editor.worker.js 445 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/
  5. /******/ // The require function
  6. /******/ function __webpack_require__(moduleId) {
  7. /******/
  8. /******/ // Check if module is in cache
  9. /******/ if(installedModules[moduleId]) {
  10. /******/ return installedModules[moduleId].exports;
  11. /******/ }
  12. /******/ // Create a new module (and put it into the cache)
  13. /******/ var module = installedModules[moduleId] = {
  14. /******/ i: moduleId,
  15. /******/ l: false,
  16. /******/ exports: {}
  17. /******/ };
  18. /******/
  19. /******/ // Execute the module function
  20. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  21. /******/
  22. /******/ // Flag the module as loaded
  23. /******/ module.l = true;
  24. /******/
  25. /******/ // Return the exports of the module
  26. /******/ return module.exports;
  27. /******/ }
  28. /******/
  29. /******/
  30. /******/ // expose the modules object (__webpack_modules__)
  31. /******/ __webpack_require__.m = modules;
  32. /******/
  33. /******/ // expose the module cache
  34. /******/ __webpack_require__.c = installedModules;
  35. /******/
  36. /******/ // define getter function for harmony exports
  37. /******/ __webpack_require__.d = function(exports, name, getter) {
  38. /******/ if(!__webpack_require__.o(exports, name)) {
  39. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  40. /******/ }
  41. /******/ };
  42. /******/
  43. /******/ // define __esModule on exports
  44. /******/ __webpack_require__.r = function(exports) {
  45. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  46. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  47. /******/ }
  48. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  49. /******/ };
  50. /******/
  51. /******/ // create a fake namespace object
  52. /******/ // mode & 1: value is a module id, require it
  53. /******/ // mode & 2: merge all properties of value into the ns
  54. /******/ // mode & 4: return value when already ns object
  55. /******/ // mode & 8|1: behave like require
  56. /******/ __webpack_require__.t = function(value, mode) {
  57. /******/ if(mode & 1) value = __webpack_require__(value);
  58. /******/ if(mode & 8) return value;
  59. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  60. /******/ var ns = Object.create(null);
  61. /******/ __webpack_require__.r(ns);
  62. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  63. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  64. /******/ return ns;
  65. /******/ };
  66. /******/
  67. /******/ // getDefaultExport function for compatibility with non-harmony modules
  68. /******/ __webpack_require__.n = function(module) {
  69. /******/ var getter = module && module.__esModule ?
  70. /******/ function getDefault() { return module['default']; } :
  71. /******/ function getModuleExports() { return module; };
  72. /******/ __webpack_require__.d(getter, 'a', getter);
  73. /******/ return getter;
  74. /******/ };
  75. /******/
  76. /******/ // Object.prototype.hasOwnProperty.call
  77. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  78. /******/
  79. /******/ // __webpack_public_path__
  80. /******/ __webpack_require__.p = "";
  81. /******/
  82. /******/
  83. /******/ // Load entry module and return exports
  84. /******/ return __webpack_require__(__webpack_require__.s = "../../node_modules/monaco-editor/esm/vs/editor/editor.worker.js");
  85. /******/ })
  86. /************************************************************************/
  87. /******/ ({
  88. /***/ "../../node_modules/monaco-editor/esm/vs/base/common/arrays.js":
  89. /*!***********************************************************************************!*\
  90. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/base/common/arrays.js ***!
  91. \***********************************************************************************/
  92. /*! exports provided: tail, tail2, equals, binarySearch, findFirstInSorted, mergeSort, groupBy, coalesce, isFalsyOrEmpty, isNonEmptyArray, distinct, distinctES6, fromSet, firstIndex, first, firstOrDefault, flatten, range, arrayInsert, pushToStart, pushToEnd, find, asArray */
  93. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  94. "use strict";
  95. __webpack_require__.r(__webpack_exports__);
  96. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tail", function() { return tail; });
  97. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tail2", function() { return tail2; });
  98. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equals", function() { return equals; });
  99. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "binarySearch", function() { return binarySearch; });
  100. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findFirstInSorted", function() { return findFirstInSorted; });
  101. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeSort", function() { return mergeSort; });
  102. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return groupBy; });
  103. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "coalesce", function() { return coalesce; });
  104. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFalsyOrEmpty", function() { return isFalsyOrEmpty; });
  105. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNonEmptyArray", function() { return isNonEmptyArray; });
  106. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return distinct; });
  107. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "distinctES6", function() { return distinctES6; });
  108. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fromSet", function() { return fromSet; });
  109. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstIndex", function() { return firstIndex; });
  110. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return first; });
  111. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstOrDefault", function() { return firstOrDefault; });
  112. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "flatten", function() { return flatten; });
  113. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return range; });
  114. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayInsert", function() { return arrayInsert; });
  115. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pushToStart", function() { return pushToStart; });
  116. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pushToEnd", function() { return pushToEnd; });
  117. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return find; });
  118. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asArray", function() { return asArray; });
  119. /**
  120. * Returns the last element of an array.
  121. * @param array The array.
  122. * @param n Which element from the end (default is zero).
  123. */
  124. function tail(array, n) {
  125. if (n === void 0) { n = 0; }
  126. return array[array.length - (1 + n)];
  127. }
  128. function tail2(arr) {
  129. if (arr.length === 0) {
  130. throw new Error('Invalid tail call');
  131. }
  132. return [arr.slice(0, arr.length - 1), arr[arr.length - 1]];
  133. }
  134. function equals(one, other, itemEquals) {
  135. if (itemEquals === void 0) { itemEquals = function (a, b) { return a === b; }; }
  136. if (one === other) {
  137. return true;
  138. }
  139. if (!one || !other) {
  140. return false;
  141. }
  142. if (one.length !== other.length) {
  143. return false;
  144. }
  145. for (var i = 0, len = one.length; i < len; i++) {
  146. if (!itemEquals(one[i], other[i])) {
  147. return false;
  148. }
  149. }
  150. return true;
  151. }
  152. function binarySearch(array, key, comparator) {
  153. var low = 0, high = array.length - 1;
  154. while (low <= high) {
  155. var mid = ((low + high) / 2) | 0;
  156. var comp = comparator(array[mid], key);
  157. if (comp < 0) {
  158. low = mid + 1;
  159. }
  160. else if (comp > 0) {
  161. high = mid - 1;
  162. }
  163. else {
  164. return mid;
  165. }
  166. }
  167. return -(low + 1);
  168. }
  169. /**
  170. * Takes a sorted array and a function p. The array is sorted in such a way that all elements where p(x) is false
  171. * are located before all elements where p(x) is true.
  172. * @returns the least x for which p(x) is true or array.length if no element fullfills the given function.
  173. */
  174. function findFirstInSorted(array, p) {
  175. var low = 0, high = array.length;
  176. if (high === 0) {
  177. return 0; // no children
  178. }
  179. while (low < high) {
  180. var mid = Math.floor((low + high) / 2);
  181. if (p(array[mid])) {
  182. high = mid;
  183. }
  184. else {
  185. low = mid + 1;
  186. }
  187. }
  188. return low;
  189. }
  190. /**
  191. * Like `Array#sort` but always stable. Usually runs a little slower `than Array#sort`
  192. * so only use this when actually needing stable sort.
  193. */
  194. function mergeSort(data, compare) {
  195. _sort(data, compare, 0, data.length - 1, []);
  196. return data;
  197. }
  198. function _merge(a, compare, lo, mid, hi, aux) {
  199. var leftIdx = lo, rightIdx = mid + 1;
  200. for (var i = lo; i <= hi; i++) {
  201. aux[i] = a[i];
  202. }
  203. for (var i = lo; i <= hi; i++) {
  204. if (leftIdx > mid) {
  205. // left side consumed
  206. a[i] = aux[rightIdx++];
  207. }
  208. else if (rightIdx > hi) {
  209. // right side consumed
  210. a[i] = aux[leftIdx++];
  211. }
  212. else if (compare(aux[rightIdx], aux[leftIdx]) < 0) {
  213. // right element is less -> comes first
  214. a[i] = aux[rightIdx++];
  215. }
  216. else {
  217. // left element comes first (less or equal)
  218. a[i] = aux[leftIdx++];
  219. }
  220. }
  221. }
  222. function _sort(a, compare, lo, hi, aux) {
  223. if (hi <= lo) {
  224. return;
  225. }
  226. var mid = lo + ((hi - lo) / 2) | 0;
  227. _sort(a, compare, lo, mid, aux);
  228. _sort(a, compare, mid + 1, hi, aux);
  229. if (compare(a[mid], a[mid + 1]) <= 0) {
  230. // left and right are sorted and if the last-left element is less
  231. // or equals than the first-right element there is nothing else
  232. // to do
  233. return;
  234. }
  235. _merge(a, compare, lo, mid, hi, aux);
  236. }
  237. function groupBy(data, compare) {
  238. var result = [];
  239. var currentGroup = undefined;
  240. for (var _i = 0, _a = mergeSort(data.slice(0), compare); _i < _a.length; _i++) {
  241. var element = _a[_i];
  242. if (!currentGroup || compare(currentGroup[0], element) !== 0) {
  243. currentGroup = [element];
  244. result.push(currentGroup);
  245. }
  246. else {
  247. currentGroup.push(element);
  248. }
  249. }
  250. return result;
  251. }
  252. /**
  253. * @returns New array with all falsy values removed. The original array IS NOT modified.
  254. */
  255. function coalesce(array) {
  256. return array.filter(function (e) { return !!e; });
  257. }
  258. /**
  259. * @returns false if the provided object is an array and not empty.
  260. */
  261. function isFalsyOrEmpty(obj) {
  262. return !Array.isArray(obj) || obj.length === 0;
  263. }
  264. function isNonEmptyArray(obj) {
  265. return Array.isArray(obj) && obj.length > 0;
  266. }
  267. /**
  268. * Removes duplicates from the given array. The optional keyFn allows to specify
  269. * how elements are checked for equalness by returning a unique string for each.
  270. */
  271. function distinct(array, keyFn) {
  272. if (!keyFn) {
  273. return array.filter(function (element, position) {
  274. return array.indexOf(element) === position;
  275. });
  276. }
  277. var seen = Object.create(null);
  278. return array.filter(function (elem) {
  279. var key = keyFn(elem);
  280. if (seen[key]) {
  281. return false;
  282. }
  283. seen[key] = true;
  284. return true;
  285. });
  286. }
  287. function distinctES6(array) {
  288. var seen = new Set();
  289. return array.filter(function (element) {
  290. if (seen.has(element)) {
  291. return false;
  292. }
  293. seen.add(element);
  294. return true;
  295. });
  296. }
  297. function fromSet(set) {
  298. var result = [];
  299. set.forEach(function (o) { return result.push(o); });
  300. return result;
  301. }
  302. function firstIndex(array, fn) {
  303. for (var i = 0; i < array.length; i++) {
  304. var element = array[i];
  305. if (fn(element)) {
  306. return i;
  307. }
  308. }
  309. return -1;
  310. }
  311. function first(array, fn, notFoundValue) {
  312. if (notFoundValue === void 0) { notFoundValue = undefined; }
  313. var index = firstIndex(array, fn);
  314. return index < 0 ? notFoundValue : array[index];
  315. }
  316. function firstOrDefault(array, notFoundValue) {
  317. return array.length > 0 ? array[0] : notFoundValue;
  318. }
  319. function flatten(arr) {
  320. var _a;
  321. return (_a = []).concat.apply(_a, arr);
  322. }
  323. function range(arg, to) {
  324. var from = typeof to === 'number' ? arg : 0;
  325. if (typeof to === 'number') {
  326. from = arg;
  327. }
  328. else {
  329. from = 0;
  330. to = arg;
  331. }
  332. var result = [];
  333. if (from <= to) {
  334. for (var i = from; i < to; i++) {
  335. result.push(i);
  336. }
  337. }
  338. else {
  339. for (var i = from; i > to; i--) {
  340. result.push(i);
  341. }
  342. }
  343. return result;
  344. }
  345. /**
  346. * Insert `insertArr` inside `target` at `insertIndex`.
  347. * Please don't touch unless you understand https://jsperf.com/inserting-an-array-within-an-array
  348. */
  349. function arrayInsert(target, insertIndex, insertArr) {
  350. var before = target.slice(0, insertIndex);
  351. var after = target.slice(insertIndex);
  352. return before.concat(insertArr, after);
  353. }
  354. /**
  355. * Pushes an element to the start of the array, if found.
  356. */
  357. function pushToStart(arr, value) {
  358. var index = arr.indexOf(value);
  359. if (index > -1) {
  360. arr.splice(index, 1);
  361. arr.unshift(value);
  362. }
  363. }
  364. /**
  365. * Pushes an element to the end of the array, if found.
  366. */
  367. function pushToEnd(arr, value) {
  368. var index = arr.indexOf(value);
  369. if (index > -1) {
  370. arr.splice(index, 1);
  371. arr.push(value);
  372. }
  373. }
  374. function find(arr, predicate) {
  375. for (var i = 0; i < arr.length; i++) {
  376. var element = arr[i];
  377. if (predicate(element, i, arr)) {
  378. return element;
  379. }
  380. }
  381. return undefined;
  382. }
  383. function asArray(x) {
  384. return Array.isArray(x) ? x : [x];
  385. }
  386. /***/ }),
  387. /***/ "../../node_modules/monaco-editor/esm/vs/base/common/cancellation.js":
  388. /*!*****************************************************************************************!*\
  389. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/base/common/cancellation.js ***!
  390. \*****************************************************************************************/
  391. /*! exports provided: CancellationToken, CancellationTokenSource */
  392. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  393. "use strict";
  394. __webpack_require__.r(__webpack_exports__);
  395. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationToken", function() { return CancellationToken; });
  396. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CancellationTokenSource", function() { return CancellationTokenSource; });
  397. /* harmony import */ var _event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event.js */ "../../node_modules/monaco-editor/esm/vs/base/common/event.js");
  398. /*---------------------------------------------------------------------------------------------
  399. * Copyright (c) Microsoft Corporation. All rights reserved.
  400. * Licensed under the MIT License. See License.txt in the project root for license information.
  401. *--------------------------------------------------------------------------------------------*/
  402. var shortcutEvent = Object.freeze(function (callback, context) {
  403. var handle = setTimeout(callback.bind(context), 0);
  404. return { dispose: function () { clearTimeout(handle); } };
  405. });
  406. var CancellationToken;
  407. (function (CancellationToken) {
  408. function isCancellationToken(thing) {
  409. if (thing === CancellationToken.None || thing === CancellationToken.Cancelled) {
  410. return true;
  411. }
  412. if (thing instanceof MutableToken) {
  413. return true;
  414. }
  415. if (!thing || typeof thing !== 'object') {
  416. return false;
  417. }
  418. return typeof thing.isCancellationRequested === 'boolean'
  419. && typeof thing.onCancellationRequested === 'function';
  420. }
  421. CancellationToken.isCancellationToken = isCancellationToken;
  422. CancellationToken.None = Object.freeze({
  423. isCancellationRequested: false,
  424. onCancellationRequested: _event_js__WEBPACK_IMPORTED_MODULE_0__["Event"].None
  425. });
  426. CancellationToken.Cancelled = Object.freeze({
  427. isCancellationRequested: true,
  428. onCancellationRequested: shortcutEvent
  429. });
  430. })(CancellationToken || (CancellationToken = {}));
  431. var MutableToken = /** @class */ (function () {
  432. function MutableToken() {
  433. this._isCancelled = false;
  434. this._emitter = null;
  435. }
  436. MutableToken.prototype.cancel = function () {
  437. if (!this._isCancelled) {
  438. this._isCancelled = true;
  439. if (this._emitter) {
  440. this._emitter.fire(undefined);
  441. this.dispose();
  442. }
  443. }
  444. };
  445. Object.defineProperty(MutableToken.prototype, "isCancellationRequested", {
  446. get: function () {
  447. return this._isCancelled;
  448. },
  449. enumerable: true,
  450. configurable: true
  451. });
  452. Object.defineProperty(MutableToken.prototype, "onCancellationRequested", {
  453. get: function () {
  454. if (this._isCancelled) {
  455. return shortcutEvent;
  456. }
  457. if (!this._emitter) {
  458. this._emitter = new _event_js__WEBPACK_IMPORTED_MODULE_0__["Emitter"]();
  459. }
  460. return this._emitter.event;
  461. },
  462. enumerable: true,
  463. configurable: true
  464. });
  465. MutableToken.prototype.dispose = function () {
  466. if (this._emitter) {
  467. this._emitter.dispose();
  468. this._emitter = null;
  469. }
  470. };
  471. return MutableToken;
  472. }());
  473. var CancellationTokenSource = /** @class */ (function () {
  474. function CancellationTokenSource(parent) {
  475. this._token = undefined;
  476. this._parentListener = undefined;
  477. this._parentListener = parent && parent.onCancellationRequested(this.cancel, this);
  478. }
  479. Object.defineProperty(CancellationTokenSource.prototype, "token", {
  480. get: function () {
  481. if (!this._token) {
  482. // be lazy and create the token only when
  483. // actually needed
  484. this._token = new MutableToken();
  485. }
  486. return this._token;
  487. },
  488. enumerable: true,
  489. configurable: true
  490. });
  491. CancellationTokenSource.prototype.cancel = function () {
  492. if (!this._token) {
  493. // save an object by returning the default
  494. // cancelled token when cancellation happens
  495. // before someone asks for the token
  496. this._token = CancellationToken.Cancelled;
  497. }
  498. else if (this._token instanceof MutableToken) {
  499. // actually cancel
  500. this._token.cancel();
  501. }
  502. };
  503. CancellationTokenSource.prototype.dispose = function (cancel) {
  504. if (cancel === void 0) { cancel = false; }
  505. if (cancel) {
  506. this.cancel();
  507. }
  508. if (this._parentListener) {
  509. this._parentListener.dispose();
  510. }
  511. if (!this._token) {
  512. // ensure to initialize with an empty token if we had none
  513. this._token = CancellationToken.None;
  514. }
  515. else if (this._token instanceof MutableToken) {
  516. // actually dispose
  517. this._token.dispose();
  518. }
  519. };
  520. return CancellationTokenSource;
  521. }());
  522. /***/ }),
  523. /***/ "../../node_modules/monaco-editor/esm/vs/base/common/diff/diff.js":
  524. /*!**************************************************************************************!*\
  525. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/base/common/diff/diff.js ***!
  526. \**************************************************************************************/
  527. /*! exports provided: StringDiffSequence, stringDiff, Debug, MyArray, LcsDiff */
  528. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  529. "use strict";
  530. __webpack_require__.r(__webpack_exports__);
  531. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StringDiffSequence", function() { return StringDiffSequence; });
  532. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringDiff", function() { return stringDiff; });
  533. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Debug", function() { return Debug; });
  534. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MyArray", function() { return MyArray; });
  535. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LcsDiff", function() { return LcsDiff; });
  536. /* harmony import */ var _diffChange_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./diffChange.js */ "../../node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js");
  537. /* harmony import */ var _hash_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../hash.js */ "../../node_modules/monaco-editor/esm/vs/base/common/hash.js");
  538. /*---------------------------------------------------------------------------------------------
  539. * Copyright (c) Microsoft Corporation. All rights reserved.
  540. * Licensed under the MIT License. See License.txt in the project root for license information.
  541. *--------------------------------------------------------------------------------------------*/
  542. var StringDiffSequence = /** @class */ (function () {
  543. function StringDiffSequence(source) {
  544. this.source = source;
  545. }
  546. StringDiffSequence.prototype.getElements = function () {
  547. var source = this.source;
  548. var characters = new Int32Array(source.length);
  549. for (var i = 0, len = source.length; i < len; i++) {
  550. characters[i] = source.charCodeAt(i);
  551. }
  552. return characters;
  553. };
  554. return StringDiffSequence;
  555. }());
  556. function stringDiff(original, modified, pretty) {
  557. return new LcsDiff(new StringDiffSequence(original), new StringDiffSequence(modified)).ComputeDiff(pretty).changes;
  558. }
  559. //
  560. // The code below has been ported from a C# implementation in VS
  561. //
  562. var Debug = /** @class */ (function () {
  563. function Debug() {
  564. }
  565. Debug.Assert = function (condition, message) {
  566. if (!condition) {
  567. throw new Error(message);
  568. }
  569. };
  570. return Debug;
  571. }());
  572. var MyArray = /** @class */ (function () {
  573. function MyArray() {
  574. }
  575. /**
  576. * Copies a range of elements from an Array starting at the specified source index and pastes
  577. * them to another Array starting at the specified destination index. The length and the indexes
  578. * are specified as 64-bit integers.
  579. * sourceArray:
  580. * The Array that contains the data to copy.
  581. * sourceIndex:
  582. * A 64-bit integer that represents the index in the sourceArray at which copying begins.
  583. * destinationArray:
  584. * The Array that receives the data.
  585. * destinationIndex:
  586. * A 64-bit integer that represents the index in the destinationArray at which storing begins.
  587. * length:
  588. * A 64-bit integer that represents the number of elements to copy.
  589. */
  590. MyArray.Copy = function (sourceArray, sourceIndex, destinationArray, destinationIndex, length) {
  591. for (var i = 0; i < length; i++) {
  592. destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];
  593. }
  594. };
  595. MyArray.Copy2 = function (sourceArray, sourceIndex, destinationArray, destinationIndex, length) {
  596. for (var i = 0; i < length; i++) {
  597. destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i];
  598. }
  599. };
  600. return MyArray;
  601. }());
  602. /**
  603. * A utility class which helps to create the set of DiffChanges from
  604. * a difference operation. This class accepts original DiffElements and
  605. * modified DiffElements that are involved in a particular change. The
  606. * MarktNextChange() method can be called to mark the separation between
  607. * distinct changes. At the end, the Changes property can be called to retrieve
  608. * the constructed changes.
  609. */
  610. var DiffChangeHelper = /** @class */ (function () {
  611. /**
  612. * Constructs a new DiffChangeHelper for the given DiffSequences.
  613. */
  614. function DiffChangeHelper() {
  615. this.m_changes = [];
  616. this.m_originalStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */;
  617. this.m_modifiedStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */;
  618. this.m_originalCount = 0;
  619. this.m_modifiedCount = 0;
  620. }
  621. /**
  622. * Marks the beginning of the next change in the set of differences.
  623. */
  624. DiffChangeHelper.prototype.MarkNextChange = function () {
  625. // Only add to the list if there is something to add
  626. if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {
  627. // Add the new change to our list
  628. this.m_changes.push(new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount));
  629. }
  630. // Reset for the next change
  631. this.m_originalCount = 0;
  632. this.m_modifiedCount = 0;
  633. this.m_originalStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */;
  634. this.m_modifiedStart = 1073741824 /* MAX_SAFE_SMALL_INTEGER */;
  635. };
  636. /**
  637. * Adds the original element at the given position to the elements
  638. * affected by the current change. The modified index gives context
  639. * to the change position with respect to the original sequence.
  640. * @param originalIndex The index of the original element to add.
  641. * @param modifiedIndex The index of the modified element that provides corresponding position in the modified sequence.
  642. */
  643. DiffChangeHelper.prototype.AddOriginalElement = function (originalIndex, modifiedIndex) {
  644. // The 'true' start index is the smallest of the ones we've seen
  645. this.m_originalStart = Math.min(this.m_originalStart, originalIndex);
  646. this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);
  647. this.m_originalCount++;
  648. };
  649. /**
  650. * Adds the modified element at the given position to the elements
  651. * affected by the current change. The original index gives context
  652. * to the change position with respect to the modified sequence.
  653. * @param originalIndex The index of the original element that provides corresponding position in the original sequence.
  654. * @param modifiedIndex The index of the modified element to add.
  655. */
  656. DiffChangeHelper.prototype.AddModifiedElement = function (originalIndex, modifiedIndex) {
  657. // The 'true' start index is the smallest of the ones we've seen
  658. this.m_originalStart = Math.min(this.m_originalStart, originalIndex);
  659. this.m_modifiedStart = Math.min(this.m_modifiedStart, modifiedIndex);
  660. this.m_modifiedCount++;
  661. };
  662. /**
  663. * Retrieves all of the changes marked by the class.
  664. */
  665. DiffChangeHelper.prototype.getChanges = function () {
  666. if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {
  667. // Finish up on whatever is left
  668. this.MarkNextChange();
  669. }
  670. return this.m_changes;
  671. };
  672. /**
  673. * Retrieves all of the changes marked by the class in the reverse order
  674. */
  675. DiffChangeHelper.prototype.getReverseChanges = function () {
  676. if (this.m_originalCount > 0 || this.m_modifiedCount > 0) {
  677. // Finish up on whatever is left
  678. this.MarkNextChange();
  679. }
  680. this.m_changes.reverse();
  681. return this.m_changes;
  682. };
  683. return DiffChangeHelper;
  684. }());
  685. /**
  686. * An implementation of the difference algorithm described in
  687. * "An O(ND) Difference Algorithm and its variations" by Eugene W. Myers
  688. */
  689. var LcsDiff = /** @class */ (function () {
  690. /**
  691. * Constructs the DiffFinder
  692. */
  693. function LcsDiff(originalSequence, modifiedSequence, continueProcessingPredicate) {
  694. if (continueProcessingPredicate === void 0) { continueProcessingPredicate = null; }
  695. this.ContinueProcessingPredicate = continueProcessingPredicate;
  696. var _a = LcsDiff._getElements(originalSequence), originalStringElements = _a[0], originalElementsOrHash = _a[1], originalHasStrings = _a[2];
  697. var _b = LcsDiff._getElements(modifiedSequence), modifiedStringElements = _b[0], modifiedElementsOrHash = _b[1], modifiedHasStrings = _b[2];
  698. this._hasStrings = (originalHasStrings && modifiedHasStrings);
  699. this._originalStringElements = originalStringElements;
  700. this._originalElementsOrHash = originalElementsOrHash;
  701. this._modifiedStringElements = modifiedStringElements;
  702. this._modifiedElementsOrHash = modifiedElementsOrHash;
  703. this.m_forwardHistory = [];
  704. this.m_reverseHistory = [];
  705. }
  706. LcsDiff._isStringArray = function (arr) {
  707. return (arr.length > 0 && typeof arr[0] === 'string');
  708. };
  709. LcsDiff._getElements = function (sequence) {
  710. var elements = sequence.getElements();
  711. if (LcsDiff._isStringArray(elements)) {
  712. var hashes = new Int32Array(elements.length);
  713. for (var i = 0, len = elements.length; i < len; i++) {
  714. hashes[i] = Object(_hash_js__WEBPACK_IMPORTED_MODULE_1__["stringHash"])(elements[i], 0);
  715. }
  716. return [elements, hashes, true];
  717. }
  718. if (elements instanceof Int32Array) {
  719. return [[], elements, false];
  720. }
  721. return [[], new Int32Array(elements), false];
  722. };
  723. LcsDiff.prototype.ElementsAreEqual = function (originalIndex, newIndex) {
  724. if (this._originalElementsOrHash[originalIndex] !== this._modifiedElementsOrHash[newIndex]) {
  725. return false;
  726. }
  727. return (this._hasStrings ? this._originalStringElements[originalIndex] === this._modifiedStringElements[newIndex] : true);
  728. };
  729. LcsDiff.prototype.OriginalElementsAreEqual = function (index1, index2) {
  730. if (this._originalElementsOrHash[index1] !== this._originalElementsOrHash[index2]) {
  731. return false;
  732. }
  733. return (this._hasStrings ? this._originalStringElements[index1] === this._originalStringElements[index2] : true);
  734. };
  735. LcsDiff.prototype.ModifiedElementsAreEqual = function (index1, index2) {
  736. if (this._modifiedElementsOrHash[index1] !== this._modifiedElementsOrHash[index2]) {
  737. return false;
  738. }
  739. return (this._hasStrings ? this._modifiedStringElements[index1] === this._modifiedStringElements[index2] : true);
  740. };
  741. LcsDiff.prototype.ComputeDiff = function (pretty) {
  742. return this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, pretty);
  743. };
  744. /**
  745. * Computes the differences between the original and modified input
  746. * sequences on the bounded range.
  747. * @returns An array of the differences between the two input sequences.
  748. */
  749. LcsDiff.prototype._ComputeDiff = function (originalStart, originalEnd, modifiedStart, modifiedEnd, pretty) {
  750. var quitEarlyArr = [false];
  751. var changes = this.ComputeDiffRecursive(originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr);
  752. if (pretty) {
  753. // We have to clean up the computed diff to be more intuitive
  754. // but it turns out this cannot be done correctly until the entire set
  755. // of diffs have been computed
  756. changes = this.PrettifyChanges(changes);
  757. }
  758. return {
  759. quitEarly: quitEarlyArr[0],
  760. changes: changes
  761. };
  762. };
  763. /**
  764. * Private helper method which computes the differences on the bounded range
  765. * recursively.
  766. * @returns An array of the differences between the two input sequences.
  767. */
  768. LcsDiff.prototype.ComputeDiffRecursive = function (originalStart, originalEnd, modifiedStart, modifiedEnd, quitEarlyArr) {
  769. quitEarlyArr[0] = false;
  770. // Find the start of the differences
  771. while (originalStart <= originalEnd && modifiedStart <= modifiedEnd && this.ElementsAreEqual(originalStart, modifiedStart)) {
  772. originalStart++;
  773. modifiedStart++;
  774. }
  775. // Find the end of the differences
  776. while (originalEnd >= originalStart && modifiedEnd >= modifiedStart && this.ElementsAreEqual(originalEnd, modifiedEnd)) {
  777. originalEnd--;
  778. modifiedEnd--;
  779. }
  780. // In the special case where we either have all insertions or all deletions or the sequences are identical
  781. if (originalStart > originalEnd || modifiedStart > modifiedEnd) {
  782. var changes = void 0;
  783. if (modifiedStart <= modifiedEnd) {
  784. Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd');
  785. // All insertions
  786. changes = [
  787. new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, 0, modifiedStart, modifiedEnd - modifiedStart + 1)
  788. ];
  789. }
  790. else if (originalStart <= originalEnd) {
  791. Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd');
  792. // All deletions
  793. changes = [
  794. new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, 0)
  795. ];
  796. }
  797. else {
  798. Debug.Assert(originalStart === originalEnd + 1, 'originalStart should only be one more than originalEnd');
  799. Debug.Assert(modifiedStart === modifiedEnd + 1, 'modifiedStart should only be one more than modifiedEnd');
  800. // Identical sequences - No differences
  801. changes = [];
  802. }
  803. return changes;
  804. }
  805. // This problem can be solved using the Divide-And-Conquer technique.
  806. var midOriginalArr = [0];
  807. var midModifiedArr = [0];
  808. var result = this.ComputeRecursionPoint(originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr);
  809. var midOriginal = midOriginalArr[0];
  810. var midModified = midModifiedArr[0];
  811. if (result !== null) {
  812. // Result is not-null when there was enough memory to compute the changes while
  813. // searching for the recursion point
  814. return result;
  815. }
  816. else if (!quitEarlyArr[0]) {
  817. // We can break the problem down recursively by finding the changes in the
  818. // First Half: (originalStart, modifiedStart) to (midOriginal, midModified)
  819. // Second Half: (midOriginal + 1, minModified + 1) to (originalEnd, modifiedEnd)
  820. // NOTE: ComputeDiff() is inclusive, therefore the second range starts on the next point
  821. var leftChanges = this.ComputeDiffRecursive(originalStart, midOriginal, modifiedStart, midModified, quitEarlyArr);
  822. var rightChanges = [];
  823. if (!quitEarlyArr[0]) {
  824. rightChanges = this.ComputeDiffRecursive(midOriginal + 1, originalEnd, midModified + 1, modifiedEnd, quitEarlyArr);
  825. }
  826. else {
  827. // We did't have time to finish the first half, so we don't have time to compute this half.
  828. // Consider the entire rest of the sequence different.
  829. rightChanges = [
  830. new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](midOriginal + 1, originalEnd - (midOriginal + 1) + 1, midModified + 1, modifiedEnd - (midModified + 1) + 1)
  831. ];
  832. }
  833. return this.ConcatenateChanges(leftChanges, rightChanges);
  834. }
  835. // If we hit here, we quit early, and so can't return anything meaningful
  836. return [
  837. new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)
  838. ];
  839. };
  840. LcsDiff.prototype.WALKTRACE = function (diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr) {
  841. var forwardChanges = null;
  842. var reverseChanges = null;
  843. // First, walk backward through the forward diagonals history
  844. var changeHelper = new DiffChangeHelper();
  845. var diagonalMin = diagonalForwardStart;
  846. var diagonalMax = diagonalForwardEnd;
  847. var diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalForwardOffset;
  848. var lastOriginalIndex = -1073741824 /* MIN_SAFE_SMALL_INTEGER */;
  849. var historyIndex = this.m_forwardHistory.length - 1;
  850. do {
  851. // Get the diagonal index from the relative diagonal number
  852. var diagonal = diagonalRelative + diagonalForwardBase;
  853. // Figure out where we came from
  854. if (diagonal === diagonalMin || (diagonal < diagonalMax && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) {
  855. // Vertical line (the element is an insert)
  856. originalIndex = forwardPoints[diagonal + 1];
  857. modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;
  858. if (originalIndex < lastOriginalIndex) {
  859. changeHelper.MarkNextChange();
  860. }
  861. lastOriginalIndex = originalIndex;
  862. changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex);
  863. diagonalRelative = (diagonal + 1) - diagonalForwardBase; //Setup for the next iteration
  864. }
  865. else {
  866. // Horizontal line (the element is a deletion)
  867. originalIndex = forwardPoints[diagonal - 1] + 1;
  868. modifiedIndex = originalIndex - diagonalRelative - diagonalForwardOffset;
  869. if (originalIndex < lastOriginalIndex) {
  870. changeHelper.MarkNextChange();
  871. }
  872. lastOriginalIndex = originalIndex - 1;
  873. changeHelper.AddOriginalElement(originalIndex, modifiedIndex + 1);
  874. diagonalRelative = (diagonal - 1) - diagonalForwardBase; //Setup for the next iteration
  875. }
  876. if (historyIndex >= 0) {
  877. forwardPoints = this.m_forwardHistory[historyIndex];
  878. diagonalForwardBase = forwardPoints[0]; //We stored this in the first spot
  879. diagonalMin = 1;
  880. diagonalMax = forwardPoints.length - 1;
  881. }
  882. } while (--historyIndex >= -1);
  883. // Ironically, we get the forward changes as the reverse of the
  884. // order we added them since we technically added them backwards
  885. forwardChanges = changeHelper.getReverseChanges();
  886. if (quitEarlyArr[0]) {
  887. // TODO: Calculate a partial from the reverse diagonals.
  888. // For now, just assume everything after the midOriginal/midModified point is a diff
  889. var originalStartPoint = midOriginalArr[0] + 1;
  890. var modifiedStartPoint = midModifiedArr[0] + 1;
  891. if (forwardChanges !== null && forwardChanges.length > 0) {
  892. var lastForwardChange = forwardChanges[forwardChanges.length - 1];
  893. originalStartPoint = Math.max(originalStartPoint, lastForwardChange.getOriginalEnd());
  894. modifiedStartPoint = Math.max(modifiedStartPoint, lastForwardChange.getModifiedEnd());
  895. }
  896. reverseChanges = [
  897. new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStartPoint, originalEnd - originalStartPoint + 1, modifiedStartPoint, modifiedEnd - modifiedStartPoint + 1)
  898. ];
  899. }
  900. else {
  901. // Now walk backward through the reverse diagonals history
  902. changeHelper = new DiffChangeHelper();
  903. diagonalMin = diagonalReverseStart;
  904. diagonalMax = diagonalReverseEnd;
  905. diagonalRelative = (midOriginalArr[0] - midModifiedArr[0]) - diagonalReverseOffset;
  906. lastOriginalIndex = 1073741824 /* MAX_SAFE_SMALL_INTEGER */;
  907. historyIndex = (deltaIsEven) ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2;
  908. do {
  909. // Get the diagonal index from the relative diagonal number
  910. var diagonal = diagonalRelative + diagonalReverseBase;
  911. // Figure out where we came from
  912. if (diagonal === diagonalMin || (diagonal < diagonalMax && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) {
  913. // Horizontal line (the element is a deletion))
  914. originalIndex = reversePoints[diagonal + 1] - 1;
  915. modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;
  916. if (originalIndex > lastOriginalIndex) {
  917. changeHelper.MarkNextChange();
  918. }
  919. lastOriginalIndex = originalIndex + 1;
  920. changeHelper.AddOriginalElement(originalIndex + 1, modifiedIndex + 1);
  921. diagonalRelative = (diagonal + 1) - diagonalReverseBase; //Setup for the next iteration
  922. }
  923. else {
  924. // Vertical line (the element is an insertion)
  925. originalIndex = reversePoints[diagonal - 1];
  926. modifiedIndex = originalIndex - diagonalRelative - diagonalReverseOffset;
  927. if (originalIndex > lastOriginalIndex) {
  928. changeHelper.MarkNextChange();
  929. }
  930. lastOriginalIndex = originalIndex;
  931. changeHelper.AddModifiedElement(originalIndex + 1, modifiedIndex + 1);
  932. diagonalRelative = (diagonal - 1) - diagonalReverseBase; //Setup for the next iteration
  933. }
  934. if (historyIndex >= 0) {
  935. reversePoints = this.m_reverseHistory[historyIndex];
  936. diagonalReverseBase = reversePoints[0]; //We stored this in the first spot
  937. diagonalMin = 1;
  938. diagonalMax = reversePoints.length - 1;
  939. }
  940. } while (--historyIndex >= -1);
  941. // There are cases where the reverse history will find diffs that
  942. // are correct, but not intuitive, so we need shift them.
  943. reverseChanges = changeHelper.getChanges();
  944. }
  945. return this.ConcatenateChanges(forwardChanges, reverseChanges);
  946. };
  947. /**
  948. * Given the range to compute the diff on, this method finds the point:
  949. * (midOriginal, midModified)
  950. * that exists in the middle of the LCS of the two sequences and
  951. * is the point at which the LCS problem may be broken down recursively.
  952. * This method will try to keep the LCS trace in memory. If the LCS recursion
  953. * point is calculated and the full trace is available in memory, then this method
  954. * will return the change list.
  955. * @param originalStart The start bound of the original sequence range
  956. * @param originalEnd The end bound of the original sequence range
  957. * @param modifiedStart The start bound of the modified sequence range
  958. * @param modifiedEnd The end bound of the modified sequence range
  959. * @param midOriginal The middle point of the original sequence range
  960. * @param midModified The middle point of the modified sequence range
  961. * @returns The diff changes, if available, otherwise null
  962. */
  963. LcsDiff.prototype.ComputeRecursionPoint = function (originalStart, originalEnd, modifiedStart, modifiedEnd, midOriginalArr, midModifiedArr, quitEarlyArr) {
  964. var originalIndex = 0, modifiedIndex = 0;
  965. var diagonalForwardStart = 0, diagonalForwardEnd = 0;
  966. var diagonalReverseStart = 0, diagonalReverseEnd = 0;
  967. // To traverse the edit graph and produce the proper LCS, our actual
  968. // start position is just outside the given boundary
  969. originalStart--;
  970. modifiedStart--;
  971. // We set these up to make the compiler happy, but they will
  972. // be replaced before we return with the actual recursion point
  973. midOriginalArr[0] = 0;
  974. midModifiedArr[0] = 0;
  975. // Clear out the history
  976. this.m_forwardHistory = [];
  977. this.m_reverseHistory = [];
  978. // Each cell in the two arrays corresponds to a diagonal in the edit graph.
  979. // The integer value in the cell represents the originalIndex of the furthest
  980. // reaching point found so far that ends in that diagonal.
  981. // The modifiedIndex can be computed mathematically from the originalIndex and the diagonal number.
  982. var maxDifferences = (originalEnd - originalStart) + (modifiedEnd - modifiedStart);
  983. var numDiagonals = maxDifferences + 1;
  984. var forwardPoints = new Int32Array(numDiagonals);
  985. var reversePoints = new Int32Array(numDiagonals);
  986. // diagonalForwardBase: Index into forwardPoints of the diagonal which passes through (originalStart, modifiedStart)
  987. // diagonalReverseBase: Index into reversePoints of the diagonal which passes through (originalEnd, modifiedEnd)
  988. var diagonalForwardBase = (modifiedEnd - modifiedStart);
  989. var diagonalReverseBase = (originalEnd - originalStart);
  990. // diagonalForwardOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the
  991. // diagonal number (relative to diagonalForwardBase)
  992. // diagonalReverseOffset: Geometric offset which allows modifiedIndex to be computed from originalIndex and the
  993. // diagonal number (relative to diagonalReverseBase)
  994. var diagonalForwardOffset = (originalStart - modifiedStart);
  995. var diagonalReverseOffset = (originalEnd - modifiedEnd);
  996. // delta: The difference between the end diagonal and the start diagonal. This is used to relate diagonal numbers
  997. // relative to the start diagonal with diagonal numbers relative to the end diagonal.
  998. // The Even/Oddn-ness of this delta is important for determining when we should check for overlap
  999. var delta = diagonalReverseBase - diagonalForwardBase;
  1000. var deltaIsEven = (delta % 2 === 0);
  1001. // Here we set up the start and end points as the furthest points found so far
  1002. // in both the forward and reverse directions, respectively
  1003. forwardPoints[diagonalForwardBase] = originalStart;
  1004. reversePoints[diagonalReverseBase] = originalEnd;
  1005. // Remember if we quit early, and thus need to do a best-effort result instead of a real result.
  1006. quitEarlyArr[0] = false;
  1007. // A couple of points:
  1008. // --With this method, we iterate on the number of differences between the two sequences.
  1009. // The more differences there actually are, the longer this will take.
  1010. // --Also, as the number of differences increases, we have to search on diagonals further
  1011. // away from the reference diagonal (which is diagonalForwardBase for forward, diagonalReverseBase for reverse).
  1012. // --We extend on even diagonals (relative to the reference diagonal) only when numDifferences
  1013. // is even and odd diagonals only when numDifferences is odd.
  1014. for (var numDifferences = 1; numDifferences <= (maxDifferences / 2) + 1; numDifferences++) {
  1015. var furthestOriginalIndex = 0;
  1016. var furthestModifiedIndex = 0;
  1017. // Run the algorithm in the forward direction
  1018. diagonalForwardStart = this.ClipDiagonalBound(diagonalForwardBase - numDifferences, numDifferences, diagonalForwardBase, numDiagonals);
  1019. diagonalForwardEnd = this.ClipDiagonalBound(diagonalForwardBase + numDifferences, numDifferences, diagonalForwardBase, numDiagonals);
  1020. for (var diagonal = diagonalForwardStart; diagonal <= diagonalForwardEnd; diagonal += 2) {
  1021. // STEP 1: We extend the furthest reaching point in the present diagonal
  1022. // by looking at the diagonals above and below and picking the one whose point
  1023. // is further away from the start point (originalStart, modifiedStart)
  1024. if (diagonal === diagonalForwardStart || (diagonal < diagonalForwardEnd && forwardPoints[diagonal - 1] < forwardPoints[diagonal + 1])) {
  1025. originalIndex = forwardPoints[diagonal + 1];
  1026. }
  1027. else {
  1028. originalIndex = forwardPoints[diagonal - 1] + 1;
  1029. }
  1030. modifiedIndex = originalIndex - (diagonal - diagonalForwardBase) - diagonalForwardOffset;
  1031. // Save the current originalIndex so we can test for false overlap in step 3
  1032. var tempOriginalIndex = originalIndex;
  1033. // STEP 2: We can continue to extend the furthest reaching point in the present diagonal
  1034. // so long as the elements are equal.
  1035. while (originalIndex < originalEnd && modifiedIndex < modifiedEnd && this.ElementsAreEqual(originalIndex + 1, modifiedIndex + 1)) {
  1036. originalIndex++;
  1037. modifiedIndex++;
  1038. }
  1039. forwardPoints[diagonal] = originalIndex;
  1040. if (originalIndex + modifiedIndex > furthestOriginalIndex + furthestModifiedIndex) {
  1041. furthestOriginalIndex = originalIndex;
  1042. furthestModifiedIndex = modifiedIndex;
  1043. }
  1044. // STEP 3: If delta is odd (overlap first happens on forward when delta is odd)
  1045. // and diagonal is in the range of reverse diagonals computed for numDifferences-1
  1046. // (the previous iteration; we haven't computed reverse diagonals for numDifferences yet)
  1047. // then check for overlap.
  1048. if (!deltaIsEven && Math.abs(diagonal - diagonalReverseBase) <= (numDifferences - 1)) {
  1049. if (originalIndex >= reversePoints[diagonal]) {
  1050. midOriginalArr[0] = originalIndex;
  1051. midModifiedArr[0] = modifiedIndex;
  1052. if (tempOriginalIndex <= reversePoints[diagonal] && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) {
  1053. // BINGO! We overlapped, and we have the full trace in memory!
  1054. return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
  1055. }
  1056. else {
  1057. // Either false overlap, or we didn't have enough memory for the full trace
  1058. // Just return the recursion point
  1059. return null;
  1060. }
  1061. }
  1062. }
  1063. }
  1064. // Check to see if we should be quitting early, before moving on to the next iteration.
  1065. var matchLengthOfLongest = ((furthestOriginalIndex - originalStart) + (furthestModifiedIndex - modifiedStart) - numDifferences) / 2;
  1066. if (this.ContinueProcessingPredicate !== null && !this.ContinueProcessingPredicate(furthestOriginalIndex, matchLengthOfLongest)) {
  1067. // We can't finish, so skip ahead to generating a result from what we have.
  1068. quitEarlyArr[0] = true;
  1069. // Use the furthest distance we got in the forward direction.
  1070. midOriginalArr[0] = furthestOriginalIndex;
  1071. midModifiedArr[0] = furthestModifiedIndex;
  1072. if (matchLengthOfLongest > 0 && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) {
  1073. // Enough of the history is in memory to walk it backwards
  1074. return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
  1075. }
  1076. else {
  1077. // We didn't actually remember enough of the history.
  1078. //Since we are quiting the diff early, we need to shift back the originalStart and modified start
  1079. //back into the boundary limits since we decremented their value above beyond the boundary limit.
  1080. originalStart++;
  1081. modifiedStart++;
  1082. return [
  1083. new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalEnd - originalStart + 1, modifiedStart, modifiedEnd - modifiedStart + 1)
  1084. ];
  1085. }
  1086. }
  1087. // Run the algorithm in the reverse direction
  1088. diagonalReverseStart = this.ClipDiagonalBound(diagonalReverseBase - numDifferences, numDifferences, diagonalReverseBase, numDiagonals);
  1089. diagonalReverseEnd = this.ClipDiagonalBound(diagonalReverseBase + numDifferences, numDifferences, diagonalReverseBase, numDiagonals);
  1090. for (var diagonal = diagonalReverseStart; diagonal <= diagonalReverseEnd; diagonal += 2) {
  1091. // STEP 1: We extend the furthest reaching point in the present diagonal
  1092. // by looking at the diagonals above and below and picking the one whose point
  1093. // is further away from the start point (originalEnd, modifiedEnd)
  1094. if (diagonal === diagonalReverseStart || (diagonal < diagonalReverseEnd && reversePoints[diagonal - 1] >= reversePoints[diagonal + 1])) {
  1095. originalIndex = reversePoints[diagonal + 1] - 1;
  1096. }
  1097. else {
  1098. originalIndex = reversePoints[diagonal - 1];
  1099. }
  1100. modifiedIndex = originalIndex - (diagonal - diagonalReverseBase) - diagonalReverseOffset;
  1101. // Save the current originalIndex so we can test for false overlap
  1102. var tempOriginalIndex = originalIndex;
  1103. // STEP 2: We can continue to extend the furthest reaching point in the present diagonal
  1104. // as long as the elements are equal.
  1105. while (originalIndex > originalStart && modifiedIndex > modifiedStart && this.ElementsAreEqual(originalIndex, modifiedIndex)) {
  1106. originalIndex--;
  1107. modifiedIndex--;
  1108. }
  1109. reversePoints[diagonal] = originalIndex;
  1110. // STEP 4: If delta is even (overlap first happens on reverse when delta is even)
  1111. // and diagonal is in the range of forward diagonals computed for numDifferences
  1112. // then check for overlap.
  1113. if (deltaIsEven && Math.abs(diagonal - diagonalForwardBase) <= numDifferences) {
  1114. if (originalIndex <= forwardPoints[diagonal]) {
  1115. midOriginalArr[0] = originalIndex;
  1116. midModifiedArr[0] = modifiedIndex;
  1117. if (tempOriginalIndex >= forwardPoints[diagonal] && 1447 /* MaxDifferencesHistory */ > 0 && numDifferences <= (1447 /* MaxDifferencesHistory */ + 1)) {
  1118. // BINGO! We overlapped, and we have the full trace in memory!
  1119. return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
  1120. }
  1121. else {
  1122. // Either false overlap, or we didn't have enough memory for the full trace
  1123. // Just return the recursion point
  1124. return null;
  1125. }
  1126. }
  1127. }
  1128. }
  1129. // Save current vectors to history before the next iteration
  1130. if (numDifferences <= 1447 /* MaxDifferencesHistory */) {
  1131. // We are allocating space for one extra int, which we fill with
  1132. // the index of the diagonal base index
  1133. var temp = new Int32Array(diagonalForwardEnd - diagonalForwardStart + 2);
  1134. temp[0] = diagonalForwardBase - diagonalForwardStart + 1;
  1135. MyArray.Copy2(forwardPoints, diagonalForwardStart, temp, 1, diagonalForwardEnd - diagonalForwardStart + 1);
  1136. this.m_forwardHistory.push(temp);
  1137. temp = new Int32Array(diagonalReverseEnd - diagonalReverseStart + 2);
  1138. temp[0] = diagonalReverseBase - diagonalReverseStart + 1;
  1139. MyArray.Copy2(reversePoints, diagonalReverseStart, temp, 1, diagonalReverseEnd - diagonalReverseStart + 1);
  1140. this.m_reverseHistory.push(temp);
  1141. }
  1142. }
  1143. // If we got here, then we have the full trace in history. We just have to convert it to a change list
  1144. // NOTE: This part is a bit messy
  1145. return this.WALKTRACE(diagonalForwardBase, diagonalForwardStart, diagonalForwardEnd, diagonalForwardOffset, diagonalReverseBase, diagonalReverseStart, diagonalReverseEnd, diagonalReverseOffset, forwardPoints, reversePoints, originalIndex, originalEnd, midOriginalArr, modifiedIndex, modifiedEnd, midModifiedArr, deltaIsEven, quitEarlyArr);
  1146. };
  1147. /**
  1148. * Shifts the given changes to provide a more intuitive diff.
  1149. * While the first element in a diff matches the first element after the diff,
  1150. * we shift the diff down.
  1151. *
  1152. * @param changes The list of changes to shift
  1153. * @returns The shifted changes
  1154. */
  1155. LcsDiff.prototype.PrettifyChanges = function (changes) {
  1156. // Shift all the changes down first
  1157. for (var i = 0; i < changes.length; i++) {
  1158. var change = changes[i];
  1159. var originalStop = (i < changes.length - 1) ? changes[i + 1].originalStart : this._originalElementsOrHash.length;
  1160. var modifiedStop = (i < changes.length - 1) ? changes[i + 1].modifiedStart : this._modifiedElementsOrHash.length;
  1161. var checkOriginal = change.originalLength > 0;
  1162. var checkModified = change.modifiedLength > 0;
  1163. while (change.originalStart + change.originalLength < originalStop &&
  1164. change.modifiedStart + change.modifiedLength < modifiedStop &&
  1165. (!checkOriginal || this.OriginalElementsAreEqual(change.originalStart, change.originalStart + change.originalLength)) &&
  1166. (!checkModified || this.ModifiedElementsAreEqual(change.modifiedStart, change.modifiedStart + change.modifiedLength))) {
  1167. change.originalStart++;
  1168. change.modifiedStart++;
  1169. }
  1170. var mergedChangeArr = [null];
  1171. if (i < changes.length - 1 && this.ChangesOverlap(changes[i], changes[i + 1], mergedChangeArr)) {
  1172. changes[i] = mergedChangeArr[0];
  1173. changes.splice(i + 1, 1);
  1174. i--;
  1175. continue;
  1176. }
  1177. }
  1178. // Shift changes back up until we hit empty or whitespace-only lines
  1179. for (var i = changes.length - 1; i >= 0; i--) {
  1180. var change = changes[i];
  1181. var originalStop = 0;
  1182. var modifiedStop = 0;
  1183. if (i > 0) {
  1184. var prevChange = changes[i - 1];
  1185. if (prevChange.originalLength > 0) {
  1186. originalStop = prevChange.originalStart + prevChange.originalLength;
  1187. }
  1188. if (prevChange.modifiedLength > 0) {
  1189. modifiedStop = prevChange.modifiedStart + prevChange.modifiedLength;
  1190. }
  1191. }
  1192. var checkOriginal = change.originalLength > 0;
  1193. var checkModified = change.modifiedLength > 0;
  1194. var bestDelta = 0;
  1195. var bestScore = this._boundaryScore(change.originalStart, change.originalLength, change.modifiedStart, change.modifiedLength);
  1196. for (var delta = 1;; delta++) {
  1197. var originalStart = change.originalStart - delta;
  1198. var modifiedStart = change.modifiedStart - delta;
  1199. if (originalStart < originalStop || modifiedStart < modifiedStop) {
  1200. break;
  1201. }
  1202. if (checkOriginal && !this.OriginalElementsAreEqual(originalStart, originalStart + change.originalLength)) {
  1203. break;
  1204. }
  1205. if (checkModified && !this.ModifiedElementsAreEqual(modifiedStart, modifiedStart + change.modifiedLength)) {
  1206. break;
  1207. }
  1208. var score = this._boundaryScore(originalStart, change.originalLength, modifiedStart, change.modifiedLength);
  1209. if (score > bestScore) {
  1210. bestScore = score;
  1211. bestDelta = delta;
  1212. }
  1213. }
  1214. change.originalStart -= bestDelta;
  1215. change.modifiedStart -= bestDelta;
  1216. }
  1217. return changes;
  1218. };
  1219. LcsDiff.prototype._OriginalIsBoundary = function (index) {
  1220. if (index <= 0 || index >= this._originalElementsOrHash.length - 1) {
  1221. return true;
  1222. }
  1223. return (this._hasStrings && /^\s*$/.test(this._originalStringElements[index]));
  1224. };
  1225. LcsDiff.prototype._OriginalRegionIsBoundary = function (originalStart, originalLength) {
  1226. if (this._OriginalIsBoundary(originalStart) || this._OriginalIsBoundary(originalStart - 1)) {
  1227. return true;
  1228. }
  1229. if (originalLength > 0) {
  1230. var originalEnd = originalStart + originalLength;
  1231. if (this._OriginalIsBoundary(originalEnd - 1) || this._OriginalIsBoundary(originalEnd)) {
  1232. return true;
  1233. }
  1234. }
  1235. return false;
  1236. };
  1237. LcsDiff.prototype._ModifiedIsBoundary = function (index) {
  1238. if (index <= 0 || index >= this._modifiedElementsOrHash.length - 1) {
  1239. return true;
  1240. }
  1241. return (this._hasStrings && /^\s*$/.test(this._modifiedStringElements[index]));
  1242. };
  1243. LcsDiff.prototype._ModifiedRegionIsBoundary = function (modifiedStart, modifiedLength) {
  1244. if (this._ModifiedIsBoundary(modifiedStart) || this._ModifiedIsBoundary(modifiedStart - 1)) {
  1245. return true;
  1246. }
  1247. if (modifiedLength > 0) {
  1248. var modifiedEnd = modifiedStart + modifiedLength;
  1249. if (this._ModifiedIsBoundary(modifiedEnd - 1) || this._ModifiedIsBoundary(modifiedEnd)) {
  1250. return true;
  1251. }
  1252. }
  1253. return false;
  1254. };
  1255. LcsDiff.prototype._boundaryScore = function (originalStart, originalLength, modifiedStart, modifiedLength) {
  1256. var originalScore = (this._OriginalRegionIsBoundary(originalStart, originalLength) ? 1 : 0);
  1257. var modifiedScore = (this._ModifiedRegionIsBoundary(modifiedStart, modifiedLength) ? 1 : 0);
  1258. return (originalScore + modifiedScore);
  1259. };
  1260. /**
  1261. * Concatenates the two input DiffChange lists and returns the resulting
  1262. * list.
  1263. * @param The left changes
  1264. * @param The right changes
  1265. * @returns The concatenated list
  1266. */
  1267. LcsDiff.prototype.ConcatenateChanges = function (left, right) {
  1268. var mergedChangeArr = [];
  1269. if (left.length === 0 || right.length === 0) {
  1270. return (right.length > 0) ? right : left;
  1271. }
  1272. else if (this.ChangesOverlap(left[left.length - 1], right[0], mergedChangeArr)) {
  1273. // Since we break the problem down recursively, it is possible that we
  1274. // might recurse in the middle of a change thereby splitting it into
  1275. // two changes. Here in the combining stage, we detect and fuse those
  1276. // changes back together
  1277. var result = new Array(left.length + right.length - 1);
  1278. MyArray.Copy(left, 0, result, 0, left.length - 1);
  1279. result[left.length - 1] = mergedChangeArr[0];
  1280. MyArray.Copy(right, 1, result, left.length, right.length - 1);
  1281. return result;
  1282. }
  1283. else {
  1284. var result = new Array(left.length + right.length);
  1285. MyArray.Copy(left, 0, result, 0, left.length);
  1286. MyArray.Copy(right, 0, result, left.length, right.length);
  1287. return result;
  1288. }
  1289. };
  1290. /**
  1291. * Returns true if the two changes overlap and can be merged into a single
  1292. * change
  1293. * @param left The left change
  1294. * @param right The right change
  1295. * @param mergedChange The merged change if the two overlap, null otherwise
  1296. * @returns True if the two changes overlap
  1297. */
  1298. LcsDiff.prototype.ChangesOverlap = function (left, right, mergedChangeArr) {
  1299. Debug.Assert(left.originalStart <= right.originalStart, 'Left change is not less than or equal to right change');
  1300. Debug.Assert(left.modifiedStart <= right.modifiedStart, 'Left change is not less than or equal to right change');
  1301. if (left.originalStart + left.originalLength >= right.originalStart || left.modifiedStart + left.modifiedLength >= right.modifiedStart) {
  1302. var originalStart = left.originalStart;
  1303. var originalLength = left.originalLength;
  1304. var modifiedStart = left.modifiedStart;
  1305. var modifiedLength = left.modifiedLength;
  1306. if (left.originalStart + left.originalLength >= right.originalStart) {
  1307. originalLength = right.originalStart + right.originalLength - left.originalStart;
  1308. }
  1309. if (left.modifiedStart + left.modifiedLength >= right.modifiedStart) {
  1310. modifiedLength = right.modifiedStart + right.modifiedLength - left.modifiedStart;
  1311. }
  1312. mergedChangeArr[0] = new _diffChange_js__WEBPACK_IMPORTED_MODULE_0__["DiffChange"](originalStart, originalLength, modifiedStart, modifiedLength);
  1313. return true;
  1314. }
  1315. else {
  1316. mergedChangeArr[0] = null;
  1317. return false;
  1318. }
  1319. };
  1320. /**
  1321. * Helper method used to clip a diagonal index to the range of valid
  1322. * diagonals. This also decides whether or not the diagonal index,
  1323. * if it exceeds the boundary, should be clipped to the boundary or clipped
  1324. * one inside the boundary depending on the Even/Odd status of the boundary
  1325. * and numDifferences.
  1326. * @param diagonal The index of the diagonal to clip.
  1327. * @param numDifferences The current number of differences being iterated upon.
  1328. * @param diagonalBaseIndex The base reference diagonal.
  1329. * @param numDiagonals The total number of diagonals.
  1330. * @returns The clipped diagonal index.
  1331. */
  1332. LcsDiff.prototype.ClipDiagonalBound = function (diagonal, numDifferences, diagonalBaseIndex, numDiagonals) {
  1333. if (diagonal >= 0 && diagonal < numDiagonals) {
  1334. // Nothing to clip, its in range
  1335. return diagonal;
  1336. }
  1337. // diagonalsBelow: The number of diagonals below the reference diagonal
  1338. // diagonalsAbove: The number of diagonals above the reference diagonal
  1339. var diagonalsBelow = diagonalBaseIndex;
  1340. var diagonalsAbove = numDiagonals - diagonalBaseIndex - 1;
  1341. var diffEven = (numDifferences % 2 === 0);
  1342. if (diagonal < 0) {
  1343. var lowerBoundEven = (diagonalsBelow % 2 === 0);
  1344. return (diffEven === lowerBoundEven) ? 0 : 1;
  1345. }
  1346. else {
  1347. var upperBoundEven = (diagonalsAbove % 2 === 0);
  1348. return (diffEven === upperBoundEven) ? numDiagonals - 1 : numDiagonals - 2;
  1349. }
  1350. };
  1351. return LcsDiff;
  1352. }());
  1353. /***/ }),
  1354. /***/ "../../node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js":
  1355. /*!********************************************************************************************!*\
  1356. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js ***!
  1357. \********************************************************************************************/
  1358. /*! exports provided: DiffChange */
  1359. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1360. "use strict";
  1361. __webpack_require__.r(__webpack_exports__);
  1362. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffChange", function() { return DiffChange; });
  1363. /*---------------------------------------------------------------------------------------------
  1364. * Copyright (c) Microsoft Corporation. All rights reserved.
  1365. * Licensed under the MIT License. See License.txt in the project root for license information.
  1366. *--------------------------------------------------------------------------------------------*/
  1367. /**
  1368. * Represents information about a specific difference between two sequences.
  1369. */
  1370. var DiffChange = /** @class */ (function () {
  1371. /**
  1372. * Constructs a new DiffChange with the given sequence information
  1373. * and content.
  1374. */
  1375. function DiffChange(originalStart, originalLength, modifiedStart, modifiedLength) {
  1376. //Debug.Assert(originalLength > 0 || modifiedLength > 0, "originalLength and modifiedLength cannot both be <= 0");
  1377. this.originalStart = originalStart;
  1378. this.originalLength = originalLength;
  1379. this.modifiedStart = modifiedStart;
  1380. this.modifiedLength = modifiedLength;
  1381. }
  1382. /**
  1383. * The end point (exclusive) of the change in the original sequence.
  1384. */
  1385. DiffChange.prototype.getOriginalEnd = function () {
  1386. return this.originalStart + this.originalLength;
  1387. };
  1388. /**
  1389. * The end point (exclusive) of the change in the modified sequence.
  1390. */
  1391. DiffChange.prototype.getModifiedEnd = function () {
  1392. return this.modifiedStart + this.modifiedLength;
  1393. };
  1394. return DiffChange;
  1395. }());
  1396. /***/ }),
  1397. /***/ "../../node_modules/monaco-editor/esm/vs/base/common/errors.js":
  1398. /*!***********************************************************************************!*\
  1399. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/base/common/errors.js ***!
  1400. \***********************************************************************************/
  1401. /*! exports provided: ErrorHandler, errorHandler, onUnexpectedError, onUnexpectedExternalError, transformErrorForSerialization, isPromiseCanceledError, canceled, illegalArgument, illegalState */
  1402. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1403. "use strict";
  1404. __webpack_require__.r(__webpack_exports__);
  1405. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ErrorHandler", function() { return ErrorHandler; });
  1406. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "errorHandler", function() { return errorHandler; });
  1407. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onUnexpectedError", function() { return onUnexpectedError; });
  1408. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onUnexpectedExternalError", function() { return onUnexpectedExternalError; });
  1409. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transformErrorForSerialization", function() { return transformErrorForSerialization; });
  1410. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isPromiseCanceledError", function() { return isPromiseCanceledError; });
  1411. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canceled", function() { return canceled; });
  1412. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "illegalArgument", function() { return illegalArgument; });
  1413. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "illegalState", function() { return illegalState; });
  1414. /*---------------------------------------------------------------------------------------------
  1415. * Copyright (c) Microsoft Corporation. All rights reserved.
  1416. * Licensed under the MIT License. See License.txt in the project root for license information.
  1417. *--------------------------------------------------------------------------------------------*/
  1418. // Avoid circular dependency on EventEmitter by implementing a subset of the interface.
  1419. var ErrorHandler = /** @class */ (function () {
  1420. function ErrorHandler() {
  1421. this.listeners = [];
  1422. this.unexpectedErrorHandler = function (e) {
  1423. setTimeout(function () {
  1424. if (e.stack) {
  1425. throw new Error(e.message + '\n\n' + e.stack);
  1426. }
  1427. throw e;
  1428. }, 0);
  1429. };
  1430. }
  1431. ErrorHandler.prototype.emit = function (e) {
  1432. this.listeners.forEach(function (listener) {
  1433. listener(e);
  1434. });
  1435. };
  1436. ErrorHandler.prototype.onUnexpectedError = function (e) {
  1437. this.unexpectedErrorHandler(e);
  1438. this.emit(e);
  1439. };
  1440. // For external errors, we don't want the listeners to be called
  1441. ErrorHandler.prototype.onUnexpectedExternalError = function (e) {
  1442. this.unexpectedErrorHandler(e);
  1443. };
  1444. return ErrorHandler;
  1445. }());
  1446. var errorHandler = new ErrorHandler();
  1447. function onUnexpectedError(e) {
  1448. // ignore errors from cancelled promises
  1449. if (!isPromiseCanceledError(e)) {
  1450. errorHandler.onUnexpectedError(e);
  1451. }
  1452. return undefined;
  1453. }
  1454. function onUnexpectedExternalError(e) {
  1455. // ignore errors from cancelled promises
  1456. if (!isPromiseCanceledError(e)) {
  1457. errorHandler.onUnexpectedExternalError(e);
  1458. }
  1459. return undefined;
  1460. }
  1461. function transformErrorForSerialization(error) {
  1462. if (error instanceof Error) {
  1463. var name_1 = error.name, message = error.message;
  1464. var stack = error.stacktrace || error.stack;
  1465. return {
  1466. $isError: true,
  1467. name: name_1,
  1468. message: message,
  1469. stack: stack
  1470. };
  1471. }
  1472. // return as is
  1473. return error;
  1474. }
  1475. var canceledName = 'Canceled';
  1476. /**
  1477. * Checks if the given error is a promise in canceled state
  1478. */
  1479. function isPromiseCanceledError(error) {
  1480. return error instanceof Error && error.name === canceledName && error.message === canceledName;
  1481. }
  1482. /**
  1483. * Returns an error that signals cancellation.
  1484. */
  1485. function canceled() {
  1486. var error = new Error(canceledName);
  1487. error.name = error.message;
  1488. return error;
  1489. }
  1490. function illegalArgument(name) {
  1491. if (name) {
  1492. return new Error("Illegal argument: " + name);
  1493. }
  1494. else {
  1495. return new Error('Illegal argument');
  1496. }
  1497. }
  1498. function illegalState(name) {
  1499. if (name) {
  1500. return new Error("Illegal state: " + name);
  1501. }
  1502. else {
  1503. return new Error('Illegal state');
  1504. }
  1505. }
  1506. /***/ }),
  1507. /***/ "../../node_modules/monaco-editor/esm/vs/base/common/event.js":
  1508. /*!**********************************************************************************!*\
  1509. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/base/common/event.js ***!
  1510. \**********************************************************************************/
  1511. /*! exports provided: Event, Emitter, PauseableEmitter, EventMultiplexer, EventBufferer, Relay */
  1512. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1513. "use strict";
  1514. __webpack_require__.r(__webpack_exports__);
  1515. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Event", function() { return Event; });
  1516. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Emitter", function() { return Emitter; });
  1517. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PauseableEmitter", function() { return PauseableEmitter; });
  1518. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventMultiplexer", function() { return EventMultiplexer; });
  1519. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EventBufferer", function() { return EventBufferer; });
  1520. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Relay", function() { return Relay; });
  1521. /* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "../../node_modules/monaco-editor/esm/vs/base/common/errors.js");
  1522. /* harmony import */ var _functional_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./functional.js */ "../../node_modules/monaco-editor/esm/vs/base/common/functional.js");
  1523. /* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lifecycle.js */ "../../node_modules/monaco-editor/esm/vs/base/common/lifecycle.js");
  1524. /* harmony import */ var _linkedList_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./linkedList.js */ "../../node_modules/monaco-editor/esm/vs/base/common/linkedList.js");
  1525. /*---------------------------------------------------------------------------------------------
  1526. * Copyright (c) Microsoft Corporation. All rights reserved.
  1527. * Licensed under the MIT License. See License.txt in the project root for license information.
  1528. *--------------------------------------------------------------------------------------------*/
  1529. var __extends = (undefined && undefined.__extends) || (function () {
  1530. var extendStatics = function (d, b) {
  1531. extendStatics = Object.setPrototypeOf ||
  1532. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  1533. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  1534. return extendStatics(d, b);
  1535. };
  1536. return function (d, b) {
  1537. extendStatics(d, b);
  1538. function __() { this.constructor = d; }
  1539. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  1540. };
  1541. })();
  1542. var Event;
  1543. (function (Event) {
  1544. Event.None = function () { return _lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"].None; };
  1545. /**
  1546. * Given an event, returns another event which only fires once.
  1547. */
  1548. function once(event) {
  1549. return function (listener, thisArgs, disposables) {
  1550. if (thisArgs === void 0) { thisArgs = null; }
  1551. // we need this, in case the event fires during the listener call
  1552. var didFire = false;
  1553. var result;
  1554. result = event(function (e) {
  1555. if (didFire) {
  1556. return;
  1557. }
  1558. else if (result) {
  1559. result.dispose();
  1560. }
  1561. else {
  1562. didFire = true;
  1563. }
  1564. return listener.call(thisArgs, e);
  1565. }, null, disposables);
  1566. if (didFire) {
  1567. result.dispose();
  1568. }
  1569. return result;
  1570. };
  1571. }
  1572. Event.once = once;
  1573. /**
  1574. * Given an event and a `map` function, returns another event which maps each element
  1575. * through the mapping function.
  1576. */
  1577. function map(event, map) {
  1578. return snapshot(function (listener, thisArgs, disposables) {
  1579. if (thisArgs === void 0) { thisArgs = null; }
  1580. return event(function (i) { return listener.call(thisArgs, map(i)); }, null, disposables);
  1581. });
  1582. }
  1583. Event.map = map;
  1584. /**
  1585. * Given an event and an `each` function, returns another identical event and calls
  1586. * the `each` function per each element.
  1587. */
  1588. function forEach(event, each) {
  1589. return snapshot(function (listener, thisArgs, disposables) {
  1590. if (thisArgs === void 0) { thisArgs = null; }
  1591. return event(function (i) { each(i); listener.call(thisArgs, i); }, null, disposables);
  1592. });
  1593. }
  1594. Event.forEach = forEach;
  1595. function filter(event, filter) {
  1596. return snapshot(function (listener, thisArgs, disposables) {
  1597. if (thisArgs === void 0) { thisArgs = null; }
  1598. return event(function (e) { return filter(e) && listener.call(thisArgs, e); }, null, disposables);
  1599. });
  1600. }
  1601. Event.filter = filter;
  1602. /**
  1603. * Given an event, returns the same event but typed as `Event<void>`.
  1604. */
  1605. function signal(event) {
  1606. return event;
  1607. }
  1608. Event.signal = signal;
  1609. /**
  1610. * Given a collection of events, returns a single event which emits
  1611. * whenever any of the provided events emit.
  1612. */
  1613. function any() {
  1614. var events = [];
  1615. for (var _i = 0; _i < arguments.length; _i++) {
  1616. events[_i] = arguments[_i];
  1617. }
  1618. return function (listener, thisArgs, disposables) {
  1619. if (thisArgs === void 0) { thisArgs = null; }
  1620. return _lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["combinedDisposable"].apply(void 0, events.map(function (event) { return event(function (e) { return listener.call(thisArgs, e); }, null, disposables); }));
  1621. };
  1622. }
  1623. Event.any = any;
  1624. /**
  1625. * Given an event and a `merge` function, returns another event which maps each element
  1626. * and the cumulative result through the `merge` function. Similar to `map`, but with memory.
  1627. */
  1628. function reduce(event, merge, initial) {
  1629. var output = initial;
  1630. return map(event, function (e) {
  1631. output = merge(output, e);
  1632. return output;
  1633. });
  1634. }
  1635. Event.reduce = reduce;
  1636. /**
  1637. * Given a chain of event processing functions (filter, map, etc), each
  1638. * function will be invoked per event & per listener. Snapshotting an event
  1639. * chain allows each function to be invoked just once per event.
  1640. */
  1641. function snapshot(event) {
  1642. var listener;
  1643. var emitter = new Emitter({
  1644. onFirstListenerAdd: function () {
  1645. listener = event(emitter.fire, emitter);
  1646. },
  1647. onLastListenerRemove: function () {
  1648. listener.dispose();
  1649. }
  1650. });
  1651. return emitter.event;
  1652. }
  1653. Event.snapshot = snapshot;
  1654. function debounce(event, merge, delay, leading, leakWarningThreshold) {
  1655. if (delay === void 0) { delay = 100; }
  1656. if (leading === void 0) { leading = false; }
  1657. var subscription;
  1658. var output = undefined;
  1659. var handle = undefined;
  1660. var numDebouncedCalls = 0;
  1661. var emitter = new Emitter({
  1662. leakWarningThreshold: leakWarningThreshold,
  1663. onFirstListenerAdd: function () {
  1664. subscription = event(function (cur) {
  1665. numDebouncedCalls++;
  1666. output = merge(output, cur);
  1667. if (leading && !handle) {
  1668. emitter.fire(output);
  1669. output = undefined;
  1670. }
  1671. clearTimeout(handle);
  1672. handle = setTimeout(function () {
  1673. var _output = output;
  1674. output = undefined;
  1675. handle = undefined;
  1676. if (!leading || numDebouncedCalls > 1) {
  1677. emitter.fire(_output);
  1678. }
  1679. numDebouncedCalls = 0;
  1680. }, delay);
  1681. });
  1682. },
  1683. onLastListenerRemove: function () {
  1684. subscription.dispose();
  1685. }
  1686. });
  1687. return emitter.event;
  1688. }
  1689. Event.debounce = debounce;
  1690. /**
  1691. * Given an event, it returns another event which fires only once and as soon as
  1692. * the input event emits. The event data is the number of millis it took for the
  1693. * event to fire.
  1694. */
  1695. function stopwatch(event) {
  1696. var start = new Date().getTime();
  1697. return map(once(event), function (_) { return new Date().getTime() - start; });
  1698. }
  1699. Event.stopwatch = stopwatch;
  1700. /**
  1701. * Given an event, it returns another event which fires only when the event
  1702. * element changes.
  1703. */
  1704. function latch(event) {
  1705. var firstCall = true;
  1706. var cache;
  1707. return filter(event, function (value) {
  1708. var shouldEmit = firstCall || value !== cache;
  1709. firstCall = false;
  1710. cache = value;
  1711. return shouldEmit;
  1712. });
  1713. }
  1714. Event.latch = latch;
  1715. /**
  1716. * Buffers the provided event until a first listener comes
  1717. * along, at which point fire all the events at once and
  1718. * pipe the event from then on.
  1719. *
  1720. * ```typescript
  1721. * const emitter = new Emitter<number>();
  1722. * const event = emitter.event;
  1723. * const bufferedEvent = buffer(event);
  1724. *
  1725. * emitter.fire(1);
  1726. * emitter.fire(2);
  1727. * emitter.fire(3);
  1728. * // nothing...
  1729. *
  1730. * const listener = bufferedEvent(num => console.log(num));
  1731. * // 1, 2, 3
  1732. *
  1733. * emitter.fire(4);
  1734. * // 4
  1735. * ```
  1736. */
  1737. function buffer(event, nextTick, _buffer) {
  1738. if (nextTick === void 0) { nextTick = false; }
  1739. if (_buffer === void 0) { _buffer = []; }
  1740. var buffer = _buffer.slice();
  1741. var listener = event(function (e) {
  1742. if (buffer) {
  1743. buffer.push(e);
  1744. }
  1745. else {
  1746. emitter.fire(e);
  1747. }
  1748. });
  1749. var flush = function () {
  1750. if (buffer) {
  1751. buffer.forEach(function (e) { return emitter.fire(e); });
  1752. }
  1753. buffer = null;
  1754. };
  1755. var emitter = new Emitter({
  1756. onFirstListenerAdd: function () {
  1757. if (!listener) {
  1758. listener = event(function (e) { return emitter.fire(e); });
  1759. }
  1760. },
  1761. onFirstListenerDidAdd: function () {
  1762. if (buffer) {
  1763. if (nextTick) {
  1764. setTimeout(flush);
  1765. }
  1766. else {
  1767. flush();
  1768. }
  1769. }
  1770. },
  1771. onLastListenerRemove: function () {
  1772. if (listener) {
  1773. listener.dispose();
  1774. }
  1775. listener = null;
  1776. }
  1777. });
  1778. return emitter.event;
  1779. }
  1780. Event.buffer = buffer;
  1781. var ChainableEvent = /** @class */ (function () {
  1782. function ChainableEvent(event) {
  1783. this.event = event;
  1784. }
  1785. ChainableEvent.prototype.map = function (fn) {
  1786. return new ChainableEvent(map(this.event, fn));
  1787. };
  1788. ChainableEvent.prototype.forEach = function (fn) {
  1789. return new ChainableEvent(forEach(this.event, fn));
  1790. };
  1791. ChainableEvent.prototype.filter = function (fn) {
  1792. return new ChainableEvent(filter(this.event, fn));
  1793. };
  1794. ChainableEvent.prototype.reduce = function (merge, initial) {
  1795. return new ChainableEvent(reduce(this.event, merge, initial));
  1796. };
  1797. ChainableEvent.prototype.latch = function () {
  1798. return new ChainableEvent(latch(this.event));
  1799. };
  1800. ChainableEvent.prototype.debounce = function (merge, delay, leading, leakWarningThreshold) {
  1801. if (delay === void 0) { delay = 100; }
  1802. if (leading === void 0) { leading = false; }
  1803. return new ChainableEvent(debounce(this.event, merge, delay, leading, leakWarningThreshold));
  1804. };
  1805. ChainableEvent.prototype.on = function (listener, thisArgs, disposables) {
  1806. return this.event(listener, thisArgs, disposables);
  1807. };
  1808. ChainableEvent.prototype.once = function (listener, thisArgs, disposables) {
  1809. return once(this.event)(listener, thisArgs, disposables);
  1810. };
  1811. return ChainableEvent;
  1812. }());
  1813. function chain(event) {
  1814. return new ChainableEvent(event);
  1815. }
  1816. Event.chain = chain;
  1817. function fromNodeEventEmitter(emitter, eventName, map) {
  1818. if (map === void 0) { map = function (id) { return id; }; }
  1819. var fn = function () {
  1820. var args = [];
  1821. for (var _i = 0; _i < arguments.length; _i++) {
  1822. args[_i] = arguments[_i];
  1823. }
  1824. return result.fire(map.apply(void 0, args));
  1825. };
  1826. var onFirstListenerAdd = function () { return emitter.on(eventName, fn); };
  1827. var onLastListenerRemove = function () { return emitter.removeListener(eventName, fn); };
  1828. var result = new Emitter({ onFirstListenerAdd: onFirstListenerAdd, onLastListenerRemove: onLastListenerRemove });
  1829. return result.event;
  1830. }
  1831. Event.fromNodeEventEmitter = fromNodeEventEmitter;
  1832. function fromDOMEventEmitter(emitter, eventName, map) {
  1833. if (map === void 0) { map = function (id) { return id; }; }
  1834. var fn = function () {
  1835. var args = [];
  1836. for (var _i = 0; _i < arguments.length; _i++) {
  1837. args[_i] = arguments[_i];
  1838. }
  1839. return result.fire(map.apply(void 0, args));
  1840. };
  1841. var onFirstListenerAdd = function () { return emitter.addEventListener(eventName, fn); };
  1842. var onLastListenerRemove = function () { return emitter.removeEventListener(eventName, fn); };
  1843. var result = new Emitter({ onFirstListenerAdd: onFirstListenerAdd, onLastListenerRemove: onLastListenerRemove });
  1844. return result.event;
  1845. }
  1846. Event.fromDOMEventEmitter = fromDOMEventEmitter;
  1847. function fromPromise(promise) {
  1848. var emitter = new Emitter();
  1849. var shouldEmit = false;
  1850. promise
  1851. .then(undefined, function () { return null; })
  1852. .then(function () {
  1853. if (!shouldEmit) {
  1854. setTimeout(function () { return emitter.fire(undefined); }, 0);
  1855. }
  1856. else {
  1857. emitter.fire(undefined);
  1858. }
  1859. });
  1860. shouldEmit = true;
  1861. return emitter.event;
  1862. }
  1863. Event.fromPromise = fromPromise;
  1864. function toPromise(event) {
  1865. return new Promise(function (c) { return once(event)(c); });
  1866. }
  1867. Event.toPromise = toPromise;
  1868. })(Event || (Event = {}));
  1869. var _globalLeakWarningThreshold = -1;
  1870. var LeakageMonitor = /** @class */ (function () {
  1871. function LeakageMonitor(customThreshold, name) {
  1872. if (name === void 0) { name = Math.random().toString(18).slice(2, 5); }
  1873. this.customThreshold = customThreshold;
  1874. this.name = name;
  1875. this._warnCountdown = 0;
  1876. }
  1877. LeakageMonitor.prototype.dispose = function () {
  1878. if (this._stacks) {
  1879. this._stacks.clear();
  1880. }
  1881. };
  1882. LeakageMonitor.prototype.check = function (listenerCount) {
  1883. var _this = this;
  1884. var threshold = _globalLeakWarningThreshold;
  1885. if (typeof this.customThreshold === 'number') {
  1886. threshold = this.customThreshold;
  1887. }
  1888. if (threshold <= 0 || listenerCount < threshold) {
  1889. return undefined;
  1890. }
  1891. if (!this._stacks) {
  1892. this._stacks = new Map();
  1893. }
  1894. var stack = new Error().stack.split('\n').slice(3).join('\n');
  1895. var count = (this._stacks.get(stack) || 0);
  1896. this._stacks.set(stack, count + 1);
  1897. this._warnCountdown -= 1;
  1898. if (this._warnCountdown <= 0) {
  1899. // only warn on first exceed and then every time the limit
  1900. // is exceeded by 50% again
  1901. this._warnCountdown = threshold * 0.5;
  1902. // find most frequent listener and print warning
  1903. var topStack_1;
  1904. var topCount_1 = 0;
  1905. this._stacks.forEach(function (count, stack) {
  1906. if (!topStack_1 || topCount_1 < count) {
  1907. topStack_1 = stack;
  1908. topCount_1 = count;
  1909. }
  1910. });
  1911. console.warn("[" + this.name + "] potential listener LEAK detected, having " + listenerCount + " listeners already. MOST frequent listener (" + topCount_1 + "):");
  1912. console.warn(topStack_1);
  1913. }
  1914. return function () {
  1915. var count = (_this._stacks.get(stack) || 0);
  1916. _this._stacks.set(stack, count - 1);
  1917. };
  1918. };
  1919. return LeakageMonitor;
  1920. }());
  1921. /**
  1922. * The Emitter can be used to expose an Event to the public
  1923. * to fire it from the insides.
  1924. * Sample:
  1925. class Document {
  1926. private readonly _onDidChange = new Emitter<(value:string)=>any>();
  1927. public onDidChange = this._onDidChange.event;
  1928. // getter-style
  1929. // get onDidChange(): Event<(value:string)=>any> {
  1930. // return this._onDidChange.event;
  1931. // }
  1932. private _doIt() {
  1933. //...
  1934. this._onDidChange.fire(value);
  1935. }
  1936. }
  1937. */
  1938. var Emitter = /** @class */ (function () {
  1939. function Emitter(options) {
  1940. this._disposed = false;
  1941. this._options = options;
  1942. this._leakageMon = _globalLeakWarningThreshold > 0
  1943. ? new LeakageMonitor(this._options && this._options.leakWarningThreshold)
  1944. : undefined;
  1945. }
  1946. Object.defineProperty(Emitter.prototype, "event", {
  1947. /**
  1948. * For the public to allow to subscribe
  1949. * to events from this Emitter
  1950. */
  1951. get: function () {
  1952. var _this = this;
  1953. if (!this._event) {
  1954. this._event = function (listener, thisArgs, disposables) {
  1955. if (!_this._listeners) {
  1956. _this._listeners = new _linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"]();
  1957. }
  1958. var firstListener = _this._listeners.isEmpty();
  1959. if (firstListener && _this._options && _this._options.onFirstListenerAdd) {
  1960. _this._options.onFirstListenerAdd(_this);
  1961. }
  1962. var remove = _this._listeners.push(!thisArgs ? listener : [listener, thisArgs]);
  1963. if (firstListener && _this._options && _this._options.onFirstListenerDidAdd) {
  1964. _this._options.onFirstListenerDidAdd(_this);
  1965. }
  1966. if (_this._options && _this._options.onListenerDidAdd) {
  1967. _this._options.onListenerDidAdd(_this, listener, thisArgs);
  1968. }
  1969. // check and record this emitter for potential leakage
  1970. var removeMonitor;
  1971. if (_this._leakageMon) {
  1972. removeMonitor = _this._leakageMon.check(_this._listeners.size);
  1973. }
  1974. var result;
  1975. result = {
  1976. dispose: function () {
  1977. if (removeMonitor) {
  1978. removeMonitor();
  1979. }
  1980. result.dispose = Emitter._noop;
  1981. if (!_this._disposed) {
  1982. remove();
  1983. if (_this._options && _this._options.onLastListenerRemove) {
  1984. var hasListeners = (_this._listeners && !_this._listeners.isEmpty());
  1985. if (!hasListeners) {
  1986. _this._options.onLastListenerRemove(_this);
  1987. }
  1988. }
  1989. }
  1990. }
  1991. };
  1992. if (disposables instanceof _lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["DisposableStore"]) {
  1993. disposables.add(result);
  1994. }
  1995. else if (Array.isArray(disposables)) {
  1996. disposables.push(result);
  1997. }
  1998. return result;
  1999. };
  2000. }
  2001. return this._event;
  2002. },
  2003. enumerable: true,
  2004. configurable: true
  2005. });
  2006. /**
  2007. * To be kept private to fire an event to
  2008. * subscribers
  2009. */
  2010. Emitter.prototype.fire = function (event) {
  2011. if (this._listeners) {
  2012. // put all [listener,event]-pairs into delivery queue
  2013. // then emit all event. an inner/nested event might be
  2014. // the driver of this
  2015. if (!this._deliveryQueue) {
  2016. this._deliveryQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"]();
  2017. }
  2018. for (var iter = this._listeners.iterator(), e = iter.next(); !e.done; e = iter.next()) {
  2019. this._deliveryQueue.push([e.value, event]);
  2020. }
  2021. while (this._deliveryQueue.size > 0) {
  2022. var _a = this._deliveryQueue.shift(), listener = _a[0], event_1 = _a[1];
  2023. try {
  2024. if (typeof listener === 'function') {
  2025. listener.call(undefined, event_1);
  2026. }
  2027. else {
  2028. listener[0].call(listener[1], event_1);
  2029. }
  2030. }
  2031. catch (e) {
  2032. Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["onUnexpectedError"])(e);
  2033. }
  2034. }
  2035. }
  2036. };
  2037. Emitter.prototype.dispose = function () {
  2038. if (this._listeners) {
  2039. this._listeners.clear();
  2040. }
  2041. if (this._deliveryQueue) {
  2042. this._deliveryQueue.clear();
  2043. }
  2044. if (this._leakageMon) {
  2045. this._leakageMon.dispose();
  2046. }
  2047. this._disposed = true;
  2048. };
  2049. Emitter._noop = function () { };
  2050. return Emitter;
  2051. }());
  2052. var PauseableEmitter = /** @class */ (function (_super) {
  2053. __extends(PauseableEmitter, _super);
  2054. function PauseableEmitter(options) {
  2055. var _this = _super.call(this, options) || this;
  2056. _this._isPaused = 0;
  2057. _this._eventQueue = new _linkedList_js__WEBPACK_IMPORTED_MODULE_3__["LinkedList"]();
  2058. _this._mergeFn = options && options.merge;
  2059. return _this;
  2060. }
  2061. PauseableEmitter.prototype.pause = function () {
  2062. this._isPaused++;
  2063. };
  2064. PauseableEmitter.prototype.resume = function () {
  2065. if (this._isPaused !== 0 && --this._isPaused === 0) {
  2066. if (this._mergeFn) {
  2067. // use the merge function to create a single composite
  2068. // event. make a copy in case firing pauses this emitter
  2069. var events = this._eventQueue.toArray();
  2070. this._eventQueue.clear();
  2071. _super.prototype.fire.call(this, this._mergeFn(events));
  2072. }
  2073. else {
  2074. // no merging, fire each event individually and test
  2075. // that this emitter isn't paused halfway through
  2076. while (!this._isPaused && this._eventQueue.size !== 0) {
  2077. _super.prototype.fire.call(this, this._eventQueue.shift());
  2078. }
  2079. }
  2080. }
  2081. };
  2082. PauseableEmitter.prototype.fire = function (event) {
  2083. if (this._listeners) {
  2084. if (this._isPaused !== 0) {
  2085. this._eventQueue.push(event);
  2086. }
  2087. else {
  2088. _super.prototype.fire.call(this, event);
  2089. }
  2090. }
  2091. };
  2092. return PauseableEmitter;
  2093. }(Emitter));
  2094. var EventMultiplexer = /** @class */ (function () {
  2095. function EventMultiplexer() {
  2096. var _this = this;
  2097. this.hasListeners = false;
  2098. this.events = [];
  2099. this.emitter = new Emitter({
  2100. onFirstListenerAdd: function () { return _this.onFirstListenerAdd(); },
  2101. onLastListenerRemove: function () { return _this.onLastListenerRemove(); }
  2102. });
  2103. }
  2104. Object.defineProperty(EventMultiplexer.prototype, "event", {
  2105. get: function () {
  2106. return this.emitter.event;
  2107. },
  2108. enumerable: true,
  2109. configurable: true
  2110. });
  2111. EventMultiplexer.prototype.add = function (event) {
  2112. var _this = this;
  2113. var e = { event: event, listener: null };
  2114. this.events.push(e);
  2115. if (this.hasListeners) {
  2116. this.hook(e);
  2117. }
  2118. var dispose = function () {
  2119. if (_this.hasListeners) {
  2120. _this.unhook(e);
  2121. }
  2122. var idx = _this.events.indexOf(e);
  2123. _this.events.splice(idx, 1);
  2124. };
  2125. return Object(_lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["toDisposable"])(Object(_functional_js__WEBPACK_IMPORTED_MODULE_1__["once"])(dispose));
  2126. };
  2127. EventMultiplexer.prototype.onFirstListenerAdd = function () {
  2128. var _this = this;
  2129. this.hasListeners = true;
  2130. this.events.forEach(function (e) { return _this.hook(e); });
  2131. };
  2132. EventMultiplexer.prototype.onLastListenerRemove = function () {
  2133. var _this = this;
  2134. this.hasListeners = false;
  2135. this.events.forEach(function (e) { return _this.unhook(e); });
  2136. };
  2137. EventMultiplexer.prototype.hook = function (e) {
  2138. var _this = this;
  2139. e.listener = e.event(function (r) { return _this.emitter.fire(r); });
  2140. };
  2141. EventMultiplexer.prototype.unhook = function (e) {
  2142. if (e.listener) {
  2143. e.listener.dispose();
  2144. }
  2145. e.listener = null;
  2146. };
  2147. EventMultiplexer.prototype.dispose = function () {
  2148. this.emitter.dispose();
  2149. };
  2150. return EventMultiplexer;
  2151. }());
  2152. /**
  2153. * The EventBufferer is useful in situations in which you want
  2154. * to delay firing your events during some code.
  2155. * You can wrap that code and be sure that the event will not
  2156. * be fired during that wrap.
  2157. *
  2158. * ```
  2159. * const emitter: Emitter;
  2160. * const delayer = new EventDelayer();
  2161. * const delayedEvent = delayer.wrapEvent(emitter.event);
  2162. *
  2163. * delayedEvent(console.log);
  2164. *
  2165. * delayer.bufferEvents(() => {
  2166. * emitter.fire(); // event will not be fired yet
  2167. * });
  2168. *
  2169. * // event will only be fired at this point
  2170. * ```
  2171. */
  2172. var EventBufferer = /** @class */ (function () {
  2173. function EventBufferer() {
  2174. this.buffers = [];
  2175. }
  2176. EventBufferer.prototype.wrapEvent = function (event) {
  2177. var _this = this;
  2178. return function (listener, thisArgs, disposables) {
  2179. return event(function (i) {
  2180. var buffer = _this.buffers[_this.buffers.length - 1];
  2181. if (buffer) {
  2182. buffer.push(function () { return listener.call(thisArgs, i); });
  2183. }
  2184. else {
  2185. listener.call(thisArgs, i);
  2186. }
  2187. }, undefined, disposables);
  2188. };
  2189. };
  2190. EventBufferer.prototype.bufferEvents = function (fn) {
  2191. var buffer = [];
  2192. this.buffers.push(buffer);
  2193. var r = fn();
  2194. this.buffers.pop();
  2195. buffer.forEach(function (flush) { return flush(); });
  2196. return r;
  2197. };
  2198. return EventBufferer;
  2199. }());
  2200. /**
  2201. * A Relay is an event forwarder which functions as a replugabble event pipe.
  2202. * Once created, you can connect an input event to it and it will simply forward
  2203. * events from that input event through its own `event` property. The `input`
  2204. * can be changed at any point in time.
  2205. */
  2206. var Relay = /** @class */ (function () {
  2207. function Relay() {
  2208. var _this = this;
  2209. this.listening = false;
  2210. this.inputEvent = Event.None;
  2211. this.inputEventListener = _lifecycle_js__WEBPACK_IMPORTED_MODULE_2__["Disposable"].None;
  2212. this.emitter = new Emitter({
  2213. onFirstListenerDidAdd: function () {
  2214. _this.listening = true;
  2215. _this.inputEventListener = _this.inputEvent(_this.emitter.fire, _this.emitter);
  2216. },
  2217. onLastListenerRemove: function () {
  2218. _this.listening = false;
  2219. _this.inputEventListener.dispose();
  2220. }
  2221. });
  2222. this.event = this.emitter.event;
  2223. }
  2224. Object.defineProperty(Relay.prototype, "input", {
  2225. set: function (event) {
  2226. this.inputEvent = event;
  2227. if (this.listening) {
  2228. this.inputEventListener.dispose();
  2229. this.inputEventListener = event(this.emitter.fire, this.emitter);
  2230. }
  2231. },
  2232. enumerable: true,
  2233. configurable: true
  2234. });
  2235. Relay.prototype.dispose = function () {
  2236. this.inputEventListener.dispose();
  2237. this.emitter.dispose();
  2238. };
  2239. return Relay;
  2240. }());
  2241. /***/ }),
  2242. /***/ "../../node_modules/monaco-editor/esm/vs/base/common/functional.js":
  2243. /*!***************************************************************************************!*\
  2244. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/base/common/functional.js ***!
  2245. \***************************************************************************************/
  2246. /*! exports provided: once */
  2247. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2248. "use strict";
  2249. __webpack_require__.r(__webpack_exports__);
  2250. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "once", function() { return once; });
  2251. /*---------------------------------------------------------------------------------------------
  2252. * Copyright (c) Microsoft Corporation. All rights reserved.
  2253. * Licensed under the MIT License. See License.txt in the project root for license information.
  2254. *--------------------------------------------------------------------------------------------*/
  2255. function once(fn) {
  2256. var _this = this;
  2257. var didCall = false;
  2258. var result;
  2259. return function () {
  2260. if (didCall) {
  2261. return result;
  2262. }
  2263. didCall = true;
  2264. result = fn.apply(_this, arguments);
  2265. return result;
  2266. };
  2267. }
  2268. /***/ }),
  2269. /***/ "../../node_modules/monaco-editor/esm/vs/base/common/hash.js":
  2270. /*!*********************************************************************************!*\
  2271. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/base/common/hash.js ***!
  2272. \*********************************************************************************/
  2273. /*! exports provided: hash, stringHash */
  2274. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2275. "use strict";
  2276. __webpack_require__.r(__webpack_exports__);
  2277. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hash", function() { return hash; });
  2278. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringHash", function() { return stringHash; });
  2279. /*---------------------------------------------------------------------------------------------
  2280. * Copyright (c) Microsoft Corporation. All rights reserved.
  2281. * Licensed under the MIT License. See License.txt in the project root for license information.
  2282. *--------------------------------------------------------------------------------------------*/
  2283. /**
  2284. * Return a hash value for an object.
  2285. */
  2286. function hash(obj, hashVal) {
  2287. if (hashVal === void 0) { hashVal = 0; }
  2288. switch (typeof obj) {
  2289. case 'object':
  2290. if (obj === null) {
  2291. return numberHash(349, hashVal);
  2292. }
  2293. else if (Array.isArray(obj)) {
  2294. return arrayHash(obj, hashVal);
  2295. }
  2296. return objectHash(obj, hashVal);
  2297. case 'string':
  2298. return stringHash(obj, hashVal);
  2299. case 'boolean':
  2300. return booleanHash(obj, hashVal);
  2301. case 'number':
  2302. return numberHash(obj, hashVal);
  2303. case 'undefined':
  2304. return numberHash(0, 937);
  2305. default:
  2306. return numberHash(0, 617);
  2307. }
  2308. }
  2309. function numberHash(val, initialHashVal) {
  2310. return (((initialHashVal << 5) - initialHashVal) + val) | 0; // hashVal * 31 + ch, keep as int32
  2311. }
  2312. function booleanHash(b, initialHashVal) {
  2313. return numberHash(b ? 433 : 863, initialHashVal);
  2314. }
  2315. function stringHash(s, hashVal) {
  2316. hashVal = numberHash(149417, hashVal);
  2317. for (var i = 0, length_1 = s.length; i < length_1; i++) {
  2318. hashVal = numberHash(s.charCodeAt(i), hashVal);
  2319. }
  2320. return hashVal;
  2321. }
  2322. function arrayHash(arr, initialHashVal) {
  2323. initialHashVal = numberHash(104579, initialHashVal);
  2324. return arr.reduce(function (hashVal, item) { return hash(item, hashVal); }, initialHashVal);
  2325. }
  2326. function objectHash(obj, initialHashVal) {
  2327. initialHashVal = numberHash(181387, initialHashVal);
  2328. return Object.keys(obj).sort().reduce(function (hashVal, key) {
  2329. hashVal = stringHash(key, hashVal);
  2330. return hash(obj[key], hashVal);
  2331. }, initialHashVal);
  2332. }
  2333. /***/ }),
  2334. /***/ "../../node_modules/monaco-editor/esm/vs/base/common/iterator.js":
  2335. /*!*************************************************************************************!*\
  2336. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/base/common/iterator.js ***!
  2337. \*************************************************************************************/
  2338. /*! exports provided: FIN, Iterator, ChainableIterator, getSequenceIterator, ArrayIterator, ArrayNavigator, MappedIterator */
  2339. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2340. "use strict";
  2341. __webpack_require__.r(__webpack_exports__);
  2342. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FIN", function() { return FIN; });
  2343. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Iterator", function() { return Iterator; });
  2344. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChainableIterator", function() { return ChainableIterator; });
  2345. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSequenceIterator", function() { return getSequenceIterator; });
  2346. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayIterator", function() { return ArrayIterator; });
  2347. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ArrayNavigator", function() { return ArrayNavigator; });
  2348. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MappedIterator", function() { return MappedIterator; });
  2349. /*---------------------------------------------------------------------------------------------
  2350. * Copyright (c) Microsoft Corporation. All rights reserved.
  2351. * Licensed under the MIT License. See License.txt in the project root for license information.
  2352. *--------------------------------------------------------------------------------------------*/
  2353. var __extends = (undefined && undefined.__extends) || (function () {
  2354. var extendStatics = function (d, b) {
  2355. extendStatics = Object.setPrototypeOf ||
  2356. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  2357. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  2358. return extendStatics(d, b);
  2359. };
  2360. return function (d, b) {
  2361. extendStatics(d, b);
  2362. function __() { this.constructor = d; }
  2363. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  2364. };
  2365. })();
  2366. var FIN = { done: true, value: undefined };
  2367. var Iterator;
  2368. (function (Iterator) {
  2369. var _empty = {
  2370. next: function () {
  2371. return FIN;
  2372. }
  2373. };
  2374. function empty() {
  2375. return _empty;
  2376. }
  2377. Iterator.empty = empty;
  2378. function single(value) {
  2379. var done = false;
  2380. return {
  2381. next: function () {
  2382. if (done) {
  2383. return FIN;
  2384. }
  2385. done = true;
  2386. return { done: false, value: value };
  2387. }
  2388. };
  2389. }
  2390. Iterator.single = single;
  2391. function fromArray(array, index, length) {
  2392. if (index === void 0) { index = 0; }
  2393. if (length === void 0) { length = array.length; }
  2394. return {
  2395. next: function () {
  2396. if (index >= length) {
  2397. return FIN;
  2398. }
  2399. return { done: false, value: array[index++] };
  2400. }
  2401. };
  2402. }
  2403. Iterator.fromArray = fromArray;
  2404. function fromNativeIterator(it) {
  2405. return {
  2406. next: function () {
  2407. var result = it.next();
  2408. if (result.done) {
  2409. return FIN;
  2410. }
  2411. return { done: false, value: result.value };
  2412. }
  2413. };
  2414. }
  2415. Iterator.fromNativeIterator = fromNativeIterator;
  2416. function from(elements) {
  2417. if (!elements) {
  2418. return Iterator.empty();
  2419. }
  2420. else if (Array.isArray(elements)) {
  2421. return Iterator.fromArray(elements);
  2422. }
  2423. else {
  2424. return elements;
  2425. }
  2426. }
  2427. Iterator.from = from;
  2428. function map(iterator, fn) {
  2429. return {
  2430. next: function () {
  2431. var element = iterator.next();
  2432. if (element.done) {
  2433. return FIN;
  2434. }
  2435. else {
  2436. return { done: false, value: fn(element.value) };
  2437. }
  2438. }
  2439. };
  2440. }
  2441. Iterator.map = map;
  2442. function filter(iterator, fn) {
  2443. return {
  2444. next: function () {
  2445. while (true) {
  2446. var element = iterator.next();
  2447. if (element.done) {
  2448. return FIN;
  2449. }
  2450. if (fn(element.value)) {
  2451. return { done: false, value: element.value };
  2452. }
  2453. }
  2454. }
  2455. };
  2456. }
  2457. Iterator.filter = filter;
  2458. function forEach(iterator, fn) {
  2459. for (var next = iterator.next(); !next.done; next = iterator.next()) {
  2460. fn(next.value);
  2461. }
  2462. }
  2463. Iterator.forEach = forEach;
  2464. function collect(iterator, atMost) {
  2465. if (atMost === void 0) { atMost = Number.POSITIVE_INFINITY; }
  2466. var result = [];
  2467. if (atMost === 0) {
  2468. return result;
  2469. }
  2470. var i = 0;
  2471. for (var next = iterator.next(); !next.done; next = iterator.next()) {
  2472. result.push(next.value);
  2473. if (++i >= atMost) {
  2474. break;
  2475. }
  2476. }
  2477. return result;
  2478. }
  2479. Iterator.collect = collect;
  2480. function concat() {
  2481. var iterators = [];
  2482. for (var _i = 0; _i < arguments.length; _i++) {
  2483. iterators[_i] = arguments[_i];
  2484. }
  2485. var i = 0;
  2486. return {
  2487. next: function () {
  2488. if (i >= iterators.length) {
  2489. return FIN;
  2490. }
  2491. var iterator = iterators[i];
  2492. var result = iterator.next();
  2493. if (result.done) {
  2494. i++;
  2495. return this.next();
  2496. }
  2497. return result;
  2498. }
  2499. };
  2500. }
  2501. Iterator.concat = concat;
  2502. function chain(iterator) {
  2503. return new ChainableIterator(iterator);
  2504. }
  2505. Iterator.chain = chain;
  2506. })(Iterator || (Iterator = {}));
  2507. var ChainableIterator = /** @class */ (function () {
  2508. function ChainableIterator(it) {
  2509. this.it = it;
  2510. }
  2511. ChainableIterator.prototype.next = function () { return this.it.next(); };
  2512. return ChainableIterator;
  2513. }());
  2514. function getSequenceIterator(arg) {
  2515. if (Array.isArray(arg)) {
  2516. return Iterator.fromArray(arg);
  2517. }
  2518. else if (!arg) {
  2519. return Iterator.empty();
  2520. }
  2521. else {
  2522. return arg;
  2523. }
  2524. }
  2525. var ArrayIterator = /** @class */ (function () {
  2526. function ArrayIterator(items, start, end, index) {
  2527. if (start === void 0) { start = 0; }
  2528. if (end === void 0) { end = items.length; }
  2529. if (index === void 0) { index = start - 1; }
  2530. this.items = items;
  2531. this.start = start;
  2532. this.end = end;
  2533. this.index = index;
  2534. }
  2535. ArrayIterator.prototype.first = function () {
  2536. this.index = this.start;
  2537. return this.current();
  2538. };
  2539. ArrayIterator.prototype.next = function () {
  2540. this.index = Math.min(this.index + 1, this.end);
  2541. return this.current();
  2542. };
  2543. ArrayIterator.prototype.current = function () {
  2544. if (this.index === this.start - 1 || this.index === this.end) {
  2545. return null;
  2546. }
  2547. return this.items[this.index];
  2548. };
  2549. return ArrayIterator;
  2550. }());
  2551. var ArrayNavigator = /** @class */ (function (_super) {
  2552. __extends(ArrayNavigator, _super);
  2553. function ArrayNavigator(items, start, end, index) {
  2554. if (start === void 0) { start = 0; }
  2555. if (end === void 0) { end = items.length; }
  2556. if (index === void 0) { index = start - 1; }
  2557. return _super.call(this, items, start, end, index) || this;
  2558. }
  2559. ArrayNavigator.prototype.current = function () {
  2560. return _super.prototype.current.call(this);
  2561. };
  2562. ArrayNavigator.prototype.previous = function () {
  2563. this.index = Math.max(this.index - 1, this.start - 1);
  2564. return this.current();
  2565. };
  2566. ArrayNavigator.prototype.first = function () {
  2567. this.index = this.start;
  2568. return this.current();
  2569. };
  2570. ArrayNavigator.prototype.last = function () {
  2571. this.index = this.end - 1;
  2572. return this.current();
  2573. };
  2574. ArrayNavigator.prototype.parent = function () {
  2575. return null;
  2576. };
  2577. return ArrayNavigator;
  2578. }(ArrayIterator));
  2579. var MappedIterator = /** @class */ (function () {
  2580. function MappedIterator(iterator, fn) {
  2581. this.iterator = iterator;
  2582. this.fn = fn;
  2583. // noop
  2584. }
  2585. MappedIterator.prototype.next = function () { return this.fn(this.iterator.next()); };
  2586. return MappedIterator;
  2587. }());
  2588. /***/ }),
  2589. /***/ "../../node_modules/monaco-editor/esm/vs/base/common/keyCodes.js":
  2590. /*!*************************************************************************************!*\
  2591. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/base/common/keyCodes.js ***!
  2592. \*************************************************************************************/
  2593. /*! exports provided: KeyCodeUtils, KeyChord, createKeybinding, createSimpleKeybinding, SimpleKeybinding, ChordKeybinding, ResolvedKeybindingPart, ResolvedKeybinding */
  2594. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2595. "use strict";
  2596. __webpack_require__.r(__webpack_exports__);
  2597. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCodeUtils", function() { return KeyCodeUtils; });
  2598. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyChord", function() { return KeyChord; });
  2599. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createKeybinding", function() { return createKeybinding; });
  2600. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createSimpleKeybinding", function() { return createSimpleKeybinding; });
  2601. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleKeybinding", function() { return SimpleKeybinding; });
  2602. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ChordKeybinding", function() { return ChordKeybinding; });
  2603. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybindingPart", function() { return ResolvedKeybindingPart; });
  2604. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResolvedKeybinding", function() { return ResolvedKeybinding; });
  2605. /* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./errors.js */ "../../node_modules/monaco-editor/esm/vs/base/common/errors.js");
  2606. /*---------------------------------------------------------------------------------------------
  2607. * Copyright (c) Microsoft Corporation. All rights reserved.
  2608. * Licensed under the MIT License. See License.txt in the project root for license information.
  2609. *--------------------------------------------------------------------------------------------*/
  2610. var KeyCodeStrMap = /** @class */ (function () {
  2611. function KeyCodeStrMap() {
  2612. this._keyCodeToStr = [];
  2613. this._strToKeyCode = Object.create(null);
  2614. }
  2615. KeyCodeStrMap.prototype.define = function (keyCode, str) {
  2616. this._keyCodeToStr[keyCode] = str;
  2617. this._strToKeyCode[str.toLowerCase()] = keyCode;
  2618. };
  2619. KeyCodeStrMap.prototype.keyCodeToStr = function (keyCode) {
  2620. return this._keyCodeToStr[keyCode];
  2621. };
  2622. KeyCodeStrMap.prototype.strToKeyCode = function (str) {
  2623. return this._strToKeyCode[str.toLowerCase()] || 0 /* Unknown */;
  2624. };
  2625. return KeyCodeStrMap;
  2626. }());
  2627. var uiMap = new KeyCodeStrMap();
  2628. var userSettingsUSMap = new KeyCodeStrMap();
  2629. var userSettingsGeneralMap = new KeyCodeStrMap();
  2630. (function () {
  2631. function define(keyCode, uiLabel, usUserSettingsLabel, generalUserSettingsLabel) {
  2632. if (usUserSettingsLabel === void 0) { usUserSettingsLabel = uiLabel; }
  2633. if (generalUserSettingsLabel === void 0) { generalUserSettingsLabel = usUserSettingsLabel; }
  2634. uiMap.define(keyCode, uiLabel);
  2635. userSettingsUSMap.define(keyCode, usUserSettingsLabel);
  2636. userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel);
  2637. }
  2638. define(0 /* Unknown */, 'unknown');
  2639. define(1 /* Backspace */, 'Backspace');
  2640. define(2 /* Tab */, 'Tab');
  2641. define(3 /* Enter */, 'Enter');
  2642. define(4 /* Shift */, 'Shift');
  2643. define(5 /* Ctrl */, 'Ctrl');
  2644. define(6 /* Alt */, 'Alt');
  2645. define(7 /* PauseBreak */, 'PauseBreak');
  2646. define(8 /* CapsLock */, 'CapsLock');
  2647. define(9 /* Escape */, 'Escape');
  2648. define(10 /* Space */, 'Space');
  2649. define(11 /* PageUp */, 'PageUp');
  2650. define(12 /* PageDown */, 'PageDown');
  2651. define(13 /* End */, 'End');
  2652. define(14 /* Home */, 'Home');
  2653. define(15 /* LeftArrow */, 'LeftArrow', 'Left');
  2654. define(16 /* UpArrow */, 'UpArrow', 'Up');
  2655. define(17 /* RightArrow */, 'RightArrow', 'Right');
  2656. define(18 /* DownArrow */, 'DownArrow', 'Down');
  2657. define(19 /* Insert */, 'Insert');
  2658. define(20 /* Delete */, 'Delete');
  2659. define(21 /* KEY_0 */, '0');
  2660. define(22 /* KEY_1 */, '1');
  2661. define(23 /* KEY_2 */, '2');
  2662. define(24 /* KEY_3 */, '3');
  2663. define(25 /* KEY_4 */, '4');
  2664. define(26 /* KEY_5 */, '5');
  2665. define(27 /* KEY_6 */, '6');
  2666. define(28 /* KEY_7 */, '7');
  2667. define(29 /* KEY_8 */, '8');
  2668. define(30 /* KEY_9 */, '9');
  2669. define(31 /* KEY_A */, 'A');
  2670. define(32 /* KEY_B */, 'B');
  2671. define(33 /* KEY_C */, 'C');
  2672. define(34 /* KEY_D */, 'D');
  2673. define(35 /* KEY_E */, 'E');
  2674. define(36 /* KEY_F */, 'F');
  2675. define(37 /* KEY_G */, 'G');
  2676. define(38 /* KEY_H */, 'H');
  2677. define(39 /* KEY_I */, 'I');
  2678. define(40 /* KEY_J */, 'J');
  2679. define(41 /* KEY_K */, 'K');
  2680. define(42 /* KEY_L */, 'L');
  2681. define(43 /* KEY_M */, 'M');
  2682. define(44 /* KEY_N */, 'N');
  2683. define(45 /* KEY_O */, 'O');
  2684. define(46 /* KEY_P */, 'P');
  2685. define(47 /* KEY_Q */, 'Q');
  2686. define(48 /* KEY_R */, 'R');
  2687. define(49 /* KEY_S */, 'S');
  2688. define(50 /* KEY_T */, 'T');
  2689. define(51 /* KEY_U */, 'U');
  2690. define(52 /* KEY_V */, 'V');
  2691. define(53 /* KEY_W */, 'W');
  2692. define(54 /* KEY_X */, 'X');
  2693. define(55 /* KEY_Y */, 'Y');
  2694. define(56 /* KEY_Z */, 'Z');
  2695. define(57 /* Meta */, 'Meta');
  2696. define(58 /* ContextMenu */, 'ContextMenu');
  2697. define(59 /* F1 */, 'F1');
  2698. define(60 /* F2 */, 'F2');
  2699. define(61 /* F3 */, 'F3');
  2700. define(62 /* F4 */, 'F4');
  2701. define(63 /* F5 */, 'F5');
  2702. define(64 /* F6 */, 'F6');
  2703. define(65 /* F7 */, 'F7');
  2704. define(66 /* F8 */, 'F8');
  2705. define(67 /* F9 */, 'F9');
  2706. define(68 /* F10 */, 'F10');
  2707. define(69 /* F11 */, 'F11');
  2708. define(70 /* F12 */, 'F12');
  2709. define(71 /* F13 */, 'F13');
  2710. define(72 /* F14 */, 'F14');
  2711. define(73 /* F15 */, 'F15');
  2712. define(74 /* F16 */, 'F16');
  2713. define(75 /* F17 */, 'F17');
  2714. define(76 /* F18 */, 'F18');
  2715. define(77 /* F19 */, 'F19');
  2716. define(78 /* NumLock */, 'NumLock');
  2717. define(79 /* ScrollLock */, 'ScrollLock');
  2718. define(80 /* US_SEMICOLON */, ';', ';', 'OEM_1');
  2719. define(81 /* US_EQUAL */, '=', '=', 'OEM_PLUS');
  2720. define(82 /* US_COMMA */, ',', ',', 'OEM_COMMA');
  2721. define(83 /* US_MINUS */, '-', '-', 'OEM_MINUS');
  2722. define(84 /* US_DOT */, '.', '.', 'OEM_PERIOD');
  2723. define(85 /* US_SLASH */, '/', '/', 'OEM_2');
  2724. define(86 /* US_BACKTICK */, '`', '`', 'OEM_3');
  2725. define(110 /* ABNT_C1 */, 'ABNT_C1');
  2726. define(111 /* ABNT_C2 */, 'ABNT_C2');
  2727. define(87 /* US_OPEN_SQUARE_BRACKET */, '[', '[', 'OEM_4');
  2728. define(88 /* US_BACKSLASH */, '\\', '\\', 'OEM_5');
  2729. define(89 /* US_CLOSE_SQUARE_BRACKET */, ']', ']', 'OEM_6');
  2730. define(90 /* US_QUOTE */, '\'', '\'', 'OEM_7');
  2731. define(91 /* OEM_8 */, 'OEM_8');
  2732. define(92 /* OEM_102 */, 'OEM_102');
  2733. define(93 /* NUMPAD_0 */, 'NumPad0');
  2734. define(94 /* NUMPAD_1 */, 'NumPad1');
  2735. define(95 /* NUMPAD_2 */, 'NumPad2');
  2736. define(96 /* NUMPAD_3 */, 'NumPad3');
  2737. define(97 /* NUMPAD_4 */, 'NumPad4');
  2738. define(98 /* NUMPAD_5 */, 'NumPad5');
  2739. define(99 /* NUMPAD_6 */, 'NumPad6');
  2740. define(100 /* NUMPAD_7 */, 'NumPad7');
  2741. define(101 /* NUMPAD_8 */, 'NumPad8');
  2742. define(102 /* NUMPAD_9 */, 'NumPad9');
  2743. define(103 /* NUMPAD_MULTIPLY */, 'NumPad_Multiply');
  2744. define(104 /* NUMPAD_ADD */, 'NumPad_Add');
  2745. define(105 /* NUMPAD_SEPARATOR */, 'NumPad_Separator');
  2746. define(106 /* NUMPAD_SUBTRACT */, 'NumPad_Subtract');
  2747. define(107 /* NUMPAD_DECIMAL */, 'NumPad_Decimal');
  2748. define(108 /* NUMPAD_DIVIDE */, 'NumPad_Divide');
  2749. })();
  2750. var KeyCodeUtils;
  2751. (function (KeyCodeUtils) {
  2752. function toString(keyCode) {
  2753. return uiMap.keyCodeToStr(keyCode);
  2754. }
  2755. KeyCodeUtils.toString = toString;
  2756. function fromString(key) {
  2757. return uiMap.strToKeyCode(key);
  2758. }
  2759. KeyCodeUtils.fromString = fromString;
  2760. function toUserSettingsUS(keyCode) {
  2761. return userSettingsUSMap.keyCodeToStr(keyCode);
  2762. }
  2763. KeyCodeUtils.toUserSettingsUS = toUserSettingsUS;
  2764. function toUserSettingsGeneral(keyCode) {
  2765. return userSettingsGeneralMap.keyCodeToStr(keyCode);
  2766. }
  2767. KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral;
  2768. function fromUserSettings(key) {
  2769. return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key);
  2770. }
  2771. KeyCodeUtils.fromUserSettings = fromUserSettings;
  2772. })(KeyCodeUtils || (KeyCodeUtils = {}));
  2773. function KeyChord(firstPart, secondPart) {
  2774. var chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0;
  2775. return (firstPart | chordPart) >>> 0;
  2776. }
  2777. function createKeybinding(keybinding, OS) {
  2778. if (keybinding === 0) {
  2779. return null;
  2780. }
  2781. var firstPart = (keybinding & 0x0000FFFF) >>> 0;
  2782. var chordPart = (keybinding & 0xFFFF0000) >>> 16;
  2783. if (chordPart !== 0) {
  2784. return new ChordKeybinding([
  2785. createSimpleKeybinding(firstPart, OS),
  2786. createSimpleKeybinding(chordPart, OS)
  2787. ]);
  2788. }
  2789. return new ChordKeybinding([createSimpleKeybinding(firstPart, OS)]);
  2790. }
  2791. function createSimpleKeybinding(keybinding, OS) {
  2792. var ctrlCmd = (keybinding & 2048 /* CtrlCmd */ ? true : false);
  2793. var winCtrl = (keybinding & 256 /* WinCtrl */ ? true : false);
  2794. var ctrlKey = (OS === 2 /* Macintosh */ ? winCtrl : ctrlCmd);
  2795. var shiftKey = (keybinding & 1024 /* Shift */ ? true : false);
  2796. var altKey = (keybinding & 512 /* Alt */ ? true : false);
  2797. var metaKey = (OS === 2 /* Macintosh */ ? ctrlCmd : winCtrl);
  2798. var keyCode = (keybinding & 255 /* KeyCode */);
  2799. return new SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode);
  2800. }
  2801. var SimpleKeybinding = /** @class */ (function () {
  2802. function SimpleKeybinding(ctrlKey, shiftKey, altKey, metaKey, keyCode) {
  2803. this.ctrlKey = ctrlKey;
  2804. this.shiftKey = shiftKey;
  2805. this.altKey = altKey;
  2806. this.metaKey = metaKey;
  2807. this.keyCode = keyCode;
  2808. }
  2809. SimpleKeybinding.prototype.equals = function (other) {
  2810. return (this.ctrlKey === other.ctrlKey
  2811. && this.shiftKey === other.shiftKey
  2812. && this.altKey === other.altKey
  2813. && this.metaKey === other.metaKey
  2814. && this.keyCode === other.keyCode);
  2815. };
  2816. SimpleKeybinding.prototype.isModifierKey = function () {
  2817. return (this.keyCode === 0 /* Unknown */
  2818. || this.keyCode === 5 /* Ctrl */
  2819. || this.keyCode === 57 /* Meta */
  2820. || this.keyCode === 6 /* Alt */
  2821. || this.keyCode === 4 /* Shift */);
  2822. };
  2823. SimpleKeybinding.prototype.toChord = function () {
  2824. return new ChordKeybinding([this]);
  2825. };
  2826. /**
  2827. * Does this keybinding refer to the key code of a modifier and it also has the modifier flag?
  2828. */
  2829. SimpleKeybinding.prototype.isDuplicateModifierCase = function () {
  2830. return ((this.ctrlKey && this.keyCode === 5 /* Ctrl */)
  2831. || (this.shiftKey && this.keyCode === 4 /* Shift */)
  2832. || (this.altKey && this.keyCode === 6 /* Alt */)
  2833. || (this.metaKey && this.keyCode === 57 /* Meta */));
  2834. };
  2835. return SimpleKeybinding;
  2836. }());
  2837. var ChordKeybinding = /** @class */ (function () {
  2838. function ChordKeybinding(parts) {
  2839. if (parts.length === 0) {
  2840. throw Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["illegalArgument"])("parts");
  2841. }
  2842. this.parts = parts;
  2843. }
  2844. ChordKeybinding.prototype.equals = function (other) {
  2845. if (other === null) {
  2846. return false;
  2847. }
  2848. if (this.parts.length !== other.parts.length) {
  2849. return false;
  2850. }
  2851. for (var i = 0; i < this.parts.length; i++) {
  2852. if (!this.parts[i].equals(other.parts[i])) {
  2853. return false;
  2854. }
  2855. }
  2856. return true;
  2857. };
  2858. return ChordKeybinding;
  2859. }());
  2860. var ResolvedKeybindingPart = /** @class */ (function () {
  2861. function ResolvedKeybindingPart(ctrlKey, shiftKey, altKey, metaKey, kbLabel, kbAriaLabel) {
  2862. this.ctrlKey = ctrlKey;
  2863. this.shiftKey = shiftKey;
  2864. this.altKey = altKey;
  2865. this.metaKey = metaKey;
  2866. this.keyLabel = kbLabel;
  2867. this.keyAriaLabel = kbAriaLabel;
  2868. }
  2869. return ResolvedKeybindingPart;
  2870. }());
  2871. /**
  2872. * A resolved keybinding. Can be a simple keybinding or a chord keybinding.
  2873. */
  2874. var ResolvedKeybinding = /** @class */ (function () {
  2875. function ResolvedKeybinding() {
  2876. }
  2877. return ResolvedKeybinding;
  2878. }());
  2879. /***/ }),
  2880. /***/ "../../node_modules/monaco-editor/esm/vs/base/common/lifecycle.js":
  2881. /*!**************************************************************************************!*\
  2882. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/base/common/lifecycle.js ***!
  2883. \**************************************************************************************/
  2884. /*! exports provided: isDisposable, dispose, combinedDisposable, toDisposable, DisposableStore, Disposable, MutableDisposable, ImmortalReference */
  2885. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2886. "use strict";
  2887. __webpack_require__.r(__webpack_exports__);
  2888. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isDisposable", function() { return isDisposable; });
  2889. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispose", function() { return dispose; });
  2890. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combinedDisposable", function() { return combinedDisposable; });
  2891. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toDisposable", function() { return toDisposable; });
  2892. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DisposableStore", function() { return DisposableStore; });
  2893. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Disposable", function() { return Disposable; });
  2894. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MutableDisposable", function() { return MutableDisposable; });
  2895. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ImmortalReference", function() { return ImmortalReference; });
  2896. /**
  2897. * Enables logging of potentially leaked disposables.
  2898. *
  2899. * A disposable is considered leaked if it is not disposed or not registered as the child of
  2900. * another disposable. This tracking is very simple an only works for classes that either
  2901. * extend Disposable or use a DisposableStore. This means there are a lot of false positives.
  2902. */
  2903. var TRACK_DISPOSABLES = false;
  2904. var __is_disposable_tracked__ = '__is_disposable_tracked__';
  2905. function markTracked(x) {
  2906. if (!TRACK_DISPOSABLES) {
  2907. return;
  2908. }
  2909. if (x && x !== Disposable.None) {
  2910. try {
  2911. x[__is_disposable_tracked__] = true;
  2912. }
  2913. catch (_a) {
  2914. // noop
  2915. }
  2916. }
  2917. }
  2918. function trackDisposable(x) {
  2919. if (!TRACK_DISPOSABLES) {
  2920. return x;
  2921. }
  2922. var stack = new Error('Potentially leaked disposable').stack;
  2923. setTimeout(function () {
  2924. if (!x[__is_disposable_tracked__]) {
  2925. console.log(stack);
  2926. }
  2927. }, 3000);
  2928. return x;
  2929. }
  2930. function isDisposable(thing) {
  2931. return typeof thing.dispose === 'function'
  2932. && thing.dispose.length === 0;
  2933. }
  2934. function dispose(disposables) {
  2935. if (Array.isArray(disposables)) {
  2936. disposables.forEach(function (d) {
  2937. if (d) {
  2938. markTracked(d);
  2939. d.dispose();
  2940. }
  2941. });
  2942. return [];
  2943. }
  2944. else if (disposables) {
  2945. markTracked(disposables);
  2946. disposables.dispose();
  2947. return disposables;
  2948. }
  2949. else {
  2950. return undefined;
  2951. }
  2952. }
  2953. function combinedDisposable() {
  2954. var disposables = [];
  2955. for (var _i = 0; _i < arguments.length; _i++) {
  2956. disposables[_i] = arguments[_i];
  2957. }
  2958. disposables.forEach(markTracked);
  2959. return trackDisposable({ dispose: function () { return dispose(disposables); } });
  2960. }
  2961. function toDisposable(fn) {
  2962. var self = trackDisposable({
  2963. dispose: function () {
  2964. markTracked(self);
  2965. fn();
  2966. }
  2967. });
  2968. return self;
  2969. }
  2970. var DisposableStore = /** @class */ (function () {
  2971. function DisposableStore() {
  2972. this._toDispose = new Set();
  2973. this._isDisposed = false;
  2974. }
  2975. /**
  2976. * Dispose of all registered disposables and mark this object as disposed.
  2977. *
  2978. * Any future disposables added to this object will be disposed of on `add`.
  2979. */
  2980. DisposableStore.prototype.dispose = function () {
  2981. if (this._isDisposed) {
  2982. return;
  2983. }
  2984. markTracked(this);
  2985. this._isDisposed = true;
  2986. this.clear();
  2987. };
  2988. /**
  2989. * Dispose of all registered disposables but do not mark this object as disposed.
  2990. */
  2991. DisposableStore.prototype.clear = function () {
  2992. this._toDispose.forEach(function (item) { return item.dispose(); });
  2993. this._toDispose.clear();
  2994. };
  2995. DisposableStore.prototype.add = function (t) {
  2996. if (!t) {
  2997. return t;
  2998. }
  2999. if (t === this) {
  3000. throw new Error('Cannot register a disposable on itself!');
  3001. }
  3002. markTracked(t);
  3003. if (this._isDisposed) {
  3004. console.warn(new Error('Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!').stack);
  3005. }
  3006. else {
  3007. this._toDispose.add(t);
  3008. }
  3009. return t;
  3010. };
  3011. return DisposableStore;
  3012. }());
  3013. var Disposable = /** @class */ (function () {
  3014. function Disposable() {
  3015. this._store = new DisposableStore();
  3016. trackDisposable(this);
  3017. }
  3018. Disposable.prototype.dispose = function () {
  3019. markTracked(this);
  3020. this._store.dispose();
  3021. };
  3022. Disposable.prototype._register = function (t) {
  3023. if (t === this) {
  3024. throw new Error('Cannot register a disposable on itself!');
  3025. }
  3026. return this._store.add(t);
  3027. };
  3028. Disposable.None = Object.freeze({ dispose: function () { } });
  3029. return Disposable;
  3030. }());
  3031. /**
  3032. * Manages the lifecycle of a disposable value that may be changed.
  3033. *
  3034. * This ensures that when the disposable value is changed, the previously held disposable is disposed of. You can
  3035. * also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up.
  3036. */
  3037. var MutableDisposable = /** @class */ (function () {
  3038. function MutableDisposable() {
  3039. this._isDisposed = false;
  3040. trackDisposable(this);
  3041. }
  3042. Object.defineProperty(MutableDisposable.prototype, "value", {
  3043. get: function () {
  3044. return this._isDisposed ? undefined : this._value;
  3045. },
  3046. set: function (value) {
  3047. if (this._isDisposed || value === this._value) {
  3048. return;
  3049. }
  3050. if (this._value) {
  3051. this._value.dispose();
  3052. }
  3053. if (value) {
  3054. markTracked(value);
  3055. }
  3056. this._value = value;
  3057. },
  3058. enumerable: true,
  3059. configurable: true
  3060. });
  3061. MutableDisposable.prototype.clear = function () {
  3062. this.value = undefined;
  3063. };
  3064. MutableDisposable.prototype.dispose = function () {
  3065. this._isDisposed = true;
  3066. markTracked(this);
  3067. if (this._value) {
  3068. this._value.dispose();
  3069. }
  3070. this._value = undefined;
  3071. };
  3072. return MutableDisposable;
  3073. }());
  3074. var ImmortalReference = /** @class */ (function () {
  3075. function ImmortalReference(object) {
  3076. this.object = object;
  3077. }
  3078. ImmortalReference.prototype.dispose = function () { };
  3079. return ImmortalReference;
  3080. }());
  3081. /***/ }),
  3082. /***/ "../../node_modules/monaco-editor/esm/vs/base/common/linkedList.js":
  3083. /*!***************************************************************************************!*\
  3084. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/base/common/linkedList.js ***!
  3085. \***************************************************************************************/
  3086. /*! exports provided: LinkedList */
  3087. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3088. "use strict";
  3089. __webpack_require__.r(__webpack_exports__);
  3090. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkedList", function() { return LinkedList; });
  3091. /* harmony import */ var _iterator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./iterator.js */ "../../node_modules/monaco-editor/esm/vs/base/common/iterator.js");
  3092. /*---------------------------------------------------------------------------------------------
  3093. * Copyright (c) Microsoft Corporation. All rights reserved.
  3094. * Licensed under the MIT License. See License.txt in the project root for license information.
  3095. *--------------------------------------------------------------------------------------------*/
  3096. var Node = /** @class */ (function () {
  3097. function Node(element) {
  3098. this.element = element;
  3099. this.next = Node.Undefined;
  3100. this.prev = Node.Undefined;
  3101. }
  3102. Node.Undefined = new Node(undefined);
  3103. return Node;
  3104. }());
  3105. var LinkedList = /** @class */ (function () {
  3106. function LinkedList() {
  3107. this._first = Node.Undefined;
  3108. this._last = Node.Undefined;
  3109. this._size = 0;
  3110. }
  3111. Object.defineProperty(LinkedList.prototype, "size", {
  3112. get: function () {
  3113. return this._size;
  3114. },
  3115. enumerable: true,
  3116. configurable: true
  3117. });
  3118. LinkedList.prototype.isEmpty = function () {
  3119. return this._first === Node.Undefined;
  3120. };
  3121. LinkedList.prototype.clear = function () {
  3122. this._first = Node.Undefined;
  3123. this._last = Node.Undefined;
  3124. this._size = 0;
  3125. };
  3126. LinkedList.prototype.unshift = function (element) {
  3127. return this._insert(element, false);
  3128. };
  3129. LinkedList.prototype.push = function (element) {
  3130. return this._insert(element, true);
  3131. };
  3132. LinkedList.prototype._insert = function (element, atTheEnd) {
  3133. var _this = this;
  3134. var newNode = new Node(element);
  3135. if (this._first === Node.Undefined) {
  3136. this._first = newNode;
  3137. this._last = newNode;
  3138. }
  3139. else if (atTheEnd) {
  3140. // push
  3141. var oldLast = this._last;
  3142. this._last = newNode;
  3143. newNode.prev = oldLast;
  3144. oldLast.next = newNode;
  3145. }
  3146. else {
  3147. // unshift
  3148. var oldFirst = this._first;
  3149. this._first = newNode;
  3150. newNode.next = oldFirst;
  3151. oldFirst.prev = newNode;
  3152. }
  3153. this._size += 1;
  3154. var didRemove = false;
  3155. return function () {
  3156. if (!didRemove) {
  3157. didRemove = true;
  3158. _this._remove(newNode);
  3159. }
  3160. };
  3161. };
  3162. LinkedList.prototype.shift = function () {
  3163. if (this._first === Node.Undefined) {
  3164. return undefined;
  3165. }
  3166. else {
  3167. var res = this._first.element;
  3168. this._remove(this._first);
  3169. return res;
  3170. }
  3171. };
  3172. LinkedList.prototype.pop = function () {
  3173. if (this._last === Node.Undefined) {
  3174. return undefined;
  3175. }
  3176. else {
  3177. var res = this._last.element;
  3178. this._remove(this._last);
  3179. return res;
  3180. }
  3181. };
  3182. LinkedList.prototype._remove = function (node) {
  3183. if (node.prev !== Node.Undefined && node.next !== Node.Undefined) {
  3184. // middle
  3185. var anchor = node.prev;
  3186. anchor.next = node.next;
  3187. node.next.prev = anchor;
  3188. }
  3189. else if (node.prev === Node.Undefined && node.next === Node.Undefined) {
  3190. // only node
  3191. this._first = Node.Undefined;
  3192. this._last = Node.Undefined;
  3193. }
  3194. else if (node.next === Node.Undefined) {
  3195. // last
  3196. this._last = this._last.prev;
  3197. this._last.next = Node.Undefined;
  3198. }
  3199. else if (node.prev === Node.Undefined) {
  3200. // first
  3201. this._first = this._first.next;
  3202. this._first.prev = Node.Undefined;
  3203. }
  3204. // done
  3205. this._size -= 1;
  3206. };
  3207. LinkedList.prototype.iterator = function () {
  3208. var element;
  3209. var node = this._first;
  3210. return {
  3211. next: function () {
  3212. if (node === Node.Undefined) {
  3213. return _iterator_js__WEBPACK_IMPORTED_MODULE_0__["FIN"];
  3214. }
  3215. if (!element) {
  3216. element = { done: false, value: node.element };
  3217. }
  3218. else {
  3219. element.value = node.element;
  3220. }
  3221. node = node.next;
  3222. return element;
  3223. }
  3224. };
  3225. };
  3226. LinkedList.prototype.toArray = function () {
  3227. var result = [];
  3228. for (var node = this._first; node !== Node.Undefined; node = node.next) {
  3229. result.push(node.element);
  3230. }
  3231. return result;
  3232. };
  3233. return LinkedList;
  3234. }());
  3235. /***/ }),
  3236. /***/ "../../node_modules/monaco-editor/esm/vs/base/common/platform.js":
  3237. /*!*************************************************************************************!*\
  3238. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/base/common/platform.js ***!
  3239. \*************************************************************************************/
  3240. /*! exports provided: isWindows, isMacintosh, isLinux, isNative, isWeb, isIOS, globals, setImmediate, OS */
  3241. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3242. "use strict";
  3243. __webpack_require__.r(__webpack_exports__);
  3244. /* WEBPACK VAR INJECTION */(function(process, global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWindows", function() { return isWindows; });
  3245. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMacintosh", function() { return isMacintosh; });
  3246. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLinux", function() { return isLinux; });
  3247. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNative", function() { return isNative; });
  3248. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isWeb", function() { return isWeb; });
  3249. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isIOS", function() { return isIOS; });
  3250. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "globals", function() { return globals; });
  3251. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setImmediate", function() { return setImmediate; });
  3252. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OS", function() { return OS; });
  3253. /*---------------------------------------------------------------------------------------------
  3254. * Copyright (c) Microsoft Corporation. All rights reserved.
  3255. * Licensed under the MIT License. See License.txt in the project root for license information.
  3256. *--------------------------------------------------------------------------------------------*/
  3257. var LANGUAGE_DEFAULT = 'en';
  3258. var _isWindows = false;
  3259. var _isMacintosh = false;
  3260. var _isLinux = false;
  3261. var _isNative = false;
  3262. var _isWeb = false;
  3263. var _isIOS = false;
  3264. var _locale = undefined;
  3265. var _language = LANGUAGE_DEFAULT;
  3266. var _translationsConfigFile = undefined;
  3267. var _userAgent = undefined;
  3268. var isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer');
  3269. // OS detection
  3270. if (typeof navigator === 'object' && !isElectronRenderer) {
  3271. _userAgent = navigator.userAgent;
  3272. _isWindows = _userAgent.indexOf('Windows') >= 0;
  3273. _isMacintosh = _userAgent.indexOf('Macintosh') >= 0;
  3274. _isIOS = _userAgent.indexOf('Macintosh') >= 0 && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;
  3275. _isLinux = _userAgent.indexOf('Linux') >= 0;
  3276. _isWeb = true;
  3277. _locale = navigator.language;
  3278. _language = _locale;
  3279. }
  3280. else if (typeof process === 'object') {
  3281. _isWindows = (process.platform === 'win32');
  3282. _isMacintosh = (process.platform === 'darwin');
  3283. _isLinux = (process.platform === 'linux');
  3284. _locale = LANGUAGE_DEFAULT;
  3285. _language = LANGUAGE_DEFAULT;
  3286. var rawNlsConfig = process.env['VSCODE_NLS_CONFIG'];
  3287. if (rawNlsConfig) {
  3288. try {
  3289. var nlsConfig = JSON.parse(rawNlsConfig);
  3290. var resolved = nlsConfig.availableLanguages['*'];
  3291. _locale = nlsConfig.locale;
  3292. // VSCode's default language is 'en'
  3293. _language = resolved ? resolved : LANGUAGE_DEFAULT;
  3294. _translationsConfigFile = nlsConfig._translationsConfigFile;
  3295. }
  3296. catch (e) {
  3297. }
  3298. }
  3299. _isNative = true;
  3300. }
  3301. var _platform = 0 /* Web */;
  3302. if (_isMacintosh) {
  3303. _platform = 1 /* Mac */;
  3304. }
  3305. else if (_isWindows) {
  3306. _platform = 3 /* Windows */;
  3307. }
  3308. else if (_isLinux) {
  3309. _platform = 2 /* Linux */;
  3310. }
  3311. var isWindows = _isWindows;
  3312. var isMacintosh = _isMacintosh;
  3313. var isLinux = _isLinux;
  3314. var isNative = _isNative;
  3315. var isWeb = _isWeb;
  3316. var isIOS = _isIOS;
  3317. var _globals = (typeof self === 'object' ? self : typeof global === 'object' ? global : {});
  3318. var globals = _globals;
  3319. var setImmediate = (function defineSetImmediate() {
  3320. if (globals.setImmediate) {
  3321. return globals.setImmediate.bind(globals);
  3322. }
  3323. if (typeof globals.postMessage === 'function' && !globals.importScripts) {
  3324. var pending_1 = [];
  3325. globals.addEventListener('message', function (e) {
  3326. if (e.data && e.data.vscodeSetImmediateId) {
  3327. for (var i = 0, len = pending_1.length; i < len; i++) {
  3328. var candidate = pending_1[i];
  3329. if (candidate.id === e.data.vscodeSetImmediateId) {
  3330. pending_1.splice(i, 1);
  3331. candidate.callback();
  3332. return;
  3333. }
  3334. }
  3335. }
  3336. });
  3337. var lastId_1 = 0;
  3338. return function (callback) {
  3339. var myId = ++lastId_1;
  3340. pending_1.push({
  3341. id: myId,
  3342. callback: callback
  3343. });
  3344. globals.postMessage({ vscodeSetImmediateId: myId }, '*');
  3345. };
  3346. }
  3347. if (typeof process !== 'undefined' && typeof process.nextTick === 'function') {
  3348. return process.nextTick.bind(process);
  3349. }
  3350. var _promise = Promise.resolve();
  3351. return function (callback) { return _promise.then(callback); };
  3352. })();
  3353. var OS = (_isMacintosh ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */));
  3354. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../process/browser.js */ "../../node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js")))
  3355. /***/ }),
  3356. /***/ "../../node_modules/monaco-editor/esm/vs/base/common/strings.js":
  3357. /*!************************************************************************************!*\
  3358. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/base/common/strings.js ***!
  3359. \************************************************************************************/
  3360. /*! exports provided: isFalsyOrWhitespace, pad, format, escape, escapeRegExpCharacters, trim, ltrim, rtrim, convertSimple2RegExpPattern, startsWith, endsWith, createRegExp, regExpLeadsToEndlessLoop, regExpFlags, firstNonWhitespaceIndex, getLeadingWhitespace, lastNonWhitespaceIndex, compare, compareIgnoreCase, isLowerAsciiLetter, isUpperAsciiLetter, equalsIgnoreCase, startsWithIgnoreCase, commonPrefixLength, commonSuffixLength, isHighSurrogate, isLowSurrogate, getNextCodePoint, nextCharLength, prevCharLength, containsRTL, containsEmoji, isBasicASCII, containsFullWidthCharacter, isFullWidthCharacter, isEmojiImprecise, UTF8_BOM_CHARACTER, startsWithUTF8BOM, safeBtoa, repeat, containsUppercaseCharacter, singleLetterHash, getGraphemeBreakType, breakBetweenGraphemeBreakType */
  3361. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3362. "use strict";
  3363. __webpack_require__.r(__webpack_exports__);
  3364. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFalsyOrWhitespace", function() { return isFalsyOrWhitespace; });
  3365. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return pad; });
  3366. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "format", function() { return format; });
  3367. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escape", function() { return escape; });
  3368. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "escapeRegExpCharacters", function() { return escapeRegExpCharacters; });
  3369. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "trim", function() { return trim; });
  3370. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ltrim", function() { return ltrim; });
  3371. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rtrim", function() { return rtrim; });
  3372. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "convertSimple2RegExpPattern", function() { return convertSimple2RegExpPattern; });
  3373. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWith", function() { return startsWith; });
  3374. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endsWith", function() { return endsWith; });
  3375. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRegExp", function() { return createRegExp; });
  3376. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regExpLeadsToEndlessLoop", function() { return regExpLeadsToEndlessLoop; });
  3377. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "regExpFlags", function() { return regExpFlags; });
  3378. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "firstNonWhitespaceIndex", function() { return firstNonWhitespaceIndex; });
  3379. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getLeadingWhitespace", function() { return getLeadingWhitespace; });
  3380. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lastNonWhitespaceIndex", function() { return lastNonWhitespaceIndex; });
  3381. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compare", function() { return compare; });
  3382. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareIgnoreCase", function() { return compareIgnoreCase; });
  3383. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowerAsciiLetter", function() { return isLowerAsciiLetter; });
  3384. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUpperAsciiLetter", function() { return isUpperAsciiLetter; });
  3385. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equalsIgnoreCase", function() { return equalsIgnoreCase; });
  3386. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithIgnoreCase", function() { return startsWithIgnoreCase; });
  3387. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonPrefixLength", function() { return commonPrefixLength; });
  3388. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "commonSuffixLength", function() { return commonSuffixLength; });
  3389. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isHighSurrogate", function() { return isHighSurrogate; });
  3390. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isLowSurrogate", function() { return isLowSurrogate; });
  3391. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNextCodePoint", function() { return getNextCodePoint; });
  3392. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nextCharLength", function() { return nextCharLength; });
  3393. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prevCharLength", function() { return prevCharLength; });
  3394. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsRTL", function() { return containsRTL; });
  3395. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsEmoji", function() { return containsEmoji; });
  3396. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBasicASCII", function() { return isBasicASCII; });
  3397. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsFullWidthCharacter", function() { return containsFullWidthCharacter; });
  3398. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFullWidthCharacter", function() { return isFullWidthCharacter; });
  3399. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmojiImprecise", function() { return isEmojiImprecise; });
  3400. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UTF8_BOM_CHARACTER", function() { return UTF8_BOM_CHARACTER; });
  3401. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "startsWithUTF8BOM", function() { return startsWithUTF8BOM; });
  3402. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safeBtoa", function() { return safeBtoa; });
  3403. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return repeat; });
  3404. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "containsUppercaseCharacter", function() { return containsUppercaseCharacter; });
  3405. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "singleLetterHash", function() { return singleLetterHash; });
  3406. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getGraphemeBreakType", function() { return getGraphemeBreakType; });
  3407. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "breakBetweenGraphemeBreakType", function() { return breakBetweenGraphemeBreakType; });
  3408. /*---------------------------------------------------------------------------------------------
  3409. * Copyright (c) Microsoft Corporation. All rights reserved.
  3410. * Licensed under the MIT License. See License.txt in the project root for license information.
  3411. *--------------------------------------------------------------------------------------------*/
  3412. function isFalsyOrWhitespace(str) {
  3413. if (!str || typeof str !== 'string') {
  3414. return true;
  3415. }
  3416. return str.trim().length === 0;
  3417. }
  3418. /**
  3419. * @returns the provided number with the given number of preceding zeros.
  3420. */
  3421. function pad(n, l, char) {
  3422. if (char === void 0) { char = '0'; }
  3423. var str = '' + n;
  3424. var r = [str];
  3425. for (var i = str.length; i < l; i++) {
  3426. r.push(char);
  3427. }
  3428. return r.reverse().join('');
  3429. }
  3430. var _formatRegexp = /{(\d+)}/g;
  3431. /**
  3432. * Helper to produce a string with a variable number of arguments. Insert variable segments
  3433. * into the string using the {n} notation where N is the index of the argument following the string.
  3434. * @param value string to which formatting is applied
  3435. * @param args replacements for {n}-entries
  3436. */
  3437. function format(value) {
  3438. var args = [];
  3439. for (var _i = 1; _i < arguments.length; _i++) {
  3440. args[_i - 1] = arguments[_i];
  3441. }
  3442. if (args.length === 0) {
  3443. return value;
  3444. }
  3445. return value.replace(_formatRegexp, function (match, group) {
  3446. var idx = parseInt(group, 10);
  3447. return isNaN(idx) || idx < 0 || idx >= args.length ?
  3448. match :
  3449. args[idx];
  3450. });
  3451. }
  3452. /**
  3453. * Converts HTML characters inside the string to use entities instead. Makes the string safe from
  3454. * being used e.g. in HTMLElement.innerHTML.
  3455. */
  3456. function escape(html) {
  3457. return html.replace(/[<>&]/g, function (match) {
  3458. switch (match) {
  3459. case '<': return '&lt;';
  3460. case '>': return '&gt;';
  3461. case '&': return '&amp;';
  3462. default: return match;
  3463. }
  3464. });
  3465. }
  3466. /**
  3467. * Escapes regular expression characters in a given string
  3468. */
  3469. function escapeRegExpCharacters(value) {
  3470. return value.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g, '\\$&');
  3471. }
  3472. /**
  3473. * Removes all occurrences of needle from the beginning and end of haystack.
  3474. * @param haystack string to trim
  3475. * @param needle the thing to trim (default is a blank)
  3476. */
  3477. function trim(haystack, needle) {
  3478. if (needle === void 0) { needle = ' '; }
  3479. var trimmed = ltrim(haystack, needle);
  3480. return rtrim(trimmed, needle);
  3481. }
  3482. /**
  3483. * Removes all occurrences of needle from the beginning of haystack.
  3484. * @param haystack string to trim
  3485. * @param needle the thing to trim
  3486. */
  3487. function ltrim(haystack, needle) {
  3488. if (!haystack || !needle) {
  3489. return haystack;
  3490. }
  3491. var needleLen = needle.length;
  3492. if (needleLen === 0 || haystack.length === 0) {
  3493. return haystack;
  3494. }
  3495. var offset = 0;
  3496. while (haystack.indexOf(needle, offset) === offset) {
  3497. offset = offset + needleLen;
  3498. }
  3499. return haystack.substring(offset);
  3500. }
  3501. /**
  3502. * Removes all occurrences of needle from the end of haystack.
  3503. * @param haystack string to trim
  3504. * @param needle the thing to trim
  3505. */
  3506. function rtrim(haystack, needle) {
  3507. if (!haystack || !needle) {
  3508. return haystack;
  3509. }
  3510. var needleLen = needle.length, haystackLen = haystack.length;
  3511. if (needleLen === 0 || haystackLen === 0) {
  3512. return haystack;
  3513. }
  3514. var offset = haystackLen, idx = -1;
  3515. while (true) {
  3516. idx = haystack.lastIndexOf(needle, offset - 1);
  3517. if (idx === -1 || idx + needleLen !== offset) {
  3518. break;
  3519. }
  3520. if (idx === 0) {
  3521. return '';
  3522. }
  3523. offset = idx;
  3524. }
  3525. return haystack.substring(0, offset);
  3526. }
  3527. function convertSimple2RegExpPattern(pattern) {
  3528. return pattern.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, '\\$&').replace(/[\*]/g, '.*');
  3529. }
  3530. /**
  3531. * Determines if haystack starts with needle.
  3532. */
  3533. function startsWith(haystack, needle) {
  3534. if (haystack.length < needle.length) {
  3535. return false;
  3536. }
  3537. if (haystack === needle) {
  3538. return true;
  3539. }
  3540. for (var i = 0; i < needle.length; i++) {
  3541. if (haystack[i] !== needle[i]) {
  3542. return false;
  3543. }
  3544. }
  3545. return true;
  3546. }
  3547. /**
  3548. * Determines if haystack ends with needle.
  3549. */
  3550. function endsWith(haystack, needle) {
  3551. var diff = haystack.length - needle.length;
  3552. if (diff > 0) {
  3553. return haystack.indexOf(needle, diff) === diff;
  3554. }
  3555. else if (diff === 0) {
  3556. return haystack === needle;
  3557. }
  3558. else {
  3559. return false;
  3560. }
  3561. }
  3562. function createRegExp(searchString, isRegex, options) {
  3563. if (options === void 0) { options = {}; }
  3564. if (!searchString) {
  3565. throw new Error('Cannot create regex from empty string');
  3566. }
  3567. if (!isRegex) {
  3568. searchString = escapeRegExpCharacters(searchString);
  3569. }
  3570. if (options.wholeWord) {
  3571. if (!/\B/.test(searchString.charAt(0))) {
  3572. searchString = '\\b' + searchString;
  3573. }
  3574. if (!/\B/.test(searchString.charAt(searchString.length - 1))) {
  3575. searchString = searchString + '\\b';
  3576. }
  3577. }
  3578. var modifiers = '';
  3579. if (options.global) {
  3580. modifiers += 'g';
  3581. }
  3582. if (!options.matchCase) {
  3583. modifiers += 'i';
  3584. }
  3585. if (options.multiline) {
  3586. modifiers += 'm';
  3587. }
  3588. if (options.unicode) {
  3589. modifiers += 'u';
  3590. }
  3591. return new RegExp(searchString, modifiers);
  3592. }
  3593. function regExpLeadsToEndlessLoop(regexp) {
  3594. // Exit early if it's one of these special cases which are meant to match
  3595. // against an empty string
  3596. if (regexp.source === '^' || regexp.source === '^$' || regexp.source === '$' || regexp.source === '^\\s*$') {
  3597. return false;
  3598. }
  3599. // We check against an empty string. If the regular expression doesn't advance
  3600. // (e.g. ends in an endless loop) it will match an empty string.
  3601. var match = regexp.exec('');
  3602. return !!(match && regexp.lastIndex === 0);
  3603. }
  3604. function regExpFlags(regexp) {
  3605. return (regexp.global ? 'g' : '')
  3606. + (regexp.ignoreCase ? 'i' : '')
  3607. + (regexp.multiline ? 'm' : '')
  3608. + (regexp.unicode ? 'u' : '');
  3609. }
  3610. /**
  3611. * Returns first index of the string that is not whitespace.
  3612. * If string is empty or contains only whitespaces, returns -1
  3613. */
  3614. function firstNonWhitespaceIndex(str) {
  3615. for (var i = 0, len = str.length; i < len; i++) {
  3616. var chCode = str.charCodeAt(i);
  3617. if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) {
  3618. return i;
  3619. }
  3620. }
  3621. return -1;
  3622. }
  3623. /**
  3624. * Returns the leading whitespace of the string.
  3625. * If the string contains only whitespaces, returns entire string
  3626. */
  3627. function getLeadingWhitespace(str, start, end) {
  3628. if (start === void 0) { start = 0; }
  3629. if (end === void 0) { end = str.length; }
  3630. for (var i = start; i < end; i++) {
  3631. var chCode = str.charCodeAt(i);
  3632. if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) {
  3633. return str.substring(start, i);
  3634. }
  3635. }
  3636. return str.substring(start, end);
  3637. }
  3638. /**
  3639. * Returns last index of the string that is not whitespace.
  3640. * If string is empty or contains only whitespaces, returns -1
  3641. */
  3642. function lastNonWhitespaceIndex(str, startIndex) {
  3643. if (startIndex === void 0) { startIndex = str.length - 1; }
  3644. for (var i = startIndex; i >= 0; i--) {
  3645. var chCode = str.charCodeAt(i);
  3646. if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) {
  3647. return i;
  3648. }
  3649. }
  3650. return -1;
  3651. }
  3652. function compare(a, b) {
  3653. if (a < b) {
  3654. return -1;
  3655. }
  3656. else if (a > b) {
  3657. return 1;
  3658. }
  3659. else {
  3660. return 0;
  3661. }
  3662. }
  3663. function compareIgnoreCase(a, b) {
  3664. var len = Math.min(a.length, b.length);
  3665. for (var i = 0; i < len; i++) {
  3666. var codeA = a.charCodeAt(i);
  3667. var codeB = b.charCodeAt(i);
  3668. if (codeA === codeB) {
  3669. // equal
  3670. continue;
  3671. }
  3672. if (isUpperAsciiLetter(codeA)) {
  3673. codeA += 32;
  3674. }
  3675. if (isUpperAsciiLetter(codeB)) {
  3676. codeB += 32;
  3677. }
  3678. var diff = codeA - codeB;
  3679. if (diff === 0) {
  3680. // equal -> ignoreCase
  3681. continue;
  3682. }
  3683. else if (isLowerAsciiLetter(codeA) && isLowerAsciiLetter(codeB)) {
  3684. //
  3685. return diff;
  3686. }
  3687. else {
  3688. return compare(a.toLowerCase(), b.toLowerCase());
  3689. }
  3690. }
  3691. if (a.length < b.length) {
  3692. return -1;
  3693. }
  3694. else if (a.length > b.length) {
  3695. return 1;
  3696. }
  3697. else {
  3698. return 0;
  3699. }
  3700. }
  3701. function isLowerAsciiLetter(code) {
  3702. return code >= 97 /* a */ && code <= 122 /* z */;
  3703. }
  3704. function isUpperAsciiLetter(code) {
  3705. return code >= 65 /* A */ && code <= 90 /* Z */;
  3706. }
  3707. function isAsciiLetter(code) {
  3708. return isLowerAsciiLetter(code) || isUpperAsciiLetter(code);
  3709. }
  3710. function equalsIgnoreCase(a, b) {
  3711. return a.length === b.length && doEqualsIgnoreCase(a, b);
  3712. }
  3713. function doEqualsIgnoreCase(a, b, stopAt) {
  3714. if (stopAt === void 0) { stopAt = a.length; }
  3715. for (var i = 0; i < stopAt; i++) {
  3716. var codeA = a.charCodeAt(i);
  3717. var codeB = b.charCodeAt(i);
  3718. if (codeA === codeB) {
  3719. continue;
  3720. }
  3721. // a-z A-Z
  3722. if (isAsciiLetter(codeA) && isAsciiLetter(codeB)) {
  3723. var diff = Math.abs(codeA - codeB);
  3724. if (diff !== 0 && diff !== 32) {
  3725. return false;
  3726. }
  3727. }
  3728. // Any other charcode
  3729. else {
  3730. if (String.fromCharCode(codeA).toLowerCase() !== String.fromCharCode(codeB).toLowerCase()) {
  3731. return false;
  3732. }
  3733. }
  3734. }
  3735. return true;
  3736. }
  3737. function startsWithIgnoreCase(str, candidate) {
  3738. var candidateLength = candidate.length;
  3739. if (candidate.length > str.length) {
  3740. return false;
  3741. }
  3742. return doEqualsIgnoreCase(str, candidate, candidateLength);
  3743. }
  3744. /**
  3745. * @returns the length of the common prefix of the two strings.
  3746. */
  3747. function commonPrefixLength(a, b) {
  3748. var i, len = Math.min(a.length, b.length);
  3749. for (i = 0; i < len; i++) {
  3750. if (a.charCodeAt(i) !== b.charCodeAt(i)) {
  3751. return i;
  3752. }
  3753. }
  3754. return len;
  3755. }
  3756. /**
  3757. * @returns the length of the common suffix of the two strings.
  3758. */
  3759. function commonSuffixLength(a, b) {
  3760. var i, len = Math.min(a.length, b.length);
  3761. var aLastIndex = a.length - 1;
  3762. var bLastIndex = b.length - 1;
  3763. for (i = 0; i < len; i++) {
  3764. if (a.charCodeAt(aLastIndex - i) !== b.charCodeAt(bLastIndex - i)) {
  3765. return i;
  3766. }
  3767. }
  3768. return len;
  3769. }
  3770. // --- unicode
  3771. // http://en.wikipedia.org/wiki/Surrogate_pair
  3772. // Returns the code point starting at a specified index in a string
  3773. // Code points U+0000 to U+D7FF and U+E000 to U+FFFF are represented on a single character
  3774. // Code points U+10000 to U+10FFFF are represented on two consecutive characters
  3775. //export function getUnicodePoint(str:string, index:number, len:number):number {
  3776. // const chrCode = str.charCodeAt(index);
  3777. // if (0xD800 <= chrCode && chrCode <= 0xDBFF && index + 1 < len) {
  3778. // const nextChrCode = str.charCodeAt(index + 1);
  3779. // if (0xDC00 <= nextChrCode && nextChrCode <= 0xDFFF) {
  3780. // return (chrCode - 0xD800) << 10 + (nextChrCode - 0xDC00) + 0x10000;
  3781. // }
  3782. // }
  3783. // return chrCode;
  3784. //}
  3785. function isHighSurrogate(charCode) {
  3786. return (0xD800 <= charCode && charCode <= 0xDBFF);
  3787. }
  3788. function isLowSurrogate(charCode) {
  3789. return (0xDC00 <= charCode && charCode <= 0xDFFF);
  3790. }
  3791. /**
  3792. * get the code point that begins at offset `offset`
  3793. */
  3794. function getNextCodePoint(str, len, offset) {
  3795. var charCode = str.charCodeAt(offset);
  3796. if (isHighSurrogate(charCode) && offset + 1 < len) {
  3797. var nextCharCode = str.charCodeAt(offset + 1);
  3798. if (isLowSurrogate(nextCharCode)) {
  3799. return ((charCode - 0xD800) << 10) + (nextCharCode - 0xDC00) + 0x10000;
  3800. }
  3801. }
  3802. return charCode;
  3803. }
  3804. /**
  3805. * get the code point that ends right before offset `offset`
  3806. */
  3807. function getPrevCodePoint(str, offset) {
  3808. var charCode = str.charCodeAt(offset - 1);
  3809. if (isLowSurrogate(charCode) && offset > 1) {
  3810. var prevCharCode = str.charCodeAt(offset - 2);
  3811. if (isHighSurrogate(prevCharCode)) {
  3812. return ((prevCharCode - 0xD800) << 10) + (charCode - 0xDC00) + 0x10000;
  3813. }
  3814. }
  3815. return charCode;
  3816. }
  3817. function nextCharLength(str, offset) {
  3818. var graphemeBreakTree = GraphemeBreakTree.getInstance();
  3819. var initialOffset = offset;
  3820. var len = str.length;
  3821. var initialCodePoint = getNextCodePoint(str, len, offset);
  3822. offset += (initialCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);
  3823. var graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(initialCodePoint);
  3824. while (offset < len) {
  3825. var nextCodePoint = getNextCodePoint(str, len, offset);
  3826. var nextGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(nextCodePoint);
  3827. if (breakBetweenGraphemeBreakType(graphemeBreakType, nextGraphemeBreakType)) {
  3828. break;
  3829. }
  3830. offset += (nextCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);
  3831. graphemeBreakType = nextGraphemeBreakType;
  3832. }
  3833. return (offset - initialOffset);
  3834. }
  3835. function prevCharLength(str, offset) {
  3836. var graphemeBreakTree = GraphemeBreakTree.getInstance();
  3837. var initialOffset = offset;
  3838. var initialCodePoint = getPrevCodePoint(str, offset);
  3839. offset -= (initialCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);
  3840. var graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(initialCodePoint);
  3841. while (offset > 0) {
  3842. var prevCodePoint = getPrevCodePoint(str, offset);
  3843. var prevGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(prevCodePoint);
  3844. if (breakBetweenGraphemeBreakType(prevGraphemeBreakType, graphemeBreakType)) {
  3845. break;
  3846. }
  3847. offset -= (prevCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);
  3848. graphemeBreakType = prevGraphemeBreakType;
  3849. }
  3850. return (initialOffset - offset);
  3851. }
  3852. /**
  3853. * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-rtl-test.js
  3854. */
  3855. var CONTAINS_RTL = /(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;
  3856. /**
  3857. * Returns true if `str` contains any Unicode character that is classified as "R" or "AL".
  3858. */
  3859. function containsRTL(str) {
  3860. return CONTAINS_RTL.test(str);
  3861. }
  3862. /**
  3863. * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-emoji-test.js
  3864. */
  3865. var CONTAINS_EMOJI = /(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDE73\uDE78-\uDE82\uDE90-\uDE95])/;
  3866. function containsEmoji(str) {
  3867. return CONTAINS_EMOJI.test(str);
  3868. }
  3869. var IS_BASIC_ASCII = /^[\t\n\r\x20-\x7E]*$/;
  3870. /**
  3871. * Returns true if `str` contains only basic ASCII characters in the range 32 - 126 (including 32 and 126) or \n, \r, \t
  3872. */
  3873. function isBasicASCII(str) {
  3874. return IS_BASIC_ASCII.test(str);
  3875. }
  3876. function containsFullWidthCharacter(str) {
  3877. for (var i = 0, len = str.length; i < len; i++) {
  3878. if (isFullWidthCharacter(str.charCodeAt(i))) {
  3879. return true;
  3880. }
  3881. }
  3882. return false;
  3883. }
  3884. function isFullWidthCharacter(charCode) {
  3885. // Do a cheap trick to better support wrapping of wide characters, treat them as 2 columns
  3886. // http://jrgraphix.net/research/unicode_blocks.php
  3887. // 2E80 — 2EFF CJK Radicals Supplement
  3888. // 2F00 — 2FDF Kangxi Radicals
  3889. // 2FF0 — 2FFF Ideographic Description Characters
  3890. // 3000 — 303F CJK Symbols and Punctuation
  3891. // 3040 — 309F Hiragana
  3892. // 30A0 — 30FF Katakana
  3893. // 3100 — 312F Bopomofo
  3894. // 3130 — 318F Hangul Compatibility Jamo
  3895. // 3190 — 319F Kanbun
  3896. // 31A0 — 31BF Bopomofo Extended
  3897. // 31F0 — 31FF Katakana Phonetic Extensions
  3898. // 3200 — 32FF Enclosed CJK Letters and Months
  3899. // 3300 — 33FF CJK Compatibility
  3900. // 3400 — 4DBF CJK Unified Ideographs Extension A
  3901. // 4DC0 — 4DFF Yijing Hexagram Symbols
  3902. // 4E00 — 9FFF CJK Unified Ideographs
  3903. // A000 — A48F Yi Syllables
  3904. // A490 — A4CF Yi Radicals
  3905. // AC00 — D7AF Hangul Syllables
  3906. // [IGNORE] D800 — DB7F High Surrogates
  3907. // [IGNORE] DB80 — DBFF High Private Use Surrogates
  3908. // [IGNORE] DC00 — DFFF Low Surrogates
  3909. // [IGNORE] E000 — F8FF Private Use Area
  3910. // F900 — FAFF CJK Compatibility Ideographs
  3911. // [IGNORE] FB00 — FB4F Alphabetic Presentation Forms
  3912. // [IGNORE] FB50 — FDFF Arabic Presentation Forms-A
  3913. // [IGNORE] FE00 — FE0F Variation Selectors
  3914. // [IGNORE] FE20 — FE2F Combining Half Marks
  3915. // [IGNORE] FE30 — FE4F CJK Compatibility Forms
  3916. // [IGNORE] FE50 — FE6F Small Form Variants
  3917. // [IGNORE] FE70 — FEFF Arabic Presentation Forms-B
  3918. // FF00 — FFEF Halfwidth and Fullwidth Forms
  3919. // [https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms]
  3920. // of which FF01 - FF5E fullwidth ASCII of 21 to 7E
  3921. // [IGNORE] and FF65 - FFDC halfwidth of Katakana and Hangul
  3922. // [IGNORE] FFF0 — FFFF Specials
  3923. charCode = +charCode; // @perf
  3924. return ((charCode >= 0x2E80 && charCode <= 0xD7AF)
  3925. || (charCode >= 0xF900 && charCode <= 0xFAFF)
  3926. || (charCode >= 0xFF01 && charCode <= 0xFF5E));
  3927. }
  3928. /**
  3929. * A fast function (therefore imprecise) to check if code points are emojis.
  3930. * Generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-emoji-test.js
  3931. */
  3932. function isEmojiImprecise(x) {
  3933. return ((x >= 0x1F1E6 && x <= 0x1F1FF) || (x >= 9728 && x <= 10175) || (x >= 127744 && x <= 128591)
  3934. || (x >= 128640 && x <= 128764) || (x >= 128992 && x <= 129003) || (x >= 129280 && x <= 129535)
  3935. || (x >= 129648 && x <= 129651) || (x >= 129656 && x <= 129666) || (x >= 129680 && x <= 129685));
  3936. }
  3937. // -- UTF-8 BOM
  3938. var UTF8_BOM_CHARACTER = String.fromCharCode(65279 /* UTF8_BOM */);
  3939. function startsWithUTF8BOM(str) {
  3940. return !!(str && str.length > 0 && str.charCodeAt(0) === 65279 /* UTF8_BOM */);
  3941. }
  3942. function safeBtoa(str) {
  3943. return btoa(encodeURIComponent(str)); // we use encodeURIComponent because btoa fails for non Latin 1 values
  3944. }
  3945. function repeat(s, count) {
  3946. var result = '';
  3947. for (var i = 0; i < count; i++) {
  3948. result += s;
  3949. }
  3950. return result;
  3951. }
  3952. function containsUppercaseCharacter(target, ignoreEscapedChars) {
  3953. if (ignoreEscapedChars === void 0) { ignoreEscapedChars = false; }
  3954. if (!target) {
  3955. return false;
  3956. }
  3957. if (ignoreEscapedChars) {
  3958. target = target.replace(/\\./g, '');
  3959. }
  3960. return target.toLowerCase() !== target;
  3961. }
  3962. /**
  3963. * Produces 'a'-'z', followed by 'A'-'Z'... followed by 'a'-'z', etc.
  3964. */
  3965. function singleLetterHash(n) {
  3966. var LETTERS_CNT = (90 /* Z */ - 65 /* A */ + 1);
  3967. n = n % (2 * LETTERS_CNT);
  3968. if (n < LETTERS_CNT) {
  3969. return String.fromCharCode(97 /* a */ + n);
  3970. }
  3971. return String.fromCharCode(65 /* A */ + n - LETTERS_CNT);
  3972. }
  3973. //#region Unicode Grapheme Break
  3974. function getGraphemeBreakType(codePoint) {
  3975. var graphemeBreakTree = GraphemeBreakTree.getInstance();
  3976. return graphemeBreakTree.getGraphemeBreakType(codePoint);
  3977. }
  3978. function breakBetweenGraphemeBreakType(breakTypeA, breakTypeB) {
  3979. // http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundary_Rules
  3980. // !!! Let's make the common case a bit faster
  3981. if (breakTypeA === 0 /* Other */) {
  3982. // see https://www.unicode.org/Public/13.0.0/ucd/auxiliary/GraphemeBreakTest-13.0.0d10.html#table
  3983. return (breakTypeB !== 5 /* Extend */ && breakTypeB !== 7 /* SpacingMark */);
  3984. }
  3985. // Do not break between a CR and LF. Otherwise, break before and after controls.
  3986. // GB3 CR × LF
  3987. // GB4 (Control | CR | LF) ÷
  3988. // GB5 ÷ (Control | CR | LF)
  3989. if (breakTypeA === 2 /* CR */) {
  3990. if (breakTypeB === 3 /* LF */) {
  3991. return false; // GB3
  3992. }
  3993. }
  3994. if (breakTypeA === 4 /* Control */ || breakTypeA === 2 /* CR */ || breakTypeA === 3 /* LF */) {
  3995. return true; // GB4
  3996. }
  3997. if (breakTypeB === 4 /* Control */ || breakTypeB === 2 /* CR */ || breakTypeB === 3 /* LF */) {
  3998. return true; // GB5
  3999. }
  4000. // Do not break Hangul syllable sequences.
  4001. // GB6 L × (L | V | LV | LVT)
  4002. // GB7 (LV | V) × (V | T)
  4003. // GB8 (LVT | T) × T
  4004. if (breakTypeA === 8 /* L */) {
  4005. if (breakTypeB === 8 /* L */ || breakTypeB === 9 /* V */ || breakTypeB === 11 /* LV */ || breakTypeB === 12 /* LVT */) {
  4006. return false; // GB6
  4007. }
  4008. }
  4009. if (breakTypeA === 11 /* LV */ || breakTypeA === 9 /* V */) {
  4010. if (breakTypeB === 9 /* V */ || breakTypeB === 10 /* T */) {
  4011. return false; // GB7
  4012. }
  4013. }
  4014. if (breakTypeA === 12 /* LVT */ || breakTypeA === 10 /* T */) {
  4015. if (breakTypeB === 10 /* T */) {
  4016. return false; // GB8
  4017. }
  4018. }
  4019. // Do not break before extending characters or ZWJ.
  4020. // GB9 × (Extend | ZWJ)
  4021. if (breakTypeB === 5 /* Extend */ || breakTypeB === 13 /* ZWJ */) {
  4022. return false; // GB9
  4023. }
  4024. // The GB9a and GB9b rules only apply to extended grapheme clusters:
  4025. // Do not break before SpacingMarks, or after Prepend characters.
  4026. // GB9a × SpacingMark
  4027. // GB9b Prepend ×
  4028. if (breakTypeB === 7 /* SpacingMark */) {
  4029. return false; // GB9a
  4030. }
  4031. if (breakTypeA === 1 /* Prepend */) {
  4032. return false; // GB9b
  4033. }
  4034. // Do not break within emoji modifier sequences or emoji zwj sequences.
  4035. // GB11 \p{Extended_Pictographic} Extend* ZWJ × \p{Extended_Pictographic}
  4036. if (breakTypeA === 13 /* ZWJ */ && breakTypeB === 14 /* Extended_Pictographic */) {
  4037. // Note: we are not implementing the rule entirely here to avoid introducing states
  4038. return false; // GB11
  4039. }
  4040. // GB12 sot (RI RI)* RI × RI
  4041. // GB13 [^RI] (RI RI)* RI × RI
  4042. if (breakTypeA === 6 /* Regional_Indicator */ && breakTypeB === 6 /* Regional_Indicator */) {
  4043. // Note: we are not implementing the rule entirely here to avoid introducing states
  4044. return false; // GB12 & GB13
  4045. }
  4046. // GB999 Any ÷ Any
  4047. return true;
  4048. }
  4049. var GraphemeBreakTree = /** @class */ (function () {
  4050. function GraphemeBreakTree() {
  4051. this._data = getGraphemeBreakRawData();
  4052. }
  4053. GraphemeBreakTree.getInstance = function () {
  4054. if (!GraphemeBreakTree._INSTANCE) {
  4055. GraphemeBreakTree._INSTANCE = new GraphemeBreakTree();
  4056. }
  4057. return GraphemeBreakTree._INSTANCE;
  4058. };
  4059. GraphemeBreakTree.prototype.getGraphemeBreakType = function (codePoint) {
  4060. // !!! Let's make 7bit ASCII a bit faster: 0..31
  4061. if (codePoint < 32) {
  4062. if (codePoint === 10 /* LineFeed */) {
  4063. return 3 /* LF */;
  4064. }
  4065. if (codePoint === 13 /* CarriageReturn */) {
  4066. return 2 /* CR */;
  4067. }
  4068. return 4 /* Control */;
  4069. }
  4070. // !!! Let's make 7bit ASCII a bit faster: 32..126
  4071. if (codePoint < 127) {
  4072. return 0 /* Other */;
  4073. }
  4074. var data = this._data;
  4075. var nodeCount = data.length / 3;
  4076. var nodeIndex = 1;
  4077. while (nodeIndex <= nodeCount) {
  4078. if (codePoint < data[3 * nodeIndex]) {
  4079. // go left
  4080. nodeIndex = 2 * nodeIndex;
  4081. }
  4082. else if (codePoint > data[3 * nodeIndex + 1]) {
  4083. // go right
  4084. nodeIndex = 2 * nodeIndex + 1;
  4085. }
  4086. else {
  4087. // hit
  4088. return data[3 * nodeIndex + 2];
  4089. }
  4090. }
  4091. return 0 /* Other */;
  4092. };
  4093. GraphemeBreakTree._INSTANCE = null;
  4094. return GraphemeBreakTree;
  4095. }());
  4096. function getGraphemeBreakRawData() {
  4097. // generated using https://github.com/alexandrudima/unicode-utils/blob/master/generate-grapheme-break.js
  4098. return JSON.parse('[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]');
  4099. }
  4100. //#endregion
  4101. /***/ }),
  4102. /***/ "../../node_modules/monaco-editor/esm/vs/base/common/types.js":
  4103. /*!**********************************************************************************!*\
  4104. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/base/common/types.js ***!
  4105. \**********************************************************************************/
  4106. /*! exports provided: isArray, isString, isObject, isNumber, isBoolean, isUndefined, isUndefinedOrNull, assertType, isEmptyObject, isFunction, validateConstraints, validateConstraint, getAllPropertyNames, getAllMethodNames, createProxyObject, withNullAsUndefined, withUndefinedAsNull */
  4107. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4108. "use strict";
  4109. __webpack_require__.r(__webpack_exports__);
  4110. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return isArray; });
  4111. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isString", function() { return isString; });
  4112. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isObject", function() { return isObject; });
  4113. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNumber", function() { return isNumber; });
  4114. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBoolean", function() { return isBoolean; });
  4115. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefined", function() { return isUndefined; });
  4116. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isUndefinedOrNull", function() { return isUndefinedOrNull; });
  4117. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "assertType", function() { return assertType; });
  4118. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEmptyObject", function() { return isEmptyObject; });
  4119. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFunction", function() { return isFunction; });
  4120. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateConstraints", function() { return validateConstraints; });
  4121. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "validateConstraint", function() { return validateConstraint; });
  4122. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllPropertyNames", function() { return getAllPropertyNames; });
  4123. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getAllMethodNames", function() { return getAllMethodNames; });
  4124. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createProxyObject", function() { return createProxyObject; });
  4125. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withNullAsUndefined", function() { return withNullAsUndefined; });
  4126. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withUndefinedAsNull", function() { return withUndefinedAsNull; });
  4127. /*---------------------------------------------------------------------------------------------
  4128. * Copyright (c) Microsoft Corporation. All rights reserved.
  4129. * Licensed under the MIT License. See License.txt in the project root for license information.
  4130. *--------------------------------------------------------------------------------------------*/
  4131. var _typeof = {
  4132. number: 'number',
  4133. string: 'string',
  4134. undefined: 'undefined',
  4135. object: 'object',
  4136. function: 'function'
  4137. };
  4138. /**
  4139. * @returns whether the provided parameter is a JavaScript Array or not.
  4140. */
  4141. function isArray(array) {
  4142. if (Array.isArray) {
  4143. return Array.isArray(array);
  4144. }
  4145. if (array && typeof (array.length) === _typeof.number && array.constructor === Array) {
  4146. return true;
  4147. }
  4148. return false;
  4149. }
  4150. /**
  4151. * @returns whether the provided parameter is a JavaScript String or not.
  4152. */
  4153. function isString(str) {
  4154. if (typeof (str) === _typeof.string || str instanceof String) {
  4155. return true;
  4156. }
  4157. return false;
  4158. }
  4159. /**
  4160. *
  4161. * @returns whether the provided parameter is of type `object` but **not**
  4162. * `null`, an `array`, a `regexp`, nor a `date`.
  4163. */
  4164. function isObject(obj) {
  4165. // The method can't do a type cast since there are type (like strings) which
  4166. // are subclasses of any put not positvely matched by the function. Hence type
  4167. // narrowing results in wrong results.
  4168. return typeof obj === _typeof.object
  4169. && obj !== null
  4170. && !Array.isArray(obj)
  4171. && !(obj instanceof RegExp)
  4172. && !(obj instanceof Date);
  4173. }
  4174. /**
  4175. * In **contrast** to just checking `typeof` this will return `false` for `NaN`.
  4176. * @returns whether the provided parameter is a JavaScript Number or not.
  4177. */
  4178. function isNumber(obj) {
  4179. if ((typeof (obj) === _typeof.number || obj instanceof Number) && !isNaN(obj)) {
  4180. return true;
  4181. }
  4182. return false;
  4183. }
  4184. /**
  4185. * @returns whether the provided parameter is a JavaScript Boolean or not.
  4186. */
  4187. function isBoolean(obj) {
  4188. return obj === true || obj === false;
  4189. }
  4190. /**
  4191. * @returns whether the provided parameter is undefined.
  4192. */
  4193. function isUndefined(obj) {
  4194. return typeof (obj) === _typeof.undefined;
  4195. }
  4196. /**
  4197. * @returns whether the provided parameter is undefined or null.
  4198. */
  4199. function isUndefinedOrNull(obj) {
  4200. return isUndefined(obj) || obj === null;
  4201. }
  4202. function assertType(condition, type) {
  4203. if (!condition) {
  4204. throw new Error(type ? "Unexpected type, expected '" + type + "'" : 'Unexpected type');
  4205. }
  4206. }
  4207. var hasOwnProperty = Object.prototype.hasOwnProperty;
  4208. /**
  4209. * @returns whether the provided parameter is an empty JavaScript Object or not.
  4210. */
  4211. function isEmptyObject(obj) {
  4212. if (!isObject(obj)) {
  4213. return false;
  4214. }
  4215. for (var key in obj) {
  4216. if (hasOwnProperty.call(obj, key)) {
  4217. return false;
  4218. }
  4219. }
  4220. return true;
  4221. }
  4222. /**
  4223. * @returns whether the provided parameter is a JavaScript Function or not.
  4224. */
  4225. function isFunction(obj) {
  4226. return typeof obj === _typeof.function;
  4227. }
  4228. function validateConstraints(args, constraints) {
  4229. var len = Math.min(args.length, constraints.length);
  4230. for (var i = 0; i < len; i++) {
  4231. validateConstraint(args[i], constraints[i]);
  4232. }
  4233. }
  4234. function validateConstraint(arg, constraint) {
  4235. if (isString(constraint)) {
  4236. if (typeof arg !== constraint) {
  4237. throw new Error("argument does not match constraint: typeof " + constraint);
  4238. }
  4239. }
  4240. else if (isFunction(constraint)) {
  4241. try {
  4242. if (arg instanceof constraint) {
  4243. return;
  4244. }
  4245. }
  4246. catch (_a) {
  4247. // ignore
  4248. }
  4249. if (!isUndefinedOrNull(arg) && arg.constructor === constraint) {
  4250. return;
  4251. }
  4252. if (constraint.length === 1 && constraint.call(undefined, arg) === true) {
  4253. return;
  4254. }
  4255. throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true");
  4256. }
  4257. }
  4258. function getAllPropertyNames(obj) {
  4259. var res = [];
  4260. var proto = Object.getPrototypeOf(obj);
  4261. while (Object.prototype !== proto) {
  4262. res = res.concat(Object.getOwnPropertyNames(proto));
  4263. proto = Object.getPrototypeOf(proto);
  4264. }
  4265. return res;
  4266. }
  4267. function getAllMethodNames(obj) {
  4268. var methods = [];
  4269. for (var _i = 0, _a = getAllPropertyNames(obj); _i < _a.length; _i++) {
  4270. var prop = _a[_i];
  4271. if (typeof obj[prop] === 'function') {
  4272. methods.push(prop);
  4273. }
  4274. }
  4275. return methods;
  4276. }
  4277. function createProxyObject(methodNames, invoke) {
  4278. var createProxyMethod = function (method) {
  4279. return function () {
  4280. var args = Array.prototype.slice.call(arguments, 0);
  4281. return invoke(method, args);
  4282. };
  4283. };
  4284. var result = {};
  4285. for (var _i = 0, methodNames_1 = methodNames; _i < methodNames_1.length; _i++) {
  4286. var methodName = methodNames_1[_i];
  4287. result[methodName] = createProxyMethod(methodName);
  4288. }
  4289. return result;
  4290. }
  4291. /**
  4292. * Converts null to undefined, passes all other values through.
  4293. */
  4294. function withNullAsUndefined(x) {
  4295. return x === null ? undefined : x;
  4296. }
  4297. /**
  4298. * Converts undefined to null, passes all other values through.
  4299. */
  4300. function withUndefinedAsNull(x) {
  4301. return typeof x === 'undefined' ? null : x;
  4302. }
  4303. /***/ }),
  4304. /***/ "../../node_modules/monaco-editor/esm/vs/base/common/uint.js":
  4305. /*!*********************************************************************************!*\
  4306. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/base/common/uint.js ***!
  4307. \*********************************************************************************/
  4308. /*! exports provided: toUint8, toUint32 */
  4309. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4310. "use strict";
  4311. __webpack_require__.r(__webpack_exports__);
  4312. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint8", function() { return toUint8; });
  4313. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toUint32", function() { return toUint32; });
  4314. /*---------------------------------------------------------------------------------------------
  4315. * Copyright (c) Microsoft Corporation. All rights reserved.
  4316. * Licensed under the MIT License. See License.txt in the project root for license information.
  4317. *--------------------------------------------------------------------------------------------*/
  4318. function toUint8(v) {
  4319. if (v < 0) {
  4320. return 0;
  4321. }
  4322. if (v > 255 /* MAX_UINT_8 */) {
  4323. return 255 /* MAX_UINT_8 */;
  4324. }
  4325. return v | 0;
  4326. }
  4327. function toUint32(v) {
  4328. if (v < 0) {
  4329. return 0;
  4330. }
  4331. if (v > 4294967295 /* MAX_UINT_32 */) {
  4332. return 4294967295 /* MAX_UINT_32 */;
  4333. }
  4334. return v | 0;
  4335. }
  4336. /***/ }),
  4337. /***/ "../../node_modules/monaco-editor/esm/vs/base/common/uri.js":
  4338. /*!********************************************************************************!*\
  4339. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/base/common/uri.js ***!
  4340. \********************************************************************************/
  4341. /*! exports provided: URI */
  4342. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4343. "use strict";
  4344. __webpack_require__.r(__webpack_exports__);
  4345. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "URI", function() { return URI; });
  4346. /* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./platform.js */ "../../node_modules/monaco-editor/esm/vs/base/common/platform.js");
  4347. /*---------------------------------------------------------------------------------------------
  4348. * Copyright (c) Microsoft Corporation. All rights reserved.
  4349. * Licensed under the MIT License. See License.txt in the project root for license information.
  4350. *--------------------------------------------------------------------------------------------*/
  4351. var __extends = (undefined && undefined.__extends) || (function () {
  4352. var extendStatics = function (d, b) {
  4353. extendStatics = Object.setPrototypeOf ||
  4354. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  4355. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  4356. return extendStatics(d, b);
  4357. };
  4358. return function (d, b) {
  4359. extendStatics(d, b);
  4360. function __() { this.constructor = d; }
  4361. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4362. };
  4363. })();
  4364. var _a;
  4365. var _schemePattern = /^\w[\w\d+.-]*$/;
  4366. var _singleSlashStart = /^\//;
  4367. var _doubleSlashStart = /^\/\//;
  4368. function _validateUri(ret, _strict) {
  4369. // scheme, must be set
  4370. if (!ret.scheme && _strict) {
  4371. throw new Error("[UriError]: Scheme is missing: {scheme: \"\", authority: \"" + ret.authority + "\", path: \"" + ret.path + "\", query: \"" + ret.query + "\", fragment: \"" + ret.fragment + "\"}");
  4372. }
  4373. // scheme, https://tools.ietf.org/html/rfc3986#section-3.1
  4374. // ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
  4375. if (ret.scheme && !_schemePattern.test(ret.scheme)) {
  4376. throw new Error('[UriError]: Scheme contains illegal characters.');
  4377. }
  4378. // path, http://tools.ietf.org/html/rfc3986#section-3.3
  4379. // If a URI contains an authority component, then the path component
  4380. // must either be empty or begin with a slash ("/") character. If a URI
  4381. // does not contain an authority component, then the path cannot begin
  4382. // with two slash characters ("//").
  4383. if (ret.path) {
  4384. if (ret.authority) {
  4385. if (!_singleSlashStart.test(ret.path)) {
  4386. throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character');
  4387. }
  4388. }
  4389. else {
  4390. if (_doubleSlashStart.test(ret.path)) {
  4391. throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
  4392. }
  4393. }
  4394. }
  4395. }
  4396. // for a while we allowed uris *without* schemes and this is the migration
  4397. // for them, e.g. an uri without scheme and without strict-mode warns and falls
  4398. // back to the file-scheme. that should cause the least carnage and still be a
  4399. // clear warning
  4400. function _schemeFix(scheme, _strict) {
  4401. if (!scheme && !_strict) {
  4402. return 'file';
  4403. }
  4404. return scheme;
  4405. }
  4406. // implements a bit of https://tools.ietf.org/html/rfc3986#section-5
  4407. function _referenceResolution(scheme, path) {
  4408. // the slash-character is our 'default base' as we don't
  4409. // support constructing URIs relative to other URIs. This
  4410. // also means that we alter and potentially break paths.
  4411. // see https://tools.ietf.org/html/rfc3986#section-5.1.4
  4412. switch (scheme) {
  4413. case 'https':
  4414. case 'http':
  4415. case 'file':
  4416. if (!path) {
  4417. path = _slash;
  4418. }
  4419. else if (path[0] !== _slash) {
  4420. path = _slash + path;
  4421. }
  4422. break;
  4423. }
  4424. return path;
  4425. }
  4426. var _empty = '';
  4427. var _slash = '/';
  4428. var _regexp = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
  4429. /**
  4430. * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.
  4431. * This class is a simple parser which creates the basic component parts
  4432. * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation
  4433. * and encoding.
  4434. *
  4435. * foo://example.com:8042/over/there?name=ferret#nose
  4436. * \_/ \______________/\_________/ \_________/ \__/
  4437. * | | | | |
  4438. * scheme authority path query fragment
  4439. * | _____________________|__
  4440. * / \ / \
  4441. * urn:example:animal:ferret:nose
  4442. */
  4443. var URI = /** @class */ (function () {
  4444. /**
  4445. * @internal
  4446. */
  4447. function URI(schemeOrData, authority, path, query, fragment, _strict) {
  4448. if (_strict === void 0) { _strict = false; }
  4449. if (typeof schemeOrData === 'object') {
  4450. this.scheme = schemeOrData.scheme || _empty;
  4451. this.authority = schemeOrData.authority || _empty;
  4452. this.path = schemeOrData.path || _empty;
  4453. this.query = schemeOrData.query || _empty;
  4454. this.fragment = schemeOrData.fragment || _empty;
  4455. // no validation because it's this URI
  4456. // that creates uri components.
  4457. // _validateUri(this);
  4458. }
  4459. else {
  4460. this.scheme = _schemeFix(schemeOrData, _strict);
  4461. this.authority = authority || _empty;
  4462. this.path = _referenceResolution(this.scheme, path || _empty);
  4463. this.query = query || _empty;
  4464. this.fragment = fragment || _empty;
  4465. _validateUri(this, _strict);
  4466. }
  4467. }
  4468. URI.isUri = function (thing) {
  4469. if (thing instanceof URI) {
  4470. return true;
  4471. }
  4472. if (!thing) {
  4473. return false;
  4474. }
  4475. return typeof thing.authority === 'string'
  4476. && typeof thing.fragment === 'string'
  4477. && typeof thing.path === 'string'
  4478. && typeof thing.query === 'string'
  4479. && typeof thing.scheme === 'string'
  4480. && typeof thing.fsPath === 'function'
  4481. && typeof thing.with === 'function'
  4482. && typeof thing.toString === 'function';
  4483. };
  4484. Object.defineProperty(URI.prototype, "fsPath", {
  4485. // ---- filesystem path -----------------------
  4486. /**
  4487. * Returns a string representing the corresponding file system path of this URI.
  4488. * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the
  4489. * platform specific path separator.
  4490. *
  4491. * * Will *not* validate the path for invalid characters and semantics.
  4492. * * Will *not* look at the scheme of this URI.
  4493. * * The result shall *not* be used for display purposes but for accessing a file on disk.
  4494. *
  4495. *
  4496. * The *difference* to `URI#path` is the use of the platform specific separator and the handling
  4497. * of UNC paths. See the below sample of a file-uri with an authority (UNC path).
  4498. *
  4499. * ```ts
  4500. const u = URI.parse('file://server/c$/folder/file.txt')
  4501. u.authority === 'server'
  4502. u.path === '/shares/c$/file.txt'
  4503. u.fsPath === '\\server\c$\folder\file.txt'
  4504. ```
  4505. *
  4506. * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,
  4507. * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working
  4508. * with URIs that represent files on disk (`file` scheme).
  4509. */
  4510. get: function () {
  4511. // if (this.scheme !== 'file') {
  4512. // console.warn(`[UriError] calling fsPath with scheme ${this.scheme}`);
  4513. // }
  4514. return _makeFsPath(this);
  4515. },
  4516. enumerable: true,
  4517. configurable: true
  4518. });
  4519. // ---- modify to new -------------------------
  4520. URI.prototype.with = function (change) {
  4521. if (!change) {
  4522. return this;
  4523. }
  4524. var scheme = change.scheme, authority = change.authority, path = change.path, query = change.query, fragment = change.fragment;
  4525. if (scheme === undefined) {
  4526. scheme = this.scheme;
  4527. }
  4528. else if (scheme === null) {
  4529. scheme = _empty;
  4530. }
  4531. if (authority === undefined) {
  4532. authority = this.authority;
  4533. }
  4534. else if (authority === null) {
  4535. authority = _empty;
  4536. }
  4537. if (path === undefined) {
  4538. path = this.path;
  4539. }
  4540. else if (path === null) {
  4541. path = _empty;
  4542. }
  4543. if (query === undefined) {
  4544. query = this.query;
  4545. }
  4546. else if (query === null) {
  4547. query = _empty;
  4548. }
  4549. if (fragment === undefined) {
  4550. fragment = this.fragment;
  4551. }
  4552. else if (fragment === null) {
  4553. fragment = _empty;
  4554. }
  4555. if (scheme === this.scheme
  4556. && authority === this.authority
  4557. && path === this.path
  4558. && query === this.query
  4559. && fragment === this.fragment) {
  4560. return this;
  4561. }
  4562. return new _URI(scheme, authority, path, query, fragment);
  4563. };
  4564. // ---- parse & validate ------------------------
  4565. /**
  4566. * Creates a new URI from a string, e.g. `http://www.msft.com/some/path`,
  4567. * `file:///usr/home`, or `scheme:with/path`.
  4568. *
  4569. * @param value A string which represents an URI (see `URI#toString`).
  4570. */
  4571. URI.parse = function (value, _strict) {
  4572. if (_strict === void 0) { _strict = false; }
  4573. var match = _regexp.exec(value);
  4574. if (!match) {
  4575. return new _URI(_empty, _empty, _empty, _empty, _empty);
  4576. }
  4577. return new _URI(match[2] || _empty, percentDecode(match[4] || _empty), percentDecode(match[5] || _empty), percentDecode(match[7] || _empty), percentDecode(match[9] || _empty), _strict);
  4578. };
  4579. /**
  4580. * Creates a new URI from a file system path, e.g. `c:\my\files`,
  4581. * `/usr/home`, or `\\server\share\some\path`.
  4582. *
  4583. * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument
  4584. * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**
  4585. * `URI.parse('file://' + path)` because the path might contain characters that are
  4586. * interpreted (# and ?). See the following sample:
  4587. * ```ts
  4588. const good = URI.file('/coding/c#/project1');
  4589. good.scheme === 'file';
  4590. good.path === '/coding/c#/project1';
  4591. good.fragment === '';
  4592. const bad = URI.parse('file://' + '/coding/c#/project1');
  4593. bad.scheme === 'file';
  4594. bad.path === '/coding/c'; // path is now broken
  4595. bad.fragment === '/project1';
  4596. ```
  4597. *
  4598. * @param path A file system path (see `URI#fsPath`)
  4599. */
  4600. URI.file = function (path) {
  4601. var authority = _empty;
  4602. // normalize to fwd-slashes on windows,
  4603. // on other systems bwd-slashes are valid
  4604. // filename character, eg /f\oo/ba\r.txt
  4605. if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"]) {
  4606. path = path.replace(/\\/g, _slash);
  4607. }
  4608. // check for authority as used in UNC shares
  4609. // or use the path as given
  4610. if (path[0] === _slash && path[1] === _slash) {
  4611. var idx = path.indexOf(_slash, 2);
  4612. if (idx === -1) {
  4613. authority = path.substring(2);
  4614. path = _slash;
  4615. }
  4616. else {
  4617. authority = path.substring(2, idx);
  4618. path = path.substring(idx) || _slash;
  4619. }
  4620. }
  4621. return new _URI('file', authority, path, _empty, _empty);
  4622. };
  4623. URI.from = function (components) {
  4624. return new _URI(components.scheme, components.authority, components.path, components.query, components.fragment);
  4625. };
  4626. // ---- printing/externalize ---------------------------
  4627. /**
  4628. * Creates a string representation for this URI. It's guaranteed that calling
  4629. * `URI.parse` with the result of this function creates an URI which is equal
  4630. * to this URI.
  4631. *
  4632. * * The result shall *not* be used for display purposes but for externalization or transport.
  4633. * * The result will be encoded using the percentage encoding and encoding happens mostly
  4634. * ignore the scheme-specific encoding rules.
  4635. *
  4636. * @param skipEncoding Do not encode the result, default is `false`
  4637. */
  4638. URI.prototype.toString = function (skipEncoding) {
  4639. if (skipEncoding === void 0) { skipEncoding = false; }
  4640. return _asFormatted(this, skipEncoding);
  4641. };
  4642. URI.prototype.toJSON = function () {
  4643. return this;
  4644. };
  4645. URI.revive = function (data) {
  4646. if (!data) {
  4647. return data;
  4648. }
  4649. else if (data instanceof URI) {
  4650. return data;
  4651. }
  4652. else {
  4653. var result = new _URI(data);
  4654. result._formatted = data.external;
  4655. result._fsPath = data._sep === _pathSepMarker ? data.fsPath : null;
  4656. return result;
  4657. }
  4658. };
  4659. return URI;
  4660. }());
  4661. var _pathSepMarker = _platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"] ? 1 : undefined;
  4662. // eslint-disable-next-line @typescript-eslint/class-name-casing
  4663. var _URI = /** @class */ (function (_super) {
  4664. __extends(_URI, _super);
  4665. function _URI() {
  4666. var _this = _super !== null && _super.apply(this, arguments) || this;
  4667. _this._formatted = null;
  4668. _this._fsPath = null;
  4669. return _this;
  4670. }
  4671. Object.defineProperty(_URI.prototype, "fsPath", {
  4672. get: function () {
  4673. if (!this._fsPath) {
  4674. this._fsPath = _makeFsPath(this);
  4675. }
  4676. return this._fsPath;
  4677. },
  4678. enumerable: true,
  4679. configurable: true
  4680. });
  4681. _URI.prototype.toString = function (skipEncoding) {
  4682. if (skipEncoding === void 0) { skipEncoding = false; }
  4683. if (!skipEncoding) {
  4684. if (!this._formatted) {
  4685. this._formatted = _asFormatted(this, false);
  4686. }
  4687. return this._formatted;
  4688. }
  4689. else {
  4690. // we don't cache that
  4691. return _asFormatted(this, true);
  4692. }
  4693. };
  4694. _URI.prototype.toJSON = function () {
  4695. var res = {
  4696. $mid: 1
  4697. };
  4698. // cached state
  4699. if (this._fsPath) {
  4700. res.fsPath = this._fsPath;
  4701. res._sep = _pathSepMarker;
  4702. }
  4703. if (this._formatted) {
  4704. res.external = this._formatted;
  4705. }
  4706. // uri components
  4707. if (this.path) {
  4708. res.path = this.path;
  4709. }
  4710. if (this.scheme) {
  4711. res.scheme = this.scheme;
  4712. }
  4713. if (this.authority) {
  4714. res.authority = this.authority;
  4715. }
  4716. if (this.query) {
  4717. res.query = this.query;
  4718. }
  4719. if (this.fragment) {
  4720. res.fragment = this.fragment;
  4721. }
  4722. return res;
  4723. };
  4724. return _URI;
  4725. }(URI));
  4726. // reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2
  4727. var encodeTable = (_a = {},
  4728. _a[58 /* Colon */] = '%3A',
  4729. _a[47 /* Slash */] = '%2F',
  4730. _a[63 /* QuestionMark */] = '%3F',
  4731. _a[35 /* Hash */] = '%23',
  4732. _a[91 /* OpenSquareBracket */] = '%5B',
  4733. _a[93 /* CloseSquareBracket */] = '%5D',
  4734. _a[64 /* AtSign */] = '%40',
  4735. _a[33 /* ExclamationMark */] = '%21',
  4736. _a[36 /* DollarSign */] = '%24',
  4737. _a[38 /* Ampersand */] = '%26',
  4738. _a[39 /* SingleQuote */] = '%27',
  4739. _a[40 /* OpenParen */] = '%28',
  4740. _a[41 /* CloseParen */] = '%29',
  4741. _a[42 /* Asterisk */] = '%2A',
  4742. _a[43 /* Plus */] = '%2B',
  4743. _a[44 /* Comma */] = '%2C',
  4744. _a[59 /* Semicolon */] = '%3B',
  4745. _a[61 /* Equals */] = '%3D',
  4746. _a[32 /* Space */] = '%20',
  4747. _a);
  4748. function encodeURIComponentFast(uriComponent, allowSlash) {
  4749. var res = undefined;
  4750. var nativeEncodePos = -1;
  4751. for (var pos = 0; pos < uriComponent.length; pos++) {
  4752. var code = uriComponent.charCodeAt(pos);
  4753. // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3
  4754. if ((code >= 97 /* a */ && code <= 122 /* z */)
  4755. || (code >= 65 /* A */ && code <= 90 /* Z */)
  4756. || (code >= 48 /* Digit0 */ && code <= 57 /* Digit9 */)
  4757. || code === 45 /* Dash */
  4758. || code === 46 /* Period */
  4759. || code === 95 /* Underline */
  4760. || code === 126 /* Tilde */
  4761. || (allowSlash && code === 47 /* Slash */)) {
  4762. // check if we are delaying native encode
  4763. if (nativeEncodePos !== -1) {
  4764. res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));
  4765. nativeEncodePos = -1;
  4766. }
  4767. // check if we write into a new string (by default we try to return the param)
  4768. if (res !== undefined) {
  4769. res += uriComponent.charAt(pos);
  4770. }
  4771. }
  4772. else {
  4773. // encoding needed, we need to allocate a new string
  4774. if (res === undefined) {
  4775. res = uriComponent.substr(0, pos);
  4776. }
  4777. // check with default table first
  4778. var escaped = encodeTable[code];
  4779. if (escaped !== undefined) {
  4780. // check if we are delaying native encode
  4781. if (nativeEncodePos !== -1) {
  4782. res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));
  4783. nativeEncodePos = -1;
  4784. }
  4785. // append escaped variant to result
  4786. res += escaped;
  4787. }
  4788. else if (nativeEncodePos === -1) {
  4789. // use native encode only when needed
  4790. nativeEncodePos = pos;
  4791. }
  4792. }
  4793. }
  4794. if (nativeEncodePos !== -1) {
  4795. res += encodeURIComponent(uriComponent.substring(nativeEncodePos));
  4796. }
  4797. return res !== undefined ? res : uriComponent;
  4798. }
  4799. function encodeURIComponentMinimal(path) {
  4800. var res = undefined;
  4801. for (var pos = 0; pos < path.length; pos++) {
  4802. var code = path.charCodeAt(pos);
  4803. if (code === 35 /* Hash */ || code === 63 /* QuestionMark */) {
  4804. if (res === undefined) {
  4805. res = path.substr(0, pos);
  4806. }
  4807. res += encodeTable[code];
  4808. }
  4809. else {
  4810. if (res !== undefined) {
  4811. res += path[pos];
  4812. }
  4813. }
  4814. }
  4815. return res !== undefined ? res : path;
  4816. }
  4817. /**
  4818. * Compute `fsPath` for the given uri
  4819. */
  4820. function _makeFsPath(uri) {
  4821. var value;
  4822. if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {
  4823. // unc path: file://shares/c$/far/boo
  4824. value = "//" + uri.authority + uri.path;
  4825. }
  4826. else if (uri.path.charCodeAt(0) === 47 /* Slash */
  4827. && (uri.path.charCodeAt(1) >= 65 /* A */ && uri.path.charCodeAt(1) <= 90 /* Z */ || uri.path.charCodeAt(1) >= 97 /* a */ && uri.path.charCodeAt(1) <= 122 /* z */)
  4828. && uri.path.charCodeAt(2) === 58 /* Colon */) {
  4829. // windows drive letter: file:///c:/far/boo
  4830. value = uri.path[1].toLowerCase() + uri.path.substr(2);
  4831. }
  4832. else {
  4833. // other path
  4834. value = uri.path;
  4835. }
  4836. if (_platform_js__WEBPACK_IMPORTED_MODULE_0__["isWindows"]) {
  4837. value = value.replace(/\//g, '\\');
  4838. }
  4839. return value;
  4840. }
  4841. /**
  4842. * Create the external version of a uri
  4843. */
  4844. function _asFormatted(uri, skipEncoding) {
  4845. var encoder = !skipEncoding
  4846. ? encodeURIComponentFast
  4847. : encodeURIComponentMinimal;
  4848. var res = '';
  4849. var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment;
  4850. if (scheme) {
  4851. res += scheme;
  4852. res += ':';
  4853. }
  4854. if (authority || scheme === 'file') {
  4855. res += _slash;
  4856. res += _slash;
  4857. }
  4858. if (authority) {
  4859. var idx = authority.indexOf('@');
  4860. if (idx !== -1) {
  4861. // <user>@<auth>
  4862. var userinfo = authority.substr(0, idx);
  4863. authority = authority.substr(idx + 1);
  4864. idx = userinfo.indexOf(':');
  4865. if (idx === -1) {
  4866. res += encoder(userinfo, false);
  4867. }
  4868. else {
  4869. // <user>:<pass>@<auth>
  4870. res += encoder(userinfo.substr(0, idx), false);
  4871. res += ':';
  4872. res += encoder(userinfo.substr(idx + 1), false);
  4873. }
  4874. res += '@';
  4875. }
  4876. authority = authority.toLowerCase();
  4877. idx = authority.indexOf(':');
  4878. if (idx === -1) {
  4879. res += encoder(authority, false);
  4880. }
  4881. else {
  4882. // <auth>:<port>
  4883. res += encoder(authority.substr(0, idx), false);
  4884. res += authority.substr(idx);
  4885. }
  4886. }
  4887. if (path) {
  4888. // lower-case windows drive letters in /C:/fff or C:/fff
  4889. if (path.length >= 3 && path.charCodeAt(0) === 47 /* Slash */ && path.charCodeAt(2) === 58 /* Colon */) {
  4890. var code = path.charCodeAt(1);
  4891. if (code >= 65 /* A */ && code <= 90 /* Z */) {
  4892. path = "/" + String.fromCharCode(code + 32) + ":" + path.substr(3); // "/c:".length === 3
  4893. }
  4894. }
  4895. else if (path.length >= 2 && path.charCodeAt(1) === 58 /* Colon */) {
  4896. var code = path.charCodeAt(0);
  4897. if (code >= 65 /* A */ && code <= 90 /* Z */) {
  4898. path = String.fromCharCode(code + 32) + ":" + path.substr(2); // "/c:".length === 3
  4899. }
  4900. }
  4901. // encode the rest of the path
  4902. res += encoder(path, true);
  4903. }
  4904. if (query) {
  4905. res += '?';
  4906. res += encoder(query, false);
  4907. }
  4908. if (fragment) {
  4909. res += '#';
  4910. res += !skipEncoding ? encodeURIComponentFast(fragment, false) : fragment;
  4911. }
  4912. return res;
  4913. }
  4914. // --- decode
  4915. function decodeURIComponentGraceful(str) {
  4916. try {
  4917. return decodeURIComponent(str);
  4918. }
  4919. catch (_a) {
  4920. if (str.length > 3) {
  4921. return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3));
  4922. }
  4923. else {
  4924. return str;
  4925. }
  4926. }
  4927. }
  4928. var _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g;
  4929. function percentDecode(str) {
  4930. if (!str.match(_rEncodedAsHex)) {
  4931. return str;
  4932. }
  4933. return str.replace(_rEncodedAsHex, function (match) { return decodeURIComponentGraceful(match); });
  4934. }
  4935. /***/ }),
  4936. /***/ "../../node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js":
  4937. /*!************************************************************************************************!*\
  4938. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js ***!
  4939. \************************************************************************************************/
  4940. /*! exports provided: logOnceWebWorkerWarning, SimpleWorkerClient, SimpleWorkerServer, create */
  4941. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4942. "use strict";
  4943. __webpack_require__.r(__webpack_exports__);
  4944. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logOnceWebWorkerWarning", function() { return logOnceWebWorkerWarning; });
  4945. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkerClient", function() { return SimpleWorkerClient; });
  4946. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SimpleWorkerServer", function() { return SimpleWorkerServer; });
  4947. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
  4948. /* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors.js */ "../../node_modules/monaco-editor/esm/vs/base/common/errors.js");
  4949. /* harmony import */ var _lifecycle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lifecycle.js */ "../../node_modules/monaco-editor/esm/vs/base/common/lifecycle.js");
  4950. /* harmony import */ var _platform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../platform.js */ "../../node_modules/monaco-editor/esm/vs/base/common/platform.js");
  4951. /* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../types.js */ "../../node_modules/monaco-editor/esm/vs/base/common/types.js");
  4952. /*---------------------------------------------------------------------------------------------
  4953. * Copyright (c) Microsoft Corporation. All rights reserved.
  4954. * Licensed under the MIT License. See License.txt in the project root for license information.
  4955. *--------------------------------------------------------------------------------------------*/
  4956. var __extends = (undefined && undefined.__extends) || (function () {
  4957. var extendStatics = function (d, b) {
  4958. extendStatics = Object.setPrototypeOf ||
  4959. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  4960. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  4961. return extendStatics(d, b);
  4962. };
  4963. return function (d, b) {
  4964. extendStatics(d, b);
  4965. function __() { this.constructor = d; }
  4966. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  4967. };
  4968. })();
  4969. var INITIALIZE = '$initialize';
  4970. var webWorkerWarningLogged = false;
  4971. function logOnceWebWorkerWarning(err) {
  4972. if (!_platform_js__WEBPACK_IMPORTED_MODULE_2__["isWeb"]) {
  4973. // running tests
  4974. return;
  4975. }
  4976. if (!webWorkerWarningLogged) {
  4977. webWorkerWarningLogged = true;
  4978. console.warn('Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq');
  4979. }
  4980. console.warn(err.message);
  4981. }
  4982. var SimpleWorkerProtocol = /** @class */ (function () {
  4983. function SimpleWorkerProtocol(handler) {
  4984. this._workerId = -1;
  4985. this._handler = handler;
  4986. this._lastSentReq = 0;
  4987. this._pendingReplies = Object.create(null);
  4988. }
  4989. SimpleWorkerProtocol.prototype.setWorkerId = function (workerId) {
  4990. this._workerId = workerId;
  4991. };
  4992. SimpleWorkerProtocol.prototype.sendMessage = function (method, args) {
  4993. var _this = this;
  4994. var req = String(++this._lastSentReq);
  4995. return new Promise(function (resolve, reject) {
  4996. _this._pendingReplies[req] = {
  4997. resolve: resolve,
  4998. reject: reject
  4999. };
  5000. _this._send({
  5001. vsWorker: _this._workerId,
  5002. req: req,
  5003. method: method,
  5004. args: args
  5005. });
  5006. });
  5007. };
  5008. SimpleWorkerProtocol.prototype.handleMessage = function (message) {
  5009. if (!message || !message.vsWorker) {
  5010. return;
  5011. }
  5012. if (this._workerId !== -1 && message.vsWorker !== this._workerId) {
  5013. return;
  5014. }
  5015. this._handleMessage(message);
  5016. };
  5017. SimpleWorkerProtocol.prototype._handleMessage = function (msg) {
  5018. var _this = this;
  5019. if (msg.seq) {
  5020. var replyMessage = msg;
  5021. if (!this._pendingReplies[replyMessage.seq]) {
  5022. console.warn('Got reply to unknown seq');
  5023. return;
  5024. }
  5025. var reply = this._pendingReplies[replyMessage.seq];
  5026. delete this._pendingReplies[replyMessage.seq];
  5027. if (replyMessage.err) {
  5028. var err = replyMessage.err;
  5029. if (replyMessage.err.$isError) {
  5030. err = new Error();
  5031. err.name = replyMessage.err.name;
  5032. err.message = replyMessage.err.message;
  5033. err.stack = replyMessage.err.stack;
  5034. }
  5035. reply.reject(err);
  5036. return;
  5037. }
  5038. reply.resolve(replyMessage.res);
  5039. return;
  5040. }
  5041. var requestMessage = msg;
  5042. var req = requestMessage.req;
  5043. var result = this._handler.handleMessage(requestMessage.method, requestMessage.args);
  5044. result.then(function (r) {
  5045. _this._send({
  5046. vsWorker: _this._workerId,
  5047. seq: req,
  5048. res: r,
  5049. err: undefined
  5050. });
  5051. }, function (e) {
  5052. if (e.detail instanceof Error) {
  5053. // Loading errors have a detail property that points to the actual error
  5054. e.detail = Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["transformErrorForSerialization"])(e.detail);
  5055. }
  5056. _this._send({
  5057. vsWorker: _this._workerId,
  5058. seq: req,
  5059. res: undefined,
  5060. err: Object(_errors_js__WEBPACK_IMPORTED_MODULE_0__["transformErrorForSerialization"])(e)
  5061. });
  5062. });
  5063. };
  5064. SimpleWorkerProtocol.prototype._send = function (msg) {
  5065. var transfer = [];
  5066. if (msg.req) {
  5067. var m = msg;
  5068. for (var i = 0; i < m.args.length; i++) {
  5069. if (m.args[i] instanceof ArrayBuffer) {
  5070. transfer.push(m.args[i]);
  5071. }
  5072. }
  5073. }
  5074. else {
  5075. var m = msg;
  5076. if (m.res instanceof ArrayBuffer) {
  5077. transfer.push(m.res);
  5078. }
  5079. }
  5080. this._handler.sendMessage(msg, transfer);
  5081. };
  5082. return SimpleWorkerProtocol;
  5083. }());
  5084. /**
  5085. * Main thread side
  5086. */
  5087. var SimpleWorkerClient = /** @class */ (function (_super) {
  5088. __extends(SimpleWorkerClient, _super);
  5089. function SimpleWorkerClient(workerFactory, moduleId, host) {
  5090. var _this = _super.call(this) || this;
  5091. var lazyProxyReject = null;
  5092. _this._worker = _this._register(workerFactory.create('vs/base/common/worker/simpleWorker', function (msg) {
  5093. _this._protocol.handleMessage(msg);
  5094. }, function (err) {
  5095. // in Firefox, web workers fail lazily :(
  5096. // we will reject the proxy
  5097. if (lazyProxyReject) {
  5098. lazyProxyReject(err);
  5099. }
  5100. }));
  5101. _this._protocol = new SimpleWorkerProtocol({
  5102. sendMessage: function (msg, transfer) {
  5103. _this._worker.postMessage(msg, transfer);
  5104. },
  5105. handleMessage: function (method, args) {
  5106. if (typeof host[method] !== 'function') {
  5107. return Promise.reject(new Error('Missing method ' + method + ' on main thread host.'));
  5108. }
  5109. try {
  5110. return Promise.resolve(host[method].apply(host, args));
  5111. }
  5112. catch (e) {
  5113. return Promise.reject(e);
  5114. }
  5115. }
  5116. });
  5117. _this._protocol.setWorkerId(_this._worker.getId());
  5118. // Gather loader configuration
  5119. var loaderConfiguration = null;
  5120. if (typeof self.require !== 'undefined' && typeof self.require.getConfig === 'function') {
  5121. // Get the configuration from the Monaco AMD Loader
  5122. loaderConfiguration = self.require.getConfig();
  5123. }
  5124. else if (typeof self.requirejs !== 'undefined') {
  5125. // Get the configuration from requirejs
  5126. loaderConfiguration = self.requirejs.s.contexts._.config;
  5127. }
  5128. var hostMethods = _types_js__WEBPACK_IMPORTED_MODULE_3__["getAllMethodNames"](host);
  5129. // Send initialize message
  5130. _this._onModuleLoaded = _this._protocol.sendMessage(INITIALIZE, [
  5131. _this._worker.getId(),
  5132. JSON.parse(JSON.stringify(loaderConfiguration)),
  5133. moduleId,
  5134. hostMethods,
  5135. ]);
  5136. // Create proxy to loaded code
  5137. var proxyMethodRequest = function (method, args) {
  5138. return _this._request(method, args);
  5139. };
  5140. _this._lazyProxy = new Promise(function (resolve, reject) {
  5141. lazyProxyReject = reject;
  5142. _this._onModuleLoaded.then(function (availableMethods) {
  5143. resolve(_types_js__WEBPACK_IMPORTED_MODULE_3__["createProxyObject"](availableMethods, proxyMethodRequest));
  5144. }, function (e) {
  5145. reject(e);
  5146. _this._onError('Worker failed to load ' + moduleId, e);
  5147. });
  5148. });
  5149. return _this;
  5150. }
  5151. SimpleWorkerClient.prototype.getProxyObject = function () {
  5152. return this._lazyProxy;
  5153. };
  5154. SimpleWorkerClient.prototype._request = function (method, args) {
  5155. var _this = this;
  5156. return new Promise(function (resolve, reject) {
  5157. _this._onModuleLoaded.then(function () {
  5158. _this._protocol.sendMessage(method, args).then(resolve, reject);
  5159. }, reject);
  5160. });
  5161. };
  5162. SimpleWorkerClient.prototype._onError = function (message, error) {
  5163. console.error(message);
  5164. console.info(error);
  5165. };
  5166. return SimpleWorkerClient;
  5167. }(_lifecycle_js__WEBPACK_IMPORTED_MODULE_1__["Disposable"]));
  5168. /**
  5169. * Worker side
  5170. */
  5171. var SimpleWorkerServer = /** @class */ (function () {
  5172. function SimpleWorkerServer(postMessage, requestHandlerFactory) {
  5173. var _this = this;
  5174. this._requestHandlerFactory = requestHandlerFactory;
  5175. this._requestHandler = null;
  5176. this._protocol = new SimpleWorkerProtocol({
  5177. sendMessage: function (msg, transfer) {
  5178. postMessage(msg, transfer);
  5179. },
  5180. handleMessage: function (method, args) { return _this._handleMessage(method, args); }
  5181. });
  5182. }
  5183. SimpleWorkerServer.prototype.onmessage = function (msg) {
  5184. this._protocol.handleMessage(msg);
  5185. };
  5186. SimpleWorkerServer.prototype._handleMessage = function (method, args) {
  5187. if (method === INITIALIZE) {
  5188. return this.initialize(args[0], args[1], args[2], args[3]);
  5189. }
  5190. if (!this._requestHandler || typeof this._requestHandler[method] !== 'function') {
  5191. return Promise.reject(new Error('Missing requestHandler or method: ' + method));
  5192. }
  5193. try {
  5194. return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args));
  5195. }
  5196. catch (e) {
  5197. return Promise.reject(e);
  5198. }
  5199. };
  5200. SimpleWorkerServer.prototype.initialize = function (workerId, loaderConfig, moduleId, hostMethods) {
  5201. var _this = this;
  5202. this._protocol.setWorkerId(workerId);
  5203. var proxyMethodRequest = function (method, args) {
  5204. return _this._protocol.sendMessage(method, args);
  5205. };
  5206. var hostProxy = _types_js__WEBPACK_IMPORTED_MODULE_3__["createProxyObject"](hostMethods, proxyMethodRequest);
  5207. if (this._requestHandlerFactory) {
  5208. // static request handler
  5209. this._requestHandler = this._requestHandlerFactory(hostProxy);
  5210. return Promise.resolve(_types_js__WEBPACK_IMPORTED_MODULE_3__["getAllMethodNames"](this._requestHandler));
  5211. }
  5212. if (loaderConfig) {
  5213. // Remove 'baseUrl', handling it is beyond scope for now
  5214. if (typeof loaderConfig.baseUrl !== 'undefined') {
  5215. delete loaderConfig['baseUrl'];
  5216. }
  5217. if (typeof loaderConfig.paths !== 'undefined') {
  5218. if (typeof loaderConfig.paths.vs !== 'undefined') {
  5219. delete loaderConfig.paths['vs'];
  5220. }
  5221. }
  5222. // Since this is in a web worker, enable catching errors
  5223. loaderConfig.catchError = true;
  5224. self.require.config(loaderConfig);
  5225. }
  5226. return new Promise(function (resolve, reject) {
  5227. // Use the global require to be sure to get the global config
  5228. self.require([moduleId], function (module) {
  5229. _this._requestHandler = module.create(hostProxy);
  5230. if (!_this._requestHandler) {
  5231. reject(new Error("No RequestHandler!"));
  5232. return;
  5233. }
  5234. resolve(_types_js__WEBPACK_IMPORTED_MODULE_3__["getAllMethodNames"](_this._requestHandler));
  5235. }, reject);
  5236. });
  5237. };
  5238. return SimpleWorkerServer;
  5239. }());
  5240. /**
  5241. * Called on the worker side
  5242. */
  5243. function create(postMessage) {
  5244. return new SimpleWorkerServer(postMessage, null);
  5245. }
  5246. /***/ }),
  5247. /***/ "../../node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js":
  5248. /*!*******************************************************************************************************!*\
  5249. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js ***!
  5250. \*******************************************************************************************************/
  5251. /*! exports provided: CharacterClassifier, CharacterSet */
  5252. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5253. "use strict";
  5254. __webpack_require__.r(__webpack_exports__);
  5255. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterClassifier", function() { return CharacterClassifier; });
  5256. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CharacterSet", function() { return CharacterSet; });
  5257. /* harmony import */ var _base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/uint.js */ "../../node_modules/monaco-editor/esm/vs/base/common/uint.js");
  5258. /*---------------------------------------------------------------------------------------------
  5259. * Copyright (c) Microsoft Corporation. All rights reserved.
  5260. * Licensed under the MIT License. See License.txt in the project root for license information.
  5261. *--------------------------------------------------------------------------------------------*/
  5262. /**
  5263. * A fast character classifier that uses a compact array for ASCII values.
  5264. */
  5265. var CharacterClassifier = /** @class */ (function () {
  5266. function CharacterClassifier(_defaultValue) {
  5267. var defaultValue = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint8"])(_defaultValue);
  5268. this._defaultValue = defaultValue;
  5269. this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue);
  5270. this._map = new Map();
  5271. }
  5272. CharacterClassifier._createAsciiMap = function (defaultValue) {
  5273. var asciiMap = new Uint8Array(256);
  5274. for (var i = 0; i < 256; i++) {
  5275. asciiMap[i] = defaultValue;
  5276. }
  5277. return asciiMap;
  5278. };
  5279. CharacterClassifier.prototype.set = function (charCode, _value) {
  5280. var value = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint8"])(_value);
  5281. if (charCode >= 0 && charCode < 256) {
  5282. this._asciiMap[charCode] = value;
  5283. }
  5284. else {
  5285. this._map.set(charCode, value);
  5286. }
  5287. };
  5288. CharacterClassifier.prototype.get = function (charCode) {
  5289. if (charCode >= 0 && charCode < 256) {
  5290. return this._asciiMap[charCode];
  5291. }
  5292. else {
  5293. return (this._map.get(charCode) || this._defaultValue);
  5294. }
  5295. };
  5296. return CharacterClassifier;
  5297. }());
  5298. var CharacterSet = /** @class */ (function () {
  5299. function CharacterSet() {
  5300. this._actual = new CharacterClassifier(0 /* False */);
  5301. }
  5302. CharacterSet.prototype.add = function (charCode) {
  5303. this._actual.set(charCode, 1 /* True */);
  5304. };
  5305. CharacterSet.prototype.has = function (charCode) {
  5306. return (this._actual.get(charCode) === 1 /* True */);
  5307. };
  5308. return CharacterSet;
  5309. }());
  5310. /***/ }),
  5311. /***/ "../../node_modules/monaco-editor/esm/vs/editor/common/core/position.js":
  5312. /*!********************************************************************************************!*\
  5313. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/editor/common/core/position.js ***!
  5314. \********************************************************************************************/
  5315. /*! exports provided: Position */
  5316. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5317. "use strict";
  5318. __webpack_require__.r(__webpack_exports__);
  5319. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Position", function() { return Position; });
  5320. /*---------------------------------------------------------------------------------------------
  5321. * Copyright (c) Microsoft Corporation. All rights reserved.
  5322. * Licensed under the MIT License. See License.txt in the project root for license information.
  5323. *--------------------------------------------------------------------------------------------*/
  5324. /**
  5325. * A position in the editor.
  5326. */
  5327. var Position = /** @class */ (function () {
  5328. function Position(lineNumber, column) {
  5329. this.lineNumber = lineNumber;
  5330. this.column = column;
  5331. }
  5332. /**
  5333. * Create a new position from this position.
  5334. *
  5335. * @param newLineNumber new line number
  5336. * @param newColumn new column
  5337. */
  5338. Position.prototype.with = function (newLineNumber, newColumn) {
  5339. if (newLineNumber === void 0) { newLineNumber = this.lineNumber; }
  5340. if (newColumn === void 0) { newColumn = this.column; }
  5341. if (newLineNumber === this.lineNumber && newColumn === this.column) {
  5342. return this;
  5343. }
  5344. else {
  5345. return new Position(newLineNumber, newColumn);
  5346. }
  5347. };
  5348. /**
  5349. * Derive a new position from this position.
  5350. *
  5351. * @param deltaLineNumber line number delta
  5352. * @param deltaColumn column delta
  5353. */
  5354. Position.prototype.delta = function (deltaLineNumber, deltaColumn) {
  5355. if (deltaLineNumber === void 0) { deltaLineNumber = 0; }
  5356. if (deltaColumn === void 0) { deltaColumn = 0; }
  5357. return this.with(this.lineNumber + deltaLineNumber, this.column + deltaColumn);
  5358. };
  5359. /**
  5360. * Test if this position equals other position
  5361. */
  5362. Position.prototype.equals = function (other) {
  5363. return Position.equals(this, other);
  5364. };
  5365. /**
  5366. * Test if position `a` equals position `b`
  5367. */
  5368. Position.equals = function (a, b) {
  5369. if (!a && !b) {
  5370. return true;
  5371. }
  5372. return (!!a &&
  5373. !!b &&
  5374. a.lineNumber === b.lineNumber &&
  5375. a.column === b.column);
  5376. };
  5377. /**
  5378. * Test if this position is before other position.
  5379. * If the two positions are equal, the result will be false.
  5380. */
  5381. Position.prototype.isBefore = function (other) {
  5382. return Position.isBefore(this, other);
  5383. };
  5384. /**
  5385. * Test if position `a` is before position `b`.
  5386. * If the two positions are equal, the result will be false.
  5387. */
  5388. Position.isBefore = function (a, b) {
  5389. if (a.lineNumber < b.lineNumber) {
  5390. return true;
  5391. }
  5392. if (b.lineNumber < a.lineNumber) {
  5393. return false;
  5394. }
  5395. return a.column < b.column;
  5396. };
  5397. /**
  5398. * Test if this position is before other position.
  5399. * If the two positions are equal, the result will be true.
  5400. */
  5401. Position.prototype.isBeforeOrEqual = function (other) {
  5402. return Position.isBeforeOrEqual(this, other);
  5403. };
  5404. /**
  5405. * Test if position `a` is before position `b`.
  5406. * If the two positions are equal, the result will be true.
  5407. */
  5408. Position.isBeforeOrEqual = function (a, b) {
  5409. if (a.lineNumber < b.lineNumber) {
  5410. return true;
  5411. }
  5412. if (b.lineNumber < a.lineNumber) {
  5413. return false;
  5414. }
  5415. return a.column <= b.column;
  5416. };
  5417. /**
  5418. * A function that compares positions, useful for sorting
  5419. */
  5420. Position.compare = function (a, b) {
  5421. var aLineNumber = a.lineNumber | 0;
  5422. var bLineNumber = b.lineNumber | 0;
  5423. if (aLineNumber === bLineNumber) {
  5424. var aColumn = a.column | 0;
  5425. var bColumn = b.column | 0;
  5426. return aColumn - bColumn;
  5427. }
  5428. return aLineNumber - bLineNumber;
  5429. };
  5430. /**
  5431. * Clone this position.
  5432. */
  5433. Position.prototype.clone = function () {
  5434. return new Position(this.lineNumber, this.column);
  5435. };
  5436. /**
  5437. * Convert to a human-readable representation.
  5438. */
  5439. Position.prototype.toString = function () {
  5440. return '(' + this.lineNumber + ',' + this.column + ')';
  5441. };
  5442. // ---
  5443. /**
  5444. * Create a `Position` from an `IPosition`.
  5445. */
  5446. Position.lift = function (pos) {
  5447. return new Position(pos.lineNumber, pos.column);
  5448. };
  5449. /**
  5450. * Test if `obj` is an `IPosition`.
  5451. */
  5452. Position.isIPosition = function (obj) {
  5453. return (obj
  5454. && (typeof obj.lineNumber === 'number')
  5455. && (typeof obj.column === 'number'));
  5456. };
  5457. return Position;
  5458. }());
  5459. /***/ }),
  5460. /***/ "../../node_modules/monaco-editor/esm/vs/editor/common/core/range.js":
  5461. /*!*****************************************************************************************!*\
  5462. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/editor/common/core/range.js ***!
  5463. \*****************************************************************************************/
  5464. /*! exports provided: Range */
  5465. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5466. "use strict";
  5467. __webpack_require__.r(__webpack_exports__);
  5468. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Range", function() { return Range; });
  5469. /* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/core/position.js");
  5470. /*---------------------------------------------------------------------------------------------
  5471. * Copyright (c) Microsoft Corporation. All rights reserved.
  5472. * Licensed under the MIT License. See License.txt in the project root for license information.
  5473. *--------------------------------------------------------------------------------------------*/
  5474. /**
  5475. * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn)
  5476. */
  5477. var Range = /** @class */ (function () {
  5478. function Range(startLineNumber, startColumn, endLineNumber, endColumn) {
  5479. if ((startLineNumber > endLineNumber) || (startLineNumber === endLineNumber && startColumn > endColumn)) {
  5480. this.startLineNumber = endLineNumber;
  5481. this.startColumn = endColumn;
  5482. this.endLineNumber = startLineNumber;
  5483. this.endColumn = startColumn;
  5484. }
  5485. else {
  5486. this.startLineNumber = startLineNumber;
  5487. this.startColumn = startColumn;
  5488. this.endLineNumber = endLineNumber;
  5489. this.endColumn = endColumn;
  5490. }
  5491. }
  5492. /**
  5493. * Test if this range is empty.
  5494. */
  5495. Range.prototype.isEmpty = function () {
  5496. return Range.isEmpty(this);
  5497. };
  5498. /**
  5499. * Test if `range` is empty.
  5500. */
  5501. Range.isEmpty = function (range) {
  5502. return (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn);
  5503. };
  5504. /**
  5505. * Test if position is in this range. If the position is at the edges, will return true.
  5506. */
  5507. Range.prototype.containsPosition = function (position) {
  5508. return Range.containsPosition(this, position);
  5509. };
  5510. /**
  5511. * Test if `position` is in `range`. If the position is at the edges, will return true.
  5512. */
  5513. Range.containsPosition = function (range, position) {
  5514. if (position.lineNumber < range.startLineNumber || position.lineNumber > range.endLineNumber) {
  5515. return false;
  5516. }
  5517. if (position.lineNumber === range.startLineNumber && position.column < range.startColumn) {
  5518. return false;
  5519. }
  5520. if (position.lineNumber === range.endLineNumber && position.column > range.endColumn) {
  5521. return false;
  5522. }
  5523. return true;
  5524. };
  5525. /**
  5526. * Test if range is in this range. If the range is equal to this range, will return true.
  5527. */
  5528. Range.prototype.containsRange = function (range) {
  5529. return Range.containsRange(this, range);
  5530. };
  5531. /**
  5532. * Test if `otherRange` is in `range`. If the ranges are equal, will return true.
  5533. */
  5534. Range.containsRange = function (range, otherRange) {
  5535. if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {
  5536. return false;
  5537. }
  5538. if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {
  5539. return false;
  5540. }
  5541. if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn < range.startColumn) {
  5542. return false;
  5543. }
  5544. if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn > range.endColumn) {
  5545. return false;
  5546. }
  5547. return true;
  5548. };
  5549. /**
  5550. * Test if `range` is strictly in this range. `range` must start after and end before this range for the result to be true.
  5551. */
  5552. Range.prototype.strictContainsRange = function (range) {
  5553. return Range.strictContainsRange(this, range);
  5554. };
  5555. /**
  5556. * Test if `otherRange` is strinctly in `range` (must start after, and end before). If the ranges are equal, will return false.
  5557. */
  5558. Range.strictContainsRange = function (range, otherRange) {
  5559. if (otherRange.startLineNumber < range.startLineNumber || otherRange.endLineNumber < range.startLineNumber) {
  5560. return false;
  5561. }
  5562. if (otherRange.startLineNumber > range.endLineNumber || otherRange.endLineNumber > range.endLineNumber) {
  5563. return false;
  5564. }
  5565. if (otherRange.startLineNumber === range.startLineNumber && otherRange.startColumn <= range.startColumn) {
  5566. return false;
  5567. }
  5568. if (otherRange.endLineNumber === range.endLineNumber && otherRange.endColumn >= range.endColumn) {
  5569. return false;
  5570. }
  5571. return true;
  5572. };
  5573. /**
  5574. * A reunion of the two ranges.
  5575. * The smallest position will be used as the start point, and the largest one as the end point.
  5576. */
  5577. Range.prototype.plusRange = function (range) {
  5578. return Range.plusRange(this, range);
  5579. };
  5580. /**
  5581. * A reunion of the two ranges.
  5582. * The smallest position will be used as the start point, and the largest one as the end point.
  5583. */
  5584. Range.plusRange = function (a, b) {
  5585. var startLineNumber;
  5586. var startColumn;
  5587. var endLineNumber;
  5588. var endColumn;
  5589. if (b.startLineNumber < a.startLineNumber) {
  5590. startLineNumber = b.startLineNumber;
  5591. startColumn = b.startColumn;
  5592. }
  5593. else if (b.startLineNumber === a.startLineNumber) {
  5594. startLineNumber = b.startLineNumber;
  5595. startColumn = Math.min(b.startColumn, a.startColumn);
  5596. }
  5597. else {
  5598. startLineNumber = a.startLineNumber;
  5599. startColumn = a.startColumn;
  5600. }
  5601. if (b.endLineNumber > a.endLineNumber) {
  5602. endLineNumber = b.endLineNumber;
  5603. endColumn = b.endColumn;
  5604. }
  5605. else if (b.endLineNumber === a.endLineNumber) {
  5606. endLineNumber = b.endLineNumber;
  5607. endColumn = Math.max(b.endColumn, a.endColumn);
  5608. }
  5609. else {
  5610. endLineNumber = a.endLineNumber;
  5611. endColumn = a.endColumn;
  5612. }
  5613. return new Range(startLineNumber, startColumn, endLineNumber, endColumn);
  5614. };
  5615. /**
  5616. * A intersection of the two ranges.
  5617. */
  5618. Range.prototype.intersectRanges = function (range) {
  5619. return Range.intersectRanges(this, range);
  5620. };
  5621. /**
  5622. * A intersection of the two ranges.
  5623. */
  5624. Range.intersectRanges = function (a, b) {
  5625. var resultStartLineNumber = a.startLineNumber;
  5626. var resultStartColumn = a.startColumn;
  5627. var resultEndLineNumber = a.endLineNumber;
  5628. var resultEndColumn = a.endColumn;
  5629. var otherStartLineNumber = b.startLineNumber;
  5630. var otherStartColumn = b.startColumn;
  5631. var otherEndLineNumber = b.endLineNumber;
  5632. var otherEndColumn = b.endColumn;
  5633. if (resultStartLineNumber < otherStartLineNumber) {
  5634. resultStartLineNumber = otherStartLineNumber;
  5635. resultStartColumn = otherStartColumn;
  5636. }
  5637. else if (resultStartLineNumber === otherStartLineNumber) {
  5638. resultStartColumn = Math.max(resultStartColumn, otherStartColumn);
  5639. }
  5640. if (resultEndLineNumber > otherEndLineNumber) {
  5641. resultEndLineNumber = otherEndLineNumber;
  5642. resultEndColumn = otherEndColumn;
  5643. }
  5644. else if (resultEndLineNumber === otherEndLineNumber) {
  5645. resultEndColumn = Math.min(resultEndColumn, otherEndColumn);
  5646. }
  5647. // Check if selection is now empty
  5648. if (resultStartLineNumber > resultEndLineNumber) {
  5649. return null;
  5650. }
  5651. if (resultStartLineNumber === resultEndLineNumber && resultStartColumn > resultEndColumn) {
  5652. return null;
  5653. }
  5654. return new Range(resultStartLineNumber, resultStartColumn, resultEndLineNumber, resultEndColumn);
  5655. };
  5656. /**
  5657. * Test if this range equals other.
  5658. */
  5659. Range.prototype.equalsRange = function (other) {
  5660. return Range.equalsRange(this, other);
  5661. };
  5662. /**
  5663. * Test if range `a` equals `b`.
  5664. */
  5665. Range.equalsRange = function (a, b) {
  5666. return (!!a &&
  5667. !!b &&
  5668. a.startLineNumber === b.startLineNumber &&
  5669. a.startColumn === b.startColumn &&
  5670. a.endLineNumber === b.endLineNumber &&
  5671. a.endColumn === b.endColumn);
  5672. };
  5673. /**
  5674. * Return the end position (which will be after or equal to the start position)
  5675. */
  5676. Range.prototype.getEndPosition = function () {
  5677. return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.endLineNumber, this.endColumn);
  5678. };
  5679. /**
  5680. * Return the start position (which will be before or equal to the end position)
  5681. */
  5682. Range.prototype.getStartPosition = function () {
  5683. return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.startLineNumber, this.startColumn);
  5684. };
  5685. /**
  5686. * Transform to a user presentable string representation.
  5687. */
  5688. Range.prototype.toString = function () {
  5689. return '[' + this.startLineNumber + ',' + this.startColumn + ' -> ' + this.endLineNumber + ',' + this.endColumn + ']';
  5690. };
  5691. /**
  5692. * Create a new range using this range's start position, and using endLineNumber and endColumn as the end position.
  5693. */
  5694. Range.prototype.setEndPosition = function (endLineNumber, endColumn) {
  5695. return new Range(this.startLineNumber, this.startColumn, endLineNumber, endColumn);
  5696. };
  5697. /**
  5698. * Create a new range using this range's end position, and using startLineNumber and startColumn as the start position.
  5699. */
  5700. Range.prototype.setStartPosition = function (startLineNumber, startColumn) {
  5701. return new Range(startLineNumber, startColumn, this.endLineNumber, this.endColumn);
  5702. };
  5703. /**
  5704. * Create a new empty range using this range's start position.
  5705. */
  5706. Range.prototype.collapseToStart = function () {
  5707. return Range.collapseToStart(this);
  5708. };
  5709. /**
  5710. * Create a new empty range using this range's start position.
  5711. */
  5712. Range.collapseToStart = function (range) {
  5713. return new Range(range.startLineNumber, range.startColumn, range.startLineNumber, range.startColumn);
  5714. };
  5715. // ---
  5716. Range.fromPositions = function (start, end) {
  5717. if (end === void 0) { end = start; }
  5718. return new Range(start.lineNumber, start.column, end.lineNumber, end.column);
  5719. };
  5720. Range.lift = function (range) {
  5721. if (!range) {
  5722. return null;
  5723. }
  5724. return new Range(range.startLineNumber, range.startColumn, range.endLineNumber, range.endColumn);
  5725. };
  5726. /**
  5727. * Test if `obj` is an `IRange`.
  5728. */
  5729. Range.isIRange = function (obj) {
  5730. return (obj
  5731. && (typeof obj.startLineNumber === 'number')
  5732. && (typeof obj.startColumn === 'number')
  5733. && (typeof obj.endLineNumber === 'number')
  5734. && (typeof obj.endColumn === 'number'));
  5735. };
  5736. /**
  5737. * Test if the two ranges are touching in any way.
  5738. */
  5739. Range.areIntersectingOrTouching = function (a, b) {
  5740. // Check if `a` is before `b`
  5741. if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn < b.startColumn)) {
  5742. return false;
  5743. }
  5744. // Check if `b` is before `a`
  5745. if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn < a.startColumn)) {
  5746. return false;
  5747. }
  5748. // These ranges must intersect
  5749. return true;
  5750. };
  5751. /**
  5752. * Test if the two ranges are intersecting. If the ranges are touching it returns true.
  5753. */
  5754. Range.areIntersecting = function (a, b) {
  5755. // Check if `a` is before `b`
  5756. if (a.endLineNumber < b.startLineNumber || (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn)) {
  5757. return false;
  5758. }
  5759. // Check if `b` is before `a`
  5760. if (b.endLineNumber < a.startLineNumber || (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn)) {
  5761. return false;
  5762. }
  5763. // These ranges must intersect
  5764. return true;
  5765. };
  5766. /**
  5767. * A function that compares ranges, useful for sorting ranges
  5768. * It will first compare ranges on the startPosition and then on the endPosition
  5769. */
  5770. Range.compareRangesUsingStarts = function (a, b) {
  5771. if (a && b) {
  5772. var aStartLineNumber = a.startLineNumber | 0;
  5773. var bStartLineNumber = b.startLineNumber | 0;
  5774. if (aStartLineNumber === bStartLineNumber) {
  5775. var aStartColumn = a.startColumn | 0;
  5776. var bStartColumn = b.startColumn | 0;
  5777. if (aStartColumn === bStartColumn) {
  5778. var aEndLineNumber = a.endLineNumber | 0;
  5779. var bEndLineNumber = b.endLineNumber | 0;
  5780. if (aEndLineNumber === bEndLineNumber) {
  5781. var aEndColumn = a.endColumn | 0;
  5782. var bEndColumn = b.endColumn | 0;
  5783. return aEndColumn - bEndColumn;
  5784. }
  5785. return aEndLineNumber - bEndLineNumber;
  5786. }
  5787. return aStartColumn - bStartColumn;
  5788. }
  5789. return aStartLineNumber - bStartLineNumber;
  5790. }
  5791. var aExists = (a ? 1 : 0);
  5792. var bExists = (b ? 1 : 0);
  5793. return aExists - bExists;
  5794. };
  5795. /**
  5796. * A function that compares ranges, useful for sorting ranges
  5797. * It will first compare ranges on the endPosition and then on the startPosition
  5798. */
  5799. Range.compareRangesUsingEnds = function (a, b) {
  5800. if (a.endLineNumber === b.endLineNumber) {
  5801. if (a.endColumn === b.endColumn) {
  5802. if (a.startLineNumber === b.startLineNumber) {
  5803. return a.startColumn - b.startColumn;
  5804. }
  5805. return a.startLineNumber - b.startLineNumber;
  5806. }
  5807. return a.endColumn - b.endColumn;
  5808. }
  5809. return a.endLineNumber - b.endLineNumber;
  5810. };
  5811. /**
  5812. * Test if the range spans multiple lines.
  5813. */
  5814. Range.spansMultipleLines = function (range) {
  5815. return range.endLineNumber > range.startLineNumber;
  5816. };
  5817. return Range;
  5818. }());
  5819. /***/ }),
  5820. /***/ "../../node_modules/monaco-editor/esm/vs/editor/common/core/selection.js":
  5821. /*!*********************************************************************************************!*\
  5822. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/editor/common/core/selection.js ***!
  5823. \*********************************************************************************************/
  5824. /*! exports provided: Selection */
  5825. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5826. "use strict";
  5827. __webpack_require__.r(__webpack_exports__);
  5828. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Selection", function() { return Selection; });
  5829. /* harmony import */ var _position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./position.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/core/position.js");
  5830. /* harmony import */ var _range_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./range.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/core/range.js");
  5831. /*---------------------------------------------------------------------------------------------
  5832. * Copyright (c) Microsoft Corporation. All rights reserved.
  5833. * Licensed under the MIT License. See License.txt in the project root for license information.
  5834. *--------------------------------------------------------------------------------------------*/
  5835. var __extends = (undefined && undefined.__extends) || (function () {
  5836. var extendStatics = function (d, b) {
  5837. extendStatics = Object.setPrototypeOf ||
  5838. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  5839. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  5840. return extendStatics(d, b);
  5841. };
  5842. return function (d, b) {
  5843. extendStatics(d, b);
  5844. function __() { this.constructor = d; }
  5845. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5846. };
  5847. })();
  5848. /**
  5849. * A selection in the editor.
  5850. * The selection is a range that has an orientation.
  5851. */
  5852. var Selection = /** @class */ (function (_super) {
  5853. __extends(Selection, _super);
  5854. function Selection(selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) {
  5855. var _this = _super.call(this, selectionStartLineNumber, selectionStartColumn, positionLineNumber, positionColumn) || this;
  5856. _this.selectionStartLineNumber = selectionStartLineNumber;
  5857. _this.selectionStartColumn = selectionStartColumn;
  5858. _this.positionLineNumber = positionLineNumber;
  5859. _this.positionColumn = positionColumn;
  5860. return _this;
  5861. }
  5862. /**
  5863. * Transform to a human-readable representation.
  5864. */
  5865. Selection.prototype.toString = function () {
  5866. return '[' + this.selectionStartLineNumber + ',' + this.selectionStartColumn + ' -> ' + this.positionLineNumber + ',' + this.positionColumn + ']';
  5867. };
  5868. /**
  5869. * Test if equals other selection.
  5870. */
  5871. Selection.prototype.equalsSelection = function (other) {
  5872. return (Selection.selectionsEqual(this, other));
  5873. };
  5874. /**
  5875. * Test if the two selections are equal.
  5876. */
  5877. Selection.selectionsEqual = function (a, b) {
  5878. return (a.selectionStartLineNumber === b.selectionStartLineNumber &&
  5879. a.selectionStartColumn === b.selectionStartColumn &&
  5880. a.positionLineNumber === b.positionLineNumber &&
  5881. a.positionColumn === b.positionColumn);
  5882. };
  5883. /**
  5884. * Get directions (LTR or RTL).
  5885. */
  5886. Selection.prototype.getDirection = function () {
  5887. if (this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn) {
  5888. return 0 /* LTR */;
  5889. }
  5890. return 1 /* RTL */;
  5891. };
  5892. /**
  5893. * Create a new selection with a different `positionLineNumber` and `positionColumn`.
  5894. */
  5895. Selection.prototype.setEndPosition = function (endLineNumber, endColumn) {
  5896. if (this.getDirection() === 0 /* LTR */) {
  5897. return new Selection(this.startLineNumber, this.startColumn, endLineNumber, endColumn);
  5898. }
  5899. return new Selection(endLineNumber, endColumn, this.startLineNumber, this.startColumn);
  5900. };
  5901. /**
  5902. * Get the position at `positionLineNumber` and `positionColumn`.
  5903. */
  5904. Selection.prototype.getPosition = function () {
  5905. return new _position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](this.positionLineNumber, this.positionColumn);
  5906. };
  5907. /**
  5908. * Create a new selection with a different `selectionStartLineNumber` and `selectionStartColumn`.
  5909. */
  5910. Selection.prototype.setStartPosition = function (startLineNumber, startColumn) {
  5911. if (this.getDirection() === 0 /* LTR */) {
  5912. return new Selection(startLineNumber, startColumn, this.endLineNumber, this.endColumn);
  5913. }
  5914. return new Selection(this.endLineNumber, this.endColumn, startLineNumber, startColumn);
  5915. };
  5916. // ----
  5917. /**
  5918. * Create a `Selection` from one or two positions
  5919. */
  5920. Selection.fromPositions = function (start, end) {
  5921. if (end === void 0) { end = start; }
  5922. return new Selection(start.lineNumber, start.column, end.lineNumber, end.column);
  5923. };
  5924. /**
  5925. * Create a `Selection` from an `ISelection`.
  5926. */
  5927. Selection.liftSelection = function (sel) {
  5928. return new Selection(sel.selectionStartLineNumber, sel.selectionStartColumn, sel.positionLineNumber, sel.positionColumn);
  5929. };
  5930. /**
  5931. * `a` equals `b`.
  5932. */
  5933. Selection.selectionsArrEqual = function (a, b) {
  5934. if (a && !b || !a && b) {
  5935. return false;
  5936. }
  5937. if (!a && !b) {
  5938. return true;
  5939. }
  5940. if (a.length !== b.length) {
  5941. return false;
  5942. }
  5943. for (var i = 0, len = a.length; i < len; i++) {
  5944. if (!this.selectionsEqual(a[i], b[i])) {
  5945. return false;
  5946. }
  5947. }
  5948. return true;
  5949. };
  5950. /**
  5951. * Test if `obj` is an `ISelection`.
  5952. */
  5953. Selection.isISelection = function (obj) {
  5954. return (obj
  5955. && (typeof obj.selectionStartLineNumber === 'number')
  5956. && (typeof obj.selectionStartColumn === 'number')
  5957. && (typeof obj.positionLineNumber === 'number')
  5958. && (typeof obj.positionColumn === 'number'));
  5959. };
  5960. /**
  5961. * Create with a direction.
  5962. */
  5963. Selection.createWithDirection = function (startLineNumber, startColumn, endLineNumber, endColumn, direction) {
  5964. if (direction === 0 /* LTR */) {
  5965. return new Selection(startLineNumber, startColumn, endLineNumber, endColumn);
  5966. }
  5967. return new Selection(endLineNumber, endColumn, startLineNumber, startColumn);
  5968. };
  5969. return Selection;
  5970. }(_range_js__WEBPACK_IMPORTED_MODULE_1__["Range"]));
  5971. /***/ }),
  5972. /***/ "../../node_modules/monaco-editor/esm/vs/editor/common/core/token.js":
  5973. /*!*****************************************************************************************!*\
  5974. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/editor/common/core/token.js ***!
  5975. \*****************************************************************************************/
  5976. /*! exports provided: Token, TokenizationResult, TokenizationResult2 */
  5977. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5978. "use strict";
  5979. __webpack_require__.r(__webpack_exports__);
  5980. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Token", function() { return Token; });
  5981. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationResult", function() { return TokenizationResult; });
  5982. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TokenizationResult2", function() { return TokenizationResult2; });
  5983. /*---------------------------------------------------------------------------------------------
  5984. * Copyright (c) Microsoft Corporation. All rights reserved.
  5985. * Licensed under the MIT License. See License.txt in the project root for license information.
  5986. *--------------------------------------------------------------------------------------------*/
  5987. var Token = /** @class */ (function () {
  5988. function Token(offset, type, language) {
  5989. this.offset = offset | 0; // @perf
  5990. this.type = type;
  5991. this.language = language;
  5992. }
  5993. Token.prototype.toString = function () {
  5994. return '(' + this.offset + ', ' + this.type + ')';
  5995. };
  5996. return Token;
  5997. }());
  5998. var TokenizationResult = /** @class */ (function () {
  5999. function TokenizationResult(tokens, endState) {
  6000. this.tokens = tokens;
  6001. this.endState = endState;
  6002. }
  6003. return TokenizationResult;
  6004. }());
  6005. var TokenizationResult2 = /** @class */ (function () {
  6006. function TokenizationResult2(tokens, endState) {
  6007. this.tokens = tokens;
  6008. this.endState = endState;
  6009. }
  6010. return TokenizationResult2;
  6011. }());
  6012. /***/ }),
  6013. /***/ "../../node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js":
  6014. /*!************************************************************************************************!*\
  6015. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js ***!
  6016. \************************************************************************************************/
  6017. /*! exports provided: DiffComputer */
  6018. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6019. "use strict";
  6020. __webpack_require__.r(__webpack_exports__);
  6021. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DiffComputer", function() { return DiffComputer; });
  6022. /* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ "../../node_modules/monaco-editor/esm/vs/base/common/diff/diff.js");
  6023. /* harmony import */ var _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/strings.js */ "../../node_modules/monaco-editor/esm/vs/base/common/strings.js");
  6024. /*---------------------------------------------------------------------------------------------
  6025. * Copyright (c) Microsoft Corporation. All rights reserved.
  6026. * Licensed under the MIT License. See License.txt in the project root for license information.
  6027. *--------------------------------------------------------------------------------------------*/
  6028. var MINIMUM_MATCHING_CHARACTER_LENGTH = 3;
  6029. function computeDiff(originalSequence, modifiedSequence, continueProcessingPredicate, pretty) {
  6030. var diffAlgo = new _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_0__["LcsDiff"](originalSequence, modifiedSequence, continueProcessingPredicate);
  6031. return diffAlgo.ComputeDiff(pretty);
  6032. }
  6033. var LineSequence = /** @class */ (function () {
  6034. function LineSequence(lines) {
  6035. var startColumns = [];
  6036. var endColumns = [];
  6037. for (var i = 0, length_1 = lines.length; i < length_1; i++) {
  6038. startColumns[i] = getFirstNonBlankColumn(lines[i], 1);
  6039. endColumns[i] = getLastNonBlankColumn(lines[i], 1);
  6040. }
  6041. this.lines = lines;
  6042. this._startColumns = startColumns;
  6043. this._endColumns = endColumns;
  6044. }
  6045. LineSequence.prototype.getElements = function () {
  6046. var elements = [];
  6047. for (var i = 0, len = this.lines.length; i < len; i++) {
  6048. elements[i] = this.lines[i].substring(this._startColumns[i] - 1, this._endColumns[i] - 1);
  6049. }
  6050. return elements;
  6051. };
  6052. LineSequence.prototype.getStartLineNumber = function (i) {
  6053. return i + 1;
  6054. };
  6055. LineSequence.prototype.getEndLineNumber = function (i) {
  6056. return i + 1;
  6057. };
  6058. LineSequence.prototype.createCharSequence = function (shouldIgnoreTrimWhitespace, startIndex, endIndex) {
  6059. var charCodes = [];
  6060. var lineNumbers = [];
  6061. var columns = [];
  6062. var len = 0;
  6063. for (var index = startIndex; index <= endIndex; index++) {
  6064. var lineContent = this.lines[index];
  6065. var startColumn = (shouldIgnoreTrimWhitespace ? this._startColumns[index] : 1);
  6066. var endColumn = (shouldIgnoreTrimWhitespace ? this._endColumns[index] : lineContent.length + 1);
  6067. for (var col = startColumn; col < endColumn; col++) {
  6068. charCodes[len] = lineContent.charCodeAt(col - 1);
  6069. lineNumbers[len] = index + 1;
  6070. columns[len] = col;
  6071. len++;
  6072. }
  6073. }
  6074. return new CharSequence(charCodes, lineNumbers, columns);
  6075. };
  6076. return LineSequence;
  6077. }());
  6078. var CharSequence = /** @class */ (function () {
  6079. function CharSequence(charCodes, lineNumbers, columns) {
  6080. this._charCodes = charCodes;
  6081. this._lineNumbers = lineNumbers;
  6082. this._columns = columns;
  6083. }
  6084. CharSequence.prototype.getElements = function () {
  6085. return this._charCodes;
  6086. };
  6087. CharSequence.prototype.getStartLineNumber = function (i) {
  6088. return this._lineNumbers[i];
  6089. };
  6090. CharSequence.prototype.getStartColumn = function (i) {
  6091. return this._columns[i];
  6092. };
  6093. CharSequence.prototype.getEndLineNumber = function (i) {
  6094. return this._lineNumbers[i];
  6095. };
  6096. CharSequence.prototype.getEndColumn = function (i) {
  6097. return this._columns[i] + 1;
  6098. };
  6099. return CharSequence;
  6100. }());
  6101. var CharChange = /** @class */ (function () {
  6102. function CharChange(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn) {
  6103. this.originalStartLineNumber = originalStartLineNumber;
  6104. this.originalStartColumn = originalStartColumn;
  6105. this.originalEndLineNumber = originalEndLineNumber;
  6106. this.originalEndColumn = originalEndColumn;
  6107. this.modifiedStartLineNumber = modifiedStartLineNumber;
  6108. this.modifiedStartColumn = modifiedStartColumn;
  6109. this.modifiedEndLineNumber = modifiedEndLineNumber;
  6110. this.modifiedEndColumn = modifiedEndColumn;
  6111. }
  6112. CharChange.createFromDiffChange = function (diffChange, originalCharSequence, modifiedCharSequence) {
  6113. var originalStartLineNumber;
  6114. var originalStartColumn;
  6115. var originalEndLineNumber;
  6116. var originalEndColumn;
  6117. var modifiedStartLineNumber;
  6118. var modifiedStartColumn;
  6119. var modifiedEndLineNumber;
  6120. var modifiedEndColumn;
  6121. if (diffChange.originalLength === 0) {
  6122. originalStartLineNumber = 0;
  6123. originalStartColumn = 0;
  6124. originalEndLineNumber = 0;
  6125. originalEndColumn = 0;
  6126. }
  6127. else {
  6128. originalStartLineNumber = originalCharSequence.getStartLineNumber(diffChange.originalStart);
  6129. originalStartColumn = originalCharSequence.getStartColumn(diffChange.originalStart);
  6130. originalEndLineNumber = originalCharSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);
  6131. originalEndColumn = originalCharSequence.getEndColumn(diffChange.originalStart + diffChange.originalLength - 1);
  6132. }
  6133. if (diffChange.modifiedLength === 0) {
  6134. modifiedStartLineNumber = 0;
  6135. modifiedStartColumn = 0;
  6136. modifiedEndLineNumber = 0;
  6137. modifiedEndColumn = 0;
  6138. }
  6139. else {
  6140. modifiedStartLineNumber = modifiedCharSequence.getStartLineNumber(diffChange.modifiedStart);
  6141. modifiedStartColumn = modifiedCharSequence.getStartColumn(diffChange.modifiedStart);
  6142. modifiedEndLineNumber = modifiedCharSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);
  6143. modifiedEndColumn = modifiedCharSequence.getEndColumn(diffChange.modifiedStart + diffChange.modifiedLength - 1);
  6144. }
  6145. return new CharChange(originalStartLineNumber, originalStartColumn, originalEndLineNumber, originalEndColumn, modifiedStartLineNumber, modifiedStartColumn, modifiedEndLineNumber, modifiedEndColumn);
  6146. };
  6147. return CharChange;
  6148. }());
  6149. function postProcessCharChanges(rawChanges) {
  6150. if (rawChanges.length <= 1) {
  6151. return rawChanges;
  6152. }
  6153. var result = [rawChanges[0]];
  6154. var prevChange = result[0];
  6155. for (var i = 1, len = rawChanges.length; i < len; i++) {
  6156. var currChange = rawChanges[i];
  6157. var originalMatchingLength = currChange.originalStart - (prevChange.originalStart + prevChange.originalLength);
  6158. var modifiedMatchingLength = currChange.modifiedStart - (prevChange.modifiedStart + prevChange.modifiedLength);
  6159. // Both of the above should be equal, but the continueProcessingPredicate may prevent this from being true
  6160. var matchingLength = Math.min(originalMatchingLength, modifiedMatchingLength);
  6161. if (matchingLength < MINIMUM_MATCHING_CHARACTER_LENGTH) {
  6162. // Merge the current change into the previous one
  6163. prevChange.originalLength = (currChange.originalStart + currChange.originalLength) - prevChange.originalStart;
  6164. prevChange.modifiedLength = (currChange.modifiedStart + currChange.modifiedLength) - prevChange.modifiedStart;
  6165. }
  6166. else {
  6167. // Add the current change
  6168. result.push(currChange);
  6169. prevChange = currChange;
  6170. }
  6171. }
  6172. return result;
  6173. }
  6174. var LineChange = /** @class */ (function () {
  6175. function LineChange(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges) {
  6176. this.originalStartLineNumber = originalStartLineNumber;
  6177. this.originalEndLineNumber = originalEndLineNumber;
  6178. this.modifiedStartLineNumber = modifiedStartLineNumber;
  6179. this.modifiedEndLineNumber = modifiedEndLineNumber;
  6180. this.charChanges = charChanges;
  6181. }
  6182. LineChange.createFromDiffResult = function (shouldIgnoreTrimWhitespace, diffChange, originalLineSequence, modifiedLineSequence, continueCharDiff, shouldComputeCharChanges, shouldPostProcessCharChanges) {
  6183. var originalStartLineNumber;
  6184. var originalEndLineNumber;
  6185. var modifiedStartLineNumber;
  6186. var modifiedEndLineNumber;
  6187. var charChanges = undefined;
  6188. if (diffChange.originalLength === 0) {
  6189. originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart) - 1;
  6190. originalEndLineNumber = 0;
  6191. }
  6192. else {
  6193. originalStartLineNumber = originalLineSequence.getStartLineNumber(diffChange.originalStart);
  6194. originalEndLineNumber = originalLineSequence.getEndLineNumber(diffChange.originalStart + diffChange.originalLength - 1);
  6195. }
  6196. if (diffChange.modifiedLength === 0) {
  6197. modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart) - 1;
  6198. modifiedEndLineNumber = 0;
  6199. }
  6200. else {
  6201. modifiedStartLineNumber = modifiedLineSequence.getStartLineNumber(diffChange.modifiedStart);
  6202. modifiedEndLineNumber = modifiedLineSequence.getEndLineNumber(diffChange.modifiedStart + diffChange.modifiedLength - 1);
  6203. }
  6204. if (shouldComputeCharChanges && diffChange.originalLength > 0 && diffChange.originalLength < 20 && diffChange.modifiedLength > 0 && diffChange.modifiedLength < 20 && continueCharDiff()) {
  6205. // Compute character changes for diff chunks of at most 20 lines...
  6206. var originalCharSequence = originalLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength - 1);
  6207. var modifiedCharSequence = modifiedLineSequence.createCharSequence(shouldIgnoreTrimWhitespace, diffChange.modifiedStart, diffChange.modifiedStart + diffChange.modifiedLength - 1);
  6208. var rawChanges = computeDiff(originalCharSequence, modifiedCharSequence, continueCharDiff, true).changes;
  6209. if (shouldPostProcessCharChanges) {
  6210. rawChanges = postProcessCharChanges(rawChanges);
  6211. }
  6212. charChanges = [];
  6213. for (var i = 0, length_2 = rawChanges.length; i < length_2; i++) {
  6214. charChanges.push(CharChange.createFromDiffChange(rawChanges[i], originalCharSequence, modifiedCharSequence));
  6215. }
  6216. }
  6217. return new LineChange(originalStartLineNumber, originalEndLineNumber, modifiedStartLineNumber, modifiedEndLineNumber, charChanges);
  6218. };
  6219. return LineChange;
  6220. }());
  6221. var DiffComputer = /** @class */ (function () {
  6222. function DiffComputer(originalLines, modifiedLines, opts) {
  6223. this.shouldComputeCharChanges = opts.shouldComputeCharChanges;
  6224. this.shouldPostProcessCharChanges = opts.shouldPostProcessCharChanges;
  6225. this.shouldIgnoreTrimWhitespace = opts.shouldIgnoreTrimWhitespace;
  6226. this.shouldMakePrettyDiff = opts.shouldMakePrettyDiff;
  6227. this.originalLines = originalLines;
  6228. this.modifiedLines = modifiedLines;
  6229. this.original = new LineSequence(originalLines);
  6230. this.modified = new LineSequence(modifiedLines);
  6231. this.continueLineDiff = createContinueProcessingPredicate(opts.maxComputationTime);
  6232. this.continueCharDiff = createContinueProcessingPredicate(opts.maxComputationTime === 0 ? 0 : Math.min(opts.maxComputationTime, 5000)); // never run after 5s for character changes...
  6233. }
  6234. DiffComputer.prototype.computeDiff = function () {
  6235. if (this.original.lines.length === 1 && this.original.lines[0].length === 0) {
  6236. // empty original => fast path
  6237. return {
  6238. quitEarly: false,
  6239. changes: [{
  6240. originalStartLineNumber: 1,
  6241. originalEndLineNumber: 1,
  6242. modifiedStartLineNumber: 1,
  6243. modifiedEndLineNumber: this.modified.lines.length,
  6244. charChanges: [{
  6245. modifiedEndColumn: 0,
  6246. modifiedEndLineNumber: 0,
  6247. modifiedStartColumn: 0,
  6248. modifiedStartLineNumber: 0,
  6249. originalEndColumn: 0,
  6250. originalEndLineNumber: 0,
  6251. originalStartColumn: 0,
  6252. originalStartLineNumber: 0
  6253. }]
  6254. }]
  6255. };
  6256. }
  6257. if (this.modified.lines.length === 1 && this.modified.lines[0].length === 0) {
  6258. // empty modified => fast path
  6259. return {
  6260. quitEarly: false,
  6261. changes: [{
  6262. originalStartLineNumber: 1,
  6263. originalEndLineNumber: this.original.lines.length,
  6264. modifiedStartLineNumber: 1,
  6265. modifiedEndLineNumber: 1,
  6266. charChanges: [{
  6267. modifiedEndColumn: 0,
  6268. modifiedEndLineNumber: 0,
  6269. modifiedStartColumn: 0,
  6270. modifiedStartLineNumber: 0,
  6271. originalEndColumn: 0,
  6272. originalEndLineNumber: 0,
  6273. originalStartColumn: 0,
  6274. originalStartLineNumber: 0
  6275. }]
  6276. }]
  6277. };
  6278. }
  6279. var diffResult = computeDiff(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff);
  6280. var rawChanges = diffResult.changes;
  6281. var quitEarly = diffResult.quitEarly;
  6282. // The diff is always computed with ignoring trim whitespace
  6283. // This ensures we get the prettiest diff
  6284. if (this.shouldIgnoreTrimWhitespace) {
  6285. var lineChanges = [];
  6286. for (var i = 0, length_3 = rawChanges.length; i < length_3; i++) {
  6287. lineChanges.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, rawChanges[i], this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));
  6288. }
  6289. return {
  6290. quitEarly: quitEarly,
  6291. changes: lineChanges
  6292. };
  6293. }
  6294. // Need to post-process and introduce changes where the trim whitespace is different
  6295. // Note that we are looping starting at -1 to also cover the lines before the first change
  6296. var result = [];
  6297. var originalLineIndex = 0;
  6298. var modifiedLineIndex = 0;
  6299. for (var i = -1 /* !!!! */, len = rawChanges.length; i < len; i++) {
  6300. var nextChange = (i + 1 < len ? rawChanges[i + 1] : null);
  6301. var originalStop = (nextChange ? nextChange.originalStart : this.originalLines.length);
  6302. var modifiedStop = (nextChange ? nextChange.modifiedStart : this.modifiedLines.length);
  6303. while (originalLineIndex < originalStop && modifiedLineIndex < modifiedStop) {
  6304. var originalLine = this.originalLines[originalLineIndex];
  6305. var modifiedLine = this.modifiedLines[modifiedLineIndex];
  6306. if (originalLine !== modifiedLine) {
  6307. // These lines differ only in trim whitespace
  6308. // Check the leading whitespace
  6309. {
  6310. var originalStartColumn = getFirstNonBlankColumn(originalLine, 1);
  6311. var modifiedStartColumn = getFirstNonBlankColumn(modifiedLine, 1);
  6312. while (originalStartColumn > 1 && modifiedStartColumn > 1) {
  6313. var originalChar = originalLine.charCodeAt(originalStartColumn - 2);
  6314. var modifiedChar = modifiedLine.charCodeAt(modifiedStartColumn - 2);
  6315. if (originalChar !== modifiedChar) {
  6316. break;
  6317. }
  6318. originalStartColumn--;
  6319. modifiedStartColumn--;
  6320. }
  6321. if (originalStartColumn > 1 || modifiedStartColumn > 1) {
  6322. this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, 1, originalStartColumn, modifiedLineIndex + 1, 1, modifiedStartColumn);
  6323. }
  6324. }
  6325. // Check the trailing whitespace
  6326. {
  6327. var originalEndColumn = getLastNonBlankColumn(originalLine, 1);
  6328. var modifiedEndColumn = getLastNonBlankColumn(modifiedLine, 1);
  6329. var originalMaxColumn = originalLine.length + 1;
  6330. var modifiedMaxColumn = modifiedLine.length + 1;
  6331. while (originalEndColumn < originalMaxColumn && modifiedEndColumn < modifiedMaxColumn) {
  6332. var originalChar = originalLine.charCodeAt(originalEndColumn - 1);
  6333. var modifiedChar = originalLine.charCodeAt(modifiedEndColumn - 1);
  6334. if (originalChar !== modifiedChar) {
  6335. break;
  6336. }
  6337. originalEndColumn++;
  6338. modifiedEndColumn++;
  6339. }
  6340. if (originalEndColumn < originalMaxColumn || modifiedEndColumn < modifiedMaxColumn) {
  6341. this._pushTrimWhitespaceCharChange(result, originalLineIndex + 1, originalEndColumn, originalMaxColumn, modifiedLineIndex + 1, modifiedEndColumn, modifiedMaxColumn);
  6342. }
  6343. }
  6344. }
  6345. originalLineIndex++;
  6346. modifiedLineIndex++;
  6347. }
  6348. if (nextChange) {
  6349. // Emit the actual change
  6350. result.push(LineChange.createFromDiffResult(this.shouldIgnoreTrimWhitespace, nextChange, this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges));
  6351. originalLineIndex += nextChange.originalLength;
  6352. modifiedLineIndex += nextChange.modifiedLength;
  6353. }
  6354. }
  6355. return {
  6356. quitEarly: quitEarly,
  6357. changes: result
  6358. };
  6359. };
  6360. DiffComputer.prototype._pushTrimWhitespaceCharChange = function (result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) {
  6361. if (this._mergeTrimWhitespaceCharChange(result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn)) {
  6362. // Merged into previous
  6363. return;
  6364. }
  6365. var charChanges = undefined;
  6366. if (this.shouldComputeCharChanges) {
  6367. charChanges = [new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn)];
  6368. }
  6369. result.push(new LineChange(originalLineNumber, originalLineNumber, modifiedLineNumber, modifiedLineNumber, charChanges));
  6370. };
  6371. DiffComputer.prototype._mergeTrimWhitespaceCharChange = function (result, originalLineNumber, originalStartColumn, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedEndColumn) {
  6372. var len = result.length;
  6373. if (len === 0) {
  6374. return false;
  6375. }
  6376. var prevChange = result[len - 1];
  6377. if (prevChange.originalEndLineNumber === 0 || prevChange.modifiedEndLineNumber === 0) {
  6378. // Don't merge with inserts/deletes
  6379. return false;
  6380. }
  6381. if (prevChange.originalEndLineNumber + 1 === originalLineNumber && prevChange.modifiedEndLineNumber + 1 === modifiedLineNumber) {
  6382. prevChange.originalEndLineNumber = originalLineNumber;
  6383. prevChange.modifiedEndLineNumber = modifiedLineNumber;
  6384. if (this.shouldComputeCharChanges && prevChange.charChanges) {
  6385. prevChange.charChanges.push(new CharChange(originalLineNumber, originalStartColumn, originalLineNumber, originalEndColumn, modifiedLineNumber, modifiedStartColumn, modifiedLineNumber, modifiedEndColumn));
  6386. }
  6387. return true;
  6388. }
  6389. return false;
  6390. };
  6391. return DiffComputer;
  6392. }());
  6393. function getFirstNonBlankColumn(txt, defaultValue) {
  6394. var r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["firstNonWhitespaceIndex"](txt);
  6395. if (r === -1) {
  6396. return defaultValue;
  6397. }
  6398. return r + 1;
  6399. }
  6400. function getLastNonBlankColumn(txt, defaultValue) {
  6401. var r = _base_common_strings_js__WEBPACK_IMPORTED_MODULE_1__["lastNonWhitespaceIndex"](txt);
  6402. if (r === -1) {
  6403. return defaultValue;
  6404. }
  6405. return r + 2;
  6406. }
  6407. function createContinueProcessingPredicate(maximumRuntime) {
  6408. if (maximumRuntime === 0) {
  6409. return function () { return true; };
  6410. }
  6411. var startTime = Date.now();
  6412. return function () {
  6413. return Date.now() - startTime < maximumRuntime;
  6414. };
  6415. }
  6416. /***/ }),
  6417. /***/ "../../node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js":
  6418. /*!****************************************************************************************************!*\
  6419. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js ***!
  6420. \****************************************************************************************************/
  6421. /*! exports provided: MirrorTextModel */
  6422. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6423. "use strict";
  6424. __webpack_require__.r(__webpack_exports__);
  6425. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MirrorTextModel", function() { return MirrorTextModel; });
  6426. /* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/position.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/core/position.js");
  6427. /* harmony import */ var _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../viewModel/prefixSumComputer.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js");
  6428. /*---------------------------------------------------------------------------------------------
  6429. * Copyright (c) Microsoft Corporation. All rights reserved.
  6430. * Licensed under the MIT License. See License.txt in the project root for license information.
  6431. *--------------------------------------------------------------------------------------------*/
  6432. var MirrorTextModel = /** @class */ (function () {
  6433. function MirrorTextModel(uri, lines, eol, versionId) {
  6434. this._uri = uri;
  6435. this._lines = lines;
  6436. this._eol = eol;
  6437. this._versionId = versionId;
  6438. this._lineStarts = null;
  6439. }
  6440. MirrorTextModel.prototype.dispose = function () {
  6441. this._lines.length = 0;
  6442. };
  6443. MirrorTextModel.prototype.getText = function () {
  6444. return this._lines.join(this._eol);
  6445. };
  6446. MirrorTextModel.prototype.onEvents = function (e) {
  6447. if (e.eol && e.eol !== this._eol) {
  6448. this._eol = e.eol;
  6449. this._lineStarts = null;
  6450. }
  6451. // Update my lines
  6452. var changes = e.changes;
  6453. for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) {
  6454. var change = changes_1[_i];
  6455. this._acceptDeleteRange(change.range);
  6456. this._acceptInsertText(new _core_position_js__WEBPACK_IMPORTED_MODULE_0__["Position"](change.range.startLineNumber, change.range.startColumn), change.text);
  6457. }
  6458. this._versionId = e.versionId;
  6459. };
  6460. MirrorTextModel.prototype._ensureLineStarts = function () {
  6461. if (!this._lineStarts) {
  6462. var eolLength = this._eol.length;
  6463. var linesLength = this._lines.length;
  6464. var lineStartValues = new Uint32Array(linesLength);
  6465. for (var i = 0; i < linesLength; i++) {
  6466. lineStartValues[i] = this._lines[i].length + eolLength;
  6467. }
  6468. this._lineStarts = new _viewModel_prefixSumComputer_js__WEBPACK_IMPORTED_MODULE_1__["PrefixSumComputer"](lineStartValues);
  6469. }
  6470. };
  6471. /**
  6472. * All changes to a line's text go through this method
  6473. */
  6474. MirrorTextModel.prototype._setLineText = function (lineIndex, newValue) {
  6475. this._lines[lineIndex] = newValue;
  6476. if (this._lineStarts) {
  6477. // update prefix sum
  6478. this._lineStarts.changeValue(lineIndex, this._lines[lineIndex].length + this._eol.length);
  6479. }
  6480. };
  6481. MirrorTextModel.prototype._acceptDeleteRange = function (range) {
  6482. if (range.startLineNumber === range.endLineNumber) {
  6483. if (range.startColumn === range.endColumn) {
  6484. // Nothing to delete
  6485. return;
  6486. }
  6487. // Delete text on the affected line
  6488. this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1)
  6489. + this._lines[range.startLineNumber - 1].substring(range.endColumn - 1));
  6490. return;
  6491. }
  6492. // Take remaining text on last line and append it to remaining text on first line
  6493. this._setLineText(range.startLineNumber - 1, this._lines[range.startLineNumber - 1].substring(0, range.startColumn - 1)
  6494. + this._lines[range.endLineNumber - 1].substring(range.endColumn - 1));
  6495. // Delete middle lines
  6496. this._lines.splice(range.startLineNumber, range.endLineNumber - range.startLineNumber);
  6497. if (this._lineStarts) {
  6498. // update prefix sum
  6499. this._lineStarts.removeValues(range.startLineNumber, range.endLineNumber - range.startLineNumber);
  6500. }
  6501. };
  6502. MirrorTextModel.prototype._acceptInsertText = function (position, insertText) {
  6503. if (insertText.length === 0) {
  6504. // Nothing to insert
  6505. return;
  6506. }
  6507. var insertLines = insertText.split(/\r\n|\r|\n/);
  6508. if (insertLines.length === 1) {
  6509. // Inserting text on one line
  6510. this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1)
  6511. + insertLines[0]
  6512. + this._lines[position.lineNumber - 1].substring(position.column - 1));
  6513. return;
  6514. }
  6515. // Append overflowing text from first line to the end of text to insert
  6516. insertLines[insertLines.length - 1] += this._lines[position.lineNumber - 1].substring(position.column - 1);
  6517. // Delete overflowing text from first line and insert text on first line
  6518. this._setLineText(position.lineNumber - 1, this._lines[position.lineNumber - 1].substring(0, position.column - 1)
  6519. + insertLines[0]);
  6520. // Insert new lines & store lengths
  6521. var newLengths = new Uint32Array(insertLines.length - 1);
  6522. for (var i = 1; i < insertLines.length; i++) {
  6523. this._lines.splice(position.lineNumber + i - 1, 0, insertLines[i]);
  6524. newLengths[i - 1] = insertLines[i].length + this._eol.length;
  6525. }
  6526. if (this._lineStarts) {
  6527. // update prefix sum
  6528. this._lineStarts.insertValues(position.lineNumber, newLengths);
  6529. }
  6530. };
  6531. return MirrorTextModel;
  6532. }());
  6533. /***/ }),
  6534. /***/ "../../node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js":
  6535. /*!***********************************************************************************************!*\
  6536. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js ***!
  6537. \***********************************************************************************************/
  6538. /*! exports provided: USUAL_WORD_SEPARATORS, DEFAULT_WORD_REGEXP, ensureValidWordDefinition, getWordAtText */
  6539. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6540. "use strict";
  6541. __webpack_require__.r(__webpack_exports__);
  6542. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "USUAL_WORD_SEPARATORS", function() { return USUAL_WORD_SEPARATORS; });
  6543. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_WORD_REGEXP", function() { return DEFAULT_WORD_REGEXP; });
  6544. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ensureValidWordDefinition", function() { return ensureValidWordDefinition; });
  6545. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getWordAtText", function() { return getWordAtText; });
  6546. /*---------------------------------------------------------------------------------------------
  6547. * Copyright (c) Microsoft Corporation. All rights reserved.
  6548. * Licensed under the MIT License. See License.txt in the project root for license information.
  6549. *--------------------------------------------------------------------------------------------*/
  6550. var USUAL_WORD_SEPARATORS = '`~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?';
  6551. /**
  6552. * Create a word definition regular expression based on default word separators.
  6553. * Optionally provide allowed separators that should be included in words.
  6554. *
  6555. * The default would look like this:
  6556. * /(-?\d*\.\d\w*)|([^\`\~\!\@\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g
  6557. */
  6558. function createWordRegExp(allowInWords) {
  6559. if (allowInWords === void 0) { allowInWords = ''; }
  6560. var source = '(-?\\d*\\.\\d\\w*)|([^';
  6561. for (var _i = 0, USUAL_WORD_SEPARATORS_1 = USUAL_WORD_SEPARATORS; _i < USUAL_WORD_SEPARATORS_1.length; _i++) {
  6562. var sep = USUAL_WORD_SEPARATORS_1[_i];
  6563. if (allowInWords.indexOf(sep) >= 0) {
  6564. continue;
  6565. }
  6566. source += '\\' + sep;
  6567. }
  6568. source += '\\s]+)';
  6569. return new RegExp(source, 'g');
  6570. }
  6571. // catches numbers (including floating numbers) in the first group, and alphanum in the second
  6572. var DEFAULT_WORD_REGEXP = createWordRegExp();
  6573. function ensureValidWordDefinition(wordDefinition) {
  6574. var result = DEFAULT_WORD_REGEXP;
  6575. if (wordDefinition && (wordDefinition instanceof RegExp)) {
  6576. if (!wordDefinition.global) {
  6577. var flags = 'g';
  6578. if (wordDefinition.ignoreCase) {
  6579. flags += 'i';
  6580. }
  6581. if (wordDefinition.multiline) {
  6582. flags += 'm';
  6583. }
  6584. if (wordDefinition.unicode) {
  6585. flags += 'u';
  6586. }
  6587. result = new RegExp(wordDefinition.source, flags);
  6588. }
  6589. else {
  6590. result = wordDefinition;
  6591. }
  6592. }
  6593. result.lastIndex = 0;
  6594. return result;
  6595. }
  6596. function getWordAtPosFast(column, wordDefinition, text, textOffset) {
  6597. // find whitespace enclosed text around column and match from there
  6598. var pos = column - 1 - textOffset;
  6599. var start = text.lastIndexOf(' ', pos - 1) + 1;
  6600. wordDefinition.lastIndex = start;
  6601. var match;
  6602. while (match = wordDefinition.exec(text)) {
  6603. var matchIndex = match.index || 0;
  6604. if (matchIndex <= pos && wordDefinition.lastIndex >= pos) {
  6605. return {
  6606. word: match[0],
  6607. startColumn: textOffset + 1 + matchIndex,
  6608. endColumn: textOffset + 1 + wordDefinition.lastIndex
  6609. };
  6610. }
  6611. }
  6612. return null;
  6613. }
  6614. function getWordAtPosSlow(column, wordDefinition, text, textOffset) {
  6615. // matches all words starting at the beginning
  6616. // of the input until it finds a match that encloses
  6617. // the desired column. slow but correct
  6618. var pos = column - 1 - textOffset;
  6619. wordDefinition.lastIndex = 0;
  6620. var match;
  6621. while (match = wordDefinition.exec(text)) {
  6622. var matchIndex = match.index || 0;
  6623. if (matchIndex > pos) {
  6624. // |nW -> matched only after the pos
  6625. return null;
  6626. }
  6627. else if (wordDefinition.lastIndex >= pos) {
  6628. // W|W -> match encloses pos
  6629. return {
  6630. word: match[0],
  6631. startColumn: textOffset + 1 + matchIndex,
  6632. endColumn: textOffset + 1 + wordDefinition.lastIndex
  6633. };
  6634. }
  6635. }
  6636. return null;
  6637. }
  6638. function getWordAtText(column, wordDefinition, text, textOffset) {
  6639. // if `words` can contain whitespace character we have to use the slow variant
  6640. // otherwise we use the fast variant of finding a word
  6641. wordDefinition.lastIndex = 0;
  6642. var match = wordDefinition.exec(text);
  6643. if (!match) {
  6644. return null;
  6645. }
  6646. // todo@joh the `match` could already be the (first) word
  6647. var ret = match[0].indexOf(' ') >= 0
  6648. // did match a word which contains a space character -> use slow word find
  6649. ? getWordAtPosSlow(column, wordDefinition, text, textOffset)
  6650. // sane word definition -> use fast word find
  6651. : getWordAtPosFast(column, wordDefinition, text, textOffset);
  6652. // both (getWordAtPosFast and getWordAtPosSlow) leave the wordDefinition-RegExp
  6653. // in an undefined state and to not confuse other users of the wordDefinition
  6654. // we reset the lastIndex
  6655. wordDefinition.lastIndex = 0;
  6656. return ret;
  6657. }
  6658. /***/ }),
  6659. /***/ "../../node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js":
  6660. /*!*************************************************************************************************!*\
  6661. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js ***!
  6662. \*************************************************************************************************/
  6663. /*! exports provided: Uint8Matrix, StateMachine, LinkComputer, computeLinks */
  6664. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6665. "use strict";
  6666. __webpack_require__.r(__webpack_exports__);
  6667. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Uint8Matrix", function() { return Uint8Matrix; });
  6668. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StateMachine", function() { return StateMachine; });
  6669. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LinkComputer", function() { return LinkComputer; });
  6670. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeLinks", function() { return computeLinks; });
  6671. /* harmony import */ var _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/characterClassifier.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/core/characterClassifier.js");
  6672. /*---------------------------------------------------------------------------------------------
  6673. * Copyright (c) Microsoft Corporation. All rights reserved.
  6674. * Licensed under the MIT License. See License.txt in the project root for license information.
  6675. *--------------------------------------------------------------------------------------------*/
  6676. var Uint8Matrix = /** @class */ (function () {
  6677. function Uint8Matrix(rows, cols, defaultValue) {
  6678. var data = new Uint8Array(rows * cols);
  6679. for (var i = 0, len = rows * cols; i < len; i++) {
  6680. data[i] = defaultValue;
  6681. }
  6682. this._data = data;
  6683. this.rows = rows;
  6684. this.cols = cols;
  6685. }
  6686. Uint8Matrix.prototype.get = function (row, col) {
  6687. return this._data[row * this.cols + col];
  6688. };
  6689. Uint8Matrix.prototype.set = function (row, col, value) {
  6690. this._data[row * this.cols + col] = value;
  6691. };
  6692. return Uint8Matrix;
  6693. }());
  6694. var StateMachine = /** @class */ (function () {
  6695. function StateMachine(edges) {
  6696. var maxCharCode = 0;
  6697. var maxState = 0 /* Invalid */;
  6698. for (var i = 0, len = edges.length; i < len; i++) {
  6699. var _a = edges[i], from = _a[0], chCode = _a[1], to = _a[2];
  6700. if (chCode > maxCharCode) {
  6701. maxCharCode = chCode;
  6702. }
  6703. if (from > maxState) {
  6704. maxState = from;
  6705. }
  6706. if (to > maxState) {
  6707. maxState = to;
  6708. }
  6709. }
  6710. maxCharCode++;
  6711. maxState++;
  6712. var states = new Uint8Matrix(maxState, maxCharCode, 0 /* Invalid */);
  6713. for (var i = 0, len = edges.length; i < len; i++) {
  6714. var _b = edges[i], from = _b[0], chCode = _b[1], to = _b[2];
  6715. states.set(from, chCode, to);
  6716. }
  6717. this._states = states;
  6718. this._maxCharCode = maxCharCode;
  6719. }
  6720. StateMachine.prototype.nextState = function (currentState, chCode) {
  6721. if (chCode < 0 || chCode >= this._maxCharCode) {
  6722. return 0 /* Invalid */;
  6723. }
  6724. return this._states.get(currentState, chCode);
  6725. };
  6726. return StateMachine;
  6727. }());
  6728. // State machine for http:// or https:// or file://
  6729. var _stateMachine = null;
  6730. function getStateMachine() {
  6731. if (_stateMachine === null) {
  6732. _stateMachine = new StateMachine([
  6733. [1 /* Start */, 104 /* h */, 2 /* H */],
  6734. [1 /* Start */, 72 /* H */, 2 /* H */],
  6735. [1 /* Start */, 102 /* f */, 6 /* F */],
  6736. [1 /* Start */, 70 /* F */, 6 /* F */],
  6737. [2 /* H */, 116 /* t */, 3 /* HT */],
  6738. [2 /* H */, 84 /* T */, 3 /* HT */],
  6739. [3 /* HT */, 116 /* t */, 4 /* HTT */],
  6740. [3 /* HT */, 84 /* T */, 4 /* HTT */],
  6741. [4 /* HTT */, 112 /* p */, 5 /* HTTP */],
  6742. [4 /* HTT */, 80 /* P */, 5 /* HTTP */],
  6743. [5 /* HTTP */, 115 /* s */, 9 /* BeforeColon */],
  6744. [5 /* HTTP */, 83 /* S */, 9 /* BeforeColon */],
  6745. [5 /* HTTP */, 58 /* Colon */, 10 /* AfterColon */],
  6746. [6 /* F */, 105 /* i */, 7 /* FI */],
  6747. [6 /* F */, 73 /* I */, 7 /* FI */],
  6748. [7 /* FI */, 108 /* l */, 8 /* FIL */],
  6749. [7 /* FI */, 76 /* L */, 8 /* FIL */],
  6750. [8 /* FIL */, 101 /* e */, 9 /* BeforeColon */],
  6751. [8 /* FIL */, 69 /* E */, 9 /* BeforeColon */],
  6752. [9 /* BeforeColon */, 58 /* Colon */, 10 /* AfterColon */],
  6753. [10 /* AfterColon */, 47 /* Slash */, 11 /* AlmostThere */],
  6754. [11 /* AlmostThere */, 47 /* Slash */, 12 /* End */],
  6755. ]);
  6756. }
  6757. return _stateMachine;
  6758. }
  6759. var _classifier = null;
  6760. function getClassifier() {
  6761. if (_classifier === null) {
  6762. _classifier = new _core_characterClassifier_js__WEBPACK_IMPORTED_MODULE_0__["CharacterClassifier"](0 /* None */);
  6763. var FORCE_TERMINATION_CHARACTERS = ' \t<>\'\"、。。、,.:;?!@#$%&*‘“〈《「『【〔([{「」}])〕】』」》〉”’`~…';
  6764. for (var i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) {
  6765. _classifier.set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), 1 /* ForceTermination */);
  6766. }
  6767. var CANNOT_END_WITH_CHARACTERS = '.,;';
  6768. for (var i = 0; i < CANNOT_END_WITH_CHARACTERS.length; i++) {
  6769. _classifier.set(CANNOT_END_WITH_CHARACTERS.charCodeAt(i), 2 /* CannotEndIn */);
  6770. }
  6771. }
  6772. return _classifier;
  6773. }
  6774. var LinkComputer = /** @class */ (function () {
  6775. function LinkComputer() {
  6776. }
  6777. LinkComputer._createLink = function (classifier, line, lineNumber, linkBeginIndex, linkEndIndex) {
  6778. // Do not allow to end link in certain characters...
  6779. var lastIncludedCharIndex = linkEndIndex - 1;
  6780. do {
  6781. var chCode = line.charCodeAt(lastIncludedCharIndex);
  6782. var chClass = classifier.get(chCode);
  6783. if (chClass !== 2 /* CannotEndIn */) {
  6784. break;
  6785. }
  6786. lastIncludedCharIndex--;
  6787. } while (lastIncludedCharIndex > linkBeginIndex);
  6788. // Handle links enclosed in parens, square brackets and curlys.
  6789. if (linkBeginIndex > 0) {
  6790. var charCodeBeforeLink = line.charCodeAt(linkBeginIndex - 1);
  6791. var lastCharCodeInLink = line.charCodeAt(lastIncludedCharIndex);
  6792. if ((charCodeBeforeLink === 40 /* OpenParen */ && lastCharCodeInLink === 41 /* CloseParen */)
  6793. || (charCodeBeforeLink === 91 /* OpenSquareBracket */ && lastCharCodeInLink === 93 /* CloseSquareBracket */)
  6794. || (charCodeBeforeLink === 123 /* OpenCurlyBrace */ && lastCharCodeInLink === 125 /* CloseCurlyBrace */)) {
  6795. // Do not end in ) if ( is before the link start
  6796. // Do not end in ] if [ is before the link start
  6797. // Do not end in } if { is before the link start
  6798. lastIncludedCharIndex--;
  6799. }
  6800. }
  6801. return {
  6802. range: {
  6803. startLineNumber: lineNumber,
  6804. startColumn: linkBeginIndex + 1,
  6805. endLineNumber: lineNumber,
  6806. endColumn: lastIncludedCharIndex + 2
  6807. },
  6808. url: line.substring(linkBeginIndex, lastIncludedCharIndex + 1)
  6809. };
  6810. };
  6811. LinkComputer.computeLinks = function (model, stateMachine) {
  6812. if (stateMachine === void 0) { stateMachine = getStateMachine(); }
  6813. var classifier = getClassifier();
  6814. var result = [];
  6815. for (var i = 1, lineCount = model.getLineCount(); i <= lineCount; i++) {
  6816. var line = model.getLineContent(i);
  6817. var len = line.length;
  6818. var j = 0;
  6819. var linkBeginIndex = 0;
  6820. var linkBeginChCode = 0;
  6821. var state = 1 /* Start */;
  6822. var hasOpenParens = false;
  6823. var hasOpenSquareBracket = false;
  6824. var hasOpenCurlyBracket = false;
  6825. while (j < len) {
  6826. var resetStateMachine = false;
  6827. var chCode = line.charCodeAt(j);
  6828. if (state === 13 /* Accept */) {
  6829. var chClass = void 0;
  6830. switch (chCode) {
  6831. case 40 /* OpenParen */:
  6832. hasOpenParens = true;
  6833. chClass = 0 /* None */;
  6834. break;
  6835. case 41 /* CloseParen */:
  6836. chClass = (hasOpenParens ? 0 /* None */ : 1 /* ForceTermination */);
  6837. break;
  6838. case 91 /* OpenSquareBracket */:
  6839. hasOpenSquareBracket = true;
  6840. chClass = 0 /* None */;
  6841. break;
  6842. case 93 /* CloseSquareBracket */:
  6843. chClass = (hasOpenSquareBracket ? 0 /* None */ : 1 /* ForceTermination */);
  6844. break;
  6845. case 123 /* OpenCurlyBrace */:
  6846. hasOpenCurlyBracket = true;
  6847. chClass = 0 /* None */;
  6848. break;
  6849. case 125 /* CloseCurlyBrace */:
  6850. chClass = (hasOpenCurlyBracket ? 0 /* None */ : 1 /* ForceTermination */);
  6851. break;
  6852. /* The following three rules make it that ' or " or ` are allowed inside links if the link began with a different one */
  6853. case 39 /* SingleQuote */:
  6854. chClass = (linkBeginChCode === 34 /* DoubleQuote */ || linkBeginChCode === 96 /* BackTick */) ? 0 /* None */ : 1 /* ForceTermination */;
  6855. break;
  6856. case 34 /* DoubleQuote */:
  6857. chClass = (linkBeginChCode === 39 /* SingleQuote */ || linkBeginChCode === 96 /* BackTick */) ? 0 /* None */ : 1 /* ForceTermination */;
  6858. break;
  6859. case 96 /* BackTick */:
  6860. chClass = (linkBeginChCode === 39 /* SingleQuote */ || linkBeginChCode === 34 /* DoubleQuote */) ? 0 /* None */ : 1 /* ForceTermination */;
  6861. break;
  6862. case 42 /* Asterisk */:
  6863. // `*` terminates a link if the link began with `*`
  6864. chClass = (linkBeginChCode === 42 /* Asterisk */) ? 1 /* ForceTermination */ : 0 /* None */;
  6865. break;
  6866. case 124 /* Pipe */:
  6867. // `|` terminates a link if the link began with `|`
  6868. chClass = (linkBeginChCode === 124 /* Pipe */) ? 1 /* ForceTermination */ : 0 /* None */;
  6869. break;
  6870. default:
  6871. chClass = classifier.get(chCode);
  6872. }
  6873. // Check if character terminates link
  6874. if (chClass === 1 /* ForceTermination */) {
  6875. result.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, j));
  6876. resetStateMachine = true;
  6877. }
  6878. }
  6879. else if (state === 12 /* End */) {
  6880. var chClass = void 0;
  6881. if (chCode === 91 /* OpenSquareBracket */) {
  6882. // Allow for the authority part to contain ipv6 addresses which contain [ and ]
  6883. hasOpenSquareBracket = true;
  6884. chClass = 0 /* None */;
  6885. }
  6886. else {
  6887. chClass = classifier.get(chCode);
  6888. }
  6889. // Check if character terminates link
  6890. if (chClass === 1 /* ForceTermination */) {
  6891. resetStateMachine = true;
  6892. }
  6893. else {
  6894. state = 13 /* Accept */;
  6895. }
  6896. }
  6897. else {
  6898. state = stateMachine.nextState(state, chCode);
  6899. if (state === 0 /* Invalid */) {
  6900. resetStateMachine = true;
  6901. }
  6902. }
  6903. if (resetStateMachine) {
  6904. state = 1 /* Start */;
  6905. hasOpenParens = false;
  6906. hasOpenSquareBracket = false;
  6907. hasOpenCurlyBracket = false;
  6908. // Record where the link started
  6909. linkBeginIndex = j + 1;
  6910. linkBeginChCode = chCode;
  6911. }
  6912. j++;
  6913. }
  6914. if (state === 13 /* Accept */) {
  6915. result.push(LinkComputer._createLink(classifier, line, i, linkBeginIndex, len));
  6916. }
  6917. }
  6918. return result;
  6919. };
  6920. return LinkComputer;
  6921. }());
  6922. /**
  6923. * Returns an array of all links contains in the provided
  6924. * document. *Note* that this operation is computational
  6925. * expensive and should not run in the UI thread.
  6926. */
  6927. function computeLinks(model) {
  6928. if (!model || typeof model.getLineCount !== 'function' || typeof model.getLineContent !== 'function') {
  6929. // Unknown caller!
  6930. return [];
  6931. }
  6932. return LinkComputer.computeLinks(model);
  6933. }
  6934. /***/ }),
  6935. /***/ "../../node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js":
  6936. /*!*******************************************************************************************************************!*\
  6937. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js ***!
  6938. \*******************************************************************************************************************/
  6939. /*! exports provided: BasicInplaceReplace */
  6940. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6941. "use strict";
  6942. __webpack_require__.r(__webpack_exports__);
  6943. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BasicInplaceReplace", function() { return BasicInplaceReplace; });
  6944. /*---------------------------------------------------------------------------------------------
  6945. * Copyright (c) Microsoft Corporation. All rights reserved.
  6946. * Licensed under the MIT License. See License.txt in the project root for license information.
  6947. *--------------------------------------------------------------------------------------------*/
  6948. var BasicInplaceReplace = /** @class */ (function () {
  6949. function BasicInplaceReplace() {
  6950. this._defaultValueSet = [
  6951. ['true', 'false'],
  6952. ['True', 'False'],
  6953. ['Private', 'Public', 'Friend', 'ReadOnly', 'Partial', 'Protected', 'WriteOnly'],
  6954. ['public', 'protected', 'private'],
  6955. ];
  6956. }
  6957. BasicInplaceReplace.prototype.navigateValueSet = function (range1, text1, range2, text2, up) {
  6958. if (range1 && text1) {
  6959. var result = this.doNavigateValueSet(text1, up);
  6960. if (result) {
  6961. return {
  6962. range: range1,
  6963. value: result
  6964. };
  6965. }
  6966. }
  6967. if (range2 && text2) {
  6968. var result = this.doNavigateValueSet(text2, up);
  6969. if (result) {
  6970. return {
  6971. range: range2,
  6972. value: result
  6973. };
  6974. }
  6975. }
  6976. return null;
  6977. };
  6978. BasicInplaceReplace.prototype.doNavigateValueSet = function (text, up) {
  6979. var numberResult = this.numberReplace(text, up);
  6980. if (numberResult !== null) {
  6981. return numberResult;
  6982. }
  6983. return this.textReplace(text, up);
  6984. };
  6985. BasicInplaceReplace.prototype.numberReplace = function (value, up) {
  6986. var precision = Math.pow(10, value.length - (value.lastIndexOf('.') + 1));
  6987. var n1 = Number(value);
  6988. var n2 = parseFloat(value);
  6989. if (!isNaN(n1) && !isNaN(n2) && n1 === n2) {
  6990. if (n1 === 0 && !up) {
  6991. return null; // don't do negative
  6992. // } else if(n1 === 9 && up) {
  6993. // return null; // don't insert 10 into a number
  6994. }
  6995. else {
  6996. n1 = Math.floor(n1 * precision);
  6997. n1 += up ? precision : -precision;
  6998. return String(n1 / precision);
  6999. }
  7000. }
  7001. return null;
  7002. };
  7003. BasicInplaceReplace.prototype.textReplace = function (value, up) {
  7004. return this.valueSetsReplace(this._defaultValueSet, value, up);
  7005. };
  7006. BasicInplaceReplace.prototype.valueSetsReplace = function (valueSets, value, up) {
  7007. var result = null;
  7008. for (var i = 0, len = valueSets.length; result === null && i < len; i++) {
  7009. result = this.valueSetReplace(valueSets[i], value, up);
  7010. }
  7011. return result;
  7012. };
  7013. BasicInplaceReplace.prototype.valueSetReplace = function (valueSet, value, up) {
  7014. var idx = valueSet.indexOf(value);
  7015. if (idx >= 0) {
  7016. idx += up ? +1 : -1;
  7017. if (idx < 0) {
  7018. idx = valueSet.length - 1;
  7019. }
  7020. else {
  7021. idx %= valueSet.length;
  7022. }
  7023. return valueSet[idx];
  7024. }
  7025. return null;
  7026. };
  7027. BasicInplaceReplace.INSTANCE = new BasicInplaceReplace();
  7028. return BasicInplaceReplace;
  7029. }());
  7030. /***/ }),
  7031. /***/ "../../node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js":
  7032. /*!**********************************************************************************************************!*\
  7033. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js ***!
  7034. \**********************************************************************************************************/
  7035. /*! exports provided: EditorSimpleWorker, create */
  7036. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7037. "use strict";
  7038. __webpack_require__.r(__webpack_exports__);
  7039. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorSimpleWorker", function() { return EditorSimpleWorker; });
  7040. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
  7041. /* harmony import */ var _base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/arrays.js */ "../../node_modules/monaco-editor/esm/vs/base/common/arrays.js");
  7042. /* harmony import */ var _base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/diff/diff.js */ "../../node_modules/monaco-editor/esm/vs/base/common/diff/diff.js");
  7043. /* harmony import */ var _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/iterator.js */ "../../node_modules/monaco-editor/esm/vs/base/common/iterator.js");
  7044. /* harmony import */ var _base_common_platform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/platform.js */ "../../node_modules/monaco-editor/esm/vs/base/common/platform.js");
  7045. /* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/uri.js */ "../../node_modules/monaco-editor/esm/vs/base/common/uri.js");
  7046. /* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/position.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/core/position.js");
  7047. /* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/range.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/core/range.js");
  7048. /* harmony import */ var _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../diff/diffComputer.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/diff/diffComputer.js");
  7049. /* harmony import */ var _model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../model/mirrorTextModel.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/model/mirrorTextModel.js");
  7050. /* harmony import */ var _model_wordHelper_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../model/wordHelper.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/model/wordHelper.js");
  7051. /* harmony import */ var _modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../modes/linkComputer.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/modes/linkComputer.js");
  7052. /* harmony import */ var _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../modes/supports/inplaceReplaceSupport.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/modes/supports/inplaceReplaceSupport.js");
  7053. /* harmony import */ var _standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../standalone/standaloneBase.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js");
  7054. /* harmony import */ var _base_common_types_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../base/common/types.js */ "../../node_modules/monaco-editor/esm/vs/base/common/types.js");
  7055. /*---------------------------------------------------------------------------------------------
  7056. * Copyright (c) Microsoft Corporation. All rights reserved.
  7057. * Licensed under the MIT License. See License.txt in the project root for license information.
  7058. *--------------------------------------------------------------------------------------------*/
  7059. var __extends = (undefined && undefined.__extends) || (function () {
  7060. var extendStatics = function (d, b) {
  7061. extendStatics = Object.setPrototypeOf ||
  7062. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  7063. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  7064. return extendStatics(d, b);
  7065. };
  7066. return function (d, b) {
  7067. extendStatics(d, b);
  7068. function __() { this.constructor = d; }
  7069. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  7070. };
  7071. })();
  7072. var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
  7073. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7074. return new (P || (P = Promise))(function (resolve, reject) {
  7075. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7076. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7077. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7078. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7079. });
  7080. };
  7081. var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
  7082. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  7083. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  7084. function verb(n) { return function (v) { return step([n, v]); }; }
  7085. function step(op) {
  7086. if (f) throw new TypeError("Generator is already executing.");
  7087. while (_) try {
  7088. if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
  7089. if (y = 0, t) op = [op[0] & 2, t.value];
  7090. switch (op[0]) {
  7091. case 0: case 1: t = op; break;
  7092. case 4: _.label++; return { value: op[1], done: false };
  7093. case 5: _.label++; y = op[1]; op = [0]; continue;
  7094. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  7095. default:
  7096. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  7097. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  7098. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  7099. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  7100. if (t[2]) _.ops.pop();
  7101. _.trys.pop(); continue;
  7102. }
  7103. op = body.call(thisArg, _);
  7104. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  7105. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  7106. }
  7107. };
  7108. /**
  7109. * @internal
  7110. */
  7111. var MirrorModel = /** @class */ (function (_super) {
  7112. __extends(MirrorModel, _super);
  7113. function MirrorModel() {
  7114. return _super !== null && _super.apply(this, arguments) || this;
  7115. }
  7116. Object.defineProperty(MirrorModel.prototype, "uri", {
  7117. get: function () {
  7118. return this._uri;
  7119. },
  7120. enumerable: true,
  7121. configurable: true
  7122. });
  7123. Object.defineProperty(MirrorModel.prototype, "version", {
  7124. get: function () {
  7125. return this._versionId;
  7126. },
  7127. enumerable: true,
  7128. configurable: true
  7129. });
  7130. Object.defineProperty(MirrorModel.prototype, "eol", {
  7131. get: function () {
  7132. return this._eol;
  7133. },
  7134. enumerable: true,
  7135. configurable: true
  7136. });
  7137. MirrorModel.prototype.getValue = function () {
  7138. return this.getText();
  7139. };
  7140. MirrorModel.prototype.getLinesContent = function () {
  7141. return this._lines.slice(0);
  7142. };
  7143. MirrorModel.prototype.getLineCount = function () {
  7144. return this._lines.length;
  7145. };
  7146. MirrorModel.prototype.getLineContent = function (lineNumber) {
  7147. return this._lines[lineNumber - 1];
  7148. };
  7149. MirrorModel.prototype.getWordAtPosition = function (position, wordDefinition) {
  7150. var wordAtText = Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_9__["getWordAtText"])(position.column, Object(_model_wordHelper_js__WEBPACK_IMPORTED_MODULE_9__["ensureValidWordDefinition"])(wordDefinition), this._lines[position.lineNumber - 1], 0);
  7151. if (wordAtText) {
  7152. return new _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"](position.lineNumber, wordAtText.startColumn, position.lineNumber, wordAtText.endColumn);
  7153. }
  7154. return null;
  7155. };
  7156. MirrorModel.prototype.createWordIterator = function (wordDefinition) {
  7157. var _this = this;
  7158. var obj;
  7159. var lineNumber = 0;
  7160. var lineText;
  7161. var wordRangesIdx = 0;
  7162. var wordRanges = [];
  7163. var next = function () {
  7164. if (wordRangesIdx < wordRanges.length) {
  7165. var value = lineText.substring(wordRanges[wordRangesIdx].start, wordRanges[wordRangesIdx].end);
  7166. wordRangesIdx += 1;
  7167. if (!obj) {
  7168. obj = { done: false, value: value };
  7169. }
  7170. else {
  7171. obj.value = value;
  7172. }
  7173. return obj;
  7174. }
  7175. else if (lineNumber >= _this._lines.length) {
  7176. return _base_common_iterator_js__WEBPACK_IMPORTED_MODULE_2__["FIN"];
  7177. }
  7178. else {
  7179. lineText = _this._lines[lineNumber];
  7180. wordRanges = _this._wordenize(lineText, wordDefinition);
  7181. wordRangesIdx = 0;
  7182. lineNumber += 1;
  7183. return next();
  7184. }
  7185. };
  7186. return { next: next };
  7187. };
  7188. MirrorModel.prototype.getLineWords = function (lineNumber, wordDefinition) {
  7189. var content = this._lines[lineNumber - 1];
  7190. var ranges = this._wordenize(content, wordDefinition);
  7191. var words = [];
  7192. for (var _i = 0, ranges_1 = ranges; _i < ranges_1.length; _i++) {
  7193. var range = ranges_1[_i];
  7194. words.push({
  7195. word: content.substring(range.start, range.end),
  7196. startColumn: range.start + 1,
  7197. endColumn: range.end + 1
  7198. });
  7199. }
  7200. return words;
  7201. };
  7202. MirrorModel.prototype._wordenize = function (content, wordDefinition) {
  7203. var result = [];
  7204. var match;
  7205. wordDefinition.lastIndex = 0; // reset lastIndex just to be sure
  7206. while (match = wordDefinition.exec(content)) {
  7207. if (match[0].length === 0) {
  7208. // it did match the empty string
  7209. break;
  7210. }
  7211. result.push({ start: match.index, end: match.index + match[0].length });
  7212. }
  7213. return result;
  7214. };
  7215. MirrorModel.prototype.getValueInRange = function (range) {
  7216. range = this._validateRange(range);
  7217. if (range.startLineNumber === range.endLineNumber) {
  7218. return this._lines[range.startLineNumber - 1].substring(range.startColumn - 1, range.endColumn - 1);
  7219. }
  7220. var lineEnding = this._eol;
  7221. var startLineIndex = range.startLineNumber - 1;
  7222. var endLineIndex = range.endLineNumber - 1;
  7223. var resultLines = [];
  7224. resultLines.push(this._lines[startLineIndex].substring(range.startColumn - 1));
  7225. for (var i = startLineIndex + 1; i < endLineIndex; i++) {
  7226. resultLines.push(this._lines[i]);
  7227. }
  7228. resultLines.push(this._lines[endLineIndex].substring(0, range.endColumn - 1));
  7229. return resultLines.join(lineEnding);
  7230. };
  7231. MirrorModel.prototype.offsetAt = function (position) {
  7232. position = this._validatePosition(position);
  7233. this._ensureLineStarts();
  7234. return this._lineStarts.getAccumulatedValue(position.lineNumber - 2) + (position.column - 1);
  7235. };
  7236. MirrorModel.prototype.positionAt = function (offset) {
  7237. offset = Math.floor(offset);
  7238. offset = Math.max(0, offset);
  7239. this._ensureLineStarts();
  7240. var out = this._lineStarts.getIndexOf(offset);
  7241. var lineLength = this._lines[out.index].length;
  7242. // Ensure we return a valid position
  7243. return {
  7244. lineNumber: 1 + out.index,
  7245. column: 1 + Math.min(out.remainder, lineLength)
  7246. };
  7247. };
  7248. MirrorModel.prototype._validateRange = function (range) {
  7249. var start = this._validatePosition({ lineNumber: range.startLineNumber, column: range.startColumn });
  7250. var end = this._validatePosition({ lineNumber: range.endLineNumber, column: range.endColumn });
  7251. if (start.lineNumber !== range.startLineNumber
  7252. || start.column !== range.startColumn
  7253. || end.lineNumber !== range.endLineNumber
  7254. || end.column !== range.endColumn) {
  7255. return {
  7256. startLineNumber: start.lineNumber,
  7257. startColumn: start.column,
  7258. endLineNumber: end.lineNumber,
  7259. endColumn: end.column
  7260. };
  7261. }
  7262. return range;
  7263. };
  7264. MirrorModel.prototype._validatePosition = function (position) {
  7265. if (!_core_position_js__WEBPACK_IMPORTED_MODULE_5__["Position"].isIPosition(position)) {
  7266. throw new Error('bad position');
  7267. }
  7268. var lineNumber = position.lineNumber, column = position.column;
  7269. var hasChanged = false;
  7270. if (lineNumber < 1) {
  7271. lineNumber = 1;
  7272. column = 1;
  7273. hasChanged = true;
  7274. }
  7275. else if (lineNumber > this._lines.length) {
  7276. lineNumber = this._lines.length;
  7277. column = this._lines[lineNumber - 1].length + 1;
  7278. hasChanged = true;
  7279. }
  7280. else {
  7281. var maxCharacter = this._lines[lineNumber - 1].length + 1;
  7282. if (column < 1) {
  7283. column = 1;
  7284. hasChanged = true;
  7285. }
  7286. else if (column > maxCharacter) {
  7287. column = maxCharacter;
  7288. hasChanged = true;
  7289. }
  7290. }
  7291. if (!hasChanged) {
  7292. return position;
  7293. }
  7294. else {
  7295. return { lineNumber: lineNumber, column: column };
  7296. }
  7297. };
  7298. return MirrorModel;
  7299. }(_model_mirrorTextModel_js__WEBPACK_IMPORTED_MODULE_8__["MirrorTextModel"]));
  7300. /**
  7301. * @internal
  7302. */
  7303. var EditorSimpleWorker = /** @class */ (function () {
  7304. function EditorSimpleWorker(host, foreignModuleFactory) {
  7305. this._host = host;
  7306. this._models = Object.create(null);
  7307. this._foreignModuleFactory = foreignModuleFactory;
  7308. this._foreignModule = null;
  7309. }
  7310. EditorSimpleWorker.prototype.dispose = function () {
  7311. this._models = Object.create(null);
  7312. };
  7313. EditorSimpleWorker.prototype._getModel = function (uri) {
  7314. return this._models[uri];
  7315. };
  7316. EditorSimpleWorker.prototype._getModels = function () {
  7317. var _this = this;
  7318. var all = [];
  7319. Object.keys(this._models).forEach(function (key) { return all.push(_this._models[key]); });
  7320. return all;
  7321. };
  7322. EditorSimpleWorker.prototype.acceptNewModel = function (data) {
  7323. this._models[data.url] = new MirrorModel(_base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__["URI"].parse(data.url), data.lines, data.EOL, data.versionId);
  7324. };
  7325. EditorSimpleWorker.prototype.acceptModelChanged = function (strURL, e) {
  7326. if (!this._models[strURL]) {
  7327. return;
  7328. }
  7329. var model = this._models[strURL];
  7330. model.onEvents(e);
  7331. };
  7332. EditorSimpleWorker.prototype.acceptRemovedModel = function (strURL) {
  7333. if (!this._models[strURL]) {
  7334. return;
  7335. }
  7336. delete this._models[strURL];
  7337. };
  7338. // ---- BEGIN diff --------------------------------------------------------------------------
  7339. EditorSimpleWorker.prototype.computeDiff = function (originalUrl, modifiedUrl, ignoreTrimWhitespace, maxComputationTime) {
  7340. return __awaiter(this, void 0, void 0, function () {
  7341. var original, modified, originalLines, modifiedLines, diffComputer, diffResult, identical;
  7342. return __generator(this, function (_a) {
  7343. original = this._getModel(originalUrl);
  7344. modified = this._getModel(modifiedUrl);
  7345. if (!original || !modified) {
  7346. return [2 /*return*/, null];
  7347. }
  7348. originalLines = original.getLinesContent();
  7349. modifiedLines = modified.getLinesContent();
  7350. diffComputer = new _diff_diffComputer_js__WEBPACK_IMPORTED_MODULE_7__["DiffComputer"](originalLines, modifiedLines, {
  7351. shouldComputeCharChanges: true,
  7352. shouldPostProcessCharChanges: true,
  7353. shouldIgnoreTrimWhitespace: ignoreTrimWhitespace,
  7354. shouldMakePrettyDiff: true,
  7355. maxComputationTime: maxComputationTime
  7356. });
  7357. diffResult = diffComputer.computeDiff();
  7358. identical = (diffResult.changes.length > 0 ? false : this._modelsAreIdentical(original, modified));
  7359. return [2 /*return*/, {
  7360. quitEarly: diffResult.quitEarly,
  7361. identical: identical,
  7362. changes: diffResult.changes
  7363. }];
  7364. });
  7365. });
  7366. };
  7367. EditorSimpleWorker.prototype._modelsAreIdentical = function (original, modified) {
  7368. var originalLineCount = original.getLineCount();
  7369. var modifiedLineCount = modified.getLineCount();
  7370. if (originalLineCount !== modifiedLineCount) {
  7371. return false;
  7372. }
  7373. for (var line = 1; line <= originalLineCount; line++) {
  7374. var originalLine = original.getLineContent(line);
  7375. var modifiedLine = modified.getLineContent(line);
  7376. if (originalLine !== modifiedLine) {
  7377. return false;
  7378. }
  7379. }
  7380. return true;
  7381. };
  7382. EditorSimpleWorker.prototype.computeMoreMinimalEdits = function (modelUrl, edits) {
  7383. return __awaiter(this, void 0, void 0, function () {
  7384. var model, result, lastEol, _i, edits_1, _a, range, text, eol, original, changes, editOffset, _b, changes_1, change, start, end, newEdit;
  7385. return __generator(this, function (_c) {
  7386. model = this._getModel(modelUrl);
  7387. if (!model) {
  7388. return [2 /*return*/, edits];
  7389. }
  7390. result = [];
  7391. lastEol = undefined;
  7392. edits = Object(_base_common_arrays_js__WEBPACK_IMPORTED_MODULE_0__["mergeSort"])(edits, function (a, b) {
  7393. if (a.range && b.range) {
  7394. return _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].compareRangesUsingStarts(a.range, b.range);
  7395. }
  7396. // eol only changes should go to the end
  7397. var aRng = a.range ? 0 : 1;
  7398. var bRng = b.range ? 0 : 1;
  7399. return aRng - bRng;
  7400. });
  7401. for (_i = 0, edits_1 = edits; _i < edits_1.length; _i++) {
  7402. _a = edits_1[_i], range = _a.range, text = _a.text, eol = _a.eol;
  7403. if (typeof eol === 'number') {
  7404. lastEol = eol;
  7405. }
  7406. if (_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].isEmpty(range) && !text) {
  7407. // empty change
  7408. continue;
  7409. }
  7410. original = model.getValueInRange(range);
  7411. text = text.replace(/\r\n|\n|\r/g, model.eol);
  7412. if (original === text) {
  7413. // noop
  7414. continue;
  7415. }
  7416. // make sure diff won't take too long
  7417. if (Math.max(text.length, original.length) > EditorSimpleWorker._diffLimit) {
  7418. result.push({ range: range, text: text });
  7419. continue;
  7420. }
  7421. changes = Object(_base_common_diff_diff_js__WEBPACK_IMPORTED_MODULE_1__["stringDiff"])(original, text, false);
  7422. editOffset = model.offsetAt(_core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"].lift(range).getStartPosition());
  7423. for (_b = 0, changes_1 = changes; _b < changes_1.length; _b++) {
  7424. change = changes_1[_b];
  7425. start = model.positionAt(editOffset + change.originalStart);
  7426. end = model.positionAt(editOffset + change.originalStart + change.originalLength);
  7427. newEdit = {
  7428. text: text.substr(change.modifiedStart, change.modifiedLength),
  7429. range: { startLineNumber: start.lineNumber, startColumn: start.column, endLineNumber: end.lineNumber, endColumn: end.column }
  7430. };
  7431. if (model.getValueInRange(newEdit.range) !== newEdit.text) {
  7432. result.push(newEdit);
  7433. }
  7434. }
  7435. }
  7436. if (typeof lastEol === 'number') {
  7437. result.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } });
  7438. }
  7439. return [2 /*return*/, result];
  7440. });
  7441. });
  7442. };
  7443. // ---- END minimal edits ---------------------------------------------------------------
  7444. EditorSimpleWorker.prototype.computeLinks = function (modelUrl) {
  7445. return __awaiter(this, void 0, void 0, function () {
  7446. var model;
  7447. return __generator(this, function (_a) {
  7448. model = this._getModel(modelUrl);
  7449. if (!model) {
  7450. return [2 /*return*/, null];
  7451. }
  7452. return [2 /*return*/, Object(_modes_linkComputer_js__WEBPACK_IMPORTED_MODULE_10__["computeLinks"])(model)];
  7453. });
  7454. });
  7455. };
  7456. EditorSimpleWorker.prototype.textualSuggest = function (modelUrl, position, wordDef, wordDefFlags) {
  7457. return __awaiter(this, void 0, void 0, function () {
  7458. var model, words, seen, wordDefRegExp, wordAt, iter, e, word;
  7459. return __generator(this, function (_a) {
  7460. model = this._getModel(modelUrl);
  7461. if (!model) {
  7462. return [2 /*return*/, null];
  7463. }
  7464. words = [];
  7465. seen = new Set();
  7466. wordDefRegExp = new RegExp(wordDef, wordDefFlags);
  7467. wordAt = model.getWordAtPosition(position, wordDefRegExp);
  7468. if (wordAt) {
  7469. seen.add(model.getValueInRange(wordAt));
  7470. }
  7471. for (iter = model.createWordIterator(wordDefRegExp), e = iter.next(); !e.done && seen.size <= EditorSimpleWorker._suggestionsLimit; e = iter.next()) {
  7472. word = e.value;
  7473. if (seen.has(word)) {
  7474. continue;
  7475. }
  7476. seen.add(word);
  7477. if (!isNaN(Number(word))) {
  7478. continue;
  7479. }
  7480. words.push(word);
  7481. }
  7482. return [2 /*return*/, words];
  7483. });
  7484. });
  7485. };
  7486. // ---- END suggest --------------------------------------------------------------------------
  7487. //#region -- word ranges --
  7488. EditorSimpleWorker.prototype.computeWordRanges = function (modelUrl, range, wordDef, wordDefFlags) {
  7489. return __awaiter(this, void 0, void 0, function () {
  7490. var model, wordDefRegExp, result, line, words, _i, words_1, word, array;
  7491. return __generator(this, function (_a) {
  7492. model = this._getModel(modelUrl);
  7493. if (!model) {
  7494. return [2 /*return*/, Object.create(null)];
  7495. }
  7496. wordDefRegExp = new RegExp(wordDef, wordDefFlags);
  7497. result = Object.create(null);
  7498. for (line = range.startLineNumber; line < range.endLineNumber; line++) {
  7499. words = model.getLineWords(line, wordDefRegExp);
  7500. for (_i = 0, words_1 = words; _i < words_1.length; _i++) {
  7501. word = words_1[_i];
  7502. if (!isNaN(Number(word.word))) {
  7503. continue;
  7504. }
  7505. array = result[word.word];
  7506. if (!array) {
  7507. array = [];
  7508. result[word.word] = array;
  7509. }
  7510. array.push({
  7511. startLineNumber: line,
  7512. startColumn: word.startColumn,
  7513. endLineNumber: line,
  7514. endColumn: word.endColumn
  7515. });
  7516. }
  7517. }
  7518. return [2 /*return*/, result];
  7519. });
  7520. });
  7521. };
  7522. //#endregion
  7523. EditorSimpleWorker.prototype.navigateValueSet = function (modelUrl, range, up, wordDef, wordDefFlags) {
  7524. return __awaiter(this, void 0, void 0, function () {
  7525. var model, wordDefRegExp, selectionText, wordRange, word, result;
  7526. return __generator(this, function (_a) {
  7527. model = this._getModel(modelUrl);
  7528. if (!model) {
  7529. return [2 /*return*/, null];
  7530. }
  7531. wordDefRegExp = new RegExp(wordDef, wordDefFlags);
  7532. if (range.startColumn === range.endColumn) {
  7533. range = {
  7534. startLineNumber: range.startLineNumber,
  7535. startColumn: range.startColumn,
  7536. endLineNumber: range.endLineNumber,
  7537. endColumn: range.endColumn + 1
  7538. };
  7539. }
  7540. selectionText = model.getValueInRange(range);
  7541. wordRange = model.getWordAtPosition({ lineNumber: range.startLineNumber, column: range.startColumn }, wordDefRegExp);
  7542. if (!wordRange) {
  7543. return [2 /*return*/, null];
  7544. }
  7545. word = model.getValueInRange(wordRange);
  7546. result = _modes_supports_inplaceReplaceSupport_js__WEBPACK_IMPORTED_MODULE_11__["BasicInplaceReplace"].INSTANCE.navigateValueSet(range, selectionText, wordRange, word, up);
  7547. return [2 /*return*/, result];
  7548. });
  7549. });
  7550. };
  7551. // ---- BEGIN foreign module support --------------------------------------------------------------------------
  7552. EditorSimpleWorker.prototype.loadForeignModule = function (moduleId, createData, foreignHostMethods) {
  7553. var _this = this;
  7554. var proxyMethodRequest = function (method, args) {
  7555. return _this._host.fhr(method, args);
  7556. };
  7557. var foreignHost = _base_common_types_js__WEBPACK_IMPORTED_MODULE_13__["createProxyObject"](foreignHostMethods, proxyMethodRequest);
  7558. var ctx = {
  7559. host: foreignHost,
  7560. getMirrorModels: function () {
  7561. return _this._getModels();
  7562. }
  7563. };
  7564. if (this._foreignModuleFactory) {
  7565. this._foreignModule = this._foreignModuleFactory(ctx, createData);
  7566. // static foreing module
  7567. return Promise.resolve(_base_common_types_js__WEBPACK_IMPORTED_MODULE_13__["getAllMethodNames"](this._foreignModule));
  7568. }
  7569. // ESM-comment-begin
  7570. // return new Promise<any>((resolve, reject) => {
  7571. // require([moduleId], (foreignModule: { create: IForeignModuleFactory }) => {
  7572. // this._foreignModule = foreignModule.create(ctx, createData);
  7573. //
  7574. // resolve(types.getAllMethodNames(this._foreignModule));
  7575. //
  7576. // }, reject);
  7577. // });
  7578. // ESM-comment-end
  7579. // ESM-uncomment-begin
  7580. return Promise.reject(new Error("Unexpected usage"));
  7581. // ESM-uncomment-end
  7582. };
  7583. // foreign method request
  7584. EditorSimpleWorker.prototype.fmr = function (method, args) {
  7585. if (!this._foreignModule || typeof this._foreignModule[method] !== 'function') {
  7586. return Promise.reject(new Error('Missing requestHandler or method: ' + method));
  7587. }
  7588. try {
  7589. return Promise.resolve(this._foreignModule[method].apply(this._foreignModule, args));
  7590. }
  7591. catch (e) {
  7592. return Promise.reject(e);
  7593. }
  7594. };
  7595. // ---- END diff --------------------------------------------------------------------------
  7596. // ---- BEGIN minimal edits ---------------------------------------------------------------
  7597. EditorSimpleWorker._diffLimit = 100000;
  7598. // ---- BEGIN suggest --------------------------------------------------------------------------
  7599. EditorSimpleWorker._suggestionsLimit = 10000;
  7600. return EditorSimpleWorker;
  7601. }());
  7602. /**
  7603. * Called on the worker side
  7604. * @internal
  7605. */
  7606. function create(host) {
  7607. return new EditorSimpleWorker(host, null);
  7608. }
  7609. if (typeof importScripts === 'function') {
  7610. // Running in a web worker
  7611. _base_common_platform_js__WEBPACK_IMPORTED_MODULE_3__["globals"].monaco = Object(_standalone_standaloneBase_js__WEBPACK_IMPORTED_MODULE_12__["createMonacoBaseAPI"])();
  7612. }
  7613. /***/ }),
  7614. /***/ "../../node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js":
  7615. /*!*******************************************************************************************************************!*\
  7616. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js ***!
  7617. \*******************************************************************************************************************/
  7618. /*! no static exports found */
  7619. /***/ (function(module, exports, __webpack_require__) {
  7620. /* WEBPACK VAR INJECTION */(function(setImmediate, global) {/*!
  7621. Copyright (c) 2014 Taylor Hakes
  7622. Copyright (c) 2014 Forbes Lindesay
  7623. */
  7624. (function (global, factory) {
  7625. true ? factory() :
  7626. undefined;
  7627. }(this, (function () {
  7628. 'use strict';
  7629. /**
  7630. * @this {Promise}
  7631. */
  7632. function finallyConstructor(callback) {
  7633. var constructor = this.constructor;
  7634. return this.then(
  7635. function (value) {
  7636. return constructor.resolve(callback()).then(function () {
  7637. return value;
  7638. });
  7639. },
  7640. function (reason) {
  7641. return constructor.resolve(callback()).then(function () {
  7642. return constructor.reject(reason);
  7643. });
  7644. }
  7645. );
  7646. }
  7647. // Store setTimeout reference so promise-polyfill will be unaffected by
  7648. // other code modifying setTimeout (like sinon.useFakeTimers())
  7649. var setTimeoutFunc = setTimeout;
  7650. function noop() { }
  7651. // Polyfill for Function.prototype.bind
  7652. function bind(fn, thisArg) {
  7653. return function () {
  7654. fn.apply(thisArg, arguments);
  7655. };
  7656. }
  7657. /**
  7658. * @constructor
  7659. * @param {Function} fn
  7660. */
  7661. function Promise(fn) {
  7662. if (!(this instanceof Promise))
  7663. throw new TypeError('Promises must be constructed via new');
  7664. if (typeof fn !== 'function') throw new TypeError('not a function');
  7665. /** @type {!number} */
  7666. this._state = 0;
  7667. /** @type {!boolean} */
  7668. this._handled = false;
  7669. /** @type {Promise|undefined} */
  7670. this._value = undefined;
  7671. /** @type {!Array<!Function>} */
  7672. this._deferreds = [];
  7673. doResolve(fn, this);
  7674. }
  7675. function handle(self, deferred) {
  7676. while (self._state === 3) {
  7677. self = self._value;
  7678. }
  7679. if (self._state === 0) {
  7680. self._deferreds.push(deferred);
  7681. return;
  7682. }
  7683. self._handled = true;
  7684. Promise._immediateFn(function () {
  7685. var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
  7686. if (cb === null) {
  7687. (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
  7688. return;
  7689. }
  7690. var ret;
  7691. try {
  7692. ret = cb(self._value);
  7693. } catch (e) {
  7694. reject(deferred.promise, e);
  7695. return;
  7696. }
  7697. resolve(deferred.promise, ret);
  7698. });
  7699. }
  7700. function resolve(self, newValue) {
  7701. try {
  7702. // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
  7703. if (newValue === self)
  7704. throw new TypeError('A promise cannot be resolved with itself.');
  7705. if (
  7706. newValue &&
  7707. (typeof newValue === 'object' || typeof newValue === 'function')
  7708. ) {
  7709. var then = newValue.then;
  7710. if (newValue instanceof Promise) {
  7711. self._state = 3;
  7712. self._value = newValue;
  7713. finale(self);
  7714. return;
  7715. } else if (typeof then === 'function') {
  7716. doResolve(bind(then, newValue), self);
  7717. return;
  7718. }
  7719. }
  7720. self._state = 1;
  7721. self._value = newValue;
  7722. finale(self);
  7723. } catch (e) {
  7724. reject(self, e);
  7725. }
  7726. }
  7727. function reject(self, newValue) {
  7728. self._state = 2;
  7729. self._value = newValue;
  7730. finale(self);
  7731. }
  7732. function finale(self) {
  7733. if (self._state === 2 && self._deferreds.length === 0) {
  7734. Promise._immediateFn(function () {
  7735. if (!self._handled) {
  7736. Promise._unhandledRejectionFn(self._value);
  7737. }
  7738. });
  7739. }
  7740. for (var i = 0, len = self._deferreds.length; i < len; i++) {
  7741. handle(self, self._deferreds[i]);
  7742. }
  7743. self._deferreds = null;
  7744. }
  7745. /**
  7746. * @constructor
  7747. */
  7748. function Handler(onFulfilled, onRejected, promise) {
  7749. this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
  7750. this.onRejected = typeof onRejected === 'function' ? onRejected : null;
  7751. this.promise = promise;
  7752. }
  7753. /**
  7754. * Take a potentially misbehaving resolver function and make sure
  7755. * onFulfilled and onRejected are only called once.
  7756. *
  7757. * Makes no guarantees about asynchrony.
  7758. */
  7759. function doResolve(fn, self) {
  7760. var done = false;
  7761. try {
  7762. fn(
  7763. function (value) {
  7764. if (done) return;
  7765. done = true;
  7766. resolve(self, value);
  7767. },
  7768. function (reason) {
  7769. if (done) return;
  7770. done = true;
  7771. reject(self, reason);
  7772. }
  7773. );
  7774. } catch (ex) {
  7775. if (done) return;
  7776. done = true;
  7777. reject(self, ex);
  7778. }
  7779. }
  7780. Promise.prototype['catch'] = function (onRejected) {
  7781. return this.then(null, onRejected);
  7782. };
  7783. Promise.prototype.then = function (onFulfilled, onRejected) {
  7784. // @ts-ignore
  7785. var prom = new this.constructor(noop);
  7786. handle(this, new Handler(onFulfilled, onRejected, prom));
  7787. return prom;
  7788. };
  7789. Promise.prototype['finally'] = finallyConstructor;
  7790. Promise.all = function (arr) {
  7791. return new Promise(function (resolve, reject) {
  7792. if (!arr || typeof arr.length === 'undefined')
  7793. throw new TypeError('Promise.all accepts an array');
  7794. var args = Array.prototype.slice.call(arr);
  7795. if (args.length === 0) return resolve([]);
  7796. var remaining = args.length;
  7797. function res(i, val) {
  7798. try {
  7799. if (val && (typeof val === 'object' || typeof val === 'function')) {
  7800. var then = val.then;
  7801. if (typeof then === 'function') {
  7802. then.call(
  7803. val,
  7804. function (val) {
  7805. res(i, val);
  7806. },
  7807. reject
  7808. );
  7809. return;
  7810. }
  7811. }
  7812. args[i] = val;
  7813. if (--remaining === 0) {
  7814. resolve(args);
  7815. }
  7816. } catch (ex) {
  7817. reject(ex);
  7818. }
  7819. }
  7820. for (var i = 0; i < args.length; i++) {
  7821. res(i, args[i]);
  7822. }
  7823. });
  7824. };
  7825. Promise.resolve = function (value) {
  7826. if (value && typeof value === 'object' && value.constructor === Promise) {
  7827. return value;
  7828. }
  7829. return new Promise(function (resolve) {
  7830. resolve(value);
  7831. });
  7832. };
  7833. Promise.reject = function (value) {
  7834. return new Promise(function (resolve, reject) {
  7835. reject(value);
  7836. });
  7837. };
  7838. Promise.race = function (values) {
  7839. return new Promise(function (resolve, reject) {
  7840. for (var i = 0, len = values.length; i < len; i++) {
  7841. values[i].then(resolve, reject);
  7842. }
  7843. });
  7844. };
  7845. // Use polyfill for setImmediate for performance gains
  7846. Promise._immediateFn =
  7847. (typeof setImmediate === 'function' &&
  7848. function (fn) {
  7849. setImmediate(fn);
  7850. }) ||
  7851. function (fn) {
  7852. setTimeoutFunc(fn, 0);
  7853. };
  7854. Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
  7855. if (typeof console !== 'undefined' && console) {
  7856. console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
  7857. }
  7858. };
  7859. /** @suppress {undefinedVars} */
  7860. var globalNS = (function () {
  7861. // the only reliable means to get the global object is
  7862. // `Function('return this')()`
  7863. // However, this causes CSP violations in Chrome apps.
  7864. if (typeof self !== 'undefined') {
  7865. return self;
  7866. }
  7867. if (typeof window !== 'undefined') {
  7868. return window;
  7869. }
  7870. if (typeof global !== 'undefined') {
  7871. return global;
  7872. }
  7873. throw new Error('unable to locate global object');
  7874. })();
  7875. if (!('Promise' in globalNS)) {
  7876. globalNS['Promise'] = Promise;
  7877. } else if (!globalNS.Promise.prototype['finally']) {
  7878. globalNS.Promise.prototype['finally'] = finallyConstructor;
  7879. }
  7880. })));
  7881. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../timers-browserify/main.js */ "../../node_modules/timers-browserify/main.js").setImmediate, __webpack_require__(/*! ./../../../../../../../webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js")))
  7882. /***/ }),
  7883. /***/ "../../node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js":
  7884. /*!********************************************************************************************************!*\
  7885. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneBase.js ***!
  7886. \********************************************************************************************************/
  7887. /*! exports provided: KeyMod, createMonacoBaseAPI */
  7888. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7889. "use strict";
  7890. __webpack_require__.r(__webpack_exports__);
  7891. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyMod", function() { return KeyMod; });
  7892. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createMonacoBaseAPI", function() { return createMonacoBaseAPI; });
  7893. /* harmony import */ var _promise_polyfill_polyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./promise-polyfill/polyfill.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/standalone/promise-polyfill/polyfill.js");
  7894. /* harmony import */ var _promise_polyfill_polyfill_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_promise_polyfill_polyfill_js__WEBPACK_IMPORTED_MODULE_0__);
  7895. /* harmony import */ var _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../base/common/cancellation.js */ "../../node_modules/monaco-editor/esm/vs/base/common/cancellation.js");
  7896. /* harmony import */ var _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../base/common/event.js */ "../../node_modules/monaco-editor/esm/vs/base/common/event.js");
  7897. /* harmony import */ var _base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../base/common/keyCodes.js */ "../../node_modules/monaco-editor/esm/vs/base/common/keyCodes.js");
  7898. /* harmony import */ var _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../base/common/uri.js */ "../../node_modules/monaco-editor/esm/vs/base/common/uri.js");
  7899. /* harmony import */ var _core_position_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../core/position.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/core/position.js");
  7900. /* harmony import */ var _core_range_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../core/range.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/core/range.js");
  7901. /* harmony import */ var _core_selection_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../core/selection.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/core/selection.js");
  7902. /* harmony import */ var _core_token_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../core/token.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/core/token.js");
  7903. /* harmony import */ var _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./standaloneEnums.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js");
  7904. /*---------------------------------------------------------------------------------------------
  7905. * Copyright (c) Microsoft Corporation. All rights reserved.
  7906. * Licensed under the MIT License. See License.txt in the project root for license information.
  7907. *--------------------------------------------------------------------------------------------*/
  7908. var KeyMod = /** @class */ (function () {
  7909. function KeyMod() {
  7910. }
  7911. KeyMod.chord = function (firstPart, secondPart) {
  7912. return Object(_base_common_keyCodes_js__WEBPACK_IMPORTED_MODULE_3__["KeyChord"])(firstPart, secondPart);
  7913. };
  7914. KeyMod.CtrlCmd = 2048 /* CtrlCmd */;
  7915. KeyMod.Shift = 1024 /* Shift */;
  7916. KeyMod.Alt = 512 /* Alt */;
  7917. KeyMod.WinCtrl = 256 /* WinCtrl */;
  7918. return KeyMod;
  7919. }());
  7920. function createMonacoBaseAPI() {
  7921. return {
  7922. editor: undefined,
  7923. languages: undefined,
  7924. CancellationTokenSource: _base_common_cancellation_js__WEBPACK_IMPORTED_MODULE_1__["CancellationTokenSource"],
  7925. Emitter: _base_common_event_js__WEBPACK_IMPORTED_MODULE_2__["Emitter"],
  7926. KeyCode: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["KeyCode"],
  7927. KeyMod: KeyMod,
  7928. Position: _core_position_js__WEBPACK_IMPORTED_MODULE_5__["Position"],
  7929. Range: _core_range_js__WEBPACK_IMPORTED_MODULE_6__["Range"],
  7930. Selection: _core_selection_js__WEBPACK_IMPORTED_MODULE_7__["Selection"],
  7931. SelectionDirection: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["SelectionDirection"],
  7932. MarkerSeverity: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["MarkerSeverity"],
  7933. MarkerTag: _standaloneEnums_js__WEBPACK_IMPORTED_MODULE_9__["MarkerTag"],
  7934. Uri: _base_common_uri_js__WEBPACK_IMPORTED_MODULE_4__["URI"],
  7935. Token: _core_token_js__WEBPACK_IMPORTED_MODULE_8__["Token"]
  7936. };
  7937. }
  7938. /***/ }),
  7939. /***/ "../../node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js":
  7940. /*!*********************************************************************************************************!*\
  7941. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/editor/common/standalone/standaloneEnums.js ***!
  7942. \*********************************************************************************************************/
  7943. /*! exports provided: AccessibilitySupport, CompletionItemInsertTextRule, CompletionItemKind, CompletionItemTag, CompletionTriggerKind, ContentWidgetPositionPreference, CursorChangeReason, DefaultEndOfLine, DocumentHighlightKind, EditorAutoIndentStrategy, EditorOption, EndOfLinePreference, EndOfLineSequence, IndentAction, KeyCode, MarkerSeverity, MarkerTag, MinimapPosition, MouseTargetType, OverlayWidgetPositionPreference, OverviewRulerLane, RenderLineNumbersType, RenderMinimap, ScrollType, ScrollbarVisibility, SelectionDirection, SignatureHelpTriggerKind, SymbolKind, SymbolTag, TextEditorCursorBlinkingStyle, TextEditorCursorStyle, TrackedRangeStickiness, WrappingIndent */
  7944. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7945. "use strict";
  7946. __webpack_require__.r(__webpack_exports__);
  7947. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AccessibilitySupport", function() { return AccessibilitySupport; });
  7948. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemInsertTextRule", function() { return CompletionItemInsertTextRule; });
  7949. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemKind", function() { return CompletionItemKind; });
  7950. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionItemTag", function() { return CompletionItemTag; });
  7951. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CompletionTriggerKind", function() { return CompletionTriggerKind; });
  7952. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ContentWidgetPositionPreference", function() { return ContentWidgetPositionPreference; });
  7953. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CursorChangeReason", function() { return CursorChangeReason; });
  7954. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultEndOfLine", function() { return DefaultEndOfLine; });
  7955. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DocumentHighlightKind", function() { return DocumentHighlightKind; });
  7956. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorAutoIndentStrategy", function() { return EditorAutoIndentStrategy; });
  7957. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EditorOption", function() { return EditorOption; });
  7958. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLinePreference", function() { return EndOfLinePreference; });
  7959. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EndOfLineSequence", function() { return EndOfLineSequence; });
  7960. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "IndentAction", function() { return IndentAction; });
  7961. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyCode", function() { return KeyCode; });
  7962. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerSeverity", function() { return MarkerSeverity; });
  7963. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MarkerTag", function() { return MarkerTag; });
  7964. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MinimapPosition", function() { return MinimapPosition; });
  7965. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MouseTargetType", function() { return MouseTargetType; });
  7966. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverlayWidgetPositionPreference", function() { return OverlayWidgetPositionPreference; });
  7967. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OverviewRulerLane", function() { return OverviewRulerLane; });
  7968. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderLineNumbersType", function() { return RenderLineNumbersType; });
  7969. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RenderMinimap", function() { return RenderMinimap; });
  7970. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollType", function() { return ScrollType; });
  7971. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollbarVisibility", function() { return ScrollbarVisibility; });
  7972. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SelectionDirection", function() { return SelectionDirection; });
  7973. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SignatureHelpTriggerKind", function() { return SignatureHelpTriggerKind; });
  7974. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolKind", function() { return SymbolKind; });
  7975. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SymbolTag", function() { return SymbolTag; });
  7976. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorBlinkingStyle", function() { return TextEditorCursorBlinkingStyle; });
  7977. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextEditorCursorStyle", function() { return TextEditorCursorStyle; });
  7978. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TrackedRangeStickiness", function() { return TrackedRangeStickiness; });
  7979. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WrappingIndent", function() { return WrappingIndent; });
  7980. /*---------------------------------------------------------------------------------------------
  7981. * Copyright (c) Microsoft Corporation. All rights reserved.
  7982. * Licensed under the MIT License. See License.txt in the project root for license information.
  7983. *--------------------------------------------------------------------------------------------*/
  7984. // THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.
  7985. var AccessibilitySupport;
  7986. (function (AccessibilitySupport) {
  7987. /**
  7988. * This should be the browser case where it is not known if a screen reader is attached or no.
  7989. */
  7990. AccessibilitySupport[AccessibilitySupport["Unknown"] = 0] = "Unknown";
  7991. AccessibilitySupport[AccessibilitySupport["Disabled"] = 1] = "Disabled";
  7992. AccessibilitySupport[AccessibilitySupport["Enabled"] = 2] = "Enabled";
  7993. })(AccessibilitySupport || (AccessibilitySupport = {}));
  7994. var CompletionItemInsertTextRule;
  7995. (function (CompletionItemInsertTextRule) {
  7996. /**
  7997. * Adjust whitespace/indentation of multiline insert texts to
  7998. * match the current line indentation.
  7999. */
  8000. CompletionItemInsertTextRule[CompletionItemInsertTextRule["KeepWhitespace"] = 1] = "KeepWhitespace";
  8001. /**
  8002. * `insertText` is a snippet.
  8003. */
  8004. CompletionItemInsertTextRule[CompletionItemInsertTextRule["InsertAsSnippet"] = 4] = "InsertAsSnippet";
  8005. })(CompletionItemInsertTextRule || (CompletionItemInsertTextRule = {}));
  8006. var CompletionItemKind;
  8007. (function (CompletionItemKind) {
  8008. CompletionItemKind[CompletionItemKind["Method"] = 0] = "Method";
  8009. CompletionItemKind[CompletionItemKind["Function"] = 1] = "Function";
  8010. CompletionItemKind[CompletionItemKind["Constructor"] = 2] = "Constructor";
  8011. CompletionItemKind[CompletionItemKind["Field"] = 3] = "Field";
  8012. CompletionItemKind[CompletionItemKind["Variable"] = 4] = "Variable";
  8013. CompletionItemKind[CompletionItemKind["Class"] = 5] = "Class";
  8014. CompletionItemKind[CompletionItemKind["Struct"] = 6] = "Struct";
  8015. CompletionItemKind[CompletionItemKind["Interface"] = 7] = "Interface";
  8016. CompletionItemKind[CompletionItemKind["Module"] = 8] = "Module";
  8017. CompletionItemKind[CompletionItemKind["Property"] = 9] = "Property";
  8018. CompletionItemKind[CompletionItemKind["Event"] = 10] = "Event";
  8019. CompletionItemKind[CompletionItemKind["Operator"] = 11] = "Operator";
  8020. CompletionItemKind[CompletionItemKind["Unit"] = 12] = "Unit";
  8021. CompletionItemKind[CompletionItemKind["Value"] = 13] = "Value";
  8022. CompletionItemKind[CompletionItemKind["Constant"] = 14] = "Constant";
  8023. CompletionItemKind[CompletionItemKind["Enum"] = 15] = "Enum";
  8024. CompletionItemKind[CompletionItemKind["EnumMember"] = 16] = "EnumMember";
  8025. CompletionItemKind[CompletionItemKind["Keyword"] = 17] = "Keyword";
  8026. CompletionItemKind[CompletionItemKind["Text"] = 18] = "Text";
  8027. CompletionItemKind[CompletionItemKind["Color"] = 19] = "Color";
  8028. CompletionItemKind[CompletionItemKind["File"] = 20] = "File";
  8029. CompletionItemKind[CompletionItemKind["Reference"] = 21] = "Reference";
  8030. CompletionItemKind[CompletionItemKind["Customcolor"] = 22] = "Customcolor";
  8031. CompletionItemKind[CompletionItemKind["Folder"] = 23] = "Folder";
  8032. CompletionItemKind[CompletionItemKind["TypeParameter"] = 24] = "TypeParameter";
  8033. CompletionItemKind[CompletionItemKind["Snippet"] = 25] = "Snippet";
  8034. })(CompletionItemKind || (CompletionItemKind = {}));
  8035. var CompletionItemTag;
  8036. (function (CompletionItemTag) {
  8037. CompletionItemTag[CompletionItemTag["Deprecated"] = 1] = "Deprecated";
  8038. })(CompletionItemTag || (CompletionItemTag = {}));
  8039. /**
  8040. * How a suggest provider was triggered.
  8041. */
  8042. var CompletionTriggerKind;
  8043. (function (CompletionTriggerKind) {
  8044. CompletionTriggerKind[CompletionTriggerKind["Invoke"] = 0] = "Invoke";
  8045. CompletionTriggerKind[CompletionTriggerKind["TriggerCharacter"] = 1] = "TriggerCharacter";
  8046. CompletionTriggerKind[CompletionTriggerKind["TriggerForIncompleteCompletions"] = 2] = "TriggerForIncompleteCompletions";
  8047. })(CompletionTriggerKind || (CompletionTriggerKind = {}));
  8048. /**
  8049. * A positioning preference for rendering content widgets.
  8050. */
  8051. var ContentWidgetPositionPreference;
  8052. (function (ContentWidgetPositionPreference) {
  8053. /**
  8054. * Place the content widget exactly at a position
  8055. */
  8056. ContentWidgetPositionPreference[ContentWidgetPositionPreference["EXACT"] = 0] = "EXACT";
  8057. /**
  8058. * Place the content widget above a position
  8059. */
  8060. ContentWidgetPositionPreference[ContentWidgetPositionPreference["ABOVE"] = 1] = "ABOVE";
  8061. /**
  8062. * Place the content widget below a position
  8063. */
  8064. ContentWidgetPositionPreference[ContentWidgetPositionPreference["BELOW"] = 2] = "BELOW";
  8065. })(ContentWidgetPositionPreference || (ContentWidgetPositionPreference = {}));
  8066. /**
  8067. * Describes the reason the cursor has changed its position.
  8068. */
  8069. var CursorChangeReason;
  8070. (function (CursorChangeReason) {
  8071. /**
  8072. * Unknown or not set.
  8073. */
  8074. CursorChangeReason[CursorChangeReason["NotSet"] = 0] = "NotSet";
  8075. /**
  8076. * A `model.setValue()` was called.
  8077. */
  8078. CursorChangeReason[CursorChangeReason["ContentFlush"] = 1] = "ContentFlush";
  8079. /**
  8080. * The `model` has been changed outside of this cursor and the cursor recovers its position from associated markers.
  8081. */
  8082. CursorChangeReason[CursorChangeReason["RecoverFromMarkers"] = 2] = "RecoverFromMarkers";
  8083. /**
  8084. * There was an explicit user gesture.
  8085. */
  8086. CursorChangeReason[CursorChangeReason["Explicit"] = 3] = "Explicit";
  8087. /**
  8088. * There was a Paste.
  8089. */
  8090. CursorChangeReason[CursorChangeReason["Paste"] = 4] = "Paste";
  8091. /**
  8092. * There was an Undo.
  8093. */
  8094. CursorChangeReason[CursorChangeReason["Undo"] = 5] = "Undo";
  8095. /**
  8096. * There was a Redo.
  8097. */
  8098. CursorChangeReason[CursorChangeReason["Redo"] = 6] = "Redo";
  8099. })(CursorChangeReason || (CursorChangeReason = {}));
  8100. /**
  8101. * The default end of line to use when instantiating models.
  8102. */
  8103. var DefaultEndOfLine;
  8104. (function (DefaultEndOfLine) {
  8105. /**
  8106. * Use line feed (\n) as the end of line character.
  8107. */
  8108. DefaultEndOfLine[DefaultEndOfLine["LF"] = 1] = "LF";
  8109. /**
  8110. * Use carriage return and line feed (\r\n) as the end of line character.
  8111. */
  8112. DefaultEndOfLine[DefaultEndOfLine["CRLF"] = 2] = "CRLF";
  8113. })(DefaultEndOfLine || (DefaultEndOfLine = {}));
  8114. /**
  8115. * A document highlight kind.
  8116. */
  8117. var DocumentHighlightKind;
  8118. (function (DocumentHighlightKind) {
  8119. /**
  8120. * A textual occurrence.
  8121. */
  8122. DocumentHighlightKind[DocumentHighlightKind["Text"] = 0] = "Text";
  8123. /**
  8124. * Read-access of a symbol, like reading a variable.
  8125. */
  8126. DocumentHighlightKind[DocumentHighlightKind["Read"] = 1] = "Read";
  8127. /**
  8128. * Write-access of a symbol, like writing to a variable.
  8129. */
  8130. DocumentHighlightKind[DocumentHighlightKind["Write"] = 2] = "Write";
  8131. })(DocumentHighlightKind || (DocumentHighlightKind = {}));
  8132. /**
  8133. * Configuration options for auto indentation in the editor
  8134. */
  8135. var EditorAutoIndentStrategy;
  8136. (function (EditorAutoIndentStrategy) {
  8137. EditorAutoIndentStrategy[EditorAutoIndentStrategy["None"] = 0] = "None";
  8138. EditorAutoIndentStrategy[EditorAutoIndentStrategy["Keep"] = 1] = "Keep";
  8139. EditorAutoIndentStrategy[EditorAutoIndentStrategy["Brackets"] = 2] = "Brackets";
  8140. EditorAutoIndentStrategy[EditorAutoIndentStrategy["Advanced"] = 3] = "Advanced";
  8141. EditorAutoIndentStrategy[EditorAutoIndentStrategy["Full"] = 4] = "Full";
  8142. })(EditorAutoIndentStrategy || (EditorAutoIndentStrategy = {}));
  8143. var EditorOption;
  8144. (function (EditorOption) {
  8145. EditorOption[EditorOption["acceptSuggestionOnCommitCharacter"] = 0] = "acceptSuggestionOnCommitCharacter";
  8146. EditorOption[EditorOption["acceptSuggestionOnEnter"] = 1] = "acceptSuggestionOnEnter";
  8147. EditorOption[EditorOption["accessibilitySupport"] = 2] = "accessibilitySupport";
  8148. EditorOption[EditorOption["accessibilityPageSize"] = 3] = "accessibilityPageSize";
  8149. EditorOption[EditorOption["ariaLabel"] = 4] = "ariaLabel";
  8150. EditorOption[EditorOption["autoClosingBrackets"] = 5] = "autoClosingBrackets";
  8151. EditorOption[EditorOption["autoClosingOvertype"] = 6] = "autoClosingOvertype";
  8152. EditorOption[EditorOption["autoClosingQuotes"] = 7] = "autoClosingQuotes";
  8153. EditorOption[EditorOption["autoIndent"] = 8] = "autoIndent";
  8154. EditorOption[EditorOption["automaticLayout"] = 9] = "automaticLayout";
  8155. EditorOption[EditorOption["autoSurround"] = 10] = "autoSurround";
  8156. EditorOption[EditorOption["codeLens"] = 11] = "codeLens";
  8157. EditorOption[EditorOption["colorDecorators"] = 12] = "colorDecorators";
  8158. EditorOption[EditorOption["comments"] = 13] = "comments";
  8159. EditorOption[EditorOption["contextmenu"] = 14] = "contextmenu";
  8160. EditorOption[EditorOption["copyWithSyntaxHighlighting"] = 15] = "copyWithSyntaxHighlighting";
  8161. EditorOption[EditorOption["cursorBlinking"] = 16] = "cursorBlinking";
  8162. EditorOption[EditorOption["cursorSmoothCaretAnimation"] = 17] = "cursorSmoothCaretAnimation";
  8163. EditorOption[EditorOption["cursorStyle"] = 18] = "cursorStyle";
  8164. EditorOption[EditorOption["cursorSurroundingLines"] = 19] = "cursorSurroundingLines";
  8165. EditorOption[EditorOption["cursorSurroundingLinesStyle"] = 20] = "cursorSurroundingLinesStyle";
  8166. EditorOption[EditorOption["cursorWidth"] = 21] = "cursorWidth";
  8167. EditorOption[EditorOption["disableLayerHinting"] = 22] = "disableLayerHinting";
  8168. EditorOption[EditorOption["disableMonospaceOptimizations"] = 23] = "disableMonospaceOptimizations";
  8169. EditorOption[EditorOption["dragAndDrop"] = 24] = "dragAndDrop";
  8170. EditorOption[EditorOption["emptySelectionClipboard"] = 25] = "emptySelectionClipboard";
  8171. EditorOption[EditorOption["extraEditorClassName"] = 26] = "extraEditorClassName";
  8172. EditorOption[EditorOption["fastScrollSensitivity"] = 27] = "fastScrollSensitivity";
  8173. EditorOption[EditorOption["find"] = 28] = "find";
  8174. EditorOption[EditorOption["fixedOverflowWidgets"] = 29] = "fixedOverflowWidgets";
  8175. EditorOption[EditorOption["folding"] = 30] = "folding";
  8176. EditorOption[EditorOption["foldingStrategy"] = 31] = "foldingStrategy";
  8177. EditorOption[EditorOption["foldingHighlight"] = 32] = "foldingHighlight";
  8178. EditorOption[EditorOption["fontFamily"] = 33] = "fontFamily";
  8179. EditorOption[EditorOption["fontInfo"] = 34] = "fontInfo";
  8180. EditorOption[EditorOption["fontLigatures"] = 35] = "fontLigatures";
  8181. EditorOption[EditorOption["fontSize"] = 36] = "fontSize";
  8182. EditorOption[EditorOption["fontWeight"] = 37] = "fontWeight";
  8183. EditorOption[EditorOption["formatOnPaste"] = 38] = "formatOnPaste";
  8184. EditorOption[EditorOption["formatOnType"] = 39] = "formatOnType";
  8185. EditorOption[EditorOption["glyphMargin"] = 40] = "glyphMargin";
  8186. EditorOption[EditorOption["gotoLocation"] = 41] = "gotoLocation";
  8187. EditorOption[EditorOption["hideCursorInOverviewRuler"] = 42] = "hideCursorInOverviewRuler";
  8188. EditorOption[EditorOption["highlightActiveIndentGuide"] = 43] = "highlightActiveIndentGuide";
  8189. EditorOption[EditorOption["hover"] = 44] = "hover";
  8190. EditorOption[EditorOption["inDiffEditor"] = 45] = "inDiffEditor";
  8191. EditorOption[EditorOption["letterSpacing"] = 46] = "letterSpacing";
  8192. EditorOption[EditorOption["lightbulb"] = 47] = "lightbulb";
  8193. EditorOption[EditorOption["lineDecorationsWidth"] = 48] = "lineDecorationsWidth";
  8194. EditorOption[EditorOption["lineHeight"] = 49] = "lineHeight";
  8195. EditorOption[EditorOption["lineNumbers"] = 50] = "lineNumbers";
  8196. EditorOption[EditorOption["lineNumbersMinChars"] = 51] = "lineNumbersMinChars";
  8197. EditorOption[EditorOption["links"] = 52] = "links";
  8198. EditorOption[EditorOption["matchBrackets"] = 53] = "matchBrackets";
  8199. EditorOption[EditorOption["minimap"] = 54] = "minimap";
  8200. EditorOption[EditorOption["mouseStyle"] = 55] = "mouseStyle";
  8201. EditorOption[EditorOption["mouseWheelScrollSensitivity"] = 56] = "mouseWheelScrollSensitivity";
  8202. EditorOption[EditorOption["mouseWheelZoom"] = 57] = "mouseWheelZoom";
  8203. EditorOption[EditorOption["multiCursorMergeOverlapping"] = 58] = "multiCursorMergeOverlapping";
  8204. EditorOption[EditorOption["multiCursorModifier"] = 59] = "multiCursorModifier";
  8205. EditorOption[EditorOption["multiCursorPaste"] = 60] = "multiCursorPaste";
  8206. EditorOption[EditorOption["occurrencesHighlight"] = 61] = "occurrencesHighlight";
  8207. EditorOption[EditorOption["overviewRulerBorder"] = 62] = "overviewRulerBorder";
  8208. EditorOption[EditorOption["overviewRulerLanes"] = 63] = "overviewRulerLanes";
  8209. EditorOption[EditorOption["parameterHints"] = 64] = "parameterHints";
  8210. EditorOption[EditorOption["peekWidgetDefaultFocus"] = 65] = "peekWidgetDefaultFocus";
  8211. EditorOption[EditorOption["quickSuggestions"] = 66] = "quickSuggestions";
  8212. EditorOption[EditorOption["quickSuggestionsDelay"] = 67] = "quickSuggestionsDelay";
  8213. EditorOption[EditorOption["readOnly"] = 68] = "readOnly";
  8214. EditorOption[EditorOption["renderControlCharacters"] = 69] = "renderControlCharacters";
  8215. EditorOption[EditorOption["renderIndentGuides"] = 70] = "renderIndentGuides";
  8216. EditorOption[EditorOption["renderFinalNewline"] = 71] = "renderFinalNewline";
  8217. EditorOption[EditorOption["renderLineHighlight"] = 72] = "renderLineHighlight";
  8218. EditorOption[EditorOption["renderValidationDecorations"] = 73] = "renderValidationDecorations";
  8219. EditorOption[EditorOption["renderWhitespace"] = 74] = "renderWhitespace";
  8220. EditorOption[EditorOption["revealHorizontalRightPadding"] = 75] = "revealHorizontalRightPadding";
  8221. EditorOption[EditorOption["roundedSelection"] = 76] = "roundedSelection";
  8222. EditorOption[EditorOption["rulers"] = 77] = "rulers";
  8223. EditorOption[EditorOption["scrollbar"] = 78] = "scrollbar";
  8224. EditorOption[EditorOption["scrollBeyondLastColumn"] = 79] = "scrollBeyondLastColumn";
  8225. EditorOption[EditorOption["scrollBeyondLastLine"] = 80] = "scrollBeyondLastLine";
  8226. EditorOption[EditorOption["selectionClipboard"] = 81] = "selectionClipboard";
  8227. EditorOption[EditorOption["selectionHighlight"] = 82] = "selectionHighlight";
  8228. EditorOption[EditorOption["selectOnLineNumbers"] = 83] = "selectOnLineNumbers";
  8229. EditorOption[EditorOption["showFoldingControls"] = 84] = "showFoldingControls";
  8230. EditorOption[EditorOption["showUnused"] = 85] = "showUnused";
  8231. EditorOption[EditorOption["snippetSuggestions"] = 86] = "snippetSuggestions";
  8232. EditorOption[EditorOption["smoothScrolling"] = 87] = "smoothScrolling";
  8233. EditorOption[EditorOption["stopRenderingLineAfter"] = 88] = "stopRenderingLineAfter";
  8234. EditorOption[EditorOption["suggest"] = 89] = "suggest";
  8235. EditorOption[EditorOption["suggestFontSize"] = 90] = "suggestFontSize";
  8236. EditorOption[EditorOption["suggestLineHeight"] = 91] = "suggestLineHeight";
  8237. EditorOption[EditorOption["suggestOnTriggerCharacters"] = 92] = "suggestOnTriggerCharacters";
  8238. EditorOption[EditorOption["suggestSelection"] = 93] = "suggestSelection";
  8239. EditorOption[EditorOption["tabCompletion"] = 94] = "tabCompletion";
  8240. EditorOption[EditorOption["useTabStops"] = 95] = "useTabStops";
  8241. EditorOption[EditorOption["wordSeparators"] = 96] = "wordSeparators";
  8242. EditorOption[EditorOption["wordWrap"] = 97] = "wordWrap";
  8243. EditorOption[EditorOption["wordWrapBreakAfterCharacters"] = 98] = "wordWrapBreakAfterCharacters";
  8244. EditorOption[EditorOption["wordWrapBreakBeforeCharacters"] = 99] = "wordWrapBreakBeforeCharacters";
  8245. EditorOption[EditorOption["wordWrapColumn"] = 100] = "wordWrapColumn";
  8246. EditorOption[EditorOption["wordWrapMinified"] = 101] = "wordWrapMinified";
  8247. EditorOption[EditorOption["wrappingIndent"] = 102] = "wrappingIndent";
  8248. EditorOption[EditorOption["wrappingStrategy"] = 103] = "wrappingStrategy";
  8249. EditorOption[EditorOption["editorClassName"] = 104] = "editorClassName";
  8250. EditorOption[EditorOption["pixelRatio"] = 105] = "pixelRatio";
  8251. EditorOption[EditorOption["tabFocusMode"] = 106] = "tabFocusMode";
  8252. EditorOption[EditorOption["layoutInfo"] = 107] = "layoutInfo";
  8253. EditorOption[EditorOption["wrappingInfo"] = 108] = "wrappingInfo";
  8254. })(EditorOption || (EditorOption = {}));
  8255. /**
  8256. * End of line character preference.
  8257. */
  8258. var EndOfLinePreference;
  8259. (function (EndOfLinePreference) {
  8260. /**
  8261. * Use the end of line character identified in the text buffer.
  8262. */
  8263. EndOfLinePreference[EndOfLinePreference["TextDefined"] = 0] = "TextDefined";
  8264. /**
  8265. * Use line feed (\n) as the end of line character.
  8266. */
  8267. EndOfLinePreference[EndOfLinePreference["LF"] = 1] = "LF";
  8268. /**
  8269. * Use carriage return and line feed (\r\n) as the end of line character.
  8270. */
  8271. EndOfLinePreference[EndOfLinePreference["CRLF"] = 2] = "CRLF";
  8272. })(EndOfLinePreference || (EndOfLinePreference = {}));
  8273. /**
  8274. * End of line character preference.
  8275. */
  8276. var EndOfLineSequence;
  8277. (function (EndOfLineSequence) {
  8278. /**
  8279. * Use line feed (\n) as the end of line character.
  8280. */
  8281. EndOfLineSequence[EndOfLineSequence["LF"] = 0] = "LF";
  8282. /**
  8283. * Use carriage return and line feed (\r\n) as the end of line character.
  8284. */
  8285. EndOfLineSequence[EndOfLineSequence["CRLF"] = 1] = "CRLF";
  8286. })(EndOfLineSequence || (EndOfLineSequence = {}));
  8287. /**
  8288. * Describes what to do with the indentation when pressing Enter.
  8289. */
  8290. var IndentAction;
  8291. (function (IndentAction) {
  8292. /**
  8293. * Insert new line and copy the previous line's indentation.
  8294. */
  8295. IndentAction[IndentAction["None"] = 0] = "None";
  8296. /**
  8297. * Insert new line and indent once (relative to the previous line's indentation).
  8298. */
  8299. IndentAction[IndentAction["Indent"] = 1] = "Indent";
  8300. /**
  8301. * Insert two new lines:
  8302. * - the first one indented which will hold the cursor
  8303. * - the second one at the same indentation level
  8304. */
  8305. IndentAction[IndentAction["IndentOutdent"] = 2] = "IndentOutdent";
  8306. /**
  8307. * Insert new line and outdent once (relative to the previous line's indentation).
  8308. */
  8309. IndentAction[IndentAction["Outdent"] = 3] = "Outdent";
  8310. })(IndentAction || (IndentAction = {}));
  8311. /**
  8312. * Virtual Key Codes, the value does not hold any inherent meaning.
  8313. * Inspired somewhat from https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx
  8314. * But these are "more general", as they should work across browsers & OS`s.
  8315. */
  8316. var KeyCode;
  8317. (function (KeyCode) {
  8318. /**
  8319. * Placed first to cover the 0 value of the enum.
  8320. */
  8321. KeyCode[KeyCode["Unknown"] = 0] = "Unknown";
  8322. KeyCode[KeyCode["Backspace"] = 1] = "Backspace";
  8323. KeyCode[KeyCode["Tab"] = 2] = "Tab";
  8324. KeyCode[KeyCode["Enter"] = 3] = "Enter";
  8325. KeyCode[KeyCode["Shift"] = 4] = "Shift";
  8326. KeyCode[KeyCode["Ctrl"] = 5] = "Ctrl";
  8327. KeyCode[KeyCode["Alt"] = 6] = "Alt";
  8328. KeyCode[KeyCode["PauseBreak"] = 7] = "PauseBreak";
  8329. KeyCode[KeyCode["CapsLock"] = 8] = "CapsLock";
  8330. KeyCode[KeyCode["Escape"] = 9] = "Escape";
  8331. KeyCode[KeyCode["Space"] = 10] = "Space";
  8332. KeyCode[KeyCode["PageUp"] = 11] = "PageUp";
  8333. KeyCode[KeyCode["PageDown"] = 12] = "PageDown";
  8334. KeyCode[KeyCode["End"] = 13] = "End";
  8335. KeyCode[KeyCode["Home"] = 14] = "Home";
  8336. KeyCode[KeyCode["LeftArrow"] = 15] = "LeftArrow";
  8337. KeyCode[KeyCode["UpArrow"] = 16] = "UpArrow";
  8338. KeyCode[KeyCode["RightArrow"] = 17] = "RightArrow";
  8339. KeyCode[KeyCode["DownArrow"] = 18] = "DownArrow";
  8340. KeyCode[KeyCode["Insert"] = 19] = "Insert";
  8341. KeyCode[KeyCode["Delete"] = 20] = "Delete";
  8342. KeyCode[KeyCode["KEY_0"] = 21] = "KEY_0";
  8343. KeyCode[KeyCode["KEY_1"] = 22] = "KEY_1";
  8344. KeyCode[KeyCode["KEY_2"] = 23] = "KEY_2";
  8345. KeyCode[KeyCode["KEY_3"] = 24] = "KEY_3";
  8346. KeyCode[KeyCode["KEY_4"] = 25] = "KEY_4";
  8347. KeyCode[KeyCode["KEY_5"] = 26] = "KEY_5";
  8348. KeyCode[KeyCode["KEY_6"] = 27] = "KEY_6";
  8349. KeyCode[KeyCode["KEY_7"] = 28] = "KEY_7";
  8350. KeyCode[KeyCode["KEY_8"] = 29] = "KEY_8";
  8351. KeyCode[KeyCode["KEY_9"] = 30] = "KEY_9";
  8352. KeyCode[KeyCode["KEY_A"] = 31] = "KEY_A";
  8353. KeyCode[KeyCode["KEY_B"] = 32] = "KEY_B";
  8354. KeyCode[KeyCode["KEY_C"] = 33] = "KEY_C";
  8355. KeyCode[KeyCode["KEY_D"] = 34] = "KEY_D";
  8356. KeyCode[KeyCode["KEY_E"] = 35] = "KEY_E";
  8357. KeyCode[KeyCode["KEY_F"] = 36] = "KEY_F";
  8358. KeyCode[KeyCode["KEY_G"] = 37] = "KEY_G";
  8359. KeyCode[KeyCode["KEY_H"] = 38] = "KEY_H";
  8360. KeyCode[KeyCode["KEY_I"] = 39] = "KEY_I";
  8361. KeyCode[KeyCode["KEY_J"] = 40] = "KEY_J";
  8362. KeyCode[KeyCode["KEY_K"] = 41] = "KEY_K";
  8363. KeyCode[KeyCode["KEY_L"] = 42] = "KEY_L";
  8364. KeyCode[KeyCode["KEY_M"] = 43] = "KEY_M";
  8365. KeyCode[KeyCode["KEY_N"] = 44] = "KEY_N";
  8366. KeyCode[KeyCode["KEY_O"] = 45] = "KEY_O";
  8367. KeyCode[KeyCode["KEY_P"] = 46] = "KEY_P";
  8368. KeyCode[KeyCode["KEY_Q"] = 47] = "KEY_Q";
  8369. KeyCode[KeyCode["KEY_R"] = 48] = "KEY_R";
  8370. KeyCode[KeyCode["KEY_S"] = 49] = "KEY_S";
  8371. KeyCode[KeyCode["KEY_T"] = 50] = "KEY_T";
  8372. KeyCode[KeyCode["KEY_U"] = 51] = "KEY_U";
  8373. KeyCode[KeyCode["KEY_V"] = 52] = "KEY_V";
  8374. KeyCode[KeyCode["KEY_W"] = 53] = "KEY_W";
  8375. KeyCode[KeyCode["KEY_X"] = 54] = "KEY_X";
  8376. KeyCode[KeyCode["KEY_Y"] = 55] = "KEY_Y";
  8377. KeyCode[KeyCode["KEY_Z"] = 56] = "KEY_Z";
  8378. KeyCode[KeyCode["Meta"] = 57] = "Meta";
  8379. KeyCode[KeyCode["ContextMenu"] = 58] = "ContextMenu";
  8380. KeyCode[KeyCode["F1"] = 59] = "F1";
  8381. KeyCode[KeyCode["F2"] = 60] = "F2";
  8382. KeyCode[KeyCode["F3"] = 61] = "F3";
  8383. KeyCode[KeyCode["F4"] = 62] = "F4";
  8384. KeyCode[KeyCode["F5"] = 63] = "F5";
  8385. KeyCode[KeyCode["F6"] = 64] = "F6";
  8386. KeyCode[KeyCode["F7"] = 65] = "F7";
  8387. KeyCode[KeyCode["F8"] = 66] = "F8";
  8388. KeyCode[KeyCode["F9"] = 67] = "F9";
  8389. KeyCode[KeyCode["F10"] = 68] = "F10";
  8390. KeyCode[KeyCode["F11"] = 69] = "F11";
  8391. KeyCode[KeyCode["F12"] = 70] = "F12";
  8392. KeyCode[KeyCode["F13"] = 71] = "F13";
  8393. KeyCode[KeyCode["F14"] = 72] = "F14";
  8394. KeyCode[KeyCode["F15"] = 73] = "F15";
  8395. KeyCode[KeyCode["F16"] = 74] = "F16";
  8396. KeyCode[KeyCode["F17"] = 75] = "F17";
  8397. KeyCode[KeyCode["F18"] = 76] = "F18";
  8398. KeyCode[KeyCode["F19"] = 77] = "F19";
  8399. KeyCode[KeyCode["NumLock"] = 78] = "NumLock";
  8400. KeyCode[KeyCode["ScrollLock"] = 79] = "ScrollLock";
  8401. /**
  8402. * Used for miscellaneous characters; it can vary by keyboard.
  8403. * For the US standard keyboard, the ';:' key
  8404. */
  8405. KeyCode[KeyCode["US_SEMICOLON"] = 80] = "US_SEMICOLON";
  8406. /**
  8407. * For any country/region, the '+' key
  8408. * For the US standard keyboard, the '=+' key
  8409. */
  8410. KeyCode[KeyCode["US_EQUAL"] = 81] = "US_EQUAL";
  8411. /**
  8412. * For any country/region, the ',' key
  8413. * For the US standard keyboard, the ',<' key
  8414. */
  8415. KeyCode[KeyCode["US_COMMA"] = 82] = "US_COMMA";
  8416. /**
  8417. * For any country/region, the '-' key
  8418. * For the US standard keyboard, the '-_' key
  8419. */
  8420. KeyCode[KeyCode["US_MINUS"] = 83] = "US_MINUS";
  8421. /**
  8422. * For any country/region, the '.' key
  8423. * For the US standard keyboard, the '.>' key
  8424. */
  8425. KeyCode[KeyCode["US_DOT"] = 84] = "US_DOT";
  8426. /**
  8427. * Used for miscellaneous characters; it can vary by keyboard.
  8428. * For the US standard keyboard, the '/?' key
  8429. */
  8430. KeyCode[KeyCode["US_SLASH"] = 85] = "US_SLASH";
  8431. /**
  8432. * Used for miscellaneous characters; it can vary by keyboard.
  8433. * For the US standard keyboard, the '`~' key
  8434. */
  8435. KeyCode[KeyCode["US_BACKTICK"] = 86] = "US_BACKTICK";
  8436. /**
  8437. * Used for miscellaneous characters; it can vary by keyboard.
  8438. * For the US standard keyboard, the '[{' key
  8439. */
  8440. KeyCode[KeyCode["US_OPEN_SQUARE_BRACKET"] = 87] = "US_OPEN_SQUARE_BRACKET";
  8441. /**
  8442. * Used for miscellaneous characters; it can vary by keyboard.
  8443. * For the US standard keyboard, the '\|' key
  8444. */
  8445. KeyCode[KeyCode["US_BACKSLASH"] = 88] = "US_BACKSLASH";
  8446. /**
  8447. * Used for miscellaneous characters; it can vary by keyboard.
  8448. * For the US standard keyboard, the ']}' key
  8449. */
  8450. KeyCode[KeyCode["US_CLOSE_SQUARE_BRACKET"] = 89] = "US_CLOSE_SQUARE_BRACKET";
  8451. /**
  8452. * Used for miscellaneous characters; it can vary by keyboard.
  8453. * For the US standard keyboard, the ''"' key
  8454. */
  8455. KeyCode[KeyCode["US_QUOTE"] = 90] = "US_QUOTE";
  8456. /**
  8457. * Used for miscellaneous characters; it can vary by keyboard.
  8458. */
  8459. KeyCode[KeyCode["OEM_8"] = 91] = "OEM_8";
  8460. /**
  8461. * Either the angle bracket key or the backslash key on the RT 102-key keyboard.
  8462. */
  8463. KeyCode[KeyCode["OEM_102"] = 92] = "OEM_102";
  8464. KeyCode[KeyCode["NUMPAD_0"] = 93] = "NUMPAD_0";
  8465. KeyCode[KeyCode["NUMPAD_1"] = 94] = "NUMPAD_1";
  8466. KeyCode[KeyCode["NUMPAD_2"] = 95] = "NUMPAD_2";
  8467. KeyCode[KeyCode["NUMPAD_3"] = 96] = "NUMPAD_3";
  8468. KeyCode[KeyCode["NUMPAD_4"] = 97] = "NUMPAD_4";
  8469. KeyCode[KeyCode["NUMPAD_5"] = 98] = "NUMPAD_5";
  8470. KeyCode[KeyCode["NUMPAD_6"] = 99] = "NUMPAD_6";
  8471. KeyCode[KeyCode["NUMPAD_7"] = 100] = "NUMPAD_7";
  8472. KeyCode[KeyCode["NUMPAD_8"] = 101] = "NUMPAD_8";
  8473. KeyCode[KeyCode["NUMPAD_9"] = 102] = "NUMPAD_9";
  8474. KeyCode[KeyCode["NUMPAD_MULTIPLY"] = 103] = "NUMPAD_MULTIPLY";
  8475. KeyCode[KeyCode["NUMPAD_ADD"] = 104] = "NUMPAD_ADD";
  8476. KeyCode[KeyCode["NUMPAD_SEPARATOR"] = 105] = "NUMPAD_SEPARATOR";
  8477. KeyCode[KeyCode["NUMPAD_SUBTRACT"] = 106] = "NUMPAD_SUBTRACT";
  8478. KeyCode[KeyCode["NUMPAD_DECIMAL"] = 107] = "NUMPAD_DECIMAL";
  8479. KeyCode[KeyCode["NUMPAD_DIVIDE"] = 108] = "NUMPAD_DIVIDE";
  8480. /**
  8481. * Cover all key codes when IME is processing input.
  8482. */
  8483. KeyCode[KeyCode["KEY_IN_COMPOSITION"] = 109] = "KEY_IN_COMPOSITION";
  8484. KeyCode[KeyCode["ABNT_C1"] = 110] = "ABNT_C1";
  8485. KeyCode[KeyCode["ABNT_C2"] = 111] = "ABNT_C2";
  8486. /**
  8487. * Placed last to cover the length of the enum.
  8488. * Please do not depend on this value!
  8489. */
  8490. KeyCode[KeyCode["MAX_VALUE"] = 112] = "MAX_VALUE";
  8491. })(KeyCode || (KeyCode = {}));
  8492. var MarkerSeverity;
  8493. (function (MarkerSeverity) {
  8494. MarkerSeverity[MarkerSeverity["Hint"] = 1] = "Hint";
  8495. MarkerSeverity[MarkerSeverity["Info"] = 2] = "Info";
  8496. MarkerSeverity[MarkerSeverity["Warning"] = 4] = "Warning";
  8497. MarkerSeverity[MarkerSeverity["Error"] = 8] = "Error";
  8498. })(MarkerSeverity || (MarkerSeverity = {}));
  8499. var MarkerTag;
  8500. (function (MarkerTag) {
  8501. MarkerTag[MarkerTag["Unnecessary"] = 1] = "Unnecessary";
  8502. MarkerTag[MarkerTag["Deprecated"] = 2] = "Deprecated";
  8503. })(MarkerTag || (MarkerTag = {}));
  8504. /**
  8505. * Position in the minimap to render the decoration.
  8506. */
  8507. var MinimapPosition;
  8508. (function (MinimapPosition) {
  8509. MinimapPosition[MinimapPosition["Inline"] = 1] = "Inline";
  8510. MinimapPosition[MinimapPosition["Gutter"] = 2] = "Gutter";
  8511. })(MinimapPosition || (MinimapPosition = {}));
  8512. /**
  8513. * Type of hit element with the mouse in the editor.
  8514. */
  8515. var MouseTargetType;
  8516. (function (MouseTargetType) {
  8517. /**
  8518. * Mouse is on top of an unknown element.
  8519. */
  8520. MouseTargetType[MouseTargetType["UNKNOWN"] = 0] = "UNKNOWN";
  8521. /**
  8522. * Mouse is on top of the textarea used for input.
  8523. */
  8524. MouseTargetType[MouseTargetType["TEXTAREA"] = 1] = "TEXTAREA";
  8525. /**
  8526. * Mouse is on top of the glyph margin
  8527. */
  8528. MouseTargetType[MouseTargetType["GUTTER_GLYPH_MARGIN"] = 2] = "GUTTER_GLYPH_MARGIN";
  8529. /**
  8530. * Mouse is on top of the line numbers
  8531. */
  8532. MouseTargetType[MouseTargetType["GUTTER_LINE_NUMBERS"] = 3] = "GUTTER_LINE_NUMBERS";
  8533. /**
  8534. * Mouse is on top of the line decorations
  8535. */
  8536. MouseTargetType[MouseTargetType["GUTTER_LINE_DECORATIONS"] = 4] = "GUTTER_LINE_DECORATIONS";
  8537. /**
  8538. * Mouse is on top of the whitespace left in the gutter by a view zone.
  8539. */
  8540. MouseTargetType[MouseTargetType["GUTTER_VIEW_ZONE"] = 5] = "GUTTER_VIEW_ZONE";
  8541. /**
  8542. * Mouse is on top of text in the content.
  8543. */
  8544. MouseTargetType[MouseTargetType["CONTENT_TEXT"] = 6] = "CONTENT_TEXT";
  8545. /**
  8546. * Mouse is on top of empty space in the content (e.g. after line text or below last line)
  8547. */
  8548. MouseTargetType[MouseTargetType["CONTENT_EMPTY"] = 7] = "CONTENT_EMPTY";
  8549. /**
  8550. * Mouse is on top of a view zone in the content.
  8551. */
  8552. MouseTargetType[MouseTargetType["CONTENT_VIEW_ZONE"] = 8] = "CONTENT_VIEW_ZONE";
  8553. /**
  8554. * Mouse is on top of a content widget.
  8555. */
  8556. MouseTargetType[MouseTargetType["CONTENT_WIDGET"] = 9] = "CONTENT_WIDGET";
  8557. /**
  8558. * Mouse is on top of the decorations overview ruler.
  8559. */
  8560. MouseTargetType[MouseTargetType["OVERVIEW_RULER"] = 10] = "OVERVIEW_RULER";
  8561. /**
  8562. * Mouse is on top of a scrollbar.
  8563. */
  8564. MouseTargetType[MouseTargetType["SCROLLBAR"] = 11] = "SCROLLBAR";
  8565. /**
  8566. * Mouse is on top of an overlay widget.
  8567. */
  8568. MouseTargetType[MouseTargetType["OVERLAY_WIDGET"] = 12] = "OVERLAY_WIDGET";
  8569. /**
  8570. * Mouse is outside of the editor.
  8571. */
  8572. MouseTargetType[MouseTargetType["OUTSIDE_EDITOR"] = 13] = "OUTSIDE_EDITOR";
  8573. })(MouseTargetType || (MouseTargetType = {}));
  8574. /**
  8575. * A positioning preference for rendering overlay widgets.
  8576. */
  8577. var OverlayWidgetPositionPreference;
  8578. (function (OverlayWidgetPositionPreference) {
  8579. /**
  8580. * Position the overlay widget in the top right corner
  8581. */
  8582. OverlayWidgetPositionPreference[OverlayWidgetPositionPreference["TOP_RIGHT_CORNER"] = 0] = "TOP_RIGHT_CORNER";
  8583. /**
  8584. * Position the overlay widget in the bottom right corner
  8585. */
  8586. OverlayWidgetPositionPreference[OverlayWidgetPositionPreference["BOTTOM_RIGHT_CORNER"] = 1] = "BOTTOM_RIGHT_CORNER";
  8587. /**
  8588. * Position the overlay widget in the top center
  8589. */
  8590. OverlayWidgetPositionPreference[OverlayWidgetPositionPreference["TOP_CENTER"] = 2] = "TOP_CENTER";
  8591. })(OverlayWidgetPositionPreference || (OverlayWidgetPositionPreference = {}));
  8592. /**
  8593. * Vertical Lane in the overview ruler of the editor.
  8594. */
  8595. var OverviewRulerLane;
  8596. (function (OverviewRulerLane) {
  8597. OverviewRulerLane[OverviewRulerLane["Left"] = 1] = "Left";
  8598. OverviewRulerLane[OverviewRulerLane["Center"] = 2] = "Center";
  8599. OverviewRulerLane[OverviewRulerLane["Right"] = 4] = "Right";
  8600. OverviewRulerLane[OverviewRulerLane["Full"] = 7] = "Full";
  8601. })(OverviewRulerLane || (OverviewRulerLane = {}));
  8602. var RenderLineNumbersType;
  8603. (function (RenderLineNumbersType) {
  8604. RenderLineNumbersType[RenderLineNumbersType["Off"] = 0] = "Off";
  8605. RenderLineNumbersType[RenderLineNumbersType["On"] = 1] = "On";
  8606. RenderLineNumbersType[RenderLineNumbersType["Relative"] = 2] = "Relative";
  8607. RenderLineNumbersType[RenderLineNumbersType["Interval"] = 3] = "Interval";
  8608. RenderLineNumbersType[RenderLineNumbersType["Custom"] = 4] = "Custom";
  8609. })(RenderLineNumbersType || (RenderLineNumbersType = {}));
  8610. var RenderMinimap;
  8611. (function (RenderMinimap) {
  8612. RenderMinimap[RenderMinimap["None"] = 0] = "None";
  8613. RenderMinimap[RenderMinimap["Text"] = 1] = "Text";
  8614. RenderMinimap[RenderMinimap["Blocks"] = 2] = "Blocks";
  8615. })(RenderMinimap || (RenderMinimap = {}));
  8616. var ScrollType;
  8617. (function (ScrollType) {
  8618. ScrollType[ScrollType["Smooth"] = 0] = "Smooth";
  8619. ScrollType[ScrollType["Immediate"] = 1] = "Immediate";
  8620. })(ScrollType || (ScrollType = {}));
  8621. var ScrollbarVisibility;
  8622. (function (ScrollbarVisibility) {
  8623. ScrollbarVisibility[ScrollbarVisibility["Auto"] = 1] = "Auto";
  8624. ScrollbarVisibility[ScrollbarVisibility["Hidden"] = 2] = "Hidden";
  8625. ScrollbarVisibility[ScrollbarVisibility["Visible"] = 3] = "Visible";
  8626. })(ScrollbarVisibility || (ScrollbarVisibility = {}));
  8627. /**
  8628. * The direction of a selection.
  8629. */
  8630. var SelectionDirection;
  8631. (function (SelectionDirection) {
  8632. /**
  8633. * The selection starts above where it ends.
  8634. */
  8635. SelectionDirection[SelectionDirection["LTR"] = 0] = "LTR";
  8636. /**
  8637. * The selection starts below where it ends.
  8638. */
  8639. SelectionDirection[SelectionDirection["RTL"] = 1] = "RTL";
  8640. })(SelectionDirection || (SelectionDirection = {}));
  8641. var SignatureHelpTriggerKind;
  8642. (function (SignatureHelpTriggerKind) {
  8643. SignatureHelpTriggerKind[SignatureHelpTriggerKind["Invoke"] = 1] = "Invoke";
  8644. SignatureHelpTriggerKind[SignatureHelpTriggerKind["TriggerCharacter"] = 2] = "TriggerCharacter";
  8645. SignatureHelpTriggerKind[SignatureHelpTriggerKind["ContentChange"] = 3] = "ContentChange";
  8646. })(SignatureHelpTriggerKind || (SignatureHelpTriggerKind = {}));
  8647. /**
  8648. * A symbol kind.
  8649. */
  8650. var SymbolKind;
  8651. (function (SymbolKind) {
  8652. SymbolKind[SymbolKind["File"] = 0] = "File";
  8653. SymbolKind[SymbolKind["Module"] = 1] = "Module";
  8654. SymbolKind[SymbolKind["Namespace"] = 2] = "Namespace";
  8655. SymbolKind[SymbolKind["Package"] = 3] = "Package";
  8656. SymbolKind[SymbolKind["Class"] = 4] = "Class";
  8657. SymbolKind[SymbolKind["Method"] = 5] = "Method";
  8658. SymbolKind[SymbolKind["Property"] = 6] = "Property";
  8659. SymbolKind[SymbolKind["Field"] = 7] = "Field";
  8660. SymbolKind[SymbolKind["Constructor"] = 8] = "Constructor";
  8661. SymbolKind[SymbolKind["Enum"] = 9] = "Enum";
  8662. SymbolKind[SymbolKind["Interface"] = 10] = "Interface";
  8663. SymbolKind[SymbolKind["Function"] = 11] = "Function";
  8664. SymbolKind[SymbolKind["Variable"] = 12] = "Variable";
  8665. SymbolKind[SymbolKind["Constant"] = 13] = "Constant";
  8666. SymbolKind[SymbolKind["String"] = 14] = "String";
  8667. SymbolKind[SymbolKind["Number"] = 15] = "Number";
  8668. SymbolKind[SymbolKind["Boolean"] = 16] = "Boolean";
  8669. SymbolKind[SymbolKind["Array"] = 17] = "Array";
  8670. SymbolKind[SymbolKind["Object"] = 18] = "Object";
  8671. SymbolKind[SymbolKind["Key"] = 19] = "Key";
  8672. SymbolKind[SymbolKind["Null"] = 20] = "Null";
  8673. SymbolKind[SymbolKind["EnumMember"] = 21] = "EnumMember";
  8674. SymbolKind[SymbolKind["Struct"] = 22] = "Struct";
  8675. SymbolKind[SymbolKind["Event"] = 23] = "Event";
  8676. SymbolKind[SymbolKind["Operator"] = 24] = "Operator";
  8677. SymbolKind[SymbolKind["TypeParameter"] = 25] = "TypeParameter";
  8678. })(SymbolKind || (SymbolKind = {}));
  8679. var SymbolTag;
  8680. (function (SymbolTag) {
  8681. SymbolTag[SymbolTag["Deprecated"] = 1] = "Deprecated";
  8682. })(SymbolTag || (SymbolTag = {}));
  8683. /**
  8684. * The kind of animation in which the editor's cursor should be rendered.
  8685. */
  8686. var TextEditorCursorBlinkingStyle;
  8687. (function (TextEditorCursorBlinkingStyle) {
  8688. /**
  8689. * Hidden
  8690. */
  8691. TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Hidden"] = 0] = "Hidden";
  8692. /**
  8693. * Blinking
  8694. */
  8695. TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Blink"] = 1] = "Blink";
  8696. /**
  8697. * Blinking with smooth fading
  8698. */
  8699. TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Smooth"] = 2] = "Smooth";
  8700. /**
  8701. * Blinking with prolonged filled state and smooth fading
  8702. */
  8703. TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Phase"] = 3] = "Phase";
  8704. /**
  8705. * Expand collapse animation on the y axis
  8706. */
  8707. TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Expand"] = 4] = "Expand";
  8708. /**
  8709. * No-Blinking
  8710. */
  8711. TextEditorCursorBlinkingStyle[TextEditorCursorBlinkingStyle["Solid"] = 5] = "Solid";
  8712. })(TextEditorCursorBlinkingStyle || (TextEditorCursorBlinkingStyle = {}));
  8713. /**
  8714. * The style in which the editor's cursor should be rendered.
  8715. */
  8716. var TextEditorCursorStyle;
  8717. (function (TextEditorCursorStyle) {
  8718. /**
  8719. * As a vertical line (sitting between two characters).
  8720. */
  8721. TextEditorCursorStyle[TextEditorCursorStyle["Line"] = 1] = "Line";
  8722. /**
  8723. * As a block (sitting on top of a character).
  8724. */
  8725. TextEditorCursorStyle[TextEditorCursorStyle["Block"] = 2] = "Block";
  8726. /**
  8727. * As a horizontal line (sitting under a character).
  8728. */
  8729. TextEditorCursorStyle[TextEditorCursorStyle["Underline"] = 3] = "Underline";
  8730. /**
  8731. * As a thin vertical line (sitting between two characters).
  8732. */
  8733. TextEditorCursorStyle[TextEditorCursorStyle["LineThin"] = 4] = "LineThin";
  8734. /**
  8735. * As an outlined block (sitting on top of a character).
  8736. */
  8737. TextEditorCursorStyle[TextEditorCursorStyle["BlockOutline"] = 5] = "BlockOutline";
  8738. /**
  8739. * As a thin horizontal line (sitting under a character).
  8740. */
  8741. TextEditorCursorStyle[TextEditorCursorStyle["UnderlineThin"] = 6] = "UnderlineThin";
  8742. })(TextEditorCursorStyle || (TextEditorCursorStyle = {}));
  8743. /**
  8744. * Describes the behavior of decorations when typing/editing near their edges.
  8745. * Note: Please do not edit the values, as they very carefully match `DecorationRangeBehavior`
  8746. */
  8747. var TrackedRangeStickiness;
  8748. (function (TrackedRangeStickiness) {
  8749. TrackedRangeStickiness[TrackedRangeStickiness["AlwaysGrowsWhenTypingAtEdges"] = 0] = "AlwaysGrowsWhenTypingAtEdges";
  8750. TrackedRangeStickiness[TrackedRangeStickiness["NeverGrowsWhenTypingAtEdges"] = 1] = "NeverGrowsWhenTypingAtEdges";
  8751. TrackedRangeStickiness[TrackedRangeStickiness["GrowsOnlyWhenTypingBefore"] = 2] = "GrowsOnlyWhenTypingBefore";
  8752. TrackedRangeStickiness[TrackedRangeStickiness["GrowsOnlyWhenTypingAfter"] = 3] = "GrowsOnlyWhenTypingAfter";
  8753. })(TrackedRangeStickiness || (TrackedRangeStickiness = {}));
  8754. /**
  8755. * Describes how to indent wrapped lines.
  8756. */
  8757. var WrappingIndent;
  8758. (function (WrappingIndent) {
  8759. /**
  8760. * No indentation => wrapped lines begin at column 1.
  8761. */
  8762. WrappingIndent[WrappingIndent["None"] = 0] = "None";
  8763. /**
  8764. * Same => wrapped lines get the same indentation as the parent.
  8765. */
  8766. WrappingIndent[WrappingIndent["Same"] = 1] = "Same";
  8767. /**
  8768. * Indent => wrapped lines get +1 indentation toward the parent.
  8769. */
  8770. WrappingIndent[WrappingIndent["Indent"] = 2] = "Indent";
  8771. /**
  8772. * DeepIndent => wrapped lines get +2 indentation toward the parent.
  8773. */
  8774. WrappingIndent[WrappingIndent["DeepIndent"] = 3] = "DeepIndent";
  8775. })(WrappingIndent || (WrappingIndent = {}));
  8776. /***/ }),
  8777. /***/ "../../node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js":
  8778. /*!**********************************************************************************************************!*\
  8779. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/editor/common/viewModel/prefixSumComputer.js ***!
  8780. \**********************************************************************************************************/
  8781. /*! exports provided: PrefixSumIndexOfResult, PrefixSumComputer */
  8782. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8783. "use strict";
  8784. __webpack_require__.r(__webpack_exports__);
  8785. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumIndexOfResult", function() { return PrefixSumIndexOfResult; });
  8786. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PrefixSumComputer", function() { return PrefixSumComputer; });
  8787. /* harmony import */ var _base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../base/common/uint.js */ "../../node_modules/monaco-editor/esm/vs/base/common/uint.js");
  8788. /*---------------------------------------------------------------------------------------------
  8789. * Copyright (c) Microsoft Corporation. All rights reserved.
  8790. * Licensed under the MIT License. See License.txt in the project root for license information.
  8791. *--------------------------------------------------------------------------------------------*/
  8792. var PrefixSumIndexOfResult = /** @class */ (function () {
  8793. function PrefixSumIndexOfResult(index, remainder) {
  8794. this.index = index;
  8795. this.remainder = remainder;
  8796. }
  8797. return PrefixSumIndexOfResult;
  8798. }());
  8799. var PrefixSumComputer = /** @class */ (function () {
  8800. function PrefixSumComputer(values) {
  8801. this.values = values;
  8802. this.prefixSum = new Uint32Array(values.length);
  8803. this.prefixSumValidIndex = new Int32Array(1);
  8804. this.prefixSumValidIndex[0] = -1;
  8805. }
  8806. PrefixSumComputer.prototype.insertValues = function (insertIndex, insertValues) {
  8807. insertIndex = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(insertIndex);
  8808. var oldValues = this.values;
  8809. var oldPrefixSum = this.prefixSum;
  8810. var insertValuesLen = insertValues.length;
  8811. if (insertValuesLen === 0) {
  8812. return false;
  8813. }
  8814. this.values = new Uint32Array(oldValues.length + insertValuesLen);
  8815. this.values.set(oldValues.subarray(0, insertIndex), 0);
  8816. this.values.set(oldValues.subarray(insertIndex), insertIndex + insertValuesLen);
  8817. this.values.set(insertValues, insertIndex);
  8818. if (insertIndex - 1 < this.prefixSumValidIndex[0]) {
  8819. this.prefixSumValidIndex[0] = insertIndex - 1;
  8820. }
  8821. this.prefixSum = new Uint32Array(this.values.length);
  8822. if (this.prefixSumValidIndex[0] >= 0) {
  8823. this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));
  8824. }
  8825. return true;
  8826. };
  8827. PrefixSumComputer.prototype.changeValue = function (index, value) {
  8828. index = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(index);
  8829. value = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(value);
  8830. if (this.values[index] === value) {
  8831. return false;
  8832. }
  8833. this.values[index] = value;
  8834. if (index - 1 < this.prefixSumValidIndex[0]) {
  8835. this.prefixSumValidIndex[0] = index - 1;
  8836. }
  8837. return true;
  8838. };
  8839. PrefixSumComputer.prototype.removeValues = function (startIndex, cnt) {
  8840. startIndex = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(startIndex);
  8841. cnt = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(cnt);
  8842. var oldValues = this.values;
  8843. var oldPrefixSum = this.prefixSum;
  8844. if (startIndex >= oldValues.length) {
  8845. return false;
  8846. }
  8847. var maxCnt = oldValues.length - startIndex;
  8848. if (cnt >= maxCnt) {
  8849. cnt = maxCnt;
  8850. }
  8851. if (cnt === 0) {
  8852. return false;
  8853. }
  8854. this.values = new Uint32Array(oldValues.length - cnt);
  8855. this.values.set(oldValues.subarray(0, startIndex), 0);
  8856. this.values.set(oldValues.subarray(startIndex + cnt), startIndex);
  8857. this.prefixSum = new Uint32Array(this.values.length);
  8858. if (startIndex - 1 < this.prefixSumValidIndex[0]) {
  8859. this.prefixSumValidIndex[0] = startIndex - 1;
  8860. }
  8861. if (this.prefixSumValidIndex[0] >= 0) {
  8862. this.prefixSum.set(oldPrefixSum.subarray(0, this.prefixSumValidIndex[0] + 1));
  8863. }
  8864. return true;
  8865. };
  8866. PrefixSumComputer.prototype.getTotalValue = function () {
  8867. if (this.values.length === 0) {
  8868. return 0;
  8869. }
  8870. return this._getAccumulatedValue(this.values.length - 1);
  8871. };
  8872. PrefixSumComputer.prototype.getAccumulatedValue = function (index) {
  8873. if (index < 0) {
  8874. return 0;
  8875. }
  8876. index = Object(_base_common_uint_js__WEBPACK_IMPORTED_MODULE_0__["toUint32"])(index);
  8877. return this._getAccumulatedValue(index);
  8878. };
  8879. PrefixSumComputer.prototype._getAccumulatedValue = function (index) {
  8880. if (index <= this.prefixSumValidIndex[0]) {
  8881. return this.prefixSum[index];
  8882. }
  8883. var startIndex = this.prefixSumValidIndex[0] + 1;
  8884. if (startIndex === 0) {
  8885. this.prefixSum[0] = this.values[0];
  8886. startIndex++;
  8887. }
  8888. if (index >= this.values.length) {
  8889. index = this.values.length - 1;
  8890. }
  8891. for (var i = startIndex; i <= index; i++) {
  8892. this.prefixSum[i] = this.prefixSum[i - 1] + this.values[i];
  8893. }
  8894. this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], index);
  8895. return this.prefixSum[index];
  8896. };
  8897. PrefixSumComputer.prototype.getIndexOf = function (accumulatedValue) {
  8898. accumulatedValue = Math.floor(accumulatedValue); //@perf
  8899. // Compute all sums (to get a fully valid prefixSum)
  8900. this.getTotalValue();
  8901. var low = 0;
  8902. var high = this.values.length - 1;
  8903. var mid = 0;
  8904. var midStop = 0;
  8905. var midStart = 0;
  8906. while (low <= high) {
  8907. mid = low + ((high - low) / 2) | 0;
  8908. midStop = this.prefixSum[mid];
  8909. midStart = midStop - this.values[mid];
  8910. if (accumulatedValue < midStart) {
  8911. high = mid - 1;
  8912. }
  8913. else if (accumulatedValue >= midStop) {
  8914. low = mid + 1;
  8915. }
  8916. else {
  8917. break;
  8918. }
  8919. }
  8920. return new PrefixSumIndexOfResult(mid, accumulatedValue - midStart);
  8921. };
  8922. return PrefixSumComputer;
  8923. }());
  8924. /***/ }),
  8925. /***/ "../../node_modules/monaco-editor/esm/vs/editor/editor.worker.js":
  8926. /*!*************************************************************************************!*\
  8927. !*** D:/Repos/Babylon.js/node_modules/monaco-editor/esm/vs/editor/editor.worker.js ***!
  8928. \*************************************************************************************/
  8929. /*! exports provided: initialize */
  8930. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8931. "use strict";
  8932. __webpack_require__.r(__webpack_exports__);
  8933. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initialize", function() { return initialize; });
  8934. /* harmony import */ var _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/common/worker/simpleWorker.js */ "../../node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js");
  8935. /* harmony import */ var _common_services_editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common/services/editorSimpleWorker.js */ "../../node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js");
  8936. /*---------------------------------------------------------------------------------------------
  8937. * Copyright (c) Microsoft Corporation. All rights reserved.
  8938. * Licensed under the MIT License. See License.txt in the project root for license information.
  8939. *--------------------------------------------------------------------------------------------*/
  8940. var initialized = false;
  8941. function initialize(foreignModule) {
  8942. if (initialized) {
  8943. return;
  8944. }
  8945. initialized = true;
  8946. var simpleWorker = new _base_common_worker_simpleWorker_js__WEBPACK_IMPORTED_MODULE_0__["SimpleWorkerServer"](function (msg) {
  8947. self.postMessage(msg);
  8948. }, function (host) { return new _common_services_editorSimpleWorker_js__WEBPACK_IMPORTED_MODULE_1__["EditorSimpleWorker"](host, foreignModule); });
  8949. self.onmessage = function (e) {
  8950. simpleWorker.onmessage(e.data);
  8951. };
  8952. }
  8953. self.onmessage = function (e) {
  8954. // Ignore first message in this case and initialize if not yet initialized
  8955. if (!initialized) {
  8956. initialize(null);
  8957. }
  8958. };
  8959. /***/ }),
  8960. /***/ "../../node_modules/process/browser.js":
  8961. /*!***********************************************************!*\
  8962. !*** D:/Repos/Babylon.js/node_modules/process/browser.js ***!
  8963. \***********************************************************/
  8964. /*! no static exports found */
  8965. /***/ (function(module, exports) {
  8966. // shim for using process in browser
  8967. var process = module.exports = {};
  8968. // cached from whatever global is present so that test runners that stub it
  8969. // don't break things. But we need to wrap it in a try catch in case it is
  8970. // wrapped in strict mode code which doesn't define any globals. It's inside a
  8971. // function because try/catches deoptimize in certain engines.
  8972. var cachedSetTimeout;
  8973. var cachedClearTimeout;
  8974. function defaultSetTimout() {
  8975. throw new Error('setTimeout has not been defined');
  8976. }
  8977. function defaultClearTimeout () {
  8978. throw new Error('clearTimeout has not been defined');
  8979. }
  8980. (function () {
  8981. try {
  8982. if (typeof setTimeout === 'function') {
  8983. cachedSetTimeout = setTimeout;
  8984. } else {
  8985. cachedSetTimeout = defaultSetTimout;
  8986. }
  8987. } catch (e) {
  8988. cachedSetTimeout = defaultSetTimout;
  8989. }
  8990. try {
  8991. if (typeof clearTimeout === 'function') {
  8992. cachedClearTimeout = clearTimeout;
  8993. } else {
  8994. cachedClearTimeout = defaultClearTimeout;
  8995. }
  8996. } catch (e) {
  8997. cachedClearTimeout = defaultClearTimeout;
  8998. }
  8999. } ())
  9000. function runTimeout(fun) {
  9001. if (cachedSetTimeout === setTimeout) {
  9002. //normal enviroments in sane situations
  9003. return setTimeout(fun, 0);
  9004. }
  9005. // if setTimeout wasn't available but was latter defined
  9006. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  9007. cachedSetTimeout = setTimeout;
  9008. return setTimeout(fun, 0);
  9009. }
  9010. try {
  9011. // when when somebody has screwed with setTimeout but no I.E. maddness
  9012. return cachedSetTimeout(fun, 0);
  9013. } catch(e){
  9014. try {
  9015. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  9016. return cachedSetTimeout.call(null, fun, 0);
  9017. } catch(e){
  9018. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  9019. return cachedSetTimeout.call(this, fun, 0);
  9020. }
  9021. }
  9022. }
  9023. function runClearTimeout(marker) {
  9024. if (cachedClearTimeout === clearTimeout) {
  9025. //normal enviroments in sane situations
  9026. return clearTimeout(marker);
  9027. }
  9028. // if clearTimeout wasn't available but was latter defined
  9029. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  9030. cachedClearTimeout = clearTimeout;
  9031. return clearTimeout(marker);
  9032. }
  9033. try {
  9034. // when when somebody has screwed with setTimeout but no I.E. maddness
  9035. return cachedClearTimeout(marker);
  9036. } catch (e){
  9037. try {
  9038. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  9039. return cachedClearTimeout.call(null, marker);
  9040. } catch (e){
  9041. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  9042. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  9043. return cachedClearTimeout.call(this, marker);
  9044. }
  9045. }
  9046. }
  9047. var queue = [];
  9048. var draining = false;
  9049. var currentQueue;
  9050. var queueIndex = -1;
  9051. function cleanUpNextTick() {
  9052. if (!draining || !currentQueue) {
  9053. return;
  9054. }
  9055. draining = false;
  9056. if (currentQueue.length) {
  9057. queue = currentQueue.concat(queue);
  9058. } else {
  9059. queueIndex = -1;
  9060. }
  9061. if (queue.length) {
  9062. drainQueue();
  9063. }
  9064. }
  9065. function drainQueue() {
  9066. if (draining) {
  9067. return;
  9068. }
  9069. var timeout = runTimeout(cleanUpNextTick);
  9070. draining = true;
  9071. var len = queue.length;
  9072. while(len) {
  9073. currentQueue = queue;
  9074. queue = [];
  9075. while (++queueIndex < len) {
  9076. if (currentQueue) {
  9077. currentQueue[queueIndex].run();
  9078. }
  9079. }
  9080. queueIndex = -1;
  9081. len = queue.length;
  9082. }
  9083. currentQueue = null;
  9084. draining = false;
  9085. runClearTimeout(timeout);
  9086. }
  9087. process.nextTick = function (fun) {
  9088. var args = new Array(arguments.length - 1);
  9089. if (arguments.length > 1) {
  9090. for (var i = 1; i < arguments.length; i++) {
  9091. args[i - 1] = arguments[i];
  9092. }
  9093. }
  9094. queue.push(new Item(fun, args));
  9095. if (queue.length === 1 && !draining) {
  9096. runTimeout(drainQueue);
  9097. }
  9098. };
  9099. // v8 likes predictible objects
  9100. function Item(fun, array) {
  9101. this.fun = fun;
  9102. this.array = array;
  9103. }
  9104. Item.prototype.run = function () {
  9105. this.fun.apply(null, this.array);
  9106. };
  9107. process.title = 'browser';
  9108. process.browser = true;
  9109. process.env = {};
  9110. process.argv = [];
  9111. process.version = ''; // empty string to avoid regexp issues
  9112. process.versions = {};
  9113. function noop() {}
  9114. process.on = noop;
  9115. process.addListener = noop;
  9116. process.once = noop;
  9117. process.off = noop;
  9118. process.removeListener = noop;
  9119. process.removeAllListeners = noop;
  9120. process.emit = noop;
  9121. process.prependListener = noop;
  9122. process.prependOnceListener = noop;
  9123. process.listeners = function (name) { return [] }
  9124. process.binding = function (name) {
  9125. throw new Error('process.binding is not supported');
  9126. };
  9127. process.cwd = function () { return '/' };
  9128. process.chdir = function (dir) {
  9129. throw new Error('process.chdir is not supported');
  9130. };
  9131. process.umask = function() { return 0; };
  9132. /***/ }),
  9133. /***/ "../../node_modules/setimmediate/setImmediate.js":
  9134. /*!*********************************************************************!*\
  9135. !*** D:/Repos/Babylon.js/node_modules/setimmediate/setImmediate.js ***!
  9136. \*********************************************************************/
  9137. /*! no static exports found */
  9138. /***/ (function(module, exports, __webpack_require__) {
  9139. /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
  9140. "use strict";
  9141. if (global.setImmediate) {
  9142. return;
  9143. }
  9144. var nextHandle = 1; // Spec says greater than zero
  9145. var tasksByHandle = {};
  9146. var currentlyRunningATask = false;
  9147. var doc = global.document;
  9148. var registerImmediate;
  9149. function setImmediate(callback) {
  9150. // Callback can either be a function or a string
  9151. if (typeof callback !== "function") {
  9152. callback = new Function("" + callback);
  9153. }
  9154. // Copy function arguments
  9155. var args = new Array(arguments.length - 1);
  9156. for (var i = 0; i < args.length; i++) {
  9157. args[i] = arguments[i + 1];
  9158. }
  9159. // Store and register the task
  9160. var task = { callback: callback, args: args };
  9161. tasksByHandle[nextHandle] = task;
  9162. registerImmediate(nextHandle);
  9163. return nextHandle++;
  9164. }
  9165. function clearImmediate(handle) {
  9166. delete tasksByHandle[handle];
  9167. }
  9168. function run(task) {
  9169. var callback = task.callback;
  9170. var args = task.args;
  9171. switch (args.length) {
  9172. case 0:
  9173. callback();
  9174. break;
  9175. case 1:
  9176. callback(args[0]);
  9177. break;
  9178. case 2:
  9179. callback(args[0], args[1]);
  9180. break;
  9181. case 3:
  9182. callback(args[0], args[1], args[2]);
  9183. break;
  9184. default:
  9185. callback.apply(undefined, args);
  9186. break;
  9187. }
  9188. }
  9189. function runIfPresent(handle) {
  9190. // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
  9191. // So if we're currently running a task, we'll need to delay this invocation.
  9192. if (currentlyRunningATask) {
  9193. // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
  9194. // "too much recursion" error.
  9195. setTimeout(runIfPresent, 0, handle);
  9196. } else {
  9197. var task = tasksByHandle[handle];
  9198. if (task) {
  9199. currentlyRunningATask = true;
  9200. try {
  9201. run(task);
  9202. } finally {
  9203. clearImmediate(handle);
  9204. currentlyRunningATask = false;
  9205. }
  9206. }
  9207. }
  9208. }
  9209. function installNextTickImplementation() {
  9210. registerImmediate = function(handle) {
  9211. process.nextTick(function () { runIfPresent(handle); });
  9212. };
  9213. }
  9214. function canUsePostMessage() {
  9215. // The test against `importScripts` prevents this implementation from being installed inside a web worker,
  9216. // where `global.postMessage` means something completely different and can't be used for this purpose.
  9217. if (global.postMessage && !global.importScripts) {
  9218. var postMessageIsAsynchronous = true;
  9219. var oldOnMessage = global.onmessage;
  9220. global.onmessage = function() {
  9221. postMessageIsAsynchronous = false;
  9222. };
  9223. global.postMessage("", "*");
  9224. global.onmessage = oldOnMessage;
  9225. return postMessageIsAsynchronous;
  9226. }
  9227. }
  9228. function installPostMessageImplementation() {
  9229. // Installs an event handler on `global` for the `message` event: see
  9230. // * https://developer.mozilla.org/en/DOM/window.postMessage
  9231. // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
  9232. var messagePrefix = "setImmediate$" + Math.random() + "$";
  9233. var onGlobalMessage = function(event) {
  9234. if (event.source === global &&
  9235. typeof event.data === "string" &&
  9236. event.data.indexOf(messagePrefix) === 0) {
  9237. runIfPresent(+event.data.slice(messagePrefix.length));
  9238. }
  9239. };
  9240. if (global.addEventListener) {
  9241. global.addEventListener("message", onGlobalMessage, false);
  9242. } else {
  9243. global.attachEvent("onmessage", onGlobalMessage);
  9244. }
  9245. registerImmediate = function(handle) {
  9246. global.postMessage(messagePrefix + handle, "*");
  9247. };
  9248. }
  9249. function installMessageChannelImplementation() {
  9250. var channel = new MessageChannel();
  9251. channel.port1.onmessage = function(event) {
  9252. var handle = event.data;
  9253. runIfPresent(handle);
  9254. };
  9255. registerImmediate = function(handle) {
  9256. channel.port2.postMessage(handle);
  9257. };
  9258. }
  9259. function installReadyStateChangeImplementation() {
  9260. var html = doc.documentElement;
  9261. registerImmediate = function(handle) {
  9262. // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
  9263. // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
  9264. var script = doc.createElement("script");
  9265. script.onreadystatechange = function () {
  9266. runIfPresent(handle);
  9267. script.onreadystatechange = null;
  9268. html.removeChild(script);
  9269. script = null;
  9270. };
  9271. html.appendChild(script);
  9272. };
  9273. }
  9274. function installSetTimeoutImplementation() {
  9275. registerImmediate = function(handle) {
  9276. setTimeout(runIfPresent, 0, handle);
  9277. };
  9278. }
  9279. // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
  9280. var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
  9281. attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
  9282. // Don't get fooled by e.g. browserify environments.
  9283. if ({}.toString.call(global.process) === "[object process]") {
  9284. // For Node.js before 0.9
  9285. installNextTickImplementation();
  9286. } else if (canUsePostMessage()) {
  9287. // For non-IE10 modern browsers
  9288. installPostMessageImplementation();
  9289. } else if (global.MessageChannel) {
  9290. // For web workers, where supported
  9291. installMessageChannelImplementation();
  9292. } else if (doc && "onreadystatechange" in doc.createElement("script")) {
  9293. // For IE 6–8
  9294. installReadyStateChangeImplementation();
  9295. } else {
  9296. // For older browsers
  9297. installSetTimeoutImplementation();
  9298. }
  9299. attachTo.setImmediate = setImmediate;
  9300. attachTo.clearImmediate = clearImmediate;
  9301. }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
  9302. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../process/browser.js */ "../../node_modules/process/browser.js")))
  9303. /***/ }),
  9304. /***/ "../../node_modules/timers-browserify/main.js":
  9305. /*!******************************************************************!*\
  9306. !*** D:/Repos/Babylon.js/node_modules/timers-browserify/main.js ***!
  9307. \******************************************************************/
  9308. /*! no static exports found */
  9309. /***/ (function(module, exports, __webpack_require__) {
  9310. /* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) ||
  9311. (typeof self !== "undefined" && self) ||
  9312. window;
  9313. var apply = Function.prototype.apply;
  9314. // DOM APIs, for completeness
  9315. exports.setTimeout = function() {
  9316. return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);
  9317. };
  9318. exports.setInterval = function() {
  9319. return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);
  9320. };
  9321. exports.clearTimeout =
  9322. exports.clearInterval = function(timeout) {
  9323. if (timeout) {
  9324. timeout.close();
  9325. }
  9326. };
  9327. function Timeout(id, clearFn) {
  9328. this._id = id;
  9329. this._clearFn = clearFn;
  9330. }
  9331. Timeout.prototype.unref = Timeout.prototype.ref = function() {};
  9332. Timeout.prototype.close = function() {
  9333. this._clearFn.call(scope, this._id);
  9334. };
  9335. // Does not start the time, just sets up the members needed.
  9336. exports.enroll = function(item, msecs) {
  9337. clearTimeout(item._idleTimeoutId);
  9338. item._idleTimeout = msecs;
  9339. };
  9340. exports.unenroll = function(item) {
  9341. clearTimeout(item._idleTimeoutId);
  9342. item._idleTimeout = -1;
  9343. };
  9344. exports._unrefActive = exports.active = function(item) {
  9345. clearTimeout(item._idleTimeoutId);
  9346. var msecs = item._idleTimeout;
  9347. if (msecs >= 0) {
  9348. item._idleTimeoutId = setTimeout(function onTimeout() {
  9349. if (item._onTimeout)
  9350. item._onTimeout();
  9351. }, msecs);
  9352. }
  9353. };
  9354. // setimmediate attaches itself to the global object
  9355. __webpack_require__(/*! setimmediate */ "../../node_modules/setimmediate/setImmediate.js");
  9356. // On some exotic environments, it's not clear which object `setimmediate` was
  9357. // able to install onto. Search each possibility in the same order as the
  9358. // `setimmediate` library.
  9359. exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) ||
  9360. (typeof global !== "undefined" && global.setImmediate) ||
  9361. (this && this.setImmediate);
  9362. exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) ||
  9363. (typeof global !== "undefined" && global.clearImmediate) ||
  9364. (this && this.clearImmediate);
  9365. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js")))
  9366. /***/ }),
  9367. /***/ "../../node_modules/webpack/buildin/global.js":
  9368. /*!***********************************!*\
  9369. !*** (webpack)/buildin/global.js ***!
  9370. \***********************************/
  9371. /*! no static exports found */
  9372. /***/ (function(module, exports) {
  9373. var g;
  9374. // This works in non-strict mode
  9375. g = (function() {
  9376. return this;
  9377. })();
  9378. try {
  9379. // This works if eval is allowed (see CSP)
  9380. g = g || new Function("return this")();
  9381. } catch (e) {
  9382. // This works if the window reference is available
  9383. if (typeof window === "object") g = window;
  9384. }
  9385. // g can still be undefined, but nothing to do about it...
  9386. // We return undefined, instead of nothing here, so it's
  9387. // easier to handle this case. if(!global) { ...}
  9388. module.exports = g;
  9389. /***/ })
  9390. /******/ });
  9391. //# sourceMappingURL=editor.worker.js.map