parser-postcss.js 1.5 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729
  1. (function webpackUniversalModuleDefinition(root, factory) {
  2. if(typeof exports === 'object' && typeof module === 'object')
  3. module.exports = factory();
  4. else if(typeof define === 'function' && define.amd)
  5. define([], factory);
  6. else if(typeof exports === 'object')
  7. exports["postcss"] = factory();
  8. else
  9. root["prettierPlugins"] = root["prettierPlugins"] || {}, root["prettierPlugins"]["postcss"] = factory();
  10. })(this, function() {
  11. return /******/ (function(modules) { // webpackBootstrap
  12. /******/ // The module cache
  13. /******/ var installedModules = {};
  14. /******/
  15. /******/ // The require function
  16. /******/ function __webpack_require__(moduleId) {
  17. /******/
  18. /******/ // Check if module is in cache
  19. /******/ if(installedModules[moduleId]) {
  20. /******/ return installedModules[moduleId].exports;
  21. /******/ }
  22. /******/ // Create a new module (and put it into the cache)
  23. /******/ var module = installedModules[moduleId] = {
  24. /******/ i: moduleId,
  25. /******/ l: false,
  26. /******/ exports: {}
  27. /******/ };
  28. /******/
  29. /******/ // Execute the module function
  30. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  31. /******/
  32. /******/ // Flag the module as loaded
  33. /******/ module.l = true;
  34. /******/
  35. /******/ // Return the exports of the module
  36. /******/ return module.exports;
  37. /******/ }
  38. /******/
  39. /******/
  40. /******/ // expose the modules object (__webpack_modules__)
  41. /******/ __webpack_require__.m = modules;
  42. /******/
  43. /******/ // expose the module cache
  44. /******/ __webpack_require__.c = installedModules;
  45. /******/
  46. /******/ // identity function for calling harmony imports with the correct context
  47. /******/ __webpack_require__.i = function(value) { return value; };
  48. /******/
  49. /******/ // define getter function for harmony exports
  50. /******/ __webpack_require__.d = function(exports, name, getter) {
  51. /******/ if(!__webpack_require__.o(exports, name)) {
  52. /******/ Object.defineProperty(exports, name, {
  53. /******/ configurable: false,
  54. /******/ enumerable: true,
  55. /******/ get: getter
  56. /******/ });
  57. /******/ }
  58. /******/ };
  59. /******/
  60. /******/ // getDefaultExport function for compatibility with non-harmony modules
  61. /******/ __webpack_require__.n = function(module) {
  62. /******/ var getter = module && module.__esModule ?
  63. /******/ function getDefault() { return module['default']; } :
  64. /******/ function getModuleExports() { return module; };
  65. /******/ __webpack_require__.d(getter, 'a', getter);
  66. /******/ return getter;
  67. /******/ };
  68. /******/
  69. /******/ // Object.prototype.hasOwnProperty.call
  70. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  71. /******/
  72. /******/ // __webpack_public_path__
  73. /******/ __webpack_require__.p = "";
  74. /******/
  75. /******/ // Load entry module and return exports
  76. /******/ return __webpack_require__(__webpack_require__.s = 175);
  77. /******/ })
  78. /************************************************************************/
  79. /******/ ([
  80. /* 0 */
  81. /***/ (function(module, exports, __webpack_require__) {
  82. "use strict";
  83. exports.__esModule = true;
  84. var TAG = exports.TAG = 'tag';
  85. var STRING = exports.STRING = 'string';
  86. var SELECTOR = exports.SELECTOR = 'selector';
  87. var ROOT = exports.ROOT = 'root';
  88. var PSEUDO = exports.PSEUDO = 'pseudo';
  89. var NESTING = exports.NESTING = 'nesting';
  90. var ID = exports.ID = 'id';
  91. var COMMENT = exports.COMMENT = 'comment';
  92. var COMBINATOR = exports.COMBINATOR = 'combinator';
  93. var CLASS = exports.CLASS = 'class';
  94. var ATTRIBUTE = exports.ATTRIBUTE = 'attribute';
  95. var UNIVERSAL = exports.UNIVERSAL = 'universal';
  96. /***/ }),
  97. /* 1 */
  98. /***/ (function(module, exports, __webpack_require__) {
  99. "use strict";
  100. const Node = __webpack_require__(3);
  101. class Container extends Node {
  102. constructor (opts) {
  103. super(opts);
  104. if (!this.nodes) {
  105. this.nodes = [];
  106. }
  107. }
  108. push (child) {
  109. child.parent = this;
  110. this.nodes.push(child);
  111. return this;
  112. }
  113. each (callback) {
  114. if (!this.lastEach) this.lastEach = 0;
  115. if (!this.indexes) this.indexes = { };
  116. this.lastEach += 1;
  117. let id = this.lastEach,
  118. index,
  119. result;
  120. this.indexes[id] = 0;
  121. if (!this.nodes) return undefined;
  122. while (this.indexes[id] < this.nodes.length) {
  123. index = this.indexes[id];
  124. result = callback(this.nodes[index], index);
  125. if (result === false) break;
  126. this.indexes[id] += 1;
  127. }
  128. delete this.indexes[id];
  129. return result;
  130. }
  131. walk (callback) {
  132. return this.each((child, i) => {
  133. let result = callback(child, i);
  134. if (result !== false && child.walk) {
  135. result = child.walk(callback);
  136. }
  137. return result;
  138. });
  139. }
  140. walkType (type, callback) {
  141. if (!type || !callback) {
  142. throw new Error('Parameters {type} and {callback} are required.');
  143. }
  144. // allow users to pass a constructor, or node type string; eg. Word.
  145. type = type.name && type.prototype ? type.name : type;
  146. return this.walk((node, index) => {
  147. if (node.type === type) {
  148. return callback.call(this, node, index);
  149. }
  150. });
  151. }
  152. append (node) {
  153. node.parent = this;
  154. this.nodes.push(node);
  155. return this;
  156. }
  157. prepend (node) {
  158. node.parent = this;
  159. this.nodes.unshift(node);
  160. return this;
  161. }
  162. cleanRaws (keepBetween) {
  163. super.cleanRaws(keepBetween);
  164. if (this.nodes) {
  165. for (let node of this.nodes) node.cleanRaws(keepBetween);
  166. }
  167. }
  168. insertAfter (oldNode, newNode) {
  169. let oldIndex = this.index(oldNode),
  170. index;
  171. this.nodes.splice(oldIndex + 1, 0, newNode);
  172. for (let id in this.indexes) {
  173. index = this.indexes[id];
  174. if (oldIndex <= index) {
  175. this.indexes[id] = index + this.nodes.length;
  176. }
  177. }
  178. return this;
  179. }
  180. insertBefore (oldNode, newNode) {
  181. let oldIndex = this.index(oldNode),
  182. index;
  183. this.nodes.splice(oldIndex, 0, newNode);
  184. for (let id in this.indexes) {
  185. index = this.indexes[id];
  186. if (oldIndex <= index) {
  187. this.indexes[id] = index + this.nodes.length;
  188. }
  189. }
  190. return this;
  191. }
  192. removeChild (child) {
  193. child = this.index(child);
  194. this.nodes[child].parent = undefined;
  195. this.nodes.splice(child, 1);
  196. let index;
  197. for (let id in this.indexes) {
  198. index = this.indexes[id];
  199. if (index >= child) {
  200. this.indexes[id] = index - 1;
  201. }
  202. }
  203. return this;
  204. }
  205. removeAll () {
  206. for (let node of this.nodes) node.parent = undefined;
  207. this.nodes = [];
  208. return this;
  209. }
  210. every (condition) {
  211. return this.nodes.every(condition);
  212. }
  213. some (condition) {
  214. return this.nodes.some(condition);
  215. }
  216. index (child) {
  217. if (typeof child === 'number') {
  218. return child;
  219. }
  220. else {
  221. return this.nodes.indexOf(child);
  222. }
  223. }
  224. get first () {
  225. if (!this.nodes) return undefined;
  226. return this.nodes[0];
  227. }
  228. get last () {
  229. if (!this.nodes) return undefined;
  230. return this.nodes[this.nodes.length - 1];
  231. }
  232. toString () {
  233. let result = this.nodes.map(String).join('');
  234. if (this.value) {
  235. result = this.value + result;
  236. }
  237. if (this.raws.before) {
  238. result = this.raws.before + result;
  239. }
  240. if (this.raws.after) {
  241. result += this.raws.after;
  242. }
  243. return result;
  244. }
  245. }
  246. Container.registerWalker = (constructor) => {
  247. let walkerName = 'walk' + constructor.name;
  248. // plural sugar
  249. if (walkerName.lastIndexOf('s') !== walkerName.length - 1) {
  250. walkerName += 's';
  251. }
  252. if (Container.prototype[walkerName]) {
  253. return;
  254. }
  255. // we need access to `this` so we can't use an arrow function
  256. Container.prototype[walkerName] = function (callback) {
  257. return this.walkType(constructor, callback);
  258. };
  259. };
  260. module.exports = Container;
  261. /***/ }),
  262. /* 2 */
  263. /***/ (function(module, exports, __webpack_require__) {
  264. "use strict";
  265. Object.defineProperty(exports, "__esModule", {
  266. value: true
  267. });
  268. var singleQuote = exports.singleQuote = '\''.charCodeAt(0);
  269. var doubleQuote = exports.doubleQuote = '"'.charCodeAt(0);
  270. var backslash = exports.backslash = '\\'.charCodeAt(0);
  271. var backTick = exports.backTick = '`'.charCodeAt(0);
  272. var slash = exports.slash = '/'.charCodeAt(0);
  273. var newline = exports.newline = '\n'.charCodeAt(0);
  274. var space = exports.space = ' '.charCodeAt(0);
  275. var feed = exports.feed = '\f'.charCodeAt(0);
  276. var tab = exports.tab = '\t'.charCodeAt(0);
  277. var carriageReturn = exports.carriageReturn = '\r'.charCodeAt(0);
  278. var openedParenthesis = exports.openedParenthesis = '('.charCodeAt(0);
  279. var closedParenthesis = exports.closedParenthesis = ')'.charCodeAt(0);
  280. var openedCurlyBracket = exports.openedCurlyBracket = '{'.charCodeAt(0);
  281. var closedCurlyBracket = exports.closedCurlyBracket = '}'.charCodeAt(0);
  282. var openSquareBracket = exports.openSquareBracket = '['.charCodeAt(0);
  283. var closeSquareBracket = exports.closeSquareBracket = ']'.charCodeAt(0);
  284. var semicolon = exports.semicolon = ';'.charCodeAt(0);
  285. var asterisk = exports.asterisk = '*'.charCodeAt(0);
  286. var colon = exports.colon = ':'.charCodeAt(0);
  287. var comma = exports.comma = ','.charCodeAt(0);
  288. var dot = exports.dot = '.'.charCodeAt(0);
  289. var atRule = exports.atRule = '@'.charCodeAt(0);
  290. var tilde = exports.tilde = '~'.charCodeAt(0);
  291. var hash = exports.hash = '#'.charCodeAt(0);
  292. var atEndPattern = exports.atEndPattern = /[ \n\t\r\f\{\(\)'"\\;/\[\]#]/g;
  293. var wordEndPattern = exports.wordEndPattern = /[ \n\t\r\f\(\)\{\}:,;@!'"\\\]\[#]|\/(?=\*)/g;
  294. var badBracketPattern = exports.badBracketPattern = /.[\\\/\("'\n]/;
  295. var variablePattern = exports.variablePattern = /^@[^:\(\{]+:/;
  296. var hashColorPattern = exports.hashColorPattern = /^#[0-9a-fA-F]{6}$|^#[0-9a-fA-F]{3}$/;
  297. /***/ }),
  298. /* 3 */
  299. /***/ (function(module, exports, __webpack_require__) {
  300. "use strict";
  301. let cloneNode = function (obj, parent) {
  302. let cloned = new obj.constructor();
  303. for (let i in obj) {
  304. if (!obj.hasOwnProperty(i)) continue;
  305. let value = obj[i],
  306. type = typeof value;
  307. if (i === 'parent' && type === 'object') {
  308. if (parent) cloned[i] = parent;
  309. }
  310. else if (i === 'source') {
  311. cloned[i] = value;
  312. }
  313. else if (value instanceof Array) {
  314. cloned[i] = value.map(j => cloneNode(j, cloned));
  315. }
  316. else if (i !== 'before' && i !== 'after' && i !== 'between' && i !== 'semicolon') {
  317. if (type === 'object' && value !== null) value = cloneNode(value);
  318. cloned[i] = value;
  319. }
  320. }
  321. return cloned;
  322. };
  323. module.exports = class Node {
  324. constructor (defaults) {
  325. defaults = defaults || {};
  326. this.raws = { before: '', after: '' };
  327. for (let name in defaults) {
  328. this[name] = defaults[name];
  329. }
  330. }
  331. remove () {
  332. if (this.parent) {
  333. this.parent.removeChild(this);
  334. }
  335. this.parent = undefined;
  336. return this;
  337. }
  338. toString () {
  339. return [
  340. this.raws.before,
  341. String(this.value),
  342. this.raws.after
  343. ].join('');
  344. }
  345. clone (overrides) {
  346. overrides = overrides || {};
  347. let cloned = cloneNode(this);
  348. for (let name in overrides) {
  349. cloned[name] = overrides[name];
  350. }
  351. return cloned;
  352. }
  353. cloneBefore (overrides) {
  354. overrides = overrides || {};
  355. let cloned = this.clone(overrides);
  356. this.parent.insertBefore(this, cloned);
  357. return cloned;
  358. }
  359. cloneAfter (overrides) {
  360. overrides = overrides || {};
  361. let cloned = this.clone(overrides);
  362. this.parent.insertAfter(this, cloned);
  363. return cloned;
  364. }
  365. replaceWith () {
  366. let nodes = Array.prototype.slice.call(arguments);
  367. if (this.parent) {
  368. for (let node of nodes) {
  369. this.parent.insertBefore(this, node);
  370. }
  371. this.remove();
  372. }
  373. return this;
  374. }
  375. moveTo (container) {
  376. this.cleanRaws(this.root() === container.root());
  377. this.remove();
  378. container.append(this);
  379. return this;
  380. }
  381. moveBefore (node) {
  382. this.cleanRaws(this.root() === node.root());
  383. this.remove();
  384. node.parent.insertBefore(node, this);
  385. return this;
  386. }
  387. moveAfter (node) {
  388. this.cleanRaws(this.root() === node.root());
  389. this.remove();
  390. node.parent.insertAfter(node, this);
  391. return this;
  392. }
  393. next () {
  394. let index = this.parent.index(this);
  395. return this.parent.nodes[index + 1];
  396. }
  397. prev () {
  398. let index = this.parent.index(this);
  399. return this.parent.nodes[index - 1];
  400. }
  401. toJSON () {
  402. let fixed = { };
  403. for (let name in this) {
  404. if (!this.hasOwnProperty(name)) continue;
  405. if (name === 'parent') continue;
  406. let value = this[name];
  407. if (value instanceof Array) {
  408. fixed[name] = value.map(i => {
  409. if (typeof i === 'object' && i.toJSON) {
  410. return i.toJSON();
  411. }
  412. else {
  413. return i;
  414. }
  415. });
  416. }
  417. else if (typeof value === 'object' && value.toJSON) {
  418. fixed[name] = value.toJSON();
  419. }
  420. else {
  421. fixed[name] = value;
  422. }
  423. }
  424. return fixed;
  425. }
  426. root () {
  427. let result = this;
  428. while (result.parent) result = result.parent;
  429. return result;
  430. }
  431. cleanRaws (keepBetween) {
  432. delete this.raws.before;
  433. delete this.raws.after;
  434. if (!keepBetween) delete this.raws.between;
  435. }
  436. positionInside (index) {
  437. let string = this.toString(),
  438. column = this.source.start.column,
  439. line = this.source.start.line;
  440. for (let i = 0; i < index; i++) {
  441. if (string[i] === '\n') {
  442. column = 1;
  443. line += 1;
  444. }
  445. else {
  446. column += 1;
  447. }
  448. }
  449. return { line, column };
  450. }
  451. positionBy (opts) {
  452. let pos = this.source.start;
  453. if (opts.index) {
  454. pos = this.positionInside(opts.index);
  455. }
  456. else if (opts.word) {
  457. let index = this.toString().indexOf(opts.word);
  458. if (index !== -1) pos = this.positionInside(index);
  459. }
  460. return pos;
  461. }
  462. };
  463. /***/ }),
  464. /* 4 */
  465. /***/ (function(module, exports, __webpack_require__) {
  466. "use strict";
  467. exports.__esModule = true;
  468. exports.default = warnOnce;
  469. var printed = {};
  470. function warnOnce(message) {
  471. if (printed[message]) return;
  472. printed[message] = true;
  473. if (typeof console !== 'undefined' && console.warn) console.warn(message);
  474. }
  475. module.exports = exports['default'];
  476. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndhcm4tb25jZS5lczYiXSwibmFtZXMiOlsid2Fybk9uY2UiLCJwcmludGVkIiwibWVzc2FnZSIsImNvbnNvbGUiLCJ3YXJuIl0sIm1hcHBpbmdzIjoiOzs7a0JBRXdCQSxRO0FBRnhCLElBQUlDLFVBQVUsRUFBZDs7QUFFZSxTQUFTRCxRQUFULENBQWtCRSxPQUFsQixFQUEyQjtBQUN0QyxRQUFLRCxRQUFRQyxPQUFSLENBQUwsRUFBd0I7QUFDeEJELFlBQVFDLE9BQVIsSUFBbUIsSUFBbkI7O0FBRUEsUUFBSyxPQUFPQyxPQUFQLEtBQW1CLFdBQW5CLElBQWtDQSxRQUFRQyxJQUEvQyxFQUFzREQsUUFBUUMsSUFBUixDQUFhRixPQUFiO0FBQ3pEIiwiZmlsZSI6Indhcm4tb25jZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImxldCBwcmludGVkID0geyB9O1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiB3YXJuT25jZShtZXNzYWdlKSB7XG4gICAgaWYgKCBwcmludGVkW21lc3NhZ2VdICkgcmV0dXJuO1xuICAgIHByaW50ZWRbbWVzc2FnZV0gPSB0cnVlO1xuXG4gICAgaWYgKCB0eXBlb2YgY29uc29sZSAhPT0gJ3VuZGVmaW5lZCcgJiYgY29uc29sZS53YXJuICkgY29uc29sZS53YXJuKG1lc3NhZ2UpO1xufVxuIl19
  477. /***/ }),
  478. /* 5 */
  479. /***/ (function(module, exports, __webpack_require__) {
  480. /* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.
  481. //
  482. // Permission is hereby granted, free of charge, to any person obtaining a
  483. // copy of this software and associated documentation files (the
  484. // "Software"), to deal in the Software without restriction, including
  485. // without limitation the rights to use, copy, modify, merge, publish,
  486. // distribute, sublicense, and/or sell copies of the Software, and to permit
  487. // persons to whom the Software is furnished to do so, subject to the
  488. // following conditions:
  489. //
  490. // The above copyright notice and this permission notice shall be included
  491. // in all copies or substantial portions of the Software.
  492. //
  493. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  494. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  495. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  496. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  497. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  498. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  499. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  500. // resolves . and .. elements in a path array with directory names there
  501. // must be no slashes, empty elements, or device names (c:\) in the array
  502. // (so also no leading and trailing slashes - it does not distinguish
  503. // relative and absolute paths)
  504. function normalizeArray(parts, allowAboveRoot) {
  505. // if the path tries to go above the root, `up` ends up > 0
  506. var up = 0;
  507. for (var i = parts.length - 1; i >= 0; i--) {
  508. var last = parts[i];
  509. if (last === '.') {
  510. parts.splice(i, 1);
  511. } else if (last === '..') {
  512. parts.splice(i, 1);
  513. up++;
  514. } else if (up) {
  515. parts.splice(i, 1);
  516. up--;
  517. }
  518. }
  519. // if the path is allowed to go above the root, restore leading ..s
  520. if (allowAboveRoot) {
  521. for (; up--; up) {
  522. parts.unshift('..');
  523. }
  524. }
  525. return parts;
  526. }
  527. // Split a filename into [root, dir, basename, ext], unix version
  528. // 'root' is just a slash, or nothing.
  529. var splitPathRe =
  530. /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
  531. var splitPath = function(filename) {
  532. return splitPathRe.exec(filename).slice(1);
  533. };
  534. // path.resolve([from ...], to)
  535. // posix version
  536. exports.resolve = function() {
  537. var resolvedPath = '',
  538. resolvedAbsolute = false;
  539. for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
  540. var path = (i >= 0) ? arguments[i] : process.cwd();
  541. // Skip empty and invalid entries
  542. if (typeof path !== 'string') {
  543. throw new TypeError('Arguments to path.resolve must be strings');
  544. } else if (!path) {
  545. continue;
  546. }
  547. resolvedPath = path + '/' + resolvedPath;
  548. resolvedAbsolute = path.charAt(0) === '/';
  549. }
  550. // At this point the path should be resolved to a full absolute path, but
  551. // handle relative paths to be safe (might happen when process.cwd() fails)
  552. // Normalize the path
  553. resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
  554. return !!p;
  555. }), !resolvedAbsolute).join('/');
  556. return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  557. };
  558. // path.normalize(path)
  559. // posix version
  560. exports.normalize = function(path) {
  561. var isAbsolute = exports.isAbsolute(path),
  562. trailingSlash = substr(path, -1) === '/';
  563. // Normalize the path
  564. path = normalizeArray(filter(path.split('/'), function(p) {
  565. return !!p;
  566. }), !isAbsolute).join('/');
  567. if (!path && !isAbsolute) {
  568. path = '.';
  569. }
  570. if (path && trailingSlash) {
  571. path += '/';
  572. }
  573. return (isAbsolute ? '/' : '') + path;
  574. };
  575. // posix version
  576. exports.isAbsolute = function(path) {
  577. return path.charAt(0) === '/';
  578. };
  579. // posix version
  580. exports.join = function() {
  581. var paths = Array.prototype.slice.call(arguments, 0);
  582. return exports.normalize(filter(paths, function(p, index) {
  583. if (typeof p !== 'string') {
  584. throw new TypeError('Arguments to path.join must be strings');
  585. }
  586. return p;
  587. }).join('/'));
  588. };
  589. // path.relative(from, to)
  590. // posix version
  591. exports.relative = function(from, to) {
  592. from = exports.resolve(from).substr(1);
  593. to = exports.resolve(to).substr(1);
  594. function trim(arr) {
  595. var start = 0;
  596. for (; start < arr.length; start++) {
  597. if (arr[start] !== '') break;
  598. }
  599. var end = arr.length - 1;
  600. for (; end >= 0; end--) {
  601. if (arr[end] !== '') break;
  602. }
  603. if (start > end) return [];
  604. return arr.slice(start, end - start + 1);
  605. }
  606. var fromParts = trim(from.split('/'));
  607. var toParts = trim(to.split('/'));
  608. var length = Math.min(fromParts.length, toParts.length);
  609. var samePartsLength = length;
  610. for (var i = 0; i < length; i++) {
  611. if (fromParts[i] !== toParts[i]) {
  612. samePartsLength = i;
  613. break;
  614. }
  615. }
  616. var outputParts = [];
  617. for (var i = samePartsLength; i < fromParts.length; i++) {
  618. outputParts.push('..');
  619. }
  620. outputParts = outputParts.concat(toParts.slice(samePartsLength));
  621. return outputParts.join('/');
  622. };
  623. exports.sep = '/';
  624. exports.delimiter = ':';
  625. exports.dirname = function(path) {
  626. var result = splitPath(path),
  627. root = result[0],
  628. dir = result[1];
  629. if (!root && !dir) {
  630. // No dirname whatsoever
  631. return '.';
  632. }
  633. if (dir) {
  634. // It has a dirname, strip trailing slash
  635. dir = dir.substr(0, dir.length - 1);
  636. }
  637. return root + dir;
  638. };
  639. exports.basename = function(path, ext) {
  640. var f = splitPath(path)[2];
  641. // TODO: make this comparison case-insensitive on windows?
  642. if (ext && f.substr(-1 * ext.length) === ext) {
  643. f = f.substr(0, f.length - ext.length);
  644. }
  645. return f;
  646. };
  647. exports.extname = function(path) {
  648. return splitPath(path)[3];
  649. };
  650. function filter (xs, f) {
  651. if (xs.filter) return xs.filter(f);
  652. var res = [];
  653. for (var i = 0; i < xs.length; i++) {
  654. if (f(xs[i], i, xs)) res.push(xs[i]);
  655. }
  656. return res;
  657. }
  658. // String.prototype.substr - negative index don't work in IE8
  659. var substr = 'ab'.substr(-1) === 'b'
  660. ? function (str, start, len) { return str.substr(start, len) }
  661. : function (str, start, len) {
  662. if (start < 0) start = str.length + start;
  663. return str.substr(start, len);
  664. }
  665. ;
  666. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(14)))
  667. /***/ }),
  668. /* 6 */
  669. /***/ (function(module, exports, __webpack_require__) {
  670. "use strict";
  671. exports.__esModule = true;
  672. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  673. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  674. var cloneNode = function cloneNode(obj, parent) {
  675. if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object') {
  676. return obj;
  677. }
  678. var cloned = new obj.constructor();
  679. for (var i in obj) {
  680. if (!obj.hasOwnProperty(i)) {
  681. continue;
  682. }
  683. var value = obj[i];
  684. var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
  685. if (i === 'parent' && type === 'object') {
  686. if (parent) {
  687. cloned[i] = parent;
  688. }
  689. } else if (value instanceof Array) {
  690. cloned[i] = value.map(function (j) {
  691. return cloneNode(j, cloned);
  692. });
  693. } else {
  694. cloned[i] = cloneNode(value, cloned);
  695. }
  696. }
  697. return cloned;
  698. };
  699. var _class = function () {
  700. function _class() {
  701. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  702. _classCallCheck(this, _class);
  703. for (var key in opts) {
  704. this[key] = opts[key];
  705. }
  706. var _opts$spaces = opts.spaces;
  707. _opts$spaces = _opts$spaces === undefined ? {} : _opts$spaces;
  708. var _opts$spaces$before = _opts$spaces.before,
  709. before = _opts$spaces$before === undefined ? '' : _opts$spaces$before,
  710. _opts$spaces$after = _opts$spaces.after,
  711. after = _opts$spaces$after === undefined ? '' : _opts$spaces$after;
  712. this.spaces = { before: before, after: after };
  713. }
  714. _class.prototype.remove = function remove() {
  715. if (this.parent) {
  716. this.parent.removeChild(this);
  717. }
  718. this.parent = undefined;
  719. return this;
  720. };
  721. _class.prototype.replaceWith = function replaceWith() {
  722. if (this.parent) {
  723. for (var index in arguments) {
  724. this.parent.insertBefore(this, arguments[index]);
  725. }
  726. this.remove();
  727. }
  728. return this;
  729. };
  730. _class.prototype.next = function next() {
  731. return this.parent.at(this.parent.index(this) + 1);
  732. };
  733. _class.prototype.prev = function prev() {
  734. return this.parent.at(this.parent.index(this) - 1);
  735. };
  736. _class.prototype.clone = function clone() {
  737. var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  738. var cloned = cloneNode(this);
  739. for (var name in overrides) {
  740. cloned[name] = overrides[name];
  741. }
  742. return cloned;
  743. };
  744. _class.prototype.toString = function toString() {
  745. return [this.spaces.before, String(this.value), this.spaces.after].join('');
  746. };
  747. return _class;
  748. }();
  749. exports.default = _class;
  750. module.exports = exports['default'];
  751. /***/ }),
  752. /* 7 */
  753. /***/ (function(module, exports, __webpack_require__) {
  754. "use strict";
  755. Object.defineProperty(exports, "__esModule", {
  756. value: true
  757. });
  758. exports.default = unclosed;
  759. function unclosed(state, what) {
  760. throw state.input.error("Unclosed " + what, state.line, state.pos - state.offset);
  761. }
  762. module.exports = exports["default"];
  763. /***/ }),
  764. /* 8 */
  765. /***/ (function(module, exports) {
  766. /* -*- Mode: js; js-indent-level: 2; -*- */
  767. /*
  768. * Copyright 2011 Mozilla Foundation and contributors
  769. * Licensed under the New BSD license. See LICENSE or:
  770. * http://opensource.org/licenses/BSD-3-Clause
  771. */
  772. /**
  773. * This is a helper function for getting values from parameter/options
  774. * objects.
  775. *
  776. * @param args The object we are extracting values from
  777. * @param name The name of the property we are getting.
  778. * @param defaultValue An optional value to return if the property is missing
  779. * from the object. If this is not specified and the property is missing, an
  780. * error will be thrown.
  781. */
  782. function getArg(aArgs, aName, aDefaultValue) {
  783. if (aName in aArgs) {
  784. return aArgs[aName];
  785. } else if (arguments.length === 3) {
  786. return aDefaultValue;
  787. } else {
  788. throw new Error('"' + aName + '" is a required argument.');
  789. }
  790. }
  791. exports.getArg = getArg;
  792. var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
  793. var dataUrlRegexp = /^data:.+\,.+$/;
  794. function urlParse(aUrl) {
  795. var match = aUrl.match(urlRegexp);
  796. if (!match) {
  797. return null;
  798. }
  799. return {
  800. scheme: match[1],
  801. auth: match[2],
  802. host: match[3],
  803. port: match[4],
  804. path: match[5]
  805. };
  806. }
  807. exports.urlParse = urlParse;
  808. function urlGenerate(aParsedUrl) {
  809. var url = '';
  810. if (aParsedUrl.scheme) {
  811. url += aParsedUrl.scheme + ':';
  812. }
  813. url += '//';
  814. if (aParsedUrl.auth) {
  815. url += aParsedUrl.auth + '@';
  816. }
  817. if (aParsedUrl.host) {
  818. url += aParsedUrl.host;
  819. }
  820. if (aParsedUrl.port) {
  821. url += ":" + aParsedUrl.port
  822. }
  823. if (aParsedUrl.path) {
  824. url += aParsedUrl.path;
  825. }
  826. return url;
  827. }
  828. exports.urlGenerate = urlGenerate;
  829. /**
  830. * Normalizes a path, or the path portion of a URL:
  831. *
  832. * - Replaces consecutive slashes with one slash.
  833. * - Removes unnecessary '.' parts.
  834. * - Removes unnecessary '<dir>/..' parts.
  835. *
  836. * Based on code in the Node.js 'path' core module.
  837. *
  838. * @param aPath The path or url to normalize.
  839. */
  840. function normalize(aPath) {
  841. var path = aPath;
  842. var url = urlParse(aPath);
  843. if (url) {
  844. if (!url.path) {
  845. return aPath;
  846. }
  847. path = url.path;
  848. }
  849. var isAbsolute = exports.isAbsolute(path);
  850. var parts = path.split(/\/+/);
  851. for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
  852. part = parts[i];
  853. if (part === '.') {
  854. parts.splice(i, 1);
  855. } else if (part === '..') {
  856. up++;
  857. } else if (up > 0) {
  858. if (part === '') {
  859. // The first part is blank if the path is absolute. Trying to go
  860. // above the root is a no-op. Therefore we can remove all '..' parts
  861. // directly after the root.
  862. parts.splice(i + 1, up);
  863. up = 0;
  864. } else {
  865. parts.splice(i, 2);
  866. up--;
  867. }
  868. }
  869. }
  870. path = parts.join('/');
  871. if (path === '') {
  872. path = isAbsolute ? '/' : '.';
  873. }
  874. if (url) {
  875. url.path = path;
  876. return urlGenerate(url);
  877. }
  878. return path;
  879. }
  880. exports.normalize = normalize;
  881. /**
  882. * Joins two paths/URLs.
  883. *
  884. * @param aRoot The root path or URL.
  885. * @param aPath The path or URL to be joined with the root.
  886. *
  887. * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
  888. * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
  889. * first.
  890. * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
  891. * is updated with the result and aRoot is returned. Otherwise the result
  892. * is returned.
  893. * - If aPath is absolute, the result is aPath.
  894. * - Otherwise the two paths are joined with a slash.
  895. * - Joining for example 'http://' and 'www.example.com' is also supported.
  896. */
  897. function join(aRoot, aPath) {
  898. if (aRoot === "") {
  899. aRoot = ".";
  900. }
  901. if (aPath === "") {
  902. aPath = ".";
  903. }
  904. var aPathUrl = urlParse(aPath);
  905. var aRootUrl = urlParse(aRoot);
  906. if (aRootUrl) {
  907. aRoot = aRootUrl.path || '/';
  908. }
  909. // `join(foo, '//www.example.org')`
  910. if (aPathUrl && !aPathUrl.scheme) {
  911. if (aRootUrl) {
  912. aPathUrl.scheme = aRootUrl.scheme;
  913. }
  914. return urlGenerate(aPathUrl);
  915. }
  916. if (aPathUrl || aPath.match(dataUrlRegexp)) {
  917. return aPath;
  918. }
  919. // `join('http://', 'www.example.com')`
  920. if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
  921. aRootUrl.host = aPath;
  922. return urlGenerate(aRootUrl);
  923. }
  924. var joined = aPath.charAt(0) === '/'
  925. ? aPath
  926. : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
  927. if (aRootUrl) {
  928. aRootUrl.path = joined;
  929. return urlGenerate(aRootUrl);
  930. }
  931. return joined;
  932. }
  933. exports.join = join;
  934. exports.isAbsolute = function (aPath) {
  935. return aPath.charAt(0) === '/' || urlRegexp.test(aPath);
  936. };
  937. /**
  938. * Make a path relative to a URL or another path.
  939. *
  940. * @param aRoot The root path or URL.
  941. * @param aPath The path or URL to be made relative to aRoot.
  942. */
  943. function relative(aRoot, aPath) {
  944. if (aRoot === "") {
  945. aRoot = ".";
  946. }
  947. aRoot = aRoot.replace(/\/$/, '');
  948. // It is possible for the path to be above the root. In this case, simply
  949. // checking whether the root is a prefix of the path won't work. Instead, we
  950. // need to remove components from the root one by one, until either we find
  951. // a prefix that fits, or we run out of components to remove.
  952. var level = 0;
  953. while (aPath.indexOf(aRoot + '/') !== 0) {
  954. var index = aRoot.lastIndexOf("/");
  955. if (index < 0) {
  956. return aPath;
  957. }
  958. // If the only part of the root that is left is the scheme (i.e. http://,
  959. // file:///, etc.), one or more slashes (/), or simply nothing at all, we
  960. // have exhausted all components, so the path is not relative to the root.
  961. aRoot = aRoot.slice(0, index);
  962. if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
  963. return aPath;
  964. }
  965. ++level;
  966. }
  967. // Make sure we add a "../" for each component we removed from the root.
  968. return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
  969. }
  970. exports.relative = relative;
  971. var supportsNullProto = (function () {
  972. var obj = Object.create(null);
  973. return !('__proto__' in obj);
  974. }());
  975. function identity (s) {
  976. return s;
  977. }
  978. /**
  979. * Because behavior goes wacky when you set `__proto__` on objects, we
  980. * have to prefix all the strings in our set with an arbitrary character.
  981. *
  982. * See https://github.com/mozilla/source-map/pull/31 and
  983. * https://github.com/mozilla/source-map/issues/30
  984. *
  985. * @param String aStr
  986. */
  987. function toSetString(aStr) {
  988. if (isProtoString(aStr)) {
  989. return '$' + aStr;
  990. }
  991. return aStr;
  992. }
  993. exports.toSetString = supportsNullProto ? identity : toSetString;
  994. function fromSetString(aStr) {
  995. if (isProtoString(aStr)) {
  996. return aStr.slice(1);
  997. }
  998. return aStr;
  999. }
  1000. exports.fromSetString = supportsNullProto ? identity : fromSetString;
  1001. function isProtoString(s) {
  1002. if (!s) {
  1003. return false;
  1004. }
  1005. var length = s.length;
  1006. if (length < 9 /* "__proto__".length */) {
  1007. return false;
  1008. }
  1009. if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
  1010. s.charCodeAt(length - 2) !== 95 /* '_' */ ||
  1011. s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
  1012. s.charCodeAt(length - 4) !== 116 /* 't' */ ||
  1013. s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
  1014. s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
  1015. s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
  1016. s.charCodeAt(length - 8) !== 95 /* '_' */ ||
  1017. s.charCodeAt(length - 9) !== 95 /* '_' */) {
  1018. return false;
  1019. }
  1020. for (var i = length - 10; i >= 0; i--) {
  1021. if (s.charCodeAt(i) !== 36 /* '$' */) {
  1022. return false;
  1023. }
  1024. }
  1025. return true;
  1026. }
  1027. /**
  1028. * Comparator between two mappings where the original positions are compared.
  1029. *
  1030. * Optionally pass in `true` as `onlyCompareGenerated` to consider two
  1031. * mappings with the same original source/line/column, but different generated
  1032. * line and column the same. Useful when searching for a mapping with a
  1033. * stubbed out mapping.
  1034. */
  1035. function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
  1036. var cmp = strcmp(mappingA.source, mappingB.source);
  1037. if (cmp !== 0) {
  1038. return cmp;
  1039. }
  1040. cmp = mappingA.originalLine - mappingB.originalLine;
  1041. if (cmp !== 0) {
  1042. return cmp;
  1043. }
  1044. cmp = mappingA.originalColumn - mappingB.originalColumn;
  1045. if (cmp !== 0 || onlyCompareOriginal) {
  1046. return cmp;
  1047. }
  1048. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  1049. if (cmp !== 0) {
  1050. return cmp;
  1051. }
  1052. cmp = mappingA.generatedLine - mappingB.generatedLine;
  1053. if (cmp !== 0) {
  1054. return cmp;
  1055. }
  1056. return strcmp(mappingA.name, mappingB.name);
  1057. }
  1058. exports.compareByOriginalPositions = compareByOriginalPositions;
  1059. /**
  1060. * Comparator between two mappings with deflated source and name indices where
  1061. * the generated positions are compared.
  1062. *
  1063. * Optionally pass in `true` as `onlyCompareGenerated` to consider two
  1064. * mappings with the same generated line and column, but different
  1065. * source/name/original line and column the same. Useful when searching for a
  1066. * mapping with a stubbed out mapping.
  1067. */
  1068. function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
  1069. var cmp = mappingA.generatedLine - mappingB.generatedLine;
  1070. if (cmp !== 0) {
  1071. return cmp;
  1072. }
  1073. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  1074. if (cmp !== 0 || onlyCompareGenerated) {
  1075. return cmp;
  1076. }
  1077. cmp = strcmp(mappingA.source, mappingB.source);
  1078. if (cmp !== 0) {
  1079. return cmp;
  1080. }
  1081. cmp = mappingA.originalLine - mappingB.originalLine;
  1082. if (cmp !== 0) {
  1083. return cmp;
  1084. }
  1085. cmp = mappingA.originalColumn - mappingB.originalColumn;
  1086. if (cmp !== 0) {
  1087. return cmp;
  1088. }
  1089. return strcmp(mappingA.name, mappingB.name);
  1090. }
  1091. exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
  1092. function strcmp(aStr1, aStr2) {
  1093. if (aStr1 === aStr2) {
  1094. return 0;
  1095. }
  1096. if (aStr1 === null) {
  1097. return 1; // aStr2 !== null
  1098. }
  1099. if (aStr2 === null) {
  1100. return -1; // aStr1 !== null
  1101. }
  1102. if (aStr1 > aStr2) {
  1103. return 1;
  1104. }
  1105. return -1;
  1106. }
  1107. /**
  1108. * Comparator between two mappings with inflated source and name strings where
  1109. * the generated positions are compared.
  1110. */
  1111. function compareByGeneratedPositionsInflated(mappingA, mappingB) {
  1112. var cmp = mappingA.generatedLine - mappingB.generatedLine;
  1113. if (cmp !== 0) {
  1114. return cmp;
  1115. }
  1116. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  1117. if (cmp !== 0) {
  1118. return cmp;
  1119. }
  1120. cmp = strcmp(mappingA.source, mappingB.source);
  1121. if (cmp !== 0) {
  1122. return cmp;
  1123. }
  1124. cmp = mappingA.originalLine - mappingB.originalLine;
  1125. if (cmp !== 0) {
  1126. return cmp;
  1127. }
  1128. cmp = mappingA.originalColumn - mappingB.originalColumn;
  1129. if (cmp !== 0) {
  1130. return cmp;
  1131. }
  1132. return strcmp(mappingA.name, mappingB.name);
  1133. }
  1134. exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
  1135. /**
  1136. * Strip any JSON XSSI avoidance prefix from the string (as documented
  1137. * in the source maps specification), and then parse the string as
  1138. * JSON.
  1139. */
  1140. function parseSourceMapInput(str) {
  1141. return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
  1142. }
  1143. exports.parseSourceMapInput = parseSourceMapInput;
  1144. /**
  1145. * Compute the URL of a source given the the source root, the source's
  1146. * URL, and the source map's URL.
  1147. */
  1148. function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
  1149. sourceURL = sourceURL || '';
  1150. if (sourceRoot) {
  1151. // This follows what Chrome does.
  1152. if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {
  1153. sourceRoot += '/';
  1154. }
  1155. // The spec says:
  1156. // Line 4: An optional source root, useful for relocating source
  1157. // files on a server or removing repeated values in the
  1158. // “sources” entry. This value is prepended to the individual
  1159. // entries in the “source” field.
  1160. sourceURL = sourceRoot + sourceURL;
  1161. }
  1162. // Historically, SourceMapConsumer did not take the sourceMapURL as
  1163. // a parameter. This mode is still somewhat supported, which is why
  1164. // this code block is conditional. However, it's preferable to pass
  1165. // the source map URL to SourceMapConsumer, so that this function
  1166. // can implement the source URL resolution algorithm as outlined in
  1167. // the spec. This block is basically the equivalent of:
  1168. // new URL(sourceURL, sourceMapURL).toString()
  1169. // ... except it avoids using URL, which wasn't available in the
  1170. // older releases of node still supported by this library.
  1171. //
  1172. // The spec says:
  1173. // If the sources are not absolute URLs after prepending of the
  1174. // “sourceRoot”, the sources are resolved relative to the
  1175. // SourceMap (like resolving script src in a html document).
  1176. if (sourceMapURL) {
  1177. var parsed = urlParse(sourceMapURL);
  1178. if (!parsed) {
  1179. throw new Error("sourceMapURL could not be parsed");
  1180. }
  1181. if (parsed.path) {
  1182. // Strip the last path component, but keep the "/".
  1183. var index = parsed.path.lastIndexOf('/');
  1184. if (index >= 0) {
  1185. parsed.path = parsed.path.substring(0, index + 1);
  1186. }
  1187. }
  1188. sourceURL = join(urlGenerate(parsed), sourceURL);
  1189. }
  1190. return normalize(sourceURL);
  1191. }
  1192. exports.computeSourceURL = computeSourceURL;
  1193. /***/ }),
  1194. /* 9 */
  1195. /***/ (function(module, exports, __webpack_require__) {
  1196. "use strict";
  1197. exports.__esModule = true;
  1198. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1199. var _node = __webpack_require__(6);
  1200. var _node2 = _interopRequireDefault(_node);
  1201. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1202. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1203. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1204. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1205. var Namespace = function (_Node) {
  1206. _inherits(Namespace, _Node);
  1207. function Namespace() {
  1208. _classCallCheck(this, Namespace);
  1209. return _possibleConstructorReturn(this, _Node.apply(this, arguments));
  1210. }
  1211. Namespace.prototype.toString = function toString() {
  1212. return [this.spaces.before, this.ns, String(this.value), this.spaces.after].join('');
  1213. };
  1214. _createClass(Namespace, [{
  1215. key: 'ns',
  1216. get: function get() {
  1217. var n = this.namespace;
  1218. return n ? (typeof n === 'string' ? n : '') + '|' : '';
  1219. }
  1220. }]);
  1221. return Namespace;
  1222. }(_node2.default);
  1223. exports.default = Namespace;
  1224. ;
  1225. module.exports = exports['default'];
  1226. /***/ }),
  1227. /* 10 */
  1228. /***/ (function(module, exports, __webpack_require__) {
  1229. "use strict";
  1230. exports.__esModule = true;
  1231. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1232. var _container = __webpack_require__(25);
  1233. var _container2 = _interopRequireDefault(_container);
  1234. var _warnOnce = __webpack_require__(4);
  1235. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  1236. var _list = __webpack_require__(154);
  1237. var _list2 = _interopRequireDefault(_list);
  1238. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1239. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1240. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1241. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1242. /**
  1243. * Represents a CSS rule: a selector followed by a declaration block.
  1244. *
  1245. * @extends Container
  1246. *
  1247. * @example
  1248. * const root = postcss.parse('a{}');
  1249. * const rule = root.first;
  1250. * rule.type //=> 'rule'
  1251. * rule.toString() //=> 'a{}'
  1252. */
  1253. var Rule = function (_Container) {
  1254. _inherits(Rule, _Container);
  1255. function Rule(defaults) {
  1256. _classCallCheck(this, Rule);
  1257. var _this = _possibleConstructorReturn(this, _Container.call(this, defaults));
  1258. _this.type = 'rule';
  1259. if (!_this.nodes) _this.nodes = [];
  1260. return _this;
  1261. }
  1262. /**
  1263. * An array containing the rule’s individual selectors.
  1264. * Groups of selectors are split at commas.
  1265. *
  1266. * @type {string[]}
  1267. *
  1268. * @example
  1269. * const root = postcss.parse('a, b { }');
  1270. * const rule = root.first;
  1271. *
  1272. * rule.selector //=> 'a, b'
  1273. * rule.selectors //=> ['a', 'b']
  1274. *
  1275. * rule.selectors = ['a', 'strong'];
  1276. * rule.selector //=> 'a, strong'
  1277. */
  1278. _createClass(Rule, [{
  1279. key: 'selectors',
  1280. get: function get() {
  1281. return _list2.default.comma(this.selector);
  1282. },
  1283. set: function set(values) {
  1284. var match = this.selector ? this.selector.match(/,\s*/) : null;
  1285. var sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen');
  1286. this.selector = values.join(sep);
  1287. }
  1288. }, {
  1289. key: '_selector',
  1290. get: function get() {
  1291. (0, _warnOnce2.default)('Rule#_selector is deprecated. Use Rule#raws.selector');
  1292. return this.raws.selector;
  1293. },
  1294. set: function set(val) {
  1295. (0, _warnOnce2.default)('Rule#_selector is deprecated. Use Rule#raws.selector');
  1296. this.raws.selector = val;
  1297. }
  1298. /**
  1299. * @memberof Rule#
  1300. * @member {string} selector - the rule’s full selector represented
  1301. * as a string
  1302. *
  1303. * @example
  1304. * const root = postcss.parse('a, b { }');
  1305. * const rule = root.first;
  1306. * rule.selector //=> 'a, b'
  1307. */
  1308. /**
  1309. * @memberof Rule#
  1310. * @member {object} raws - Information to generate byte-to-byte equal
  1311. * node string as it was in the origin input.
  1312. *
  1313. * Every parser saves its own properties,
  1314. * but the default CSS parser uses:
  1315. *
  1316. * * `before`: the space symbols before the node. It also stores `*`
  1317. * and `_` symbols before the declaration (IE hack).
  1318. * * `after`: the space symbols after the last child of the node
  1319. * to the end of the node.
  1320. * * `between`: the symbols between the property and value
  1321. * for declarations, selector and `{` for rules, or last parameter
  1322. * and `{` for at-rules.
  1323. * * `semicolon`: contains true if the last child has
  1324. * an (optional) semicolon.
  1325. *
  1326. * PostCSS cleans selectors from comments and extra spaces,
  1327. * but it stores origin content in raws properties.
  1328. * As such, if you don’t change a declaration’s value,
  1329. * PostCSS will use the raw value with comments.
  1330. *
  1331. * @example
  1332. * const root = postcss.parse('a {\n color:black\n}')
  1333. * root.first.first.raws //=> { before: '', between: ' ', after: '\n' }
  1334. */
  1335. }]);
  1336. return Rule;
  1337. }(_container2.default);
  1338. exports.default = Rule;
  1339. module.exports = exports['default'];
  1340. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJ1bGUuZXM2Il0sIm5hbWVzIjpbIlJ1bGUiLCJkZWZhdWx0cyIsInR5cGUiLCJub2RlcyIsImNvbW1hIiwic2VsZWN0b3IiLCJ2YWx1ZXMiLCJtYXRjaCIsInNlcCIsInJhdyIsImpvaW4iLCJyYXdzIiwidmFsIl0sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQTs7OztBQUNBOzs7O0FBQ0E7Ozs7Ozs7Ozs7OztBQUVBOzs7Ozs7Ozs7OztJQVdNQSxJOzs7QUFFRixrQkFBWUMsUUFBWixFQUFzQjtBQUFBOztBQUFBLHFEQUNsQixzQkFBTUEsUUFBTixDQURrQjs7QUFFbEIsY0FBS0MsSUFBTCxHQUFZLE1BQVo7QUFDQSxZQUFLLENBQUMsTUFBS0MsS0FBWCxFQUFtQixNQUFLQSxLQUFMLEdBQWEsRUFBYjtBQUhEO0FBSXJCOztBQUVEOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs0QkFnQmdCO0FBQ1osbUJBQU8sZUFBS0MsS0FBTCxDQUFXLEtBQUtDLFFBQWhCLENBQVA7QUFDSCxTOzBCQUVhQyxNLEVBQVE7QUFDbEIsZ0JBQUlDLFFBQVEsS0FBS0YsUUFBTCxHQUFnQixLQUFLQSxRQUFMLENBQWNFLEtBQWQsQ0FBb0IsTUFBcEIsQ0FBaEIsR0FBOEMsSUFBMUQ7QUFDQSxnQkFBSUMsTUFBUUQsUUFBUUEsTUFBTSxDQUFOLENBQVIsR0FBbUIsTUFBTSxLQUFLRSxHQUFMLENBQVMsU0FBVCxFQUFvQixZQUFwQixDQUFyQztBQUNBLGlCQUFLSixRQ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KCdhIHtcXG4gIGNvbG9yOmJsYWNrXFxufScpXG4gICAgICogcm9vdC5maXJzdC5maXJzdC5yYXdzIC8vPT4geyBiZWZvcmU6ICcnLCBiZXR3ZWVuOiAnICcsIGFmdGVyOiAnXFxuJyB9XG4gICAgICovXG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgUnVsZTtcbiJdfQ==
  1341. /***/ }),
  1342. /* 11 */
  1343. /***/ (function(module, exports) {
  1344. /* -*- Mode: js; js-indent-level: 2; -*- */
  1345. /*
  1346. * Copyright 2011 Mozilla Foundation and contributors
  1347. * Licensed under the New BSD license. See LICENSE or:
  1348. * http://opensource.org/licenses/BSD-3-Clause
  1349. */
  1350. /**
  1351. * This is a helper function for getting values from parameter/options
  1352. * objects.
  1353. *
  1354. * @param args The object we are extracting values from
  1355. * @param name The name of the property we are getting.
  1356. * @param defaultValue An optional value to return if the property is missing
  1357. * from the object. If this is not specified and the property is missing, an
  1358. * error will be thrown.
  1359. */
  1360. function getArg(aArgs, aName, aDefaultValue) {
  1361. if (aName in aArgs) {
  1362. return aArgs[aName];
  1363. } else if (arguments.length === 3) {
  1364. return aDefaultValue;
  1365. } else {
  1366. throw new Error('"' + aName + '" is a required argument.');
  1367. }
  1368. }
  1369. exports.getArg = getArg;
  1370. var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
  1371. var dataUrlRegexp = /^data:.+\,.+$/;
  1372. function urlParse(aUrl) {
  1373. var match = aUrl.match(urlRegexp);
  1374. if (!match) {
  1375. return null;
  1376. }
  1377. return {
  1378. scheme: match[1],
  1379. auth: match[2],
  1380. host: match[3],
  1381. port: match[4],
  1382. path: match[5]
  1383. };
  1384. }
  1385. exports.urlParse = urlParse;
  1386. function urlGenerate(aParsedUrl) {
  1387. var url = '';
  1388. if (aParsedUrl.scheme) {
  1389. url += aParsedUrl.scheme + ':';
  1390. }
  1391. url += '//';
  1392. if (aParsedUrl.auth) {
  1393. url += aParsedUrl.auth + '@';
  1394. }
  1395. if (aParsedUrl.host) {
  1396. url += aParsedUrl.host;
  1397. }
  1398. if (aParsedUrl.port) {
  1399. url += ":" + aParsedUrl.port
  1400. }
  1401. if (aParsedUrl.path) {
  1402. url += aParsedUrl.path;
  1403. }
  1404. return url;
  1405. }
  1406. exports.urlGenerate = urlGenerate;
  1407. /**
  1408. * Normalizes a path, or the path portion of a URL:
  1409. *
  1410. * - Replaces consecutive slashes with one slash.
  1411. * - Removes unnecessary '.' parts.
  1412. * - Removes unnecessary '<dir>/..' parts.
  1413. *
  1414. * Based on code in the Node.js 'path' core module.
  1415. *
  1416. * @param aPath The path or url to normalize.
  1417. */
  1418. function normalize(aPath) {
  1419. var path = aPath;
  1420. var url = urlParse(aPath);
  1421. if (url) {
  1422. if (!url.path) {
  1423. return aPath;
  1424. }
  1425. path = url.path;
  1426. }
  1427. var isAbsolute = exports.isAbsolute(path);
  1428. var parts = path.split(/\/+/);
  1429. for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
  1430. part = parts[i];
  1431. if (part === '.') {
  1432. parts.splice(i, 1);
  1433. } else if (part === '..') {
  1434. up++;
  1435. } else if (up > 0) {
  1436. if (part === '') {
  1437. // The first part is blank if the path is absolute. Trying to go
  1438. // above the root is a no-op. Therefore we can remove all '..' parts
  1439. // directly after the root.
  1440. parts.splice(i + 1, up);
  1441. up = 0;
  1442. } else {
  1443. parts.splice(i, 2);
  1444. up--;
  1445. }
  1446. }
  1447. }
  1448. path = parts.join('/');
  1449. if (path === '') {
  1450. path = isAbsolute ? '/' : '.';
  1451. }
  1452. if (url) {
  1453. url.path = path;
  1454. return urlGenerate(url);
  1455. }
  1456. return path;
  1457. }
  1458. exports.normalize = normalize;
  1459. /**
  1460. * Joins two paths/URLs.
  1461. *
  1462. * @param aRoot The root path or URL.
  1463. * @param aPath The path or URL to be joined with the root.
  1464. *
  1465. * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
  1466. * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
  1467. * first.
  1468. * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
  1469. * is updated with the result and aRoot is returned. Otherwise the result
  1470. * is returned.
  1471. * - If aPath is absolute, the result is aPath.
  1472. * - Otherwise the two paths are joined with a slash.
  1473. * - Joining for example 'http://' and 'www.example.com' is also supported.
  1474. */
  1475. function join(aRoot, aPath) {
  1476. if (aRoot === "") {
  1477. aRoot = ".";
  1478. }
  1479. if (aPath === "") {
  1480. aPath = ".";
  1481. }
  1482. var aPathUrl = urlParse(aPath);
  1483. var aRootUrl = urlParse(aRoot);
  1484. if (aRootUrl) {
  1485. aRoot = aRootUrl.path || '/';
  1486. }
  1487. // `join(foo, '//www.example.org')`
  1488. if (aPathUrl && !aPathUrl.scheme) {
  1489. if (aRootUrl) {
  1490. aPathUrl.scheme = aRootUrl.scheme;
  1491. }
  1492. return urlGenerate(aPathUrl);
  1493. }
  1494. if (aPathUrl || aPath.match(dataUrlRegexp)) {
  1495. return aPath;
  1496. }
  1497. // `join('http://', 'www.example.com')`
  1498. if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
  1499. aRootUrl.host = aPath;
  1500. return urlGenerate(aRootUrl);
  1501. }
  1502. var joined = aPath.charAt(0) === '/'
  1503. ? aPath
  1504. : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
  1505. if (aRootUrl) {
  1506. aRootUrl.path = joined;
  1507. return urlGenerate(aRootUrl);
  1508. }
  1509. return joined;
  1510. }
  1511. exports.join = join;
  1512. exports.isAbsolute = function (aPath) {
  1513. return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);
  1514. };
  1515. /**
  1516. * Make a path relative to a URL or another path.
  1517. *
  1518. * @param aRoot The root path or URL.
  1519. * @param aPath The path or URL to be made relative to aRoot.
  1520. */
  1521. function relative(aRoot, aPath) {
  1522. if (aRoot === "") {
  1523. aRoot = ".";
  1524. }
  1525. aRoot = aRoot.replace(/\/$/, '');
  1526. // It is possible for the path to be above the root. In this case, simply
  1527. // checking whether the root is a prefix of the path won't work. Instead, we
  1528. // need to remove components from the root one by one, until either we find
  1529. // a prefix that fits, or we run out of components to remove.
  1530. var level = 0;
  1531. while (aPath.indexOf(aRoot + '/') !== 0) {
  1532. var index = aRoot.lastIndexOf("/");
  1533. if (index < 0) {
  1534. return aPath;
  1535. }
  1536. // If the only part of the root that is left is the scheme (i.e. http://,
  1537. // file:///, etc.), one or more slashes (/), or simply nothing at all, we
  1538. // have exhausted all components, so the path is not relative to the root.
  1539. aRoot = aRoot.slice(0, index);
  1540. if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
  1541. return aPath;
  1542. }
  1543. ++level;
  1544. }
  1545. // Make sure we add a "../" for each component we removed from the root.
  1546. return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
  1547. }
  1548. exports.relative = relative;
  1549. var supportsNullProto = (function () {
  1550. var obj = Object.create(null);
  1551. return !('__proto__' in obj);
  1552. }());
  1553. function identity (s) {
  1554. return s;
  1555. }
  1556. /**
  1557. * Because behavior goes wacky when you set `__proto__` on objects, we
  1558. * have to prefix all the strings in our set with an arbitrary character.
  1559. *
  1560. * See https://github.com/mozilla/source-map/pull/31 and
  1561. * https://github.com/mozilla/source-map/issues/30
  1562. *
  1563. * @param String aStr
  1564. */
  1565. function toSetString(aStr) {
  1566. if (isProtoString(aStr)) {
  1567. return '$' + aStr;
  1568. }
  1569. return aStr;
  1570. }
  1571. exports.toSetString = supportsNullProto ? identity : toSetString;
  1572. function fromSetString(aStr) {
  1573. if (isProtoString(aStr)) {
  1574. return aStr.slice(1);
  1575. }
  1576. return aStr;
  1577. }
  1578. exports.fromSetString = supportsNullProto ? identity : fromSetString;
  1579. function isProtoString(s) {
  1580. if (!s) {
  1581. return false;
  1582. }
  1583. var length = s.length;
  1584. if (length < 9 /* "__proto__".length */) {
  1585. return false;
  1586. }
  1587. if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
  1588. s.charCodeAt(length - 2) !== 95 /* '_' */ ||
  1589. s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
  1590. s.charCodeAt(length - 4) !== 116 /* 't' */ ||
  1591. s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
  1592. s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
  1593. s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
  1594. s.charCodeAt(length - 8) !== 95 /* '_' */ ||
  1595. s.charCodeAt(length - 9) !== 95 /* '_' */) {
  1596. return false;
  1597. }
  1598. for (var i = length - 10; i >= 0; i--) {
  1599. if (s.charCodeAt(i) !== 36 /* '$' */) {
  1600. return false;
  1601. }
  1602. }
  1603. return true;
  1604. }
  1605. /**
  1606. * Comparator between two mappings where the original positions are compared.
  1607. *
  1608. * Optionally pass in `true` as `onlyCompareGenerated` to consider two
  1609. * mappings with the same original source/line/column, but different generated
  1610. * line and column the same. Useful when searching for a mapping with a
  1611. * stubbed out mapping.
  1612. */
  1613. function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
  1614. var cmp = mappingA.source - mappingB.source;
  1615. if (cmp !== 0) {
  1616. return cmp;
  1617. }
  1618. cmp = mappingA.originalLine - mappingB.originalLine;
  1619. if (cmp !== 0) {
  1620. return cmp;
  1621. }
  1622. cmp = mappingA.originalColumn - mappingB.originalColumn;
  1623. if (cmp !== 0 || onlyCompareOriginal) {
  1624. return cmp;
  1625. }
  1626. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  1627. if (cmp !== 0) {
  1628. return cmp;
  1629. }
  1630. cmp = mappingA.generatedLine - mappingB.generatedLine;
  1631. if (cmp !== 0) {
  1632. return cmp;
  1633. }
  1634. return mappingA.name - mappingB.name;
  1635. }
  1636. exports.compareByOriginalPositions = compareByOriginalPositions;
  1637. /**
  1638. * Comparator between two mappings with deflated source and name indices where
  1639. * the generated positions are compared.
  1640. *
  1641. * Optionally pass in `true` as `onlyCompareGenerated` to consider two
  1642. * mappings with the same generated line and column, but different
  1643. * source/name/original line and column the same. Useful when searching for a
  1644. * mapping with a stubbed out mapping.
  1645. */
  1646. function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
  1647. var cmp = mappingA.generatedLine - mappingB.generatedLine;
  1648. if (cmp !== 0) {
  1649. return cmp;
  1650. }
  1651. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  1652. if (cmp !== 0 || onlyCompareGenerated) {
  1653. return cmp;
  1654. }
  1655. cmp = mappingA.source - mappingB.source;
  1656. if (cmp !== 0) {
  1657. return cmp;
  1658. }
  1659. cmp = mappingA.originalLine - mappingB.originalLine;
  1660. if (cmp !== 0) {
  1661. return cmp;
  1662. }
  1663. cmp = mappingA.originalColumn - mappingB.originalColumn;
  1664. if (cmp !== 0) {
  1665. return cmp;
  1666. }
  1667. return mappingA.name - mappingB.name;
  1668. }
  1669. exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
  1670. function strcmp(aStr1, aStr2) {
  1671. if (aStr1 === aStr2) {
  1672. return 0;
  1673. }
  1674. if (aStr1 > aStr2) {
  1675. return 1;
  1676. }
  1677. return -1;
  1678. }
  1679. /**
  1680. * Comparator between two mappings with inflated source and name strings where
  1681. * the generated positions are compared.
  1682. */
  1683. function compareByGeneratedPositionsInflated(mappingA, mappingB) {
  1684. var cmp = mappingA.generatedLine - mappingB.generatedLine;
  1685. if (cmp !== 0) {
  1686. return cmp;
  1687. }
  1688. cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  1689. if (cmp !== 0) {
  1690. return cmp;
  1691. }
  1692. cmp = strcmp(mappingA.source, mappingB.source);
  1693. if (cmp !== 0) {
  1694. return cmp;
  1695. }
  1696. cmp = mappingA.originalLine - mappingB.originalLine;
  1697. if (cmp !== 0) {
  1698. return cmp;
  1699. }
  1700. cmp = mappingA.originalColumn - mappingB.originalColumn;
  1701. if (cmp !== 0) {
  1702. return cmp;
  1703. }
  1704. return strcmp(mappingA.name, mappingB.name);
  1705. }
  1706. exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
  1707. /***/ }),
  1708. /* 12 */
  1709. /***/ (function(module, exports, __webpack_require__) {
  1710. "use strict";
  1711. Object.defineProperty(exports, "__esModule", {
  1712. value: true
  1713. });
  1714. exports.default = lessStringify;
  1715. var _lessStringifier = __webpack_require__(108);
  1716. var _lessStringifier2 = _interopRequireDefault(_lessStringifier);
  1717. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1718. function lessStringify(node, builder) {
  1719. var str = new _lessStringifier2.default(builder);
  1720. str.stringify(node);
  1721. }
  1722. module.exports = exports['default'];
  1723. /***/ }),
  1724. /* 13 */
  1725. /***/ (function(module, exports, __webpack_require__) {
  1726. "use strict";
  1727. exports.__esModule = true;
  1728. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1729. var _declaration = __webpack_require__(39);
  1730. var _declaration2 = _interopRequireDefault(_declaration);
  1731. var _comment = __webpack_require__(17);
  1732. var _comment2 = _interopRequireDefault(_comment);
  1733. var _node = __webpack_require__(19);
  1734. var _node2 = _interopRequireDefault(_node);
  1735. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  1736. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1737. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1738. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1739. function cleanSource(nodes) {
  1740. return nodes.map(function (i) {
  1741. if (i.nodes) i.nodes = cleanSource(i.nodes);
  1742. delete i.source;
  1743. return i;
  1744. });
  1745. }
  1746. /**
  1747. * The {@link Root}, {@link AtRule}, and {@link Rule} container nodes
  1748. * inherit some common methods to help work with their children.
  1749. *
  1750. * Note that all containers can store any content. If you write a rule inside
  1751. * a rule, PostCSS will parse it.
  1752. *
  1753. * @extends Node
  1754. * @abstract
  1755. */
  1756. var Container = function (_Node) {
  1757. _inherits(Container, _Node);
  1758. function Container() {
  1759. _classCallCheck(this, Container);
  1760. return _possibleConstructorReturn(this, _Node.apply(this, arguments));
  1761. }
  1762. Container.prototype.push = function push(child) {
  1763. child.parent = this;
  1764. this.nodes.push(child);
  1765. return this;
  1766. };
  1767. /**
  1768. * Iterates through the container’s immediate children,
  1769. * calling `callback` for each child.
  1770. *
  1771. * Returning `false` in the callback will break iteration.
  1772. *
  1773. * This method only iterates through the container’s immediate children.
  1774. * If you need to recursively iterate through all the container’s descendant
  1775. * nodes, use {@link Container#walk}.
  1776. *
  1777. * Unlike the for `{}`-cycle or `Array#forEach` this iterator is safe
  1778. * if you are mutating the array of child nodes during iteration.
  1779. * PostCSS will adjust the current index to match the mutations.
  1780. *
  1781. * @param {childIterator} callback - iterator receives each node and index
  1782. *
  1783. * @return {false|undefined} returns `false` if iteration was broke
  1784. *
  1785. * @example
  1786. * const root = postcss.parse('a { color: black; z-index: 1 }');
  1787. * const rule = root.first;
  1788. *
  1789. * for ( let decl of rule.nodes ) {
  1790. * decl.cloneBefore({ prop: '-webkit-' + decl.prop });
  1791. * // Cycle will be infinite, because cloneBefore moves the current node
  1792. * // to the next index
  1793. * }
  1794. *
  1795. * rule.each(decl => {
  1796. * decl.cloneBefore({ prop: '-webkit-' + decl.prop });
  1797. * // Will be executed only for color and z-index
  1798. * });
  1799. */
  1800. Container.prototype.each = function each(callback) {
  1801. if (!this.lastEach) this.lastEach = 0;
  1802. if (!this.indexes) this.indexes = {};
  1803. this.lastEach += 1;
  1804. var id = this.lastEach;
  1805. this.indexes[id] = 0;
  1806. if (!this.nodes) return undefined;
  1807. var index = void 0,
  1808. result = void 0;
  1809. while (this.indexes[id] < this.nodes.length) {
  1810. index = this.indexes[id];
  1811. result = callback(this.nodes[index], index);
  1812. if (result === false) break;
  1813. this.indexes[id] += 1;
  1814. }
  1815. delete this.indexes[id];
  1816. return result;
  1817. };
  1818. /**
  1819. * Traverses the container’s descendant nodes, calling callback
  1820. * for each node.
  1821. *
  1822. * Like container.each(), this method is safe to use
  1823. * if you are mutating arrays during iteration.
  1824. *
  1825. * If you only need to iterate through the container’s immediate children,
  1826. * use {@link Container#each}.
  1827. *
  1828. * @param {childIterator} callback - iterator receives each node and index
  1829. *
  1830. * @return {false|undefined} returns `false` if iteration was broke
  1831. *
  1832. * @example
  1833. * root.walk(node => {
  1834. * // Traverses all descendant nodes.
  1835. * });
  1836. */
  1837. Container.prototype.walk = function walk(callback) {
  1838. return this.each(function (child, i) {
  1839. var result = callback(child, i);
  1840. if (result !== false && child.walk) {
  1841. result = child.walk(callback);
  1842. }
  1843. return result;
  1844. });
  1845. };
  1846. /**
  1847. * Traverses the container’s descendant nodes, calling callback
  1848. * for each declaration node.
  1849. *
  1850. * If you pass a filter, iteration will only happen over declarations
  1851. * with matching properties.
  1852. *
  1853. * Like {@link Container#each}, this method is safe
  1854. * to use if you are mutating arrays during iteration.
  1855. *
  1856. * @param {string|RegExp} [prop] - string or regular expression
  1857. * to filter declarations by property name
  1858. * @param {childIterator} callback - iterator receives each node and index
  1859. *
  1860. * @return {false|undefined} returns `false` if iteration was broke
  1861. *
  1862. * @example
  1863. * root.walkDecls(decl => {
  1864. * checkPropertySupport(decl.prop);
  1865. * });
  1866. *
  1867. * root.walkDecls('border-radius', decl => {
  1868. * decl.remove();
  1869. * });
  1870. *
  1871. * root.walkDecls(/^background/, decl => {
  1872. * decl.value = takeFirstColorFromGradient(decl.value);
  1873. * });
  1874. */
  1875. Container.prototype.walkDecls = function walkDecls(prop, callback) {
  1876. if (!callback) {
  1877. callback = prop;
  1878. return this.walk(function (child, i) {
  1879. if (child.type === 'decl') {
  1880. return callback(child, i);
  1881. }
  1882. });
  1883. } else if (prop instanceof RegExp) {
  1884. return this.walk(function (child, i) {
  1885. if (child.type === 'decl' && prop.test(child.prop)) {
  1886. return callback(child, i);
  1887. }
  1888. });
  1889. } else {
  1890. return this.walk(function (child, i) {
  1891. if (child.type === 'decl' && child.prop === prop) {
  1892. return callback(child, i);
  1893. }
  1894. });
  1895. }
  1896. };
  1897. /**
  1898. * Traverses the container’s descendant nodes, calling callback
  1899. * for each rule node.
  1900. *
  1901. * If you pass a filter, iteration will only happen over rules
  1902. * with matching selectors.
  1903. *
  1904. * Like {@link Container#each}, this method is safe
  1905. * to use if you are mutating arrays during iteration.
  1906. *
  1907. * @param {string|RegExp} [selector] - string or regular expression
  1908. * to filter rules by selector
  1909. * @param {childIterator} callback - iterator receives each node and index
  1910. *
  1911. * @return {false|undefined} returns `false` if iteration was broke
  1912. *
  1913. * @example
  1914. * const selectors = [];
  1915. * root.walkRules(rule => {
  1916. * selectors.push(rule.selector);
  1917. * });
  1918. * console.log(`Your CSS uses ${selectors.length} selectors`);
  1919. */
  1920. Container.prototype.walkRules = function walkRules(selector, callback) {
  1921. if (!callback) {
  1922. callback = selector;
  1923. return this.walk(function (child, i) {
  1924. if (child.type === 'rule') {
  1925. return callback(child, i);
  1926. }
  1927. });
  1928. } else if (selector instanceof RegExp) {
  1929. return this.walk(function (child, i) {
  1930. if (child.type === 'rule' && selector.test(child.selector)) {
  1931. return callback(child, i);
  1932. }
  1933. });
  1934. } else {
  1935. return this.walk(function (child, i) {
  1936. if (child.type === 'rule' && child.selector === selector) {
  1937. return callback(child, i);
  1938. }
  1939. });
  1940. }
  1941. };
  1942. /**
  1943. * Traverses the container’s descendant nodes, calling callback
  1944. * for each at-rule node.
  1945. *
  1946. * If you pass a filter, iteration will only happen over at-rules
  1947. * that have matching names.
  1948. *
  1949. * Like {@link Container#each}, this method is safe
  1950. * to use if you are mutating arrays during iteration.
  1951. *
  1952. * @param {string|RegExp} [name] - string or regular expression
  1953. * to filter at-rules by name
  1954. * @param {childIterator} callback - iterator receives each node and index
  1955. *
  1956. * @return {false|undefined} returns `false` if iteration was broke
  1957. *
  1958. * @example
  1959. * root.walkAtRules(rule => {
  1960. * if ( isOld(rule.name) ) rule.remove();
  1961. * });
  1962. *
  1963. * let first = false;
  1964. * root.walkAtRules('charset', rule => {
  1965. * if ( !first ) {
  1966. * first = true;
  1967. * } else {
  1968. * rule.remove();
  1969. * }
  1970. * });
  1971. */
  1972. Container.prototype.walkAtRules = function walkAtRules(name, callback) {
  1973. if (!callback) {
  1974. callback = name;
  1975. return this.walk(function (child, i) {
  1976. if (child.type === 'atrule') {
  1977. return callback(child, i);
  1978. }
  1979. });
  1980. } else if (name instanceof RegExp) {
  1981. return this.walk(function (child, i) {
  1982. if (child.type === 'atrule' && name.test(child.name)) {
  1983. return callback(child, i);
  1984. }
  1985. });
  1986. } else {
  1987. return this.walk(function (child, i) {
  1988. if (child.type === 'atrule' && child.name === name) {
  1989. return callback(child, i);
  1990. }
  1991. });
  1992. }
  1993. };
  1994. /**
  1995. * Traverses the container’s descendant nodes, calling callback
  1996. * for each comment node.
  1997. *
  1998. * Like {@link Container#each}, this method is safe
  1999. * to use if you are mutating arrays during iteration.
  2000. *
  2001. * @param {childIterator} callback - iterator receives each node and index
  2002. *
  2003. * @return {false|undefined} returns `false` if iteration was broke
  2004. *
  2005. * @example
  2006. * root.walkComments(comment => {
  2007. * comment.remove();
  2008. * });
  2009. */
  2010. Container.prototype.walkComments = function walkComments(callback) {
  2011. return this.walk(function (child, i) {
  2012. if (child.type === 'comment') {
  2013. return callback(child, i);
  2014. }
  2015. });
  2016. };
  2017. /**
  2018. * Inserts new nodes to the end of the container.
  2019. *
  2020. * @param {...(Node|object|string|Node[])} children - new nodes
  2021. *
  2022. * @return {Node} this node for methods chain
  2023. *
  2024. * @example
  2025. * const decl1 = postcss.decl({ prop: 'color', value: 'black' });
  2026. * const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
  2027. * rule.append(decl1, decl2);
  2028. *
  2029. * root.append({ name: 'charset', params: '"UTF-8"' }); // at-rule
  2030. * root.append({ selector: 'a' }); // rule
  2031. * rule.append({ prop: 'color', value: 'black' }); // declaration
  2032. * rule.append({ text: 'Comment' }) // comment
  2033. *
  2034. * root.append('a {}');
  2035. * root.first.append('color: black; z-index: 1');
  2036. */
  2037. Container.prototype.append = function append() {
  2038. for (var _len = arguments.length, children = Array(_len), _key = 0; _key < _len; _key++) {
  2039. children[_key] = arguments[_key];
  2040. }
  2041. for (var _iterator = children, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  2042. var _ref;
  2043. if (_isArray) {
  2044. if (_i >= _iterator.length) break;
  2045. _ref = _iterator[_i++];
  2046. } else {
  2047. _i = _iterator.next();
  2048. if (_i.done) break;
  2049. _ref = _i.value;
  2050. }
  2051. var child = _ref;
  2052. var nodes = this.normalize(child, this.last);
  2053. for (var _iterator2 = nodes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
  2054. var _ref2;
  2055. if (_isArray2) {
  2056. if (_i2 >= _iterator2.length) break;
  2057. _ref2 = _iterator2[_i2++];
  2058. } else {
  2059. _i2 = _iterator2.next();
  2060. if (_i2.done) break;
  2061. _ref2 = _i2.value;
  2062. }
  2063. var node = _ref2;
  2064. this.nodes.push(node);
  2065. }
  2066. }
  2067. return this;
  2068. };
  2069. /**
  2070. * Inserts new nodes to the start of the container.
  2071. *
  2072. * @param {...(Node|object|string|Node[])} children - new nodes
  2073. *
  2074. * @return {Node} this node for methods chain
  2075. *
  2076. * @example
  2077. * const decl1 = postcss.decl({ prop: 'color', value: 'black' });
  2078. * const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
  2079. * rule.prepend(decl1, decl2);
  2080. *
  2081. * root.append({ name: 'charset', params: '"UTF-8"' }); // at-rule
  2082. * root.append({ selector: 'a' }); // rule
  2083. * rule.append({ prop: 'color', value: 'black' }); // declaration
  2084. * rule.append({ text: 'Comment' }) // comment
  2085. *
  2086. * root.append('a {}');
  2087. * root.first.append('color: black; z-index: 1');
  2088. */
  2089. Container.prototype.prepend = function prepend() {
  2090. for (var _len2 = arguments.length, children = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  2091. children[_key2] = arguments[_key2];
  2092. }
  2093. children = children.reverse();
  2094. for (var _iterator3 = children, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
  2095. var _ref3;
  2096. if (_isArray3) {
  2097. if (_i3 >= _iterator3.length) break;
  2098. _ref3 = _iterator3[_i3++];
  2099. } else {
  2100. _i3 = _iterator3.next();
  2101. if (_i3.done) break;
  2102. _ref3 = _i3.value;
  2103. }
  2104. var child = _ref3;
  2105. var nodes = this.normalize(child, this.first, 'prepend').reverse();
  2106. for (var _iterator4 = nodes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
  2107. var _ref4;
  2108. if (_isArray4) {
  2109. if (_i4 >= _iterator4.length) break;
  2110. _ref4 = _iterator4[_i4++];
  2111. } else {
  2112. _i4 = _iterator4.next();
  2113. if (_i4.done) break;
  2114. _ref4 = _i4.value;
  2115. }
  2116. var node = _ref4;
  2117. this.nodes.unshift(node);
  2118. }for (var id in this.indexes) {
  2119. this.indexes[id] = this.indexes[id] + nodes.length;
  2120. }
  2121. }
  2122. return this;
  2123. };
  2124. Container.prototype.cleanRaws = function cleanRaws(keepBetween) {
  2125. _Node.prototype.cleanRaws.call(this, keepBetween);
  2126. if (this.nodes) {
  2127. for (var _iterator5 = this.nodes, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
  2128. var _ref5;
  2129. if (_isArray5) {
  2130. if (_i5 >= _iterator5.length) break;
  2131. _ref5 = _iterator5[_i5++];
  2132. } else {
  2133. _i5 = _iterator5.next();
  2134. if (_i5.done) break;
  2135. _ref5 = _i5.value;
  2136. }
  2137. var node = _ref5;
  2138. node.cleanRaws(keepBetween);
  2139. }
  2140. }
  2141. };
  2142. /**
  2143. * Insert new node before old node within the container.
  2144. *
  2145. * @param {Node|number} exist - child or child’s index.
  2146. * @param {Node|object|string|Node[]} add - new node
  2147. *
  2148. * @return {Node} this node for methods chain
  2149. *
  2150. * @example
  2151. * rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }));
  2152. */
  2153. Container.prototype.insertBefore = function insertBefore(exist, add) {
  2154. exist = this.index(exist);
  2155. var type = exist === 0 ? 'prepend' : false;
  2156. var nodes = this.normalize(add, this.nodes[exist], type).reverse();
  2157. for (var _iterator6 = nodes, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
  2158. var _ref6;
  2159. if (_isArray6) {
  2160. if (_i6 >= _iterator6.length) break;
  2161. _ref6 = _iterator6[_i6++];
  2162. } else {
  2163. _i6 = _iterator6.next();
  2164. if (_i6.done) break;
  2165. _ref6 = _i6.value;
  2166. }
  2167. var node = _ref6;
  2168. this.nodes.splice(exist, 0, node);
  2169. }var index = void 0;
  2170. for (var id in this.indexes) {
  2171. index = this.indexes[id];
  2172. if (exist <= index) {
  2173. this.indexes[id] = index + nodes.length;
  2174. }
  2175. }
  2176. return this;
  2177. };
  2178. /**
  2179. * Insert new node after old node within the container.
  2180. *
  2181. * @param {Node|number} exist - child or child’s index
  2182. * @param {Node|object|string|Node[]} add - new node
  2183. *
  2184. * @return {Node} this node for methods chain
  2185. */
  2186. Container.prototype.insertAfter = function insertAfter(exist, add) {
  2187. exist = this.index(exist);
  2188. var nodes = this.normalize(add, this.nodes[exist]).reverse();
  2189. for (var _iterator7 = nodes, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) {
  2190. var _ref7;
  2191. if (_isArray7) {
  2192. if (_i7 >= _iterator7.length) break;
  2193. _ref7 = _iterator7[_i7++];
  2194. } else {
  2195. _i7 = _iterator7.next();
  2196. if (_i7.done) break;
  2197. _ref7 = _i7.value;
  2198. }
  2199. var node = _ref7;
  2200. this.nodes.splice(exist + 1, 0, node);
  2201. }var index = void 0;
  2202. for (var id in this.indexes) {
  2203. index = this.indexes[id];
  2204. if (exist < index) {
  2205. this.indexes[id] = index + nodes.length;
  2206. }
  2207. }
  2208. return this;
  2209. };
  2210. /**
  2211. * Removes node from the container and cleans the parent properties
  2212. * from the node and its children.
  2213. *
  2214. * @param {Node|number} child - child or child’s index
  2215. *
  2216. * @return {Node} this node for methods chain
  2217. *
  2218. * @example
  2219. * rule.nodes.length //=> 5
  2220. * rule.removeChild(decl);
  2221. * rule.nodes.length //=> 4
  2222. * decl.parent //=> undefined
  2223. */
  2224. Container.prototype.removeChild = function removeChild(child) {
  2225. child = this.index(child);
  2226. this.nodes[child].parent = undefined;
  2227. this.nodes.splice(child, 1);
  2228. var index = void 0;
  2229. for (var id in this.indexes) {
  2230. index = this.indexes[id];
  2231. if (index >= child) {
  2232. this.indexes[id] = index - 1;
  2233. }
  2234. }
  2235. return this;
  2236. };
  2237. /**
  2238. * Removes all children from the container
  2239. * and cleans their parent properties.
  2240. *
  2241. * @return {Node} this node for methods chain
  2242. *
  2243. * @example
  2244. * rule.removeAll();
  2245. * rule.nodes.length //=> 0
  2246. */
  2247. Container.prototype.removeAll = function removeAll() {
  2248. for (var _iterator8 = this.nodes, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) {
  2249. var _ref8;
  2250. if (_isArray8) {
  2251. if (_i8 >= _iterator8.length) break;
  2252. _ref8 = _iterator8[_i8++];
  2253. } else {
  2254. _i8 = _iterator8.next();
  2255. if (_i8.done) break;
  2256. _ref8 = _i8.value;
  2257. }
  2258. var node = _ref8;
  2259. node.parent = undefined;
  2260. }this.nodes = [];
  2261. return this;
  2262. };
  2263. /**
  2264. * Passes all declaration values within the container that match pattern
  2265. * through callback, replacing those values with the returned result
  2266. * of callback.
  2267. *
  2268. * This method is useful if you are using a custom unit or function
  2269. * and need to iterate through all values.
  2270. *
  2271. * @param {string|RegExp} pattern - replace pattern
  2272. * @param {object} opts - options to speed up the search
  2273. * @param {string|string[]} opts.props - an array of property names
  2274. * @param {string} opts.fast - string that’s used
  2275. * to narrow down values and speed up
  2276. the regexp search
  2277. * @param {function|string} callback - string to replace pattern
  2278. * or callback that returns a new
  2279. * value.
  2280. * The callback will receive
  2281. * the same arguments as those
  2282. * passed to a function parameter
  2283. * of `String#replace`.
  2284. *
  2285. * @return {Node} this node for methods chain
  2286. *
  2287. * @example
  2288. * root.replaceValues(/\d+rem/, { fast: 'rem' }, string => {
  2289. * return 15 * parseInt(string) + 'px';
  2290. * });
  2291. */
  2292. Container.prototype.replaceValues = function replaceValues(pattern, opts, callback) {
  2293. if (!callback) {
  2294. callback = opts;
  2295. opts = {};
  2296. }
  2297. this.walkDecls(function (decl) {
  2298. if (opts.props && opts.props.indexOf(decl.prop) === -1) return;
  2299. if (opts.fast && decl.value.indexOf(opts.fast) === -1) return;
  2300. decl.value = decl.value.replace(pattern, callback);
  2301. });
  2302. return this;
  2303. };
  2304. /**
  2305. * Returns `true` if callback returns `true`
  2306. * for all of the container’s children.
  2307. *
  2308. * @param {childCondition} condition - iterator returns true or false.
  2309. *
  2310. * @return {boolean} is every child pass condition
  2311. *
  2312. * @example
  2313. * const noPrefixes = rule.every(i => i.prop[0] !== '-');
  2314. */
  2315. Container.prototype.every = function every(condition) {
  2316. return this.nodes.every(condition);
  2317. };
  2318. /**
  2319. * Returns `true` if callback returns `true` for (at least) one
  2320. * of the container’s children.
  2321. *
  2322. * @param {childCondition} condition - iterator returns true or false.
  2323. *
  2324. * @return {boolean} is some child pass condition
  2325. *
  2326. * @example
  2327. * const hasPrefix = rule.some(i => i.prop[0] === '-');
  2328. */
  2329. Container.prototype.some = function some(condition) {
  2330. return this.nodes.some(condition);
  2331. };
  2332. /**
  2333. * Returns a `child`’s index within the {@link Container#nodes} array.
  2334. *
  2335. * @param {Node} child - child of the current container.
  2336. *
  2337. * @return {number} child index
  2338. *
  2339. * @example
  2340. * rule.index( rule.nodes[2] ) //=> 2
  2341. */
  2342. Container.prototype.index = function index(child) {
  2343. if (typeof child === 'number') {
  2344. return child;
  2345. } else {
  2346. return this.nodes.indexOf(child);
  2347. }
  2348. };
  2349. /**
  2350. * The container’s first child.
  2351. *
  2352. * @type {Node}
  2353. *
  2354. * @example
  2355. * rule.first == rules.nodes[0];
  2356. */
  2357. Container.prototype.normalize = function normalize(nodes, sample) {
  2358. var _this2 = this;
  2359. if (typeof nodes === 'string') {
  2360. var parse = __webpack_require__(41);
  2361. nodes = cleanSource(parse(nodes).nodes);
  2362. } else if (Array.isArray(nodes)) {
  2363. nodes = nodes.slice(0);
  2364. for (var _iterator9 = nodes, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) {
  2365. var _ref9;
  2366. if (_isArray9) {
  2367. if (_i9 >= _iterator9.length) break;
  2368. _ref9 = _iterator9[_i9++];
  2369. } else {
  2370. _i9 = _iterator9.next();
  2371. if (_i9.done) break;
  2372. _ref9 = _i9.value;
  2373. }
  2374. var i = _ref9;
  2375. if (i.parent) i.parent.removeChild(i, 'ignore');
  2376. }
  2377. } else if (nodes.type === 'root') {
  2378. nodes = nodes.nodes.slice(0);
  2379. for (var _iterator10 = nodes, _isArray10 = Array.isArray(_iterator10), _i11 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) {
  2380. var _ref10;
  2381. if (_isArray10) {
  2382. if (_i11 >= _iterator10.length) break;
  2383. _ref10 = _iterator10[_i11++];
  2384. } else {
  2385. _i11 = _iterator10.next();
  2386. if (_i11.done) break;
  2387. _ref10 = _i11.value;
  2388. }
  2389. var _i10 = _ref10;
  2390. if (_i10.parent) _i10.parent.removeChild(_i10, 'ignore');
  2391. }
  2392. } else if (nodes.type) {
  2393. nodes = [nodes];
  2394. } else if (nodes.prop) {
  2395. if (typeof nodes.value === 'undefined') {
  2396. throw new Error('Value field is missed in node creation');
  2397. } else if (typeof nodes.value !== 'string') {
  2398. nodes.value = String(nodes.value);
  2399. }
  2400. nodes = [new _declaration2.default(nodes)];
  2401. } else if (nodes.selector) {
  2402. var Rule = __webpack_require__(20);
  2403. nodes = [new Rule(nodes)];
  2404. } else if (nodes.name) {
  2405. var AtRule = __webpack_require__(16);
  2406. nodes = [new AtRule(nodes)];
  2407. } else if (nodes.text) {
  2408. nodes = [new _comment2.default(nodes)];
  2409. } else {
  2410. throw new Error('Unknown node type in node creation');
  2411. }
  2412. var processed = nodes.map(function (i) {
  2413. if (typeof i.before !== 'function') i = _this2.rebuild(i);
  2414. if (i.parent) i.parent.removeChild(i);
  2415. if (typeof i.raws.before === 'undefined') {
  2416. if (sample && typeof sample.raws.before !== 'undefined') {
  2417. i.raws.before = sample.raws.before.replace(/[^\s]/g, '');
  2418. }
  2419. }
  2420. i.parent = _this2;
  2421. return i;
  2422. });
  2423. return processed;
  2424. };
  2425. Container.prototype.rebuild = function rebuild(node, parent) {
  2426. var _this3 = this;
  2427. var fix = void 0;
  2428. if (node.type === 'root') {
  2429. var Root = __webpack_require__(43);
  2430. fix = new Root();
  2431. } else if (node.type === 'atrule') {
  2432. var AtRule = __webpack_require__(16);
  2433. fix = new AtRule();
  2434. } else if (node.type === 'rule') {
  2435. var Rule = __webpack_require__(20);
  2436. fix = new Rule();
  2437. } else if (node.type === 'decl') {
  2438. fix = new _declaration2.default();
  2439. } else if (node.type === 'comment') {
  2440. fix = new _comment2.default();
  2441. }
  2442. for (var i in node) {
  2443. if (i === 'nodes') {
  2444. fix.nodes = node.nodes.map(function (j) {
  2445. return _this3.rebuild(j, fix);
  2446. });
  2447. } else if (i === 'parent' && parent) {
  2448. fix.parent = parent;
  2449. } else if (node.hasOwnProperty(i)) {
  2450. fix[i] = node[i];
  2451. }
  2452. }
  2453. return fix;
  2454. };
  2455. /**
  2456. * @memberof Container#
  2457. * @member {Node[]} nodes - an array containing the container’s children
  2458. *
  2459. * @example
  2460. * const root = postcss.parse('a { color: black }');
  2461. * root.nodes.length //=> 1
  2462. * root.nodes[0].selector //=> 'a'
  2463. * root.nodes[0].nodes[0].prop //=> 'color'
  2464. */
  2465. _createClass(Container, [{
  2466. key: 'first',
  2467. get: function get() {
  2468. if (!this.nodes) return undefined;
  2469. return this.nodes[0];
  2470. }
  2471. /**
  2472. * The container’s last child.
  2473. *
  2474. * @type {Node}
  2475. *
  2476. * @example
  2477. * rule.last == rule.nodes[rule.nodes.length - 1];
  2478. */
  2479. }, {
  2480. key: 'last',
  2481. get: function get() {
  2482. if (!this.nodes) return undefined;
  2483. return this.nodes[this.nodes.length - 1];
  2484. }
  2485. }]);
  2486. return Container;
  2487. }(_node2.default);
  2488. exports.default = Container;
  2489. /**
  2490. * @callback childCondition
  2491. * @param {Node} node - container child
  2492. * @param {number} index - child index
  2493. * @param {Node[]} nodes - all container children
  2494. * @return {boolean}
  2495. */
  2496. /**
  2497. * @callback childIterator
  2498. * @param {Node} node - container child
  2499. * @param {number} index - child index
  2500. * @return {false|undefined} returning `false` will break iteration
  2501. */
  2502. module.exports = exports['default'];
  2503. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbnRhaW5lci5lczYiXSwibmFtZXMiOlsiY2xlYW5Tb3VyY2UiLCJub2RlcyI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GlvbiB3YXMgYnJva2VcbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogcm9vdC53YWxrRGVjbHMoZGVjbCA9PiB7XG4gICAgICogICBjaGVja1Byb3BlcnR5U3VwcG9ydChkZWNsLnByb3ApO1xuICAgICAqIH0pO1xuICAgICAqXG4gICAgICogcm9vdC53YWxrRGVjbHMoJ2JvcmRlci1yYWRpdXMnLCBkZWNsID0+IHtcbiAgICAgKiAgIGRlY2wucmVtb3ZlKCk7XG4gICAgICogfSk7XG4gICAgICpcbiAgICAgKiByb290LndhbGtEZWNscygvXmJhY2tncm91bmQvLCBkZWNsID0+IHtcbiAgICAgKiAgIGRlY2wudmFsdWUgPSB0YWtlRmlyc3RDb2xvckZyb21HcmFkaWVudChkZWNsLnZhbHVlKTtcbiAgICAgKiB9KTtcbiAgICAgKi9cbiAgICB3YWxrRGVjbHMocHJvcCwgY2FsbGJhY2spIHtcbiAgICAgICAgaWYgKCAhY2FsbGJhY2sgKSB7XG4gICAgICAgICAgICBjYWxsYmFjayA9IHByb3A7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy53YWxrKCAoY2hpbGQsIGkpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIGNoaWxkLnR5cGUgPT09ICdkZWNsJyApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGNoaWxkLCBpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIGlmICggcHJvcCBpbnN0YW5jZW9mIFJlZ0V4cCApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLndhbGsoIChjaGlsZCwgaSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICggY2hpbGQudHlwZSA9PT0gJ2RlY2wnICYmIHByb3AudGVzdChjaGlsZC5wcm9wKSApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGNoaWxkLCBpKTtcbiAgICAgICAgIC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4gICAgICpcbiAgICAgKiBAcmV0dXJuIHtmYWxzZXx1bmRlZmluZWR9IHJldHVybnMgYGZhbHNlYCBpZiBpdGVyYXRpb24gd2FzIGJyb2tlXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIGNvbnN0IHNlbGVjdG9ycyA9IFtdO1xuICAgICAqIHJvb3Qud2Fsa1J1bGVzKHJ1bGUgPT4ge1xuICAgICAqICAgc2VsZWN0b3JzLnB1c2gocnVsZS5zZWxlY3Rvcik7XG4gICAgICogfSk7XG4gICAgICogY29uc29sZS5sb2coYFlvdXIgQ1NTIHVzZXMgJHtzZWxlY3RvcnMubGVuZ3RofSBzZWxlY3RvcnNgKTtcbiAgICAgKi9cbiAgICB3YWxrUnVsZXMoc2VsZWN0b3IsIGNhbGxiYWNrKSB7XG4gICAgICAgIGlmICggIWNhbGxiYWNrICkge1xuICAgICAgICAgICAgY2FsbGJhY2sgPSBzZWxlY3RvcjtcblxuICAgICAgICAgICAgcmV0dXJuIHRoaXMud2FsayggKGNoaWxkLCBpKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCBjaGlsZC50eXBlID09PSAncnVsZScgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhjaGlsZCwgaSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSBpZiAoIHNlbGVjdG9yIGluc3RhbmNlb2YgUmVnRXhwICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMud2FsayggKGNoaWxkLCBpKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCBjaGlsZC50eXBlID09PSAncnVsZScgJiYgc2VsZWN0b3IudGVzdChjaGlsZC5zZWxlY3RvcikgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhjaGlsZCwgaSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxz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uIHtmYWxzZXx1bmRlZmluZWR9IHJldHVybnMgYGZhbHNlYCBpZiBpdGVyYXRpb24gd2FzIGJyb2tlXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHJvb3Qud2Fsa0F0UnVsZXMocnVsZSA9PiB7XG4gICAgICogICBpZiAoIGlzT2xkKHJ1bGUubmFtZSkgKSBydWxlLnJlbW92ZSgpO1xuICAgICAqIH0pO1xuICAgICAqXG4gICAgICogbGV0IGZpcnN0ID0gZmFsc2U7XG4gICAgICogcm9vdC53YWxrQXRSdWxlcygnY2hhcnNldCcsIHJ1bGUgPT4ge1xuICAgICAqICAgaWYgKCAhZmlyc3QgKSB7XG4gICAgICogICAgIGZpcnN0ID0gdHJ1ZTtcbiAgICAgKiAgIH0gZWxzZSB7XG4gICAgICogICAgIHJ1bGUucmVtb3ZlKCk7XG4gICAgICogICB9XG4gICAgICogfSk7XG4gICAgICovXG4gICAgd2Fsa0F0UnVsZXMobmFtZSwgY2FsbGJhY2spIHtcbiAgICAgICAgaWYgKCAhY2FsbGJhY2sgKSB7XG4gICAgICAgICAgICBjYWxsYmFjayA9IG5hbWU7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy53YWxrKCAoY2hpbGQsIGkpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIGNoaWxkLnR5cGUgPT09ICdhdHJ1bGUnICkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2FsbGJhY2soY2hpbGQsIGkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2UgaWYgKCBuYW1lIGluc3RhbmNlb2YgUmVnRXhwICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMud2FsayggKGNoaWxkLCBpKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCBjaGlsZC50eXBlID09PSAnYXRydWxlJyAmJiBuYW1lLnRlc3QoY2hpbGQubmFtZSkgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhjaGlsZCwgaSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy53YWxrKCAoY2hpbGQsIGkpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIGNoaWxkLnR5cGUgPT09ICdhdHJ1bGUnICYmIGNoaWxkLm5hbWUgPT09IG5hbWUgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhjaGlsZCwgaSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBUcmF2ZXJzZXMgdGhlIGNvbnRhaW5lcuKAmXMgZGVzY2VuZGFudCBub2RlcywgY2FsbGluZyBjYWxsYmFja1xuICAgICAqIGZvciBlYWNoIGNvbW1lbnQgbm9kZS5cbiAgICAgKlxuICAgICAqIExpa2Uge0BsaW5rIENvbnRhaW5lciNlYWNofSwgdGhpcyBtZXRob2QgaXMgc2FmZVxuICAgICAqIHRvIHVzZSBpZiB5b3UgYXJlIG11dGF0aW5nIGFycmF5cyBkdXJpbmcgaXRlcmF0aW9uLlxuICAgICAqXG4gICAgICogQHBhcmFtIHtjaGlsZEl0ZXJhdG9yfSBjYWxsYmFjayAtIGl0ZXJhdG9yIHJlY2VpdmVzIGVhY2ggbm9kZSBhbmQgaW5kZXhcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge2ZhbHNlfHVuZGVmaW5lZH0gcmV0dXJucyBgZmFsc2VgIGlmIGl0ZXJhdGlvbiB3YXMgYnJva2VcbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogcm9vdC53YWxrQ29tbWVudHMoY29tbWVudCA9PiB7XG4gICAgICogICBjb21tZW50LnJlbW92ZSgpO1xuICAgICAqIH0pO1xuICAgICAqL1xuICAgIHdhbGtDb21tZW50cyhj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AnY2hhcnNldCcsIHBhcmFtczogJ1wiVVRGLThcIicgfSk7ICAvLyBhdC1ydWxlXG4gICAgICogcm9vdC5hcHBlbmQoeyBzZWxlY3RvcjogJ2EnIH0pOyAgICAgICAgICAgICAgICAgICAgICAgLy8gcnVsZVxuICAgICAqIHJ1bGUuYXBwZW5kKHsgcHJvcDogJ2NvbG9yJywgdmFsdWU6ICdibGFjaycgfSk7ICAgICAgIC8vIGRlY2xhcmF0aW9uXG4gICAgICogcnVsZS5hcHBlbmQoeyB0ZXh0OiAnQ29tbWVudCcgfSkgICAgICAgICAgICAgICAgICAgICAgLy8gY29tbWVudFxuICAgICAqXG4gICAgICogcm9vdC5hcHBlbmQoJ2Ege30nKTtcbiAgICAgKiByb290LmZpcnN0LmFwcGVuZCgnY29sb3I6IGJsYWNrOyB6LWluZGV4OiAxJyk7XG4gICAgICovXG4gICAgcHJlcGVuZCguLi5jaGlsZHJlbikge1xuICAgICAgICBjaGlsZHJlbiA9IGNoaWxkcmVuLnJldmVyc2UoKTtcbiAgICAgICAgZm9yICggbGV0IGNoaWxkIG9mIGNoaWxkcmVuICkge1xuICAgICAgICAgICAgbGV0IG5vZGVzID0gdGhpcy5ub3JtYWxpemUoY2hpbGQsIHRoaXMuZmlyc3QsICdwcmVwZW5kJykucmV2ZXJzZSgpO1xuICAgICAgICAgICAgZm9yICggbGV0IG5vZGUgb2Ygbm9kZXMgKSB0aGlzLm5vZGVzLnVuc2hpZnQobm9kZSk7XG4gICAgICAgICAgICBmb3IgKCBsZXQgaWQgaW4gdGhpcy5pbmRleGVzICkge1xuICAgICAgICAgICAgICAgIHRoaXMuaW5kZXhlc1tpZF0gPSB0aGlzLmluZGV4ZXNbaWRdICsgbm9kZXMubGVuZ3RoO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIGNsZWFuUmF3cyhrZWVwQmV0d2Vlbikge1xuICAgICAgICBzdXBlci5jbGVhblJh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ICAqIEBwYXJhbSB7c3RyaW5nfFJlZ0V4cH0gcGF0dGVybiAgICAgIC0gcmVwbGFjZSBwYXR0ZXJuXG4gICAgICogQHBhcmFtIHtvYmplY3R9IG9wdHMgICAgICAgICAgICAgICAgLSBvcHRpb25zIHRvIHNwZWVkIHVwIHRoZSBzZWFyY2hcbiAgICAgKiBAcGFyYW0ge3N0cmluZ3xzdHJpbmdbXX0gb3B0cy5wcm9wcyAtIGFuIGFycmF5IG9mIHByb3BlcnR5IG5hbWVzXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IG9wdHMuZmFzdCAgICAgICAgICAgLSBzdHJpbmcgdGhhdOKAmXMgdXNlZFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG8gbmFycm93IGRvd24gdmFsdWVzIGFuZCBzcGVlZCB1cFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHJlZ2V4cCBzZWFyY2hcbiAgICAgKiBAcGFyYW0ge2Z1bmN0aW9ufHN0cmluZ30gY2FsbGJhY2sgICAtIHN0cmluZyB0byByZXBsYWNlIHBhdHRlcm5cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9yIGNhbGxiYWNrIHRoYXQgcmV0dXJucyBhIG5ld1xuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUuXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUaGUgY2FsbGJhY2sgd2lsbCByZWNlaXZlXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgc2FtZSBhcmd1bWVudHMgYXMgdGhvc2VcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhc3NlZCB0byBhIGZ1bmN0aW9uIHBhcmFtZXRlclxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAg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KiBAcGFyYW0ge05vZGV9IGNoaWxkIC0gY2hpbGQgb2YgdGhlIGN1cnJlbnQgY29udGFpbmVyLlxuICAgICAqXG4gICAgICogQHJldHVybiB7bnVtYmVyfSBjaGlsZCBpbmRleFxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiBydWxlLmluZGV4KCBydWxlLm5vZGVzWzJdICkgLy89PiAyXG4gICAgICovXG4gICAgaW5kZXgoY2hpbGQpIHtcbiAgICAgICAgaWYgKCB0eXBlb2YgY2hpbGQgPT09ICdudW1iZXInICkge1xuICAgICAgICAgICAgcmV0dXJuIGNoaWxkO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMubm9kZXMuaW5kZXhPZihjaGlsZCk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBUaGUgY29udGFpbmVy4oCZcyBmaXJzdCBjaGlsZC5cbiAgICAgKlxuICAgICAqIEB0eXBlIHtOb2RlfVxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiBydWxlLmZpcnN0ID09IHJ1bGVzLm5vZGVzWzBdO1xuICAgICAqL1xuICAgIGdldCBmaXJzdCgpIHtcbiAgICAgICAgaWYgKCAhdGhpcy5ub2RlcyApIHJldHVybiB1bmRlZmluZWQ7XG4gICAgICAgIHJldHVybiB0aGlzLm5vZGVzWzBdO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBjb250YWluZXLigJlzIGxhc3QgY2hpbGQuXG4gICAgICpcbiAgICAgKiBAdHlwZSB7Tm9kZX1cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogcnVsZS5sYXN0ID09IHJ1bGUubm9kZXNbcnVsZS5ub2Rlcy5sZW5ndGggLSAxXTtcbiAgICAgKi9cbiAgICBnZXQgbGFzdCgpIHtcbiAgICAgICAgaWYgKCAhdGhpcy5ub2RlcyApIHJldHVybiB1bmRlZmluZWQ7XG4gICAgICAgIHJldHVybiB0aGlzLm5vZGVzW3RoaXMubm9kZXMubGVuZ3RoIC0gMV07XG4gICAgfVxuXG4gICAgbm9ybWFsaXplKG5vZGVzLCBzYW1wbGUpIHtcbiAgICAgICAgaWYgKCB0eXBlb2Ygbm9kZXMgPT09ICdzdHJpbmcnICkge1xuICAgICAgICAgICAgbGV0IHBhcnNlID0gcmVxdWlyZSgnLi9wYXJzZScpO1xuICAgICAgICAgICAgbm9kZXMgPSBjbGVhblNvdXJjZShwYXJzZShub2Rlcykubm9kZXMpO1xuICAgICAgICB9IGVsc2UgaWYgKCBBcnJheS5pc0FycmF5KG5vZGVzKSApIHtcbiAgICAgICAgICAgIG5vZGVzID0gbm9kZXMuc2xpY2UoMCk7XG4gICAgICAgICAgICBmb3IgKCBsZXQgaSBvZiBub2RlcyApIHtcbiAgICAgICAgICAgICAgICBpZiAoIGkucGFyZW50ICkgaS5wYXJlbnQucmVtb3ZlQ2hpbGQoaSwgJ2lnbm9yZScpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKCBub2Rlcy50eXBlID09PSAncm9vdCcgKSB7XG4gICAgICAgICAgICBub2RlcyA9IG5vZGVzLm5vZGVzLnNsaWNlKDApO1xuICAgICAgICAgICAgZm9yICggbGV0IGkgb2Ygbm9kZXMgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBpLnBhcmVudCApIGkucGFyZW50LnJlbW92ZUNoaWxkKGksICdpZ25vcmUnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmICggbm9kZXMudHlwZSApIHtcbiAgICAgICAgICAgIG5vZGVzID0gW25vZGVzXTtcbiAgICAgICAgfSBlbHNlIGlmICggbm9kZXMucHJvcCApIHtcbiAgICAgICAgICAgIGlmICggdHlwZW9mIG5vZGVzLnZhbHVlID09PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1ZhbHVlIGZpZWxkIGlzIG1pc3NlZCBpbiBub2RlIGNyZWF0aW9uJyk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlb2Ygbm9kZXMudmFsdWUgIT09ICdzdHJpbmcnICkge1xuICAgICAgICAgICAgICAgIG5vZGVzLnZhbHVlID0gU3RyaW5nKG5vZGVzLnZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG5vZGVzID0gW25ldyBEZWNsYXJhdGlvbihub2RlcyldO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2Rlcy5zZWxlY3RvciApIHtcbiAgICAgICAgICAgIGxldCBSdWxlID0gcmVxdWlyZSgnLi9ydWxlJyk7XG4gICAgICAgICAgICBub2RlcyA9IFtuZXcgUnVsZShub2RlcyldO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2Rlcy5uYW1lICkge1xuICAgICAgICAgICAgbGV0IEF0UnVsZSA9IHJlcXVpcmUoJy4vYXQtcnVsZScpO1xuICAgICAgICAgICAgbm9kZXMgPSBbbmV3IEF0UnVsZShub2RlcyldO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2Rlcy50ZXh0ICkge1xuICAgICAgICAgICAgbm9kZXMgPSBbbmV3IENvbW1lbnQobm9kZXMpXTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVW5rbm93biBub2RlIHR5cGUgaW4gbm9kZSBjcmVhdGlvbicpO1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IHByb2Nlc3NlZCA9IG5vZGVzLm1hcCggaSA9PiB7XG4gICAgICAgICAgICBpZiAoIHR5cGVvZiBpLmJlZm9yZSAhPT0gJ2Z1bmN0aW9uJyApIGkgPSB0aGlzLnJlYnVpbGQoaSk7XG5cbiAgICAgICAgICAgIGlmICggaS5wYXJlbnQgKSBpLnBhcmVudC5yZW1vdmVDaGlsZChpKTtcbiAgICAgICAgICAgIGlmICggdHlwZW9mIGkucmF3cy5iZWZvcmUgPT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgIGlmICggc2FtcGxlICYmIHR5cGVvZiBzYW1wbGUucmF3cy5iZWZvcmUgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgICAgICBpLnJhd3MuYmVmb3JlID0gc2FtcGxlLnJhd3MuYmVmb3JlLnJlcGxhY2UoL1teXFxzXS9nLCAnJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaS5wYXJlbnQgPSB0aGlzO1xuICAgICAgICAgICAgcmV0dXJuIGk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiBwcm9jZXNzZWQ7XG4gICAgfVxuXG4gICAgcmVidWlsZChub2RlLCBwYXJlbnQpIHtcbiAgICAgICAgbGV0IGZpeDtcbiAgICAgICAgaWYgKCBub2RlLnR5cGUgPT09ICdyb290JyApIHtcbiAgICAgICAgICAgIGxldCBSb290ID0gcmVxdWlyZSgnLi9yb290Jyk7XG4gICAgICAgICAgICBmaXggPSBuZXcgUm9vdCgpO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2RlLnR5cGUgPT09ICdhdHJ1bGUnICkge1xuICAgICAgICAgICAgbGV0IEF0UnVsZSA9IHJlcXVpcmUoJy4vYXQtcnVsZScpO1xuICAgICAgICAgICAgZml4ID0gbmV3IEF0UnVsZSgpO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2RlLnR5cGUgPT09ICdydWxlJyApIHtcbiAgICAgICAgICAgIGxldCBSdWxlID0gcmVxdWlyZSgnLi9ydWxlJyk7XG4gICAgICAgICAgICBmaXggPSBuZXcgUnVsZSgpO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2RlLnR5cGUgPT09ICdkZWNsJyApIHtcbiAgICAgICAgICAgIGZpeCA9IG5ldyBEZWNsYXJhdGlvbigpO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2RlLnR5cGUgPT09ICdjb21tZW50JyApIHtcbiAgICAgICAgICAgIGZpeCA9IG5ldyBDb21tZW50KCk7XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKCBsZXQgaSBpbiBub2RlICkge1xuICAgICAgICAgICAgaWYgKCBpID09PSAnbm9kZXMnICkge1xuICAgICAgICAgICAgICAgIGZpeC5ub2RlcyA9IG5vZGUubm9kZXMubWFwKCBqID0+IHRoaXMucmVidWlsZChqLCBmaXgpICk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBpID09PSAncGFyZW50JyAmJiBwYXJlbnQgKSB7XG4gICAgICAgICAgICAgICAgZml4LnBhcmVudCA9IHBhcmVudDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIG5vZGUuaGFzT3duUHJvcGVydHkoaSkgKSB7XG4gICAgICAgICAgICAgICAgZml4W2ldID0gbm9kZVtpXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBmaXg7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQG1lbWJlcm9mIENvbnRhaW5lciNcbiAgICAgKiBAbWVtYmVyIHtOb2RlW119IG5vZGVzIC0gYW4gYXJyYXkgY29udGFpbmluZyB0aGUgY29udGFpbmVy4oCZcyBjaGlsZHJlblxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiBjb25zdCByb290ID0gcG9zdGNzcy5wYXJzZSgnYSB7IGNvbG9yOiBibGFjayB9Jyk7XG4gICAgICogcm9vdC5ub2Rlcy5sZW5ndGggICAgICAgICAgIC8vPT4gMVxuICAgICAqIHJvb3Qubm9kZXNbMF0uc2VsZWN0b3IgICAgICAvLz0+ICdhJ1xuICAgICAqIHJvb3Qubm9kZXNbMF0ubm9kZXNbMF0ucHJvcCAvLz0+ICdjb2xvcidcbiAgICAgKi9cblxufVxuXG5leHBvcnQgZGVmYXVsdCBDb250YWluZXI7XG5cblxuLyoqXG4gKiBAY2FsbGJhY2sgY2hpbGRDb25kaXRpb25cbiAqIEBwYXJhbSB7Tm9kZX0gbm9kZSAgICAtIGNvbnRhaW5lciBjaGlsZFxuICogQHBhcmFtIHtudW1iZXJ9IGluZGV4IC0gY2hpbGQgaW5kZXhcbiAqIEBwYXJhbSB7Tm9kZVtdfSBub2RlcyAtIGFsbCBjb250YWluZXIgY2hpbGRyZW5cbiAqIEByZXR1cm4ge2Jvb2xlYW59XG4gKi9cblxuLyoqXG4gKiBAY2FsbGJhY2sgY2hpbGRJdGVyYXRvclxuICogQHBhcmFtIHtOb2RlfSBub2RlICAgIC0gY29udGFpbmVyIGNoaWxkXG4gKiBAcGFyYW0ge251bWJlcn0gaW5kZXggLSBjaGlsZCBpbmRleFxuICogQHJldHVybiB7ZmFsc2V8dW5kZWZpbmVkfSByZXR1cm5pbmcgYGZhbHNlYCB3aWxsIGJyZWFrIGl0ZXJhdGlvblxuICovXG4iXX0=
  2504. /***/ }),
  2505. /* 14 */
  2506. /***/ (function(module, exports) {
  2507. // shim for using process in browser
  2508. var process = module.exports = {};
  2509. // cached from whatever global is present so that test runners that stub it
  2510. // don't break things. But we need to wrap it in a try catch in case it is
  2511. // wrapped in strict mode code which doesn't define any globals. It's inside a
  2512. // function because try/catches deoptimize in certain engines.
  2513. var cachedSetTimeout;
  2514. var cachedClearTimeout;
  2515. function defaultSetTimout() {
  2516. throw new Error('setTimeout has not been defined');
  2517. }
  2518. function defaultClearTimeout () {
  2519. throw new Error('clearTimeout has not been defined');
  2520. }
  2521. (function () {
  2522. try {
  2523. if (typeof setTimeout === 'function') {
  2524. cachedSetTimeout = setTimeout;
  2525. } else {
  2526. cachedSetTimeout = defaultSetTimout;
  2527. }
  2528. } catch (e) {
  2529. cachedSetTimeout = defaultSetTimout;
  2530. }
  2531. try {
  2532. if (typeof clearTimeout === 'function') {
  2533. cachedClearTimeout = clearTimeout;
  2534. } else {
  2535. cachedClearTimeout = defaultClearTimeout;
  2536. }
  2537. } catch (e) {
  2538. cachedClearTimeout = defaultClearTimeout;
  2539. }
  2540. } ())
  2541. function runTimeout(fun) {
  2542. if (cachedSetTimeout === setTimeout) {
  2543. //normal enviroments in sane situations
  2544. return setTimeout(fun, 0);
  2545. }
  2546. // if setTimeout wasn't available but was latter defined
  2547. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  2548. cachedSetTimeout = setTimeout;
  2549. return setTimeout(fun, 0);
  2550. }
  2551. try {
  2552. // when when somebody has screwed with setTimeout but no I.E. maddness
  2553. return cachedSetTimeout(fun, 0);
  2554. } catch(e){
  2555. try {
  2556. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  2557. return cachedSetTimeout.call(null, fun, 0);
  2558. } catch(e){
  2559. // 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
  2560. return cachedSetTimeout.call(this, fun, 0);
  2561. }
  2562. }
  2563. }
  2564. function runClearTimeout(marker) {
  2565. if (cachedClearTimeout === clearTimeout) {
  2566. //normal enviroments in sane situations
  2567. return clearTimeout(marker);
  2568. }
  2569. // if clearTimeout wasn't available but was latter defined
  2570. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  2571. cachedClearTimeout = clearTimeout;
  2572. return clearTimeout(marker);
  2573. }
  2574. try {
  2575. // when when somebody has screwed with setTimeout but no I.E. maddness
  2576. return cachedClearTimeout(marker);
  2577. } catch (e){
  2578. try {
  2579. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  2580. return cachedClearTimeout.call(null, marker);
  2581. } catch (e){
  2582. // 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.
  2583. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  2584. return cachedClearTimeout.call(this, marker);
  2585. }
  2586. }
  2587. }
  2588. var queue = [];
  2589. var draining = false;
  2590. var currentQueue;
  2591. var queueIndex = -1;
  2592. function cleanUpNextTick() {
  2593. if (!draining || !currentQueue) {
  2594. return;
  2595. }
  2596. draining = false;
  2597. if (currentQueue.length) {
  2598. queue = currentQueue.concat(queue);
  2599. } else {
  2600. queueIndex = -1;
  2601. }
  2602. if (queue.length) {
  2603. drainQueue();
  2604. }
  2605. }
  2606. function drainQueue() {
  2607. if (draining) {
  2608. return;
  2609. }
  2610. var timeout = runTimeout(cleanUpNextTick);
  2611. draining = true;
  2612. var len = queue.length;
  2613. while(len) {
  2614. currentQueue = queue;
  2615. queue = [];
  2616. while (++queueIndex < len) {
  2617. if (currentQueue) {
  2618. currentQueue[queueIndex].run();
  2619. }
  2620. }
  2621. queueIndex = -1;
  2622. len = queue.length;
  2623. }
  2624. currentQueue = null;
  2625. draining = false;
  2626. runClearTimeout(timeout);
  2627. }
  2628. process.nextTick = function (fun) {
  2629. var args = new Array(arguments.length - 1);
  2630. if (arguments.length > 1) {
  2631. for (var i = 1; i < arguments.length; i++) {
  2632. args[i - 1] = arguments[i];
  2633. }
  2634. }
  2635. queue.push(new Item(fun, args));
  2636. if (queue.length === 1 && !draining) {
  2637. runTimeout(drainQueue);
  2638. }
  2639. };
  2640. // v8 likes predictible objects
  2641. function Item(fun, array) {
  2642. this.fun = fun;
  2643. this.array = array;
  2644. }
  2645. Item.prototype.run = function () {
  2646. this.fun.apply(null, this.array);
  2647. };
  2648. process.title = 'browser';
  2649. process.browser = true;
  2650. process.env = {};
  2651. process.argv = [];
  2652. process.version = ''; // empty string to avoid regexp issues
  2653. process.versions = {};
  2654. function noop() {}
  2655. process.on = noop;
  2656. process.addListener = noop;
  2657. process.once = noop;
  2658. process.off = noop;
  2659. process.removeListener = noop;
  2660. process.removeAllListeners = noop;
  2661. process.emit = noop;
  2662. process.prependListener = noop;
  2663. process.prependOnceListener = noop;
  2664. process.listeners = function (name) { return [] }
  2665. process.binding = function (name) {
  2666. throw new Error('process.binding is not supported');
  2667. };
  2668. process.cwd = function () { return '/' };
  2669. process.chdir = function (dir) {
  2670. throw new Error('process.chdir is not supported');
  2671. };
  2672. process.umask = function() { return 0; };
  2673. /***/ }),
  2674. /* 15 */
  2675. /***/ (function(module, exports, __webpack_require__) {
  2676. "use strict";
  2677. /* WEBPACK VAR INJECTION */(function(global) {/*!
  2678. * The buffer module from node.js, for the browser.
  2679. *
  2680. * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
  2681. * @license MIT
  2682. */
  2683. /* eslint-disable no-proto */
  2684. var base64 = __webpack_require__(98)
  2685. var ieee754 = __webpack_require__(102)
  2686. var isArray = __webpack_require__(103)
  2687. exports.Buffer = Buffer
  2688. exports.SlowBuffer = SlowBuffer
  2689. exports.INSPECT_MAX_BYTES = 50
  2690. /**
  2691. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  2692. * === true Use Uint8Array implementation (fastest)
  2693. * === false Use Object implementation (most compatible, even IE6)
  2694. *
  2695. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  2696. * Opera 11.6+, iOS 4.2+.
  2697. *
  2698. * Due to various browser bugs, sometimes the Object implementation will be used even
  2699. * when the browser supports typed arrays.
  2700. *
  2701. * Note:
  2702. *
  2703. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  2704. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  2705. *
  2706. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  2707. *
  2708. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  2709. * incorrect length in some situations.
  2710. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  2711. * get the Object implementation, which is slower but behaves correctly.
  2712. */
  2713. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  2714. ? global.TYPED_ARRAY_SUPPORT
  2715. : typedArraySupport()
  2716. /*
  2717. * Export kMaxLength after typed array support is determined.
  2718. */
  2719. exports.kMaxLength = kMaxLength()
  2720. function typedArraySupport () {
  2721. try {
  2722. var arr = new Uint8Array(1)
  2723. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  2724. return arr.foo() === 42 && // typed array instances can be augmented
  2725. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  2726. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  2727. } catch (e) {
  2728. return false
  2729. }
  2730. }
  2731. function kMaxLength () {
  2732. return Buffer.TYPED_ARRAY_SUPPORT
  2733. ? 0x7fffffff
  2734. : 0x3fffffff
  2735. }
  2736. function createBuffer (that, length) {
  2737. if (kMaxLength() < length) {
  2738. throw new RangeError('Invalid typed array length')
  2739. }
  2740. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2741. // Return an augmented `Uint8Array` instance, for best performance
  2742. that = new Uint8Array(length)
  2743. that.__proto__ = Buffer.prototype
  2744. } else {
  2745. // Fallback: Return an object instance of the Buffer class
  2746. if (that === null) {
  2747. that = new Buffer(length)
  2748. }
  2749. that.length = length
  2750. }
  2751. return that
  2752. }
  2753. /**
  2754. * The Buffer constructor returns instances of `Uint8Array` that have their
  2755. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  2756. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  2757. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  2758. * returns a single octet.
  2759. *
  2760. * The `Uint8Array` prototype remains unmodified.
  2761. */
  2762. function Buffer (arg, encodingOrOffset, length) {
  2763. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  2764. return new Buffer(arg, encodingOrOffset, length)
  2765. }
  2766. // Common case.
  2767. if (typeof arg === 'number') {
  2768. if (typeof encodingOrOffset === 'string') {
  2769. throw new Error(
  2770. 'If encoding is specified then the first argument must be a string'
  2771. )
  2772. }
  2773. return allocUnsafe(this, arg)
  2774. }
  2775. return from(this, arg, encodingOrOffset, length)
  2776. }
  2777. Buffer.poolSize = 8192 // not used by this implementation
  2778. // TODO: Legacy, not needed anymore. Remove in next major version.
  2779. Buffer._augment = function (arr) {
  2780. arr.__proto__ = Buffer.prototype
  2781. return arr
  2782. }
  2783. function from (that, value, encodingOrOffset, length) {
  2784. if (typeof value === 'number') {
  2785. throw new TypeError('"value" argument must not be a number')
  2786. }
  2787. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  2788. return fromArrayBuffer(that, value, encodingOrOffset, length)
  2789. }
  2790. if (typeof value === 'string') {
  2791. return fromString(that, value, encodingOrOffset)
  2792. }
  2793. return fromObject(that, value)
  2794. }
  2795. /**
  2796. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  2797. * if value is a number.
  2798. * Buffer.from(str[, encoding])
  2799. * Buffer.from(array)
  2800. * Buffer.from(buffer)
  2801. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  2802. **/
  2803. Buffer.from = function (value, encodingOrOffset, length) {
  2804. return from(null, value, encodingOrOffset, length)
  2805. }
  2806. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2807. Buffer.prototype.__proto__ = Uint8Array.prototype
  2808. Buffer.__proto__ = Uint8Array
  2809. if (typeof Symbol !== 'undefined' && Symbol.species &&
  2810. Buffer[Symbol.species] === Buffer) {
  2811. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  2812. Object.defineProperty(Buffer, Symbol.species, {
  2813. value: null,
  2814. configurable: true
  2815. })
  2816. }
  2817. }
  2818. function assertSize (size) {
  2819. if (typeof size !== 'number') {
  2820. throw new TypeError('"size" argument must be a number')
  2821. } else if (size < 0) {
  2822. throw new RangeError('"size" argument must not be negative')
  2823. }
  2824. }
  2825. function alloc (that, size, fill, encoding) {
  2826. assertSize(size)
  2827. if (size <= 0) {
  2828. return createBuffer(that, size)
  2829. }
  2830. if (fill !== undefined) {
  2831. // Only pay attention to encoding if it's a string. This
  2832. // prevents accidentally sending in a number that would
  2833. // be interpretted as a start offset.
  2834. return typeof encoding === 'string'
  2835. ? createBuffer(that, size).fill(fill, encoding)
  2836. : createBuffer(that, size).fill(fill)
  2837. }
  2838. return createBuffer(that, size)
  2839. }
  2840. /**
  2841. * Creates a new filled Buffer instance.
  2842. * alloc(size[, fill[, encoding]])
  2843. **/
  2844. Buffer.alloc = function (size, fill, encoding) {
  2845. return alloc(null, size, fill, encoding)
  2846. }
  2847. function allocUnsafe (that, size) {
  2848. assertSize(size)
  2849. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  2850. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  2851. for (var i = 0; i < size; ++i) {
  2852. that[i] = 0
  2853. }
  2854. }
  2855. return that
  2856. }
  2857. /**
  2858. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  2859. * */
  2860. Buffer.allocUnsafe = function (size) {
  2861. return allocUnsafe(null, size)
  2862. }
  2863. /**
  2864. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  2865. */
  2866. Buffer.allocUnsafeSlow = function (size) {
  2867. return allocUnsafe(null, size)
  2868. }
  2869. function fromString (that, string, encoding) {
  2870. if (typeof encoding !== 'string' || encoding === '') {
  2871. encoding = 'utf8'
  2872. }
  2873. if (!Buffer.isEncoding(encoding)) {
  2874. throw new TypeError('"encoding" must be a valid string encoding')
  2875. }
  2876. var length = byteLength(string, encoding) | 0
  2877. that = createBuffer(that, length)
  2878. var actual = that.write(string, encoding)
  2879. if (actual !== length) {
  2880. // Writing a hex string, for example, that contains invalid characters will
  2881. // cause everything after the first invalid character to be ignored. (e.g.
  2882. // 'abxxcd' will be treated as 'ab')
  2883. that = that.slice(0, actual)
  2884. }
  2885. return that
  2886. }
  2887. function fromArrayLike (that, array) {
  2888. var length = array.length < 0 ? 0 : checked(array.length) | 0
  2889. that = createBuffer(that, length)
  2890. for (var i = 0; i < length; i += 1) {
  2891. that[i] = array[i] & 255
  2892. }
  2893. return that
  2894. }
  2895. function fromArrayBuffer (that, array, byteOffset, length) {
  2896. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  2897. if (byteOffset < 0 || array.byteLength < byteOffset) {
  2898. throw new RangeError('\'offset\' is out of bounds')
  2899. }
  2900. if (array.byteLength < byteOffset + (length || 0)) {
  2901. throw new RangeError('\'length\' is out of bounds')
  2902. }
  2903. if (byteOffset === undefined && length === undefined) {
  2904. array = new Uint8Array(array)
  2905. } else if (length === undefined) {
  2906. array = new Uint8Array(array, byteOffset)
  2907. } else {
  2908. array = new Uint8Array(array, byteOffset, length)
  2909. }
  2910. if (Buffer.TYPED_ARRAY_SUPPORT) {
  2911. // Return an augmented `Uint8Array` instance, for best performance
  2912. that = array
  2913. that.__proto__ = Buffer.prototype
  2914. } else {
  2915. // Fallback: Return an object instance of the Buffer class
  2916. that = fromArrayLike(that, array)
  2917. }
  2918. return that
  2919. }
  2920. function fromObject (that, obj) {
  2921. if (Buffer.isBuffer(obj)) {
  2922. var len = checked(obj.length) | 0
  2923. that = createBuffer(that, len)
  2924. if (that.length === 0) {
  2925. return that
  2926. }
  2927. obj.copy(that, 0, 0, len)
  2928. return that
  2929. }
  2930. if (obj) {
  2931. if ((typeof ArrayBuffer !== 'undefined' &&
  2932. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  2933. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  2934. return createBuffer(that, 0)
  2935. }
  2936. return fromArrayLike(that, obj)
  2937. }
  2938. if (obj.type === 'Buffer' && isArray(obj.data)) {
  2939. return fromArrayLike(that, obj.data)
  2940. }
  2941. }
  2942. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  2943. }
  2944. function checked (length) {
  2945. // Note: cannot use `length < kMaxLength()` here because that fails when
  2946. // length is NaN (which is otherwise coerced to zero.)
  2947. if (length >= kMaxLength()) {
  2948. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  2949. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  2950. }
  2951. return length | 0
  2952. }
  2953. function SlowBuffer (length) {
  2954. if (+length != length) { // eslint-disable-line eqeqeq
  2955. length = 0
  2956. }
  2957. return Buffer.alloc(+length)
  2958. }
  2959. Buffer.isBuffer = function isBuffer (b) {
  2960. return !!(b != null && b._isBuffer)
  2961. }
  2962. Buffer.compare = function compare (a, b) {
  2963. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  2964. throw new TypeError('Arguments must be Buffers')
  2965. }
  2966. if (a === b) return 0
  2967. var x = a.length
  2968. var y = b.length
  2969. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  2970. if (a[i] !== b[i]) {
  2971. x = a[i]
  2972. y = b[i]
  2973. break
  2974. }
  2975. }
  2976. if (x < y) return -1
  2977. if (y < x) return 1
  2978. return 0
  2979. }
  2980. Buffer.isEncoding = function isEncoding (encoding) {
  2981. switch (String(encoding).toLowerCase()) {
  2982. case 'hex':
  2983. case 'utf8':
  2984. case 'utf-8':
  2985. case 'ascii':
  2986. case 'latin1':
  2987. case 'binary':
  2988. case 'base64':
  2989. case 'ucs2':
  2990. case 'ucs-2':
  2991. case 'utf16le':
  2992. case 'utf-16le':
  2993. return true
  2994. default:
  2995. return false
  2996. }
  2997. }
  2998. Buffer.concat = function concat (list, length) {
  2999. if (!isArray(list)) {
  3000. throw new TypeError('"list" argument must be an Array of Buffers')
  3001. }
  3002. if (list.length === 0) {
  3003. return Buffer.alloc(0)
  3004. }
  3005. var i
  3006. if (length === undefined) {
  3007. length = 0
  3008. for (i = 0; i < list.length; ++i) {
  3009. length += list[i].length
  3010. }
  3011. }
  3012. var buffer = Buffer.allocUnsafe(length)
  3013. var pos = 0
  3014. for (i = 0; i < list.length; ++i) {
  3015. var buf = list[i]
  3016. if (!Buffer.isBuffer(buf)) {
  3017. throw new TypeError('"list" argument must be an Array of Buffers')
  3018. }
  3019. buf.copy(buffer, pos)
  3020. pos += buf.length
  3021. }
  3022. return buffer
  3023. }
  3024. function byteLength (string, encoding) {
  3025. if (Buffer.isBuffer(string)) {
  3026. return string.length
  3027. }
  3028. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  3029. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  3030. return string.byteLength
  3031. }
  3032. if (typeof string !== 'string') {
  3033. string = '' + string
  3034. }
  3035. var len = string.length
  3036. if (len === 0) return 0
  3037. // Use a for loop to avoid recursion
  3038. var loweredCase = false
  3039. for (;;) {
  3040. switch (encoding) {
  3041. case 'ascii':
  3042. case 'latin1':
  3043. case 'binary':
  3044. return len
  3045. case 'utf8':
  3046. case 'utf-8':
  3047. case undefined:
  3048. return utf8ToBytes(string).length
  3049. case 'ucs2':
  3050. case 'ucs-2':
  3051. case 'utf16le':
  3052. case 'utf-16le':
  3053. return len * 2
  3054. case 'hex':
  3055. return len >>> 1
  3056. case 'base64':
  3057. return base64ToBytes(string).length
  3058. default:
  3059. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  3060. encoding = ('' + encoding).toLowerCase()
  3061. loweredCase = true
  3062. }
  3063. }
  3064. }
  3065. Buffer.byteLength = byteLength
  3066. function slowToString (encoding, start, end) {
  3067. var loweredCase = false
  3068. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  3069. // property of a typed array.
  3070. // This behaves neither like String nor Uint8Array in that we set start/end
  3071. // to their upper/lower bounds if the value passed is out of range.
  3072. // undefined is handled specially as per ECMA-262 6th Edition,
  3073. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  3074. if (start === undefined || start < 0) {
  3075. start = 0
  3076. }
  3077. // Return early if start > this.length. Done here to prevent potential uint32
  3078. // coercion fail below.
  3079. if (start > this.length) {
  3080. return ''
  3081. }
  3082. if (end === undefined || end > this.length) {
  3083. end = this.length
  3084. }
  3085. if (end <= 0) {
  3086. return ''
  3087. }
  3088. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  3089. end >>>= 0
  3090. start >>>= 0
  3091. if (end <= start) {
  3092. return ''
  3093. }
  3094. if (!encoding) encoding = 'utf8'
  3095. while (true) {
  3096. switch (encoding) {
  3097. case 'hex':
  3098. return hexSlice(this, start, end)
  3099. case 'utf8':
  3100. case 'utf-8':
  3101. return utf8Slice(this, start, end)
  3102. case 'ascii':
  3103. return asciiSlice(this, start, end)
  3104. case 'latin1':
  3105. case 'binary':
  3106. return latin1Slice(this, start, end)
  3107. case 'base64':
  3108. return base64Slice(this, start, end)
  3109. case 'ucs2':
  3110. case 'ucs-2':
  3111. case 'utf16le':
  3112. case 'utf-16le':
  3113. return utf16leSlice(this, start, end)
  3114. default:
  3115. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  3116. encoding = (encoding + '').toLowerCase()
  3117. loweredCase = true
  3118. }
  3119. }
  3120. }
  3121. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  3122. // Buffer instances.
  3123. Buffer.prototype._isBuffer = true
  3124. function swap (b, n, m) {
  3125. var i = b[n]
  3126. b[n] = b[m]
  3127. b[m] = i
  3128. }
  3129. Buffer.prototype.swap16 = function swap16 () {
  3130. var len = this.length
  3131. if (len % 2 !== 0) {
  3132. throw new RangeError('Buffer size must be a multiple of 16-bits')
  3133. }
  3134. for (var i = 0; i < len; i += 2) {
  3135. swap(this, i, i + 1)
  3136. }
  3137. return this
  3138. }
  3139. Buffer.prototype.swap32 = function swap32 () {
  3140. var len = this.length
  3141. if (len % 4 !== 0) {
  3142. throw new RangeError('Buffer size must be a multiple of 32-bits')
  3143. }
  3144. for (var i = 0; i < len; i += 4) {
  3145. swap(this, i, i + 3)
  3146. swap(this, i + 1, i + 2)
  3147. }
  3148. return this
  3149. }
  3150. Buffer.prototype.swap64 = function swap64 () {
  3151. var len = this.length
  3152. if (len % 8 !== 0) {
  3153. throw new RangeError('Buffer size must be a multiple of 64-bits')
  3154. }
  3155. for (var i = 0; i < len; i += 8) {
  3156. swap(this, i, i + 7)
  3157. swap(this, i + 1, i + 6)
  3158. swap(this, i + 2, i + 5)
  3159. swap(this, i + 3, i + 4)
  3160. }
  3161. return this
  3162. }
  3163. Buffer.prototype.toString = function toString () {
  3164. var length = this.length | 0
  3165. if (length === 0) return ''
  3166. if (arguments.length === 0) return utf8Slice(this, 0, length)
  3167. return slowToString.apply(this, arguments)
  3168. }
  3169. Buffer.prototype.equals = function equals (b) {
  3170. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  3171. if (this === b) return true
  3172. return Buffer.compare(this, b) === 0
  3173. }
  3174. Buffer.prototype.inspect = function inspect () {
  3175. var str = ''
  3176. var max = exports.INSPECT_MAX_BYTES
  3177. if (this.length > 0) {
  3178. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  3179. if (this.length > max) str += ' ... '
  3180. }
  3181. return '<Buffer ' + str + '>'
  3182. }
  3183. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  3184. if (!Buffer.isBuffer(target)) {
  3185. throw new TypeError('Argument must be a Buffer')
  3186. }
  3187. if (start === undefined) {
  3188. start = 0
  3189. }
  3190. if (end === undefined) {
  3191. end = target ? target.length : 0
  3192. }
  3193. if (thisStart === undefined) {
  3194. thisStart = 0
  3195. }
  3196. if (thisEnd === undefined) {
  3197. thisEnd = this.length
  3198. }
  3199. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  3200. throw new RangeError('out of range index')
  3201. }
  3202. if (thisStart >= thisEnd && start >= end) {
  3203. return 0
  3204. }
  3205. if (thisStart >= thisEnd) {
  3206. return -1
  3207. }
  3208. if (start >= end) {
  3209. return 1
  3210. }
  3211. start >>>= 0
  3212. end >>>= 0
  3213. thisStart >>>= 0
  3214. thisEnd >>>= 0
  3215. if (this === target) return 0
  3216. var x = thisEnd - thisStart
  3217. var y = end - start
  3218. var len = Math.min(x, y)
  3219. var thisCopy = this.slice(thisStart, thisEnd)
  3220. var targetCopy = target.slice(start, end)
  3221. for (var i = 0; i < len; ++i) {
  3222. if (thisCopy[i] !== targetCopy[i]) {
  3223. x = thisCopy[i]
  3224. y = targetCopy[i]
  3225. break
  3226. }
  3227. }
  3228. if (x < y) return -1
  3229. if (y < x) return 1
  3230. return 0
  3231. }
  3232. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  3233. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  3234. //
  3235. // Arguments:
  3236. // - buffer - a Buffer to search
  3237. // - val - a string, Buffer, or number
  3238. // - byteOffset - an index into `buffer`; will be clamped to an int32
  3239. // - encoding - an optional encoding, relevant is val is a string
  3240. // - dir - true for indexOf, false for lastIndexOf
  3241. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  3242. // Empty buffer means no match
  3243. if (buffer.length === 0) return -1
  3244. // Normalize byteOffset
  3245. if (typeof byteOffset === 'string') {
  3246. encoding = byteOffset
  3247. byteOffset = 0
  3248. } else if (byteOffset > 0x7fffffff) {
  3249. byteOffset = 0x7fffffff
  3250. } else if (byteOffset < -0x80000000) {
  3251. byteOffset = -0x80000000
  3252. }
  3253. byteOffset = +byteOffset // Coerce to Number.
  3254. if (isNaN(byteOffset)) {
  3255. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  3256. byteOffset = dir ? 0 : (buffer.length - 1)
  3257. }
  3258. // Normalize byteOffset: negative offsets start from the end of the buffer
  3259. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  3260. if (byteOffset >= buffer.length) {
  3261. if (dir) return -1
  3262. else byteOffset = buffer.length - 1
  3263. } else if (byteOffset < 0) {
  3264. if (dir) byteOffset = 0
  3265. else return -1
  3266. }
  3267. // Normalize val
  3268. if (typeof val === 'string') {
  3269. val = Buffer.from(val, encoding)
  3270. }
  3271. // Finally, search either indexOf (if dir is true) or lastIndexOf
  3272. if (Buffer.isBuffer(val)) {
  3273. // Special case: looking for empty string/buffer always fails
  3274. if (val.length === 0) {
  3275. return -1
  3276. }
  3277. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  3278. } else if (typeof val === 'number') {
  3279. val = val & 0xFF // Search for a byte value [0-255]
  3280. if (Buffer.TYPED_ARRAY_SUPPORT &&
  3281. typeof Uint8Array.prototype.indexOf === 'function') {
  3282. if (dir) {
  3283. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  3284. } else {
  3285. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  3286. }
  3287. }
  3288. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  3289. }
  3290. throw new TypeError('val must be string, number or Buffer')
  3291. }
  3292. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  3293. var indexSize = 1
  3294. var arrLength = arr.length
  3295. var valLength = val.length
  3296. if (encoding !== undefined) {
  3297. encoding = String(encoding).toLowerCase()
  3298. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  3299. encoding === 'utf16le' || encoding === 'utf-16le') {
  3300. if (arr.length < 2 || val.length < 2) {
  3301. return -1
  3302. }
  3303. indexSize = 2
  3304. arrLength /= 2
  3305. valLength /= 2
  3306. byteOffset /= 2
  3307. }
  3308. }
  3309. function read (buf, i) {
  3310. if (indexSize === 1) {
  3311. return buf[i]
  3312. } else {
  3313. return buf.readUInt16BE(i * indexSize)
  3314. }
  3315. }
  3316. var i
  3317. if (dir) {
  3318. var foundIndex = -1
  3319. for (i = byteOffset; i < arrLength; i++) {
  3320. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  3321. if (foundIndex === -1) foundIndex = i
  3322. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  3323. } else {
  3324. if (foundIndex !== -1) i -= i - foundIndex
  3325. foundIndex = -1
  3326. }
  3327. }
  3328. } else {
  3329. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  3330. for (i = byteOffset; i >= 0; i--) {
  3331. var found = true
  3332. for (var j = 0; j < valLength; j++) {
  3333. if (read(arr, i + j) !== read(val, j)) {
  3334. found = false
  3335. break
  3336. }
  3337. }
  3338. if (found) return i
  3339. }
  3340. }
  3341. return -1
  3342. }
  3343. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  3344. return this.indexOf(val, byteOffset, encoding) !== -1
  3345. }
  3346. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  3347. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  3348. }
  3349. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  3350. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  3351. }
  3352. function hexWrite (buf, string, offset, length) {
  3353. offset = Number(offset) || 0
  3354. var remaining = buf.length - offset
  3355. if (!length) {
  3356. length = remaining
  3357. } else {
  3358. length = Number(length)
  3359. if (length > remaining) {
  3360. length = remaining
  3361. }
  3362. }
  3363. // must be an even number of digits
  3364. var strLen = string.length
  3365. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  3366. if (length > strLen / 2) {
  3367. length = strLen / 2
  3368. }
  3369. for (var i = 0; i < length; ++i) {
  3370. var parsed = parseInt(string.substr(i * 2, 2), 16)
  3371. if (isNaN(parsed)) return i
  3372. buf[offset + i] = parsed
  3373. }
  3374. return i
  3375. }
  3376. function utf8Write (buf, string, offset, length) {
  3377. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  3378. }
  3379. function asciiWrite (buf, string, offset, length) {
  3380. return blitBuffer(asciiToBytes(string), buf, offset, length)
  3381. }
  3382. function latin1Write (buf, string, offset, length) {
  3383. return asciiWrite(buf, string, offset, length)
  3384. }
  3385. function base64Write (buf, string, offset, length) {
  3386. return blitBuffer(base64ToBytes(string), buf, offset, length)
  3387. }
  3388. function ucs2Write (buf, string, offset, length) {
  3389. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  3390. }
  3391. Buffer.prototype.write = function write (string, offset, length, encoding) {
  3392. // Buffer#write(string)
  3393. if (offset === undefined) {
  3394. encoding = 'utf8'
  3395. length = this.length
  3396. offset = 0
  3397. // Buffer#write(string, encoding)
  3398. } else if (length === undefined && typeof offset === 'string') {
  3399. encoding = offset
  3400. length = this.length
  3401. offset = 0
  3402. // Buffer#write(string, offset[, length][, encoding])
  3403. } else if (isFinite(offset)) {
  3404. offset = offset | 0
  3405. if (isFinite(length)) {
  3406. length = length | 0
  3407. if (encoding === undefined) encoding = 'utf8'
  3408. } else {
  3409. encoding = length
  3410. length = undefined
  3411. }
  3412. // legacy write(string, encoding, offset, length) - remove in v0.13
  3413. } else {
  3414. throw new Error(
  3415. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  3416. )
  3417. }
  3418. var remaining = this.length - offset
  3419. if (length === undefined || length > remaining) length = remaining
  3420. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  3421. throw new RangeError('Attempt to write outside buffer bounds')
  3422. }
  3423. if (!encoding) encoding = 'utf8'
  3424. var loweredCase = false
  3425. for (;;) {
  3426. switch (encoding) {
  3427. case 'hex':
  3428. return hexWrite(this, string, offset, length)
  3429. case 'utf8':
  3430. case 'utf-8':
  3431. return utf8Write(this, string, offset, length)
  3432. case 'ascii':
  3433. return asciiWrite(this, string, offset, length)
  3434. case 'latin1':
  3435. case 'binary':
  3436. return latin1Write(this, string, offset, length)
  3437. case 'base64':
  3438. // Warning: maxLength not taken into account in base64Write
  3439. return base64Write(this, string, offset, length)
  3440. case 'ucs2':
  3441. case 'ucs-2':
  3442. case 'utf16le':
  3443. case 'utf-16le':
  3444. return ucs2Write(this, string, offset, length)
  3445. default:
  3446. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  3447. encoding = ('' + encoding).toLowerCase()
  3448. loweredCase = true
  3449. }
  3450. }
  3451. }
  3452. Buffer.prototype.toJSON = function toJSON () {
  3453. return {
  3454. type: 'Buffer',
  3455. data: Array.prototype.slice.call(this._arr || this, 0)
  3456. }
  3457. }
  3458. function base64Slice (buf, start, end) {
  3459. if (start === 0 && end === buf.length) {
  3460. return base64.fromByteArray(buf)
  3461. } else {
  3462. return base64.fromByteArray(buf.slice(start, end))
  3463. }
  3464. }
  3465. function utf8Slice (buf, start, end) {
  3466. end = Math.min(buf.length, end)
  3467. var res = []
  3468. var i = start
  3469. while (i < end) {
  3470. var firstByte = buf[i]
  3471. var codePoint = null
  3472. var bytesPerSequence = (firstByte > 0xEF) ? 4
  3473. : (firstByte > 0xDF) ? 3
  3474. : (firstByte > 0xBF) ? 2
  3475. : 1
  3476. if (i + bytesPerSequence <= end) {
  3477. var secondByte, thirdByte, fourthByte, tempCodePoint
  3478. switch (bytesPerSequence) {
  3479. case 1:
  3480. if (firstByte < 0x80) {
  3481. codePoint = firstByte
  3482. }
  3483. break
  3484. case 2:
  3485. secondByte = buf[i + 1]
  3486. if ((secondByte & 0xC0) === 0x80) {
  3487. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  3488. if (tempCodePoint > 0x7F) {
  3489. codePoint = tempCodePoint
  3490. }
  3491. }
  3492. break
  3493. case 3:
  3494. secondByte = buf[i + 1]
  3495. thirdByte = buf[i + 2]
  3496. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  3497. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  3498. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  3499. codePoint = tempCodePoint
  3500. }
  3501. }
  3502. break
  3503. case 4:
  3504. secondByte = buf[i + 1]
  3505. thirdByte = buf[i + 2]
  3506. fourthByte = buf[i + 3]
  3507. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  3508. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  3509. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  3510. codePoint = tempCodePoint
  3511. }
  3512. }
  3513. }
  3514. }
  3515. if (codePoint === null) {
  3516. // we did not generate a valid codePoint so insert a
  3517. // replacement char (U+FFFD) and advance only 1 byte
  3518. codePoint = 0xFFFD
  3519. bytesPerSequence = 1
  3520. } else if (codePoint > 0xFFFF) {
  3521. // encode to utf16 (surrogate pair dance)
  3522. codePoint -= 0x10000
  3523. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  3524. codePoint = 0xDC00 | codePoint & 0x3FF
  3525. }
  3526. res.push(codePoint)
  3527. i += bytesPerSequence
  3528. }
  3529. return decodeCodePointsArray(res)
  3530. }
  3531. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  3532. // the lowest limit is Chrome, with 0x10000 args.
  3533. // We go 1 magnitude less, for safety
  3534. var MAX_ARGUMENTS_LENGTH = 0x1000
  3535. function decodeCodePointsArray (codePoints) {
  3536. var len = codePoints.length
  3537. if (len <= MAX_ARGUMENTS_LENGTH) {
  3538. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  3539. }
  3540. // Decode in chunks to avoid "call stack size exceeded".
  3541. var res = ''
  3542. var i = 0
  3543. while (i < len) {
  3544. res += String.fromCharCode.apply(
  3545. String,
  3546. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  3547. )
  3548. }
  3549. return res
  3550. }
  3551. function asciiSlice (buf, start, end) {
  3552. var ret = ''
  3553. end = Math.min(buf.length, end)
  3554. for (var i = start; i < end; ++i) {
  3555. ret += String.fromCharCode(buf[i] & 0x7F)
  3556. }
  3557. return ret
  3558. }
  3559. function latin1Slice (buf, start, end) {
  3560. var ret = ''
  3561. end = Math.min(buf.length, end)
  3562. for (var i = start; i < end; ++i) {
  3563. ret += String.fromCharCode(buf[i])
  3564. }
  3565. return ret
  3566. }
  3567. function hexSlice (buf, start, end) {
  3568. var len = buf.length
  3569. if (!start || start < 0) start = 0
  3570. if (!end || end < 0 || end > len) end = len
  3571. var out = ''
  3572. for (var i = start; i < end; ++i) {
  3573. out += toHex(buf[i])
  3574. }
  3575. return out
  3576. }
  3577. function utf16leSlice (buf, start, end) {
  3578. var bytes = buf.slice(start, end)
  3579. var res = ''
  3580. for (var i = 0; i < bytes.length; i += 2) {
  3581. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  3582. }
  3583. return res
  3584. }
  3585. Buffer.prototype.slice = function slice (start, end) {
  3586. var len = this.length
  3587. start = ~~start
  3588. end = end === undefined ? len : ~~end
  3589. if (start < 0) {
  3590. start += len
  3591. if (start < 0) start = 0
  3592. } else if (start > len) {
  3593. start = len
  3594. }
  3595. if (end < 0) {
  3596. end += len
  3597. if (end < 0) end = 0
  3598. } else if (end > len) {
  3599. end = len
  3600. }
  3601. if (end < start) end = start
  3602. var newBuf
  3603. if (Buffer.TYPED_ARRAY_SUPPORT) {
  3604. newBuf = this.subarray(start, end)
  3605. newBuf.__proto__ = Buffer.prototype
  3606. } else {
  3607. var sliceLen = end - start
  3608. newBuf = new Buffer(sliceLen, undefined)
  3609. for (var i = 0; i < sliceLen; ++i) {
  3610. newBuf[i] = this[i + start]
  3611. }
  3612. }
  3613. return newBuf
  3614. }
  3615. /*
  3616. * Need to make sure that buffer isn't trying to write out of bounds.
  3617. */
  3618. function checkOffset (offset, ext, length) {
  3619. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  3620. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  3621. }
  3622. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  3623. offset = offset | 0
  3624. byteLength = byteLength | 0
  3625. if (!noAssert) checkOffset(offset, byteLength, this.length)
  3626. var val = this[offset]
  3627. var mul = 1
  3628. var i = 0
  3629. while (++i < byteLength && (mul *= 0x100)) {
  3630. val += this[offset + i] * mul
  3631. }
  3632. return val
  3633. }
  3634. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  3635. offset = offset | 0
  3636. byteLength = byteLength | 0
  3637. if (!noAssert) {
  3638. checkOffset(offset, byteLength, this.length)
  3639. }
  3640. var val = this[offset + --byteLength]
  3641. var mul = 1
  3642. while (byteLength > 0 && (mul *= 0x100)) {
  3643. val += this[offset + --byteLength] * mul
  3644. }
  3645. return val
  3646. }
  3647. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  3648. if (!noAssert) checkOffset(offset, 1, this.length)
  3649. return this[offset]
  3650. }
  3651. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  3652. if (!noAssert) checkOffset(offset, 2, this.length)
  3653. return this[offset] | (this[offset + 1] << 8)
  3654. }
  3655. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  3656. if (!noAssert) checkOffset(offset, 2, this.length)
  3657. return (this[offset] << 8) | this[offset + 1]
  3658. }
  3659. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  3660. if (!noAssert) checkOffset(offset, 4, this.length)
  3661. return ((this[offset]) |
  3662. (this[offset + 1] << 8) |
  3663. (this[offset + 2] << 16)) +
  3664. (this[offset + 3] * 0x1000000)
  3665. }
  3666. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  3667. if (!noAssert) checkOffset(offset, 4, this.length)
  3668. return (this[offset] * 0x1000000) +
  3669. ((this[offset + 1] << 16) |
  3670. (this[offset + 2] << 8) |
  3671. this[offset + 3])
  3672. }
  3673. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  3674. offset = offset | 0
  3675. byteLength = byteLength | 0
  3676. if (!noAssert) checkOffset(offset, byteLength, this.length)
  3677. var val = this[offset]
  3678. var mul = 1
  3679. var i = 0
  3680. while (++i < byteLength && (mul *= 0x100)) {
  3681. val += this[offset + i] * mul
  3682. }
  3683. mul *= 0x80
  3684. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  3685. return val
  3686. }
  3687. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  3688. offset = offset | 0
  3689. byteLength = byteLength | 0
  3690. if (!noAssert) checkOffset(offset, byteLength, this.length)
  3691. var i = byteLength
  3692. var mul = 1
  3693. var val = this[offset + --i]
  3694. while (i > 0 && (mul *= 0x100)) {
  3695. val += this[offset + --i] * mul
  3696. }
  3697. mul *= 0x80
  3698. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  3699. return val
  3700. }
  3701. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  3702. if (!noAssert) checkOffset(offset, 1, this.length)
  3703. if (!(this[offset] & 0x80)) return (this[offset])
  3704. return ((0xff - this[offset] + 1) * -1)
  3705. }
  3706. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  3707. if (!noAssert) checkOffset(offset, 2, this.length)
  3708. var val = this[offset] | (this[offset + 1] << 8)
  3709. return (val & 0x8000) ? val | 0xFFFF0000 : val
  3710. }
  3711. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  3712. if (!noAssert) checkOffset(offset, 2, this.length)
  3713. var val = this[offset + 1] | (this[offset] << 8)
  3714. return (val & 0x8000) ? val | 0xFFFF0000 : val
  3715. }
  3716. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  3717. if (!noAssert) checkOffset(offset, 4, this.length)
  3718. return (this[offset]) |
  3719. (this[offset + 1] << 8) |
  3720. (this[offset + 2] << 16) |
  3721. (this[offset + 3] << 24)
  3722. }
  3723. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  3724. if (!noAssert) checkOffset(offset, 4, this.length)
  3725. return (this[offset] << 24) |
  3726. (this[offset + 1] << 16) |
  3727. (this[offset + 2] << 8) |
  3728. (this[offset + 3])
  3729. }
  3730. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  3731. if (!noAssert) checkOffset(offset, 4, this.length)
  3732. return ieee754.read(this, offset, true, 23, 4)
  3733. }
  3734. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  3735. if (!noAssert) checkOffset(offset, 4, this.length)
  3736. return ieee754.read(this, offset, false, 23, 4)
  3737. }
  3738. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  3739. if (!noAssert) checkOffset(offset, 8, this.length)
  3740. return ieee754.read(this, offset, true, 52, 8)
  3741. }
  3742. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  3743. if (!noAssert) checkOffset(offset, 8, this.length)
  3744. return ieee754.read(this, offset, false, 52, 8)
  3745. }
  3746. function checkInt (buf, value, offset, ext, max, min) {
  3747. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  3748. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  3749. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  3750. }
  3751. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  3752. value = +value
  3753. offset = offset | 0
  3754. byteLength = byteLength | 0
  3755. if (!noAssert) {
  3756. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  3757. checkInt(this, value, offset, byteLength, maxBytes, 0)
  3758. }
  3759. var mul = 1
  3760. var i = 0
  3761. this[offset] = value & 0xFF
  3762. while (++i < byteLength && (mul *= 0x100)) {
  3763. this[offset + i] = (value / mul) & 0xFF
  3764. }
  3765. return offset + byteLength
  3766. }
  3767. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  3768. value = +value
  3769. offset = offset | 0
  3770. byteLength = byteLength | 0
  3771. if (!noAssert) {
  3772. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  3773. checkInt(this, value, offset, byteLength, maxBytes, 0)
  3774. }
  3775. var i = byteLength - 1
  3776. var mul = 1
  3777. this[offset + i] = value & 0xFF
  3778. while (--i >= 0 && (mul *= 0x100)) {
  3779. this[offset + i] = (value / mul) & 0xFF
  3780. }
  3781. return offset + byteLength
  3782. }
  3783. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  3784. value = +value
  3785. offset = offset | 0
  3786. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  3787. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  3788. this[offset] = (value & 0xff)
  3789. return offset + 1
  3790. }
  3791. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  3792. if (value < 0) value = 0xffff + value + 1
  3793. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  3794. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  3795. (littleEndian ? i : 1 - i) * 8
  3796. }
  3797. }
  3798. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  3799. value = +value
  3800. offset = offset | 0
  3801. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  3802. if (Buffer.TYPED_ARRAY_SUPPORT) {
  3803. this[offset] = (value & 0xff)
  3804. this[offset + 1] = (value >>> 8)
  3805. } else {
  3806. objectWriteUInt16(this, value, offset, true)
  3807. }
  3808. return offset + 2
  3809. }
  3810. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  3811. value = +value
  3812. offset = offset | 0
  3813. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  3814. if (Buffer.TYPED_ARRAY_SUPPORT) {
  3815. this[offset] = (value >>> 8)
  3816. this[offset + 1] = (value & 0xff)
  3817. } else {
  3818. objectWriteUInt16(this, value, offset, false)
  3819. }
  3820. return offset + 2
  3821. }
  3822. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  3823. if (value < 0) value = 0xffffffff + value + 1
  3824. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  3825. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  3826. }
  3827. }
  3828. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  3829. value = +value
  3830. offset = offset | 0
  3831. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  3832. if (Buffer.TYPED_ARRAY_SUPPORT) {
  3833. this[offset + 3] = (value >>> 24)
  3834. this[offset + 2] = (value >>> 16)
  3835. this[offset + 1] = (value >>> 8)
  3836. this[offset] = (value & 0xff)
  3837. } else {
  3838. objectWriteUInt32(this, value, offset, true)
  3839. }
  3840. return offset + 4
  3841. }
  3842. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  3843. value = +value
  3844. offset = offset | 0
  3845. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  3846. if (Buffer.TYPED_ARRAY_SUPPORT) {
  3847. this[offset] = (value >>> 24)
  3848. this[offset + 1] = (value >>> 16)
  3849. this[offset + 2] = (value >>> 8)
  3850. this[offset + 3] = (value & 0xff)
  3851. } else {
  3852. objectWriteUInt32(this, value, offset, false)
  3853. }
  3854. return offset + 4
  3855. }
  3856. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  3857. value = +value
  3858. offset = offset | 0
  3859. if (!noAssert) {
  3860. var limit = Math.pow(2, 8 * byteLength - 1)
  3861. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  3862. }
  3863. var i = 0
  3864. var mul = 1
  3865. var sub = 0
  3866. this[offset] = value & 0xFF
  3867. while (++i < byteLength && (mul *= 0x100)) {
  3868. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  3869. sub = 1
  3870. }
  3871. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  3872. }
  3873. return offset + byteLength
  3874. }
  3875. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  3876. value = +value
  3877. offset = offset | 0
  3878. if (!noAssert) {
  3879. var limit = Math.pow(2, 8 * byteLength - 1)
  3880. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  3881. }
  3882. var i = byteLength - 1
  3883. var mul = 1
  3884. var sub = 0
  3885. this[offset + i] = value & 0xFF
  3886. while (--i >= 0 && (mul *= 0x100)) {
  3887. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  3888. sub = 1
  3889. }
  3890. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  3891. }
  3892. return offset + byteLength
  3893. }
  3894. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  3895. value = +value
  3896. offset = offset | 0
  3897. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  3898. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  3899. if (value < 0) value = 0xff + value + 1
  3900. this[offset] = (value & 0xff)
  3901. return offset + 1
  3902. }
  3903. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  3904. value = +value
  3905. offset = offset | 0
  3906. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  3907. if (Buffer.TYPED_ARRAY_SUPPORT) {
  3908. this[offset] = (value & 0xff)
  3909. this[offset + 1] = (value >>> 8)
  3910. } else {
  3911. objectWriteUInt16(this, value, offset, true)
  3912. }
  3913. return offset + 2
  3914. }
  3915. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  3916. value = +value
  3917. offset = offset | 0
  3918. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  3919. if (Buffer.TYPED_ARRAY_SUPPORT) {
  3920. this[offset] = (value >>> 8)
  3921. this[offset + 1] = (value & 0xff)
  3922. } else {
  3923. objectWriteUInt16(this, value, offset, false)
  3924. }
  3925. return offset + 2
  3926. }
  3927. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  3928. value = +value
  3929. offset = offset | 0
  3930. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  3931. if (Buffer.TYPED_ARRAY_SUPPORT) {
  3932. this[offset] = (value & 0xff)
  3933. this[offset + 1] = (value >>> 8)
  3934. this[offset + 2] = (value >>> 16)
  3935. this[offset + 3] = (value >>> 24)
  3936. } else {
  3937. objectWriteUInt32(this, value, offset, true)
  3938. }
  3939. return offset + 4
  3940. }
  3941. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  3942. value = +value
  3943. offset = offset | 0
  3944. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  3945. if (value < 0) value = 0xffffffff + value + 1
  3946. if (Buffer.TYPED_ARRAY_SUPPORT) {
  3947. this[offset] = (value >>> 24)
  3948. this[offset + 1] = (value >>> 16)
  3949. this[offset + 2] = (value >>> 8)
  3950. this[offset + 3] = (value & 0xff)
  3951. } else {
  3952. objectWriteUInt32(this, value, offset, false)
  3953. }
  3954. return offset + 4
  3955. }
  3956. function checkIEEE754 (buf, value, offset, ext, max, min) {
  3957. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  3958. if (offset < 0) throw new RangeError('Index out of range')
  3959. }
  3960. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  3961. if (!noAssert) {
  3962. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  3963. }
  3964. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  3965. return offset + 4
  3966. }
  3967. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  3968. return writeFloat(this, value, offset, true, noAssert)
  3969. }
  3970. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  3971. return writeFloat(this, value, offset, false, noAssert)
  3972. }
  3973. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  3974. if (!noAssert) {
  3975. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  3976. }
  3977. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  3978. return offset + 8
  3979. }
  3980. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  3981. return writeDouble(this, value, offset, true, noAssert)
  3982. }
  3983. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  3984. return writeDouble(this, value, offset, false, noAssert)
  3985. }
  3986. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  3987. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  3988. if (!start) start = 0
  3989. if (!end && end !== 0) end = this.length
  3990. if (targetStart >= target.length) targetStart = target.length
  3991. if (!targetStart) targetStart = 0
  3992. if (end > 0 && end < start) end = start
  3993. // Copy 0 bytes; we're done
  3994. if (end === start) return 0
  3995. if (target.length === 0 || this.length === 0) return 0
  3996. // Fatal error conditions
  3997. if (targetStart < 0) {
  3998. throw new RangeError('targetStart out of bounds')
  3999. }
  4000. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  4001. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  4002. // Are we oob?
  4003. if (end > this.length) end = this.length
  4004. if (target.length - targetStart < end - start) {
  4005. end = target.length - targetStart + start
  4006. }
  4007. var len = end - start
  4008. var i
  4009. if (this === target && start < targetStart && targetStart < end) {
  4010. // descending copy from end
  4011. for (i = len - 1; i >= 0; --i) {
  4012. target[i + targetStart] = this[i + start]
  4013. }
  4014. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  4015. // ascending copy from start
  4016. for (i = 0; i < len; ++i) {
  4017. target[i + targetStart] = this[i + start]
  4018. }
  4019. } else {
  4020. Uint8Array.prototype.set.call(
  4021. target,
  4022. this.subarray(start, start + len),
  4023. targetStart
  4024. )
  4025. }
  4026. return len
  4027. }
  4028. // Usage:
  4029. // buffer.fill(number[, offset[, end]])
  4030. // buffer.fill(buffer[, offset[, end]])
  4031. // buffer.fill(string[, offset[, end]][, encoding])
  4032. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  4033. // Handle string cases:
  4034. if (typeof val === 'string') {
  4035. if (typeof start === 'string') {
  4036. encoding = start
  4037. start = 0
  4038. end = this.length
  4039. } else if (typeof end === 'string') {
  4040. encoding = end
  4041. end = this.length
  4042. }
  4043. if (val.length === 1) {
  4044. var code = val.charCodeAt(0)
  4045. if (code < 256) {
  4046. val = code
  4047. }
  4048. }
  4049. if (encoding !== undefined && typeof encoding !== 'string') {
  4050. throw new TypeError('encoding must be a string')
  4051. }
  4052. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  4053. throw new TypeError('Unknown encoding: ' + encoding)
  4054. }
  4055. } else if (typeof val === 'number') {
  4056. val = val & 255
  4057. }
  4058. // Invalid ranges are not set to a default, so can range check early.
  4059. if (start < 0 || this.length < start || this.length < end) {
  4060. throw new RangeError('Out of range index')
  4061. }
  4062. if (end <= start) {
  4063. return this
  4064. }
  4065. start = start >>> 0
  4066. end = end === undefined ? this.length : end >>> 0
  4067. if (!val) val = 0
  4068. var i
  4069. if (typeof val === 'number') {
  4070. for (i = start; i < end; ++i) {
  4071. this[i] = val
  4072. }
  4073. } else {
  4074. var bytes = Buffer.isBuffer(val)
  4075. ? val
  4076. : utf8ToBytes(new Buffer(val, encoding).toString())
  4077. var len = bytes.length
  4078. for (i = 0; i < end - start; ++i) {
  4079. this[i + start] = bytes[i % len]
  4080. }
  4081. }
  4082. return this
  4083. }
  4084. // HELPER FUNCTIONS
  4085. // ================
  4086. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  4087. function base64clean (str) {
  4088. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  4089. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  4090. // Node converts strings with length < 2 to ''
  4091. if (str.length < 2) return ''
  4092. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  4093. while (str.length % 4 !== 0) {
  4094. str = str + '='
  4095. }
  4096. return str
  4097. }
  4098. function stringtrim (str) {
  4099. if (str.trim) return str.trim()
  4100. return str.replace(/^\s+|\s+$/g, '')
  4101. }
  4102. function toHex (n) {
  4103. if (n < 16) return '0' + n.toString(16)
  4104. return n.toString(16)
  4105. }
  4106. function utf8ToBytes (string, units) {
  4107. units = units || Infinity
  4108. var codePoint
  4109. var length = string.length
  4110. var leadSurrogate = null
  4111. var bytes = []
  4112. for (var i = 0; i < length; ++i) {
  4113. codePoint = string.charCodeAt(i)
  4114. // is surrogate component
  4115. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  4116. // last char was a lead
  4117. if (!leadSurrogate) {
  4118. // no lead yet
  4119. if (codePoint > 0xDBFF) {
  4120. // unexpected trail
  4121. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  4122. continue
  4123. } else if (i + 1 === length) {
  4124. // unpaired lead
  4125. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  4126. continue
  4127. }
  4128. // valid lead
  4129. leadSurrogate = codePoint
  4130. continue
  4131. }
  4132. // 2 leads in a row
  4133. if (codePoint < 0xDC00) {
  4134. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  4135. leadSurrogate = codePoint
  4136. continue
  4137. }
  4138. // valid surrogate pair
  4139. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  4140. } else if (leadSurrogate) {
  4141. // valid bmp char, but last char was a lead
  4142. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  4143. }
  4144. leadSurrogate = null
  4145. // encode utf8
  4146. if (codePoint < 0x80) {
  4147. if ((units -= 1) < 0) break
  4148. bytes.push(codePoint)
  4149. } else if (codePoint < 0x800) {
  4150. if ((units -= 2) < 0) break
  4151. bytes.push(
  4152. codePoint >> 0x6 | 0xC0,
  4153. codePoint & 0x3F | 0x80
  4154. )
  4155. } else if (codePoint < 0x10000) {
  4156. if ((units -= 3) < 0) break
  4157. bytes.push(
  4158. codePoint >> 0xC | 0xE0,
  4159. codePoint >> 0x6 & 0x3F | 0x80,
  4160. codePoint & 0x3F | 0x80
  4161. )
  4162. } else if (codePoint < 0x110000) {
  4163. if ((units -= 4) < 0) break
  4164. bytes.push(
  4165. codePoint >> 0x12 | 0xF0,
  4166. codePoint >> 0xC & 0x3F | 0x80,
  4167. codePoint >> 0x6 & 0x3F | 0x80,
  4168. codePoint & 0x3F | 0x80
  4169. )
  4170. } else {
  4171. throw new Error('Invalid code point')
  4172. }
  4173. }
  4174. return bytes
  4175. }
  4176. function asciiToBytes (str) {
  4177. var byteArray = []
  4178. for (var i = 0; i < str.length; ++i) {
  4179. // Node's code seems to be doing this and not & 0x7F..
  4180. byteArray.push(str.charCodeAt(i) & 0xFF)
  4181. }
  4182. return byteArray
  4183. }
  4184. function utf16leToBytes (str, units) {
  4185. var c, hi, lo
  4186. var byteArray = []
  4187. for (var i = 0; i < str.length; ++i) {
  4188. if ((units -= 2) < 0) break
  4189. c = str.charCodeAt(i)
  4190. hi = c >> 8
  4191. lo = c % 256
  4192. byteArray.push(lo)
  4193. byteArray.push(hi)
  4194. }
  4195. return byteArray
  4196. }
  4197. function base64ToBytes (str) {
  4198. return base64.toByteArray(base64clean(str))
  4199. }
  4200. function blitBuffer (src, dst, offset, length) {
  4201. for (var i = 0; i < length; ++i) {
  4202. if ((i + offset >= dst.length) || (i >= src.length)) break
  4203. dst[i + offset] = src[i]
  4204. }
  4205. return i
  4206. }
  4207. function isnan (val) {
  4208. return val !== val // eslint-disable-line no-self-compare
  4209. }
  4210. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(30)))
  4211. /***/ }),
  4212. /* 16 */
  4213. /***/ (function(module, exports, __webpack_require__) {
  4214. "use strict";
  4215. exports.__esModule = true;
  4216. var _container = __webpack_require__(13);
  4217. var _container2 = _interopRequireDefault(_container);
  4218. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4219. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4220. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4221. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  4222. /**
  4223. * Represents an at-rule.
  4224. *
  4225. * If it’s followed in the CSS by a {} block, this node will have
  4226. * a nodes property representing its children.
  4227. *
  4228. * @extends Container
  4229. *
  4230. * @example
  4231. * const root = postcss.parse('@charset "UTF-8"; @media print {}');
  4232. *
  4233. * const charset = root.first;
  4234. * charset.type //=> 'atrule'
  4235. * charset.nodes //=> undefined
  4236. *
  4237. * const media = root.last;
  4238. * media.nodes //=> []
  4239. */
  4240. var AtRule = function (_Container) {
  4241. _inherits(AtRule, _Container);
  4242. function AtRule(defaults) {
  4243. _classCallCheck(this, AtRule);
  4244. var _this = _possibleConstructorReturn(this, _Container.call(this, defaults));
  4245. _this.type = 'atrule';
  4246. return _this;
  4247. }
  4248. AtRule.prototype.append = function append() {
  4249. var _Container$prototype$;
  4250. if (!this.nodes) this.nodes = [];
  4251. for (var _len = arguments.length, children = Array(_len), _key = 0; _key < _len; _key++) {
  4252. children[_key] = arguments[_key];
  4253. }
  4254. return (_Container$prototype$ = _Container.prototype.append).call.apply(_Container$prototype$, [this].concat(children));
  4255. };
  4256. AtRule.prototype.prepend = function prepend() {
  4257. var _Container$prototype$2;
  4258. if (!this.nodes) this.nodes = [];
  4259. for (var _len2 = arguments.length, children = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  4260. children[_key2] = arguments[_key2];
  4261. }
  4262. return (_Container$prototype$2 = _Container.prototype.prepend).call.apply(_Container$prototype$2, [this].concat(children));
  4263. };
  4264. /**
  4265. * @memberof AtRule#
  4266. * @member {string} name - the at-rule’s name immediately follows the `@`
  4267. *
  4268. * @example
  4269. * const root = postcss.parse('@media print {}');
  4270. * media.name //=> 'media'
  4271. * const media = root.first;
  4272. */
  4273. /**
  4274. * @memberof AtRule#
  4275. * @member {string} params - the at-rule’s parameters, the values
  4276. * that follow the at-rule’s name but precede
  4277. * any {} block
  4278. *
  4279. * @example
  4280. * const root = postcss.parse('@media print, screen {}');
  4281. * const media = root.first;
  4282. * media.params //=> 'print, screen'
  4283. */
  4284. /**
  4285. * @memberof AtRule#
  4286. * @member {object} raws - Information to generate byte-to-byte equal
  4287. * node string as it was in the origin input.
  4288. *
  4289. * Every parser saves its own properties,
  4290. * but the default CSS parser uses:
  4291. *
  4292. * * `before`: the space symbols before the node. It also stores `*`
  4293. * and `_` symbols before the declaration (IE hack).
  4294. * * `after`: the space symbols after the last child of the node
  4295. * to the end of the node.
  4296. * * `between`: the symbols between the property and value
  4297. * for declarations, selector and `{` for rules, or last parameter
  4298. * and `{` for at-rules.
  4299. * * `semicolon`: contains true if the last child has
  4300. * an (optional) semicolon.
  4301. * * `afterName`: the space between the at-rule name and its parameters.
  4302. *
  4303. * PostCSS cleans at-rule parameters from comments and extra spaces,
  4304. * but it stores origin content in raws properties.
  4305. * As such, if you don’t change a declaration’s value,
  4306. * PostCSS will use the raw value with comments.
  4307. *
  4308. * @example
  4309. * const root = postcss.parse(' @media\nprint {\n}')
  4310. * root.first.first.raws //=> { before: ' ',
  4311. * // between: ' ',
  4312. * // afterName: '\n',
  4313. * // after: '\n' }
  4314. */
  4315. return AtRule;
  4316. }(_container2.default);
  4317. exports.default = AtRule;
  4318. module.exports = exports['default'];
  4319. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImF0LXJ1bGUuZXM2Il0sIm5hbWVzIjpbIkF0UnVsZSIsImRlZmF1bHRzIiwidHlwZSIsImFwcGVuZCIsIm5vZGVzIiwiY2hpbGRyZW4iLCJwcmVwZW5kIl0sIm1hcHBpbmdzIjoiOzs7O0FBQUE7Ozs7Ozs7Ozs7OztBQUVBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7SUFrQk1BLE07OztBQUVGLGtCQUFZQyxRQUFaLEVBQXNCO0FBQUE7O0FBQUEsaURBQ2xCLHNCQUFNQSxRQUFOLENBRGtCOztBQUVsQixVQUFLQyxJQUFMLEdBQVksUUFBWjtBQUZrQjtBQUdyQjs7bUJBRURDLE0scUJBQW9CO0FBQUE7O0FBQ2hCLFFBQUssQ0FBQyxLQUFLQyxLQUFYLEVBQW1CLEtBQUtBLEtBQUwsR0FBYSxFQUFiOztBQURILHNDQUFWQyxRQUFVO0FBQVZBLGNBQVU7QUFBQTs7QUFFaEIsV0FBTyw4Q0F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dGVyOiAnXFxuJyB9XG4gICAgICovXG59XG5cbmV4cG9ydCBkZWZhdWx0IEF0UnVsZTtcbiJdfQ==
  4320. /***/ }),
  4321. /* 17 */
  4322. /***/ (function(module, exports, __webpack_require__) {
  4323. "use strict";
  4324. exports.__esModule = true;
  4325. var _node = __webpack_require__(19);
  4326. var _node2 = _interopRequireDefault(_node);
  4327. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4328. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4329. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4330. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  4331. /**
  4332. * Represents a comment between declarations or statements (rule and at-rules).
  4333. *
  4334. * Comments inside selectors, at-rule parameters, or declaration values
  4335. * will be stored in the `raws` properties explained above.
  4336. *
  4337. * @extends Node
  4338. */
  4339. var Comment = function (_Node) {
  4340. _inherits(Comment, _Node);
  4341. function Comment(defaults) {
  4342. _classCallCheck(this, Comment);
  4343. var _this = _possibleConstructorReturn(this, _Node.call(this, defaults));
  4344. _this.type = 'comment';
  4345. return _this;
  4346. }
  4347. /**
  4348. * @memberof Comment#
  4349. * @member {string} text - the comment’s text
  4350. */
  4351. /**
  4352. * @memberof Comment#
  4353. * @member {object} raws - Information to generate byte-to-byte equal
  4354. * node string as it was in the origin input.
  4355. *
  4356. * Every parser saves its own properties,
  4357. * but the default CSS parser uses:
  4358. *
  4359. * * `before`: the space symbols before the node.
  4360. * * `left`: the space symbols between `/*` and the comment’s text.
  4361. * * `right`: the space symbols between the comment’s text.
  4362. */
  4363. return Comment;
  4364. }(_node2.default);
  4365. exports.default = Comment;
  4366. module.exports = exports['default'];
  4367. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbW1lbnQuZXM2Il0sIm5hbWVzIjpbIkNvbW1lbnQiLCJkZWZhdWx0cyIsInR5cGUiXSwibWFwcGluZ3MiOiI7Ozs7QUFBQTs7Ozs7Ozs7Ozs7O0FBRUE7Ozs7Ozs7O0lBUU1BLE87OztBQUVGLG1CQUFZQyxRQUFaLEVBQXNCO0FBQUE7O0FBQUEsaURBQ2xCLGlCQUFNQSxRQUFOLENBRGtCOztBQUVsQixVQUFLQyxJQUFMLEdBQVksU0FBWjtBQUZrQjtBQUdyQjs7QUFFRDs7Ozs7QUFLQTs7Ozs7Ozs7Ozs7Ozs7Ozs7a0JBY1dGLE8iLCJmaWxlIjoiY29tbWVudC5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBOb2RlIGZyb20gJy4vbm9kZSc7XG5cbi8qKlxuICogUmVwcmVzZW50cyBhIGNvbW1lbnQgYmV0d2VlbiBkZWNsYXJhdGlvbnMgb3Igc3RhdGVtZW50cyAocnVsZSBhbmQgYXQtcnVsZXMpLlxuICpcbiAqIENvbW1lbnRzIGluc2lkZSBzZWxlY3RvcnMsIGF0LXJ1bGUgcGFyYW1ldGVycywgb3IgZGVjbGFyYXRpb24gdmFsdWVzXG4gKiB3aWxsIGJlIHN0b3JlZCBpbiB0aGUgYHJhd3NgIHByb3BlcnRpZXMgZXhwbGFpbmVkIGFib3ZlLlxuICpcbiAqIEBleHRlbmRzIE5vZGVcbiAqL1xuY2xhc3MgQ29tbWVudCBleHRlbmRzIE5vZGUge1xuXG4gICAgY29uc3RydWN0b3IoZGVmYXVsdHMpIHtcbiAgICAgICAgc3VwZXIoZGVmYXVsdHMpO1xuICAgICAgICB0aGlzLnR5cGUgPSAnY29tbWVudCc7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQG1lbWJlcm9mIENvbW1lbnQjXG4gICAgICogQG1lbWJlciB7c3RyaW5nfSB0ZXh0IC0gdGhlIGNvbW1lbnTigJlzIHRleHRcbiAgICAgKi9cblxuICAgIC8qKlxuICAgICAqIEBtZW1iZXJvZiBDb21tZW50I1xuICAgICAqIEBtZW1iZXIge29iamVjdH0gcmF3cyAtIEluZm9ybWF0aW9uIHRvIGdlbmVyYXRlIGJ5dGUtdG8tYnl0ZSBlcXVhbFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUgc3RyaW5nIGFzIGl0IHdhcyBpbiB0aGUgb3JpZ2luIGlucHV0LlxuICAgICAqXG4gICAgICogRXZlcnkgcGFyc2VyIHNhdmVzIGl0cyBvd24gcHJvcGVydGllcyxcbiAgICAgKiBidXQgdGhlIGRlZmF1bHQgQ1NTIHBhcnNlciB1c2VzOlxuICAgICAqXG4gICAgICogKiBgYmVmb3JlYDogdGhlIHNwYWNlIHN5bWJvbHMgYmVmb3JlIHRoZSBub2RlLlxuICAgICAqICogYGxlZnRgOiB0aGUgc3BhY2Ugc3ltYm9scyBiZXR3ZWVuIGAvKmAgYW5kIHRoZSBjb21tZW504oCZcyB0ZXh0LlxuICAgICAqICogYHJpZ2h0YDogdGhlIHNwYWNlIHN5bWJvbHMgYmV0d2VlbiB0aGUgY29tbWVudOKAmXMgdGV4dC5cbiAgICAgKi9cbn1cblxuZXhwb3J0IGRlZmF1bHQgQ29tbWVudDtcbiJdfQ==
  4368. /***/ }),
  4369. /* 18 */
  4370. /***/ (function(module, exports, __webpack_require__) {
  4371. "use strict";
  4372. exports.__esModule = true;
  4373. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  4374. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4375. var _cssSyntaxError = __webpack_require__(38);
  4376. var _cssSyntaxError2 = _interopRequireDefault(_cssSyntaxError);
  4377. var _previousMap = __webpack_require__(134);
  4378. var _previousMap2 = _interopRequireDefault(_previousMap);
  4379. var _path = __webpack_require__(5);
  4380. var _path2 = _interopRequireDefault(_path);
  4381. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4382. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4383. var sequence = 0;
  4384. /**
  4385. * Represents the source CSS.
  4386. *
  4387. * @example
  4388. * const root = postcss.parse(css, { from: file });
  4389. * const input = root.source.input;
  4390. */
  4391. var Input = function () {
  4392. /**
  4393. * @param {string} css - input CSS source
  4394. * @param {object} [opts] - {@link Processor#process} options
  4395. */
  4396. function Input(css) {
  4397. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  4398. _classCallCheck(this, Input);
  4399. if (css === null || (typeof css === 'undefined' ? 'undefined' : _typeof(css)) === 'object' && !css.toString) {
  4400. throw new Error('PostCSS received ' + css + ' instead of CSS string');
  4401. }
  4402. /**
  4403. * @member {string} - input CSS source
  4404. *
  4405. * @example
  4406. * const input = postcss.parse('a{}', { from: file }).input;
  4407. * input.css //=> "a{}";
  4408. */
  4409. this.css = css.toString();
  4410. if (this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE') {
  4411. this.css = this.css.slice(1);
  4412. }
  4413. if (opts.from) {
  4414. if (/^\w+:\/\//.test(opts.from)) {
  4415. /**
  4416. * @member {string} - The absolute path to the CSS source file
  4417. * defined with the `from` option.
  4418. *
  4419. * @example
  4420. * const root = postcss.parse(css, { from: 'a.css' });
  4421. * root.source.input.file //=> '/home/ai/a.css'
  4422. */
  4423. this.file = opts.from;
  4424. } else {
  4425. this.file = _path2.default.resolve(opts.from);
  4426. }
  4427. }
  4428. var map = new _previousMap2.default(this.css, opts);
  4429. if (map.text) {
  4430. /**
  4431. * @member {PreviousMap} - The input source map passed from
  4432. * a compilation step before PostCSS
  4433. * (for example, from Sass compiler).
  4434. *
  4435. * @example
  4436. * root.source.input.map.consumer().sources //=> ['a.sass']
  4437. */
  4438. this.map = map;
  4439. var file = map.consumer().file;
  4440. if (!this.file && file) this.file = this.mapResolve(file);
  4441. }
  4442. if (!this.file) {
  4443. sequence += 1;
  4444. /**
  4445. * @member {string} - The unique ID of the CSS source. It will be
  4446. * created if `from` option is not provided
  4447. * (because PostCSS does not know the file path).
  4448. *
  4449. * @example
  4450. * const root = postcss.parse(css);
  4451. * root.source.input.file //=> undefined
  4452. * root.source.input.id //=> "<input css 1>"
  4453. */
  4454. this.id = '<input css ' + sequence + '>';
  4455. }
  4456. if (this.map) this.map.file = this.from;
  4457. }
  4458. Input.prototype.error = function error(message, line, column) {
  4459. var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  4460. var result = void 0;
  4461. var origin = this.origin(line, column);
  4462. if (origin) {
  4463. result = new _cssSyntaxError2.default(message, origin.line, origin.column, origin.source, origin.file, opts.plugin);
  4464. } else {
  4465. result = new _cssSyntaxError2.default(message, line, column, this.css, this.file, opts.plugin);
  4466. }
  4467. result.input = { line: line, column: column, source: this.css };
  4468. if (this.file) result.input.file = this.file;
  4469. return result;
  4470. };
  4471. /**
  4472. * Reads the input source map and returns a symbol position
  4473. * in the input source (e.g., in a Sass file that was compiled
  4474. * to CSS before being passed to PostCSS).
  4475. *
  4476. * @param {number} line - line in input CSS
  4477. * @param {number} column - column in input CSS
  4478. *
  4479. * @return {filePosition} position in input source
  4480. *
  4481. * @example
  4482. * root.source.input.origin(1, 1) //=> { file: 'a.css', line: 3, column: 1 }
  4483. */
  4484. Input.prototype.origin = function origin(line, column) {
  4485. if (!this.map) return false;
  4486. var consumer = this.map.consumer();
  4487. var from = consumer.originalPositionFor({ line: line, column: column });
  4488. if (!from.source) return false;
  4489. var result = {
  4490. file: this.mapResolve(from.source),
  4491. line: from.line,
  4492. column: from.column
  4493. };
  4494. var source = consumer.sourceContentFor(from.source);
  4495. if (source) result.source = source;
  4496. return result;
  4497. };
  4498. Input.prototype.mapResolve = function mapResolve(file) {
  4499. if (/^\w+:\/\//.test(file)) {
  4500. return file;
  4501. } else {
  4502. return _path2.default.resolve(this.map.consumer().sourceRoot || '.', file);
  4503. }
  4504. };
  4505. /**
  4506. * The CSS source identifier. Contains {@link Input#file} if the user
  4507. * set the `from` option, or {@link Input#id} if they did not.
  4508. * @type {string}
  4509. *
  4510. * @example
  4511. * const root = postcss.parse(css, { from: 'a.css' });
  4512. * root.source.input.from //=> "/home/ai/a.css"
  4513. *
  4514. * const root = postcss.parse(css);
  4515. * root.source.input.from //=> "<input css 1>"
  4516. */
  4517. _createClass(Input, [{
  4518. key: 'from',
  4519. get: function get() {
  4520. return this.file || this.id;
  4521. }
  4522. }]);
  4523. return Input;
  4524. }();
  4525. exports.default = Input;
  4526. /**
  4527. * @typedef {object} filePosition
  4528. * @property {string} file - path to file
  4529. * @property {number} line - source line in file
  4530. * @property {number} column - source column in file
  4531. */
  4532. module.exports = exports['default'];
  4533. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmVzNiJdLCJuYW1lcyI6WyJzZXF1ZW5jZSIsIklucHV0IiwiY3NzIiwib3B0cyIsInRvU3RyaW5nIiwiRXJyb3IiLCJzbGljZSIsImZyb20iLCJ0ZXN0IiwiZmlsZSIsInJlc29sdmUiLCJtYXAiLCJ0ZXh0IiwiY29uc3VtZXIiLCJtYXBSZXNvbHZlIiwiaWQiLCJlcnJvciIsIm1lc3NhZ2UiLC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G9yKGNzcywgb3B0cyA9IHsgfSkge1xuICAgICAgICBpZiAoIGNzcyA9PT0gbnVsbCB8fCB0eXBlb2YgY3NzID09PSAnb2JqZWN0JyAmJiAhY3NzLnRvU3RyaW5nICkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBQb3N0Q1NTIHJlY2VpdmVkICR7IGNzcyB9IGluc3RlYWQgb2YgQ1NTIHN0cmluZ2ApO1xuICAgICAgICB9XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge3N0cmluZ30gLSBpbnB1dCBDU1Mgc291cmNlXG4gICAgICAgICAqXG4gICAgICAgICAqIEBleGFtcGxlXG4gICAgICAgICAqIGNvbnN0IGlucHV0ID0gcG9zdGNzcy5wYXJzZSgnYXt9JywgeyBmcm9tOiBmaWxlIH0pLmlucHV0O1xuICAgICAgICAgKiBpbnB1dC5jc3MgLy89PiBcImF7fVwiO1xuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5jc3MgPSBjc3MudG9TdHJpbmcoKTtcblxuICAgICAgICBpZiAoIHRoaXMuY3NzWzBdID09PSAnXFx1RkVGRicgfHwgdGhpcy5jc3NbMF0gPT09ICdcXHVGRkZFJyApIHtcbiAgICAgICAgICAgIHRoaXMuY3NzID0gdGhpcy5jc3Muc2xpY2UoMSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIG9wdHMuZnJvbSApIHtcbiAgICAgICAgICAgIGlmICggL15cXHcrOlxcL1xcLy8udGVzdChvcHRzLmZyb20pICkge1xuICAgICAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICAgICAqIEBtZW1iZXIge3N0cmluZ30gLSBUaGUgYWJzb2x1dGUgcGF0aCB0byB0aGUgQ1NTIHNvdXJjZSBmaWxlXG4gICAgICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgIGRlZmluZWQgd2l0aCB0aGUgYGZyb21gIG9wdGlvbi5cbiAgICAgICAgICAgICAgICAgKlxuICAgICAgICAgICAgICAgICAqIEBleGFtcGxlXG4gICAgICAgICAgICAgICAgICogY29uc3Qgcm9vdCA9IHBvc3Rjc3MucGFyc2UoY3NzLCB7IGZyb206ICdhLmNzcycgfSk7XG4gICAgICAgICAgICAgICAgICogcm9vdC5zb3VyY2UuaW5wdXQuZmlsZSAvLz0+ICcvaG9tZS9haS9hLmNzcydcbiAgICAgICAgICAgICAgICAgKi9cbiAgICAgICAgICAgICAgICB0aGlzLmZpbGUgPSBvcHRzLmZyb207XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuZmlsZSA9IHBhdGgucmVzb2x2ZShvcHRzLmZyb20pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgbGV0IG1hcCA9IG5ldyBQcmV2aW91c01hcCh0aGlzLmNzcywgb3B0cyk7XG4gICAgICAgIGlmICggbWFwLnRleHQgKSB7XG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIEBtZW1iZXIge1ByZXZpb3VzTWFwfSAtIFRoZSBpbnB1dCBzb3VyY2UgbWFwIHBhc3NlZCBmcm9tXG4gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICBhIGNvbXBpbGF0aW9uIHN0ZXAgYmVmb3JlIFBvc3RDU1NcbiAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIChmb3IgZXhhbXBsZSwgZnJvbSBTYXNzIGNvbXBpbGVyKS5cbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgICAgICogcm9vdC5zb3VyY2UuaW5wdXQubWFwLmNvbnN1bWVyKCkuc291cmNlcyAvLz0+IFsnYS5zYXNzJ11cbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy5tYXAgPSBtYXA7XG4gICAgICAgICAgICBsZXQgZmlsZSA9IG1hcC5jb25zdW1lcigpLmZpbGU7XG4gICAgICAgICAgICBpZiAoICF0aGlzLmZpbGUgJiYgZmlsZSApIHRoaXMuZmlsZSA9IHRoaXMubWFwUmVzb2x2ZShmaWxlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICggIXRoaXMuZmlsZSApIHtcbiAgICAgICAgICAgIHNlcXVlbmNlICs9IDE7XG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIEBtZW1iZXIge3N0cmluZ30gLSBUaGUgdW5pcXVlIElEIG9mIHRoZSBDU1Mgc291cmNlLiBJdCB3aWxsIGJlXG4gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgY3JlYXRlZCBpZiBgZnJvbWAgb3B0aW9uIGlzIG5vdCBwcm92aWRlZFxuICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgIChiZWNhdXNlIFBvc3RDU1MgZG9lcyBub3Qga25vdyB0aGUgZmlsZSBwYXRoKS5cbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgICAgICogY29uc3Qgcm9vdCA9IHBvc3Rjc3MucGFyc2UoY3NzKTtcbiAgICAgICAgICAgICAqIHJvb3Quc291cmNlLmlucHV0LmZpbGUgLy89PiB1bmRlZmluZWRcbiAgICAgICAgICAgICAqIHJvb3Quc291cmNlLmlucHV0LmlkICAgLy89PiBcIjxpbnB1dCBjc3MgMT5cIlxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICB0aGlzLmlkICAgPSAnPGlucHV0IGNzcyAnICsgc2VxdWVuY2UgKyAnPic7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCB0aGlzLm1hcCApIHRoaXMubWFwLmZpbGUgPSB0aGlzLmZyb207XG4gICAgfVxuXG4gICAgZXJyb3IobWVzc2FnZSwgbGluZSwgY29sdW1uLCBvcHRzID0geyB9KSB7XG4gICAgICAgIGxldCByZXN1bHQ7XG4gICAgICAgIGxldCBvcmlnaW4gPSB0aGlzLm9yaWdpbihsaW5lLCBjb2x1bW4pO1xuICAgICAgICBpZiAoIG9ya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VxuICAgICAqIHJvb3Quc291cmNlLmlucHV0Lm9yaWdpbigxLCAxKSAvLz0+IHsgZmlsZTogJ2EuY3NzJywgbGluZTogMywgY29sdW1uOiAxIH1cbiAgICAgKi9cbiAgICBvcmlnaW4obGluZSwgY29sdW1uKSB7XG4gICAgICAgIGlmICggIXRoaXMubWFwICkgcmV0dXJuIGZhbHNlO1xuICAgICAgICBsZXQgY29uc3VtZXIgPSB0aGlzLm1hcC5jb25zdW1lcigpO1xuXG4gICAgICAgIGxldCBmcm9tID0gY29uc3VtZXIub3JpZ2luYWxQb3NpdGlvbkZvcih7IGxpbmUsIGNvbHVtbiB9KTtcbiAgICAgICAgaWYgKCAhZnJvbS5zb3VyY2UgKSByZXR1cm4gZmFsc2U7XG5cbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgIGZpbGU6ICAgdGhpcy5tYXBSZXNvbHZlKGZyb20uc291cmNlKSxcbiAgICAgICAgICAgIGxpbmU6ICAgZnJvbS5saW5lLFxuICAgICAgICAgICAgY29sdW1uOiBmcm9tLmNvbHVtblxuICAgICAgICB9O1xuXG4gICAgICAgIGxldCBzb3VyY2UgPSBjb25zdW1lci5zb3VyY2VDb250ZW50Rm9yKGZyb20uc291cmNlKTtcbiAgICAgICAgaWYgKCBzb3VyY2UgKSByZXN1bHQuc291cmNlID0gc291cmNlO1xuXG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgbWFwUmVzb2x2ZShmaWxlKSB7XG4gICAgICAgIGlmICggL15cXHcrOlxcL1xcLy8udGVzdChmaWxlKSApIHtcbiAgICAgICAgICAgIHJldHVybiBmaWxlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHBhdGgucmVzb2x2ZSh0aGlzLm1hcC5jb25zdW1lcigpLnNvdXJjZVJvb3QgfHwgJy4nLCBmaWxlKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBDU1Mgc291cmNlIGlkZW50aWZpZXIuIENvbnRhaW5zIHtAbGluayBJbnB1dCNmaWxlfSBpZiB0aGUgdXNlclxuICAgICAqIHNldCB0aGUgYGZyb21gIG9wdGlvbiwgb3Ige0BsaW5rIElucHV0I2lkfSBpZiB0aGV5IGRpZCBub3QuXG4gICAgICogQHR5cGUge3N0cmluZ31cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogY29uc3Qgcm9vdCA9IHBvc3Rjc3MucGFyc2UoY3NzLCB7IGZyb206ICdhLmNzcycgfSk7XG4gICAgICogcm9vdC5zb3VyY2UuaW5wdXQuZnJvbSAvLz0+IFwiL2hvbWUvYWkvYS5jc3NcIlxuICAgICAqXG4gICAgICogY29uc3Qgcm9vdCA9IHBvc3Rjc3MucGFyc2UoY3NzKTtcbiAgICAgKiByb290LnNvdXJjZS5pbnB1dC5mcm9tIC8vPT4gXCI8aW5wdXQgY3NzIDE+XCJcbiAgICAgKi9cbiAgICBnZXQgZnJvbSgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZmlsZSB8fCB0aGlzLmlkO1xuICAgIH1cblxufVxuXG5leHBvcnQgZGVmYXVsdCBJbnB1dDtcblxuLyoqXG4gKiBAdHlwZWRlZiAge29iamVjdH0gZmlsZVBvc2l0aW9uXG4gKiBAcHJvcGVydHkge3N0cmluZ30gZmlsZSAgIC0gcGF0aCB0byBmaWxlXG4gKiBAcHJvcGVydHkge251bWJlcn0gbGluZSAgIC0gc291cmNlIGxpbmUgaW4gZmlsZVxuICogQHByb3BlcnR5IHtudW1iZXJ9IGNvbHVtbiAtIHNvdXJjZSBjb2x1bW4gaW4gZmlsZVxuICovXG4iXX0=
  4534. /***/ }),
  4535. /* 19 */
  4536. /***/ (function(module, exports, __webpack_require__) {
  4537. "use strict";
  4538. exports.__esModule = true;
  4539. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  4540. var _cssSyntaxError = __webpack_require__(38);
  4541. var _cssSyntaxError2 = _interopRequireDefault(_cssSyntaxError);
  4542. var _stringifier = __webpack_require__(21);
  4543. var _stringifier2 = _interopRequireDefault(_stringifier);
  4544. var _stringify = __webpack_require__(44);
  4545. var _stringify2 = _interopRequireDefault(_stringify);
  4546. var _warnOnce = __webpack_require__(46);
  4547. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  4548. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  4549. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4550. var cloneNode = function cloneNode(obj, parent) {
  4551. var cloned = new obj.constructor();
  4552. for (var i in obj) {
  4553. if (!obj.hasOwnProperty(i)) continue;
  4554. var value = obj[i];
  4555. var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
  4556. if (i === 'parent' && type === 'object') {
  4557. if (parent) cloned[i] = parent;
  4558. } else if (i === 'source') {
  4559. cloned[i] = value;
  4560. } else if (value instanceof Array) {
  4561. cloned[i] = value.map(function (j) {
  4562. return cloneNode(j, cloned);
  4563. });
  4564. } else {
  4565. if (type === 'object' && value !== null) value = cloneNode(value);
  4566. cloned[i] = value;
  4567. }
  4568. }
  4569. return cloned;
  4570. };
  4571. /**
  4572. * All node classes inherit the following common methods.
  4573. *
  4574. * @abstract
  4575. */
  4576. var Node = function () {
  4577. /**
  4578. * @param {object} [defaults] - value for node properties
  4579. */
  4580. function Node() {
  4581. var defaults = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  4582. _classCallCheck(this, Node);
  4583. this.raws = {};
  4584. if ((typeof defaults === 'undefined' ? 'undefined' : _typeof(defaults)) !== 'object' && typeof defaults !== 'undefined') {
  4585. throw new Error('PostCSS nodes constructor accepts object, not ' + JSON.stringify(defaults));
  4586. }
  4587. for (var name in defaults) {
  4588. this[name] = defaults[name];
  4589. }
  4590. }
  4591. /**
  4592. * Returns a CssSyntaxError instance containing the original position
  4593. * of the node in the source, showing line and column numbers and also
  4594. * a small excerpt to facilitate debugging.
  4595. *
  4596. * If present, an input source map will be used to get the original position
  4597. * of the source, even from a previous compilation step
  4598. * (e.g., from Sass compilation).
  4599. *
  4600. * This method produces very useful error messages.
  4601. *
  4602. * @param {string} message - error description
  4603. * @param {object} [opts] - options
  4604. * @param {string} opts.plugin - plugin name that created this error.
  4605. * PostCSS will set it automatically.
  4606. * @param {string} opts.word - a word inside a node’s string that should
  4607. * be highlighted as the source of the error
  4608. * @param {number} opts.index - an index inside a node’s string that should
  4609. * be highlighted as the source of the error
  4610. *
  4611. * @return {CssSyntaxError} error object to throw it
  4612. *
  4613. * @example
  4614. * if ( !variables[name] ) {
  4615. * throw decl.error('Unknown variable ' + name, { word: name });
  4616. * // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
  4617. * // color: $black
  4618. * // a
  4619. * // ^
  4620. * // background: white
  4621. * }
  4622. */
  4623. Node.prototype.error = function error(message) {
  4624. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  4625. if (this.source) {
  4626. var pos = this.positionBy(opts);
  4627. return this.source.input.error(message, pos.line, pos.column, opts);
  4628. } else {
  4629. return new _cssSyntaxError2.default(message);
  4630. }
  4631. };
  4632. /**
  4633. * This method is provided as a convenience wrapper for {@link Result#warn}.
  4634. *
  4635. * @param {Result} result - the {@link Result} instance
  4636. * that will receive the warning
  4637. * @param {string} text - warning message
  4638. * @param {object} [opts] - options
  4639. * @param {string} opts.plugin - plugin name that created this warning.
  4640. * PostCSS will set it automatically.
  4641. * @param {string} opts.word - a word inside a node’s string that should
  4642. * be highlighted as the source of the warning
  4643. * @param {number} opts.index - an index inside a node’s string that should
  4644. * be highlighted as the source of the warning
  4645. *
  4646. * @return {Warning} created warning object
  4647. *
  4648. * @example
  4649. * const plugin = postcss.plugin('postcss-deprecated', () => {
  4650. * return (root, result) => {
  4651. * root.walkDecls('bad', decl => {
  4652. * decl.warn(result, 'Deprecated property bad');
  4653. * });
  4654. * };
  4655. * });
  4656. */
  4657. Node.prototype.warn = function warn(result, text, opts) {
  4658. var data = { node: this };
  4659. for (var i in opts) {
  4660. data[i] = opts[i];
  4661. }return result.warn(text, data);
  4662. };
  4663. /**
  4664. * Removes the node from its parent and cleans the parent properties
  4665. * from the node and its children.
  4666. *
  4667. * @example
  4668. * if ( decl.prop.match(/^-webkit-/) ) {
  4669. * decl.remove();
  4670. * }
  4671. *
  4672. * @return {Node} node to make calls chain
  4673. */
  4674. Node.prototype.remove = function remove() {
  4675. if (this.parent) {
  4676. this.parent.removeChild(this);
  4677. }
  4678. this.parent = undefined;
  4679. return this;
  4680. };
  4681. /**
  4682. * Returns a CSS string representing the node.
  4683. *
  4684. * @param {stringifier|syntax} [stringifier] - a syntax to use
  4685. * in string generation
  4686. *
  4687. * @return {string} CSS string of this node
  4688. *
  4689. * @example
  4690. * postcss.rule({ selector: 'a' }).toString() //=> "a {}"
  4691. */
  4692. Node.prototype.toString = function toString() {
  4693. var stringifier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _stringify2.default;
  4694. if (stringifier.stringify) stringifier = stringifier.stringify;
  4695. var result = '';
  4696. stringifier(this, function (i) {
  4697. result += i;
  4698. });
  4699. return result;
  4700. };
  4701. /**
  4702. * Returns a clone of the node.
  4703. *
  4704. * The resulting cloned node and its (cloned) children will have
  4705. * a clean parent and code style properties.
  4706. *
  4707. * @param {object} [overrides] - new properties to override in the clone.
  4708. *
  4709. * @example
  4710. * const cloned = decl.clone({ prop: '-moz-' + decl.prop });
  4711. * cloned.raws.before //=> undefined
  4712. * cloned.parent //=> undefined
  4713. * cloned.toString() //=> -moz-transform: scale(0)
  4714. *
  4715. * @return {Node} clone of the node
  4716. */
  4717. Node.prototype.clone = function clone() {
  4718. var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  4719. var cloned = cloneNode(this);
  4720. for (var name in overrides) {
  4721. cloned[name] = overrides[name];
  4722. }
  4723. return cloned;
  4724. };
  4725. /**
  4726. * Shortcut to clone the node and insert the resulting cloned node
  4727. * before the current node.
  4728. *
  4729. * @param {object} [overrides] - new properties to override in the clone.
  4730. *
  4731. * @example
  4732. * decl.cloneBefore({ prop: '-moz-' + decl.prop });
  4733. *
  4734. * @return {Node} - new node
  4735. */
  4736. Node.prototype.cloneBefore = function cloneBefore() {
  4737. var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  4738. var cloned = this.clone(overrides);
  4739. this.parent.insertBefore(this, cloned);
  4740. return cloned;
  4741. };
  4742. /**
  4743. * Shortcut to clone the node and insert the resulting cloned node
  4744. * after the current node.
  4745. *
  4746. * @param {object} [overrides] - new properties to override in the clone.
  4747. *
  4748. * @return {Node} - new node
  4749. */
  4750. Node.prototype.cloneAfter = function cloneAfter() {
  4751. var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  4752. var cloned = this.clone(overrides);
  4753. this.parent.insertAfter(this, cloned);
  4754. return cloned;
  4755. };
  4756. /**
  4757. * Inserts node(s) before the current node and removes the current node.
  4758. *
  4759. * @param {...Node} nodes - node(s) to replace current one
  4760. *
  4761. * @example
  4762. * if ( atrule.name == 'mixin' ) {
  4763. * atrule.replaceWith(mixinRules[atrule.params]);
  4764. * }
  4765. *
  4766. * @return {Node} current node to methods chain
  4767. */
  4768. Node.prototype.replaceWith = function replaceWith() {
  4769. if (this.parent) {
  4770. for (var _len = arguments.length, nodes = Array(_len), _key = 0; _key < _len; _key++) {
  4771. nodes[_key] = arguments[_key];
  4772. }
  4773. for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  4774. var _ref;
  4775. if (_isArray) {
  4776. if (_i >= _iterator.length) break;
  4777. _ref = _iterator[_i++];
  4778. } else {
  4779. _i = _iterator.next();
  4780. if (_i.done) break;
  4781. _ref = _i.value;
  4782. }
  4783. var node = _ref;
  4784. this.parent.insertBefore(this, node);
  4785. }
  4786. this.remove();
  4787. }
  4788. return this;
  4789. };
  4790. Node.prototype.moveTo = function moveTo(newParent) {
  4791. (0, _warnOnce2.default)('Node#moveTo was deprecated. Use Container#append.');
  4792. this.cleanRaws(this.root() === newParent.root());
  4793. this.remove();
  4794. newParent.append(this);
  4795. return this;
  4796. };
  4797. Node.prototype.moveBefore = function moveBefore(otherNode) {
  4798. (0, _warnOnce2.default)('Node#moveBefore was deprecated. Use Node#before.');
  4799. this.cleanRaws(this.root() === otherNode.root());
  4800. this.remove();
  4801. otherNode.parent.insertBefore(otherNode, this);
  4802. return this;
  4803. };
  4804. Node.prototype.moveAfter = function moveAfter(otherNode) {
  4805. (0, _warnOnce2.default)('Node#moveAfter was deprecated. Use Node#after.');
  4806. this.cleanRaws(this.root() === otherNode.root());
  4807. this.remove();
  4808. otherNode.parent.insertAfter(otherNode, this);
  4809. return this;
  4810. };
  4811. /**
  4812. * Returns the next child of the node’s parent.
  4813. * Returns `undefined` if the current node is the last child.
  4814. *
  4815. * @return {Node|undefined} next node
  4816. *
  4817. * @example
  4818. * if ( comment.text === 'delete next' ) {
  4819. * const next = comment.next();
  4820. * if ( next ) {
  4821. * next.remove();
  4822. * }
  4823. * }
  4824. */
  4825. Node.prototype.next = function next() {
  4826. var index = this.parent.index(this);
  4827. return this.parent.nodes[index + 1];
  4828. };
  4829. /**
  4830. * Returns the previous child of the node’s parent.
  4831. * Returns `undefined` if the current node is the first child.
  4832. *
  4833. * @return {Node|undefined} previous node
  4834. *
  4835. * @example
  4836. * const annotation = decl.prev();
  4837. * if ( annotation.type == 'comment' ) {
  4838. * readAnnotation(annotation.text);
  4839. * }
  4840. */
  4841. Node.prototype.prev = function prev() {
  4842. var index = this.parent.index(this);
  4843. return this.parent.nodes[index - 1];
  4844. };
  4845. /**
  4846. * Insert new node before current node to current node’s parent.
  4847. *
  4848. * Just alias for `node.parent.insertBefore(node, add)`.
  4849. *
  4850. * @param {Node|object|string|Node[]} add - new node
  4851. *
  4852. * @return {Node} this node for methods chain.
  4853. *
  4854. * @example
  4855. * decl.before('content: ""');
  4856. */
  4857. Node.prototype.before = function before(add) {
  4858. this.parent.insertBefore(this, add);
  4859. return this;
  4860. };
  4861. /**
  4862. * Insert new node after current node to current node’s parent.
  4863. *
  4864. * Just alias for `node.parent.insertAfter(node, add)`.
  4865. *
  4866. * @param {Node|object|string|Node[]} add - new node
  4867. *
  4868. * @return {Node} this node for methods chain.
  4869. *
  4870. * @example
  4871. * decl.after('color: black');
  4872. */
  4873. Node.prototype.after = function after(add) {
  4874. this.parent.insertAfter(this, add);
  4875. return this;
  4876. };
  4877. Node.prototype.toJSON = function toJSON() {
  4878. var fixed = {};
  4879. for (var name in this) {
  4880. if (!this.hasOwnProperty(name)) continue;
  4881. if (name === 'parent') continue;
  4882. var value = this[name];
  4883. if (value instanceof Array) {
  4884. fixed[name] = value.map(function (i) {
  4885. if ((typeof i === 'undefined' ? 'undefined' : _typeof(i)) === 'object' && i.toJSON) {
  4886. return i.toJSON();
  4887. } else {
  4888. return i;
  4889. }
  4890. });
  4891. } else if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.toJSON) {
  4892. fixed[name] = value.toJSON();
  4893. } else {
  4894. fixed[name] = value;
  4895. }
  4896. }
  4897. return fixed;
  4898. };
  4899. /**
  4900. * Returns a {@link Node#raws} value. If the node is missing
  4901. * the code style property (because the node was manually built or cloned),
  4902. * PostCSS will try to autodetect the code style property by looking
  4903. * at other nodes in the tree.
  4904. *
  4905. * @param {string} prop - name of code style property
  4906. * @param {string} [defaultType] - name of default value, it can be missed
  4907. * if the value is the same as prop
  4908. *
  4909. * @example
  4910. * const root = postcss.parse('a { background: white }');
  4911. * root.nodes[0].append({ prop: 'color', value: 'black' });
  4912. * root.nodes[0].nodes[1].raws.before //=> undefined
  4913. * root.nodes[0].nodes[1].raw('before') //=> ' '
  4914. *
  4915. * @return {string} code style value
  4916. */
  4917. Node.prototype.raw = function raw(prop, defaultType) {
  4918. var str = new _stringifier2.default();
  4919. return str.raw(this, prop, defaultType);
  4920. };
  4921. /**
  4922. * Finds the Root instance of the node’s tree.
  4923. *
  4924. * @example
  4925. * root.nodes[0].nodes[0].root() === root
  4926. *
  4927. * @return {Root} root parent
  4928. */
  4929. Node.prototype.root = function root() {
  4930. var result = this;
  4931. while (result.parent) {
  4932. result = result.parent;
  4933. }return result;
  4934. };
  4935. Node.prototype.cleanRaws = function cleanRaws(keepBetween) {
  4936. delete this.raws.before;
  4937. delete this.raws.after;
  4938. if (!keepBetween) delete this.raws.between;
  4939. };
  4940. Node.prototype.positionInside = function positionInside(index) {
  4941. var string = this.toString();
  4942. var column = this.source.start.column;
  4943. var line = this.source.start.line;
  4944. for (var i = 0; i < index; i++) {
  4945. if (string[i] === '\n') {
  4946. column = 1;
  4947. line += 1;
  4948. } else {
  4949. column += 1;
  4950. }
  4951. }
  4952. return { line: line, column: column };
  4953. };
  4954. Node.prototype.positionBy = function positionBy(opts) {
  4955. var pos = this.source.start;
  4956. if (opts.index) {
  4957. pos = this.positionInside(opts.index);
  4958. } else if (opts.word) {
  4959. var index = this.toString().indexOf(opts.word);
  4960. if (index !== -1) pos = this.positionInside(index);
  4961. }
  4962. return pos;
  4963. };
  4964. /**
  4965. * @memberof Node#
  4966. * @member {string} type - String representing the node’s type.
  4967. * Possible values are `root`, `atrule`, `rule`,
  4968. * `decl`, or `comment`.
  4969. *
  4970. * @example
  4971. * postcss.decl({ prop: 'color', value: 'black' }).type //=> 'decl'
  4972. */
  4973. /**
  4974. * @memberof Node#
  4975. * @member {Container} parent - the node’s parent node.
  4976. *
  4977. * @example
  4978. * root.nodes[0].parent == root;
  4979. */
  4980. /**
  4981. * @memberof Node#
  4982. * @member {source} source - the input source of the node
  4983. *
  4984. * The property is used in source map generation.
  4985. *
  4986. * If you create a node manually (e.g., with `postcss.decl()`),
  4987. * that node will not have a `source` property and will be absent
  4988. * from the source map. For this reason, the plugin developer should
  4989. * consider cloning nodes to create new ones (in which case the new node’s
  4990. * source will reference the original, cloned node) or setting
  4991. * the `source` property manually.
  4992. *
  4993. * ```js
  4994. * // Bad
  4995. * const prefixed = postcss.decl({
  4996. * prop: '-moz-' + decl.prop,
  4997. * value: decl.value
  4998. * });
  4999. *
  5000. * // Good
  5001. * const prefixed = decl.clone({ prop: '-moz-' + decl.prop });
  5002. * ```
  5003. *
  5004. * ```js
  5005. * if ( atrule.name == 'add-link' ) {
  5006. * const rule = postcss.rule({ selector: 'a', source: atrule.source });
  5007. * atrule.parent.insertBefore(atrule, rule);
  5008. * }
  5009. * ```
  5010. *
  5011. * @example
  5012. * decl.source.input.from //=> '/home/ai/a.sass'
  5013. * decl.source.start //=> { line: 10, column: 2 }
  5014. * decl.source.end //=> { line: 10, column: 12 }
  5015. */
  5016. /**
  5017. * @memberof Node#
  5018. * @member {object} raws - Information to generate byte-to-byte equal
  5019. * node string as it was in the origin input.
  5020. *
  5021. * Every parser saves its own properties,
  5022. * but the default CSS parser uses:
  5023. *
  5024. * * `before`: the space symbols before the node. It also stores `*`
  5025. * and `_` symbols before the declaration (IE hack).
  5026. * * `after`: the space symbols after the last child of the node
  5027. * to the end of the node.
  5028. * * `between`: the symbols between the property and value
  5029. * for declarations, selector and `{` for rules, or last parameter
  5030. * and `{` for at-rules.
  5031. * * `semicolon`: contains true if the last child has
  5032. * an (optional) semicolon.
  5033. * * `afterName`: the space between the at-rule name and its parameters.
  5034. * * `left`: the space symbols between `/*` and the comment’s text.
  5035. * * `right`: the space symbols between the comment’s text
  5036. * and <code>*&#47;</code>.
  5037. * * `important`: the content of the important statement,
  5038. * if it is not just `!important`.
  5039. *
  5040. * PostCSS cleans selectors, declaration values and at-rule parameters
  5041. * from comments and extra spaces, but it stores origin content in raws
  5042. * properties. As such, if you don’t change a declaration’s value,
  5043. * PostCSS will use the raw value with comments.
  5044. *
  5045. * @example
  5046. * const root = postcss.parse('a {\n color:black\n}')
  5047. * root.first.first.raws //=> { before: '\n ', between: ':' }
  5048. */
  5049. return Node;
  5050. }();
  5051. exports.default = Node;
  5052. /**
  5053. * @typedef {object} position
  5054. * @property {number} line - source line in file
  5055. * @property {number} column - source column in file
  5056. */
  5057. /**
  5058. * @typedef {object} source
  5059. * @property {Input} input - {@link Input} with input file
  5060. * @property {position} start - The starting position of the node’s source
  5061. * @property {position} end - The ending position of the node’s source
  5062. */
  5063. module.exports = exports['default'];
  5064. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGUuZXM2Il0sIm5hbWVzIjpbImNsb25lTm9kZSIsIm9iaiIsInBhcmVudCIsImNsb25lZCIsImNvbnN0cnVjdG9yIiwiaSIsImhhc093blByb3BlcnR5IiwidmFsdWUiLCJ0eXBlIiwiQXJyYXkiLCJtYXAiLCJqIiwiTm9kZSIsImRlZmF1bHRzIiwicmF3cyIsIkVycm9yIiwiSlNPTiIsInN0cmluZ2lmeSIsIm5hbWUiLCJlcnJvciIsIm1lc3NhZ2UiLCJvcHRzIiwic291cmNlIiwicG9zIiwicG9zaXRpb25CeSIsImlucHV0IiwibGluZSIsImNvbHVtbiIsIndhcm4iLCJyZXN1bHQiLCJ0ZXh0IiwiZGF0YSIsIm5vZGUiLCJyZW1vdmUiLCJyZW1vdmVDaGlsZCIsInVuZGVmaW5lZCIsInRvU3RyaW5nIiwic3RyaW5naWZpZXIiLCJjbG9uZSIsIm92ZXJyaWRlcyIsImNsb25lQmVmb3JlIiwiaW5zZXJ0QmVmb3JlIiwiY2xvbmVBZnRlciIsImluc2VydEFmdGVyIiwicmVwbGFjZVdpdGgiLCJub2RlcyIsIm1vdmVUbyIsIm5ld1BhcmVudCIsImNsZWFuUmF3cyIsInJvb3QiLCJhcHBlbmQiLCJtb3ZlQmVmb3JlIiwib3RoZXJOb2RlIiwibW92ZUFmdGVyIiwibmV4dCIsImluZGV4IiwicHJldiIsImJlZm9yZSIsImFkZCIsImFmdGVyI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ZXJ0IG5ldyBub2RlIGFmdGVyIGN1cnJlbnQgbm9kZSB0byBjdXJyZW50IG5vZGXigJlzIHBhcmVudC5cbiAgICAgKlxuICAgICAqIEp1c3QgYWxpYXMgZm9yIGBub2RlLnBhcmVudC5pbnNlcnRBZnRlcihub2RlLCBhZGQpYC5cbiAgICAgKlxuICAgICAqIEBwYXJhbSB7Tm9kZXxvYmplY3R8c3RyaW5nfE5vZGVbXX0gYWRkIC0gbmV3IG5vZGVcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge05vZGV9IHRoaXMgbm9kZSBmb3IgbWV0aG9kcyBjaGFpbi5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogZGVjbC5hZnRlcignY29sb3I6IGJsYWNrJyk7XG4gICAgICovXG4gICAgYWZ0ZXIoYWRkKSB7XG4gICAgICAgIHRoaXMucGFyZW50Lmluc2VydEFmdGVyKHRoaXMsIGFkZCk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIHRvSlNPTigpIHtcbiAgICAgICAgbGV0IGZpeGVkID0geyB9O1xuXG4gICAgICAgIGZvciAoIGxldCBuYW1lIGluIHRoaXMgKSB7XG4gICAgICAgICAgICBpZiAoICF0aGlzLmhhc093blByb3BlcnR5KG5hbWUpICkgY29udGludWU7XG4gICAgICAgICAgICBpZiAoIG5hbWUgPT09ICdwYXJlbnQnICkgY29udGludWU7XG4gICAgICAgICAgICBsZXQgdmFsdWUgPSB0aGlzW25hbWVdO1xuXG4gICAgICAgICAgICBpZiAoIHZhbHVlIGluc3RhbmNlb2YgQXJyYXkgKSB7XG4gICAgICAgICAgICAgICAgZml4ZWRbbmFtZV0gPSB2YWx1ZS5tYXAoIGkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIHR5cGVvZiBpID09PSAnb2JqZWN0JyAmJiBpLnRvSlNPTiApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpLnRvSlNPTigpO1xuICAgICAgIC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gICAgICAgZGVsZXRlIHRoaXMucmF3cy5hZnRlcjtcbiAgICAgICAgaWYgKCAha2VlcEJldHdlZW4gKSBkZWxldGUgdGhpcy5yYXdzLmJldHdlZW47XG4gICAgfVxuXG4gICAgcG9zaXRpb25JbnNpZGUoaW5kZXgpIHtcbiAgICAgICAgbGV0IHN0cmluZyA9IHRoaXMudG9TdHJpbmcoKTtcbiAgICAgICAgbGV0IGNvbHVtbiA9IHRoaXMuc291cmNlLnN0YXJ0LmNvbHVtbjtcbiAgICAgICAgbGV0IGxpbmUgICA9IHRoaXMuc291cmNlLnN0YXJ0LmxpbmU7XG5cbiAgICAgICAgZm9yICggbGV0IGkgPSAwOyBpIDwgaW5kZXg7IGkrKyApIHtcbiAgICAgICAgICAgIGlmICggc3RyaW5nW2ldID09PSAnXFxuJyApIHtcbiAgICAgICAgICAgICAgICBjb2x1bW4gPSAxO1xuICAgICAgICAgICAgICAgIGxpbmUgICs9IDE7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbHVtbiArPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHsgbGluZSwgY29sdW1uIH07XG4gICAgfVxuXG4gICAgcG9zaXRpb25CeShvcHRzKSB7XG4gICAgICAgIGxldCBwb3MgPSB0aGlzLnNvdXJjZS5zdGFydDtcbiAgICAgICAgaWYgKCBvcHRzLmluZGV4ICkge1xuICAgICAgICAgICAgcG9zID0gdGhpcy5wb3NpdGlvbkluc2lkZShvcHRzLmluZGV4KTtcbiAgICAgICAgfSBlbHNlIGlmICggb3B0cy53b3JkICkge1xuICAgICAgICAgICAgbGV0IGluZGV4ID0gdGhpcy50b1N0cmluZygpLmluZGV4T2Yob3B0cy53b3JkKTtcbiAgICAgICAgICAgIGlmICggaW5kZXggIT09IC0xICkgcG9zID0gdGhpcy5wb3NpdGlvbkluc2lkZShpbmRleCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIH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ICBjb2xvcjpibGFja1xcbn0nKVxuICAgICAqIHJvb3QuZmlyc3QuZmlyc3QucmF3cyAvLz0+IHsgYmVmb3JlOiAnXFxuICAnLCBiZXR3ZWVuOiAnOicgfVxuICAgICAqL1xuXG59XG5cbmV4cG9ydCBkZWZhdWx0IE5vZGU7XG5cbi8qKlxuICogQHR5cGVkZWYge29iamVjdH0gcG9zaXRpb25cbiAqIEBwcm9wZXJ0eSB7bnVtYmVyfSBsaW5lICAgLSBzb3VyY2UgbGluZSBpbiBmaWxlXG4gKiBAcHJvcGVydHkge251bWJlcn0gY29sdW1uIC0gc291cmNlIGNvbHVtbiBpbiBmaWxlXG4gKi9cblxuLyoqXG4gKiBAdHlwZWRlZiB7b2JqZWN0fSBzb3VyY2VcbiAqIEBwcm9wZXJ0eSB7SW5wdXR9IGlucHV0ICAgIC0ge0BsaW5rIElucHV0fSB3aXRoIGlucHV0IGZpbGVcbiAqIEBwcm9wZXJ0eSB7cG9zaXRpb259IHN0YXJ0IC0gVGhlIHN0YXJ0aW5nIHBvc2l0aW9uIG9mIHRoZSBub2Rl4oCZcyBzb3VyY2VcbiAqIEBwcm9wZXJ0eSB7cG9zaXRpb259IGVuZCAgIC0gVGhlIGVuZGluZyBwb3NpdGlvbiBvZiB0aGUgbm9kZeKAmXMgc291cmNlXG4gKi9cbiJdfQ==
  5065. /***/ }),
  5066. /* 20 */
  5067. /***/ (function(module, exports, __webpack_require__) {
  5068. "use strict";
  5069. exports.__esModule = true;
  5070. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5071. var _container = __webpack_require__(13);
  5072. var _container2 = _interopRequireDefault(_container);
  5073. var _list = __webpack_require__(132);
  5074. var _list2 = _interopRequireDefault(_list);
  5075. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5076. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5077. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5078. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5079. /**
  5080. * Represents a CSS rule: a selector followed by a declaration block.
  5081. *
  5082. * @extends Container
  5083. *
  5084. * @example
  5085. * const root = postcss.parse('a{}');
  5086. * const rule = root.first;
  5087. * rule.type //=> 'rule'
  5088. * rule.toString() //=> 'a{}'
  5089. */
  5090. var Rule = function (_Container) {
  5091. _inherits(Rule, _Container);
  5092. function Rule(defaults) {
  5093. _classCallCheck(this, Rule);
  5094. var _this = _possibleConstructorReturn(this, _Container.call(this, defaults));
  5095. _this.type = 'rule';
  5096. if (!_this.nodes) _this.nodes = [];
  5097. return _this;
  5098. }
  5099. /**
  5100. * An array containing the rule’s individual selectors.
  5101. * Groups of selectors are split at commas.
  5102. *
  5103. * @type {string[]}
  5104. *
  5105. * @example
  5106. * const root = postcss.parse('a, b { }');
  5107. * const rule = root.first;
  5108. *
  5109. * rule.selector //=> 'a, b'
  5110. * rule.selectors //=> ['a', 'b']
  5111. *
  5112. * rule.selectors = ['a', 'strong'];
  5113. * rule.selector //=> 'a, strong'
  5114. */
  5115. _createClass(Rule, [{
  5116. key: 'selectors',
  5117. get: function get() {
  5118. return _list2.default.comma(this.selector);
  5119. },
  5120. set: function set(values) {
  5121. var match = this.selector ? this.selector.match(/,\s*/) : null;
  5122. var sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen');
  5123. this.selector = values.join(sep);
  5124. }
  5125. /**
  5126. * @memberof Rule#
  5127. * @member {string} selector - the rule’s full selector represented
  5128. * as a string
  5129. *
  5130. * @example
  5131. * const root = postcss.parse('a, b { }');
  5132. * const rule = root.first;
  5133. * rule.selector //=> 'a, b'
  5134. */
  5135. /**
  5136. * @memberof Rule#
  5137. * @member {object} raws - Information to generate byte-to-byte equal
  5138. * node string as it was in the origin input.
  5139. *
  5140. * Every parser saves its own properties,
  5141. * but the default CSS parser uses:
  5142. *
  5143. * * `before`: the space symbols before the node. It also stores `*`
  5144. * and `_` symbols before the declaration (IE hack).
  5145. * * `after`: the space symbols after the last child of the node
  5146. * to the end of the node.
  5147. * * `between`: the symbols between the property and value
  5148. * for declarations, selector and `{` for rules, or last parameter
  5149. * and `{` for at-rules.
  5150. * * `semicolon`: contains `true` if the last child has
  5151. * an (optional) semicolon.
  5152. * * `ownSemicolon`: contains `true` if there is semicolon after rule.
  5153. *
  5154. * PostCSS cleans selectors from comments and extra spaces,
  5155. * but it stores origin content in raws properties.
  5156. * As such, if you don’t change a declaration’s value,
  5157. * PostCSS will use the raw value with comments.
  5158. *
  5159. * @example
  5160. * const root = postcss.parse('a {\n color:black\n}')
  5161. * root.first.first.raws //=> { before: '', between: ' ', after: '\n' }
  5162. */
  5163. }]);
  5164. return Rule;
  5165. }(_container2.default);
  5166. exports.default = Rule;
  5167. module.exports = exports['default'];
  5168. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJ1bGUuZXM2Il0sIm5hbWVzIjpbIlJ1bGUiLCJkZWZhdWx0cyIsInR5cGUiLCJub2RlcyIsImNvbW1hIiwic2VsZWN0b3IiLCJ2YWx1ZXMiLCJtYXRjaCIsInNlcCIsInJhdyIsImpvaW4iXSwibWFwcGluZ3MiOiI7Ozs7OztBQUF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aW9u4oCZcyB2YWx1ZSxcbiAgICAgKiBQb3N0Q1NTIHdpbGwgdXNlIHRoZSByYXcgdmFsdWUgd2l0aCBjb21tZW50cy5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogY29uc3Qgcm9vdCA9IHBvc3Rjc3MucGFyc2UoJ2Ege1xcbiAgY29sb3I6YmxhY2tcXG59JylcbiAgICAgKiByb290LmZpcnN0LmZpcnN0LnJhd3MgLy89PiB7IGJlZm9yZTogJycsIGJldHdlZW46ICcgJywgYWZ0ZXI6ICdcXG4nIH1cbiAgICAgKi9cblxufVxuXG5leHBvcnQgZGVmYXVsdCBSdWxlO1xuIl19
  5169. /***/ }),
  5170. /* 21 */
  5171. /***/ (function(module, exports, __webpack_require__) {
  5172. "use strict";
  5173. exports.__esModule = true;
  5174. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5175. var defaultRaw = {
  5176. colon: ': ',
  5177. indent: ' ',
  5178. beforeDecl: '\n',
  5179. beforeRule: '\n',
  5180. beforeOpen: ' ',
  5181. beforeClose: '\n',
  5182. beforeComment: '\n',
  5183. after: '\n',
  5184. emptyBody: '',
  5185. commentLeft: ' ',
  5186. commentRight: ' '
  5187. };
  5188. function capitalize(str) {
  5189. return str[0].toUpperCase() + str.slice(1);
  5190. }
  5191. var Stringifier = function () {
  5192. function Stringifier(builder) {
  5193. _classCallCheck(this, Stringifier);
  5194. this.builder = builder;
  5195. }
  5196. Stringifier.prototype.stringify = function stringify(node, semicolon) {
  5197. this[node.type](node, semicolon);
  5198. };
  5199. Stringifier.prototype.root = function root(node) {
  5200. this.body(node);
  5201. if (node.raws.after) this.builder(node.raws.after);
  5202. };
  5203. Stringifier.prototype.comment = function comment(node) {
  5204. var left = this.raw(node, 'left', 'commentLeft');
  5205. var right = this.raw(node, 'right', 'commentRight');
  5206. this.builder('/*' + left + node.text + right + '*/', node);
  5207. };
  5208. Stringifier.prototype.decl = function decl(node, semicolon) {
  5209. var between = this.raw(node, 'between', 'colon');
  5210. var string = node.prop + between + this.rawValue(node, 'value');
  5211. if (node.important) {
  5212. string += node.raws.important || ' !important';
  5213. }
  5214. if (semicolon) string += ';';
  5215. this.builder(string, node);
  5216. };
  5217. Stringifier.prototype.rule = function rule(node) {
  5218. this.block(node, this.rawValue(node, 'selector'));
  5219. if (node.raws.ownSemicolon) {
  5220. this.builder(node.raws.ownSemicolon, node, 'end');
  5221. }
  5222. };
  5223. Stringifier.prototype.atrule = function atrule(node, semicolon) {
  5224. var name = '@' + node.name;
  5225. var params = node.params ? this.rawValue(node, 'params') : '';
  5226. if (typeof node.raws.afterName !== 'undefined') {
  5227. name += node.raws.afterName;
  5228. } else if (params) {
  5229. name += ' ';
  5230. }
  5231. if (node.nodes) {
  5232. this.block(node, name + params);
  5233. } else {
  5234. var end = (node.raws.between || '') + (semicolon ? ';' : '');
  5235. this.builder(name + params + end, node);
  5236. }
  5237. };
  5238. Stringifier.prototype.body = function body(node) {
  5239. var last = node.nodes.length - 1;
  5240. while (last > 0) {
  5241. if (node.nodes[last].type !== 'comment') break;
  5242. last -= 1;
  5243. }
  5244. var semicolon = this.raw(node, 'semicolon');
  5245. for (var i = 0; i < node.nodes.length; i++) {
  5246. var child = node.nodes[i];
  5247. var before = this.raw(child, 'before');
  5248. if (before) this.builder(before);
  5249. this.stringify(child, last !== i || semicolon);
  5250. }
  5251. };
  5252. Stringifier.prototype.block = function block(node, start) {
  5253. var between = this.raw(node, 'between', 'beforeOpen');
  5254. this.builder(start + between + '{', node, 'start');
  5255. var after = void 0;
  5256. if (node.nodes && node.nodes.length) {
  5257. this.body(node);
  5258. after = this.raw(node, 'after');
  5259. } else {
  5260. after = this.raw(node, 'after', 'emptyBody');
  5261. }
  5262. if (after) this.builder(after);
  5263. this.builder('}', node, 'end');
  5264. };
  5265. Stringifier.prototype.raw = function raw(node, own, detect) {
  5266. var value = void 0;
  5267. if (!detect) detect = own;
  5268. // Already had
  5269. if (own) {
  5270. value = node.raws[own];
  5271. if (typeof value !== 'undefined') return value;
  5272. }
  5273. var parent = node.parent;
  5274. // Hack for first rule in CSS
  5275. if (detect === 'before') {
  5276. if (!parent || parent.type === 'root' && parent.first === node) {
  5277. return '';
  5278. }
  5279. }
  5280. // Floating child without parent
  5281. if (!parent) return defaultRaw[detect];
  5282. // Detect style by other nodes
  5283. var root = node.root();
  5284. if (!root.rawCache) root.rawCache = {};
  5285. if (typeof root.rawCache[detect] !== 'undefined') {
  5286. return root.rawCache[detect];
  5287. }
  5288. if (detect === 'before' || detect === 'after') {
  5289. return this.beforeAfter(node, detect);
  5290. } else {
  5291. var method = 'raw' + capitalize(detect);
  5292. if (this[method]) {
  5293. value = this[method](root, node);
  5294. } else {
  5295. root.walk(function (i) {
  5296. value = i.raws[own];
  5297. if (typeof value !== 'undefined') return false;
  5298. });
  5299. }
  5300. }
  5301. if (typeof value === 'undefined') value = defaultRaw[detect];
  5302. root.rawCache[detect] = value;
  5303. return value;
  5304. };
  5305. Stringifier.prototype.rawSemicolon = function rawSemicolon(root) {
  5306. var value = void 0;
  5307. root.walk(function (i) {
  5308. if (i.nodes && i.nodes.length && i.last.type === 'decl') {
  5309. value = i.raws.semicolon;
  5310. if (typeof value !== 'undefined') return false;
  5311. }
  5312. });
  5313. return value;
  5314. };
  5315. Stringifier.prototype.rawEmptyBody = function rawEmptyBody(root) {
  5316. var value = void 0;
  5317. root.walk(function (i) {
  5318. if (i.nodes && i.nodes.length === 0) {
  5319. value = i.raws.after;
  5320. if (typeof value !== 'undefined') return false;
  5321. }
  5322. });
  5323. return value;
  5324. };
  5325. Stringifier.prototype.rawIndent = function rawIndent(root) {
  5326. if (root.raws.indent) return root.raws.indent;
  5327. var value = void 0;
  5328. root.walk(function (i) {
  5329. var p = i.parent;
  5330. if (p && p !== root && p.parent && p.parent === root) {
  5331. if (typeof i.raws.before !== 'undefined') {
  5332. var parts = i.raws.before.split('\n');
  5333. value = parts[parts.length - 1];
  5334. value = value.replace(/[^\s]/g, '');
  5335. return false;
  5336. }
  5337. }
  5338. });
  5339. return value;
  5340. };
  5341. Stringifier.prototype.rawBeforeComment = function rawBeforeComment(root, node) {
  5342. var value = void 0;
  5343. root.walkComments(function (i) {
  5344. if (typeof i.raws.before !== 'undefined') {
  5345. value = i.raws.before;
  5346. if (value.indexOf('\n') !== -1) {
  5347. value = value.replace(/[^\n]+$/, '');
  5348. }
  5349. return false;
  5350. }
  5351. });
  5352. if (typeof value === 'undefined') {
  5353. value = this.raw(node, null, 'beforeDecl');
  5354. } else if (value) {
  5355. value = value.replace(/[^\s]/g, '');
  5356. }
  5357. return value;
  5358. };
  5359. Stringifier.prototype.rawBeforeDecl = function rawBeforeDecl(root, node) {
  5360. var value = void 0;
  5361. root.walkDecls(function (i) {
  5362. if (typeof i.raws.before !== 'undefined') {
  5363. value = i.raws.before;
  5364. if (value.indexOf('\n') !== -1) {
  5365. value = value.replace(/[^\n]+$/, '');
  5366. }
  5367. return false;
  5368. }
  5369. });
  5370. if (typeof value === 'undefined') {
  5371. value = this.raw(node, null, 'beforeRule');
  5372. } else if (value) {
  5373. value = value.replace(/[^\s]/g, '');
  5374. }
  5375. return value;
  5376. };
  5377. Stringifier.prototype.rawBeforeRule = function rawBeforeRule(root) {
  5378. var value = void 0;
  5379. root.walk(function (i) {
  5380. if (i.nodes && (i.parent !== root || root.first !== i)) {
  5381. if (typeof i.raws.before !== 'undefined') {
  5382. value = i.raws.before;
  5383. if (value.indexOf('\n') !== -1) {
  5384. value = value.replace(/[^\n]+$/, '');
  5385. }
  5386. return false;
  5387. }
  5388. }
  5389. });
  5390. if (value) value = value.replace(/[^\s]/g, '');
  5391. return value;
  5392. };
  5393. Stringifier.prototype.rawBeforeClose = function rawBeforeClose(root) {
  5394. var value = void 0;
  5395. root.walk(function (i) {
  5396. if (i.nodes && i.nodes.length > 0) {
  5397. if (typeof i.raws.after !== 'undefined') {
  5398. value = i.raws.after;
  5399. if (value.indexOf('\n') !== -1) {
  5400. value = value.replace(/[^\n]+$/, '');
  5401. }
  5402. return false;
  5403. }
  5404. }
  5405. });
  5406. if (value) value = value.replace(/[^\s]/g, '');
  5407. return value;
  5408. };
  5409. Stringifier.prototype.rawBeforeOpen = function rawBeforeOpen(root) {
  5410. var value = void 0;
  5411. root.walk(function (i) {
  5412. if (i.type !== 'decl') {
  5413. value = i.raws.between;
  5414. if (typeof value !== 'undefined') return false;
  5415. }
  5416. });
  5417. return value;
  5418. };
  5419. Stringifier.prototype.rawColon = function rawColon(root) {
  5420. var value = void 0;
  5421. root.walkDecls(function (i) {
  5422. if (typeof i.raws.between !== 'undefined') {
  5423. value = i.raws.between.replace(/[^\s:]/g, '');
  5424. return false;
  5425. }
  5426. });
  5427. return value;
  5428. };
  5429. Stringifier.prototype.beforeAfter = function beforeAfter(node, detect) {
  5430. var value = void 0;
  5431. if (node.type === 'decl') {
  5432. value = this.raw(node, null, 'beforeDecl');
  5433. } else if (node.type === 'comment') {
  5434. value = this.raw(node, null, 'beforeComment');
  5435. } else if (detect === 'before') {
  5436. value = this.raw(node, null, 'beforeRule');
  5437. } else {
  5438. value = this.raw(node, null, 'beforeClose');
  5439. }
  5440. var buf = node.parent;
  5441. var depth = 0;
  5442. while (buf && buf.type !== 'root') {
  5443. depth += 1;
  5444. buf = buf.parent;
  5445. }
  5446. if (value.indexOf('\n') !== -1) {
  5447. var indent = this.raw(node, null, 'indent');
  5448. if (indent.length) {
  5449. for (var step = 0; step < depth; step++) {
  5450. value += indent;
  5451. }
  5452. }
  5453. }
  5454. return value;
  5455. };
  5456. Stringifier.prototype.rawValue = function rawValue(node, prop) {
  5457. var value = node[prop];
  5458. var raw = node.raws[prop];
  5459. if (raw && raw.value === value) {
  5460. return raw.raw;
  5461. } else {
  5462. return value;
  5463. }
  5464. };
  5465. return Stringifier;
  5466. }();
  5467. exports.default = Stringifier;
  5468. module.exports = exports['default'];
  5469. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3Vy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G5vZGUsICd2YWx1ZScpO1xuXG4gICAgICAgIGlmICggbm9kZS5pbXBvcnRhbnQgKSB7XG4gICAgICAgICAgICBzdHJpbmcgKz0gbm9kZS5yYXdzLmltcG9ydGFudCB8fCAnICFpbXBvcnRhbnQnO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCBzZW1pY29sb24gKSBzdHJpbmcgKz0gJzsnO1xuICAgICAgICB0aGlzLmJ1aWxkZXIoc3RyaW5nLCBub2RlKTtcbiAgICB9XG5cbiAgICBydWxlKG5vZGUpIHtcbiAgICAgICAgdGhpcy5ibG9jayhub2RlLCB0aGlzLnJhd1ZhbHVlKG5vZGUsICdzZWxlY3RvcicpKTtcbiAgICAgICAgaWYgKCBub2RlLnJhd3Mub3duU2VtaWNvbG9uICkge1xuICAgICAgICAgICAgdGhpcy5idWlsZGVyKG5vZGUucmF3cy5vd25TZW1pY29sb24sIG5vZGUsICdlbmQnKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGF0cnVsZShub2RlLCBzZW1pY29sb24pIHtcbiAgICAgICAgbGV0IG5hbWUgICA9ICdAJyArIG5vZGUubmFtZTtcbiAgICAgICAgbGV0IHBhcmFtcyA9IG5vZGUucGFyYW1zID8gdGhpcy5yYXdWYWx1ZShub2RlLCAncGFyYW1zJykgOiAnJztcblxuICAgICAgICBpZiAoIHR5cGVvZiBub2RlLnJhd3MuYWZ0ZXJOYW1lICE9PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgIG5hbWUgKz0gbm9kZS5yYXdzLmFmdGVyTmFtZTtcbiAgICAgICAgfSBlbHNlIGlmICggcGFyYW1zICkge1xuICAgICAgICAgICAgbmFtZSArPSAnICc7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIG5vZGUubm9kZXMgKSB7XG4gICAgICAgICAgICB0aGlzLmJsb2NrKG5vZGUsIG5hbWUgKyBwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IGVuZCA9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mICggbm9kZS5ub2RlcyAmJiBub2RlLm5vZGVzLmxlbmd0aCApIHtcbiAgICAgICAgICAgIHRoaXMuYm9keShub2RlKTtcbiAgICAgICAgICAgIGFmdGVyID0gdGhpcy5yYXcobm9kZSwgJ2FmdGVyJyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBhZnRlciA9IHRoaXMucmF3KG5vZGUsICdhZnRlcicsICdlbXB0eUJvZHknKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICggYWZ0ZXIgKSB0aGlzLmJ1aWxkZXIoYWZ0ZXIpO1xuICAgICAgICB0aGlzLmJ1aWxkZXIoJ30nLCBub2RlLCAnZW5kJyk7XG4gICAgfVxuXG4gICAgcmF3KG5vZGUsIG93biwgZGV0ZWN0KSB7XG4gICAgICAgIGxldCB2YWx1ZTtcbiAgICAgICAgaWYgKCAhZGV0ZWN0ICkgZGV0ZWN0ID0gb3duO1xuXG4gICAgICAgIC8vIEFscmVhZHkgaGFkXG4gICAgICAgIGlmICggb3duICkge1xuICAgICAgICAgICAgdmFsdWUgPSBub2RlLnJhd3Nbb3duXTtcbiAgICAgICAgICAgIGlmICggdHlwZW9mIHZhbHVlICE9PSAndW5kZWZpbmVkJyApIHJldHVybiB2YWx1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCBwYXJlbnQgPSBub2RlLnBhcmVudDtcblxuICAgICAgICAvLyBIYWNrIGZvciBmaXJzdCBydWxlIGluIENTU1xuICAgICAgICBpZiAoIGRldGVjdCA9PT0gJ2JlZm9yZScgKSB7XG4gICAgICAgICAgICBpZiAoICFwYXJlbnQgfHwgcGFyZW50LnR5cGUgPT09ICdyb290JyAmJiBwYXJlbnQuZmlyc3QgPT09IG5vZGUgKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICcnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgLy8gRmxvYXRpbmcgY2hpbGQgd2l0aG91dCBwYXJlbnRcbiAgICAgIC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UmF3W2RldGVjdF07XG5cbiAgICAgICAgcm9vdC5yYXdDYWNoZVtkZXRlY3RdID0gdmFsdWU7XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICByYXdTZW1pY29sb24ocm9vdCkge1xuICAgICAgICBsZXQgdmFsdWU7XG4gICAgICAgIHJvb3Qud2FsayggaSA9PiB7XG4gICAgICAgICAgICBpZiAoIGkubm9kZXMgJiYgaS5ub2Rlcy5sZW5ndGggJiYgaS5sYXN0LnR5cGUgPT09ICdkZWNsJyApIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGkucmF3cy5zZW1pY29sb247XG4gICAgICAgICAgICAgICAgaWYgKCB0eXBlb2YgdmFsdWUgIT09ICd1bmRlZmluZWQnICkgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cblxuICAgIHJhd0VtcHR5Qm9keShyb290KSB7XG4gICAgICAgIGxldCB2YWx1ZTtcbiAgICAgICAgcm9vdC53YWxrKCBpID0+IHtcbiAgICAgICAgICAgIGlmICggaS5ub2RlcyAmJiBpLm5vZGVzLmxlbmd0aCA9PT0gMCApIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGkucmF3cy5hZnRlcjtcbiAgICAgICAgICAgICAgICBpZiAoIHR5cGVvZiB2YWx1ZSAhPT0gJ3VuZGVmaW5lZCcgKSByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuXG4gICAgcmF3SW5kZW50KHJvb3QpIHtcbiAgICAgICAgaWYgKCByb290LnJhd3MuaW5kZW50ICkgcmV0dXJuIHJvb3QucmF3cy5pbmRlbnQ7XG4gICAgICAgIGxldCB2YWx1ZTtcbiAgICAgICAgcm9vdC53YWxrKCBpID0+IHtcbiAgICAgICAgICAgIGxldCBwID0gaS5wYXJlbnQ7XG4gICAgICAgICAgICBpZiAoIHAgJiYgcCAhPT0gcm9vdCAmJiBwLnBhcmVudCAmJiBwLnBhcmVudCA9PT0gcm9vdCApIHtcbiAgICAgICAgICAgICAgICBpZiAoIHR5cGVvZiBpLnJhd3MuYmVmb3JlICE9PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhcnRzID0gaS5yYXdzLmJlZm9yZS5zcGxpdCgnXFxuJyk7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gcGFydHNbcGFydHMubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gdmFsdWUucmVwbGFjZSgvW15cXHNdL2csICcnKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICByYXdCZWZvcmVDb21tZW50KHJvb3QsIG5vZGUpIHtcbiAgICAgICAgbGV0IHZhbHVlO1xuICAgICAgICByb290LndhbGtDb21tZW50cyggaSA9PiB7XG4gICAgICAgICAgICBpZiAoIHR5cGVvZiBpLnJhd3MuYmVmb3JlICE9PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGkucmF3cy5iZWZvcmU7XG4gICAgICAgICAgICAgICAgaWYgKCB2YWx1ZS5pbmRleE9mKCdcXG4nKSAhPT0gLTEgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gdmFsdWUucmVwbGFjZSgvW15cXG5dKyQvLCAnJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIGlmICggdHlwZW9mIHZhbHVlID09PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgIHZhbHVlID0gdGhpcy5yYXcobm9kZSwgbnVsbCwgJ2JlZm9yZURlY2wnKTtcbiAgICAgICAgfSBlbHNlIGlmICggdmFsdWUgKSB7XG4gICAgICAgICAgICB2YWx1ZSA9IHZhbHVlLnJlcGxhY2UoL1teXFxzXS9nLCAnJyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cblxuICAgIHJhd0JlZm9yZURlY2wocm9vdCwgbm9kZSkge1xuICAgICAgICBsZXQgdmFsdWU7XG4gICAgICAgIHJvb3Qud2Fsa0RlY2xzKCBpID0+IHtcbiAgICAgICAgICAgIGlmICggdHlwZW9mIGkucmF3cy5iZWZvcmUgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLmJlZm9yZTtcbiAgICAgICAgICAgICAgICBpZiAoIHZhbHVlLmluZGV4T2YoJ1xcbicpICE9PSAtMSApIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZS5yZXBsYWNlKC9bXlxcbl0rJC8sICcnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgaWYgKCB0eXBlb2YgdmFsdWUgPT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgdmFsdWUgPSB0aGlzLnJhdyhub2RlLCBudWxsLCAnYmVmb3JlUnVsZScpO1xuICAgICAgICB9IGVsc2UgaWYgKCB2YWx1ZSApIHtcbiAgICAgICAgICAgIHZhbHVlID0gdmFsdWUucmVwbGFjZSgvW15cXHNdL2csICcnKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuXG4gICAgcmF3QmVmb3JlUnVsZShyb290KSB7XG4gICAgICAgIGxldCB2YWx1ZTtcbiAgICAgICAgcm9vdC53YWxrKCBpID0+IHtcbiAgICAgICAgICAgIGlmICggaS5ub2RlcyAmJiAoaS5wYXJlbnQgIT09IHJvb3QgfHwgcm9vdC5maXJzdCAhPT0gaSkgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCB0eXBlb2YgaS5yYXdzLmJlZm9yZSAhPT0gJ3VuZGVmaW5lZCcgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLmJlZm9yZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCB2YWx1ZS5pbmRleE9mKCdcXG4nKSAhPT0gLTEgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHZhbHVlLnJlcGxhY2UoL1teXFxuXSskLywgJycpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBpZiAoIHZhbHVlICkgdmFsdWUgPSB2YWx1ZS5yZXBsYWNlKC9bXlxcc10vZywgJycpO1xuICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuXG4gICAgcmF3QmVmb3JlQ2xvc2Uocm9vdCkge1xuICAgICAgICBsZXQgdmFsdWU7XG4gICAgICAgIHJvb3Qud2FsayggaSA9PiB7XG4gICAgICAgICAgICBpZiAoIGkubm9kZXMgJiYgaS5ub2Rlcy5sZW5ndGggPiAwICkge1xuICAgICAgICAgICAgICAgIGlmICggdHlwZW9mIGkucmF3cy5hZnRlciAhPT0gJ3VuZGVmaW5lZCcgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLmFmdGVyO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIHZhbHVlLmluZGV4T2YoJ1xcbicpICE9PSAtMSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gdmFsdWUucmVwbGFjZSgvW15cXG5dKyQvLCAnJyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIGlmICggdmFsdWUgKSB2YWx1ZSA9IHZhbHVlLnJlcGxhY2UoL1teXFxzXS9nLCAnJyk7XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICByYXdCZWZvcmVPcGVuKHJvb3QpIHtcbiAgICAgICAgbGV0IHZhbHVlO1xuICAgICAgICByb290LndhbGsoIGkgPT4ge1xuICAgICAgICAgICAgaWYgKCBpLnR5cGUgIT09ICdkZWNsJyApIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGkucmF3cy5iZXR3ZWVuO1xuICAgICAgICAgICAgICAgIGlmICggdHlwZW9mIHZhbHVlICE9PSAndW5kZWZpbmVkJyApIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICByYXdDb2xvbihyb290KSB7XG4gICAgICAgIGxldCB2YWx1ZTtcbiAgICAgICAgcm9vdC53YWxrRGVjbHMoIGkgPT4ge1xuICAgICAgICAgICAgaWYgKCB0eXBlb2YgaS5yYXdzLmJldHdlZW4gIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLmJldHdlZW4ucmVwbGFjZSgvW15cXHM6XS9nLCAnJyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cblxuICAgIGJlZm9yZUFmdGVyKG5vZGUsIGRldGVjdCkge1xuICAgICAgICBsZXQgdmFsdWU7XG4gICAgICAgIGlmICggbm9kZS50eXBlID09PSAnZGVjbCcgKSB7XG4gICAgICAgICAgICB2Y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IG5vZGVbcHJvcF07XG4gICAgICAgIGxldCByYXcgICA9IG5vZGUucmF3c1twcm9wXTtcbiAgICAgICAgaWYgKCByYXcgJiYgcmF3LnZhbHVlID09PSB2YWx1ZSApIHtcbiAgICAgICAgICAgIHJldHVybiByYXcucmF3O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICB9XG4gICAgfVxuXG59XG5cbmV4cG9ydCBkZWZhdWx0IFN0cmluZ2lmaWVyO1xuIl19
  5470. /***/ }),
  5471. /* 22 */
  5472. /***/ (function(module, exports, __webpack_require__) {
  5473. "use strict";
  5474. exports.__esModule = true;
  5475. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5476. var _node = __webpack_require__(6);
  5477. var _node2 = _interopRequireDefault(_node);
  5478. var _types = __webpack_require__(0);
  5479. var types = _interopRequireWildcard(_types);
  5480. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  5481. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5482. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5483. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5484. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5485. var Container = function (_Node) {
  5486. _inherits(Container, _Node);
  5487. function Container(opts) {
  5488. _classCallCheck(this, Container);
  5489. var _this = _possibleConstructorReturn(this, _Node.call(this, opts));
  5490. if (!_this.nodes) {
  5491. _this.nodes = [];
  5492. }
  5493. return _this;
  5494. }
  5495. Container.prototype.append = function append(selector) {
  5496. selector.parent = this;
  5497. this.nodes.push(selector);
  5498. return this;
  5499. };
  5500. Container.prototype.prepend = function prepend(selector) {
  5501. selector.parent = this;
  5502. this.nodes.unshift(selector);
  5503. return this;
  5504. };
  5505. Container.prototype.at = function at(index) {
  5506. return this.nodes[index];
  5507. };
  5508. Container.prototype.index = function index(child) {
  5509. if (typeof child === 'number') {
  5510. return child;
  5511. }
  5512. return this.nodes.indexOf(child);
  5513. };
  5514. Container.prototype.removeChild = function removeChild(child) {
  5515. child = this.index(child);
  5516. this.at(child).parent = undefined;
  5517. this.nodes.splice(child, 1);
  5518. var index = void 0;
  5519. for (var id in this.indexes) {
  5520. index = this.indexes[id];
  5521. if (index >= child) {
  5522. this.indexes[id] = index - 1;
  5523. }
  5524. }
  5525. return this;
  5526. };
  5527. Container.prototype.removeAll = function removeAll() {
  5528. for (var _iterator = this.nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  5529. var _ref;
  5530. if (_isArray) {
  5531. if (_i >= _iterator.length) break;
  5532. _ref = _iterator[_i++];
  5533. } else {
  5534. _i = _iterator.next();
  5535. if (_i.done) break;
  5536. _ref = _i.value;
  5537. }
  5538. var node = _ref;
  5539. node.parent = undefined;
  5540. }
  5541. this.nodes = [];
  5542. return this;
  5543. };
  5544. Container.prototype.empty = function empty() {
  5545. return this.removeAll();
  5546. };
  5547. Container.prototype.insertAfter = function insertAfter(oldNode, newNode) {
  5548. var oldIndex = this.index(oldNode);
  5549. this.nodes.splice(oldIndex + 1, 0, newNode);
  5550. var index = void 0;
  5551. for (var id in this.indexes) {
  5552. index = this.indexes[id];
  5553. if (oldIndex <= index) {
  5554. this.indexes[id] = index + this.nodes.length;
  5555. }
  5556. }
  5557. return this;
  5558. };
  5559. Container.prototype.insertBefore = function insertBefore(oldNode, newNode) {
  5560. var oldIndex = this.index(oldNode);
  5561. this.nodes.splice(oldIndex, 0, newNode);
  5562. var index = void 0;
  5563. for (var id in this.indexes) {
  5564. index = this.indexes[id];
  5565. if (oldIndex <= index) {
  5566. this.indexes[id] = index + this.nodes.length;
  5567. }
  5568. }
  5569. return this;
  5570. };
  5571. Container.prototype.each = function each(callback) {
  5572. if (!this.lastEach) {
  5573. this.lastEach = 0;
  5574. }
  5575. if (!this.indexes) {
  5576. this.indexes = {};
  5577. }
  5578. this.lastEach++;
  5579. var id = this.lastEach;
  5580. this.indexes[id] = 0;
  5581. if (!this.length) {
  5582. return undefined;
  5583. }
  5584. var index = void 0,
  5585. result = void 0;
  5586. while (this.indexes[id] < this.length) {
  5587. index = this.indexes[id];
  5588. result = callback(this.at(index), index);
  5589. if (result === false) {
  5590. break;
  5591. }
  5592. this.indexes[id] += 1;
  5593. }
  5594. delete this.indexes[id];
  5595. if (result === false) {
  5596. return false;
  5597. }
  5598. };
  5599. Container.prototype.walk = function walk(callback) {
  5600. return this.each(function (node, i) {
  5601. var result = callback(node, i);
  5602. if (result !== false && node.length) {
  5603. result = node.walk(callback);
  5604. }
  5605. if (result === false) {
  5606. return false;
  5607. }
  5608. });
  5609. };
  5610. Container.prototype.walkAttributes = function walkAttributes(callback) {
  5611. var _this2 = this;
  5612. return this.walk(function (selector) {
  5613. if (selector.type === types.ATTRIBUTE) {
  5614. return callback.call(_this2, selector);
  5615. }
  5616. });
  5617. };
  5618. Container.prototype.walkClasses = function walkClasses(callback) {
  5619. var _this3 = this;
  5620. return this.walk(function (selector) {
  5621. if (selector.type === types.CLASS) {
  5622. return callback.call(_this3, selector);
  5623. }
  5624. });
  5625. };
  5626. Container.prototype.walkCombinators = function walkCombinators(callback) {
  5627. var _this4 = this;
  5628. return this.walk(function (selector) {
  5629. if (selector.type === types.COMBINATOR) {
  5630. return callback.call(_this4, selector);
  5631. }
  5632. });
  5633. };
  5634. Container.prototype.walkComments = function walkComments(callback) {
  5635. var _this5 = this;
  5636. return this.walk(function (selector) {
  5637. if (selector.type === types.COMMENT) {
  5638. return callback.call(_this5, selector);
  5639. }
  5640. });
  5641. };
  5642. Container.prototype.walkIds = function walkIds(callback) {
  5643. var _this6 = this;
  5644. return this.walk(function (selector) {
  5645. if (selector.type === types.ID) {
  5646. return callback.call(_this6, selector);
  5647. }
  5648. });
  5649. };
  5650. Container.prototype.walkNesting = function walkNesting(callback) {
  5651. var _this7 = this;
  5652. return this.walk(function (selector) {
  5653. if (selector.type === types.NESTING) {
  5654. return callback.call(_this7, selector);
  5655. }
  5656. });
  5657. };
  5658. Container.prototype.walkPseudos = function walkPseudos(callback) {
  5659. var _this8 = this;
  5660. return this.walk(function (selector) {
  5661. if (selector.type === types.PSEUDO) {
  5662. return callback.call(_this8, selector);
  5663. }
  5664. });
  5665. };
  5666. Container.prototype.walkTags = function walkTags(callback) {
  5667. var _this9 = this;
  5668. return this.walk(function (selector) {
  5669. if (selector.type === types.TAG) {
  5670. return callback.call(_this9, selector);
  5671. }
  5672. });
  5673. };
  5674. Container.prototype.walkUniversals = function walkUniversals(callback) {
  5675. var _this10 = this;
  5676. return this.walk(function (selector) {
  5677. if (selector.type === types.UNIVERSAL) {
  5678. return callback.call(_this10, selector);
  5679. }
  5680. });
  5681. };
  5682. Container.prototype.split = function split(callback) {
  5683. var _this11 = this;
  5684. var current = [];
  5685. return this.reduce(function (memo, node, index) {
  5686. var split = callback.call(_this11, node);
  5687. current.push(node);
  5688. if (split) {
  5689. memo.push(current);
  5690. current = [];
  5691. } else if (index === _this11.length - 1) {
  5692. memo.push(current);
  5693. }
  5694. return memo;
  5695. }, []);
  5696. };
  5697. Container.prototype.map = function map(callback) {
  5698. return this.nodes.map(callback);
  5699. };
  5700. Container.prototype.reduce = function reduce(callback, memo) {
  5701. return this.nodes.reduce(callback, memo);
  5702. };
  5703. Container.prototype.every = function every(callback) {
  5704. return this.nodes.every(callback);
  5705. };
  5706. Container.prototype.some = function some(callback) {
  5707. return this.nodes.some(callback);
  5708. };
  5709. Container.prototype.filter = function filter(callback) {
  5710. return this.nodes.filter(callback);
  5711. };
  5712. Container.prototype.sort = function sort(callback) {
  5713. return this.nodes.sort(callback);
  5714. };
  5715. Container.prototype.toString = function toString() {
  5716. return this.map(String).join('');
  5717. };
  5718. _createClass(Container, [{
  5719. key: 'first',
  5720. get: function get() {
  5721. return this.at(0);
  5722. }
  5723. }, {
  5724. key: 'last',
  5725. get: function get() {
  5726. return this.at(this.length - 1);
  5727. }
  5728. }, {
  5729. key: 'length',
  5730. get: function get() {
  5731. return this.nodes.length;
  5732. }
  5733. }]);
  5734. return Container;
  5735. }(_node2.default);
  5736. exports.default = Container;
  5737. module.exports = exports['default'];
  5738. /***/ }),
  5739. /* 23 */
  5740. /***/ (function(module, exports, __webpack_require__) {
  5741. "use strict";
  5742. exports.__esModule = true;
  5743. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5744. var _container = __webpack_require__(25);
  5745. var _container2 = _interopRequireDefault(_container);
  5746. var _warnOnce = __webpack_require__(4);
  5747. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  5748. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5749. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5750. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5751. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5752. /**
  5753. * Represents an at-rule.
  5754. *
  5755. * If it’s followed in the CSS by a {} block, this node will have
  5756. * a nodes property representing its children.
  5757. *
  5758. * @extends Container
  5759. *
  5760. * @example
  5761. * const root = postcss.parse('@charset "UTF-8"; @media print {}');
  5762. *
  5763. * const charset = root.first;
  5764. * charset.type //=> 'atrule'
  5765. * charset.nodes //=> undefined
  5766. *
  5767. * const media = root.last;
  5768. * media.nodes //=> []
  5769. */
  5770. var AtRule = function (_Container) {
  5771. _inherits(AtRule, _Container);
  5772. function AtRule(defaults) {
  5773. _classCallCheck(this, AtRule);
  5774. var _this = _possibleConstructorReturn(this, _Container.call(this, defaults));
  5775. _this.type = 'atrule';
  5776. return _this;
  5777. }
  5778. AtRule.prototype.append = function append() {
  5779. var _Container$prototype$;
  5780. if (!this.nodes) this.nodes = [];
  5781. for (var _len = arguments.length, children = Array(_len), _key = 0; _key < _len; _key++) {
  5782. children[_key] = arguments[_key];
  5783. }
  5784. return (_Container$prototype$ = _Container.prototype.append).call.apply(_Container$prototype$, [this].concat(children));
  5785. };
  5786. AtRule.prototype.prepend = function prepend() {
  5787. var _Container$prototype$2;
  5788. if (!this.nodes) this.nodes = [];
  5789. for (var _len2 = arguments.length, children = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  5790. children[_key2] = arguments[_key2];
  5791. }
  5792. return (_Container$prototype$2 = _Container.prototype.prepend).call.apply(_Container$prototype$2, [this].concat(children));
  5793. };
  5794. _createClass(AtRule, [{
  5795. key: 'afterName',
  5796. get: function get() {
  5797. (0, _warnOnce2.default)('AtRule#afterName was deprecated. Use AtRule#raws.afterName');
  5798. return this.raws.afterName;
  5799. },
  5800. set: function set(val) {
  5801. (0, _warnOnce2.default)('AtRule#afterName was deprecated. Use AtRule#raws.afterName');
  5802. this.raws.afterName = val;
  5803. }
  5804. }, {
  5805. key: '_params',
  5806. get: function get() {
  5807. (0, _warnOnce2.default)('AtRule#_params was deprecated. Use AtRule#raws.params');
  5808. return this.raws.params;
  5809. },
  5810. set: function set(val) {
  5811. (0, _warnOnce2.default)('AtRule#_params was deprecated. Use AtRule#raws.params');
  5812. this.raws.params = val;
  5813. }
  5814. /**
  5815. * @memberof AtRule#
  5816. * @member {string} name - the at-rule’s name immediately follows the `@`
  5817. *
  5818. * @example
  5819. * const root = postcss.parse('@media print {}');
  5820. * media.name //=> 'media'
  5821. * const media = root.first;
  5822. */
  5823. /**
  5824. * @memberof AtRule#
  5825. * @member {string} params - the at-rule’s parameters, the values
  5826. * that follow the at-rule’s name but precede
  5827. * any {} block
  5828. *
  5829. * @example
  5830. * const root = postcss.parse('@media print, screen {}');
  5831. * const media = root.first;
  5832. * media.params //=> 'print, screen'
  5833. */
  5834. /**
  5835. * @memberof AtRule#
  5836. * @member {object} raws - Information to generate byte-to-byte equal
  5837. * node string as it was in the origin input.
  5838. *
  5839. * Every parser saves its own properties,
  5840. * but the default CSS parser uses:
  5841. *
  5842. * * `before`: the space symbols before the node. It also stores `*`
  5843. * and `_` symbols before the declaration (IE hack).
  5844. * * `after`: the space symbols after the last child of the node
  5845. * to the end of the node.
  5846. * * `between`: the symbols between the property and value
  5847. * for declarations, selector and `{` for rules, or last parameter
  5848. * and `{` for at-rules.
  5849. * * `semicolon`: contains true if the last child has
  5850. * an (optional) semicolon.
  5851. * * `afterName`: the space between the at-rule name and its parameters.
  5852. *
  5853. * PostCSS cleans at-rule parameters from comments and extra spaces,
  5854. * but it stores origin content in raws properties.
  5855. * As such, if you don’t change a declaration’s value,
  5856. * PostCSS will use the raw value with comments.
  5857. *
  5858. * @example
  5859. * const root = postcss.parse(' @media\nprint {\n}')
  5860. * root.first.first.raws //=> { before: ' ',
  5861. * // between: ' ',
  5862. * // afterName: '\n',
  5863. * // after: '\n' }
  5864. */
  5865. }]);
  5866. return AtRule;
  5867. }(_container2.default);
  5868. exports.default = AtRule;
  5869. module.exports = exports['default'];
  5870. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImF0LXJ1bGUuZXM2Il0sIm5hbWVzIjpbIkF0UnVsZSIsImRlZmF1bHRzIiwidHlwZSIsImFwcGVuZCIsIm5vZGVzIiwiY2hpbGRyZW4iLCJwcmVwZW5kIiwicmF3cyIsImFmdGVyTmFtZSIsInZhbCIsInBhcmFtcyJdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUE7Ozs7QUFDQTs7Ozs7Ozs7Ozs7O0FBRUE7Ozs7Ozs7Ozs7Ozs7Ozs7OztJQWtCTUEsTTs7O0FBRUYsb0JBQVlDLFFBQVosRUFBc0I7QUFBQTs7QUFBQSxxREFDbEIsc0JBQU1BLFFBQU4sQ0FEa0I7O0FBRWxCLGNBQUtDLElBQUwsR0FBWSxRQUFaO0FBRmtCO0FBR3JCOztxQkFFREMsTSxxQkFBb0I7QUFBQTs7QUFDaEIsWUFBSyxDQUFDLEtBQUtDLEtBQVgsRUFBbUIsS0FBS0EsS0FBTCxHQUFhLEVBQWI7O0FBREgsMENBQVZDLFFBQVU7QUFBVkEsb0JBQVU7QUFBQTs7QUFFaEIsZUFBTyw4Q0FBTUYsTUFBTixrREFBZ0JFLFFBQWhCLEVBQVA7QUFDSCxLOztxQkFFREMsTyxzQkFBcUI7QUFBQTs7QUFDakIsWUFBSyxDQUFDLEtBQUtGLEtBQVgsRUFBbUIsS0FBS0EsS0FBTCx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WZ0ZXI6ICdcXG4nIH1cbiAgICAgKi9cbn1cblxuZXhwb3J0IGRlZmF1bHQgQXRSdWxlO1xuIl19
  5871. /***/ }),
  5872. /* 24 */
  5873. /***/ (function(module, exports, __webpack_require__) {
  5874. "use strict";
  5875. exports.__esModule = true;
  5876. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5877. var _warnOnce = __webpack_require__(4);
  5878. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  5879. var _node = __webpack_require__(27);
  5880. var _node2 = _interopRequireDefault(_node);
  5881. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5882. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5883. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5884. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5885. /**
  5886. * Represents a comment between declarations or statements (rule and at-rules).
  5887. *
  5888. * Comments inside selectors, at-rule parameters, or declaration values
  5889. * will be stored in the `raws` properties explained above.
  5890. *
  5891. * @extends Node
  5892. */
  5893. var Comment = function (_Node) {
  5894. _inherits(Comment, _Node);
  5895. function Comment(defaults) {
  5896. _classCallCheck(this, Comment);
  5897. var _this = _possibleConstructorReturn(this, _Node.call(this, defaults));
  5898. _this.type = 'comment';
  5899. return _this;
  5900. }
  5901. _createClass(Comment, [{
  5902. key: 'left',
  5903. get: function get() {
  5904. (0, _warnOnce2.default)('Comment#left was deprecated. Use Comment#raws.left');
  5905. return this.raws.left;
  5906. },
  5907. set: function set(val) {
  5908. (0, _warnOnce2.default)('Comment#left was deprecated. Use Comment#raws.left');
  5909. this.raws.left = val;
  5910. }
  5911. }, {
  5912. key: 'right',
  5913. get: function get() {
  5914. (0, _warnOnce2.default)('Comment#right was deprecated. Use Comment#raws.right');
  5915. return this.raws.right;
  5916. },
  5917. set: function set(val) {
  5918. (0, _warnOnce2.default)('Comment#right was deprecated. Use Comment#raws.right');
  5919. this.raws.right = val;
  5920. }
  5921. /**
  5922. * @memberof Comment#
  5923. * @member {string} text - the comment’s text
  5924. */
  5925. /**
  5926. * @memberof Comment#
  5927. * @member {object} raws - Information to generate byte-to-byte equal
  5928. * node string as it was in the origin input.
  5929. *
  5930. * Every parser saves its own properties,
  5931. * but the default CSS parser uses:
  5932. *
  5933. * * `before`: the space symbols before the node.
  5934. * * `left`: the space symbols between `/*` and the comment’s text.
  5935. * * `right`: the space symbols between the comment’s text.
  5936. */
  5937. }]);
  5938. return Comment;
  5939. }(_node2.default);
  5940. exports.default = Comment;
  5941. module.exports = exports['default'];
  5942. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbW1lbnQuZXM2Il0sIm5hbWVzIjpbIkNvbW1lbnQiLCJkZWZhdWx0cyIsInR5cGUiLCJyYXdzIiwibGVmdCIsInZhbCIsInJpZ2h0Il0sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQTs7OztBQUNBOzs7Ozs7Ozs7Ozs7QUFFQTs7Ozs7Ozs7SUFRTUEsTzs7O0FBRUYscUJBQVlDLFFBQVosRUFBc0I7QUFBQTs7QUFBQSxxREFDbEIsaUJBQU1BLFFBQU4sQ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dGUgZXF1YWxcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICBub2RlIHN0cmluZyBhcyBpdCB3YXMgaW4gdGhlIG9yaWdpbiBpbnB1dC5cbiAgICAgKlxuICAgICAqIEV2ZXJ5IHBhcnNlciBzYXZlcyBpdHMgb3duIHByb3BlcnRpZXMsXG4gICAgICogYnV0IHRoZSBkZWZhdWx0IENTUyBwYXJzZXIgdXNlczpcbiAgICAgKlxuICAgICAqICogYGJlZm9yZWA6IHRoZSBzcGFjZSBzeW1ib2xzIGJlZm9yZSB0aGUgbm9kZS5cbiAgICAgKiAqIGBsZWZ0YDogdGhlIHNwYWNlIHN5bWJvbHMgYmV0d2VlbiBgLypgIGFuZCB0aGUgY29tbWVudOKAmXMgdGV4dC5cbiAgICAgKiAqIGByaWdodGA6IHRoZSBzcGFjZSBzeW1ib2xzIGJldHdlZW4gdGhlIGNvbW1lbnTigJlzIHRleHQuXG4gICAgICovXG59XG5cbmV4cG9ydCBkZWZhdWx0IENvbW1lbnQ7XG4iXX0=
  5943. /***/ }),
  5944. /* 25 */
  5945. /***/ (function(module, exports, __webpack_require__) {
  5946. "use strict";
  5947. exports.__esModule = true;
  5948. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5949. var _declaration = __webpack_require__(76);
  5950. var _declaration2 = _interopRequireDefault(_declaration);
  5951. var _warnOnce = __webpack_require__(4);
  5952. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  5953. var _comment = __webpack_require__(24);
  5954. var _comment2 = _interopRequireDefault(_comment);
  5955. var _node = __webpack_require__(27);
  5956. var _node2 = _interopRequireDefault(_node);
  5957. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  5958. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5959. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5960. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5961. function cleanSource(nodes) {
  5962. return nodes.map(function (i) {
  5963. if (i.nodes) i.nodes = cleanSource(i.nodes);
  5964. delete i.source;
  5965. return i;
  5966. });
  5967. }
  5968. /**
  5969. * The {@link Root}, {@link AtRule}, and {@link Rule} container nodes
  5970. * inherit some common methods to help work with their children.
  5971. *
  5972. * Note that all containers can store any content. If you write a rule inside
  5973. * a rule, PostCSS will parse it.
  5974. *
  5975. * @extends Node
  5976. * @abstract
  5977. */
  5978. var Container = function (_Node) {
  5979. _inherits(Container, _Node);
  5980. function Container() {
  5981. _classCallCheck(this, Container);
  5982. return _possibleConstructorReturn(this, _Node.apply(this, arguments));
  5983. }
  5984. Container.prototype.push = function push(child) {
  5985. child.parent = this;
  5986. this.nodes.push(child);
  5987. return this;
  5988. };
  5989. /**
  5990. * Iterates through the container’s immediate children,
  5991. * calling `callback` for each child.
  5992. *
  5993. * Returning `false` in the callback will break iteration.
  5994. *
  5995. * This method only iterates through the container’s immediate children.
  5996. * If you need to recursively iterate through all the container’s descendant
  5997. * nodes, use {@link Container#walk}.
  5998. *
  5999. * Unlike the for `{}`-cycle or `Array#forEach` this iterator is safe
  6000. * if you are mutating the array of child nodes during iteration.
  6001. * PostCSS will adjust the current index to match the mutations.
  6002. *
  6003. * @param {childIterator} callback - iterator receives each node and index
  6004. *
  6005. * @return {false|undefined} returns `false` if iteration was broke
  6006. *
  6007. * @example
  6008. * const root = postcss.parse('a { color: black; z-index: 1 }');
  6009. * const rule = root.first;
  6010. *
  6011. * for ( let decl of rule.nodes ) {
  6012. * decl.cloneBefore({ prop: '-webkit-' + decl.prop });
  6013. * // Cycle will be infinite, because cloneBefore moves the current node
  6014. * // to the next index
  6015. * }
  6016. *
  6017. * rule.each(decl => {
  6018. * decl.cloneBefore({ prop: '-webkit-' + decl.prop });
  6019. * // Will be executed only for color and z-index
  6020. * });
  6021. */
  6022. Container.prototype.each = function each(callback) {
  6023. if (!this.lastEach) this.lastEach = 0;
  6024. if (!this.indexes) this.indexes = {};
  6025. this.lastEach += 1;
  6026. var id = this.lastEach;
  6027. this.indexes[id] = 0;
  6028. if (!this.nodes) return undefined;
  6029. var index = void 0,
  6030. result = void 0;
  6031. while (this.indexes[id] < this.nodes.length) {
  6032. index = this.indexes[id];
  6033. result = callback(this.nodes[index], index);
  6034. if (result === false) break;
  6035. this.indexes[id] += 1;
  6036. }
  6037. delete this.indexes[id];
  6038. return result;
  6039. };
  6040. /**
  6041. * Traverses the container’s descendant nodes, calling callback
  6042. * for each node.
  6043. *
  6044. * Like container.each(), this method is safe to use
  6045. * if you are mutating arrays during iteration.
  6046. *
  6047. * If you only need to iterate through the container’s immediate children,
  6048. * use {@link Container#each}.
  6049. *
  6050. * @param {childIterator} callback - iterator receives each node and index
  6051. *
  6052. * @return {false|undefined} returns `false` if iteration was broke
  6053. *
  6054. * @example
  6055. * root.walk(node => {
  6056. * // Traverses all descendant nodes.
  6057. * });
  6058. */
  6059. Container.prototype.walk = function walk(callback) {
  6060. return this.each(function (child, i) {
  6061. var result = callback(child, i);
  6062. if (result !== false && child.walk) {
  6063. result = child.walk(callback);
  6064. }
  6065. return result;
  6066. });
  6067. };
  6068. /**
  6069. * Traverses the container’s descendant nodes, calling callback
  6070. * for each declaration node.
  6071. *
  6072. * If you pass a filter, iteration will only happen over declarations
  6073. * with matching properties.
  6074. *
  6075. * Like {@link Container#each}, this method is safe
  6076. * to use if you are mutating arrays during iteration.
  6077. *
  6078. * @param {string|RegExp} [prop] - string or regular expression
  6079. * to filter declarations by property name
  6080. * @param {childIterator} callback - iterator receives each node and index
  6081. *
  6082. * @return {false|undefined} returns `false` if iteration was broke
  6083. *
  6084. * @example
  6085. * root.walkDecls(decl => {
  6086. * checkPropertySupport(decl.prop);
  6087. * });
  6088. *
  6089. * root.walkDecls('border-radius', decl => {
  6090. * decl.remove();
  6091. * });
  6092. *
  6093. * root.walkDecls(/^background/, decl => {
  6094. * decl.value = takeFirstColorFromGradient(decl.value);
  6095. * });
  6096. */
  6097. Container.prototype.walkDecls = function walkDecls(prop, callback) {
  6098. if (!callback) {
  6099. callback = prop;
  6100. return this.walk(function (child, i) {
  6101. if (child.type === 'decl') {
  6102. return callback(child, i);
  6103. }
  6104. });
  6105. } else if (prop instanceof RegExp) {
  6106. return this.walk(function (child, i) {
  6107. if (child.type === 'decl' && prop.test(child.prop)) {
  6108. return callback(child, i);
  6109. }
  6110. });
  6111. } else {
  6112. return this.walk(function (child, i) {
  6113. if (child.type === 'decl' && child.prop === prop) {
  6114. return callback(child, i);
  6115. }
  6116. });
  6117. }
  6118. };
  6119. /**
  6120. * Traverses the container’s descendant nodes, calling callback
  6121. * for each rule node.
  6122. *
  6123. * If you pass a filter, iteration will only happen over rules
  6124. * with matching selectors.
  6125. *
  6126. * Like {@link Container#each}, this method is safe
  6127. * to use if you are mutating arrays during iteration.
  6128. *
  6129. * @param {string|RegExp} [selector] - string or regular expression
  6130. * to filter rules by selector
  6131. * @param {childIterator} callback - iterator receives each node and index
  6132. *
  6133. * @return {false|undefined} returns `false` if iteration was broke
  6134. *
  6135. * @example
  6136. * const selectors = [];
  6137. * root.walkRules(rule => {
  6138. * selectors.push(rule.selector);
  6139. * });
  6140. * console.log(`Your CSS uses ${selectors.length} selectors`);
  6141. */
  6142. Container.prototype.walkRules = function walkRules(selector, callback) {
  6143. if (!callback) {
  6144. callback = selector;
  6145. return this.walk(function (child, i) {
  6146. if (child.type === 'rule') {
  6147. return callback(child, i);
  6148. }
  6149. });
  6150. } else if (selector instanceof RegExp) {
  6151. return this.walk(function (child, i) {
  6152. if (child.type === 'rule' && selector.test(child.selector)) {
  6153. return callback(child, i);
  6154. }
  6155. });
  6156. } else {
  6157. return this.walk(function (child, i) {
  6158. if (child.type === 'rule' && child.selector === selector) {
  6159. return callback(child, i);
  6160. }
  6161. });
  6162. }
  6163. };
  6164. /**
  6165. * Traverses the container’s descendant nodes, calling callback
  6166. * for each at-rule node.
  6167. *
  6168. * If you pass a filter, iteration will only happen over at-rules
  6169. * that have matching names.
  6170. *
  6171. * Like {@link Container#each}, this method is safe
  6172. * to use if you are mutating arrays during iteration.
  6173. *
  6174. * @param {string|RegExp} [name] - string or regular expression
  6175. * to filter at-rules by name
  6176. * @param {childIterator} callback - iterator receives each node and index
  6177. *
  6178. * @return {false|undefined} returns `false` if iteration was broke
  6179. *
  6180. * @example
  6181. * root.walkAtRules(rule => {
  6182. * if ( isOld(rule.name) ) rule.remove();
  6183. * });
  6184. *
  6185. * let first = false;
  6186. * root.walkAtRules('charset', rule => {
  6187. * if ( !first ) {
  6188. * first = true;
  6189. * } else {
  6190. * rule.remove();
  6191. * }
  6192. * });
  6193. */
  6194. Container.prototype.walkAtRules = function walkAtRules(name, callback) {
  6195. if (!callback) {
  6196. callback = name;
  6197. return this.walk(function (child, i) {
  6198. if (child.type === 'atrule') {
  6199. return callback(child, i);
  6200. }
  6201. });
  6202. } else if (name instanceof RegExp) {
  6203. return this.walk(function (child, i) {
  6204. if (child.type === 'atrule' && name.test(child.name)) {
  6205. return callback(child, i);
  6206. }
  6207. });
  6208. } else {
  6209. return this.walk(function (child, i) {
  6210. if (child.type === 'atrule' && child.name === name) {
  6211. return callback(child, i);
  6212. }
  6213. });
  6214. }
  6215. };
  6216. /**
  6217. * Traverses the container’s descendant nodes, calling callback
  6218. * for each comment node.
  6219. *
  6220. * Like {@link Container#each}, this method is safe
  6221. * to use if you are mutating arrays during iteration.
  6222. *
  6223. * @param {childIterator} callback - iterator receives each node and index
  6224. *
  6225. * @return {false|undefined} returns `false` if iteration was broke
  6226. *
  6227. * @example
  6228. * root.walkComments(comment => {
  6229. * comment.remove();
  6230. * });
  6231. */
  6232. Container.prototype.walkComments = function walkComments(callback) {
  6233. return this.walk(function (child, i) {
  6234. if (child.type === 'comment') {
  6235. return callback(child, i);
  6236. }
  6237. });
  6238. };
  6239. /**
  6240. * Inserts new nodes to the end of the container.
  6241. *
  6242. * @param {...(Node|object|string|Node[])} children - new nodes
  6243. *
  6244. * @return {Node} this node for methods chain
  6245. *
  6246. * @example
  6247. * const decl1 = postcss.decl({ prop: 'color', value: 'black' });
  6248. * const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
  6249. * rule.append(decl1, decl2);
  6250. *
  6251. * root.append({ name: 'charset', params: '"UTF-8"' }); // at-rule
  6252. * root.append({ selector: 'a' }); // rule
  6253. * rule.append({ prop: 'color', value: 'black' }); // declaration
  6254. * rule.append({ text: 'Comment' }) // comment
  6255. *
  6256. * root.append('a {}');
  6257. * root.first.append('color: black; z-index: 1');
  6258. */
  6259. Container.prototype.append = function append() {
  6260. for (var _len = arguments.length, children = Array(_len), _key = 0; _key < _len; _key++) {
  6261. children[_key] = arguments[_key];
  6262. }
  6263. for (var _iterator = children, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  6264. var _ref;
  6265. if (_isArray) {
  6266. if (_i >= _iterator.length) break;
  6267. _ref = _iterator[_i++];
  6268. } else {
  6269. _i = _iterator.next();
  6270. if (_i.done) break;
  6271. _ref = _i.value;
  6272. }
  6273. var child = _ref;
  6274. var nodes = this.normalize(child, this.last);
  6275. for (var _iterator2 = nodes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
  6276. var _ref2;
  6277. if (_isArray2) {
  6278. if (_i2 >= _iterator2.length) break;
  6279. _ref2 = _iterator2[_i2++];
  6280. } else {
  6281. _i2 = _iterator2.next();
  6282. if (_i2.done) break;
  6283. _ref2 = _i2.value;
  6284. }
  6285. var node = _ref2;
  6286. this.nodes.push(node);
  6287. }
  6288. }
  6289. return this;
  6290. };
  6291. /**
  6292. * Inserts new nodes to the start of the container.
  6293. *
  6294. * @param {...(Node|object|string|Node[])} children - new nodes
  6295. *
  6296. * @return {Node} this node for methods chain
  6297. *
  6298. * @example
  6299. * const decl1 = postcss.decl({ prop: 'color', value: 'black' });
  6300. * const decl2 = postcss.decl({ prop: 'background-color', value: 'white' });
  6301. * rule.prepend(decl1, decl2);
  6302. *
  6303. * root.append({ name: 'charset', params: '"UTF-8"' }); // at-rule
  6304. * root.append({ selector: 'a' }); // rule
  6305. * rule.append({ prop: 'color', value: 'black' }); // declaration
  6306. * rule.append({ text: 'Comment' }) // comment
  6307. *
  6308. * root.append('a {}');
  6309. * root.first.append('color: black; z-index: 1');
  6310. */
  6311. Container.prototype.prepend = function prepend() {
  6312. for (var _len2 = arguments.length, children = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  6313. children[_key2] = arguments[_key2];
  6314. }
  6315. children = children.reverse();
  6316. for (var _iterator3 = children, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
  6317. var _ref3;
  6318. if (_isArray3) {
  6319. if (_i3 >= _iterator3.length) break;
  6320. _ref3 = _iterator3[_i3++];
  6321. } else {
  6322. _i3 = _iterator3.next();
  6323. if (_i3.done) break;
  6324. _ref3 = _i3.value;
  6325. }
  6326. var child = _ref3;
  6327. var nodes = this.normalize(child, this.first, 'prepend').reverse();
  6328. for (var _iterator4 = nodes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
  6329. var _ref4;
  6330. if (_isArray4) {
  6331. if (_i4 >= _iterator4.length) break;
  6332. _ref4 = _iterator4[_i4++];
  6333. } else {
  6334. _i4 = _iterator4.next();
  6335. if (_i4.done) break;
  6336. _ref4 = _i4.value;
  6337. }
  6338. var node = _ref4;
  6339. this.nodes.unshift(node);
  6340. }for (var id in this.indexes) {
  6341. this.indexes[id] = this.indexes[id] + nodes.length;
  6342. }
  6343. }
  6344. return this;
  6345. };
  6346. Container.prototype.cleanRaws = function cleanRaws(keepBetween) {
  6347. _Node.prototype.cleanRaws.call(this, keepBetween);
  6348. if (this.nodes) {
  6349. for (var _iterator5 = this.nodes, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
  6350. var _ref5;
  6351. if (_isArray5) {
  6352. if (_i5 >= _iterator5.length) break;
  6353. _ref5 = _iterator5[_i5++];
  6354. } else {
  6355. _i5 = _iterator5.next();
  6356. if (_i5.done) break;
  6357. _ref5 = _i5.value;
  6358. }
  6359. var node = _ref5;
  6360. node.cleanRaws(keepBetween);
  6361. }
  6362. }
  6363. };
  6364. /**
  6365. * Insert new node before old node within the container.
  6366. *
  6367. * @param {Node|number} exist - child or child’s index.
  6368. * @param {Node|object|string|Node[]} add - new node
  6369. *
  6370. * @return {Node} this node for methods chain
  6371. *
  6372. * @example
  6373. * rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }));
  6374. */
  6375. Container.prototype.insertBefore = function insertBefore(exist, add) {
  6376. exist = this.index(exist);
  6377. var type = exist === 0 ? 'prepend' : false;
  6378. var nodes = this.normalize(add, this.nodes[exist], type).reverse();
  6379. for (var _iterator6 = nodes, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
  6380. var _ref6;
  6381. if (_isArray6) {
  6382. if (_i6 >= _iterator6.length) break;
  6383. _ref6 = _iterator6[_i6++];
  6384. } else {
  6385. _i6 = _iterator6.next();
  6386. if (_i6.done) break;
  6387. _ref6 = _i6.value;
  6388. }
  6389. var node = _ref6;
  6390. this.nodes.splice(exist, 0, node);
  6391. }var index = void 0;
  6392. for (var id in this.indexes) {
  6393. index = this.indexes[id];
  6394. if (exist <= index) {
  6395. this.indexes[id] = index + nodes.length;
  6396. }
  6397. }
  6398. return this;
  6399. };
  6400. /**
  6401. * Insert new node after old node within the container.
  6402. *
  6403. * @param {Node|number} exist - child or child’s index
  6404. * @param {Node|object|string|Node[]} add - new node
  6405. *
  6406. * @return {Node} this node for methods chain
  6407. */
  6408. Container.prototype.insertAfter = function insertAfter(exist, add) {
  6409. exist = this.index(exist);
  6410. var nodes = this.normalize(add, this.nodes[exist]).reverse();
  6411. for (var _iterator7 = nodes, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) {
  6412. var _ref7;
  6413. if (_isArray7) {
  6414. if (_i7 >= _iterator7.length) break;
  6415. _ref7 = _iterator7[_i7++];
  6416. } else {
  6417. _i7 = _iterator7.next();
  6418. if (_i7.done) break;
  6419. _ref7 = _i7.value;
  6420. }
  6421. var node = _ref7;
  6422. this.nodes.splice(exist + 1, 0, node);
  6423. }var index = void 0;
  6424. for (var id in this.indexes) {
  6425. index = this.indexes[id];
  6426. if (exist < index) {
  6427. this.indexes[id] = index + nodes.length;
  6428. }
  6429. }
  6430. return this;
  6431. };
  6432. Container.prototype.remove = function remove(child) {
  6433. if (typeof child !== 'undefined') {
  6434. (0, _warnOnce2.default)('Container#remove is deprecated. ' + 'Use Container#removeChild');
  6435. this.removeChild(child);
  6436. } else {
  6437. _Node.prototype.remove.call(this);
  6438. }
  6439. return this;
  6440. };
  6441. /**
  6442. * Removes node from the container and cleans the parent properties
  6443. * from the node and its children.
  6444. *
  6445. * @param {Node|number} child - child or child’s index
  6446. *
  6447. * @return {Node} this node for methods chain
  6448. *
  6449. * @example
  6450. * rule.nodes.length //=> 5
  6451. * rule.removeChild(decl);
  6452. * rule.nodes.length //=> 4
  6453. * decl.parent //=> undefined
  6454. */
  6455. Container.prototype.removeChild = function removeChild(child) {
  6456. child = this.index(child);
  6457. this.nodes[child].parent = undefined;
  6458. this.nodes.splice(child, 1);
  6459. var index = void 0;
  6460. for (var id in this.indexes) {
  6461. index = this.indexes[id];
  6462. if (index >= child) {
  6463. this.indexes[id] = index - 1;
  6464. }
  6465. }
  6466. return this;
  6467. };
  6468. /**
  6469. * Removes all children from the container
  6470. * and cleans their parent properties.
  6471. *
  6472. * @return {Node} this node for methods chain
  6473. *
  6474. * @example
  6475. * rule.removeAll();
  6476. * rule.nodes.length //=> 0
  6477. */
  6478. Container.prototype.removeAll = function removeAll() {
  6479. for (var _iterator8 = this.nodes, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) {
  6480. var _ref8;
  6481. if (_isArray8) {
  6482. if (_i8 >= _iterator8.length) break;
  6483. _ref8 = _iterator8[_i8++];
  6484. } else {
  6485. _i8 = _iterator8.next();
  6486. if (_i8.done) break;
  6487. _ref8 = _i8.value;
  6488. }
  6489. var node = _ref8;
  6490. node.parent = undefined;
  6491. }this.nodes = [];
  6492. return this;
  6493. };
  6494. /**
  6495. * Passes all declaration values within the container that match pattern
  6496. * through callback, replacing those values with the returned result
  6497. * of callback.
  6498. *
  6499. * This method is useful if you are using a custom unit or function
  6500. * and need to iterate through all values.
  6501. *
  6502. * @param {string|RegExp} pattern - replace pattern
  6503. * @param {object} opts - options to speed up the search
  6504. * @param {string|string[]} opts.props - an array of property names
  6505. * @param {string} opts.fast - string that’s used
  6506. * to narrow down values and speed up
  6507. the regexp search
  6508. * @param {function|string} callback - string to replace pattern
  6509. * or callback that returns a new
  6510. * value.
  6511. * The callback will receive
  6512. * the same arguments as those
  6513. * passed to a function parameter
  6514. * of `String#replace`.
  6515. *
  6516. * @return {Node} this node for methods chain
  6517. *
  6518. * @example
  6519. * root.replaceValues(/\d+rem/, { fast: 'rem' }, string => {
  6520. * return 15 * parseInt(string) + 'px';
  6521. * });
  6522. */
  6523. Container.prototype.replaceValues = function replaceValues(pattern, opts, callback) {
  6524. if (!callback) {
  6525. callback = opts;
  6526. opts = {};
  6527. }
  6528. this.walkDecls(function (decl) {
  6529. if (opts.props && opts.props.indexOf(decl.prop) === -1) return;
  6530. if (opts.fast && decl.value.indexOf(opts.fast) === -1) return;
  6531. decl.value = decl.value.replace(pattern, callback);
  6532. });
  6533. return this;
  6534. };
  6535. /**
  6536. * Returns `true` if callback returns `true`
  6537. * for all of the container’s children.
  6538. *
  6539. * @param {childCondition} condition - iterator returns true or false.
  6540. *
  6541. * @return {boolean} is every child pass condition
  6542. *
  6543. * @example
  6544. * const noPrefixes = rule.every(i => i.prop[0] !== '-');
  6545. */
  6546. Container.prototype.every = function every(condition) {
  6547. return this.nodes.every(condition);
  6548. };
  6549. /**
  6550. * Returns `true` if callback returns `true` for (at least) one
  6551. * of the container’s children.
  6552. *
  6553. * @param {childCondition} condition - iterator returns true or false.
  6554. *
  6555. * @return {boolean} is some child pass condition
  6556. *
  6557. * @example
  6558. * const hasPrefix = rule.some(i => i.prop[0] === '-');
  6559. */
  6560. Container.prototype.some = function some(condition) {
  6561. return this.nodes.some(condition);
  6562. };
  6563. /**
  6564. * Returns a `child`’s index within the {@link Container#nodes} array.
  6565. *
  6566. * @param {Node} child - child of the current container.
  6567. *
  6568. * @return {number} child index
  6569. *
  6570. * @example
  6571. * rule.index( rule.nodes[2] ) //=> 2
  6572. */
  6573. Container.prototype.index = function index(child) {
  6574. if (typeof child === 'number') {
  6575. return child;
  6576. } else {
  6577. return this.nodes.indexOf(child);
  6578. }
  6579. };
  6580. /**
  6581. * The container’s first child.
  6582. *
  6583. * @type {Node}
  6584. *
  6585. * @example
  6586. * rule.first == rules.nodes[0];
  6587. */
  6588. Container.prototype.normalize = function normalize(nodes, sample) {
  6589. var _this2 = this;
  6590. if (typeof nodes === 'string') {
  6591. var parse = __webpack_require__(78);
  6592. nodes = cleanSource(parse(nodes).nodes);
  6593. } else if (!Array.isArray(nodes)) {
  6594. if (nodes.type === 'root') {
  6595. nodes = nodes.nodes;
  6596. } else if (nodes.type) {
  6597. nodes = [nodes];
  6598. } else if (nodes.prop) {
  6599. if (typeof nodes.value === 'undefined') {
  6600. throw new Error('Value field is missed in node creation');
  6601. } else if (typeof nodes.value !== 'string') {
  6602. nodes.value = String(nodes.value);
  6603. }
  6604. nodes = [new _declaration2.default(nodes)];
  6605. } else if (nodes.selector) {
  6606. var Rule = __webpack_require__(10);
  6607. nodes = [new Rule(nodes)];
  6608. } else if (nodes.name) {
  6609. var AtRule = __webpack_require__(23);
  6610. nodes = [new AtRule(nodes)];
  6611. } else if (nodes.text) {
  6612. nodes = [new _comment2.default(nodes)];
  6613. } else {
  6614. throw new Error('Unknown node type in node creation');
  6615. }
  6616. }
  6617. var processed = nodes.map(function (i) {
  6618. if (typeof i.raws === 'undefined') i = _this2.rebuild(i);
  6619. if (i.parent) i = i.clone();
  6620. if (typeof i.raws.before === 'undefined') {
  6621. if (sample && typeof sample.raws.before !== 'undefined') {
  6622. i.raws.before = sample.raws.before.replace(/[^\s]/g, '');
  6623. }
  6624. }
  6625. i.parent = _this2;
  6626. return i;
  6627. });
  6628. return processed;
  6629. };
  6630. Container.prototype.rebuild = function rebuild(node, parent) {
  6631. var _this3 = this;
  6632. var fix = void 0;
  6633. if (node.type === 'root') {
  6634. var Root = __webpack_require__(28);
  6635. fix = new Root();
  6636. } else if (node.type === 'atrule') {
  6637. var AtRule = __webpack_require__(23);
  6638. fix = new AtRule();
  6639. } else if (node.type === 'rule') {
  6640. var Rule = __webpack_require__(10);
  6641. fix = new Rule();
  6642. } else if (node.type === 'decl') {
  6643. fix = new _declaration2.default();
  6644. } else if (node.type === 'comment') {
  6645. fix = new _comment2.default();
  6646. }
  6647. for (var i in node) {
  6648. if (i === 'nodes') {
  6649. fix.nodes = node.nodes.map(function (j) {
  6650. return _this3.rebuild(j, fix);
  6651. });
  6652. } else if (i === 'parent' && parent) {
  6653. fix.parent = parent;
  6654. } else if (node.hasOwnProperty(i)) {
  6655. fix[i] = node[i];
  6656. }
  6657. }
  6658. return fix;
  6659. };
  6660. Container.prototype.eachInside = function eachInside(callback) {
  6661. (0, _warnOnce2.default)('Container#eachInside is deprecated. ' + 'Use Container#walk instead.');
  6662. return this.walk(callback);
  6663. };
  6664. Container.prototype.eachDecl = function eachDecl(prop, callback) {
  6665. (0, _warnOnce2.default)('Container#eachDecl is deprecated. ' + 'Use Container#walkDecls instead.');
  6666. return this.walkDecls(prop, callback);
  6667. };
  6668. Container.prototype.eachRule = function eachRule(selector, callback) {
  6669. (0, _warnOnce2.default)('Container#eachRule is deprecated. ' + 'Use Container#walkRules instead.');
  6670. return this.walkRules(selector, callback);
  6671. };
  6672. Container.prototype.eachAtRule = function eachAtRule(name, callback) {
  6673. (0, _warnOnce2.default)('Container#eachAtRule is deprecated. ' + 'Use Container#walkAtRules instead.');
  6674. return this.walkAtRules(name, callback);
  6675. };
  6676. Container.prototype.eachComment = function eachComment(callback) {
  6677. (0, _warnOnce2.default)('Container#eachComment is deprecated. ' + 'Use Container#walkComments instead.');
  6678. return this.walkComments(callback);
  6679. };
  6680. _createClass(Container, [{
  6681. key: 'first',
  6682. get: function get() {
  6683. if (!this.nodes) return undefined;
  6684. return this.nodes[0];
  6685. }
  6686. /**
  6687. * The container’s last child.
  6688. *
  6689. * @type {Node}
  6690. *
  6691. * @example
  6692. * rule.last == rule.nodes[rule.nodes.length - 1];
  6693. */
  6694. }, {
  6695. key: 'last',
  6696. get: function get() {
  6697. if (!this.nodes) return undefined;
  6698. return this.nodes[this.nodes.length - 1];
  6699. }
  6700. }, {
  6701. key: 'semicolon',
  6702. get: function get() {
  6703. (0, _warnOnce2.default)('Node#semicolon is deprecated. Use Node#raws.semicolon');
  6704. return this.raws.semicolon;
  6705. },
  6706. set: function set(val) {
  6707. (0, _warnOnce2.default)('Node#semicolon is deprecated. Use Node#raws.semicolon');
  6708. this.raws.semicolon = val;
  6709. }
  6710. }, {
  6711. key: 'after',
  6712. get: function get() {
  6713. (0, _warnOnce2.default)('Node#after is deprecated. Use Node#raws.after');
  6714. return this.raws.after;
  6715. },
  6716. set: function set(val) {
  6717. (0, _warnOnce2.default)('Node#after is deprecated. Use Node#raws.after');
  6718. this.raws.after = val;
  6719. }
  6720. /**
  6721. * @memberof Container#
  6722. * @member {Node[]} nodes - an array containing the container’s children
  6723. *
  6724. * @example
  6725. * const root = postcss.parse('a { color: black }');
  6726. * root.nodes.length //=> 1
  6727. * root.nodes[0].selector //=> 'a'
  6728. * root.nodes[0].nodes[0].prop //=> 'color'
  6729. */
  6730. }]);
  6731. return Container;
  6732. }(_node2.default);
  6733. exports.default = Container;
  6734. /**
  6735. * @callback childCondition
  6736. * @param {Node} node - container child
  6737. * @param {number} index - child index
  6738. * @param {Node[]} nodes - all container children
  6739. * @return {boolean}
  6740. */
  6741. /**
  6742. * @callback childIterator
  6743. * @param {Node} node - container child
  6744. * @param {number} index - child index
  6745. * @return {false|undefined} returning `false` will break iteration
  6746. */
  6747. module.exports = exports['default'];
  6748. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbnRhaW5lci5lczYiXSwibmFtZXMiOlsiY2xlYW5Tb3VyY2UiLCJub2RlcyIsIm1hcCIsImkiLCJzb3VyY2UiLCJDb250YWluZXIiLCJwdXNoIiwiY2hpbGQiLCJwYXJlbnQiLCJlYWNoIiwiY2FsbGJhY2siLCJsYXN0RWFjaCIsImluZGV4ZXMiLCJpZCIsInVuZGVmaW5lZCIsImluZGV4IiwicmVzdWx0IiwibGVuZ3RoIiwid2FsayIsIndhbGtEZWNscyIsInByb3AiLCJ0eXBlIiwiUmVnRXhwIiwidGVzdCIsIndhbGtSdWxlcyIsInNlbGVjdG9yIiwid2Fsa0F0UnVsZXMiLCJuYW1lIiwid2Fsa0Nv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PT4ge1xuICAgICAqICAgZGVjbC52YWx1ZSA9IHRha2VGaXJzdENvbG9yRnJvbUdyYWRpZW50KGRlY2wudmFsdWUpO1xuICAgICAqIH0pO1xuICAgICAqL1xuICAgIHdhbGtEZWNscyhwcm9wLCBjYWxsYmFjaykge1xuICAgICAgICBpZiAoICFjYWxsYmFjayApIHtcbiAgICAgICAgICAgIGNhbGxiYWNrID0gcHJvcDtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLndhbGsoIChjaGlsZCwgaSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICggY2hpbGQudHlwZSA9PT0gJ2RlY2wnICkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2FsbGJhY2soY2hpbGQsIGkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2UgaWYgKCBwcm9wIGluc3RhbmNlb2YgUmVnRXhwICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMud2FsayggKGNoaWxkLCBpKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCBjaGlsZC50eXBlID09PSAnZGVjbCcgJiYgcHJvcC50ZXN0KGNoaWxkLnByb3ApICkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2FsbGJhY2soY2hpbGQsIGkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMud2FsayggKGNoaWxkLCBpKSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCBjaGlsZC50eXBlID09PSAnZGVjbCcgJiYgY2hpbGQucHJvcCA9PT0gcHJvcCApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGNoaWxkLCBpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRyYXZlc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ndGh9IHNlbGVjdG9yc2ApO1xuICAgICAqL1xuICAgIHdhbGtSdWxlcyhzZWxlY3RvciwgY2FsbGJhY2spIHtcbiAgICAgICAgaWYgKCAhY2FsbGJhY2sgKSB7XG4gICAgICAgICAgICBjYWxsYmFjayA9IHNlbGVjdG9yO1xuXG4gICAgICAgICAgICByZXR1cm4gdGhpcy53YWxrKCAoY2hpbGQsIGkpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIGNoaWxkLnR5cGUgPT09ICdydWxlJyApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGNoaWxkLCBpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIGlmICggc2VsZWN0b3IgaW5zdGFuY2VvZiBSZWdFeHAgKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy53YWxrKCAoY2hpbGQsIGkpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIGNoaWxkLnR5cGUgPT09ICdydWxlJyAmJiBzZWxlY3Rvci50ZXN0KGNoaWxkLnNlbGVjdG9yKSApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGNoaWxkLCBpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLndhbGsoIChjaGlsZCwgaSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICggY2hpbGQudHlwZSA9PT0gJ3J1bGUnICYmIGNoaWxkLnNlbGVjdG9yID09PSBzZWxlY3RvciApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGNoaWxkLCBpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRyYXZlcnNlcyB0aGUgY29udGFpbmVy4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ICBpZiAoICFmaXJzdCApIHtcbiAgICAgKiAgICAgZmlyc3QgPSB0cnVlO1xuICAgICAqICAgfSBlbHNlIHtcbiAgICAgKiAgICAgcnVsZS5yZW1vdmUoKTtcbiAgICAgKiAgIH1cbiAgICAgKiB9KTtcbiAgICAgKi9cbiAgICB3YWxrQXRSdWxlcyhuYW1lLCBjYWxsYmFjaykge1xuICAgICAgICBpZiAoICFjYWxsYmFjayApIHtcbiAgICAgICAgICAgIGNhbGxiYWNrID0gbmFtZTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLndhbGsoIChjaGlsZCwgaSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICggY2hpbGQudHlwZSA9PT0gJ2F0cnVsZScgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayhjaGlsZCwgaSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSBpZiAoIG5hbWUgaW5zdGFuY2VvZiBSZWdFeHAgKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy53YWxrKCAoY2hpbGQsIGkpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIGNoaWxkLnR5cGUgPT09ICdhdHJ1bGUnICYmIG5hbWUudGVzdChjaGlsZC5uYW1lKSApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGNoaWxkLCBpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLndhbGsoIChjaGlsZCwgaSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICggY2hpbGQudHlwZSA9PT0gJ2F0cnVsZScgJiYgY2hpbGQubmFtZSA9PT0gbmFtZSApIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKGNoaWxkLCBpKTtcbiAgICAgICAgICAgICAgICB9XG4gICA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BjdXN0b20gdW5pdCBvciBmdW5jdGlvblxuICAgICAqIGFuZCBuZWVkIHRvIGl0ZXJhdGUgdGhyb3VnaCBhbGwgdmFsdWVzLlxuICAgICAqXG4gICAgICogQHBhcmFtIHtzdHJpbmd8UmVnRXhwfSBwYXR0ZXJuICAgICAgLSByZXBsYWNlIHBhdHRlcm5cbiAgICAgKiBAcGFyYW0ge29iamVjdH0gb3B0cyAgICAgICAgICAgICAgICAtIG9wdGlvbnMgdG8gc3BlZWQgdXAgdGhlIHNlYXJjaFxuICAgICAqIEBwYXJhbSB7c3RyaW5nfHN0cmluZ1tdfSBvcHRzLnByb3BzIC0gYW4gYXJyYXkgb2YgcHJvcGVydHkgbmFtZXNcbiAgICAgKiBAcGFyYW0ge3N0cmluZ30gb3B0cy5mYXN0ICAgICAgICAgICAtIHN0cmluZyB0aGF04oCZcyB1c2VkXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byBuYXJyb3cgZG93biB2YWx1ZXMgYW5kIHNwZWVkIHVwXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgcmVnZXhwIHNlYXJjaFxuICAgICAqIEBwYXJhbSB7ZnVuY3Rpb258c3RyaW5nfSBjYWxsYmFjayAgIC0gc3RyaW5nIHRvIHJlcGxhY2UgcGF0dGVyblxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3IgY2FsbGJhY2sgdGhhdCByZXR1cm5zIGEgbmV3XG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZS5cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSBjYWxsYmFjayB3aWxsIHJlY2VpdmVcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBzYW1lIGFyZ3VtZW50cyBhcyB0aG9zZVxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFzc2VkIHRvIGEgZnVuY3Rpb24gcGFyYW1ldGVyXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZiBgU3RyaW5nI3JlcGxhY2VgLlxuICAgICAqXG4gICAgICogQHJldHVybiB7Tm9kZX0gdGhpcyBub2RlIGZvciBtZXRob2RzIGNoYWluXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHJvb3QucmVwbGFjZVZhbHVlcygvXFxkK3JlbS8sIHsgZmFzdDogJ3JlbScgfSwgc3RyaW5nID0+IHtcbiAgICAgKiAgIHJldHVybiAxNSAqIHBhcnNlSW50KHN0cmluZykgKyAncHgnO1xuICAgICAqIH0pO1xuICAgICAqL1xuICAgIHJlcGxhY2VWYWx1ZXMocGF0dGVybiwgb3B0cywgY2FsbGJhY2spIHtcbiAgICAgICAgaWYgKCAhY2FsbGJhY2sgKSB7XG4gICAgICAgICAgICBjYWxsYmFjayA9IG9wdHM7XG4gICAgICAgICAgICBvcHRzID0geyB9O1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy53YWxrRGVjbHMoIGRlY2wgPT4ge1xuICAgICAgICAgICAgaWYgKCBvcHRzLnByb3BzICYmIG9wdHMucHJvcHMuaW5kZXhPZihkZWNsLnByb3ApID09PSAtMSApIHJldHVybjtcbiAgICAgICAgICAgIGlmICggb3B0cy5mYXN0ICAmJiBkZWNsLnZhbHVlLmluZGV4T2Yob3B0cy5mYXN0KSA9PT0gLTEgKSByZXR1cm47XG5cbiAgICAgICAgICAgIGRlY2wudmFsdWUgPSBkZWNsLnZhbHVlLnJlcGxhY2UocGF0dGVybiwgY2FsbGJhY2spO1xuICAgICAgICB9KTtcblxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBSZXR1cm5zIGB0cnVlYCBpZiBjYWxsYmFjayByZXR1cm5zIGB0cnVlYFxuICAg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AqL1xuICAgIGdldCBsYXN0KCkge1xuICAgICAgICBpZiAoICF0aGlzLm5vZGVzICkgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgcmV0dXJuIHRoaXMubm9kZXNbdGhpcy5ub2Rlcy5sZW5ndGggLSAxXTtcbiAgICB9XG5cbiAgICBub3JtYWxpemUobm9kZXMsIHNhbXBsZSkge1xuICAgICAgICBpZiAoIHR5cGVvZiBub2RlcyA9PT0gJ3N0cmluZycgKSB7XG4gICAgICAgICAgICBsZXQgcGFyc2UgPSByZXF1aXJlKCcuL3BhcnNlJyk7XG4gICAgICAgICAgICBub2RlcyA9IGNsZWFuU291cmNlKHBhcnNlKG5vZGVzKS5ub2Rlcyk7XG4gICAgICAgIH0gZWxzZSBpZiAoICFBcnJheS5pc0FycmF5KG5vZGVzKSApIHtcbiAgICAgICAgICAgIGlmICggbm9kZXMudHlwZSA9PT0gJ3Jvb3QnICkge1xuICAgICAgICAgICAgICAgIG5vZGVzID0gbm9kZXMubm9kZXM7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBub2Rlcy50eXBlICkge1xuICAgICAgICAgICAgICAgIG5vZGVzID0gW25vZGVzXTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIG5vZGVzLnByb3AgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCB0eXBlb2Ygbm9kZXMudmFsdWUgPT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1ZhbHVlIGZpZWxkIGlzIG1pc3NlZCBpbiBub2RlIGNyZWF0aW9uJyk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICggdHlwZW9mIG5vZGVzLnZhbHVlICE9PSAnc3RyaW5nJyApIHtcbiAgICAgICAgICAgICAgICAgICAgbm9kZXMudmFsdWUgPSBTdHJpbmcobm9kZXMudmFsdWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBub2RlcyA9IFtuZXcgRGVjbGFyYXRpb24obm9kZXMpXTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIG5vZGVzLnNlbGVjdG9yICkge1xuICAgICAgICAgICAgICAgIGxldCBSdWxlID0gcmVxdWlyZSgnLi9ydWxlJyk7XG4gICAgICAgICAgICAgICAgbm9kZXMgPSBbbmV3IFJ1bGUobm9kZXMpXTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIG5vZGVzLm5hbWUgKSB7XG4gICAgICAgICAgICAgICAgbGV0IEF0UnVsZSA9IHJlcXVpcmUoJy4vYXQtcnVsZScpO1xuICAgICAgICAgICAgICAgIG5vZGVzID0gW25ldyBBdFJ1bGUobm9kZXMpXTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIG5vZGVzLnRleHQgKSB7XG4gICAgICAgICAgICAgICAgbm9kZXMgPSBbbmV3IENvbW1lbnQobm9kZXMpXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdVbmtub3duIG5vZGUgdHlwZSBpbiBub2RlIGNyZWF0aW9uJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgcHJvY2Vzc2VkID0gbm9kZXMubWFwKCBpID0+IHtcbiAgICAgICAgICAgIGlmICggdHlwZW9mIGkucmF3cyA9PT0gJ3VuZGVmaW5lZCcgKSBpID0gdGhpcy5yZWJ1aWxkKGkpO1xuXG4gICAgICAgICAgICBpZiAoIGkucGFyZW50ICkgaSA9IGkuY2xvbmUoKTtcbiAgICAgICAgICAgIGlmICggdHlwZW9mIGkucmF3cy5iZWZvcmUgPT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgIGlmICggc2FtcGxlICYmIHR5cGVvZiBzYW1wbGUucmF3cy5iZWZvcmUgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgICAgICBpLnJhd3MuYmVmb3JlID0gc2FtcGxlLnJhd3MuYmVmb3JlLnJlcGxhY2UoL1teXFxzXS9nLCAnJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaS5wYXJlbnQgPSB0aGlzO1xuICAgICAgICAgICAgcmV0dXJuIGk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiBwcm9jZXNzZWQ7XG4gICAgfVxuXG4gICAgcmVidWlsZChub2RlLCBwYXJlbnQpIHtcbiAgICAgICAgbGV0IGZpeDtcbiAgICAgICAgaWYgKCBub2RlLnR5cGUgPT09ICdyb290JyApIHtcbiAgICAgICAgICAgIGxldCBSb290ID0gcmVxdWlyZSgnLi9yb290Jyk7XG4gICAgICAgICAgICBmaXggPSBuZXcgUm9vdCgpO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2RlLnR5cGUgPT09ICdhdHJ1bGUnICkge1xuICAgICAgICAgICAgbGV0IEF0UnVsZSA9IHJlcXVpcmUoJy4vYXQtcnVsZScpO1xuICAgICAgICAgICAgZml4ID0gbmV3IEF0UnVsZSgpO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2RlLnR5cGUgPT09ICdydWxlJyApIHtcbiAgICAgICAgICAgIGxldCBSdWxlID0gcmVxdWlyZSgnLi9ydWxlJyk7XG4gICAgICAgICAgICBmaXggPSBuZXcgUnVsZSgpO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2RlLnR5cGUgPT09ICdkZWNsJyApIHtcbiAgICAgICAgICAgIGZpeCA9IG5ldyBEZWNsYXJhdGlvbigpO1xuICAgICAgICB9IGVsc2UgaWYgKCBub2RlLnR5cGUgPT09ICdjb21tZW50JyApIHtcbiAgICAgICAgICAgIGZpeCA9IG5ldyBDb21tZW50KCk7XG4gICAgICAgIH1cblxuICAgICAgICBmb3IgKCBsZXQgaSBpbiBub2RlICkge1xuICAgICAgICAgICAgaWYgKCBpID09PSAnbm9kZXMnICkge1xuICAgICAgICAgICAgICAgIGZpeC5ub2RlcyA9IG5vZGUubm9kZXMubWFwKCBqID0+IHRoaXMucmVidWlsZChqLCBmaXgpICk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBpID09PSAncGFyZW50JyAmJiBwYXJlbnQgKSB7XG4gICAgICAgICAgICAgICAgZml4LnBhcmVudCA9IHBhcmVudDtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIG5vZGUuaGFzT3duUHJvcGVydHkoaSkgKSB7XG4gICAgICAgICAgICAgICAgZml4W2ldID0gbm9kZVtpXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBmaXg7XG4gICAgfVxuXG4gICAgZWFjaEluc2lkZShjYWxsYmFjaykge1xuICAgICAgICB3YXJuT25jZSgnQ29udGFpbmVyI2VhY2hJbnNpZGUgaXMgZGVwcmVjYXRlZC4gJyArXG4gICAgICAgICAgICAgICAgICdVc2UgQ29udGFpbmVyI3dhbGsgaW5zdGVhZC4nKTtcbiAgICAgICAgcmV0dXJuIHRoaXMud2FsayhjYWxsYmFjayk7XG4gICAgfVxuXG4gICAgZWFjaERlY2wocHJvcCwgY2FsbGJhY2spIHtcbiAgICAgICAgd2Fybk9uY2UoJ0NvbnRhaW5lciNlYWNoRGVjbCBpcyBkZXByZWNhdGVkLiAnICtcbiAgICAgICAgICAgICAgICAgJ1VzZSBDb250YWluZXIjd2Fsa0RlY2xzIGluc3RlYWQuJyk7XG4gICAgICAgIHJldHVybiB0aGlzLndhbGtEZWNscyhwcm9wLCBjYWxsYmFjayk7XG4gICAgfVxuXG4gICAgZWFjaFJ1bGUoc2VsZWN0b3IsIGNhbGxiYWNrKSB7XG4gICAgICAgIHdhcm5PbmNlKCdDb250YWluZXIjZWFjaFJ1bGUgaXMgZGVwcmVjYXRlZC4gJyArXG4gICAgICAgICAgICAgICAgICdVc2UgQ29udGFpbmVyI3dhbGtSdWxlcyBpbnN0ZWFkLicpO1xuICAgICAgICByZXR1cm4gdGhpcy53YWxrUnVsZXMoc2VsZWN0b3IsIGNh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FtIHtudW1iZXJ9IGluZGV4IC0gY2hpbGQgaW5kZXhcbiAqIEByZXR1cm4ge2ZhbHNlfHVuZGVmaW5lZH0gcmV0dXJuaW5nIGBmYWxzZWAgd2lsbCBicmVhayBpdGVyYXRpb25cbiAqL1xuIl19
  6749. /***/ }),
  6750. /* 26 */
  6751. /***/ (function(module, exports, __webpack_require__) {
  6752. "use strict";
  6753. exports.__esModule = true;
  6754. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6755. var _cssSyntaxError = __webpack_require__(75);
  6756. var _cssSyntaxError2 = _interopRequireDefault(_cssSyntaxError);
  6757. var _previousMap = __webpack_require__(156);
  6758. var _previousMap2 = _interopRequireDefault(_previousMap);
  6759. var _path = __webpack_require__(5);
  6760. var _path2 = _interopRequireDefault(_path);
  6761. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  6762. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6763. var sequence = 0;
  6764. /**
  6765. * Represents the source CSS.
  6766. *
  6767. * @example
  6768. * const root = postcss.parse(css, { from: file });
  6769. * const input = root.source.input;
  6770. */
  6771. var Input = function () {
  6772. /**
  6773. * @param {string} css - input CSS source
  6774. * @param {object} [opts] - {@link Processor#process} options
  6775. */
  6776. function Input(css) {
  6777. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6778. _classCallCheck(this, Input);
  6779. /**
  6780. * @member {string} - input CSS source
  6781. *
  6782. * @example
  6783. * const input = postcss.parse('a{}', { from: file }).input;
  6784. * input.css //=> "a{}";
  6785. */
  6786. this.css = css.toString();
  6787. if (this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE') {
  6788. this.css = this.css.slice(1);
  6789. }
  6790. if (opts.from) {
  6791. if (/^\w+:\/\//.test(opts.from)) {
  6792. /**
  6793. * @member {string} - The absolute path to the CSS source file
  6794. * defined with the `from` option.
  6795. *
  6796. * @example
  6797. * const root = postcss.parse(css, { from: 'a.css' });
  6798. * root.source.input.file //=> '/home/ai/a.css'
  6799. */
  6800. this.file = opts.from;
  6801. } else {
  6802. this.file = _path2.default.resolve(opts.from);
  6803. }
  6804. }
  6805. var map = new _previousMap2.default(this.css, opts);
  6806. if (map.text) {
  6807. /**
  6808. * @member {PreviousMap} - The input source map passed from
  6809. * a compilation step before PostCSS
  6810. * (for example, from Sass compiler).
  6811. *
  6812. * @example
  6813. * root.source.input.map.consumer().sources //=> ['a.sass']
  6814. */
  6815. this.map = map;
  6816. var file = map.consumer().file;
  6817. if (!this.file && file) this.file = this.mapResolve(file);
  6818. }
  6819. if (!this.file) {
  6820. sequence += 1;
  6821. /**
  6822. * @member {string} - The unique ID of the CSS source. It will be
  6823. * created if `from` option is not provided
  6824. * (because PostCSS does not know the file path).
  6825. *
  6826. * @example
  6827. * const root = postcss.parse(css);
  6828. * root.source.input.file //=> undefined
  6829. * root.source.input.id //=> "<input css 1>"
  6830. */
  6831. this.id = '<input css ' + sequence + '>';
  6832. }
  6833. if (this.map) this.map.file = this.from;
  6834. }
  6835. Input.prototype.error = function error(message, line, column) {
  6836. var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  6837. var result = void 0;
  6838. var origin = this.origin(line, column);
  6839. if (origin) {
  6840. result = new _cssSyntaxError2.default(message, origin.line, origin.column, origin.source, origin.file, opts.plugin);
  6841. } else {
  6842. result = new _cssSyntaxError2.default(message, line, column, this.css, this.file, opts.plugin);
  6843. }
  6844. result.input = { line: line, column: column, source: this.css };
  6845. if (this.file) result.input.file = this.file;
  6846. return result;
  6847. };
  6848. /**
  6849. * Reads the input source map and returns a symbol position
  6850. * in the input source (e.g., in a Sass file that was compiled
  6851. * to CSS before being passed to PostCSS).
  6852. *
  6853. * @param {number} line - line in input CSS
  6854. * @param {number} column - column in input CSS
  6855. *
  6856. * @return {filePosition} position in input source
  6857. *
  6858. * @example
  6859. * root.source.input.origin(1, 1) //=> { file: 'a.css', line: 3, column: 1 }
  6860. */
  6861. Input.prototype.origin = function origin(line, column) {
  6862. if (!this.map) return false;
  6863. var consumer = this.map.consumer();
  6864. var from = consumer.originalPositionFor({ line: line, column: column });
  6865. if (!from.source) return false;
  6866. var result = {
  6867. file: this.mapResolve(from.source),
  6868. line: from.line,
  6869. column: from.column
  6870. };
  6871. var source = consumer.sourceContentFor(from.source);
  6872. if (source) result.source = source;
  6873. return result;
  6874. };
  6875. Input.prototype.mapResolve = function mapResolve(file) {
  6876. if (/^\w+:\/\//.test(file)) {
  6877. return file;
  6878. } else {
  6879. return _path2.default.resolve(this.map.consumer().sourceRoot || '.', file);
  6880. }
  6881. };
  6882. /**
  6883. * The CSS source identifier. Contains {@link Input#file} if the user
  6884. * set the `from` option, or {@link Input#id} if they did not.
  6885. * @type {string}
  6886. *
  6887. * @example
  6888. * const root = postcss.parse(css, { from: 'a.css' });
  6889. * root.source.input.from //=> "/home/ai/a.css"
  6890. *
  6891. * const root = postcss.parse(css);
  6892. * root.source.input.from //=> "<input css 1>"
  6893. */
  6894. _createClass(Input, [{
  6895. key: 'from',
  6896. get: function get() {
  6897. return this.file || this.id;
  6898. }
  6899. }]);
  6900. return Input;
  6901. }();
  6902. exports.default = Input;
  6903. /**
  6904. * @typedef {object} filePosition
  6905. * @property {string} file - path to file
  6906. * @property {number} line - source line in file
  6907. * @property {number} column - source column in file
  6908. */
  6909. module.exports = exports['default'];
  6910. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImlucHV0LmVzNiJdLCJuYW1lcyI6WyJzZXF1ZW5jZSIsIklucHV0IiwiY3NzIiwib3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1lbWJlciB7c3RyaW5nfSAtIGlucHV0IENTUyBzb3VyY2VcbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogY29uc3QgaW5wdXQgPSBwb3N0Y3NzLnBhcnNlKCdhe30nLCB7IGZyb206IGZpbGUgfSkuaW5wdXQ7XG4gICAgICAgICAqIGlucHV0LmNzcyAvLz0+IFwiYXt9XCI7XG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLmNzcyA9IGNzcy50b1N0cmluZygpO1xuXG4gICAgICAgIGlmICggdGhpcy5jc3NbMF0gPT09ICdcXHVGRUZGJyB8fCB0aGlzLmNzc1swXSA9PT0gJ1xcdUZGRkUnICkge1xuICAgICAgICAgICAgdGhpcy5jc3MgPSB0aGlzLmNzcy5zbGljZSgxKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICggb3B0cy5mcm9tICkge1xuICAgICAgICAgICAgaWYgKCAvXlxcdys6XFwvXFwvLy50ZXN0KG9wdHMuZnJvbSkgKSB7XG4gICAgICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgICAgICogQG1lbWJlciB7c3RyaW5nfSAtIFRoZSBhYnNvbHV0ZSBwYXRoIHRvIHRoZSBDU1Mgc291cmNlIGZpbGVcbiAgICAgICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgZGVmaW5lZCB3aXRoIHRoZSBgZnJvbWAgb3B0aW9uLlxuICAgICAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICAgICAgICAgKiBjb25zdCByb290ID0gcG9zdGNzcy5wYXJzZShjc3MsIHsgZnJvbTogJ2EuY3NzJyB9KTtcbiAgICAgICAgICAgICAgICAgKiByb290LnNvdXJjZS5pbnB1dC5maWxlIC8vPT4gJy9ob21lL2FpL2EuY3NzJ1xuICAgICAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgICAgIHRoaXMuZmlsZSA9IG9wdHMuZnJvbTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5maWxlID0gcGF0aC5yZXNvbHZlKG9wdHMuZnJvbSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgbWFwID0gbmV3IFByZXZpb3VzTWFwKHRoaXMuY3NzLCBvcHRzKTtcbiAgICAgICAgaWYgKCBtYXAudGV4dCApIHtcbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQG1lbWJlciB7UHJldmlvdXNNYXB9IC0gVGhlIGlucHV0IHNvdXJjZSBtYXAgcGFzc2VkIGZyb21cbiAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIGEgY29tcGlsYXRpb24gc3RlcCBiZWZvcmUgUG9zdENTU1xuICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgKGZvciBleGFtcGxlLCBmcm9tIFNhc3MgY29tcGlsZXIpLlxuICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAqIEBleGFtcGxlXG4gICAgICAgICAgICAgKiByb290LnNvdXJjZS5pbnB1dC5tYXAuY29uc3VtZXIoKS5zb3VyY2VzIC8vPT4gWydhLnNhc3MnXVxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICB0aGlzLm1hcCA9IG1hcDtcbiAgICAgICAgICAgIGxldCBmaWxlID0gbWFwLmNvbnN1bWVyKCkuZmlsZTtcbiAgICAgICAgICAgIGlmICggIXRoaXMuZmlsZSAmJiBmaWxlICkgdGhpcy5maWxlID0gdGhpcy5tYXBSZXNvbHZlKGZpbGUpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCAhdGhpcy5maWxlICkge1xuICAgICAgICAgICAgc2VxdWVuY2UgKz0gMTtcbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQG1lbWJlciB7c3RyaW5nfSAtIFRoZSB1bmlxdWUgSUQgb2YgdGhlIENTUyBzb3VyY2UuIEl0IHdpbGwgYmVcbiAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICBjcmVhdGVkIGlmIGBmcm9tYCBvcHRpb24gaXMgbm90IHByb3ZpZGVkXG4gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgKGJlY2F1c2UgUG9zdENTUyBkb2VzIG5vdCBrbm93IHRoZSBmaWxlIHBhdGgpLlxuICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAqIEBleGFtcGxlXG4gICAgICAgICAgICAgKiBjb25zdCByb290ID0gcG9zdGNzcy5wYXJzZShjc3MpO1xuICAgICAgICAgICAgICogcm9vdC5zb3VyY2UuaW5wdXQuZmlsZSAvLz0+IHVuZGVmaW5lZFxuICAgICAgICAgICAgICogcm9vdC5zb3VyY2UuaW5wdXQuaWQgICAvLz0+IFwiPGlucHV0IGNzcyAxPlwiXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIHRoaXMuaWQgICA9ICc8aW5wdXQgY3NzICcgKyBzZXF1ZW5jZSArICc+JztcbiAgICAgICAgfVxuICAgICAgICBpZiAoIHRoaXMubWFwICkgdGhpcy5tYXAuZmlsZSA9IHRoaXMuZnJvbTtcbiAgICB9XG5cbiAgICBlcnJvcihtZXNzYWdlLCBsaW5lLCBjb2x1bW4sIG9wdHMgPSB7IH0pIHtcbiAgICAgICAgbGV0IHJlc3VsdDtcbiAgICAgICAgbGV0IG9yaWdpbiA9IHRoaXMub3JpZ2luKGxpbmUsIGNvbHVtbik7XG4gICAgICAgIGlmICggb3JpZ2luICkge1xuICAgICAgICAgICAgcmVzdWx0ID0gbmV3IENzc1N5bnRheEVycm9yKG1lc3NhZ2UsIG9yaWdpbi5saW5lLCBvcmlnaW4uY29sdW1uLFxuICAgICAgICAgICAgICAgIG9yaWdpbi5zb3VyY2UsIG9yaWdpbi5maWxlLCBvcHRzLnBsdWdpbik7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXN1bHQgPSBuZXcgQ3NzU3ludGF4RXJyb3IobWVzc2FnZSwgbGluZS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wYXJzZShjc3MsIHsgZnJvbTogJ2EuY3NzJyB9KTtcbiAgICAgKiByb290LnNvdXJjZS5pbnB1dC5mcm9tIC8vPT4gXCIvaG9tZS9haS9hLmNzc1wiXG4gICAgICpcbiAgICAgKiBjb25zdCByb290ID0gcG9zdGNzcy5wYXJzZShjc3MpO1xuICAgICAqIHJvb3Quc291cmNlLmlucHV0LmZyb20gLy89PiBcIjxpbnB1dCBjc3MgMT5cIlxuICAgICAqL1xuICAgIGdldCBmcm9tKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5maWxlIHx8IHRoaXMuaWQ7XG4gICAgfVxuXG59XG5cbmV4cG9ydCBkZWZhdWx0IElucHV0O1xuXG4vKipcbiAqIEB0eXBlZGVmICB7b2JqZWN0fSBmaWxlUG9zaXRpb25cbiAqIEBwcm9wZXJ0eSB7c3RyaW5nfSBmaWxlICAgLSBwYXRoIHRvIGZpbGVcbiAqIEBwcm9wZXJ0eSB7bnVtYmVyfSBsaW5lICAgLSBzb3VyY2UgbGluZSBpbiBmaWxlXG4gKiBAcHJvcGVydHkge251bWJlcn0gY29sdW1uIC0gc291cmNlIGNvbHVtbiBpbiBmaWxlXG4gKi9cbiJdfQ==
  6911. /***/ }),
  6912. /* 27 */
  6913. /***/ (function(module, exports, __webpack_require__) {
  6914. "use strict";
  6915. exports.__esModule = true;
  6916. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6917. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  6918. var _cssSyntaxError = __webpack_require__(75);
  6919. var _cssSyntaxError2 = _interopRequireDefault(_cssSyntaxError);
  6920. var _stringifier = __webpack_require__(29);
  6921. var _stringifier2 = _interopRequireDefault(_stringifier);
  6922. var _stringify = __webpack_require__(80);
  6923. var _stringify2 = _interopRequireDefault(_stringify);
  6924. var _warnOnce = __webpack_require__(4);
  6925. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  6926. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  6927. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6928. var cloneNode = function cloneNode(obj, parent) {
  6929. var cloned = new obj.constructor();
  6930. for (var i in obj) {
  6931. if (!obj.hasOwnProperty(i)) continue;
  6932. var value = obj[i];
  6933. var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
  6934. if (i === 'parent' && type === 'object') {
  6935. if (parent) cloned[i] = parent;
  6936. } else if (i === 'source') {
  6937. cloned[i] = value;
  6938. } else if (value instanceof Array) {
  6939. cloned[i] = value.map(function (j) {
  6940. return cloneNode(j, cloned);
  6941. });
  6942. } else if (i !== 'before' && i !== 'after' && i !== 'between' && i !== 'semicolon') {
  6943. if (type === 'object' && value !== null) value = cloneNode(value);
  6944. cloned[i] = value;
  6945. }
  6946. }
  6947. return cloned;
  6948. };
  6949. /**
  6950. * All node classes inherit the following common methods.
  6951. *
  6952. * @abstract
  6953. */
  6954. var Node = function () {
  6955. /**
  6956. * @param {object} [defaults] - value for node properties
  6957. */
  6958. function Node() {
  6959. var defaults = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  6960. _classCallCheck(this, Node);
  6961. this.raws = {};
  6962. if ((typeof defaults === 'undefined' ? 'undefined' : _typeof(defaults)) !== 'object' && typeof defaults !== 'undefined') {
  6963. throw new Error('PostCSS nodes constructor accepts object, not ' + JSON.stringify(defaults));
  6964. }
  6965. for (var name in defaults) {
  6966. this[name] = defaults[name];
  6967. }
  6968. }
  6969. /**
  6970. * Returns a CssSyntaxError instance containing the original position
  6971. * of the node in the source, showing line and column numbers and also
  6972. * a small excerpt to facilitate debugging.
  6973. *
  6974. * If present, an input source map will be used to get the original position
  6975. * of the source, even from a previous compilation step
  6976. * (e.g., from Sass compilation).
  6977. *
  6978. * This method produces very useful error messages.
  6979. *
  6980. * @param {string} message - error description
  6981. * @param {object} [opts] - options
  6982. * @param {string} opts.plugin - plugin name that created this error.
  6983. * PostCSS will set it automatically.
  6984. * @param {string} opts.word - a word inside a node’s string that should
  6985. * be highlighted as the source of the error
  6986. * @param {number} opts.index - an index inside a node’s string that should
  6987. * be highlighted as the source of the error
  6988. *
  6989. * @return {CssSyntaxError} error object to throw it
  6990. *
  6991. * @example
  6992. * if ( !variables[name] ) {
  6993. * throw decl.error('Unknown variable ' + name, { word: name });
  6994. * // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
  6995. * // color: $black
  6996. * // a
  6997. * // ^
  6998. * // background: white
  6999. * }
  7000. */
  7001. Node.prototype.error = function error(message) {
  7002. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7003. if (this.source) {
  7004. var pos = this.positionBy(opts);
  7005. return this.source.input.error(message, pos.line, pos.column, opts);
  7006. } else {
  7007. return new _cssSyntaxError2.default(message);
  7008. }
  7009. };
  7010. /**
  7011. * This method is provided as a convenience wrapper for {@link Result#warn}.
  7012. *
  7013. * @param {Result} result - the {@link Result} instance
  7014. * that will receive the warning
  7015. * @param {string} text - warning message
  7016. * @param {object} [opts] - options
  7017. * @param {string} opts.plugin - plugin name that created this warning.
  7018. * PostCSS will set it automatically.
  7019. * @param {string} opts.word - a word inside a node’s string that should
  7020. * be highlighted as the source of the warning
  7021. * @param {number} opts.index - an index inside a node’s string that should
  7022. * be highlighted as the source of the warning
  7023. *
  7024. * @return {Warning} created warning object
  7025. *
  7026. * @example
  7027. * const plugin = postcss.plugin('postcss-deprecated', () => {
  7028. * return (root, result) => {
  7029. * root.walkDecls('bad', decl => {
  7030. * decl.warn(result, 'Deprecated property bad');
  7031. * });
  7032. * };
  7033. * });
  7034. */
  7035. Node.prototype.warn = function warn(result, text, opts) {
  7036. var data = { node: this };
  7037. for (var i in opts) {
  7038. data[i] = opts[i];
  7039. }return result.warn(text, data);
  7040. };
  7041. /**
  7042. * Removes the node from its parent and cleans the parent properties
  7043. * from the node and its children.
  7044. *
  7045. * @example
  7046. * if ( decl.prop.match(/^-webkit-/) ) {
  7047. * decl.remove();
  7048. * }
  7049. *
  7050. * @return {Node} node to make calls chain
  7051. */
  7052. Node.prototype.remove = function remove() {
  7053. if (this.parent) {
  7054. this.parent.removeChild(this);
  7055. }
  7056. this.parent = undefined;
  7057. return this;
  7058. };
  7059. /**
  7060. * Returns a CSS string representing the node.
  7061. *
  7062. * @param {stringifier|syntax} [stringifier] - a syntax to use
  7063. * in string generation
  7064. *
  7065. * @return {string} CSS string of this node
  7066. *
  7067. * @example
  7068. * postcss.rule({ selector: 'a' }).toString() //=> "a {}"
  7069. */
  7070. Node.prototype.toString = function toString() {
  7071. var stringifier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _stringify2.default;
  7072. if (stringifier.stringify) stringifier = stringifier.stringify;
  7073. var result = '';
  7074. stringifier(this, function (i) {
  7075. result += i;
  7076. });
  7077. return result;
  7078. };
  7079. /**
  7080. * Returns a clone of the node.
  7081. *
  7082. * The resulting cloned node and its (cloned) children will have
  7083. * a clean parent and code style properties.
  7084. *
  7085. * @param {object} [overrides] - new properties to override in the clone.
  7086. *
  7087. * @example
  7088. * const cloned = decl.clone({ prop: '-moz-' + decl.prop });
  7089. * cloned.raws.before //=> undefined
  7090. * cloned.parent //=> undefined
  7091. * cloned.toString() //=> -moz-transform: scale(0)
  7092. *
  7093. * @return {Node} clone of the node
  7094. */
  7095. Node.prototype.clone = function clone() {
  7096. var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  7097. var cloned = cloneNode(this);
  7098. for (var name in overrides) {
  7099. cloned[name] = overrides[name];
  7100. }
  7101. return cloned;
  7102. };
  7103. /**
  7104. * Shortcut to clone the node and insert the resulting cloned node
  7105. * before the current node.
  7106. *
  7107. * @param {object} [overrides] - new properties to override in the clone.
  7108. *
  7109. * @example
  7110. * decl.cloneBefore({ prop: '-moz-' + decl.prop });
  7111. *
  7112. * @return {Node} - new node
  7113. */
  7114. Node.prototype.cloneBefore = function cloneBefore() {
  7115. var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  7116. var cloned = this.clone(overrides);
  7117. this.parent.insertBefore(this, cloned);
  7118. return cloned;
  7119. };
  7120. /**
  7121. * Shortcut to clone the node and insert the resulting cloned node
  7122. * after the current node.
  7123. *
  7124. * @param {object} [overrides] - new properties to override in the clone.
  7125. *
  7126. * @return {Node} - new node
  7127. */
  7128. Node.prototype.cloneAfter = function cloneAfter() {
  7129. var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  7130. var cloned = this.clone(overrides);
  7131. this.parent.insertAfter(this, cloned);
  7132. return cloned;
  7133. };
  7134. /**
  7135. * Inserts node(s) before the current node and removes the current node.
  7136. *
  7137. * @param {...Node} nodes - node(s) to replace current one
  7138. *
  7139. * @example
  7140. * if ( atrule.name == 'mixin' ) {
  7141. * atrule.replaceWith(mixinRules[atrule.params]);
  7142. * }
  7143. *
  7144. * @return {Node} current node to methods chain
  7145. */
  7146. Node.prototype.replaceWith = function replaceWith() {
  7147. if (this.parent) {
  7148. for (var _len = arguments.length, nodes = Array(_len), _key = 0; _key < _len; _key++) {
  7149. nodes[_key] = arguments[_key];
  7150. }
  7151. for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  7152. var _ref;
  7153. if (_isArray) {
  7154. if (_i >= _iterator.length) break;
  7155. _ref = _iterator[_i++];
  7156. } else {
  7157. _i = _iterator.next();
  7158. if (_i.done) break;
  7159. _ref = _i.value;
  7160. }
  7161. var node = _ref;
  7162. this.parent.insertBefore(this, node);
  7163. }
  7164. this.remove();
  7165. }
  7166. return this;
  7167. };
  7168. /**
  7169. * Removes the node from its current parent and inserts it
  7170. * at the end of `newParent`.
  7171. *
  7172. * This will clean the `before` and `after` code {@link Node#raws} data
  7173. * from the node and replace them with the indentation style of `newParent`.
  7174. * It will also clean the `between` property
  7175. * if `newParent` is in another {@link Root}.
  7176. *
  7177. * @param {Container} newParent - container node where the current node
  7178. * will be moved
  7179. *
  7180. * @example
  7181. * atrule.moveTo(atrule.root());
  7182. *
  7183. * @return {Node} current node to methods chain
  7184. */
  7185. Node.prototype.moveTo = function moveTo(newParent) {
  7186. this.cleanRaws(this.root() === newParent.root());
  7187. this.remove();
  7188. newParent.append(this);
  7189. return this;
  7190. };
  7191. /**
  7192. * Removes the node from its current parent and inserts it into
  7193. * a new parent before `otherNode`.
  7194. *
  7195. * This will also clean the node’s code style properties just as it would
  7196. * in {@link Node#moveTo}.
  7197. *
  7198. * @param {Node} otherNode - node that will be before current node
  7199. *
  7200. * @return {Node} current node to methods chain
  7201. */
  7202. Node.prototype.moveBefore = function moveBefore(otherNode) {
  7203. this.cleanRaws(this.root() === otherNode.root());
  7204. this.remove();
  7205. otherNode.parent.insertBefore(otherNode, this);
  7206. return this;
  7207. };
  7208. /**
  7209. * Removes the node from its current parent and inserts it into
  7210. * a new parent after `otherNode`.
  7211. *
  7212. * This will also clean the node’s code style properties just as it would
  7213. * in {@link Node#moveTo}.
  7214. *
  7215. * @param {Node} otherNode - node that will be after current node
  7216. *
  7217. * @return {Node} current node to methods chain
  7218. */
  7219. Node.prototype.moveAfter = function moveAfter(otherNode) {
  7220. this.cleanRaws(this.root() === otherNode.root());
  7221. this.remove();
  7222. otherNode.parent.insertAfter(otherNode, this);
  7223. return this;
  7224. };
  7225. /**
  7226. * Returns the next child of the node’s parent.
  7227. * Returns `undefined` if the current node is the last child.
  7228. *
  7229. * @return {Node|undefined} next node
  7230. *
  7231. * @example
  7232. * if ( comment.text === 'delete next' ) {
  7233. * const next = comment.next();
  7234. * if ( next ) {
  7235. * next.remove();
  7236. * }
  7237. * }
  7238. */
  7239. Node.prototype.next = function next() {
  7240. var index = this.parent.index(this);
  7241. return this.parent.nodes[index + 1];
  7242. };
  7243. /**
  7244. * Returns the previous child of the node’s parent.
  7245. * Returns `undefined` if the current node is the first child.
  7246. *
  7247. * @return {Node|undefined} previous node
  7248. *
  7249. * @example
  7250. * const annotation = decl.prev();
  7251. * if ( annotation.type == 'comment' ) {
  7252. * readAnnotation(annotation.text);
  7253. * }
  7254. */
  7255. Node.prototype.prev = function prev() {
  7256. var index = this.parent.index(this);
  7257. return this.parent.nodes[index - 1];
  7258. };
  7259. Node.prototype.toJSON = function toJSON() {
  7260. var fixed = {};
  7261. for (var name in this) {
  7262. if (!this.hasOwnProperty(name)) continue;
  7263. if (name === 'parent') continue;
  7264. var value = this[name];
  7265. if (value instanceof Array) {
  7266. fixed[name] = value.map(function (i) {
  7267. if ((typeof i === 'undefined' ? 'undefined' : _typeof(i)) === 'object' && i.toJSON) {
  7268. return i.toJSON();
  7269. } else {
  7270. return i;
  7271. }
  7272. });
  7273. } else if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.toJSON) {
  7274. fixed[name] = value.toJSON();
  7275. } else {
  7276. fixed[name] = value;
  7277. }
  7278. }
  7279. return fixed;
  7280. };
  7281. /**
  7282. * Returns a {@link Node#raws} value. If the node is missing
  7283. * the code style property (because the node was manually built or cloned),
  7284. * PostCSS will try to autodetect the code style property by looking
  7285. * at other nodes in the tree.
  7286. *
  7287. * @param {string} prop - name of code style property
  7288. * @param {string} [defaultType] - name of default value, it can be missed
  7289. * if the value is the same as prop
  7290. *
  7291. * @example
  7292. * const root = postcss.parse('a { background: white }');
  7293. * root.nodes[0].append({ prop: 'color', value: 'black' });
  7294. * root.nodes[0].nodes[1].raws.before //=> undefined
  7295. * root.nodes[0].nodes[1].raw('before') //=> ' '
  7296. *
  7297. * @return {string} code style value
  7298. */
  7299. Node.prototype.raw = function raw(prop, defaultType) {
  7300. var str = new _stringifier2.default();
  7301. return str.raw(this, prop, defaultType);
  7302. };
  7303. /**
  7304. * Finds the Root instance of the node’s tree.
  7305. *
  7306. * @example
  7307. * root.nodes[0].nodes[0].root() === root
  7308. *
  7309. * @return {Root} root parent
  7310. */
  7311. Node.prototype.root = function root() {
  7312. var result = this;
  7313. while (result.parent) {
  7314. result = result.parent;
  7315. }return result;
  7316. };
  7317. Node.prototype.cleanRaws = function cleanRaws(keepBetween) {
  7318. delete this.raws.before;
  7319. delete this.raws.after;
  7320. if (!keepBetween) delete this.raws.between;
  7321. };
  7322. Node.prototype.positionInside = function positionInside(index) {
  7323. var string = this.toString();
  7324. var column = this.source.start.column;
  7325. var line = this.source.start.line;
  7326. for (var i = 0; i < index; i++) {
  7327. if (string[i] === '\n') {
  7328. column = 1;
  7329. line += 1;
  7330. } else {
  7331. column += 1;
  7332. }
  7333. }
  7334. return { line: line, column: column };
  7335. };
  7336. Node.prototype.positionBy = function positionBy(opts) {
  7337. var pos = this.source.start;
  7338. if (opts.index) {
  7339. pos = this.positionInside(opts.index);
  7340. } else if (opts.word) {
  7341. var index = this.toString().indexOf(opts.word);
  7342. if (index !== -1) pos = this.positionInside(index);
  7343. }
  7344. return pos;
  7345. };
  7346. Node.prototype.removeSelf = function removeSelf() {
  7347. (0, _warnOnce2.default)('Node#removeSelf is deprecated. Use Node#remove.');
  7348. return this.remove();
  7349. };
  7350. Node.prototype.replace = function replace(nodes) {
  7351. (0, _warnOnce2.default)('Node#replace is deprecated. Use Node#replaceWith');
  7352. return this.replaceWith(nodes);
  7353. };
  7354. Node.prototype.style = function style(own, detect) {
  7355. (0, _warnOnce2.default)('Node#style() is deprecated. Use Node#raw()');
  7356. return this.raw(own, detect);
  7357. };
  7358. Node.prototype.cleanStyles = function cleanStyles(keepBetween) {
  7359. (0, _warnOnce2.default)('Node#cleanStyles() is deprecated. Use Node#cleanRaws()');
  7360. return this.cleanRaws(keepBetween);
  7361. };
  7362. _createClass(Node, [{
  7363. key: 'before',
  7364. get: function get() {
  7365. (0, _warnOnce2.default)('Node#before is deprecated. Use Node#raws.before');
  7366. return this.raws.before;
  7367. },
  7368. set: function set(val) {
  7369. (0, _warnOnce2.default)('Node#before is deprecated. Use Node#raws.before');
  7370. this.raws.before = val;
  7371. }
  7372. }, {
  7373. key: 'between',
  7374. get: function get() {
  7375. (0, _warnOnce2.default)('Node#between is deprecated. Use Node#raws.between');
  7376. return this.raws.between;
  7377. },
  7378. set: function set(val) {
  7379. (0, _warnOnce2.default)('Node#between is deprecated. Use Node#raws.between');
  7380. this.raws.between = val;
  7381. }
  7382. /**
  7383. * @memberof Node#
  7384. * @member {string} type - String representing the node’s type.
  7385. * Possible values are `root`, `atrule`, `rule`,
  7386. * `decl`, or `comment`.
  7387. *
  7388. * @example
  7389. * postcss.decl({ prop: 'color', value: 'black' }).type //=> 'decl'
  7390. */
  7391. /**
  7392. * @memberof Node#
  7393. * @member {Container} parent - the node’s parent node.
  7394. *
  7395. * @example
  7396. * root.nodes[0].parent == root;
  7397. */
  7398. /**
  7399. * @memberof Node#
  7400. * @member {source} source - the input source of the node
  7401. *
  7402. * The property is used in source map generation.
  7403. *
  7404. * If you create a node manually (e.g., with `postcss.decl()`),
  7405. * that node will not have a `source` property and will be absent
  7406. * from the source map. For this reason, the plugin developer should
  7407. * consider cloning nodes to create new ones (in which case the new node’s
  7408. * source will reference the original, cloned node) or setting
  7409. * the `source` property manually.
  7410. *
  7411. * ```js
  7412. * // Bad
  7413. * const prefixed = postcss.decl({
  7414. * prop: '-moz-' + decl.prop,
  7415. * value: decl.value
  7416. * });
  7417. *
  7418. * // Good
  7419. * const prefixed = decl.clone({ prop: '-moz-' + decl.prop });
  7420. * ```
  7421. *
  7422. * ```js
  7423. * if ( atrule.name == 'add-link' ) {
  7424. * const rule = postcss.rule({ selector: 'a', source: atrule.source });
  7425. * atrule.parent.insertBefore(atrule, rule);
  7426. * }
  7427. * ```
  7428. *
  7429. * @example
  7430. * decl.source.input.from //=> '/home/ai/a.sass'
  7431. * decl.source.start //=> { line: 10, column: 2 }
  7432. * decl.source.end //=> { line: 10, column: 12 }
  7433. */
  7434. /**
  7435. * @memberof Node#
  7436. * @member {object} raws - Information to generate byte-to-byte equal
  7437. * node string as it was in the origin input.
  7438. *
  7439. * Every parser saves its own properties,
  7440. * but the default CSS parser uses:
  7441. *
  7442. * * `before`: the space symbols before the node. It also stores `*`
  7443. * and `_` symbols before the declaration (IE hack).
  7444. * * `after`: the space symbols after the last child of the node
  7445. * to the end of the node.
  7446. * * `between`: the symbols between the property and value
  7447. * for declarations, selector and `{` for rules, or last parameter
  7448. * and `{` for at-rules.
  7449. * * `semicolon`: contains true if the last child has
  7450. * an (optional) semicolon.
  7451. * * `afterName`: the space between the at-rule name and its parameters.
  7452. * * `left`: the space symbols between `/*` and the comment’s text.
  7453. * * `right`: the space symbols between the comment’s text
  7454. * and <code>*&#47;</code>.
  7455. * * `important`: the content of the important statement,
  7456. * if it is not just `!important`.
  7457. *
  7458. * PostCSS cleans selectors, declaration values and at-rule parameters
  7459. * from comments and extra spaces, but it stores origin content in raws
  7460. * properties. As such, if you don’t change a declaration’s value,
  7461. * PostCSS will use the raw value with comments.
  7462. *
  7463. * @example
  7464. * const root = postcss.parse('a {\n color:black\n}')
  7465. * root.first.first.raws //=> { before: '\n ', between: ':' }
  7466. */
  7467. }]);
  7468. return Node;
  7469. }();
  7470. exports.default = Node;
  7471. /**
  7472. * @typedef {object} position
  7473. * @property {number} line - source line in file
  7474. * @property {number} column - source column in file
  7475. */
  7476. /**
  7477. * @typedef {object} source
  7478. * @property {Input} input - {@link Input} with input file
  7479. * @property {position} start - The starting position of the node’s source
  7480. * @property {position} end - The ending position of the node’s source
  7481. */
  7482. module.exports = exports['default'];
  7483. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGUuZXM2Il0sIm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gICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQb3N0Q1NTIHdpbGwgc2V0IGl0IGF1dG9tYXRpY2FsbHkuXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IG9wdHMud29yZCAgIC0gYSB3b3JkIGluc2lkZSBhIG5vZGXigJlzIHN0cmluZyB0aGF0IHNob3VsZFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJlIGhpZ2hsaWdodGVkIGFzIHRoZSBzb3VyY2Ugb2YgdGhlIGVycm9yXG4gICAgICogQHBhcmFtIHtudW1iZXJ9IG9wdHMuaW5kZXggIC0gYW4gaW5kZXggaW5zaWRlIGEgbm9kZeKAmXMgc3RyaW5nIHRoYXQgc2hvdWxkXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmUgaGlnaGxpZ2h0ZWQgYXMgdGhlIHNvdXJjZSBvZiB0aGUgZXJyb3JcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge0Nzc1N5bnRheEVycm9yfSBlcnJvciBvYmplY3QgdG8gdGhyb3cgaXRcbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogaWYgKCAhdmFyaWFibGVzW25hbWVdICkge1xuICAgICAqICAgdGhyb3cgZGVjbC5lcnJvcignVW5rbm93biB2YXJpYWJsZSAnICsgbmFtZSwgeyB3b3JkOiBuYW1lIH0pO1xuICAgICAqICAgLy8gQ3NzU3ludGF4RXJyb3I6IHBvc3Rjc3MtdmFyczphLnNhc3M6NDozOiBVbmtub3duIHZhcmlhYmxlICRibGFja1xuICAgICAqICAgLy8gICBjb2xvcjogJGJsYWNrXG4gICAgICogICAvLyBhXG4gICAgICogICAvLyAgICAgICAgICBeXG4gICAgICogICAvLyAgIGJhY2tncm91bmQ6IHdoaXRlXG4gICAgICogfVxuICAgICAqL1xuICAgIGVycm9yKG1lc3NhZ2UsIG9wdHMgPSB7IH0pIHtcbiAgICAgICAgaWYgKCB0aGlzLnNvdXJjZSAp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bXBsZVxuICAgICAqIGlmICggZGVjbC5wcm9wLm1hdGNoKC9eLXdlYmtpdC0vKSApIHtcbiAgICAgKiAgIGRlY2wucmVtb3ZlKCk7XG4gICAgICogfVxuICAgICAqXG4gICAgICogQHJldHVybiB7Tm9kZX0gbm9kZSB0byBtYWtlIGNhbGxzIGNoYWluXG4gICAgICovXG4gICAgcmVtb3ZlKCkge1xuICAgICAgICBpZiAoIHRoaXMucGFyZW50ICkge1xuICAgICAgICAgICAgdGhpcy5wYXJlbnQucmVtb3ZlQ2hpbGQodGhpcyk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5wYXJlbnQgPSB1bmRlZmluZWQ7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgYSBDU1Mgc3RyaW5nIHJlcHJlc2VudGluZyB0aGUgbm9kZS5cbiAgICAgKlxuICAgICAqIEBwYXJhbSB7c3RyaW5naWZpZXJ8c3ludGF4fSBbc3RyaW5naWZpZXJdIC0gYSBzeW50YXggdG8gdXNlXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbiBzdHJpbmcgZ2VuZXJhdGlvblxuICAgICAqXG4gICAgICogQHJldHVybiB7c3RyaW5nfSBDU1Mgc3RyaW5nIG9mIHRoaXMgbm9kZVxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiBwb3N0Y3NzLnJ1bGUoeyBzZWxlY3RvcjogJ2EnIH0pLnRvU3RyaW5nKCkgLy89PiBcImEge31cIlxuICAgICAqL1xuICAgIHRvU3RyaW5nKHN0cmluZ2lmaWVyID0gc3RyaW5naWZ5KSB7XG4gICAgICAgIGlmICggc3RyaW5naWZpZXIuc3RyaW5naWZ5ICkgc3RyaW5naWZpZXIgPSBzdHJpbmdpZmllci5zdHJpbmdpZnk7XG4gICAgICAgIGxldCByZXN1bHQgID0gJyc7XG4gICAgICAgIHN0cmluZ2lmaWVyK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pO1xuICAgICAgICB0aGlzLnBhcmVudC5pbnNlcnRBZnRlcih0aGlzLCBjbG9uZWQpO1xuICAgICAgICByZXR1cm4gY2xvbmVkO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEluc2VydHMgbm9kZShzKSBiZWZvcmUgdGhlIGN1cnJlbnQgbm9kZSBhbmQgcmVtb3ZlcyB0aGUgY3VycmVudCBub2RlLlxuICAgICAqXG4gICAgICogQHBhcmFtIHsuLi5Ob2RlfSBub2RlcyAtIG5vZGUocykgdG8gcmVwbGFjZSBjdXJyZW50IG9uZVxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiBpZiAoIGF0cnVsZS5uYW1lID09ICdtaXhpbicgKSB7XG4gICAgICogICBhdHJ1bGUucmVwbGFjZVdpdGgobWl4aW5SdWxlc1thdHJ1bGUucGFyYW1zXSk7XG4gICAgICogfVxuICAgICAqXG4gICAgICogQHJldHVybiB7Tm9kZX0gY3VycmVudCBub2RlIHRvIG1ldGhvZHMgY2hhaW5cbiAgICAgKi9cbiAgICByZXBsYWNlV2l0aCguLi5ub2Rlcykge1xuICAgICAgICBpZiAodGhpcy5wYXJlbnQpIHtcbiAgICAgICAgICAgIGZvciAobGV0IG5vZGUgb2Ygbm9kZXMpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC5pbnNlcnRCZWZvcmUodGhpcywgbm9kZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMucmVtb3ZlKCk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBSZW1vdmVzIHRoZSBub2RlIGZyb20gaXRzIGN1cnJlbnQgcGFyZW50IGFuZCBpbnNlcnRzIGl0XG4gICAgICogYXQgdGhlIGVuZCBvZiBgbmV3UGFyZW50YC5cbiAgICAgKlxuICAgICAqIFRoaXMgd2lsbCBjbGVhbiB0aGUgYGJlZm9yZWAgYW5kIGBhZnR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dW5kZWZpbmVkfSBwcmV2aW91cyBub2RlXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIGNvbnN0IGFubm90YXRpb24gPSBkZWNsLnByZXYoKTtcbiAgICAgKiBpZiAoIGFubm90YXRpb24udHlwZSA9PSAnY29tbWVudCcgKSB7XG4gICAgICogIHJlYWRBbm5vdGF0aW9uKGFubm90YXRpb24udGV4dCk7XG4gICAgICogfVxuICAgICAqL1xuICAgIHByZXYoKSB7XG4gICAgICAgIGxldCBpbmRleCA9IHRoaXMucGFyZW50LmluZGV4KHRoaXMpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJlbnQubm9kZXNbaW5kZXggLSAxXTtcbiAgICB9XG5cbiAgICB0b0pTT04oKSB7XG4gICAgICAgIGxldCBmaXhlZCA9IHsgfTtcblxuICAgICAgICBmb3IgKCBsZXQgbmFtZSBpbiB0aGlzICkge1xuICAgICAgICAgICAgaWYgKCAhdGhpcy5oYXNPd25Qcm9wZXJ0eShuYW1lKSApIGNvbnRpbnVlO1xuICAgICAgICAgICAgaWYgKCBuYW1lID09PSAncGFyZW50JyApIGNvbnRpbnVlO1xuICAgICAgICAgICAgbGV0IHZhbHVlID0gdGhpc1tuYW1lXTtcblxuICAgICAgICAgICAgaWYgKCB2YWx1ZSBpbnN0YW5jZW9mIEFycmF5ICkge1xuICAgICAgICAgICAgICAgIGZpeGVkW25hbWVdID0gdmFsdWUubWFwKCBpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCB0eXBlb2YgaSA9PT0gJ29iamVjdCcgJiYgaS50b0pTT04gKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaS50b0pTT04oKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCB0eX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KSB7XG4gICAgICAgIGxldCBzdHJpbmcgPSB0aGlzLnRvU3RyaW5nKCk7XG4gICAgICAgIGxldCBjb2x1bW4gPSB0aGlzLnNvdXJjZS5zdGFydC5jb2x1bW47XG4gICAgICAgIGxldCBsaW5lICAgPSB0aGlzLnNvdXJjZS5zdGFydC5saW5lO1xuXG4gICAgICAgIGZvciAoIGxldCBpID0gMDsgaSA8IGluZGV4OyBpKysgKSB7XG4gICAgICAgICAgICBpZiAoIHN0cmluZ1tpXSA9PT0gJ1xcbicgKSB7XG4gICAgICAgICAgICAgICAgY29sdW1uID0gMTtcbiAgICAgICAgICAgICAgICBsaW5lICArPSAxO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb2x1bW4gKz0gMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB7IGxpbmUsIGNvbHVtbiB9O1xuICAgIH1cblxuICAgIHBvc2l0aW9uQnkob3B0cykge1xuICAgICAgICBsZXQgcG9zID0gdGhpcy5zb3VyY2Uuc3RhcnQ7XG4gICAgICAgIGlmICggb3B0cy5pbmRleCApIHtcbiAgICAgICAgICAgIHBvcyA9IHRoaXMucG9zaXRpb25JbnNpZGUob3B0cy5pbmRleCk7XG4gICAgICAgIH0gZWxzZSBpZiAoIG9wdHMud29yZCApIHtcbiAgICAgICAgICAgIGxldCBpbmRleCA9IHRoaXMudG9TdHJpbmcoKS5pbmRleE9mKG9wdHMud29yZCk7XG4gICAgICAgICAgICBpZiAoIGluZGV4ICE9PSAtMSApIHBvcyA9IHRoaXMucG9zaXRpb25JbnNpZGUoaW5kZXgpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBwb3M7XG4gICAgfVxuXG4gICAgcmVtb3ZlU2VsZigpIHtcbiAgICAgICAgd2Fybk9uY2UoJ05vZGUjcmVtb3ZlU2VsZiBpcyBkZXByZWNhdGVkLiBVc2UgTm9kZSNyZW1vdmUuJyk7XG4gICAgICAgI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gcmF3c1xuICAgICAqIHByb3BlcnRpZXMuIEFzIHN1Y2gsIGlmIHlvdSBkb27igJl0IGNoYW5nZSBhIGRlY2xhcmF0aW9u4oCZcyB2YWx1ZSxcbiAgICAgKiBQb3N0Q1NTIHdpbGwgdXNlIHRoZSByYXcgdmFsdWUgd2l0aCBjb21tZW50cy5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogY29uc3Qgcm9vdCA9IHBvc3Rjc3MucGFyc2UoJ2Ege1xcbiAgY29sb3I6YmxhY2tcXG59JylcbiAgICAgKiByb290LmZpcnN0LmZpcnN0LnJhd3MgLy89PiB7IGJlZm9yZTogJ1xcbiAgJywgYmV0d2VlbjogJzonIH1cbiAgICAgKi9cblxufVxuXG5leHBvcnQgZGVmYXVsdCBOb2RlO1xuXG4vKipcbiAqIEB0eXBlZGVmIHtvYmplY3R9IHBvc2l0aW9uXG4gKiBAcHJvcGVydHkge251bWJlcn0gbGluZSAgIC0gc291cmNlIGxpbmUgaW4gZmlsZVxuICogQHByb3BlcnR5IHtudW1iZXJ9IGNvbHVtbiAtIHNvdXJjZSBjb2x1bW4gaW4gZmlsZVxuICovXG5cbi8qKlxuICogQHR5cGVkZWYge29iamVjdH0gc291cmNlXG4gKiBAcHJvcGVydHkge0lucHV0fSBpbnB1dCAgICAtIHtAbGluayBJbnB1dH0gd2l0aCBpbnB1dCBmaWxlXG4gKiBAcHJvcGVydHkge3Bvc2l0aW9ufSBzdGFydCAtIFRoZSBzdGFydGluZyBwb3NpdGlvbiBvZiB0aGUgbm9kZeKAmXMgc291cmNlXG4gKiBAcHJvcGVydHkge3Bvc2l0aW9ufSBlbmQgICAtIFRoZSBlbmRpbmcgcG9zaXRpb24gb2YgdGhlIG5vZGXigJlzIHNvdXJjZVxuICovXG4iXX0=
  7484. /***/ }),
  7485. /* 28 */
  7486. /***/ (function(module, exports, __webpack_require__) {
  7487. "use strict";
  7488. exports.__esModule = true;
  7489. var _container = __webpack_require__(25);
  7490. var _container2 = _interopRequireDefault(_container);
  7491. var _warnOnce = __webpack_require__(4);
  7492. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  7493. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  7494. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7495. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  7496. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  7497. /**
  7498. * Represents a CSS file and contains all its parsed nodes.
  7499. *
  7500. * @extends Container
  7501. *
  7502. * @example
  7503. * const root = postcss.parse('a{color:black} b{z-index:2}');
  7504. * root.type //=> 'root'
  7505. * root.nodes.length //=> 2
  7506. */
  7507. var Root = function (_Container) {
  7508. _inherits(Root, _Container);
  7509. function Root(defaults) {
  7510. _classCallCheck(this, Root);
  7511. var _this = _possibleConstructorReturn(this, _Container.call(this, defaults));
  7512. _this.type = 'root';
  7513. if (!_this.nodes) _this.nodes = [];
  7514. return _this;
  7515. }
  7516. Root.prototype.removeChild = function removeChild(child) {
  7517. child = this.index(child);
  7518. if (child === 0 && this.nodes.length > 1) {
  7519. this.nodes[1].raws.before = this.nodes[child].raws.before;
  7520. }
  7521. return _Container.prototype.removeChild.call(this, child);
  7522. };
  7523. Root.prototype.normalize = function normalize(child, sample, type) {
  7524. var nodes = _Container.prototype.normalize.call(this, child);
  7525. if (sample) {
  7526. if (type === 'prepend') {
  7527. if (this.nodes.length > 1) {
  7528. sample.raws.before = this.nodes[1].raws.before;
  7529. } else {
  7530. delete sample.raws.before;
  7531. }
  7532. } else if (this.first !== sample) {
  7533. for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  7534. var _ref;
  7535. if (_isArray) {
  7536. if (_i >= _iterator.length) break;
  7537. _ref = _iterator[_i++];
  7538. } else {
  7539. _i = _iterator.next();
  7540. if (_i.done) break;
  7541. _ref = _i.value;
  7542. }
  7543. var node = _ref;
  7544. node.raws.before = sample.raws.before;
  7545. }
  7546. }
  7547. }
  7548. return nodes;
  7549. };
  7550. /**
  7551. * Returns a {@link Result} instance representing the root’s CSS.
  7552. *
  7553. * @param {processOptions} [opts] - options with only `to` and `map` keys
  7554. *
  7555. * @return {Result} result with current root’s CSS
  7556. *
  7557. * @example
  7558. * const root1 = postcss.parse(css1, { from: 'a.css' });
  7559. * const root2 = postcss.parse(css2, { from: 'b.css' });
  7560. * root1.append(root2);
  7561. * const result = root1.toResult({ to: 'all.css', map: true });
  7562. */
  7563. Root.prototype.toResult = function toResult() {
  7564. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  7565. var LazyResult = __webpack_require__(77);
  7566. var Processor = __webpack_require__(157);
  7567. var lazy = new LazyResult(new Processor(), this, opts);
  7568. return lazy.stringify();
  7569. };
  7570. Root.prototype.remove = function remove(child) {
  7571. (0, _warnOnce2.default)('Root#remove is deprecated. Use Root#removeChild');
  7572. this.removeChild(child);
  7573. };
  7574. Root.prototype.prevMap = function prevMap() {
  7575. (0, _warnOnce2.default)('Root#prevMap is deprecated. Use Root#source.input.map');
  7576. return this.source.input.map;
  7577. };
  7578. /**
  7579. * @memberof Root#
  7580. * @member {object} raws - Information to generate byte-to-byte equal
  7581. * node string as it was in the origin input.
  7582. *
  7583. * Every parser saves its own properties,
  7584. * but the default CSS parser uses:
  7585. *
  7586. * * `after`: the space symbols after the last child to the end of file.
  7587. * * `semicolon`: is the last child has an (optional) semicolon.
  7588. *
  7589. * @example
  7590. * postcss.parse('a {}\n').raws //=> { after: '\n' }
  7591. * postcss.parse('a {}').raws //=> { after: '' }
  7592. */
  7593. return Root;
  7594. }(_container2.default);
  7595. exports.default = Root;
  7596. module.exports = exports['default'];
  7597. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJvb3QuZXM2Il0sIm5hbWVzIjpbIlJvb3QiLCJkZWZhdWx0cyIsInR5cGUiLCJub2RlcyIsInJlbW92ZUNoaWxkIiwiY2hpbGQiLCJpbmRleCIsImxlbmd0aCIsInJhd3MiLCJiZWZvcmUiLCJub3JtYWxpemUiLCJzYW1wbGUiLCJmaXJzdCIsIm5vZGUiLCJ0b1Jlc3VsdCIsIm9wdHMiLCJMYXp5UmVzdWx0IiwicmVxdWlyZSIsIlByb2Nlc3NvciIsImxhenkiLCJzdHJpbmdpZnkiLCJyZW1vdmUiLCJwcmV2TWFwIiwic291cmNlIiwiaW5wdXQiLCJtYXAiXSwibWFwcGluZ3MiOiI7Ozs7QUFBQTs7OztBQUNBOzs7Ozs7Ozs7Ozs7QUFFQTs7Ozs7Ozs7OztJQVVNQSxJOzs7QUFFRixrQkFBWUMsUUFBWixFQUFzQjtBQUFBOztBQUFBLHFEQUNsQixzQkFBTUEsUUFBTixDQURrQjs7QUFFbEIsY0FBS0MsSUFBTCxHQUFZLE1BQVo7QUFDQSxZQUFLLENBQUMsTUFBS0MsS0FBWCxFQUFtQixNQUFLQSxLQUFMLEdBQWEsRUFBYjtBQUhEO0FBSXJCOzttQkFFREMsVyx3QkFBWUMsSyxFQUFPO0FBQ2ZBLGdCQUFRLEtBQUtDLEtBQUwsQ0FBV0QsS0FBWCxDQUFSOztBQUVBLFlBQUtBLFVBQVUsQ0FBVixJQUFlLEtBQUtGLEtBQUwsQ0FBV0ksTUFBWCxHQUFvQixDQUF4QyxFQUE0QztBQUN4QyxpQkFBS0osS0FBTCxDQUFXLENBQVgsRUFBY0ssSUFBZCxDQUFtQkMsTUFBbkIsR0FBNEI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gIGlmICggIXRoaXMubm9kZXMgKSB0aGlzLm5vZGVzID0gW107XG4gICAgfVxuXG4gICAgcmVtb3ZlQ2hpbGQoY2hpbGQpIHtcbiAgICAgICAgY2hpbGQgPSB0aGlzLmluZGV4KGNoaWxkKTtcblxuICAgICAgICBpZiAoIGNoaWxkID09PSAwICYmIHRoaXMubm9kZXMubGVuZ3RoID4gMSApIHtcbiAgICAgICAgICAgIHRoaXMubm9kZXNbMV0ucmF3cy5iZWZvcmUgPSB0aGlzLm5vZGVzW2NoaWxkXS5yYXdzLmJlZm9yZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBzdXBlci5yZW1vdmVDaGlsZChjaGlsZCk7XG4gICAgfVxuXG4gICAgbm9ybWFsaXplKGNoaWxkLCBzYW1wbGUsIHR5cGUpIHtcbiAgICAgICAgbGV0IG5vZGVzID0gc3VwZXIubm9ybWFsaXplKGNoaWxkKTtcblxuICAgICAgICBpZiAoIHNhbXBsZSApIHtcbiAgICAgICAgICAgIGlmICggdHlwZSA9PT0gJ3ByZXBlbmQnICkge1xuICAgICAgICAgICAgICAgIGlmICggdGhpcy5ub2Rlcy5sZW5ndGggPiAxICkge1xuICAgICAgICAgICAgICAgICAgICBzYW1wbGUucmF3cy5iZWZvcmUgPSB0aGlzLm5vZGVzWzFdLnJhd3MuYmVmb3JlO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBzYW1wbGUucmF3cy5iZWZvcmU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmICggdGhpcy5maXJzdCAhPT0gc2FtcGxlICkge1xuICAgICAgICAgICAgICAgIGZvciAoIGxldCBub2RlIG9mIG5vZGVzICkge1xuICAgICAgICAgICAgICAgICAgICBub2RlLnJhd3MuYmVmb3JlID0gc2FtcGxlLnJhd3MuYmVmb3JlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICA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b3J0IGRlZmF1bHQgUm9vdDtcbiJdfQ==
  7598. /***/ }),
  7599. /* 29 */
  7600. /***/ (function(module, exports, __webpack_require__) {
  7601. "use strict";
  7602. exports.__esModule = true;
  7603. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7604. var defaultRaw = {
  7605. colon: ': ',
  7606. indent: ' ',
  7607. beforeDecl: '\n',
  7608. beforeRule: '\n',
  7609. beforeOpen: ' ',
  7610. beforeClose: '\n',
  7611. beforeComment: '\n',
  7612. after: '\n',
  7613. emptyBody: '',
  7614. commentLeft: ' ',
  7615. commentRight: ' '
  7616. };
  7617. function capitalize(str) {
  7618. return str[0].toUpperCase() + str.slice(1);
  7619. }
  7620. var Stringifier = function () {
  7621. function Stringifier(builder) {
  7622. _classCallCheck(this, Stringifier);
  7623. this.builder = builder;
  7624. }
  7625. Stringifier.prototype.stringify = function stringify(node, semicolon) {
  7626. this[node.type](node, semicolon);
  7627. };
  7628. Stringifier.prototype.root = function root(node) {
  7629. this.body(node);
  7630. if (node.raws.after) this.builder(node.raws.after);
  7631. };
  7632. Stringifier.prototype.comment = function comment(node) {
  7633. var left = this.raw(node, 'left', 'commentLeft');
  7634. var right = this.raw(node, 'right', 'commentRight');
  7635. this.builder('/*' + left + node.text + right + '*/', node);
  7636. };
  7637. Stringifier.prototype.decl = function decl(node, semicolon) {
  7638. var between = this.raw(node, 'between', 'colon');
  7639. var string = node.prop + between + this.rawValue(node, 'value');
  7640. if (node.important) {
  7641. string += node.raws.important || ' !important';
  7642. }
  7643. if (semicolon) string += ';';
  7644. this.builder(string, node);
  7645. };
  7646. Stringifier.prototype.rule = function rule(node) {
  7647. this.block(node, this.rawValue(node, 'selector'));
  7648. };
  7649. Stringifier.prototype.atrule = function atrule(node, semicolon) {
  7650. var name = '@' + node.name;
  7651. var params = node.params ? this.rawValue(node, 'params') : '';
  7652. if (typeof node.raws.afterName !== 'undefined') {
  7653. name += node.raws.afterName;
  7654. } else if (params) {
  7655. name += ' ';
  7656. }
  7657. if (node.nodes) {
  7658. this.block(node, name + params);
  7659. } else {
  7660. var end = (node.raws.between || '') + (semicolon ? ';' : '');
  7661. this.builder(name + params + end, node);
  7662. }
  7663. };
  7664. Stringifier.prototype.body = function body(node) {
  7665. var last = node.nodes.length - 1;
  7666. while (last > 0) {
  7667. if (node.nodes[last].type !== 'comment') break;
  7668. last -= 1;
  7669. }
  7670. var semicolon = this.raw(node, 'semicolon');
  7671. for (var i = 0; i < node.nodes.length; i++) {
  7672. var child = node.nodes[i];
  7673. var before = this.raw(child, 'before');
  7674. if (before) this.builder(before);
  7675. this.stringify(child, last !== i || semicolon);
  7676. }
  7677. };
  7678. Stringifier.prototype.block = function block(node, start) {
  7679. var between = this.raw(node, 'between', 'beforeOpen');
  7680. this.builder(start + between + '{', node, 'start');
  7681. var after = void 0;
  7682. if (node.nodes && node.nodes.length) {
  7683. this.body(node);
  7684. after = this.raw(node, 'after');
  7685. } else {
  7686. after = this.raw(node, 'after', 'emptyBody');
  7687. }
  7688. if (after) this.builder(after);
  7689. this.builder('}', node, 'end');
  7690. };
  7691. Stringifier.prototype.raw = function raw(node, own, detect) {
  7692. var value = void 0;
  7693. if (!detect) detect = own;
  7694. // Already had
  7695. if (own) {
  7696. value = node.raws[own];
  7697. if (typeof value !== 'undefined') return value;
  7698. }
  7699. var parent = node.parent;
  7700. // Hack for first rule in CSS
  7701. if (detect === 'before') {
  7702. if (!parent || parent.type === 'root' && parent.first === node) {
  7703. return '';
  7704. }
  7705. }
  7706. // Floating child without parent
  7707. if (!parent) return defaultRaw[detect];
  7708. // Detect style by other nodes
  7709. var root = node.root();
  7710. if (!root.rawCache) root.rawCache = {};
  7711. if (typeof root.rawCache[detect] !== 'undefined') {
  7712. return root.rawCache[detect];
  7713. }
  7714. if (detect === 'before' || detect === 'after') {
  7715. return this.beforeAfter(node, detect);
  7716. } else {
  7717. var method = 'raw' + capitalize(detect);
  7718. if (this[method]) {
  7719. value = this[method](root, node);
  7720. } else {
  7721. root.walk(function (i) {
  7722. value = i.raws[own];
  7723. if (typeof value !== 'undefined') return false;
  7724. });
  7725. }
  7726. }
  7727. if (typeof value === 'undefined') value = defaultRaw[detect];
  7728. root.rawCache[detect] = value;
  7729. return value;
  7730. };
  7731. Stringifier.prototype.rawSemicolon = function rawSemicolon(root) {
  7732. var value = void 0;
  7733. root.walk(function (i) {
  7734. if (i.nodes && i.nodes.length && i.last.type === 'decl') {
  7735. value = i.raws.semicolon;
  7736. if (typeof value !== 'undefined') return false;
  7737. }
  7738. });
  7739. return value;
  7740. };
  7741. Stringifier.prototype.rawEmptyBody = function rawEmptyBody(root) {
  7742. var value = void 0;
  7743. root.walk(function (i) {
  7744. if (i.nodes && i.nodes.length === 0) {
  7745. value = i.raws.after;
  7746. if (typeof value !== 'undefined') return false;
  7747. }
  7748. });
  7749. return value;
  7750. };
  7751. Stringifier.prototype.rawIndent = function rawIndent(root) {
  7752. if (root.raws.indent) return root.raws.indent;
  7753. var value = void 0;
  7754. root.walk(function (i) {
  7755. var p = i.parent;
  7756. if (p && p !== root && p.parent && p.parent === root) {
  7757. if (typeof i.raws.before !== 'undefined') {
  7758. var parts = i.raws.before.split('\n');
  7759. value = parts[parts.length - 1];
  7760. value = value.replace(/[^\s]/g, '');
  7761. return false;
  7762. }
  7763. }
  7764. });
  7765. return value;
  7766. };
  7767. Stringifier.prototype.rawBeforeComment = function rawBeforeComment(root, node) {
  7768. var value = void 0;
  7769. root.walkComments(function (i) {
  7770. if (typeof i.raws.before !== 'undefined') {
  7771. value = i.raws.before;
  7772. if (value.indexOf('\n') !== -1) {
  7773. value = value.replace(/[^\n]+$/, '');
  7774. }
  7775. return false;
  7776. }
  7777. });
  7778. if (typeof value === 'undefined') {
  7779. value = this.raw(node, null, 'beforeDecl');
  7780. }
  7781. return value;
  7782. };
  7783. Stringifier.prototype.rawBeforeDecl = function rawBeforeDecl(root, node) {
  7784. var value = void 0;
  7785. root.walkDecls(function (i) {
  7786. if (typeof i.raws.before !== 'undefined') {
  7787. value = i.raws.before;
  7788. if (value.indexOf('\n') !== -1) {
  7789. value = value.replace(/[^\n]+$/, '');
  7790. }
  7791. return false;
  7792. }
  7793. });
  7794. if (typeof value === 'undefined') {
  7795. value = this.raw(node, null, 'beforeRule');
  7796. }
  7797. return value;
  7798. };
  7799. Stringifier.prototype.rawBeforeRule = function rawBeforeRule(root) {
  7800. var value = void 0;
  7801. root.walk(function (i) {
  7802. if (i.nodes && (i.parent !== root || root.first !== i)) {
  7803. if (typeof i.raws.before !== 'undefined') {
  7804. value = i.raws.before;
  7805. if (value.indexOf('\n') !== -1) {
  7806. value = value.replace(/[^\n]+$/, '');
  7807. }
  7808. return false;
  7809. }
  7810. }
  7811. });
  7812. return value;
  7813. };
  7814. Stringifier.prototype.rawBeforeClose = function rawBeforeClose(root) {
  7815. var value = void 0;
  7816. root.walk(function (i) {
  7817. if (i.nodes && i.nodes.length > 0) {
  7818. if (typeof i.raws.after !== 'undefined') {
  7819. value = i.raws.after;
  7820. if (value.indexOf('\n') !== -1) {
  7821. value = value.replace(/[^\n]+$/, '');
  7822. }
  7823. return false;
  7824. }
  7825. }
  7826. });
  7827. return value;
  7828. };
  7829. Stringifier.prototype.rawBeforeOpen = function rawBeforeOpen(root) {
  7830. var value = void 0;
  7831. root.walk(function (i) {
  7832. if (i.type !== 'decl') {
  7833. value = i.raws.between;
  7834. if (typeof value !== 'undefined') return false;
  7835. }
  7836. });
  7837. return value;
  7838. };
  7839. Stringifier.prototype.rawColon = function rawColon(root) {
  7840. var value = void 0;
  7841. root.walkDecls(function (i) {
  7842. if (typeof i.raws.between !== 'undefined') {
  7843. value = i.raws.between.replace(/[^\s:]/g, '');
  7844. return false;
  7845. }
  7846. });
  7847. return value;
  7848. };
  7849. Stringifier.prototype.beforeAfter = function beforeAfter(node, detect) {
  7850. var value = void 0;
  7851. if (node.type === 'decl') {
  7852. value = this.raw(node, null, 'beforeDecl');
  7853. } else if (node.type === 'comment') {
  7854. value = this.raw(node, null, 'beforeComment');
  7855. } else if (detect === 'before') {
  7856. value = this.raw(node, null, 'beforeRule');
  7857. } else {
  7858. value = this.raw(node, null, 'beforeClose');
  7859. }
  7860. var buf = node.parent;
  7861. var depth = 0;
  7862. while (buf && buf.type !== 'root') {
  7863. depth += 1;
  7864. buf = buf.parent;
  7865. }
  7866. if (value.indexOf('\n') !== -1) {
  7867. var indent = this.raw(node, null, 'indent');
  7868. if (indent.length) {
  7869. for (var step = 0; step < depth; step++) {
  7870. value += indent;
  7871. }
  7872. }
  7873. }
  7874. return value;
  7875. };
  7876. Stringifier.prototype.rawValue = function rawValue(node, prop) {
  7877. var value = node[prop];
  7878. var raw = node.raws[prop];
  7879. if (raw && raw.value === value) {
  7880. return raw.raw;
  7881. } else {
  7882. return value;
  7883. }
  7884. };
  7885. return Stringifier;
  7886. }();
  7887. exports.default = Stringifier;
  7888. module.exports = exports['default'];
  7889. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0cmluZ2lmaWVyLmVzNiJdLCJuYW1lcyI6WyJkZWZhdWx0UmF3IiwiY29sb24iLCJpbmRlbnQiLCJiZWZvcmVEZWNsIiwiYmVmb3JlUnVsZSIsImJlZm9yZU9wZW4iLCJiZWZvcmVDbG9zZSIsImJlZm9yZUNvbW1lbnQiLCJhZnRlciIsImVtcHR5Qm9keSIsImNvbW1lbnRMZWZ0IiwiY29tbWVudFJpZ2h0IiwiY2FwaXRhbGl6ZSIsInN0ciIsInRvVXBwZXJDYXNlIiwic2xpY2UiLCJTdHJpbmdpZmllciIsImJ1aWxkZXIiLCJzdHJpbmdpZnkiLCJub2RlIiwic2VtaWNvbG9uIiwidHlwZSIsInJvb3QiLCJib2R5IiwicmF3cyIsImNvbW1lbnQiLCJsZWZ0IiwicmF3IiwicmlnaHQiLCJ0ZXh0IiwiZGVjbCIsImJldHdlZW4iLCJzdHJpbmciLCJwcm9wIiwicmF3VmFsdW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W50ICkge1xuICAgICAgICAgICAgc3RyaW5nICs9IG5vZGUucmF3cy5pbXBvcnRhbnQgfHwgJyAhaW1wb3J0YW50JztcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICggc2VtaWNvbG9uICkgc3RyaW5nICs9ICc7JztcbiAgICAgICAgdGhpcy5idWlsZGVyKHN0cmluZywgbm9kZSk7XG4gICAgfVxuXG4gICAgcnVsZShub2RlKSB7XG4gICAgICAgIHRoaXMuYmxvY2sobm9kZSwgdGhpcy5yYXdWYWx1ZShub2RlLCAnc2VsZWN0b3InKSk7XG4gICAgfVxuXG4gICAgYXRydWxlKG5vZGUsIHNlbWljb2xvbikge1xuICAgICAgICBsZXQgbmFtZSAgID0gJ0AnICsgbm9kZS5uYW1lO1xuICAgICAgICBsZXQgcGFyYW1zID0gbm9kZS5wYXJhbXMgPyB0aGlzLnJhd1ZhbHVlKG5vZGUsICdwYXJhbXMnKSA6ICcnO1xuXG4gICAgICAgIGlmICggdHlwZW9mIG5vZGUucmF3cy5hZnRlck5hbWUgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgbmFtZSArPSBub2RlLnJhd3MuYWZ0ZXJOYW1lO1xuICAgICAgICB9IGVsc2UgaWYgKCBwYXJhbXMgKSB7XG4gICAgICAgICAgICBuYW1lICs9ICcgJztcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICggbm9kZS5ub2RlcyApIHtcbiAgICAgICAgICAgIHRoaXMuYmxvY2sobm9kZSwgbmFtZSArIHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBsZXQgZW5kID0gKG5vZGUucmF3cy5iZXR3ZWVuIHx8ICcnKSArIChzZW1pY29sb24gPyAnOycgOiAnJyk7XG4gICAgICAgICAgICB0aGlzLmJ1aWxkZXIobmFtZSArIHBhcmFtcyArIGVuZCwgbm9kZSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBib2R5KG5vZGUpIHtcbiAgICAgICAgbGV0IGxhc3QgPSBub2RlLm5vZGVzLmxlbmd0aCAtIDE7XG4gICAgICAgIHdoaWxlICggbGFzdCA+IDAgKSB7XG4gICAgICAgICAgICBpZiAoIG5vZGUubm9kZXNbbGFzdF0udHlwZSAhPT0gJ2NvbW1lbnQnICkgYnJlYWs7XG4gICAgICAgICAgICBsYXN0IC09IDE7XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgc2VtaWNvbG9uID0gdGhpcy5yYXcobm9kZSwgJ3NlbWljb2xvbicpO1xuICAgICAgICBmb3IgKCBsZXQgaSA9IDA7IGkgPCBub2RlLm5vZGVzLmxlbmd0aDsgaSsrICkge1xuICAgICAgICAgICAgbGV0IGNoaWxkICA9IG5vZGUubm9kZXNbaV07XG4gICAgICAgICAgICBsZXQgYmVmb3JlID0gdGhpcy5yYXcoY2hpbGQsICdiZWZvcmUnKTtcbiAgICAgICAgICAgIGlmICggYmVmb3JlICkgdGhpcy5idWlsZGVyKGJlZm9yZSk7XG4gICAgICAgICAgICB0aGlzLnN0cmluZ2lmeShjaGlsZCwgbGFzdCAhPT0gaSB8fCBzZW1pY29sb24pO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgYmxvY2sobm9kZSwgc3RhcnQpIHtcbiAgICAgICAgbGV0IGJldHdlZW4gPSB0aGlzLnJhdyhub2RlLCAnYmV0d2VlbicsICdiZWZvcmVPcGVuJyk7XG4gICAgICAgIHRoaXMuYnVpbGRlcihzdGFydCArIGJldHdlZW4gKyAneycsIG5vZGUsICdzdGFydCcpO1xuXG4gICAgICAgIGxldCBhZnRlcjtcbiAgICAgICAgaWYgKCBub2RlLm5vZGVzICYmIG5vZGUubm9kZXMubGVuZ3RoICkge1xuICAgICAgICAgICAgdGhpcy5ib2R5KG5vZGUpO1xuICAgICAgICAgICAgYWZ0ZXIgPSB0aGlzLnJhdyhub2RlLCAnYWZ0ZXInKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGFmdGVyID0gdGhpcy5yYXcobm9kZSwgJ2FmdGVyJywgJ2VtcHR5Qm9keScpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCBhZnRlciApIHRoaXMuYnVpbGRlcihhZnRlcik7XG4gICAgICAgIHRoaXMuYnVpbGRlcignfScsIG5vZGUsICdlbmQnKTtcbiAgICB9XG5cbiAgICByYXcobm9kZSwgb3duLCBkZXRlY3QpIHtcbiAgICAgICAgbGV0IHZhbHVlO1xuICAgICAgICBpZiAoICFkZXRlY3QgKSBkZXRlY3QgPSBvd247XG5cbiAgICAgICAgLy8gQWxyZWFkeSBoYWRcbiAgICAgICAgaWYgKCBvd24gKSB7XG4gICAgICAgICAgICB2YWx1ZSA9IG5vZGUucmF3c1tvd25dO1xuICAgICAgICAgICAgaWYgKCB0eXBlb2YgdmFsdWUgIT09ICd1bmRlZmluZWQnICkgcmV0dXJuIHZhbHVlO1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IHBhcmVudCA9IG5vZGUucGFyZW50O1xuXG4gICAgICAgIC8vIEhhY2sgZm9yIGZpcnN0IHJ1bGUgaW4gQ1NTXG4gICAgICAgIGlmICggZGV0ZWN0ID09PSAnYmVmb3JlJyApIHtcbiAgICAgICAgICAgIGlmICggIXBhcmVudCB8fCBwYXJlbnQudHlwZSA9PT0gJ3Jvb3QnICYmIHBhcmVudC5maXJzdCA9PT0gbm9kZSApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJyc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvLyBGbG9hdGluZyBjaGlsZCB3aXRob3V0IHBhcmVudFxuICAgICAgICBpZiAoICFwYXJlbnQgKSByZXR1cm4gZGVmYXVsdFJhd1tkZXRlY3RdO1xuXG4gICAgICAgIC8vIERldGVjdCBzdHlsZSBieSBvdGhlciBub2Rlc1xuICAgICAgICBsZXQgcm9vdCA9IG5vZGUucm9vdCgpO1xuICAgICAgICBpZiAoICFyb290LnJhd0NhY2hlICkgcm9vdC5yYXdDYWNoZSA9IHsgfTtcbiAgICAgICAgaWYgKCB0eXBlb2Ygcm9vdC5yYXdDYWNoZVtkZXRlY3RdICE9PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgIHJldHVybiByb290LnJhd0NhY2hlW2RldGVjdF07XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIGRldGVjdCA9PT0gJ2JlZm9yZScgfHwgZGV0ZWN0ID09PSAnYWZ0ZXInICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuYmVmb3JlQWZ0ZXIobm9kZSwgZGV0ZWN0KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGxldCBtZXRob2QgPSAncmF3JyArIGNhcGl0YWxpemUoZGV0ZWN0KTtcbiAgICAgICAgICAgIGlmICggdGhpc1ttZXRob2RdICkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gdGhpc1ttZXRob2RdKHJvb3QsIG5vZGUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByb290LndhbGsoIGkgPT4ge1xuICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IGkucmF3c1tvd25dO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIHR5cGVvZiB2YWx1ZSAhPT0gJ3VuZGVmaW5lZCcgKSByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIHR5cGVvZiB2YWx1ZSA9PT0gJ3VuZGVmaW5lZCcgKSB2YWx1ZSA9IGRlZmF1bHRSYXdbZGV0ZWN0XTtcblxuICAgICAgICByb290LnJhd0NhY2hlW2RldGVjdF0gPSB2YWx1ZTtcbiAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cblxuICAgIHJhd1NlbWljb2xvbihyb290KSB7XG4gICAgICAgIGxldCB2YWx1ZTtcbiAgICAgICAgcm9vdC53YWxrKCBpID0+IHtcbiAgICAgICAgICAgIGlmICggaS5ub2RlcyAmJiBpLm5vZGVzLmxlbmd0aCAmJiBpLmxhc3QudHlwZSA9PT0gJ2RlY2wnICkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLnNlbWljb2xvbjtcbiAgICAgICAgICAgICAgICBpZiAoIHR5cGVvZiB2YWx1ZSAhPT0gJ3VuZGVmaW5lZCcgKSByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuXG4gICAgcmF3RW1wdHlCb2R5KHJvb3QpIHtcbiAgICAgICAgbGV0IHZhbHVlO1xuICAgICAgICByb290LndhbGsoIGkgPT4ge1xuICAgICAgICAgICAgaWYgKCBpLm5vZGVzICYmIGkubm9kZXMubGVuZ3RoID09PSAwICkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLmFmdGVyO1xuICAgICAgICAgICAgICAgIGlmICggdHlwZW9mIHZhbHVlICE9PSAndW5kZWZpbmVkJyApIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICByYXdJbmRlbnQocm9vdCkge1xuICAgICAgICBpZiAoIHJvb3QucmF3cy5pbmRlbnQgKSByZXR1cm4gcm9vdC5yYXdzLmluZGVudDtcbiAgICAgICAgbGV0IHZhbHVlO1xuICAgICAgICByb290LndhbGsoIGkgPT4ge1xuICAgICAgICAgICAgbGV0IHAgPSBpLnBhcmVudDtcbiAgICAgICAgICAgIGlmICggcCAmJiBwICE9PSByb290ICYmIHAucGFyZW50ICYmIHAucGFyZW50ID09PSByb290ICkge1xuICAgICAgICAgICAgICAgIGlmICggdHlwZW9mIGkucmF3cy5iZWZvcmUgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgcGFydHMgPSBpLnJhd3MuYmVmb3JlLnNwbGl0KCdcXG4nKTtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBwYXJ0c1twYXJ0cy5sZW5ndGggLSAxXTtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZS5yZXBsYWNlKC9bXlxcc10vZywgJycpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cblxuICAgIHJhd0JlZm9yZUNvbW1lbnQocm9vdCwgbm9kZSkge1xuICAgICAgICBsZXQgdmFsdWU7XG4gICAgICAgIHJvb3Qud2Fsa0NvbW1lbnRzKCBpID0+IHtcbiAgICAgICAgICAgIGlmICggdHlwZW9mIGkucmF3cy5iZWZvcmUgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLmJlZm9yZTtcbiAgICAgICAgICAgICAgICBpZiAoIHZhbHVlLmluZGV4T2YoJ1xcbicpICE9PSAtMSApIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZS5yZXBsYWNlKC9bXlxcbl0rJC8sICcnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgaWYgKCB0eXBlb2YgdmFsdWUgPT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgdmFsdWUgPSB0aGlzLnJhdyhub2RlLCBudWxsLCAnYmVmb3JlRGVjbCcpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICByYXdCZWZvcmVEZWNsKHJvb3QsIG5vZGUpIHtcbiAgICAgICAgbGV0IHZhbHVlO1xuICAgICAgICByb290LndhbGtEZWNscyggaSA9PiB7XG4gICAgICAgICAgICBpZiAoIHR5cGVvZiBpLnJhd3MuYmVmb3JlICE9PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGkucmF3cy5iZWZvcmU7XG4gICAgICAgICAgICAgICAgaWYgKCB2YWx1ZS5pbmRleE9mKCdcXG4nKSAhPT0gLTEgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gdmFsdWUucmVwbGFjZSgvW15cXG5dKyQvLCAnJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIGlmICggdHlwZW9mIHZhbHVlID09PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgIHZhbHVlID0gdGhpcy5yYXcobm9kZSwgbnVsbCwgJ2JlZm9yZVJ1bGUnKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuXG4gICAgcmF3QmVmb3JlUnVsZShyb290KSB7XG4gICAgICAgIGxldCB2YWx1ZTtcbiAgICAgICAgcm9vdC53YWxrKCBpID0+IHtcbiAgICAgICAgICAgIGlmICggaS5ub2RlcyAmJiAoaS5wYXJlbnQgIT09IHJvb3QgfHwgcm9vdC5maXJzdCAhPT0gaSkgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCB0eXBlb2YgaS5yYXdzLmJlZm9yZSAhPT0gJ3VuZGVmaW5lZCcgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLmJlZm9yZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCB2YWx1ZS5pbmRleE9mKCdcXG4nKSAhPT0gLTEgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHZhbHVlLnJlcGxhY2UoL1teXFxuXSskLywgJycpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuXG4gICAgcmF3QmVmb3JlQ2xvc2Uocm9vdCkge1xuICAgICAgICBsZXQgdmFsdWU7XG4gICAgICAgIHJvb3Qud2FsayggaSA9PiB7XG4gICAgICAgICAgICBpZiAoIGkubm9kZXMgJiYgaS5ub2Rlcy5sZW5ndGggPiAwICkge1xuICAgICAgICAgICAgICAgIGlmICggdHlwZW9mIGkucmF3cy5hZnRlciAhPT0gJ3VuZGVmaW5lZCcgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLmFmdGVyO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIHZhbHVlLmluZGV4T2YoJ1xcbicpICE9PSAtMSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gdmFsdWUucmVwbGFjZSgvW15cXG5dKyQvLCAnJyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICByYXdCZWZvcmVPcGVuKHJvb3QpIHtcbiAgICAgICAgbGV0IHZhbHVlO1xuICAgICAgICByb290LndhbGsoIGkgPT4ge1xuICAgICAgICAgICAgaWYgKCBpLnR5cGUgIT09ICdkZWNsJyApIHtcbiAgICAgICAgICAgICAgICB2YWx1ZSA9IGkucmF3cy5iZXR3ZWVuO1xuICAgICAgICAgICAgICAgIGlmICggdHlwZW9mIHZhbHVlICE9PSAndW5kZWZpbmVkJyApIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICByYXdDb2xvbihyb290KSB7XG4gICAgICAgIGxldCB2YWx1ZTtcbiAgICAgICAgcm9vdC53YWxrRGVjbHMoIGkgPT4ge1xuICAgICAgICAgICAgaWYgKCB0eXBlb2YgaS5yYXdzLmJldHdlZW4gIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgICAgIHZhbHVlID0gaS5yYXdzLmJldHdlZW4ucmVwbGFjZSgvW15cXHM6XS9nLCAnJyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cblxuICAgIGJlZm9yZUFmdGVyKG5vZGUsIGRldGVjdCkge1xuICAgICAgICBsZXQgdmFsdWU7XG4gICAgICAgIGlmICggbm9kZS50eXBlID09PSAnZGVjbCcgKSB7XG4gICAgICAgICAgICB2YWx1ZSA9IHRoaXMucmF3KG5vZGUsIG51bGwsICdiZWZvcmVEZWNsJyk7XG4gICAgICAgIH0gZWxzZSBpZiAoIG5vZGUudHlwZSA9PT0gJ2NvbW1lbnQnICkge1xuICAgICAgICAgICAgdmFsdWUgPSB0aGlzLnJhdyhub2RlLCBudWxsLCAnYmVmb3JlQ29tbWVudCcpO1xuICAgICAgICB9IGVsc2UgaWYgKCBkZXRlY3QgPT09ICdiZWZvcmUnICkge1xuICAgICAgICAgICAgdmFsdWUgPSB0aGlzLnJhdyhub2RlLCBudWxsLCAnYmVmb3JlUnVsZScpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFsdWUgPSB0aGlzLnJhdyhub2RlLCBudWxsLCAnYmVmb3JlQ2xvc2UnKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCBidWYgICA9IG5vZGUucGFyZW50O1xuICAgICAgICBsZXQgZGVwdGggPSAwO1xuICAgICAgICB3aGlsZSAoIGJ1ZiAmJiBidWYudHlwZSAhPT0gJ3Jvb3QnICkge1xuICAgICAgICAgICAgZGVwdGggKz0gMTtcbiAgICAgICAgICAgIGJ1ZiA9IGJ1Zi5wYXJlbnQ7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIHZhbHVlLmluZGV4T2YoJ1xcbicpICE9PSAtMSApIHtcbiAgICAgICAgICAgIGxldCBpbmRlbnQgPSB0aGlzLnJhdyhub2RlLCBudWxsLCAnaW5kZW50Jyk7XG4gICAgICAgICAgICBpZiAoIGluZGVudC5sZW5ndGggKSB7XG4gICAgICAgICAgICAgICAgZm9yICggbGV0IHN0ZXAgPSAwOyBzdGVwIDwgZGVwdGg7IHN0ZXArKyApIHZhbHVlICs9IGluZGVudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG5cbiAgICByYXdWYWx1ZShub2RlLCBwcm9wKSB7XG4gICAgICAgIGxldCB2YWx1ZSA9IG5vZGVbcHJvcF07XG4gICAgICAgIGxldCByYXcgICA9IG5vZGUucmF3c1twcm9wXTtcbiAgICAgICAgaWYgKCByYXcgJiYgcmF3LnZhbHVlID09PSB2YWx1ZSApIHtcbiAgICAgICAgICAgIHJldHVybiByYXcucmF3O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICB9XG4gICAgfVxuXG59XG5cbmV4cG9ydCBkZWZhdWx0IFN0cmluZ2lmaWVyO1xuIl19
  7890. /***/ }),
  7891. /* 30 */
  7892. /***/ (function(module, exports) {
  7893. var g;
  7894. // This works in non-strict mode
  7895. g = (function() {
  7896. return this;
  7897. })();
  7898. try {
  7899. // This works if eval is allowed (see CSP)
  7900. g = g || Function("return this")() || (1,eval)("this");
  7901. } catch(e) {
  7902. // This works if the window reference is available
  7903. if(typeof window === "object")
  7904. g = window;
  7905. }
  7906. // g can still be undefined, but nothing to do about it...
  7907. // We return undefined, instead of nothing here, so it's
  7908. // easier to handle this case. if(!global) { ...}
  7909. module.exports = g;
  7910. /***/ }),
  7911. /* 31 */
  7912. /***/ (function(module, exports, __webpack_require__) {
  7913. "use strict";
  7914. Object.defineProperty(exports, "__esModule", {
  7915. value: true
  7916. });
  7917. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7918. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  7919. var _comment = __webpack_require__(24);
  7920. var _comment2 = _interopRequireDefault(_comment);
  7921. var _import2 = __webpack_require__(105);
  7922. var _import3 = _interopRequireDefault(_import2);
  7923. var _parser = __webpack_require__(79);
  7924. var _parser2 = _interopRequireDefault(_parser);
  7925. var _rule = __webpack_require__(111);
  7926. var _rule2 = _interopRequireDefault(_rule);
  7927. var _root = __webpack_require__(110);
  7928. var _root2 = _interopRequireDefault(_root);
  7929. var _findExtendRule = __webpack_require__(104);
  7930. var _findExtendRule2 = _interopRequireDefault(_findExtendRule);
  7931. var _isMixinToken = __webpack_require__(106);
  7932. var _isMixinToken2 = _interopRequireDefault(_isMixinToken);
  7933. var _lessTokenize = __webpack_require__(109);
  7934. var _lessTokenize2 = _interopRequireDefault(_lessTokenize);
  7935. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  7936. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7937. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  7938. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  7939. var blockCommentEndPattern = /\*\/$/;
  7940. var LessParser = function (_Parser) {
  7941. _inherits(LessParser, _Parser);
  7942. function LessParser(input) {
  7943. _classCallCheck(this, LessParser);
  7944. var _this = _possibleConstructorReturn(this, (LessParser.__proto__ || Object.getPrototypeOf(LessParser)).call(this, input));
  7945. _this.root = new _root2.default();
  7946. _this.current = _this.root;
  7947. _this.root.source = { input: input, start: { line: 1, column: 1 } };
  7948. return _this;
  7949. }
  7950. _createClass(LessParser, [{
  7951. key: 'atrule',
  7952. value: function atrule(token) {
  7953. if (token[1] === '@import') {
  7954. this.import(token);
  7955. } else {
  7956. _get(LessParser.prototype.__proto__ || Object.getPrototypeOf(LessParser.prototype), 'atrule', this).call(this, token);
  7957. }
  7958. }
  7959. }, {
  7960. key: 'comment',
  7961. value: function comment(token) {
  7962. var node = new _comment2.default();
  7963. var content = token[1];
  7964. var text = content.slice(2).replace(blockCommentEndPattern, '');
  7965. this.init(node, token[2], token[3]);
  7966. node.source.end = {
  7967. line: token[4],
  7968. column: token[5]
  7969. };
  7970. node.raws.content = content;
  7971. node.raws.begin = content[0] + content[1];
  7972. node.inline = token[6] === 'inline';
  7973. node.block = !node.inline;
  7974. if (/^\s*$/.test(text)) {
  7975. node.text = '';
  7976. node.raws.left = text;
  7977. node.raws.right = '';
  7978. } else {
  7979. var match = text.match(/^(\s*)([^]*[^\s])(\s*)$/);
  7980. node.text = match[2];
  7981. // Add extra spaces to generate a comment in a common style /*[space][text][space]*/
  7982. node.raws.left = match[1] || ' ';
  7983. node.raws.right = match[3] || ' ';
  7984. }
  7985. }
  7986. /**
  7987. * @description Create a Declaration
  7988. * @param options {{start: number}}
  7989. */
  7990. }, {
  7991. key: 'createDeclaration',
  7992. value: function createDeclaration(options) {
  7993. this.decl(this.tokens.slice(options.start, this.pos + 1));
  7994. }
  7995. /**
  7996. * @description Create a Rule node
  7997. * @param options {{start: number, params: Array}}
  7998. */
  7999. }, {
  8000. key: 'createRule',
  8001. value: function createRule(options) {
  8002. var semi = this.tokens[this.pos][0] === ';';
  8003. var end = this.pos + (options.empty && semi ? 2 : 1);
  8004. var tokens = this.tokens.slice(options.start, end);
  8005. var node = this.rule(tokens);
  8006. /**
  8007. * By default in PostCSS `Rule.params` is `undefined`.
  8008. * To preserve compability with PostCSS:
  8009. * - Don't set empty params for a Rule.
  8010. * - Set params for a Rule only if it can be a mixin or &:extend rule.
  8011. */
  8012. if (options.params[0] && (options.mixin || options.extend)) {
  8013. this.raw(node, 'params', options.params);
  8014. }
  8015. if (options.empty) {
  8016. // if it's an empty mixin or extend, it must have a semicolon
  8017. // (that's the only way we get to this point)
  8018. if (semi) {
  8019. node.raws.semicolon = this.semicolon = true;
  8020. node.selector = node.selector.replace(/;$/, '');
  8021. }
  8022. if (options.extend) {
  8023. node.extend = true;
  8024. }
  8025. if (options.mixin) {
  8026. node.mixin = true;
  8027. }
  8028. /**
  8029. * @description Mark mixin without declarations.
  8030. * @type {boolean}
  8031. */
  8032. node.empty = true;
  8033. // eslint-disable-next-line
  8034. delete this.current.nodes;
  8035. if (/!\s*important/i.test(node.selector)) {
  8036. node.important = true;
  8037. if (/\s*!\s*important/i.test(node.selector)) {
  8038. node.raws.important = node.selector.match(/(\s*!\s*important)/i)[1];
  8039. }
  8040. node.selector = node.selector.replace(/\s*!\s*important/i, '');
  8041. }
  8042. // rules don't have trailing semicolons in vanilla css, so they get
  8043. // added to this.spaces by the parser loop, so don't step back.
  8044. if (!semi) {
  8045. this.pos--;
  8046. }
  8047. this.end(this.tokens[this.pos]);
  8048. }
  8049. }
  8050. }, {
  8051. key: 'end',
  8052. value: function end(token) {
  8053. var node = this.current;
  8054. // if a Rule contains other Rules (mixins, extends) and those have
  8055. // semicolons, assert that the parent Rule has a semicolon
  8056. if (node.nodes && node.nodes.length && node.last.raws.semicolon && !node.last.nodes) {
  8057. this.semicolon = true;
  8058. }
  8059. _get(LessParser.prototype.__proto__ || Object.getPrototypeOf(LessParser.prototype), 'end', this).call(this, token);
  8060. }
  8061. }, {
  8062. key: 'import',
  8063. value: function _import(token) {
  8064. /* eslint complexity: 0 */
  8065. var last = false,
  8066. open = false,
  8067. end = { line: 0, column: 0 };
  8068. var directives = [];
  8069. var node = new _import3.default();
  8070. node.name = token[1].slice(1);
  8071. this.init(node, token[2], token[3]);
  8072. this.pos += 1;
  8073. while (this.pos < this.tokens.length) {
  8074. var tokn = this.tokens[this.pos];
  8075. if (tokn[0] === ';') {
  8076. end = { line: tokn[2], column: tokn[3] };
  8077. node.raws.semicolon = true;
  8078. break;
  8079. } else if (tokn[0] === '{') {
  8080. open = true;
  8081. break;
  8082. } else if (tokn[0] === '}') {
  8083. this.end(tokn);
  8084. break;
  8085. } else if (tokn[0] === 'brackets') {
  8086. if (node.urlFunc) {
  8087. node.importPath = tokn[1].replace(/[()]/g, '');
  8088. } else {
  8089. directives.push(tokn);
  8090. }
  8091. } else if (tokn[0] === 'space') {
  8092. if (directives.length) {
  8093. node.raws.between = tokn[1];
  8094. } else if (node.urlFunc) {
  8095. node.raws.beforeUrl = tokn[1];
  8096. } else if (node.importPath) {
  8097. if (node.urlFunc) {
  8098. node.raws.afterUrl = tokn[1];
  8099. } else {
  8100. node.raws.after = tokn[1];
  8101. }
  8102. } else {
  8103. node.raws.afterName = tokn[1];
  8104. }
  8105. } else if (tokn[0] === 'word' && tokn[1] === 'url') {
  8106. node.urlFunc = true;
  8107. } else {
  8108. if (tokn[0] !== '(' && tokn[0] !== ')') {
  8109. node.importPath = tokn[1];
  8110. }
  8111. }
  8112. if (this.pos === this.tokens.length) {
  8113. last = true;
  8114. break;
  8115. }
  8116. this.pos += 1;
  8117. }
  8118. if (node.raws.between && !node.raws.afterName) {
  8119. node.raws.afterName = node.raws.between;
  8120. node.raws.between = '';
  8121. }
  8122. node.source.end = end;
  8123. if (directives.length) {
  8124. this.raw(node, 'directives', directives);
  8125. if (last) {
  8126. token = directives[directives.length - 1];
  8127. node.source.end = { line: token[4], column: token[5] };
  8128. this.spaces = node.raws.between;
  8129. node.raws.between = '';
  8130. }
  8131. } else {
  8132. node.directives = '';
  8133. }
  8134. if (open) {
  8135. node.nodes = [];
  8136. this.current = node;
  8137. }
  8138. }
  8139. /* eslint-disable max-statements, complexity */
  8140. }, {
  8141. key: 'other',
  8142. value: function other() {
  8143. var brackets = [];
  8144. var params = [];
  8145. var start = this.pos;
  8146. var end = false,
  8147. colon = false,
  8148. bracket = null;
  8149. // we need pass "()" as spaces
  8150. // However we can override method Parser.loop, but it seems less maintainable
  8151. if (this.tokens[start][0] === 'brackets') {
  8152. this.spaces += this.tokens[start][1];
  8153. return;
  8154. }
  8155. var mixin = (0, _isMixinToken2.default)(this.tokens[start]);
  8156. var extend = Boolean((0, _findExtendRule2.default)(this.tokens, start));
  8157. while (this.pos < this.tokens.length) {
  8158. var token = this.tokens[this.pos];
  8159. var type = token[0];
  8160. if (type === '(' || type === '[') {
  8161. if (!bracket) {
  8162. bracket = token;
  8163. }
  8164. brackets.push(type === '(' ? ')' : ']');
  8165. } else if (brackets.length === 0) {
  8166. if (type === ';') {
  8167. var foundEndOfRule = this.ruleEnd({
  8168. start: start,
  8169. params: params,
  8170. colon: colon,
  8171. mixin: mixin,
  8172. extend: extend
  8173. });
  8174. if (foundEndOfRule) {
  8175. return;
  8176. }
  8177. break;
  8178. } else if (type === '{') {
  8179. this.createRule({ start: start, params: params, mixin: mixin });
  8180. return;
  8181. } else if (type === '}') {
  8182. this.pos -= 1;
  8183. end = true;
  8184. break;
  8185. } else if (type === ':') {
  8186. colon = true;
  8187. }
  8188. } else if (type === brackets[brackets.length - 1]) {
  8189. brackets.pop();
  8190. if (brackets.length === 0) {
  8191. bracket = null;
  8192. }
  8193. }
  8194. // we don't want to add params for pseudo-selectors that utilize parens (#56)
  8195. // if ((extend || !colon) && (brackets.length > 0 || type === 'brackets' || params[0])) {
  8196. // params.push(token);
  8197. // }
  8198. // we don't want to add params for pseudo-selectors that utilize parens (#56) or bracket selectors (#96)
  8199. if ((extend || !colon) && (brackets.length > 0 || type === 'brackets' || params[0]) && brackets[0] !== ']') {
  8200. params.push(token);
  8201. }
  8202. this.pos += 1;
  8203. }
  8204. if (this.pos === this.tokens.length) {
  8205. this.pos -= 1;
  8206. end = true;
  8207. }
  8208. if (brackets.length > 0) {
  8209. this.unclosedBracket(bracket);
  8210. }
  8211. // dont process an end of rule if there's only one token and it's unknown (#64)
  8212. if (end && this.tokens.length > 1) {
  8213. // Handle the case where the there is only a single token in the end rule.
  8214. if (start === this.pos) {
  8215. this.pos += 1;
  8216. }
  8217. var _foundEndOfRule = this.ruleEnd({
  8218. start: start,
  8219. params: params,
  8220. colon: colon,
  8221. mixin: mixin,
  8222. extend: extend,
  8223. isEndOfBlock: true
  8224. });
  8225. if (_foundEndOfRule) {
  8226. return;
  8227. }
  8228. }
  8229. this.unknownWord(start);
  8230. }
  8231. }, {
  8232. key: 'rule',
  8233. value: function rule(tokens) {
  8234. tokens.pop();
  8235. var node = new _rule2.default();
  8236. this.init(node, tokens[0][2], tokens[0][3]);
  8237. //node.raws.between = this.spacesFromEnd(tokens);
  8238. node.raws.between = this.spacesAndCommentsFromEnd(tokens);
  8239. this.raw(node, 'selector', tokens);
  8240. this.current = node;
  8241. return node;
  8242. }
  8243. }, {
  8244. key: 'ruleEnd',
  8245. value: function ruleEnd(options) {
  8246. var start = options.start;
  8247. if (options.extend || options.mixin) {
  8248. this.createRule(Object.assign(options, { empty: true }));
  8249. return true;
  8250. }
  8251. if (options.colon) {
  8252. if (options.isEndOfBlock) {
  8253. while (this.pos > start) {
  8254. var token = this.tokens[this.pos][0];
  8255. if (token !== 'space' && token !== 'comment') {
  8256. break;
  8257. }
  8258. this.pos -= 1;
  8259. }
  8260. }
  8261. this.createDeclaration({ start: start });
  8262. return true;
  8263. }
  8264. return false;
  8265. }
  8266. }, {
  8267. key: 'tokenize',
  8268. value: function tokenize() {
  8269. this.tokens = (0, _lessTokenize2.default)(this.input);
  8270. }
  8271. /* eslint-enable max-statements, complexity */
  8272. }]);
  8273. return LessParser;
  8274. }(_parser2.default);
  8275. exports.default = LessParser;
  8276. module.exports = exports['default'];
  8277. /***/ }),
  8278. /* 32 */
  8279. /***/ (function(module, exports, __webpack_require__) {
  8280. "use strict";
  8281. module.exports = function () {
  8282. return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g;
  8283. };
  8284. /***/ }),
  8285. /* 33 */
  8286. /***/ (function(module, exports) {
  8287. module.exports = function flatten(list, depth) {
  8288. depth = (typeof depth == 'number') ? depth : Infinity;
  8289. if (!depth) {
  8290. if (Array.isArray(list)) {
  8291. return list.map(function(i) { return i; });
  8292. }
  8293. return list;
  8294. }
  8295. return _flatten(list, 1);
  8296. function _flatten(list, d) {
  8297. return list.reduce(function (acc, item) {
  8298. if (Array.isArray(item) && d < depth) {
  8299. return acc.concat(_flatten(item, d + 1));
  8300. }
  8301. else {
  8302. return acc.concat(item);
  8303. }
  8304. }, []);
  8305. }
  8306. };
  8307. /***/ }),
  8308. /* 34 */
  8309. /***/ (function(module, exports) {
  8310. module.exports = function (ary, item) {
  8311. var i = -1, indexes = []
  8312. while((i = ary.indexOf(item, i + 1)) !== -1)
  8313. indexes.push(i)
  8314. return indexes
  8315. }
  8316. /***/ }),
  8317. /* 35 */
  8318. /***/ (function(module, exports, __webpack_require__) {
  8319. /* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
  8320. * $Id: base64.js,v 2.15 2014/04/05 12:58:57 dankogai Exp dankogai $
  8321. *
  8322. * Licensed under the BSD 3-Clause License.
  8323. * http://opensource.org/licenses/BSD-3-Clause
  8324. *
  8325. * References:
  8326. * http://en.wikipedia.org/wiki/Base64
  8327. */
  8328. (function(global) {
  8329. 'use strict';
  8330. // existing version for noConflict()
  8331. var _Base64 = global.Base64;
  8332. var version = "2.3.2";
  8333. // if node.js, we use Buffer
  8334. var buffer;
  8335. if (typeof module !== 'undefined' && module.exports) {
  8336. try {
  8337. buffer = __webpack_require__(15).Buffer;
  8338. } catch (err) {}
  8339. }
  8340. // constants
  8341. var b64chars
  8342. = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  8343. var b64tab = function(bin) {
  8344. var t = {};
  8345. for (var i = 0, l = bin.length; i < l; i++) t[bin.charAt(i)] = i;
  8346. return t;
  8347. }(b64chars);
  8348. var fromCharCode = String.fromCharCode;
  8349. // encoder stuff
  8350. var cb_utob = function(c) {
  8351. if (c.length < 2) {
  8352. var cc = c.charCodeAt(0);
  8353. return cc < 0x80 ? c
  8354. : cc < 0x800 ? (fromCharCode(0xc0 | (cc >>> 6))
  8355. + fromCharCode(0x80 | (cc & 0x3f)))
  8356. : (fromCharCode(0xe0 | ((cc >>> 12) & 0x0f))
  8357. + fromCharCode(0x80 | ((cc >>> 6) & 0x3f))
  8358. + fromCharCode(0x80 | ( cc & 0x3f)));
  8359. } else {
  8360. var cc = 0x10000
  8361. + (c.charCodeAt(0) - 0xD800) * 0x400
  8362. + (c.charCodeAt(1) - 0xDC00);
  8363. return (fromCharCode(0xf0 | ((cc >>> 18) & 0x07))
  8364. + fromCharCode(0x80 | ((cc >>> 12) & 0x3f))
  8365. + fromCharCode(0x80 | ((cc >>> 6) & 0x3f))
  8366. + fromCharCode(0x80 | ( cc & 0x3f)));
  8367. }
  8368. };
  8369. var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
  8370. var utob = function(u) {
  8371. return u.replace(re_utob, cb_utob);
  8372. };
  8373. var cb_encode = function(ccc) {
  8374. var padlen = [0, 2, 1][ccc.length % 3],
  8375. ord = ccc.charCodeAt(0) << 16
  8376. | ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8)
  8377. | ((ccc.length > 2 ? ccc.charCodeAt(2) : 0)),
  8378. chars = [
  8379. b64chars.charAt( ord >>> 18),
  8380. b64chars.charAt((ord >>> 12) & 63),
  8381. padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63),
  8382. padlen >= 1 ? '=' : b64chars.charAt(ord & 63)
  8383. ];
  8384. return chars.join('');
  8385. };
  8386. var btoa = global.btoa ? function(b) {
  8387. return global.btoa(b);
  8388. } : function(b) {
  8389. return b.replace(/[\s\S]{1,3}/g, cb_encode);
  8390. };
  8391. var _encode = buffer ?
  8392. buffer.from && buffer.from !== Uint8Array.from ? function (u) {
  8393. return (u.constructor === buffer.constructor ? u : buffer.from(u))
  8394. .toString('base64')
  8395. }
  8396. : function (u) {
  8397. return (u.constructor === buffer.constructor ? u : new buffer(u))
  8398. .toString('base64')
  8399. }
  8400. : function (u) { return btoa(utob(u)) }
  8401. ;
  8402. var encode = function(u, urisafe) {
  8403. return !urisafe
  8404. ? _encode(String(u))
  8405. : _encode(String(u)).replace(/[+\/]/g, function(m0) {
  8406. return m0 == '+' ? '-' : '_';
  8407. }).replace(/=/g, '');
  8408. };
  8409. var encodeURI = function(u) { return encode(u, true) };
  8410. // decoder stuff
  8411. var re_btou = new RegExp([
  8412. '[\xC0-\xDF][\x80-\xBF]',
  8413. '[\xE0-\xEF][\x80-\xBF]{2}',
  8414. '[\xF0-\xF7][\x80-\xBF]{3}'
  8415. ].join('|'), 'g');
  8416. var cb_btou = function(cccc) {
  8417. switch(cccc.length) {
  8418. case 4:
  8419. var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
  8420. | ((0x3f & cccc.charCodeAt(1)) << 12)
  8421. | ((0x3f & cccc.charCodeAt(2)) << 6)
  8422. | (0x3f & cccc.charCodeAt(3)),
  8423. offset = cp - 0x10000;
  8424. return (fromCharCode((offset >>> 10) + 0xD800)
  8425. + fromCharCode((offset & 0x3FF) + 0xDC00));
  8426. case 3:
  8427. return fromCharCode(
  8428. ((0x0f & cccc.charCodeAt(0)) << 12)
  8429. | ((0x3f & cccc.charCodeAt(1)) << 6)
  8430. | (0x3f & cccc.charCodeAt(2))
  8431. );
  8432. default:
  8433. return fromCharCode(
  8434. ((0x1f & cccc.charCodeAt(0)) << 6)
  8435. | (0x3f & cccc.charCodeAt(1))
  8436. );
  8437. }
  8438. };
  8439. var btou = function(b) {
  8440. return b.replace(re_btou, cb_btou);
  8441. };
  8442. var cb_decode = function(cccc) {
  8443. var len = cccc.length,
  8444. padlen = len % 4,
  8445. n = (len > 0 ? b64tab[cccc.charAt(0)] << 18 : 0)
  8446. | (len > 1 ? b64tab[cccc.charAt(1)] << 12 : 0)
  8447. | (len > 2 ? b64tab[cccc.charAt(2)] << 6 : 0)
  8448. | (len > 3 ? b64tab[cccc.charAt(3)] : 0),
  8449. chars = [
  8450. fromCharCode( n >>> 16),
  8451. fromCharCode((n >>> 8) & 0xff),
  8452. fromCharCode( n & 0xff)
  8453. ];
  8454. chars.length -= [0, 0, 2, 1][padlen];
  8455. return chars.join('');
  8456. };
  8457. var atob = global.atob ? function(a) {
  8458. return global.atob(a);
  8459. } : function(a){
  8460. return a.replace(/[\s\S]{1,4}/g, cb_decode);
  8461. };
  8462. var _decode = buffer ?
  8463. buffer.from && buffer.from !== Uint8Array.from ? function(a) {
  8464. return (a.constructor === buffer.constructor
  8465. ? a : buffer.from(a, 'base64')).toString();
  8466. }
  8467. : function(a) {
  8468. return (a.constructor === buffer.constructor
  8469. ? a : new buffer(a, 'base64')).toString();
  8470. }
  8471. : function(a) { return btou(atob(a)) };
  8472. var decode = function(a){
  8473. return _decode(
  8474. String(a).replace(/[-_]/g, function(m0) { return m0 == '-' ? '+' : '/' })
  8475. .replace(/[^A-Za-z0-9\+\/]/g, '')
  8476. );
  8477. };
  8478. var noConflict = function() {
  8479. var Base64 = global.Base64;
  8480. global.Base64 = _Base64;
  8481. return Base64;
  8482. };
  8483. // export Base64
  8484. global.Base64 = {
  8485. VERSION: version,
  8486. atob: atob,
  8487. btoa: btoa,
  8488. fromBase64: decode,
  8489. toBase64: encode,
  8490. utob: utob,
  8491. encode: encode,
  8492. encodeURI: encodeURI,
  8493. btou: btou,
  8494. decode: decode,
  8495. noConflict: noConflict
  8496. };
  8497. // if ES5 is available, make Base64.extendString() available
  8498. if (typeof Object.defineProperty === 'function') {
  8499. var noEnum = function(v){
  8500. return {value:v,enumerable:false,writable:true,configurable:true};
  8501. };
  8502. global.Base64.extendString = function () {
  8503. Object.defineProperty(
  8504. String.prototype, 'fromBase64', noEnum(function () {
  8505. return decode(this)
  8506. }));
  8507. Object.defineProperty(
  8508. String.prototype, 'toBase64', noEnum(function (urisafe) {
  8509. return encode(this, urisafe)
  8510. }));
  8511. Object.defineProperty(
  8512. String.prototype, 'toBase64URI', noEnum(function () {
  8513. return encode(this, true)
  8514. }));
  8515. };
  8516. }
  8517. //
  8518. // export Base64 to the namespace
  8519. //
  8520. if (global['Meteor']) { // Meteor.js
  8521. Base64 = global.Base64;
  8522. }
  8523. // module.exports and AMD are mutually exclusive.
  8524. // module.exports has precedence.
  8525. if (typeof module !== 'undefined' && module.exports) {
  8526. module.exports.Base64 = global.Base64;
  8527. }
  8528. else if (true) {
  8529. // AMD. Register as an anonymous module.
  8530. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function(){ return global.Base64 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  8531. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  8532. }
  8533. // that's it!
  8534. })( typeof self !== 'undefined' ? self
  8535. : typeof window !== 'undefined' ? window
  8536. : typeof global !== 'undefined' ? global
  8537. : this
  8538. );
  8539. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(30)))
  8540. /***/ }),
  8541. /* 36 */
  8542. /***/ (function(module, exports, __webpack_require__) {
  8543. "use strict";
  8544. Object.defineProperty(exports, "__esModule", {
  8545. value: true
  8546. });
  8547. var _Node = __webpack_require__(37);
  8548. var _Node2 = _interopRequireDefault(_Node);
  8549. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8550. function Container(opts) {
  8551. var _this = this;
  8552. this.constructor(opts);
  8553. this.nodes = opts.nodes;
  8554. if (this.after === undefined) {
  8555. this.after = this.nodes.length > 0 ? this.nodes[this.nodes.length - 1].after : '';
  8556. }
  8557. if (this.before === undefined) {
  8558. this.before = this.nodes.length > 0 ? this.nodes[0].before : '';
  8559. }
  8560. if (this.sourceIndex === undefined) {
  8561. this.sourceIndex = this.before.length;
  8562. }
  8563. this.nodes.forEach(function (node) {
  8564. node.parent = _this; // eslint-disable-line no-param-reassign
  8565. });
  8566. } /**
  8567. * A node that contains other nodes and support traversing over them
  8568. */
  8569. Container.prototype = Object.create(_Node2.default.prototype);
  8570. Container.constructor = _Node2.default;
  8571. /**
  8572. * Iterate over descendant nodes of the node
  8573. *
  8574. * @param {RegExp|string} filter - Optional. Only nodes with node.type that
  8575. * satisfies the filter will be traversed over
  8576. * @param {function} cb - callback to call on each node. Takes theese params:
  8577. * node - the node being processed, i - it's index, nodes - the array
  8578. * of all nodes
  8579. * If false is returned, the iteration breaks
  8580. *
  8581. * @return (boolean) false, if the iteration was broken
  8582. */
  8583. Container.prototype.walk = function walk(filter, cb) {
  8584. var hasFilter = typeof filter === 'string' || filter instanceof RegExp;
  8585. var callback = hasFilter ? cb : filter;
  8586. var filterReg = typeof filter === 'string' ? new RegExp(filter) : filter;
  8587. for (var i = 0; i < this.nodes.length; i++) {
  8588. var node = this.nodes[i];
  8589. var filtered = hasFilter ? filterReg.test(node.type) : true;
  8590. if (filtered && callback && callback(node, i, this.nodes) === false) {
  8591. return false;
  8592. }
  8593. if (node.nodes && node.walk(filter, cb) === false) {
  8594. return false;
  8595. }
  8596. }
  8597. return true;
  8598. };
  8599. /**
  8600. * Iterate over immediate children of the node
  8601. *
  8602. * @param {function} cb - callback to call on each node. Takes theese params:
  8603. * node - the node being processed, i - it's index, nodes - the array
  8604. * of all nodes
  8605. * If false is returned, the iteration breaks
  8606. *
  8607. * @return (boolean) false, if the iteration was broken
  8608. */
  8609. Container.prototype.each = function each() {
  8610. var cb = arguments.length <= 0 || arguments[0] === undefined ? function () {} : arguments[0];
  8611. for (var i = 0; i < this.nodes.length; i++) {
  8612. var node = this.nodes[i];
  8613. if (cb(node, i, this.nodes) === false) {
  8614. return false;
  8615. }
  8616. }
  8617. return true;
  8618. };
  8619. exports.default = Container;
  8620. /***/ }),
  8621. /* 37 */
  8622. /***/ (function(module, exports, __webpack_require__) {
  8623. "use strict";
  8624. Object.defineProperty(exports, "__esModule", {
  8625. value: true
  8626. });
  8627. /**
  8628. * A very generic node. Pretty much any element of a media query
  8629. */
  8630. function Node(opts) {
  8631. this.after = opts.after;
  8632. this.before = opts.before;
  8633. this.type = opts.type;
  8634. this.value = opts.value;
  8635. this.sourceIndex = opts.sourceIndex;
  8636. }
  8637. exports.default = Node;
  8638. /***/ }),
  8639. /* 38 */
  8640. /***/ (function(module, exports, __webpack_require__) {
  8641. "use strict";
  8642. exports.__esModule = true;
  8643. var _supportsColor = __webpack_require__(177);
  8644. var _supportsColor2 = _interopRequireDefault(_supportsColor);
  8645. var _chalk = __webpack_require__(88);
  8646. var _chalk2 = _interopRequireDefault(_chalk);
  8647. var _terminalHighlight = __webpack_require__(137);
  8648. var _terminalHighlight2 = _interopRequireDefault(_terminalHighlight);
  8649. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8650. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8651. /**
  8652. * The CSS parser throws this error for broken CSS.
  8653. *
  8654. * Custom parsers can throw this error for broken custom syntax using
  8655. * the {@link Node#error} method.
  8656. *
  8657. * PostCSS will use the input source map to detect the original error location.
  8658. * If you wrote a Sass file, compiled it to CSS and then parsed it with PostCSS,
  8659. * PostCSS will show the original position in the Sass file.
  8660. *
  8661. * If you need the position in the PostCSS input
  8662. * (e.g., to debug the previous compiler), use `error.input.file`.
  8663. *
  8664. * @example
  8665. * // Catching and checking syntax error
  8666. * try {
  8667. * postcss.parse('a{')
  8668. * } catch (error) {
  8669. * if ( error.name === 'CssSyntaxError' ) {
  8670. * error //=> CssSyntaxError
  8671. * }
  8672. * }
  8673. *
  8674. * @example
  8675. * // Raising error from plugin
  8676. * throw node.error('Unknown variable', { plugin: 'postcss-vars' });
  8677. */
  8678. var CssSyntaxError = function () {
  8679. /**
  8680. * @param {string} message - error message
  8681. * @param {number} [line] - source line of the error
  8682. * @param {number} [column] - source column of the error
  8683. * @param {string} [source] - source code of the broken file
  8684. * @param {string} [file] - absolute path to the broken file
  8685. * @param {string} [plugin] - PostCSS plugin name, if error came from plugin
  8686. */
  8687. function CssSyntaxError(message, line, column, source, file, plugin) {
  8688. _classCallCheck(this, CssSyntaxError);
  8689. /**
  8690. * @member {string} - Always equal to `'CssSyntaxError'`. You should
  8691. * always check error type
  8692. * by `error.name === 'CssSyntaxError'` instead of
  8693. * `error instanceof CssSyntaxError`, because
  8694. * npm could have several PostCSS versions.
  8695. *
  8696. * @example
  8697. * if ( error.name === 'CssSyntaxError' ) {
  8698. * error //=> CssSyntaxError
  8699. * }
  8700. */
  8701. this.name = 'CssSyntaxError';
  8702. /**
  8703. * @member {string} - Error message.
  8704. *
  8705. * @example
  8706. * error.message //=> 'Unclosed block'
  8707. */
  8708. this.reason = message;
  8709. if (file) {
  8710. /**
  8711. * @member {string} - Absolute path to the broken file.
  8712. *
  8713. * @example
  8714. * error.file //=> 'a.sass'
  8715. * error.input.file //=> 'a.css'
  8716. */
  8717. this.file = file;
  8718. }
  8719. if (source) {
  8720. /**
  8721. * @member {string} - Source code of the broken file.
  8722. *
  8723. * @example
  8724. * error.source //=> 'a { b {} }'
  8725. * error.input.column //=> 'a b { }'
  8726. */
  8727. this.source = source;
  8728. }
  8729. if (plugin) {
  8730. /**
  8731. * @member {string} - Plugin name, if error came from plugin.
  8732. *
  8733. * @example
  8734. * error.plugin //=> 'postcss-vars'
  8735. */
  8736. this.plugin = plugin;
  8737. }
  8738. if (typeof line !== 'undefined' && typeof column !== 'undefined') {
  8739. /**
  8740. * @member {number} - Source line of the error.
  8741. *
  8742. * @example
  8743. * error.line //=> 2
  8744. * error.input.line //=> 4
  8745. */
  8746. this.line = line;
  8747. /**
  8748. * @member {number} - Source column of the error.
  8749. *
  8750. * @example
  8751. * error.column //=> 1
  8752. * error.input.column //=> 4
  8753. */
  8754. this.column = column;
  8755. }
  8756. this.setMessage();
  8757. if (Error.captureStackTrace) {
  8758. Error.captureStackTrace(this, CssSyntaxError);
  8759. }
  8760. }
  8761. CssSyntaxError.prototype.setMessage = function setMessage() {
  8762. /**
  8763. * @member {string} - Full error text in the GNU error format
  8764. * with plugin, file, line and column.
  8765. *
  8766. * @example
  8767. * error.message //=> 'a.css:1:1: Unclosed block'
  8768. */
  8769. this.message = this.plugin ? this.plugin + ': ' : '';
  8770. this.message += this.file ? this.file : '<css input>';
  8771. if (typeof this.line !== 'undefined') {
  8772. this.message += ':' + this.line + ':' + this.column;
  8773. }
  8774. this.message += ': ' + this.reason;
  8775. };
  8776. /**
  8777. * Returns a few lines of CSS source that caused the error.
  8778. *
  8779. * If the CSS has an input source map without `sourceContent`,
  8780. * this method will return an empty string.
  8781. *
  8782. * @param {boolean} [color] whether arrow will be colored red by terminal
  8783. * color codes. By default, PostCSS will detect
  8784. * color support by `process.stdout.isTTY`
  8785. * and `process.env.NODE_DISABLE_COLORS`.
  8786. *
  8787. * @example
  8788. * error.showSourceCode() //=> " 4 | }
  8789. * // 5 | a {
  8790. * // > 6 | bad
  8791. * // | ^
  8792. * // 7 | }
  8793. * // 8 | b {"
  8794. *
  8795. * @return {string} few lines of CSS source that caused the error
  8796. */
  8797. CssSyntaxError.prototype.showSourceCode = function showSourceCode(color) {
  8798. var _this = this;
  8799. if (!this.source) return '';
  8800. var css = this.source;
  8801. if (typeof color === 'undefined') color = _supportsColor2.default.stdout;
  8802. if (color) css = (0, _terminalHighlight2.default)(css);
  8803. var lines = css.split(/\r?\n/);
  8804. var start = Math.max(this.line - 3, 0);
  8805. var end = Math.min(this.line + 2, lines.length);
  8806. var maxWidth = String(end).length;
  8807. function mark(text) {
  8808. if (color && _chalk2.default.red) {
  8809. return _chalk2.default.red.bold(text);
  8810. } else {
  8811. return text;
  8812. }
  8813. }
  8814. function aside(text) {
  8815. if (color && _chalk2.default.gray) {
  8816. return _chalk2.default.gray(text);
  8817. } else {
  8818. return text;
  8819. }
  8820. }
  8821. return lines.slice(start, end).map(function (line, index) {
  8822. var number = start + 1 + index;
  8823. var gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | ';
  8824. if (number === _this.line) {
  8825. var spacing = aside(gutter.replace(/\d/g, ' ')) + line.slice(0, _this.column - 1).replace(/[^\t]/g, ' ');
  8826. return mark('>') + aside(gutter) + line + '\n ' + spacing + mark('^');
  8827. } else {
  8828. return ' ' + aside(gutter) + line;
  8829. }
  8830. }).join('\n');
  8831. };
  8832. /**
  8833. * Returns error position, message and source code of the broken part.
  8834. *
  8835. * @example
  8836. * error.toString() //=> "CssSyntaxError: app.css:1:1: Unclosed block
  8837. * // > 1 | a {
  8838. * // | ^"
  8839. *
  8840. * @return {string} error position, message and source code
  8841. */
  8842. CssSyntaxError.prototype.toString = function toString() {
  8843. var code = this.showSourceCode();
  8844. if (code) {
  8845. code = '\n\n' + code + '\n';
  8846. }
  8847. return this.name + ': ' + this.message + code;
  8848. };
  8849. /**
  8850. * @memberof CssSyntaxError#
  8851. * @member {Input} input - Input object with PostCSS internal information
  8852. * about input file. If input has source map
  8853. * from previous tool, PostCSS will use origin
  8854. * (for example, Sass) source. You can use this
  8855. * object to get PostCSS input source.
  8856. *
  8857. * @example
  8858. * error.input.file //=> 'a.css'
  8859. * error.file //=> 'a.sass'
  8860. */
  8861. return CssSyntaxError;
  8862. }();
  8863. exports.default = CssSyntaxError;
  8864. module.exports = exports['default'];
  8865. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNzcy1zeW50YXgtZXJyb3IuZXM2Il0sIm5hbWVzIjpbIkNzc1N5bnRheEVycm9yIiwibWVzc2FnZSIsImxpbmUiLCJjb2x1bW4iLCJzb3VyY2UiLCJmaWxlIiwicGx1Z2luIiwibmFtZSIsInJlYXNvbiIsInNldE1lc3NhZ2UiLCJFcnJvciIsImNhcHR1cmVTdGFja1RyYWNlIiwic2hvd1NvdXJjZUNvZGUiLCJjb2xvciIsImNzcyIsInN0ZG91dCIsImxpbmVzIiwic3BsaXQiLCJzdGFydCIsIk1hdGgiLCJtYXgiLCJlbmQiLCJtaW4iLCJsZW5ndGgiLCJtYXhXaWR0aCIsIlN0cmluZyIsIm1hcmsiLCJ0ZXh0IiwicmVkIiwiYm9sZCIsImFzaWRlIiwiZ3JheSIsInNsaWNlIiwibWFwIiwiaW5kZXgiLCJudW1iZXIiLCJndXR0ZXIiLCJzcGFjaW5nIiwicmVwbGFjZSIsImpvaW4iLCJ0b1N0cmluZyIsImNvZGUiXSwibWFwcGluZ3MiOiI7Ozs7QUFBQTs7OztBQUNBOzs7O0FBRUE7Ozs7Ozs7O0FBRUE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztJQTJCTUEsYzs7QUFFRjs7Ozs7Ozs7QUFRQSw0QkFBWUMsT0FBWixFQUFxQkMsSUFBckIsRUFBMkJDLE1BQTNCLEVBQW1DQyxNQUFuQyxFQUEyQ0MsSUFBM0MsRUFBaURDLE1BQWpELEVBQXlEO0FBQUE7O0FBQ3JEOzs7Ozs7Ozs7Ozs7QUFZQSxhQUFLQyxJQUFMLEdBQVksZ0JBQVo7QUFDQ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bHVnaW5cbiAgICAgKi9cbiAgICBjb25zdHJ1Y3RvcihtZXNzYWdlLCBsaW5lLCBjb2x1bW4sIHNvdXJjZSwgZmlsZSwgcGx1Z2luKSB7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtzdHJpbmd9IC0gQWx3YXlzIGVxdWFsIHRvIGAnQ3NzU3ludGF4RXJyb3InYC4gWW91IHNob3VsZFxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgYWx3YXlzIGNoZWNrIGVycm9yIHR5cGVcbiAgICAgICAgICogICAgICAgICAgICAgICAgICAgIGJ5IGBlcnJvci5uYW1lID09PSAnQ3NzU3ludGF4RXJyb3InYCBpbnN0ZWFkIG9mXG4gICAgICAgICAqICAgICAgICAgICAgICAgICAgICBgZXJyb3IgaW5zdGFuY2VvZiBDc3NTeW50YXhFcnJvcmAsIGJlY2F1c2VcbiAgICAgICAgICogICAgICAgICAgICAgICAgICAgIG5wbSBjb3VsZCBoYXZlIHNldmVyYWwgUG9zdENTUyB2ZXJzaW9ucy5cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogaWYgKCBlcnJvci5uYW1lID09PSAnQ3NzU3ludGF4RXJyb3InICkge1xuICAgICAgICAgKiAgIGVycm9yIC8vPT4gQ3NzU3ludGF4RXJyb3JcbiAgICAgICAgICogfVxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5uYW1lID0gJ0Nzc1N5bnRheEVycm9yJztcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge3N0cmluZ30gLSBFcnJvciBtZXNzYWdlLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgKiBlcnJvci5tZXNzYWdlIC8vPT4gJ1VuY2xvc2VkIGJsb2NrJ1xuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5yZWFzb24gPSBtZXNzYWdlO1xuXG4gICAgICAgIGlmICggZmlsZSApIHtcbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQG1lbWJlciB7c3RyaW5nfSAtIEFic29sdXRlIHBhdGggdG8gdGhlIGJyb2tlbiBmaWxlLlxuICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAqIEBleGFtcGxlXG4gICAgICAgICAgICAgKiBlcnJvci5maWxlICAgICAgIC8vPT4gJ2Euc2FzcydcbiAgICAgICAgICAgICAqIGVycm9yLmlucHV0LmZpbGUgLy89PiAnYS5jc3MnXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIHRoaXMuZmlsZSA9IGZpbGU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCBzb3VyY2UgKSB7XG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIEBtZW1iZXIge3N0cmluZ30gLSBTb3VyY2UgY29kZSBvZiB0aGUgYnJva2VuIGZpbGUuXG4gICAgICAgICAgICAgKlxuICAgICAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICAgICAqIGVycm9yLnNvdXJjZSAgICAgICAvLz0+ICdhIHsgYiB7fSB9J1xuICAgICAgICAgICAgICogZXJyb3IuaW5wdXQuY29sdW1uIC8vPT4gJ2EgYiB7IH0nXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIHRoaXMuc291cmNlID0gc291cmNlO1xuICAgICAgICB9XG4gICAgICAgIGlmICggcGx1Z2luICkge1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBAbWVtYmVyIHtzdHJpbmd9IC0gUGx1Z2luIG5hbWUsIGlmIGVycm9yIGNhbWUgZnJvbSBwbHVnaW4uXG4gICAgICAgICAgICAgKlxuICAgICAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICAgICAqIGVycm9yLnBsdWdpbiAvLz0+ICdwb3N0Y3NzLXZhcnMnXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIHRoaXMucGx1Z2luID0gcGx1Z2luO1xuICAgICAgICB9XG4gICAgICAgIGlmICggdHlwZW9mIGxpbmUgIT09ICd1bmRlZmluZWQnICYmIHR5cGVvZiBjb2x1bW4gIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBAbWVtYmVyIHtudW1iZXJ9IC0gU291cmNlIGxpbmUgb2YgdGhlIGVycm9yLlxuICAgICAgICAgICAgICpcbiAgICAgICAgICAgICAqIEBleGFtcGxlXG4gICAgICAgICAgICAgKiBlcnJvci5saW5lICAgICAgIC8vPT4gMlxuICAgICAgICAgICAgICogZXJyb3IuaW5wdXQubGluZSAvLz0+IDRcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy5saW5lICAgPSBsaW5lO1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBAbWVtYmVyIHtudW1iZXJ9IC0gU291cmNlIGNvbHVtbiBvZiB0aGUgZXJyb3IuXG4gICAgICAgICAgICAgKlxuICAgICAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICAgICAqIGVycm9yLmNvbHVtbiAgICAgICAvLz0+IDFcbiAgICAgICAgICAgICAqIGVycm9yLmlucHV0LmNvbHVtbiAvLz0+IDRcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy5jb2x1bW4gPSBjb2x1bW47XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnNldE1lc3NhZ2UoKTtcblxuICAgICAgICBpZiAoIEVycm9yLmNhcHR1cmVTdGFja1RyYWNlICkge1xuICAgICAgICAgICAgRXJyb3IuY2FwdHVyZVN0YWNrVHJhY2UodGhpcywgQ3NzU3ludGF4RXJyb3IpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgc2V0TWVzc2FnZSgpIHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge3N0cmluZ30gLSBGdWxsIGVycm9yIHRleHQgaW4gdGhlIEdOVSBlcnJvciBmb3JtYXRcbiAgICAgICAgICogICAgICAgICAgICAgICAgICAgIHd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ICAgICAgICAgICAgICAgY29sb3Igc3VwcG9ydCBieSBgcHJvY2Vzcy5zdGRvdXQuaXNUVFlgXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgIGFuZCBgcHJvY2Vzcy5lbnYuTk9ERV9ESVNBQkxFX0NPTE9SU2AuXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIGVycm9yLnNob3dTb3VyY2VDb2RlKCkgLy89PiBcIiAgNCB8IH1cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgNSB8IGEge1xuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgPiA2IHwgICBiYWRcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgICAgICB8ICAgXlxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICA3IHwgfVxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICA4IHwgYiB7XCJcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge3N0cmluZ30gZmV3IGxpbmVzIG9mIENTUyBzb3VyY2UgdGhhdCBjYXVzZWQgdGhlIGVycm9yXG4gICAgICovXG4gICAgc2hvd1NvdXJjZUNvZGUoY29sb3IpIHtcbiAgICAgICAgaWYgKCAhdGhpcy5zb3VyY2UgKSByZXR1cm4gJyc7XG5cbiAgICAgICAgbGV0IGNzcyA9IHRoaXMuc291cmNlO1xuICAgICAgICBpZiAoIHR5cGVvZiBjb2xvciA9PT0gJ3VuZGVmaW5lZCcgKSBjb2xvciA9IHN1cHBvcnRzQ29sb3Iuc3Rkb3V0O1xuICAgICAgICBpZiAoIGNvbG9yICkgY3NzID0gdGVybWluYWxIaWdobGlnaHQoY3NzKTtcblxuICAgICAgICBsZXQgbGluZXMgPSBjc3Muc3BsaXQoL1xccj9cXG4vKTtcbiAgICAgICAgbGV0IHN0YXJ0ID0gTWF0aC5tYXgodGhpcy5saW5lIC0gMywgMCk7XG4gICAgICAgIGxldCBlbmQgICA9IE1hdGgubWluKHRoaXMubGluZSArIDIsIGxpbmVzLmxlbmd0aCk7XG5cbiAgICAgICAgbGV0IG1heFdpZHRoID0gU3RyaW5nKGVuZCkubGVuZ3RoO1xuXG4gICAgICAgIGZ1bmN0aW9uIG1hcmsodGV4dCkge1xuICAgICAgICAgICAgaWYgKCBjb2xvciAmJiBjaGFsay5yZWQgKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNoYWxrLnJlZC5ib2xkKHRleHQpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGV4dDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBhc2lkZSh0ZXh0KSB7XG4gICAgICAgICAgICBpZiAoIGNvbG9yICYmIGNoYWxrLmdyYXkgKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNoYWxrLmdyYXkodGV4dCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGxpbmVzLnNsaWNlKHN0YXJ0LCBlbmQpLm1hcCggKGxpbmUsIGluZGV4KSA9PiB7XG4gICAgICAgICAgICBsZXQgbnVtYmVyID0gc3RhcnQgKyAxICsgaW5kZXg7XG4gICAgICAgICAgICBsZXQgZ3V0dGVyID0gJyAnICsgKCcgJyArIG51bWJlcikuc2xpY2UoLW1heFdpZHRoKSArICcgfCAnO1xuICAgICAgICAgICAgaWYgKCBudW1iZXIgPT09IHRoaXMubGluZSApIHtcbiAgICAgICAgICAgICAgICBsZXQgc3BhY2luZyA9XG4gICAgICAgICAgICAgICAgICAgIGFzaWRlKGd1dHRlci5yZXBsYWNlKC9cXGQvZywgJyAnKSkgK1xuICAgICAgICAgICAgICAgICAgICBsaW5lLnNsaWNlKDAsIHRoaXMuY29sdW1uIC0gMSkucmVwbGFjZSgvW15cXHRdL2csICcgJyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG1hcmsoJz4nKSArIGFzaWRlKGd1dHRlcikgKyBsaW5lICsgJ1xcbiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgc3BhY2luZyArIG1hcmsoJ14nKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICcgJyArIGFzaWRlKGd1dHRlcikgKyBsaW5lO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KS5qb2luKCdcXG4nKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBSZXR1cm5zIGVycm9yIHBvc2l0aW9uLCBtZXNzYWdlIGFuZCBzb3VyY2UgY29kZSBvZiB0aGUgYnJva2VuIHBhcnQuXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIGVycm9yLnRvU3RyaW5nKCkgLy89PiBcIkNzc1N5bnRheEVycm9yOiBhcHAuY3NzOjE6MTogVW5jbG9zZWQgYmxvY2tcbiAgICAgKiAgICAgICAgICAgICAgICAgIC8vICAgID4gMSB8IGEge1xuICAgICAqICAgICAgICAgICAgICAgICAgLy8gICAgICAgIHwgXlwiXG4gICAgICpcbiAgICAgKiBAcmV0dXJuIHtzdHJpbmd9IGVycm9yIHBvc2l0aW9uLCBtZXNzYWdlIGFuZCBzb3VyY2UgY29kZVxuICAgICAqL1xuICAgIHRvU3RyaW5nKCkge1xuICAgICAgICBsZXQgY29kZSA9IHRoaXMuc2hvd1NvdXJjZUNvZGUoKTtcbiAgICAgICAgaWYgKCBjb2RlICkge1xuICAgICAgICAgICAgY29kZSA9ICdcXG5cXG4nICsgY29kZSArICdcXG4nO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLm5hbWUgKyAnOiAnICsgdGhpcy5tZXNzYWdlICsgY29kZTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBAbWVtYmVyb2YgQ3NzU3ludGF4RXJyb3IjXG4gICAgICogQG1lbWJlciB7SW5wdXR9IGlucHV0IC0gSW5wdXQgb2JqZWN0IHdpdGggUG9zdENTUyBpbnRlcm5hbCBpbmZvcm1hdGlvblxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIGFib3V0IGlucHV0IGZpbGUuIElmIGlucHV0IGhhcyBzb3VyY2UgbWFwXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgZnJvbSBwcmV2aW91cyB0b29sLCBQb3N0Q1NTIHdpbGwgdXNlIG9yaWdpblxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIChmb3IgZXhhbXBsZSwgU2Fzcykgc291cmNlLiBZb3UgY2FuIHVzZSB0aGlzXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgb2JqZWN0IHRvIGdldCBQb3N0Q1NTIGlucHV0IHNvdXJjZS5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogZXJyb3IuaW5wdXQuZmlsZSAvLz0+ICdhLmNzcydcbiAgICAgKiBlcnJvci5maWxlICAgICAgIC8vPT4gJ2Euc2FzcydcbiAgICAgKi9cblxufVxuXG5leHBvcnQgZGVmYXVsdCBDc3NTeW50YXhFcnJvcjtcbiJdfQ==
  8866. /***/ }),
  8867. /* 39 */
  8868. /***/ (function(module, exports, __webpack_require__) {
  8869. "use strict";
  8870. exports.__esModule = true;
  8871. var _node = __webpack_require__(19);
  8872. var _node2 = _interopRequireDefault(_node);
  8873. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8874. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8875. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  8876. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  8877. /**
  8878. * Represents a CSS declaration.
  8879. *
  8880. * @extends Node
  8881. *
  8882. * @example
  8883. * const root = postcss.parse('a { color: black }');
  8884. * const decl = root.first.first;
  8885. * decl.type //=> 'decl'
  8886. * decl.toString() //=> ' color: black'
  8887. */
  8888. var Declaration = function (_Node) {
  8889. _inherits(Declaration, _Node);
  8890. function Declaration(defaults) {
  8891. _classCallCheck(this, Declaration);
  8892. var _this = _possibleConstructorReturn(this, _Node.call(this, defaults));
  8893. _this.type = 'decl';
  8894. return _this;
  8895. }
  8896. /**
  8897. * @memberof Declaration#
  8898. * @member {string} prop - the declaration’s property name
  8899. *
  8900. * @example
  8901. * const root = postcss.parse('a { color: black }');
  8902. * const decl = root.first.first;
  8903. * decl.prop //=> 'color'
  8904. */
  8905. /**
  8906. * @memberof Declaration#
  8907. * @member {string} value - the declaration’s value
  8908. *
  8909. * @example
  8910. * const root = postcss.parse('a { color: black }');
  8911. * const decl = root.first.first;
  8912. * decl.value //=> 'black'
  8913. */
  8914. /**
  8915. * @memberof Declaration#
  8916. * @member {boolean} important - `true` if the declaration
  8917. * has an !important annotation.
  8918. *
  8919. * @example
  8920. * const root = postcss.parse('a { color: black !important; color: red }');
  8921. * root.first.first.important //=> true
  8922. * root.first.last.important //=> undefined
  8923. */
  8924. /**
  8925. * @memberof Declaration#
  8926. * @member {object} raws - Information to generate byte-to-byte equal
  8927. * node string as it was in the origin input.
  8928. *
  8929. * Every parser saves its own properties,
  8930. * but the default CSS parser uses:
  8931. *
  8932. * * `before`: the space symbols before the node. It also stores `*`
  8933. * and `_` symbols before the declaration (IE hack).
  8934. * * `between`: the symbols between the property and value
  8935. * for declarations.
  8936. * * `important`: the content of the important statement,
  8937. * if it is not just `!important`.
  8938. *
  8939. * PostCSS cleans declaration from comments and extra spaces,
  8940. * but it stores origin content in raws properties.
  8941. * As such, if you don’t change a declaration’s value,
  8942. * PostCSS will use the raw value with comments.
  8943. *
  8944. * @example
  8945. * const root = postcss.parse('a {\n color:black\n}')
  8946. * root.first.first.raws //=> { before: '\n ', between: ':' }
  8947. */
  8948. return Declaration;
  8949. }(_node2.default);
  8950. exports.default = Declaration;
  8951. module.exports = exports['default'];
  8952. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRlY2xhcmF0aW9uLmVzNiJdLCJuYW1lcyI6WyJEZWNsYXJhdGlvbiIsImRlZmF1bHRzIiwidHlwZSJdLCJtYXBwaW5ncyI6Ijs7OztBQUFBOzs7Ozs7Ozs7Ozs7QUFFQTs7Ozs7Ozs7Ozs7SUFXTUEsVzs7O0FBRUYsdUJBQVlDLFFBQVosRUFBc0I7QUFBQTs7QUFBQSxpREFDbEIsaUJBQU1BLFFBQU4sQ0FEa0I7O0FBRWxCLFVBQUtDLElBQUwsR0FBWSxNQUFaO0FBRmtCO0FBR3JCOztBQUVEOzs7Ozs7Ozs7O0FBVUE7Ozs7Ozs7Ozs7QUFVQTs7Ozs7Ozs7Ozs7QUFXQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztrQkEyQldGLFciLCJmaWxlIjoiZGVjbGFyYXRpb24uanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgTm9kZSBmcm9tICcuL25vZGUnO1xuXG4vKipcbiAqIFJlcHJlc2VudHMgYSBDU1MgZGVjbGFyYXRpb24uXG4gKlxuICogQGV4dGVuZHMgTm9kZVxuICpcbiAqIEBleGFtcGxlXG4gKiBjb25zdCByb290ID0gcG9zdGNzcy5wYXJzZSgnYSB7IGNvbG9yOiBibGFjayB9Jyk7XG4gKiBjb25zdCBkZWNsID0gcm9vdC5maXJzdC5maXJzdDtcbiAqIGRlY2wudHlwZSAgICAgICAvLz0+ICdkZWNsJ1xuICogZGVjbC50b1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GF0ZW1lbnQsXG4gICAgICogICBpZiBpdCBpcyBub3QganVzdCBgIWltcG9ydGFudGAuXG4gICAgICpcbiAgICAgKiBQb3N0Q1NTIGNsZWFucyBkZWNsYXJhdGlvbiBmcm9tIGNvbW1lbnRzIGFuZCBleHRyYSBzcGFjZXMsXG4gICAgICogYnV0IGl0IHN0b3JlcyBvcmlnaW4gY29udGVudCBpbiByYXdzIHByb3BlcnRpZXMuXG4gICAgICogQXMgc3VjaCwgaWYgeW91IGRvbuKAmXQgY2hhbmdlIGEgZGVjbGFyYXRpb27igJlzIHZhbHVlLFxuICAgICAqIFBvc3RDU1Mgd2lsbCB1c2UgdGhlIHJhdyB2YWx1ZSB3aXRoIGNvbW1lbnRzLlxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiBjb25zdCByb290ID0gcG9zdGNzcy5wYXJzZSgnYSB7XFxuICBjb2xvcjpibGFja1xcbn0nKVxuICAgICAqIHJvb3QuZmlyc3QuZmlyc3QucmF3cyAvLz0+IHsgYmVmb3JlOiAnXFxuICAnLCBiZXR3ZWVuOiAnOicgfVxuICAgICAqL1xuXG59XG5cbmV4cG9ydCBkZWZhdWx0IERlY2xhcmF0aW9uO1xuIl19
  8953. /***/ }),
  8954. /* 40 */
  8955. /***/ (function(module, exports, __webpack_require__) {
  8956. "use strict";
  8957. exports.__esModule = true;
  8958. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8959. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  8960. var _mapGenerator = __webpack_require__(133);
  8961. var _mapGenerator2 = _interopRequireDefault(_mapGenerator);
  8962. var _stringify2 = __webpack_require__(44);
  8963. var _stringify3 = _interopRequireDefault(_stringify2);
  8964. var _warnOnce = __webpack_require__(46);
  8965. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  8966. var _result = __webpack_require__(136);
  8967. var _result2 = _interopRequireDefault(_result);
  8968. var _parse = __webpack_require__(41);
  8969. var _parse2 = _interopRequireDefault(_parse);
  8970. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8971. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8972. function isPromise(obj) {
  8973. return (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && typeof obj.then === 'function';
  8974. }
  8975. /**
  8976. * A Promise proxy for the result of PostCSS transformations.
  8977. *
  8978. * A `LazyResult` instance is returned by {@link Processor#process}.
  8979. *
  8980. * @example
  8981. * const lazy = postcss([cssnext]).process(css);
  8982. */
  8983. var LazyResult = function () {
  8984. function LazyResult(processor, css, opts) {
  8985. _classCallCheck(this, LazyResult);
  8986. this.stringified = false;
  8987. this.processed = false;
  8988. var root = void 0;
  8989. if ((typeof css === 'undefined' ? 'undefined' : _typeof(css)) === 'object' && css !== null && css.type === 'root') {
  8990. root = css;
  8991. } else if (css instanceof LazyResult || css instanceof _result2.default) {
  8992. root = css.root;
  8993. if (css.map) {
  8994. if (typeof opts.map === 'undefined') opts.map = {};
  8995. if (!opts.map.inline) opts.map.inline = false;
  8996. opts.map.prev = css.map;
  8997. }
  8998. } else {
  8999. var parser = _parse2.default;
  9000. if (opts.syntax) parser = opts.syntax.parse;
  9001. if (opts.parser) parser = opts.parser;
  9002. if (parser.parse) parser = parser.parse;
  9003. try {
  9004. root = parser(css, opts);
  9005. } catch (error) {
  9006. this.error = error;
  9007. }
  9008. }
  9009. this.result = new _result2.default(processor, root, opts);
  9010. }
  9011. /**
  9012. * Returns a {@link Processor} instance, which will be used
  9013. * for CSS transformations.
  9014. * @type {Processor}
  9015. */
  9016. /**
  9017. * Processes input CSS through synchronous plugins
  9018. * and calls {@link Result#warnings()}.
  9019. *
  9020. * @return {Warning[]} warnings from plugins
  9021. */
  9022. LazyResult.prototype.warnings = function warnings() {
  9023. return this.sync().warnings();
  9024. };
  9025. /**
  9026. * Alias for the {@link LazyResult#css} property.
  9027. *
  9028. * @example
  9029. * lazy + '' === lazy.css;
  9030. *
  9031. * @return {string} output CSS
  9032. */
  9033. LazyResult.prototype.toString = function toString() {
  9034. return this.css;
  9035. };
  9036. /**
  9037. * Processes input CSS through synchronous and asynchronous plugins
  9038. * and calls `onFulfilled` with a Result instance. If a plugin throws
  9039. * an error, the `onRejected` callback will be executed.
  9040. *
  9041. * It implements standard Promise API.
  9042. *
  9043. * @param {onFulfilled} onFulfilled - callback will be executed
  9044. * when all plugins will finish work
  9045. * @param {onRejected} onRejected - callback will be executed on any error
  9046. *
  9047. * @return {Promise} Promise API to make queue
  9048. *
  9049. * @example
  9050. * postcss([cssnext]).process(css, { from: cssPath }).then(result => {
  9051. * console.log(result.css);
  9052. * });
  9053. */
  9054. LazyResult.prototype.then = function then(onFulfilled, onRejected) {
  9055. if (!('from' in this.opts)) {
  9056. (0, _warnOnce2.default)('Without `from` option PostCSS could generate wrong ' + 'source map and will not find Browserslist config. ' + 'Set it to CSS file path or to `undefined` to prevent ' + 'this warning.');
  9057. }
  9058. return this.async().then(onFulfilled, onRejected);
  9059. };
  9060. /**
  9061. * Processes input CSS through synchronous and asynchronous plugins
  9062. * and calls onRejected for each error thrown in any plugin.
  9063. *
  9064. * It implements standard Promise API.
  9065. *
  9066. * @param {onRejected} onRejected - callback will be executed on any error
  9067. *
  9068. * @return {Promise} Promise API to make queue
  9069. *
  9070. * @example
  9071. * postcss([cssnext]).process(css).then(result => {
  9072. * console.log(result.css);
  9073. * }).catch(error => {
  9074. * console.error(error);
  9075. * });
  9076. */
  9077. LazyResult.prototype.catch = function _catch(onRejected) {
  9078. return this.async().catch(onRejected);
  9079. };
  9080. LazyResult.prototype.handleError = function handleError(error, plugin) {
  9081. try {
  9082. this.error = error;
  9083. if (error.name === 'CssSyntaxError' && !error.plugin) {
  9084. error.plugin = plugin.postcssPlugin;
  9085. error.setMessage();
  9086. } else if (plugin.postcssVersion) {
  9087. var pluginName = plugin.postcssPlugin;
  9088. var pluginVer = plugin.postcssVersion;
  9089. var runtimeVer = this.result.processor.version;
  9090. var a = pluginVer.split('.');
  9091. var b = runtimeVer.split('.');
  9092. if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1])) {
  9093. console.error('Unknown error from PostCSS plugin. ' + 'Your current PostCSS version ' + 'is ' + runtimeVer + ', but ' + pluginName + ' ' + 'uses ' + pluginVer + '. Perhaps this is ' + 'the source of the error below.');
  9094. }
  9095. }
  9096. } catch (err) {
  9097. if (console && console.error) console.error(err);
  9098. }
  9099. };
  9100. LazyResult.prototype.asyncTick = function asyncTick(resolve, reject) {
  9101. var _this = this;
  9102. if (this.plugin >= this.processor.plugins.length) {
  9103. this.processed = true;
  9104. return resolve();
  9105. }
  9106. try {
  9107. var plugin = this.processor.plugins[this.plugin];
  9108. var promise = this.run(plugin);
  9109. this.plugin += 1;
  9110. if (isPromise(promise)) {
  9111. promise.then(function () {
  9112. _this.asyncTick(resolve, reject);
  9113. }).catch(function (error) {
  9114. _this.handleError(error, plugin);
  9115. _this.processed = true;
  9116. reject(error);
  9117. });
  9118. } else {
  9119. this.asyncTick(resolve, reject);
  9120. }
  9121. } catch (error) {
  9122. this.processed = true;
  9123. reject(error);
  9124. }
  9125. };
  9126. LazyResult.prototype.async = function async() {
  9127. var _this2 = this;
  9128. if (this.processed) {
  9129. return new Promise(function (resolve, reject) {
  9130. if (_this2.error) {
  9131. reject(_this2.error);
  9132. } else {
  9133. resolve(_this2.stringify());
  9134. }
  9135. });
  9136. }
  9137. if (this.processing) {
  9138. return this.processing;
  9139. }
  9140. this.processing = new Promise(function (resolve, reject) {
  9141. if (_this2.error) return reject(_this2.error);
  9142. _this2.plugin = 0;
  9143. _this2.asyncTick(resolve, reject);
  9144. }).then(function () {
  9145. _this2.processed = true;
  9146. return _this2.stringify();
  9147. });
  9148. return this.processing;
  9149. };
  9150. LazyResult.prototype.sync = function sync() {
  9151. if (this.processed) return this.result;
  9152. this.processed = true;
  9153. if (this.processing) {
  9154. throw new Error('Use process(css).then(cb) to work with async plugins');
  9155. }
  9156. if (this.error) throw this.error;
  9157. for (var _iterator = this.result.processor.plugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  9158. var _ref;
  9159. if (_isArray) {
  9160. if (_i >= _iterator.length) break;
  9161. _ref = _iterator[_i++];
  9162. } else {
  9163. _i = _iterator.next();
  9164. if (_i.done) break;
  9165. _ref = _i.value;
  9166. }
  9167. var plugin = _ref;
  9168. var promise = this.run(plugin);
  9169. if (isPromise(promise)) {
  9170. throw new Error('Use process(css).then(cb) to work with async plugins');
  9171. }
  9172. }
  9173. return this.result;
  9174. };
  9175. LazyResult.prototype.run = function run(plugin) {
  9176. this.result.lastPlugin = plugin;
  9177. try {
  9178. return plugin(this.result.root, this.result);
  9179. } catch (error) {
  9180. this.handleError(error, plugin);
  9181. throw error;
  9182. }
  9183. };
  9184. LazyResult.prototype.stringify = function stringify() {
  9185. if (this.stringified) return this.result;
  9186. this.stringified = true;
  9187. this.sync();
  9188. var opts = this.result.opts;
  9189. var str = _stringify3.default;
  9190. if (opts.syntax) str = opts.syntax.stringify;
  9191. if (opts.stringifier) str = opts.stringifier;
  9192. if (str.stringify) str = str.stringify;
  9193. var map = new _mapGenerator2.default(str, this.result.root, this.result.opts);
  9194. var data = map.generate();
  9195. this.result.css = data[0];
  9196. this.result.map = data[1];
  9197. return this.result;
  9198. };
  9199. _createClass(LazyResult, [{
  9200. key: 'processor',
  9201. get: function get() {
  9202. return this.result.processor;
  9203. }
  9204. /**
  9205. * Options from the {@link Processor#process} call.
  9206. * @type {processOptions}
  9207. */
  9208. }, {
  9209. key: 'opts',
  9210. get: function get() {
  9211. return this.result.opts;
  9212. }
  9213. /**
  9214. * Processes input CSS through synchronous plugins, converts `Root`
  9215. * to a CSS string and returns {@link Result#css}.
  9216. *
  9217. * This property will only work with synchronous plugins.
  9218. * If the processor contains any asynchronous plugins
  9219. * it will throw an error. This is why this method is only
  9220. * for debug purpose, you should always use {@link LazyResult#then}.
  9221. *
  9222. * @type {string}
  9223. * @see Result#css
  9224. */
  9225. }, {
  9226. key: 'css',
  9227. get: function get() {
  9228. return this.stringify().css;
  9229. }
  9230. /**
  9231. * An alias for the `css` property. Use it with syntaxes
  9232. * that generate non-CSS output.
  9233. *
  9234. * This property will only work with synchronous plugins.
  9235. * If the processor contains any asynchronous plugins
  9236. * it will throw an error. This is why this method is only
  9237. * for debug purpose, you should always use {@link LazyResult#then}.
  9238. *
  9239. * @type {string}
  9240. * @see Result#content
  9241. */
  9242. }, {
  9243. key: 'content',
  9244. get: function get() {
  9245. return this.stringify().content;
  9246. }
  9247. /**
  9248. * Processes input CSS through synchronous plugins
  9249. * and returns {@link Result#map}.
  9250. *
  9251. * This property will only work with synchronous plugins.
  9252. * If the processor contains any asynchronous plugins
  9253. * it will throw an error. This is why this method is only
  9254. * for debug purpose, you should always use {@link LazyResult#then}.
  9255. *
  9256. * @type {SourceMapGenerator}
  9257. * @see Result#map
  9258. */
  9259. }, {
  9260. key: 'map',
  9261. get: function get() {
  9262. return this.stringify().map;
  9263. }
  9264. /**
  9265. * Processes input CSS through synchronous plugins
  9266. * and returns {@link Result#root}.
  9267. *
  9268. * This property will only work with synchronous plugins. If the processor
  9269. * contains any asynchronous plugins it will throw an error.
  9270. *
  9271. * This is why this method is only for debug purpose,
  9272. * you should always use {@link LazyResult#then}.
  9273. *
  9274. * @type {Root}
  9275. * @see Result#root
  9276. */
  9277. }, {
  9278. key: 'root',
  9279. get: function get() {
  9280. return this.sync().root;
  9281. }
  9282. /**
  9283. * Processes input CSS through synchronous plugins
  9284. * and returns {@link Result#messages}.
  9285. *
  9286. * This property will only work with synchronous plugins. If the processor
  9287. * contains any asynchronous plugins it will throw an error.
  9288. *
  9289. * This is why this method is only for debug purpose,
  9290. * you should always use {@link LazyResult#then}.
  9291. *
  9292. * @type {Message[]}
  9293. * @see Result#messages
  9294. */
  9295. }, {
  9296. key: 'messages',
  9297. get: function get() {
  9298. return this.sync().messages;
  9299. }
  9300. }]);
  9301. return LazyResult;
  9302. }();
  9303. exports.default = LazyResult;
  9304. /**
  9305. * @callback onFulfilled
  9306. * @param {Result} result
  9307. */
  9308. /**
  9309. * @callback onRejected
  9310. * @param {Error} error
  9311. */
  9312. module.exports = exports['default'];
  9313. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxhenktcmVzdWx0LmVzNiJdLCJuYW1lcyI6WyJpc1Byb21pc2UiLCJvYmoiLCJ0aGVuIiwiTGF6eVJlc3VsdCIsInByb2Nlc3NvciIsImNzcyIsIm9wdHMiLCJzdHJpbmdpZmllZCIsInByb2Nlc3NlZCIsInJvb3QiLCJ0eXBlIiwibWFwIiwiaW5saW5lIiwicHJldiIsInBhcnNlciIsInN5bnRheCIsInBhcnNlIiwiZXJyb3IiLCJyZXN1bHQiLCJ3YXJuaW5ncyIsInN5bmMiLCJ0b1N0cmluZyIsIm9uRnVsZmlsbGVkIiwib25SZWplY3RlZCIsImFzeW5jIiwiY2F0Y2giLCJoYW5kbGVFcnJvciIsInBsdWdpbiIsIm5hbWUiLCJwb3N0Y3NzUGx1Z2luIiwic2V0TWVzc2FnZSIsInBvc3Rjc3NWZXJzaW9uIiwicGx1Z2luTmFtZSIsInBsdWdpblZlciIsInJ1bnRpbWVWZXIiLCJ2ZXJzaW9uIiwiYSIsInNwbGl0IiwiYiIsInBhcnNlSW50IiwiY29uc29sZSIsImVyciIsImFzeW5jVGljayIsInJlc29sdmUiLC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uXG4gICAgICpcbiAgICAgKiBJdCBpbXBsZW1lbnRzIHN0YW5kYXJkIFByb21pc2UgQVBJLlxuICAgICAqXG4gICAgICogQHBhcmFtIHtvblJlamVjdGVkfSBvblJlamVjdGVkIC0gY2FsbGJhY2sgd2lsbCBiZSBleGVjdXRlZCBvbiBhbnkgZXJyb3JcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge1Byb21pc2V9IFByb21pc2UgQVBJIHRvIG1ha2UgcXVldWVcbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogcG9zdGNzcyhbY3NzbmV4dF0pLnByb2Nlc3MoY3NzKS50aGVuKHJlc3VsdCA9PiB7XG4gICAgICogICBjb25zb2xlLmxvZyhyZXN1bHQuY3NzKTtcbiAgICAgKiB9KS5jYXRjaChlcnJvciA9PiB7XG4gICAgICogICBjb25zb2xlLmVycm9yKGVycm9yKTtcbiAgICAgKiB9KTtcbiAgICAgKi9cbiAgICBjYXRjaChvblJlamVjdGVkKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmFzeW5jKCkuY2F0Y2gob25SZWplY3RlZCk7XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3IoZXJyb3IsIHBsdWdpbikge1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgdGhpcy5lcnJvciA9IGVycm9yO1xuICAgICAgICAgICAgaWYgKCBlcnJvci5uYW1lID09PSAnQ3NzU3ludGF4RXJyb3InICYmICFlcnJvci5wbHVnaW4gKSB7XG4gICAgICAgICAgICAgICAgZXJyb3IucGx1Z2luID0gcGx1Z2luLnBvc3Rjc3NQbHVnaW47XG4gICAgICAgICAgICAgICAgZXJyb3Iuc2V0TWVzc2FnZSgpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggcGx1Z2luLnBvc3Rjc3NWZXJzaW9uICkge1xuICAgICAgICAgICAgICAgIGxldCBwbHVnaW5OYW1lID0gcGx1Z2luLnBvc3Rjc3NQbHVnaW47XG4gICAgICAgICAgICAgICAgbGV0IHBsdWdpblZlciAgPSBwbHVnaW4ucG9zdGNzc1ZlcnNpb247XG4gICAgICAgICAgICAgICAgbGV0IHJ1bnRpbWVWZXIgPSB0aGlzLnJlc3VsdC5wcm9jZXNzb3IudmVyc2lvbjtcbiAgICAgICAgICAgICAgICBsZXQgYSA9IHBsdWdpblZlci5zcGxpdCgnLicpO1xuICAgICAgICAgICAgICAgIGxldCBiID0gcnVudGltZVZlci5zcGxpdCgnLicpO1xuXG4gICAgICAgICAgICAgICAgaWYgKCBhWzBdICE9PSBiWzBdIHx8IHBhcnNlSW50KGFbMV0pID4gcGFyc2VJbnQoYlsxXSkgKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoXG4gICAgICAgICAgICAgICAgICAgICAgICAnVW5rbm93biBlcnJvciBmcm9tIFBvc3RDU1MgcGx1Z2luLiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICdZb3VyIGN1cnJlbnQgUG9zdENTUyB2ZXJzaW9uICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2lzICcgKyBydW50aW1lVmVyICsgJywgYnV0ICcgKyBwbHVnaW5OYW1lICsgJyAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VzICcgKyBwbHVnaW5WZXIgKyAnLiBQZXJoYXBzIHRoaXMgaXMgJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAndGhlIHNvdXJjZSBvZiB0aGUgZXJyb3IgYmVsb3cuJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgICAgICAgIGlmICggY29uc29sZSAmJiBjb25zb2xlLmVycm9yICkgY29uc29sZS5lcnJvcihlcnIpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgYXN5bmNUaWNrKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgICBpZiAoIHRoaXMucGx1Z2luID49IHRoaXMucHJvY2Vzc29yLnBsdWdpbnMubGVuZ3RoICkge1xuICAgICAgICAgICAgdGhpcy5wcm9jZXNzZWQgPSB0cnVlO1xuICAgICAgICAgICAgcmV0dXJuIHJlc29sdmUoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICBsZXQgcGx1Z2luICA9IHRoaXMucHJvY2Vzc29yLnBsdWdpbnNbdGhpcy5wbHVnaW5dO1xuICAgICAgICAgICAgbGV0IHByb21pc2UgPSB0aGlzLnJ1bihwbHVnaW4pO1xuICAgICAgICAgICAgdGhpcy5wbHVnaW4gKz0gMTtcblxuICAgICAgICAgICAgaWYgKCBpc1Byb21pc2UocHJvbWlzZSkgKSB7XG4gICAgICAgICAgICAgICAgcHJvbWlzZS50aGVuKCAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYXN5bmNUaWNrKHJlc29sdmUsIHJlamVjdCk7XG4gICAgICAgICAgICAgICAgfSkuY2F0Y2goIGVycm9yID0+IHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5oYW5kbGVFcnJvcihlcnJvciwgcGx1Z2luKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wcm9jZXNzZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZXJyb3IpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLmFzeW5jVGljayhyZXNvbHZlLCByZWplY3QpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICB0aGlzLnByb2Nlc3NlZCA9IHRydWU7XG4gICAgICAgICAgICByZWplY3QoZXJyb3IpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgYXN5bmMoKSB7XG4gICAgICAgIGlmICggdGhpcy5wcm9jZXNzZWQgKSB7XG4gICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoIChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIHRoaXMuZXJyb3IgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdCh0aGlzLmVycm9yKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHRoaXMuc3RyaW5naWZ5KCkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGlmICggdGhpcy5wcm9jZXNzaW5nICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMucHJvY2Vzc2luZztcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMucHJvY2Vzc2luZyA9IG5ldyBQcm9taXNlKCAocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICAgICAgICBpZiAoIHRoaXMuZXJyb3IgKSByZXR1cm4gcmVqZWN0KHRoaXMuZXJyb3IpO1xuICAgICAgICAgICAgdGhpcy5wbHVnaW4gPSAwO1xuICAgICAgICAgICAgdGhpcy5hc3luY1RpY2socmVzb2x2ZSwgcmVqZWN0KTtcbiAgICAgICAgfSkudGhlbiggKCkgPT4ge1xuICAgICAgICAgICAgdGhpcy5wcm9jZXNzZWQgPSB0cnVlO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuc3RyaW5naWZ5KCk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiB0aGlzLnByb2Nlc3Npbmc7XG4gICAgfVxuXG4gICAgc3luYygpIHtcbiAgICAgICAgaWYgKCB0aGlzLnByb2Nlc3NlZCApIHJldHVybiB0aGlzLnJlc3VsdDtcbiAgICAgICAgdGhpcy5wcm9jZXNzZWQgPSB0cnVlO1xuXG4gICAgICAgIGlmICggdGhpcy5wcm9jZXNzaW5nICkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuICAgICAgICAgICAgICAgICdVc2UgcHJvY2Vzcyhjc3MpLnRoZW4oY2IpIHRv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M7XG4gICAgICAgIGxldCBzdHIgID0gc3RyaW5naWZ5O1xuICAgICAgICBpZiAoIG9wdHMuc3ludGF4ICkgICAgICBzdHIgPSBvcHRzLnN5bnRheC5zdHJpbmdpZnk7XG4gICAgICAgIGlmICggb3B0cy5zdHJpbmdpZmllciApIHN0ciA9IG9wdHMuc3RyaW5naWZpZXI7XG4gICAgICAgIGlmICggc3RyLnN0cmluZ2lmeSApICAgIHN0ciA9IHN0ci5zdHJpbmdpZnk7XG5cbiAgICAgICAgbGV0IG1hcCAgPSBuZXcgTWFwR2VuZXJhdG9yKHN0ciwgdGhpcy5yZXN1bHQucm9vdCwgdGhpcy5yZXN1bHQub3B0cyk7XG4gICAgICAgIGxldCBkYXRhID0gbWFwLmdlbmVyYXRlKCk7XG4gICAgICAgIHRoaXMucmVzdWx0LmNzcyA9IGRhdGFbMF07XG4gICAgICAgIHRoaXMucmVzdWx0Lm1hcCA9IGRhdGFbMV07XG5cbiAgICAgICAgcmV0dXJuIHRoaXMucmVzdWx0O1xuICAgIH1cblxufVxuXG5leHBvcnQgZGVmYXVsdCBMYXp5UmVzdWx0O1xuXG4vKipcbiAqIEBjYWxsYmFjayBvbkZ1bGZpbGxlZFxuICogQHBhcmFtIHtSZXN1bHR9IHJlc3VsdFxuICovXG5cbi8qKlxuICogQGNhbGxiYWNrIG9uUmVqZWN0ZWRcbiAqIEBwYXJhbSB7RXJyb3J9IGVycm9yXG4gKi9cbiJdfQ==
  9314. /***/ }),
  9315. /* 41 */
  9316. /***/ (function(module, exports, __webpack_require__) {
  9317. "use strict";
  9318. exports.__esModule = true;
  9319. exports.default = parse;
  9320. var _parser = __webpack_require__(42);
  9321. var _parser2 = _interopRequireDefault(_parser);
  9322. var _input = __webpack_require__(18);
  9323. var _input2 = _interopRequireDefault(_input);
  9324. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9325. function parse(css, opts) {
  9326. if (opts && opts.safe) {
  9327. throw new Error('Option safe was removed. ' + 'Use parser: require("postcss-safe-parser")');
  9328. }
  9329. var input = new _input2.default(css, opts);
  9330. var parser = new _parser2.default(input);
  9331. try {
  9332. parser.parse();
  9333. } catch (e) {
  9334. if (e.name === 'CssSyntaxError' && opts && opts.from) {
  9335. if (/\.scss$/i.test(opts.from)) {
  9336. e.message += '\nYou tried to parse SCSS with ' + 'the standard CSS parser; ' + 'try again with the postcss-scss parser';
  9337. } else if (/\.sass/i.test(opts.from)) {
  9338. e.message += '\nYou tried to parse Sass with ' + 'the standard CSS parser; ' + 'try again with the postcss-sass parser';
  9339. } else if (/\.less$/i.test(opts.from)) {
  9340. e.message += '\nYou tried to parse Less with ' + 'the standard CSS parser; ' + 'try again with the postcss-less parser';
  9341. }
  9342. }
  9343. throw e;
  9344. }
  9345. return parser.root;
  9346. }
  9347. module.exports = exports['default'];
  9348. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBhcnNlLmVzNiJdLCJuYW1lcyI6WyJwYXJzZSIsImNzcyIsIm9wdHMiLCJzYWZlIiwiRXJyb3IiLCJpbnB1dCIsInBhcnNlciIsImUiLCJuYW1lIiwiZnJvbSIsInRlc3QiLCJtZXNzYWdlIiwicm9vdCJdLCJtYXBwaW5ncyI6Ijs7O2tCQUd3QkEsSzs7QUFIeEI7Ozs7QUFDQTs7Ozs7O0FBRWUsU0FBU0EsS0FBVCxDQUFlQyxHQUFmLEVBQW9CQyxJQUFwQixFQUEwQjtBQUNyQyxRQUFLQSxRQUFRQSxLQUFLQyxJQUFsQixFQUF5QjtBQUNyQixjQUFNLElBQUlDLEtBQUosQ0FBVSw4QkFDQSw0Q0FEVixDQUFOO0FBRUg7O0FBRUQsUUFBSUMsUUFBUSxvQkFBVUosR0FBVixFQUFlQyxJQUFmLENBQVo7QUFDQSxRQUFJSSxTQUFTLHFCQUFXRCxLQUFYLENBQWI7QUFDQSxRQUFJO0FBQ0FDLGVBQU9OLEtBQVA7QUFDSCxLQUZELEN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Q1NTIHBhcnNlcjsgJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICd0cnkgYWdhaW4gd2l0aCB0aGUgcG9zdGNzcy1sZXNzIHBhcnNlcic7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdGhyb3cgZTtcbiAgICB9XG5cbiAgICByZXR1cm4gcGFyc2VyLnJvb3Q7XG59XG4iXX0=
  9349. /***/ }),
  9350. /* 42 */
  9351. /***/ (function(module, exports, __webpack_require__) {
  9352. "use strict";
  9353. exports.__esModule = true;
  9354. var _declaration = __webpack_require__(39);
  9355. var _declaration2 = _interopRequireDefault(_declaration);
  9356. var _tokenize = __webpack_require__(45);
  9357. var _tokenize2 = _interopRequireDefault(_tokenize);
  9358. var _comment = __webpack_require__(17);
  9359. var _comment2 = _interopRequireDefault(_comment);
  9360. var _atRule = __webpack_require__(16);
  9361. var _atRule2 = _interopRequireDefault(_atRule);
  9362. var _root = __webpack_require__(43);
  9363. var _root2 = _interopRequireDefault(_root);
  9364. var _rule = __webpack_require__(20);
  9365. var _rule2 = _interopRequireDefault(_rule);
  9366. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9367. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9368. var Parser = function () {
  9369. function Parser(input) {
  9370. _classCallCheck(this, Parser);
  9371. this.input = input;
  9372. this.root = new _root2.default();
  9373. this.current = this.root;
  9374. this.spaces = '';
  9375. this.semicolon = false;
  9376. this.createTokenizer();
  9377. this.root.source = { input: input, start: { line: 1, column: 1 } };
  9378. }
  9379. Parser.prototype.createTokenizer = function createTokenizer() {
  9380. this.tokenizer = (0, _tokenize2.default)(this.input);
  9381. };
  9382. Parser.prototype.parse = function parse() {
  9383. var token = void 0;
  9384. while (!this.tokenizer.endOfFile()) {
  9385. token = this.tokenizer.nextToken();
  9386. switch (token[0]) {
  9387. case 'space':
  9388. this.spaces += token[1];
  9389. break;
  9390. case ';':
  9391. this.freeSemicolon(token);
  9392. break;
  9393. case '}':
  9394. this.end(token);
  9395. break;
  9396. case 'comment':
  9397. this.comment(token);
  9398. break;
  9399. case 'at-word':
  9400. this.atrule(token);
  9401. break;
  9402. case '{':
  9403. this.emptyRule(token);
  9404. break;
  9405. default:
  9406. this.other(token);
  9407. break;
  9408. }
  9409. }
  9410. this.endFile();
  9411. };
  9412. Parser.prototype.comment = function comment(token) {
  9413. var node = new _comment2.default();
  9414. this.init(node, token[2], token[3]);
  9415. node.source.end = { line: token[4], column: token[5] };
  9416. var text = token[1].slice(2, -2);
  9417. if (/^\s*$/.test(text)) {
  9418. node.text = '';
  9419. node.raws.left = text;
  9420. node.raws.right = '';
  9421. } else {
  9422. var match = text.match(/^(\s*)([^]*[^\s])(\s*)$/);
  9423. node.text = match[2];
  9424. node.raws.left = match[1];
  9425. node.raws.right = match[3];
  9426. }
  9427. };
  9428. Parser.prototype.emptyRule = function emptyRule(token) {
  9429. var node = new _rule2.default();
  9430. this.init(node, token[2], token[3]);
  9431. node.selector = '';
  9432. node.raws.between = '';
  9433. this.current = node;
  9434. };
  9435. Parser.prototype.other = function other(start) {
  9436. var end = false;
  9437. var type = null;
  9438. var colon = false;
  9439. var bracket = null;
  9440. var brackets = [];
  9441. var tokens = [];
  9442. var token = start;
  9443. while (token) {
  9444. type = token[0];
  9445. tokens.push(token);
  9446. if (type === '(' || type === '[') {
  9447. if (!bracket) bracket = token;
  9448. brackets.push(type === '(' ? ')' : ']');
  9449. } else if (brackets.length === 0) {
  9450. if (type === ';') {
  9451. if (colon) {
  9452. this.decl(tokens);
  9453. return;
  9454. } else {
  9455. break;
  9456. }
  9457. } else if (type === '{') {
  9458. this.rule(tokens);
  9459. return;
  9460. } else if (type === '}') {
  9461. this.tokenizer.back(tokens.pop());
  9462. end = true;
  9463. break;
  9464. } else if (type === ':') {
  9465. colon = true;
  9466. }
  9467. } else if (type === brackets[brackets.length - 1]) {
  9468. brackets.pop();
  9469. if (brackets.length === 0) bracket = null;
  9470. }
  9471. token = this.tokenizer.nextToken();
  9472. }
  9473. if (this.tokenizer.endOfFile()) end = true;
  9474. if (brackets.length > 0) this.unclosedBracket(bracket);
  9475. if (end && colon) {
  9476. while (tokens.length) {
  9477. token = tokens[tokens.length - 1][0];
  9478. if (token !== 'space' && token !== 'comment') break;
  9479. this.tokenizer.back(tokens.pop());
  9480. }
  9481. this.decl(tokens);
  9482. return;
  9483. } else {
  9484. this.unknownWord(tokens);
  9485. }
  9486. };
  9487. Parser.prototype.rule = function rule(tokens) {
  9488. tokens.pop();
  9489. var node = new _rule2.default();
  9490. this.init(node, tokens[0][2], tokens[0][3]);
  9491. node.raws.between = this.spacesAndCommentsFromEnd(tokens);
  9492. this.raw(node, 'selector', tokens);
  9493. this.current = node;
  9494. };
  9495. Parser.prototype.decl = function decl(tokens) {
  9496. var node = new _declaration2.default();
  9497. this.init(node);
  9498. var last = tokens[tokens.length - 1];
  9499. if (last[0] === ';') {
  9500. this.semicolon = true;
  9501. tokens.pop();
  9502. }
  9503. if (last[4]) {
  9504. node.source.end = { line: last[4], column: last[5] };
  9505. } else {
  9506. node.source.end = { line: last[2], column: last[3] };
  9507. }
  9508. while (tokens[0][0] !== 'word') {
  9509. if (tokens.length === 1) this.unknownWord(tokens);
  9510. node.raws.before += tokens.shift()[1];
  9511. }
  9512. node.source.start = { line: tokens[0][2], column: tokens[0][3] };
  9513. node.prop = '';
  9514. while (tokens.length) {
  9515. var type = tokens[0][0];
  9516. if (type === ':' || type === 'space' || type === 'comment') {
  9517. break;
  9518. }
  9519. node.prop += tokens.shift()[1];
  9520. }
  9521. node.raws.between = '';
  9522. var token = void 0;
  9523. while (tokens.length) {
  9524. token = tokens.shift();
  9525. if (token[0] === ':') {
  9526. node.raws.between += token[1];
  9527. break;
  9528. } else {
  9529. node.raws.between += token[1];
  9530. }
  9531. }
  9532. if (node.prop[0] === '_' || node.prop[0] === '*') {
  9533. node.raws.before += node.prop[0];
  9534. node.prop = node.prop.slice(1);
  9535. }
  9536. node.raws.between += this.spacesAndCommentsFromStart(tokens);
  9537. this.precheckMissedSemicolon(tokens);
  9538. for (var i = tokens.length - 1; i > 0; i--) {
  9539. token = tokens[i];
  9540. if (token[1].toLowerCase() === '!important') {
  9541. node.important = true;
  9542. var string = this.stringFrom(tokens, i);
  9543. string = this.spacesFromEnd(tokens) + string;
  9544. if (string !== ' !important') node.raws.important = string;
  9545. break;
  9546. } else if (token[1].toLowerCase() === 'important') {
  9547. var cache = tokens.slice(0);
  9548. var str = '';
  9549. for (var j = i; j > 0; j--) {
  9550. var _type = cache[j][0];
  9551. if (str.trim().indexOf('!') === 0 && _type !== 'space') {
  9552. break;
  9553. }
  9554. str = cache.pop()[1] + str;
  9555. }
  9556. if (str.trim().indexOf('!') === 0) {
  9557. node.important = true;
  9558. node.raws.important = str;
  9559. tokens = cache;
  9560. }
  9561. }
  9562. if (token[0] !== 'space' && token[0] !== 'comment') {
  9563. break;
  9564. }
  9565. }
  9566. this.raw(node, 'value', tokens);
  9567. if (node.value.indexOf(':') !== -1) this.checkMissedSemicolon(tokens);
  9568. };
  9569. Parser.prototype.atrule = function atrule(token) {
  9570. var node = new _atRule2.default();
  9571. node.name = token[1].slice(1);
  9572. if (node.name === '') {
  9573. this.unnamedAtrule(node, token);
  9574. }
  9575. this.init(node, token[2], token[3]);
  9576. var prev = void 0;
  9577. var shift = void 0;
  9578. var last = false;
  9579. var open = false;
  9580. var params = [];
  9581. while (!this.tokenizer.endOfFile()) {
  9582. token = this.tokenizer.nextToken();
  9583. if (token[0] === ';') {
  9584. node.source.end = { line: token[2], column: token[3] };
  9585. this.semicolon = true;
  9586. break;
  9587. } else if (token[0] === '{') {
  9588. open = true;
  9589. break;
  9590. } else if (token[0] === '}') {
  9591. if (params.length > 0) {
  9592. shift = params.length - 1;
  9593. prev = params[shift];
  9594. while (prev && prev[0] === 'space') {
  9595. prev = params[--shift];
  9596. }
  9597. if (prev) {
  9598. node.source.end = { line: prev[4], column: prev[5] };
  9599. }
  9600. }
  9601. this.end(token);
  9602. break;
  9603. } else {
  9604. params.push(token);
  9605. }
  9606. if (this.tokenizer.endOfFile()) {
  9607. last = true;
  9608. break;
  9609. }
  9610. }
  9611. node.raws.between = this.spacesAndCommentsFromEnd(params);
  9612. if (params.length) {
  9613. node.raws.afterName = this.spacesAndCommentsFromStart(params);
  9614. this.raw(node, 'params', params);
  9615. if (last) {
  9616. token = params[params.length - 1];
  9617. node.source.end = { line: token[4], column: token[5] };
  9618. this.spaces = node.raws.between;
  9619. node.raws.between = '';
  9620. }
  9621. } else {
  9622. node.raws.afterName = '';
  9623. node.params = '';
  9624. }
  9625. if (open) {
  9626. node.nodes = [];
  9627. this.current = node;
  9628. }
  9629. };
  9630. Parser.prototype.end = function end(token) {
  9631. if (this.current.nodes && this.current.nodes.length) {
  9632. this.current.raws.semicolon = this.semicolon;
  9633. }
  9634. this.semicolon = false;
  9635. this.current.raws.after = (this.current.raws.after || '') + this.spaces;
  9636. this.spaces = '';
  9637. if (this.current.parent) {
  9638. this.current.source.end = { line: token[2], column: token[3] };
  9639. this.current = this.current.parent;
  9640. } else {
  9641. this.unexpectedClose(token);
  9642. }
  9643. };
  9644. Parser.prototype.endFile = function endFile() {
  9645. if (this.current.parent) this.unclosedBlock();
  9646. if (this.current.nodes && this.current.nodes.length) {
  9647. this.current.raws.semicolon = this.semicolon;
  9648. }
  9649. this.current.raws.after = (this.current.raws.after || '') + this.spaces;
  9650. };
  9651. Parser.prototype.freeSemicolon = function freeSemicolon(token) {
  9652. this.spaces += token[1];
  9653. if (this.current.nodes) {
  9654. var prev = this.current.nodes[this.current.nodes.length - 1];
  9655. if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) {
  9656. prev.raws.ownSemicolon = this.spaces;
  9657. this.spaces = '';
  9658. }
  9659. }
  9660. };
  9661. // Helpers
  9662. Parser.prototype.init = function init(node, line, column) {
  9663. this.current.push(node);
  9664. node.source = { start: { line: line, column: column }, input: this.input };
  9665. node.raws.before = this.spaces;
  9666. this.spaces = '';
  9667. if (node.type !== 'comment') this.semicolon = false;
  9668. };
  9669. Parser.prototype.raw = function raw(node, prop, tokens) {
  9670. var token = void 0,
  9671. type = void 0;
  9672. var length = tokens.length;
  9673. var value = '';
  9674. var clean = true;
  9675. var next = void 0,
  9676. prev = void 0;
  9677. var pattern = /^([.|#])?([\w])+/i;
  9678. for (var i = 0; i < length; i += 1) {
  9679. token = tokens[i];
  9680. type = token[0];
  9681. if (type === 'comment' && node.type === 'rule') {
  9682. prev = tokens[i - 1];
  9683. next = tokens[i + 1];
  9684. if (prev[0] !== 'space' && next[0] !== 'space' && pattern.test(prev[1]) && pattern.test(next[1])) {
  9685. value += token[1];
  9686. } else {
  9687. clean = false;
  9688. }
  9689. continue;
  9690. }
  9691. if (type === 'comment' || type === 'space' && i === length - 1) {
  9692. clean = false;
  9693. } else {
  9694. value += token[1];
  9695. }
  9696. }
  9697. if (!clean) {
  9698. var raw = tokens.reduce(function (all, i) {
  9699. return all + i[1];
  9700. }, '');
  9701. node.raws[prop] = { value: value, raw: raw };
  9702. }
  9703. node[prop] = value;
  9704. };
  9705. Parser.prototype.spacesAndCommentsFromEnd = function spacesAndCommentsFromEnd(tokens) {
  9706. var lastTokenType = void 0;
  9707. var spaces = '';
  9708. while (tokens.length) {
  9709. lastTokenType = tokens[tokens.length - 1][0];
  9710. if (lastTokenType !== 'space' && lastTokenType !== 'comment') break;
  9711. spaces = tokens.pop()[1] + spaces;
  9712. }
  9713. return spaces;
  9714. };
  9715. Parser.prototype.spacesAndCommentsFromStart = function spacesAndCommentsFromStart(tokens) {
  9716. var next = void 0;
  9717. var spaces = '';
  9718. while (tokens.length) {
  9719. next = tokens[0][0];
  9720. if (next !== 'space' && next !== 'comment') break;
  9721. spaces += tokens.shift()[1];
  9722. }
  9723. return spaces;
  9724. };
  9725. Parser.prototype.spacesFromEnd = function spacesFromEnd(tokens) {
  9726. var lastTokenType = void 0;
  9727. var spaces = '';
  9728. while (tokens.length) {
  9729. lastTokenType = tokens[tokens.length - 1][0];
  9730. if (lastTokenType !== 'space') break;
  9731. spaces = tokens.pop()[1] + spaces;
  9732. }
  9733. return spaces;
  9734. };
  9735. Parser.prototype.stringFrom = function stringFrom(tokens, from) {
  9736. var result = '';
  9737. for (var i = from; i < tokens.length; i++) {
  9738. result += tokens[i][1];
  9739. }
  9740. tokens.splice(from, tokens.length - from);
  9741. return result;
  9742. };
  9743. Parser.prototype.colon = function colon(tokens) {
  9744. var brackets = 0;
  9745. var token = void 0,
  9746. type = void 0,
  9747. prev = void 0;
  9748. for (var i = 0; i < tokens.length; i++) {
  9749. token = tokens[i];
  9750. type = token[0];
  9751. if (type === '(') {
  9752. brackets += 1;
  9753. } else if (type === ')') {
  9754. brackets -= 1;
  9755. } else if (brackets === 0 && type === ':') {
  9756. if (!prev) {
  9757. this.doubleColon(token);
  9758. } else if (prev[0] === 'word' && prev[1] === 'progid') {
  9759. continue;
  9760. } else {
  9761. return i;
  9762. }
  9763. }
  9764. prev = token;
  9765. }
  9766. return false;
  9767. };
  9768. // Errors
  9769. Parser.prototype.unclosedBracket = function unclosedBracket(bracket) {
  9770. throw this.input.error('Unclosed bracket', bracket[2], bracket[3]);
  9771. };
  9772. Parser.prototype.unknownWord = function unknownWord(tokens) {
  9773. throw this.input.error('Unknown word', tokens[0][2], tokens[0][3]);
  9774. };
  9775. Parser.prototype.unexpectedClose = function unexpectedClose(token) {
  9776. throw this.input.error('Unexpected }', token[2], token[3]);
  9777. };
  9778. Parser.prototype.unclosedBlock = function unclosedBlock() {
  9779. var pos = this.current.source.start;
  9780. throw this.input.error('Unclosed block', pos.line, pos.column);
  9781. };
  9782. Parser.prototype.doubleColon = function doubleColon(token) {
  9783. throw this.input.error('Double colon', token[2], token[3]);
  9784. };
  9785. Parser.prototype.unnamedAtrule = function unnamedAtrule(node, token) {
  9786. throw this.input.error('At-rule without name', token[2], token[3]);
  9787. };
  9788. Parser.prototype.precheckMissedSemicolon = function precheckMissedSemicolon(tokens) {
  9789. // Hook for Safe Parser
  9790. tokens;
  9791. };
  9792. Parser.prototype.checkMissedSemicolon = function checkMissedSemicolon(tokens) {
  9793. var colon = this.colon(tokens);
  9794. if (colon === false) return;
  9795. var founded = 0;
  9796. var token = void 0;
  9797. for (var j = colon - 1; j >= 0; j--) {
  9798. token = tokens[j];
  9799. if (token[0] !== 'space') {
  9800. founded += 1;
  9801. if (founded === 2) break;
  9802. }
  9803. }
  9804. throw this.input.error('Missed semicolon', token[2], token[3]);
  9805. };
  9806. return Parser;
  9807. }();
  9808. exports.default = Parser;
  9809. module.exports = exports['default'];
  9810. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBhcnNlci5lczYiXSwibmFtZXMiOlsiUGFyc2VyIiwiaW5wdXQiLCJyb290IiwiY3VycmVudCIsInNwYWNlcyIsInNlbWljb2xvbiIsImNyZWF0ZVRva2VuaXplciIsInNvdXJjZSIsInN0YXJ0IiwibGluZSIsImNvbHVtbiIsInRva2VuaXplciIsInBhcnNlIiwidG9rZW4iLCJlbmRPZkZpbGUiLCJuZXh0VG9rZW4iLCJmcmVlU2VtaWNvbG9uIiwiZW5kIiwiY29tbWVudCIsImF0cnVsZSIsImVtcHR5UnVsZSIsIm90aGVyIiwiZW5kRmlsZSIsIm5vZGUiLCJpbml0IiwidGV4dCIsInNsaWNlIiwidGVzdCIsInJhd3MiLCJsZWZ0IiwicmlnaHQiLCJtYXRjaCIsInNlbGVjdG9yIiwiYmV0d2VlbiIsInR5cGUiLCJjb2xvbiIsImJyYWNrZXQiLCJicmFja2V0cyIsInRva2VucyIsInB1c2giLCJsZW5ndGgiLCJkZWNsIiwicnVsZSIsImJhY2siLCJwb3AiLCJ1bmNsb3NlZEJyYWNrZXQiLCJ1bmtub3duV29yZCIsInNwYWNlc0FuZENvbW1lbnRzRnJvbUVuZCIsInJhdyIsImxhc3QiLCJiZWZvcmUiLCJzaGlmdCIsInByb3AiLC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wb3J0IGRlZmF1bHQgY2xhc3MgUGFyc2VyIHtcblxuICAgIGNvbnN0cnVjdG9yKGlucHV0KSB7XG4gICAgICAgIHRoaXMuaW5wdXQgPSBpbnB1dDtcblxuICAgICAgICB0aGlzLnJvb3QgICAgICA9IG5ldyBSb290KCk7XG4gICAgICAgIHRoaXMuY3VycmVudCAgID0gdGhpcy5yb290O1xuICAgICAgICB0aGlzLnNwYWNlcyAgICA9ICcnO1xuICAgICAgICB0aGlzLnNlbWljb2xvbiA9IGZhbHNlO1xuXG4gICAgICAgIHRoaXMuY3JlYXRlVG9rZW5pemVyKCk7XG4gICAgICAgIHRoaXMucm9vdC5zb3VyY2UgPSB7IGlucHV0LCBzdGFydDogeyBsaW5lOiAxLCBjb2x1bW46IDEgfSB9O1xuICAgIH1cblxuICAgIGNyZWF0ZVRva2VuaXplcigpIHtcbiAgICAgICAgdGhpcy50b2tlbml6ZXIgPSB0b2tlbml6ZXIodGhpcy5pbnB1dCk7XG4gICAgfVxuXG4gICAgcGFyc2UoKSB7XG4gICAgICAgIGxldCB0b2tlbjtcbiAgICAgICAgd2hpbGUgKCAhdGhpcy50b2tlbml6ZXIuZW5kT2ZGaWxlKCkgKSB7XG4gICAgICAgICAgICB0b2tlbiA9IHRoaXMudG9rZW5pemVyLm5leHRUb2tlbigpO1xuXG4gICAgICAgICAgICBzd2l0Y2ggKCB0b2tlblswXSApIHtcblxuICAgICAgICAgICAgY2FzZSAnc3BhY2UnOlxuICAgICAgICAgICAgICAgIHRoaXMuc3BhY2VzICs9IHRva2VuWzFdO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBjYXNlICc7JzpcbiAgICAgICAgICAgICAgICB0aGlzLmZyZWVTZW1pY29sb24odG9rZW4pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBjYXNlICd9JzpcbiAgICAgICAgICAgICAgICB0aGlzLmVuZCh0b2tlbik7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIGNhc2UgJ2NvbW1lbnQnOlxuICAgICAgICAgICAgICAgIHRoaXMuY29tbWVudCh0b2tlbik7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIGNhc2UgJ2F0LXdvcmQnOlxuICAgICAgICAgICAgICAgIHRoaXMuYXRydWxlKHRva2VuKTtcbiAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgY2FzZSAneyc6XG4gICAgICAgICAgICAgICAgdGhpcy5lbXB0eVJ1bGUodG9rZW4pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIHRoaXMub3RoZXIodG9rZW4pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHRoaXMuZW5kRmlsZSgpO1xuICAgIH1cblxuICAgIGNvbW1lbnQodG9rZW4pIHtcbiAgICAgICAgbGV0IG5vZGUgPSBuZXcgQ29tbWVudCgpO1xuICAgICAgICB0aGlzLmluaXQobm9kZSwgdG9rZW5bMl0sIHRva2VuWzNdKTtcbiAgICAgICAgbm9kZS5zb3VyY2UuZW5kID0geyBsaW5lOiB0b2tlbls0XSwgY29sdW1uOiB0b2tlbls1XSB9O1xuXG4gICAgICAgIGxldCB0ZXh0ID0gdG9rZW5bMV0uc2xpY2UoMiwgLTIpO1xuICAgICAgICBpZiAoIC9eXFxzKiQvLnRlc3QodGV4dCkgKSB7XG4gICAgICAgICAgICBub2RlLnRleHQgICAgICAgPSAnJztcbiAgICAgICAgICAgIG5vZGUucmF3cy5sZWZ0ICA9IHRleHQ7XG4gICAgICAgICAgICBub2RlLnJhd3MucmlnaHQgPSAnJztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGxldCBtYXRjaCA9IHRleHQubWF0Y2goL14oXFxzKikoW15dKlteXFxzXSkoXFxzKikkLyk7XG4gICAgICAgICAgICBub2RlLnRleHQgICAgICAgPSBtYXRjaFsyXTtcbiAgICAgICAgICAgIG5vZGUucmF3cy5sZWZ0ICA9IG1hdGNoWzFdO1xuICAgICAgICAgICAgbm9kZS5yYXdzLnJpZ2h0ID0gbWF0Y2hbM107XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBlbXB0eVJ1bGUodG9rZW4pIHtcbiAgICAgICAgbGV0IG5vZGUgPSBuZXcgUnVsZSgpO1xuICAgICAgICB0aGlzLmluaXQobm9kZSwgdG9rZW5bMl0sIHRva2VuWzNdKTtcbiAgICAgICAgbm9kZS5zZWxlY3RvciA9ICcnO1xuICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9ICcnO1xuICAgICAgICB0aGlzLmN1cnJlbnQgPSBub2RlO1xuICAgIH1cblxuICAgIG90aGVyKHN0YXJ0KSB7XG4gICAgICAgIGxldCBlbmQgICAgICA9IGZhbHNlO1xuICAgICAgICBsZXQgdHlwZSAgICAgPSBudWxsO1xuICAgICAgICBsZXQgY29sb24gICAgPSBmYWxzZTtcbiAgICAgICAgbGV0IGJyYWNrZXQgID0gbnVsbDtcbiAgICAgICAgbGV0IGJyYWNrZXRzID0gW107XG5cbiAgICAgICAgbGV0IHRva2VucyA9IFtdO1xuICAgICAgICBsZXQgdG9rZW4gPSBzdGFydDtcbiAgICAgICAgd2hpbGUgKCB0b2tlbiApIHtcbiAgICAgICAgICAgIHR5cGUgPSB0b2tlblswXTtcbiAgICAgICAgICAgIHRva2Vucy5wdXNoKHRva2VuKTtcblxuICAgICAgICAgICAgaWYgKCB0eXBlID09PSAnKCcgfHwgdHlwZSA9PT0gJ1snICkge1xuICAgICAgICAgICAgICAgIGlmICggIWJyYWNrZXQgKSBicmFja2V0ID0gdG9rZW47XG4gICAgICAgICAgICAgICAgYnJhY2tldHMucHVzaCh0eXBlID09PSAnKCcgPyAnKScgOiAnXScpO1xuXG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBicmFja2V0cy5sZW5ndGggPT09IDAgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCB0eXBlID09PSAnOycgKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICggY29sb24gKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRlY2wodG9rZW5zKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSAneycgKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucnVsZSh0b2tlbnMpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG5cbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSAnfScgKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMudG9rZW5pemVyLmJhY2sodG9rZW5zLnBvcCgpKTtcbiAgICAgICAgICAgICAgICAgICAgZW5kID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSAnOicgKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbG9uID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHR5cGUgPT09IGJyYWNrZXRzW2JyYWNrZXRzLmxlbmd0aCAtIDFdICkge1xuICAgICAgICAgICAgICAgIGJyYWNrZXRzLnBvcCgpO1xuICAgICAgICAgICAgICAgIGlmICggYnJhY2tldHMubGVuZ3RoID09PSAwICkgYnJhY2tldCA9IG51bGw7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRva2VuID0gdGhpcy50b2tlbml6ZXIubmV4dFRva2VuKCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIHRoaXMudG9rZW5pemVyLmVuZE9mRmlsZSgpICkgZW5kID0gdHJ1ZTtcbiAgICAgICAgaWYgKCBicmFja2V0cy5sZW5ndGggPiAwICkgdGhpcy51bmNsb3NlZEJyYWNrZXQoYnJhY2tldCk7XG5cbiAgICAgICAgaWYgKCBlbmQgJiYgY29sb24gKSB7XG4gICAgICAgICAgICB3aGlsZSAoIHRva2Vucy5sZW5ndGggKSB7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSB0b2tlbnNbdG9rZW5zLmxlbmd0aCAtIDFdWzBdO1xuICAgICAgICAgICAgICAgIGlmICggdG9rZW4gIT09ICdzcGFjZScgJiYgdG9rZW4gIT09ICdjb21tZW50JyApIGJyZWFrO1xuICAgICAgICAgICAgICAgIHRoaXMudG9rZW5pemVyLmJhY2sodG9rZW5zLnBvcCgpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuZGVjbCh0b2tlbnMpO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy51bmtub3duV29yZCh0b2tlbnMpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcnVsZSh0b2tlbnMpIHtcbiAgICAgICAgdG9rZW5zLnBvcCgpO1xuXG4gICAgICAgIGxldCBub2RlID0gbmV3IFJ1bGUoKTtcbiAgICAgICAgdGhpcy5pbml0KG5vZGUsIHRva2Vuc1swXVsyXSwgdG9rZW5zWzBdWzNdKTtcblxuICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9IHRoaXMuc3BhY2VzQW5kQ29tbWVudHNGcm9tRW5kKHRva2Vucyk7XG4gICAgICAgIHRoaXMucmF3KG5vZGUsICdzZWxlY3RvcicsIHRva2Vucyk7XG4gICAgICAgIHRoaXMuY3VycmVudCA9IG5vZGU7XG4gICAgfVxuXG4gICAgZGVjbCh0b2tlbnMpIHtcbiAgICAgICAgbGV0IG5vZGUgPSBuZXcgRGVjbGFyYXRpb24oKTtcbiAgICAgICAgdGhpcy5pbml0KG5vZGUpO1xuXG4gICAgICAgIGxldCBsYXN0ID0gdG9rZW5zW3Rva2Vucy5sZW5ndGggLSAxXTtcbiAgICAgICAgaWYgKCBsYXN0WzBdID09PSAnOycgKSB7XG4gICAgICAgICAgICB0aGlzLnNlbWljb2xvbiA9IHRydWU7XG4gICAgICAgICAgICB0b2tlbnMucG9wKCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCBsYXN0WzRdICkge1xuICAgICAgICAgICAgbm9kZS5zb3VyY2UuZW5kID0geyBsaW5lOiBsYXN0WzRdLCBjb2x1bW46IGxhc3RbNV0gfTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG5vZGUuc291cmNlLmVuZCA9IHsgbGluZTogbGFzdFsyXSwgY29sdW1uOiBsYXN0WzNdIH07XG4gICAgICAgIH1cblxuICAgICAgICB3aGlsZSAoIHRva2Vuc1swXVswXSAhPT0gJ3dvcmQnICkge1xuICAgICAgICAgICAgaWYgKCB0b2tlbnMubGVuZ3RoID09PSAxICkgdGhpcy51bmtub3duV29yZCh0b2tlbnMpO1xuICAgICAgICAgICAgbm9kZS5yYXdzLmJlZm9yZSArPSB0b2tlbnMuc2hpZnQoKVsxXTtcbiAgICAgICAgfVxuICAgICAgICBub2RlLnNvdXJjZS5zdGFydCA9IHsgbGluZTogdG9rZW5zWzBdWzJdLCBjb2x1bW46IHRva2Vuc1swXVszXSB9O1xuXG4gICAgICAgIG5vZGUucHJvcCA9ICcnO1xuICAgICAgICB3aGlsZSAoIHRva2Vucy5sZW5ndGggKSB7XG4gICAgICAgICAgICBsZXQgdHlwZSA9IHRva2Vuc1swXVswXTtcbiAgICAgICAgICAgIGlmICggdHlwZSA9PT0gJzonIHx8IHR5cGUgPT09ICdzcGFjZScgfHwgdHlwZSA9PT0gJ2NvbW1lbnQnICkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbm9kZS5wcm9wICs9IHRva2Vucy5zaGlmdCgpWzFdO1xuICAgICAgICB9XG5cbiAgICAgICAgbm9kZS5yYXdzLmJldHdlZW4gPSAnJztcblxuICAgICAgICBsZXQgdG9rZW47XG4gICAgICAgIHdoaWxlICggdG9rZW5zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIHRva2VuID0gdG9rZW5zLnNoaWZ0KCk7XG5cbiAgICAgICAgICAgIGlmICggdG9rZW5bMF0gPT09ICc6JyApIHtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiArPSB0b2tlblsxXTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbm9kZS5yYXdzLmJldHdlZW4gKz0gdG9rZW5bMV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIG5vZGUucHJvcFswXSA9PT0gJ18nIHx8IG5vZGUucHJvcFswXSA9PT0gJyonICkge1xuICAgICAgICAgICAgbm9kZS5yYXdzLmJlZm9yZSArPSBub2RlLnByb3BbMF07XG4gICAgICAgICAgICBub2RlLnByb3AgPSBub2RlLnByb3Auc2xpY2UoMSk7XG4gICAgICAgIH1cbiAgICAgICAgbm9kZS5yYXdzLmJldHdlZW4gKz0gdGhpcy5zcGFjZXNBbmRDb21tZW50c0Zyb21TdGFydCh0b2tlbnMpO1xuICAgICAgICB0aGlzLnByZWNoZWNrTWlzc2VkU2VtaWNvbG9uKHRva2Vucyk7XG5cbiAgICAgICAgZm9yICggbGV0IGkgPSB0b2tlbnMubGVuZ3RoIC0gMTsgaSA+IDA7IGktLSApIHtcbiAgICAgICAgICAgIHRva2VuID0gdG9rZW5zW2ldO1xuICAgICAgICAgICAgaWYgKCB0b2tlblsxXS50b0xvd2VyQ2FzZSgpID09PSAnIWltcG9ydGFudCcgKSB7XG4gICAgICAgICAgICAgICAgbm9kZS5pbXBvcnRhbnQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGxldCBzdHJpbmcgPSB0aGlzLnN0cmluZ0Zyb20odG9rZW5zLCBpKTtcbiAgICAgICAgICAgICAgICBzdHJpbmcgPSB0aGlzLnNwYWNlc0Zyb21FbmQodG9rZW5zKSArIHN0cmluZztcbiAgICAgICAgICAgICAgICBpZiAoIHN0cmluZyAhPT0gJyAhaW1wb3J0YW50JyApIG5vZGUucmF3cy5pbXBvcnRhbnQgPSBzdHJpbmc7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIH0gZWxzZSBpZiAodG9rZW5bMV0udG9Mb3dlckNhc2UoKSA9PT0gJ2ltcG9ydGFudCcpIHtcbiAgICAgICAgICAgICAgICBsZXQgY2FjaGUgPSB0b2tlbnMuc2xpY2UoMCk7XG4gICAgICAgICAgICAgICAgbGV0IHN0ciAgID0gJyc7XG4gICAgICAgICAgICAgICAgZm9yICggbGV0IGogPSBpOyBqID4gMDsgai0tICkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgdHlwZSA9IGNhY2hlW2pdWzBdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIHN0ci50cmltKCkuaW5kZXhPZignIScpID09PSAwICYmIHR5cGUgIT09ICdzcGFjZScgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBzdHIgPSBjYWNoZS5wb3AoKVsxXSArIHN0cjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCBzdHIudHJpbSgpLmluZGV4T2YoJyEnKSA9PT0gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5pbXBvcnRhbnQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBub2RlLnJhd3MuaW1wb3J0YW50ID0gc3RyO1xuICAgICAgICAgICAgICAgICAgICB0b2tlbnMgPSBjYWNoZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICggdG9rZW5bMF0gIT09ICdzcGFjZScgJiYgdG9rZW5bMF0gIT09ICdjb21tZW50JyApIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMucmF3KG5vZGUsICd2YWx1ZScsIHRva2Vucyk7XG5cbiAgICAgICAgaWYgKCBub2RlLnZhbHVlLmluZGV4T2YoJzonKSAhPT0gLTEgKSB0aGlzLmNoZWNrTWlzc2VkU2VtaWNvbG9uKHRva2Vucyk7XG4gICAgfVxuXG4gICAgYXRydWxlKHRva2VuKSB7XG4gICAgICAgIGxldCBub2RlICA9IG5ldyBBdFJ1bGUoKTtcbiAgICAgICAgbm9kZS5uYW1lID0gdG9rZW5bMV0uc2xpY2UoMSk7XG4gICAgICAgIGlmICggbm9kZS5uYW1lID09PSAnJyApIHtcbiAgICAgICAgICAgIHRoaXMudW5uYW1lZEF0cnVsZShub2RlLCB0b2tlbik7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5pbml0KG5vZGUsIHRva2VuWzJdLCB0b2tlblszXSk7XG5cbiAgICAgICAgbGV0IHByZXY7XG4gICAgICAgIGxldCBzaGlmdDtcbiAgICAgICAgbGV0IGxhc3QgICA9IGZhbHNlO1xuICAgICAgICBsZXQgb3BlbiAgID0gZmFsc2U7XG4gICAgICAgIGxldCBwYXJhbXMgPSBbXTtcblxuICAgICAgICB3aGlsZSAoICF0aGlzLnRva2VuaXplci5lbmRPZkZpbGUoKSApIHtcbiAgICAgICAgICAgIHRva2VuID0gdGhpcy50b2tlbml6ZXIubmV4dFRva2VuKCk7XG5cbiAgICAgICAgICAgIGlmICggdG9rZW5bMF0gPT09ICc7JyApIHtcbiAgICAgICAgICAgICAgICBub2RlLnNvdXJjZS5lbmQgPSB7IGxpbmU6IHRva2VuWzJdLCBjb2x1bW46IHRva2VuWzNdIH07XG4gICAgICAgICAgICAgICAgdGhpcy5zZW1pY29sb24gPSB0cnVlO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggdG9rZW5bMF0gPT09ICd7JyApIHtcbiAgICAgICAgICAgICAgICBvcGVuID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHRva2VuWzBdID09PSAnfScpIHtcbiAgICAgICAgICAgICAgICBpZiAoIHBhcmFtcy5sZW5ndGggPiAwICkge1xuICAgICAgICAgICAgICAgICAgICBzaGlmdCA9IHBhcmFtcy5sZW5ndGggLSAxO1xuICAgICAgICAgICAgICAgICAgICBwcmV2ID0gcGFyYW1zW3NoaWZ0XTtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKCBwcmV2ICYmIHByZXZbMF0gPT09ICdzcGFjZScgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBwcmV2ID0gcGFyYW1zWy0tc2hpZnRdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICggcHJldiApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUuc291cmNlLmVuZCA9IHsgbGluZTogcHJldls0XSwgY29sdW1uOiBwcmV2WzVdIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5lbmQodG9rZW4pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBwYXJhbXMucHVzaCh0b2tlbik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICggdGhpcy50b2tlbml6ZXIuZW5kT2ZGaWxlKCkgKSB7XG4gICAgICAgICAgICAgICAgbGFzdCA9IHRydWU7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9IHRoaXMuc3BhY2VzQW5kQ29tbWVudHNGcm9tRW5kKHBhcmFtcyk7XG4gICAgICAgIGlmICggcGFyYW1zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIG5vZGUucmF3cy5hZnRlck5hbWUgPSB0aGlzLnNwYWNlc0FuZENvbW1lbnRzRnJvbVN0YXJ0KHBhcmFtcyk7XG4gICAgICAgICAgICB0aGlzLnJhdyhub2RlLCAncGFyYW1zJywgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmICggbGFzdCApIHtcbiAgICAgICAgICAgICAgICB0b2tlbiA9IHBhcmFtc1twYXJhbXMubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICAgICAgbm9kZS5zb3VyY2UuZW5kICAgPSB7IGxpbmU6IHRva2VuWzRdLCBjb2x1bW46IHRva2VuWzVdIH07XG4gICAgICAgICAgICAgICAgdGhpcy5zcGFjZXMgICAgICAgPSBub2RlLnJhd3MuYmV0d2VlbjtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9ICcnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbm9kZS5yYXdzLmFmdGVyTmFtZSA9ICcnO1xuICAgICAgICAgICAgbm9kZS5wYXJhbXMgICAgICAgICA9ICcnO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCBvcGVuICkge1xuICAgICAgICAgICAgbm9kZS5ub2RlcyAgID0gW107XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnQgPSBub2RlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZW5kKHRva2VuKSB7XG4gICAgICAgIGlmICggdGhpcy5jdXJyZW50Lm5vZGVzICYmIHRoaXMuY3VycmVudC5ub2Rlcy5sZW5ndGggKSB7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnQucmF3cy5zZW1pY29sb24gPSB0aGlzLnNlbWljb2xvbjtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnNlbWljb2xvbiA9IGZhbHNlO1xuXG4gICAgICAgIHRoaXMuY3VycmVudC5yYXdzLmFmdGVyID0gKHRoaXMuY3VycmVudC5yYXdzLmFmdGVyIHx8ICcnKSArIHRoaXMuc3BhY2VzO1xuICAgICAgICB0aGlzLnNwYWNlcyA9ICcnO1xuXG4gICAgICAgIGlmICggdGhpcy5jdXJyZW50LnBhcmVudCApIHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudC5zb3VyY2UuZW5kID0geyBsaW5lOiB0b2tlblsyXSwgY29sdW1uOiB0b2tlblszXSB9O1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50ID0gdGhpcy5jdXJyZW50LnBhcmVudDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMudW5leHBlY3RlZENsb3NlKHRva2VuKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGVuZEZpbGUoKSB7XG4gICAgICAgIGlmICggdGhpcy5jdXJyZW50LnBhcmVudCApIHRoaXMudW5jbG9zZWRCbG9jaygpO1xuICAgICAgICBpZiAoIHRoaXMuY3VycmVudC5ub2RlcyAmJiB0aGlzLmN1cnJlbnQubm9kZXMubGVuZ3RoICkge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50LnJhd3Muc2VtaWNvbG9uID0gdGhpcy5zZW1pY29sb247XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5jdXJyZW50LnJhd3MuYWZ0ZXIgPSAodGhpcy5jdXJyZW50LnJhd3MuYWZ0ZXIgfHwgJycpICsgdGhpcy5zcGFjZXM7XG4gICAgfVxuXG4gICAgZnJlZVNlbWljb2xvbih0b2tlbikge1xuICAgICAgICB0aGlzLnNwYWNlcyArPSB0b2tlblsxXTtcbiAgICAgICAgaWYgKCB0aGlzLmN1cnJlbnQubm9kZXMgKSB7XG4gICAgICAgICAgICBsZXQgcHJldiA9IHRoaXMuY3VycmVudC5ub2Rlc1t0aGlzLmN1cnJlbnQubm9kZXMubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICBpZiAoIHByZXYgJiYgcHJldi50eXBlID09PSAncnVsZScgJiYgIXByZXYucmF3cy5vd25TZW1pY29sb24gKSB7XG4gICAgICAgICAgICAgICAgcHJldi5yYXdzLm93blNlbWljb2xvbiA9IHRoaXMuc3BhY2VzO1xuICAgICAgICAgICAgICAgIHRoaXMuc3BhY2VzID0gJyc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBIZWxwZXJzXG5cbiAgICBpbml0KG5vZGUsIGxpbmUsIGNvbHVtbikge1xuICAgICAgICB0aGlzLmN1cnJlbnQucHVzaChub2RlKTtcblxuICAgICAgICBub2RlLnNvdXJjZSA9IHsgc3RhcnQ6IHsgbGluZSwgY29sdW1uIH0sIGlucHV0OiB0aGlzLmlucHV0IH07XG4gICAgICAgIG5vZGUucmF3cy5iZWZvcmUgPSB0aGlzLnNwYWNlcztcbiAgICAgICAgdGhpcy5zcGFjZXMgPSAnJztcbiAgICAgICAgaWYgKCBub2RlLnR5cGUgIT09ICdjb21tZW50JyApIHRoaXMuc2VtaWNvbG9uID0gZmFsc2U7XG4gICAgfVxuXG4gICAgcmF3KG5vZGUsIHByb3AsIHRva2Vucykge1xuICAgICAgICBsZXQgdG9rZW4sIHR5cGU7XG4gICAgICAgIGxldCBsZW5ndGggPSB0b2tlbnMubGVuZ3RoO1xuICAgICAgICBsZXQgdmFsdWUgID0gJyc7XG4gICAgICAgIGxldCBjbGVhbiAgPSB0cnVlO1xuICAgICAgICBsZXQgbmV4dCwgcHJldjtcbiAgICAgICAgY29uc3QgcGF0dGVybiA9IC9eKFsufCNdKT8oW1xcd10pKy9pO1xuXG4gICAgICAgIGZvciAoIGxldCBpID0gMDsgaSA8IGxlbmd0aDsgaSArPSAxICkge1xuICAgICAgICAgICAgdG9rZW4gPSB0b2tlbnNbaV07XG4gICAgICAgICAgICB0eXBlICA9IHRva2VuWzBdO1xuXG4gICAgICAgICAgICBpZiAoIHR5cGUgPT09ICdjb21tZW50JyAmJiBub2RlLnR5cGUgPT09ICdydWxlJyApIHtcbiAgICAgICAgICAgICAgICBwcmV2ID0gdG9rZW5zW2kgLSAxXTtcbiAgICAgICAgICAgICAgICBuZXh0ID0gdG9rZW5zW2kgKyAxXTtcblxuICAgICAgICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICAgICAgICAgcHJldlswXSAhPT0gJ3NwYWNlJyAmJlxuICAgICAgICAgICAgICAgICAgICBuZXh0WzBdICE9PSAnc3BhY2UnICYmXG4gICAgICAgICAgICAgICAgICAgIHBhdHRlcm4udGVzdChwcmV2WzFdKSAmJlxuICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuLnRlc3QobmV4dFsxXSlcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUgKz0gdG9rZW5bMV07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY2xlYW4gPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCB0eXBlID09PSAnY29tbWVudCcgfHwgdHlwZSA9PT0gJ3NwYWNlJyAmJiBpID09PSBsZW5ndGggLSAxICkge1xuICAgICAgICAgICAgICAgIGNsZWFuID0gZmFsc2U7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhbHVlICs9IHRva2VuWzFdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICggIWNsZWFuICkge1xuICAgICAgICAgICAgbGV0IHJhdyA9IHRva2Vucy5yZWR1Y2UoIChhbGwsIGkpID0+IGFsbCArIGlbMV0sICcnKTtcbiAgICAgICAgICAgIG5vZGUucmF3c1twcm9wXSA9IHsgdmFsdWUsIHJhdyB9O1xuICAgICAgICB9XG4gICAgICAgIG5vZGVbcHJvcF0gPSB2YWx1ZTtcbiAgICB9XG5cbiAgICBzcGFjZXNBbmRDb21tZW50c0Zyb21FbmQodG9rZW5zKSB7XG4gICAgICAgIGxldCBsYXN0VG9rZW5UeXBlO1xuICAgICAgICBsZXQgc3BhY2VzID0gJyc7XG4gICAgICAgIHdoaWxlICggdG9rZW5zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIGxhc3RUb2tlblR5cGUgPSB0b2tlbnNbdG9rZW5zLmxlbmd0aCAtIDFdWzBdO1xuICAgICAgICAgICAgaWYgKCBsYXN0VG9rZW5UeXBlICE9PSAnc3BhY2UnICYmXG4gICAgICAgICAgICAgICAgbGFzdFRva2VuVHlwZSAhPT0gJ2NvbW1lbnQnICkgYnJlYWs7XG4gICAgICAgICAgICBzcGFjZXMgPSB0b2tlbnMucG9wKClbMV0gKyBzcGFjZXM7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHNwYWNlcztcbiAgICB9XG5cbiAgICBzcGFjZXNBbmRDb21tZW50c0Zyb21TdGFydCh0b2tlbnMpIHtcbiAgICAgICAgbGV0IG5leHQ7XG4gICAgICAgIGxldCBzcGFjZXMgPSAnJztcbiAgICAgICAgd2hpbGUgKCB0b2tlbnMubGVuZ3RoICkge1xuICAgICAgICAgICAgbmV4dCA9IHRva2Vuc1swXVswXTtcbiAgICAgICAgICAgIGlmICggbmV4dCAhPT0gJ3NwYWNlJyAmJiBuZXh0ICE9PSAnY29tbWVudCcgKSBicmVhaztcbiAgICAgICAgICAgIHNwYWNlcyArPSB0b2tlbnMuc2hpZnQoKVsxXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc3BhY2VzO1xuICAgIH1cblxuICAgIHNwYWNlc0Zyb21FbmQodG9rZW5zKSB7XG4gICAgICAgIGxldCBsYXN0VG9rZW5UeXBlO1xuICAgICAgICBsZXQgc3BhY2VzID0gJyc7XG4gICAgICAgIHdoaWxlICggdG9rZW5zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIGxhc3RUb2tlblR5cGUgPSB0b2tlbnNbdG9rZW5zLmxlbmd0aCAtIDFdWzBdO1xuICAgICAgICAgICAgaWYgKCBsYXN0VG9rZW5UeXBlICE9PSAnc3BhY2UnICkgYnJlYWs7XG4gICAgICAgICAgICBzcGFjZXMgPSB0b2tlbnMucG9wKClbMV0gKyBzcGFjZXM7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHNwYWNlcztcbiAgICB9XG5cbiAgICBzdHJpbmdGcm9tKHRva2VucywgZnJvbSkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gJyc7XG4gICAgICAgIGZvciAoIGxldCBpID0gZnJvbTsgaSA8IHRva2Vucy5sZW5ndGg7IGkrKyApIHtcbiAgICAgICAgICAgIHJlc3VsdCArPSB0b2tlbnNbaV1bMV07XG4gICAgICAgIH1cbiAgICAgICAgdG9rZW5zLnNwbGljZShmcm9tLCB0b2tlbnMubGVuZ3RoIC0gZnJvbSk7XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgY29sb24odG9rZW5zKSB7XG4gICAgICAgIGxldCBicmFja2V0cyA9IDA7XG4gICAgICAgIGxldCB0b2tlbiwgdHlwZSwgcHJldjtcbiAgICAgICAgZm9yICggbGV0IGkgPSAwOyBpIDwgdG9rZW5zLmxlbmd0aDsgaSsrICkge1xuICAgICAgICAgICAgdG9rZW4gPSB0b2tlbnNbaV07XG4gICAgICAgICAgICB0eXBlICA9IHRva2VuWzBdO1xuXG4gICAgICAgICAgICBpZiAoIHR5cGUgPT09ICcoJyApIHtcbiAgICAgICAgICAgICAgICBicmFja2V0cyArPSAxO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggdHlwZSA9PT0gJyknICkge1xuICAgICAgICAgICAgICAgIGJyYWNrZXRzIC09IDE7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBicmFja2V0cyA9PT0gMCAmJiB0eXBlID09PSAnOicgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCAhcHJldiApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kb3VibGVDb2xvbih0b2tlbik7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICggcHJldlswXSA9PT0gJ3dvcmQnICYmIHByZXZbMV0gPT09ICdwcm9naWQnICkge1xuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHByZXYgPSB0b2tlbjtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgLy8gRXJyb3JzXG5cbiAgICB1bmNsb3NlZEJyYWNrZXQoYnJhY2tldCkge1xuICAgICAgICB0aHJvdyB0aGlzLmlucHV0LmVycm9yKCdVbmNsb3NlZCBicmFja2V0JywgYnJhY2tldFsyXSwgYnJhY2tldFszXSk7XG4gICAgfVxuXG4gICAgdW5rbm93bldvcmQodG9rZW5zKSB7XG4gICAgICAgIHRocm93IHRoaXMuaW5wdXQuZXJyb3IoJ1Vua25vd24gd29yZCcsIHRva2Vuc1swXVsyXSwgdG9rZW5zWzBdWzNdKTtcbiAgICB9XG5cbiAgICB1bmV4cGVjdGVkQ2xvc2UodG9rZW4pIHtcbiAgICAgICAgdGhyb3cgdGhpcy5pbnB1dC5lcnJvcignVW5leHBlY3RlZCB9JywgdG9rZW5bMl0sIHRva2VuWzNdKTtcbiAgICB9XG5cbiAgICB1bmNsb3NlZEJsb2NrKCkge1xuICAgICAgICBsZXQgcG9zID0gdGhpcy5jdXJyZW50LnNvdXJjZS5zdGFydDtcbiAgICAgICAgdGhyb3cgdGhpcy5pbnB1dC5lcnJvcignVW5jbG9zZWQgYmxvY2snLCBwb3MubGluZSwgcG9zLmNvbHVtbik7XG4gICAgfVxuXG4gICAgZG91YmxlQ29sb24odG9rZW4pIHtcbiAgICAgICAgdGhyb3cgdGhpcy5pbnB1dC5lcnJvcignRG91YmxlIGNvbG9uJywgdG9rZW5bMl0sIHRva2VuWzNdKTtcbiAgICB9XG5cbiAgICB1bm5hbWVkQXRydWxlKG5vZGUsIHRva2VuKSB7XG4gICAgICAgIHRocm93IHRoaXMuaW5wdXQuZXJyb3IoJ0F0LXJ1bGUgd2l0aG91dCBuYW1lJywgdG9rZW5bMl0sIHRva2VuWzNdKTtcbiAgICB9XG5cbiAgICBwcmVjaGVja01pc3NlZFNlbWljb2xvbih0b2tlbnMpIHtcbiAgICAgICAgLy8gSG9vayBmb3IgU2FmZSBQYXJzZXJcbiAgICAgICAgdG9rZW5zO1xuICAgIH1cblxuICAgIGNoZWNrTWlzc2VkU2VtaWNvbG9uKHRva2Vucykge1xuICAgICAgICBsZXQgY29sb24gPSB0aGlzLmNvbG9uKHRva2Vucyk7XG4gICAgICAgIGlmICggY29sb24gPT09IGZhbHNlICkgcmV0dXJuO1xuXG4gICAgICAgIGxldCBmb3VuZGVkID0gMDtcbiAgICAgICAgbGV0IHRva2VuO1xuICAgICAgICBmb3IgKCBsZXQgaiA9IGNvbG9uIC0gMTsgaiA+PSAwOyBqLS0gKSB7XG4gICAgICAgICAgICB0b2tlbiA9IHRva2Vuc1tqXTtcbiAgICAgICAgICAgIGlmICggdG9rZW5bMF0gIT09ICdzcGFjZScgKSB7XG4gICAgICAgICAgICAgICAgZm91bmRlZCArPSAxO1xuICAgICAgICAgICAgICAgIGlmICggZm91bmRlZCA9PT0gMiApIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHRocm93IHRoaXMuaW5wdXQuZXJyb3IoJ01pc3NlZCBzZW1pY29sb24nLCB0b2tlblsyXSwgdG9rZW5bM10pO1xuICAgIH1cblxufVxuIl19
  9811. /***/ }),
  9812. /* 43 */
  9813. /***/ (function(module, exports, __webpack_require__) {
  9814. "use strict";
  9815. exports.__esModule = true;
  9816. var _container = __webpack_require__(13);
  9817. var _container2 = _interopRequireDefault(_container);
  9818. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9819. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9820. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  9821. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  9822. /**
  9823. * Represents a CSS file and contains all its parsed nodes.
  9824. *
  9825. * @extends Container
  9826. *
  9827. * @example
  9828. * const root = postcss.parse('a{color:black} b{z-index:2}');
  9829. * root.type //=> 'root'
  9830. * root.nodes.length //=> 2
  9831. */
  9832. var Root = function (_Container) {
  9833. _inherits(Root, _Container);
  9834. function Root(defaults) {
  9835. _classCallCheck(this, Root);
  9836. var _this = _possibleConstructorReturn(this, _Container.call(this, defaults));
  9837. _this.type = 'root';
  9838. if (!_this.nodes) _this.nodes = [];
  9839. return _this;
  9840. }
  9841. Root.prototype.removeChild = function removeChild(child, ignore) {
  9842. var index = this.index(child);
  9843. if (!ignore && index === 0 && this.nodes.length > 1) {
  9844. this.nodes[1].raws.before = this.nodes[index].raws.before;
  9845. }
  9846. return _Container.prototype.removeChild.call(this, child);
  9847. };
  9848. Root.prototype.normalize = function normalize(child, sample, type) {
  9849. var nodes = _Container.prototype.normalize.call(this, child);
  9850. if (sample) {
  9851. if (type === 'prepend') {
  9852. if (this.nodes.length > 1) {
  9853. sample.raws.before = this.nodes[1].raws.before;
  9854. } else {
  9855. delete sample.raws.before;
  9856. }
  9857. } else if (this.first !== sample) {
  9858. for (var _iterator = nodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  9859. var _ref;
  9860. if (_isArray) {
  9861. if (_i >= _iterator.length) break;
  9862. _ref = _iterator[_i++];
  9863. } else {
  9864. _i = _iterator.next();
  9865. if (_i.done) break;
  9866. _ref = _i.value;
  9867. }
  9868. var node = _ref;
  9869. node.raws.before = sample.raws.before;
  9870. }
  9871. }
  9872. }
  9873. return nodes;
  9874. };
  9875. /**
  9876. * Returns a {@link Result} instance representing the root’s CSS.
  9877. *
  9878. * @param {processOptions} [opts] - options with only `to` and `map` keys
  9879. *
  9880. * @return {Result} result with current root’s CSS
  9881. *
  9882. * @example
  9883. * const root1 = postcss.parse(css1, { from: 'a.css' });
  9884. * const root2 = postcss.parse(css2, { from: 'b.css' });
  9885. * root1.append(root2);
  9886. * const result = root1.toResult({ to: 'all.css', map: true });
  9887. */
  9888. Root.prototype.toResult = function toResult() {
  9889. var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  9890. var LazyResult = __webpack_require__(40);
  9891. var Processor = __webpack_require__(135);
  9892. var lazy = new LazyResult(new Processor(), this, opts);
  9893. return lazy.stringify();
  9894. };
  9895. /**
  9896. * @memberof Root#
  9897. * @member {object} raws - Information to generate byte-to-byte equal
  9898. * node string as it was in the origin input.
  9899. *
  9900. * Every parser saves its own properties,
  9901. * but the default CSS parser uses:
  9902. *
  9903. * * `after`: the space symbols after the last child to the end of file.
  9904. * * `semicolon`: is the last child has an (optional) semicolon.
  9905. *
  9906. * @example
  9907. * postcss.parse('a {}\n').raws //=> { after: '\n' }
  9908. * postcss.parse('a {}').raws //=> { after: '' }
  9909. */
  9910. return Root;
  9911. }(_container2.default);
  9912. exports.default = Root;
  9913. module.exports = exports['default'];
  9914. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJvb3QuZXM2Il0sIm5hbWVzIjpbIlJvb3QiLCJkZWZhdWx0cyIsInR5cGUiLCJub2RlcyI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YWxpemUoY2hpbGQpO1xuXG4gICAgICAgIGlmICggc2FtcGxlICkge1xuICAgICAgICAgICAgaWYgKCB0eXBlID09PSAncHJlcGVuZCcgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCB0aGlzLm5vZGVzLmxlbmd0aCA+IDEgKSB7XG4gICAgICAgICAgICAgICAgICAgIHNhbXBsZS5yYXdzLmJlZm9yZSA9IHRoaXMubm9kZXNbMV0ucmF3cy5iZWZvcmU7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHNhbXBsZS5yYXdzLmJlZm9yZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCB0aGlzLmZpcnN0ICE9PSBzYW1wbGUgKSB7XG4gICAgICAgICAgICAgICAgZm9yICggbGV0IG5vZGUgb2Ygbm9kZXMgKSB7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUucmF3cy5iZWZvcmUgPSBzYW1wbGUucmF3cy5iZWZvcmU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG5vZGVzO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgYSB7QGxpbmsgUmVzdWx0fSBpbnN0YW5jZSByZXByZXNlbnRpbmcgdGhlIHJvb3TigJlzIENTUy5cbiAgICAgKlxuICAgICAqIEBwYXJhbSB7cHJvY2Vzc09wdGlvbnN9IFtvcHRzXSAtIG9wdGlvbnMgd2l0aCBvbmx5IGB0b2AgYW5kIGBtYXBgIGtleXNcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge1Jlc3VsdH0gcmVzdWx0IHdpdGggY3VycmVudCByb2904oCZcyBDU1NcbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogY29uc3Qgcm9vdDEgPSBwb3N0Y3NzLnBhcnNlKGNzczEsIHsgZnJvbTogJ2EuY3NzJyB9K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W4gKG9wdGlvbmFsKSBzZW1pY29sb24uXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHBvc3Rjc3MucGFyc2UoJ2Ege31cXG4nKS5yYXdzIC8vPT4geyBhZnRlcjogJ1xcbicgfVxuICAgICAqIHBvc3Rjc3MucGFyc2UoJ2Ege30nKS5yYXdzICAgLy89PiB7IGFmdGVyOiAnJyB9XG4gICAgICovXG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgUm9vdDtcbiJdfQ==
  9915. /***/ }),
  9916. /* 44 */
  9917. /***/ (function(module, exports, __webpack_require__) {
  9918. "use strict";
  9919. exports.__esModule = true;
  9920. exports.default = stringify;
  9921. var _stringifier = __webpack_require__(21);
  9922. var _stringifier2 = _interopRequireDefault(_stringifier);
  9923. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  9924. function stringify(node, builder) {
  9925. var str = new _stringifier2.default(builder);
  9926. str.stringify(node);
  9927. }
  9928. module.exports = exports['default'];
  9929. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0cmluZ2lmeS5lczYiXSwibmFtZXMiOlsic3RyaW5naWZ5Iiwibm9kZSIsImJ1aWxkZXIiLCJzdHIiXSwibWFwcGluZ3MiOiI7OztrQkFFd0JBLFM7O0FBRnhCOzs7Ozs7QUFFZSxTQUFTQSxTQUFULENBQW1CQyxJQUFuQixFQUF5QkMsT0FBekIsRUFBa0M7QUFDN0MsUUFBSUMsTUFBTSwwQkFBZ0JELE9BQWhCLENBQVY7QUFDQUMsUUFBSUgsU0FBSixDQUFjQyxJQUFkO0FBQ0giLCJmaWxlIjoic3RyaW5naWZ5LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFN0cmluZ2lmaWVyIGZyb20gJy4vc3RyaW5naWZpZXInO1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBzdHJpbmdpZnkobm9kZSwgYnVpbGRlcikge1xuICAgIGxldCBzdHIgPSBuZXcgU3RyaW5naWZpZXIoYnVpbGRlcik7XG4gICAgc3RyLnN0cmluZ2lmeShub2RlKTtcbn1cbiJdfQ==
  9930. /***/ }),
  9931. /* 45 */
  9932. /***/ (function(module, exports, __webpack_require__) {
  9933. "use strict";
  9934. exports.__esModule = true;
  9935. exports.default = tokenizer;
  9936. var SINGLE_QUOTE = 39;
  9937. var DOUBLE_QUOTE = 34;
  9938. var BACKSLASH = 92;
  9939. var SLASH = 47;
  9940. var NEWLINE = 10;
  9941. var SPACE = 32;
  9942. var FEED = 12;
  9943. var TAB = 9;
  9944. var CR = 13;
  9945. var OPEN_SQUARE = 91;
  9946. var CLOSE_SQUARE = 93;
  9947. var OPEN_PARENTHESES = 40;
  9948. var CLOSE_PARENTHESES = 41;
  9949. var OPEN_CURLY = 123;
  9950. var CLOSE_CURLY = 125;
  9951. var SEMICOLON = 59;
  9952. var ASTERISK = 42;
  9953. var COLON = 58;
  9954. var AT = 64;
  9955. var RE_AT_END = /[ \n\t\r\f\{\(\)'"\\;/\[\]#]/g;
  9956. var RE_WORD_END = /[ \n\t\r\f\(\)\{\}:;@!'"\\\]\[#]|\/(?=\*)/g;
  9957. var RE_BAD_BRACKET = /.[\\\/\("'\n]/;
  9958. var RE_HEX_ESCAPE = /[a-f0-9]/i;
  9959. function tokenizer(input) {
  9960. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  9961. var css = input.css.valueOf();
  9962. var ignore = options.ignoreErrors;
  9963. var code = void 0,
  9964. next = void 0,
  9965. quote = void 0,
  9966. lines = void 0,
  9967. last = void 0,
  9968. content = void 0,
  9969. escape = void 0,
  9970. nextLine = void 0,
  9971. nextOffset = void 0,
  9972. escaped = void 0,
  9973. escapePos = void 0,
  9974. prev = void 0,
  9975. n = void 0,
  9976. currentToken = void 0;
  9977. var length = css.length;
  9978. var offset = -1;
  9979. var line = 1;
  9980. var pos = 0;
  9981. var buffer = [];
  9982. var returned = [];
  9983. function unclosed(what) {
  9984. throw input.error('Unclosed ' + what, line, pos - offset);
  9985. }
  9986. function endOfFile() {
  9987. return returned.length === 0 && pos >= length;
  9988. }
  9989. function nextToken() {
  9990. if (returned.length) return returned.pop();
  9991. if (pos >= length) return;
  9992. code = css.charCodeAt(pos);
  9993. if (code === NEWLINE || code === FEED || code === CR && css.charCodeAt(pos + 1) !== NEWLINE) {
  9994. offset = pos;
  9995. line += 1;
  9996. }
  9997. switch (code) {
  9998. case NEWLINE:
  9999. case SPACE:
  10000. case TAB:
  10001. case CR:
  10002. case FEED:
  10003. next = pos;
  10004. do {
  10005. next += 1;
  10006. code = css.charCodeAt(next);
  10007. if (code === NEWLINE) {
  10008. offset = next;
  10009. line += 1;
  10010. }
  10011. } while (code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED);
  10012. currentToken = ['space', css.slice(pos, next)];
  10013. pos = next - 1;
  10014. break;
  10015. case OPEN_SQUARE:
  10016. currentToken = ['[', '[', line, pos - offset];
  10017. break;
  10018. case CLOSE_SQUARE:
  10019. currentToken = [']', ']', line, pos - offset];
  10020. break;
  10021. case OPEN_CURLY:
  10022. currentToken = ['{', '{', line, pos - offset];
  10023. break;
  10024. case CLOSE_CURLY:
  10025. currentToken = ['}', '}', line, pos - offset];
  10026. break;
  10027. case COLON:
  10028. currentToken = [':', ':', line, pos - offset];
  10029. break;
  10030. case SEMICOLON:
  10031. currentToken = [';', ';', line, pos - offset];
  10032. break;
  10033. case OPEN_PARENTHESES:
  10034. prev = buffer.length ? buffer.pop()[1] : '';
  10035. n = css.charCodeAt(pos + 1);
  10036. if (prev === 'url' && n !== SINGLE_QUOTE && n !== DOUBLE_QUOTE && n !== SPACE && n !== NEWLINE && n !== TAB && n !== FEED && n !== CR) {
  10037. next = pos;
  10038. do {
  10039. escaped = false;
  10040. next = css.indexOf(')', next + 1);
  10041. if (next === -1) {
  10042. if (ignore) {
  10043. next = pos;
  10044. break;
  10045. } else {
  10046. unclosed('bracket');
  10047. }
  10048. }
  10049. escapePos = next;
  10050. while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
  10051. escapePos -= 1;
  10052. escaped = !escaped;
  10053. }
  10054. } while (escaped);
  10055. currentToken = ['brackets', css.slice(pos, next + 1), line, pos - offset, line, next - offset];
  10056. pos = next;
  10057. } else {
  10058. next = css.indexOf(')', pos + 1);
  10059. content = css.slice(pos, next + 1);
  10060. if (next === -1 || RE_BAD_BRACKET.test(content)) {
  10061. currentToken = ['(', '(', line, pos - offset];
  10062. } else {
  10063. currentToken = ['brackets', content, line, pos - offset, line, next - offset];
  10064. pos = next;
  10065. }
  10066. }
  10067. break;
  10068. case CLOSE_PARENTHESES:
  10069. currentToken = [')', ')', line, pos - offset];
  10070. break;
  10071. case SINGLE_QUOTE:
  10072. case DOUBLE_QUOTE:
  10073. quote = code === SINGLE_QUOTE ? '\'' : '"';
  10074. next = pos;
  10075. do {
  10076. escaped = false;
  10077. next = css.indexOf(quote, next + 1);
  10078. if (next === -1) {
  10079. if (ignore) {
  10080. next = pos + 1;
  10081. break;
  10082. } else {
  10083. unclosed('string');
  10084. }
  10085. }
  10086. escapePos = next;
  10087. while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
  10088. escapePos -= 1;
  10089. escaped = !escaped;
  10090. }
  10091. } while (escaped);
  10092. content = css.slice(pos, next + 1);
  10093. lines = content.split('\n');
  10094. last = lines.length - 1;
  10095. if (last > 0) {
  10096. nextLine = line + last;
  10097. nextOffset = next - lines[last].length;
  10098. } else {
  10099. nextLine = line;
  10100. nextOffset = offset;
  10101. }
  10102. currentToken = ['string', css.slice(pos, next + 1), line, pos - offset, nextLine, next - nextOffset];
  10103. offset = nextOffset;
  10104. line = nextLine;
  10105. pos = next;
  10106. break;
  10107. case AT:
  10108. RE_AT_END.lastIndex = pos + 1;
  10109. RE_AT_END.test(css);
  10110. if (RE_AT_END.lastIndex === 0) {
  10111. next = css.length - 1;
  10112. } else {
  10113. next = RE_AT_END.lastIndex - 2;
  10114. }
  10115. currentToken = ['at-word', css.slice(pos, next + 1), line, pos - offset, line, next - offset];
  10116. pos = next;
  10117. break;
  10118. case BACKSLASH:
  10119. next = pos;
  10120. escape = true;
  10121. while (css.charCodeAt(next + 1) === BACKSLASH) {
  10122. next += 1;
  10123. escape = !escape;
  10124. }
  10125. code = css.charCodeAt(next + 1);
  10126. if (escape && code !== SLASH && code !== SPACE && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED) {
  10127. next += 1;
  10128. if (RE_HEX_ESCAPE.test(css.charAt(next))) {
  10129. while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) {
  10130. next += 1;
  10131. }
  10132. if (css.charCodeAt(next + 1) === SPACE) {
  10133. next += 1;
  10134. }
  10135. }
  10136. }
  10137. currentToken = ['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset];
  10138. pos = next;
  10139. break;
  10140. default:
  10141. if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) {
  10142. next = css.indexOf('*/', pos + 2) + 1;
  10143. if (next === 0) {
  10144. if (ignore) {
  10145. next = css.length;
  10146. } else {
  10147. unclosed('comment');
  10148. }
  10149. }
  10150. content = css.slice(pos, next + 1);
  10151. lines = content.split('\n');
  10152. last = lines.length - 1;
  10153. if (last > 0) {
  10154. nextLine = line + last;
  10155. nextOffset = next - lines[last].length;
  10156. } else {
  10157. nextLine = line;
  10158. nextOffset = offset;
  10159. }
  10160. currentToken = ['comment', content, line, pos - offset, nextLine, next - nextOffset];
  10161. offset = nextOffset;
  10162. line = nextLine;
  10163. pos = next;
  10164. } else {
  10165. RE_WORD_END.lastIndex = pos + 1;
  10166. RE_WORD_END.test(css);
  10167. if (RE_WORD_END.lastIndex === 0) {
  10168. next = css.length - 1;
  10169. } else {
  10170. next = RE_WORD_END.lastIndex - 2;
  10171. }
  10172. currentToken = ['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset];
  10173. buffer.push(currentToken);
  10174. pos = next;
  10175. }
  10176. break;
  10177. }
  10178. pos++;
  10179. return currentToken;
  10180. }
  10181. function back(token) {
  10182. returned.push(token);
  10183. }
  10184. return {
  10185. back: back,
  10186. nextToken: nextToken,
  10187. endOfFile: endOfFile
  10188. };
  10189. }
  10190. module.exports = exports['default'];
  10191. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRva2VuaXplLmVzNiJdLCJuYW1lcyI6WyJ0b2tlbml6ZXIiLCJTSU5HTEVfUVVPVEUiLCJET1VCTEVfUVVPVEUiLCJCQUNLU0xBU0giLCJTTEFTSCIsIk5FV0xJTkUiLCJTUEFDRSIsIkZFRUQiLCJUQUIiLCJDUiIsIk9QRU5fU1FVQVJFIiwiQ0xPU0VfU1FVQVJFIiwiT1BFTl9QQVJFTlRIRVNFUyIsIkNMT1NFX1BBUkVOVEhFU0VTIiwiT1BFTl9DVVJMWSIsIkNMT1NFX0NVUkxZIiwiU0VNSUNPTE9OIiwiQVNURVJJU0siLCJDT0xPTiIsIkFUIiwiUkVfQVRfRU5EIiwiUkVfV09SRF9FTkQiLCJSRV9CQURfQlJBQ0tFVCIsIlJFX0hFWF9FU0NBUEUiLCJpbnB1dCIsIm9wdGlvbnMiLCJjc3MiLCJ2YWx1ZU9mIiwiaWdub3JlIiwiaWdub3JlRXJyb3JzIiwiY29kZSIsIm5leHQiLCJxdW90ZSIsImxpbmVzIiwibGFzdCIsImNvbnRlbnQiLCJlc2NhcGUiLCJuZXh0TGluZSIsIm5leHRPZmZzZXQiLCJlc2NhcGVkIiwiZXNjYXBlUG9zIiwicHJldiIsIm4iLCJjdXJyZW50VG9rZW4iLCJsZW5ndGgiLCJvZmZzZXQiLCJsaW5lIiwicG9zIiwiYnVmZmVyIiwicmV0dXJuZWQiLCJ1bmNsb3NlZCIsIndoYXQiLCJlcnJvciIsImVuZE9mRmlsZSIsIm5leHRUb2tlbiIsInBvcCIsImNoYXJDb2RlQXQiLCJzbGljZSIsImluZGV4T2YiLCJ0ZXN0Iiwic3BsaX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ICAgICAgY2FzZSBUQUI6XG4gICAgICAgIGNhc2UgQ1I6XG4gICAgICAgIGNhc2UgRkVFRDpcbiAgICAgICAgICAgIG5leHQgPSBwb3M7XG4gICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgbmV4dCArPSAxO1xuICAgICAgICAgICAgICAgIGNvZGUgPSBjc3MuY2hhckNvZGVBdChuZXh0KTtcbiAgICAgICAgICAgICAgICBpZiAoIGNvZGUgPT09IE5FV0xJTkUgKSB7XG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IG5leHQ7XG4gICAgICAgICAgICAgICAgICAgIGxpbmUgKz0gMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IHdoaWxlICggY29kZSA9PT0gU1BBQ0UgICB8fFxuICAgICAgICAgICAgICAgICAgICAgIGNvZGUgPT09IE5FV0xJTkUgfHxcbiAgICAgICAgICAgICAgICAgICAgICBjb2RlID09PSBUQUIgICAgIHx8XG4gICAgICAgICAgICAgICAgICAgICAgY29kZSA9PT0gQ1IgICAgICB8fFxuICAgICAgICAgICAgICAgICAgICAgIGNvZGUgPT09IEZFRUQgKTtcblxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gWydzcGFjZScsIGNzcy5zbGljZShwb3MsIG5leHQpXTtcbiAgICAgICAgICAgIHBvcyA9IG5leHQgLSAxO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBPUEVOX1NRVUFSRTpcbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnWycsICdbJywgbGluZSwgcG9zIC0gb2Zmc2V0XTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQ0xPU0VfU1FVQVJFOlxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gWyddJywgJ10nLCBsaW5lLCBwb3MgLSBvZmZzZXRdO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBPUEVOX0NVUkxZOlxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gWyd7JywgJ3snLCBsaW5lLCBwb3MgLSBvZmZzZXRdO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBDTE9TRV9DVVJMWTpcbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnfScsICd9JywgbGluZSwgcG9zIC0gb2Zmc2V0XTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQ09MT046XG4gICAgICAgICAgICBjdXJyZW50VG9rZW4gPSBbJzonLCAnOicsIGxpbmUsIHBvcyAtIG9mZnNldF07XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIFNFTUlDT0xPTjpcbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnOycsICc7JywgbGluZSwgcG9zIC0gb2Zmc2V0XTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgT1BFTl9QQVJFTlRIRVNFUzpcbiAgICAgICAgICAgIHByZXYgPSBidWZmZXIubGVuZ3RoID8gYnVmZmVyLnBvcCgpWzFdIDogJyc7XG4gICAgICAgICAgICBuICAgID0gY3NzLmNoYXJDb2RlQXQocG9zICsgMSk7XG4gICAgICAgICAgICBpZiAoIHByZXYgPT09ICd1cmwnICYmXG4gICAgICAgICAgICAgICAgIG4gIT09IFNJTkdMRV9RVU9URSAmJiBuICE9PSBET1VCTEVfUVVPVEUgJiZcbiAgICAgICAgICAgICAgICAgbiAhPT0gU1BBQ0UgJiYgbiAhPT0gTkVXTElORSAmJiBuICE9PSBUQUIgJiZcbiAgICAgICAgICAgICAgICAgbiAhPT0gRkVFRCAmJiBuICE9PSBDUiApIHtcbiAgICAgICAgICAgICAgICBuZXh0ID0gcG9zO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgZXNjYXBlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBuZXh0ICAgID0gY3NzLmluZGV4T2YoJyknLCBuZXh0ICsgMSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICggbmV4dCA9PT0gLTEgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIGlnbm9yZSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID0gcG9zO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmNsb3NlZCgnYnJhY2tldCcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVzY2FwZVBvcyA9IG5leHQ7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICggY3NzLmNoYXJDb2RlQXQoZXNjYXBlUG9zIC0gMSkgPT09IEJBQ0tTTEFTSCApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVzY2FwZVBvcyAtPSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgZXNjYXBlZCA9ICFlc2NhcGVkO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoIGVzY2FwZWQgKTtcblxuICAgICAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnYnJhY2tldHMnLCBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSksXG4gICAgICAgICAgICAgICAgICAgIGxpbmUsIHBvcyAgLSBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgIGxpbmUsIG5leHQgLSBvZmZzZXRcbiAgICAgICAgICAgICAgICBdO1xuXG4gICAgICAgICAgICAgICAgcG9zID0gbmV4dDtcblxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBuZXh0ICAgID0gY3NzLmluZGV4T2YoJyknLCBwb3MgKyAxKTtcbiAgICAgICAgICAgICAgICBjb250ZW50ID0gY3NzLnNsaWNlKHBvcywgbmV4dCArIDEpO1xuXG4gICAgICAgICAgICAgICAgaWYgKCBuZXh0ID09PSAtMSB8fCBSRV9CQURfQlJBQ0tFVC50ZXN0KGNvbnRlbnQpICkge1xuICAgICAgICAgICAgICAgICAgICBjdXJyZW50VG9rZW4gPSBbJygnLCAnKCcsIGxpbmUsIHBvcyAtIG9mZnNldF07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudFRva2VuID0gWydicmFja2V0cycsIGNvbnRlbnQsXG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lLCBwb3MgIC0gb2Zmc2V0LFxuICAgICAgICAgICAgICAgICAgICAgICAgbGluZSwgbmV4dCAtIG9mZnNldFxuICAgICAgICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgICAgICAgICBwb3MgPSBuZXh0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBDTE9TRV9QQVJFTlRIRVNFUzpcbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnKScsICcpJywgbGluZSwgcG9zIC0gb2Zmc2V0XTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgU0lOR0xFX1FVT1RFOlxuICAgICAgICBjYXNlIERPVUJMRV9RVU9URTpcbiAgICAgICAgICAgIHF1b3RlID0gY29kZSA9PT0gU0lOR0xFX1FVT1RFID8gJ1xcJycgOiAnXCInO1xuICAgICAgICAgICAgbmV4dCAgPSBwb3M7XG4gICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgZXNjYXBlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIG5leHQgICAgPSBjc3MuaW5kZXhPZihxdW90ZSwgbmV4dCArIDEpO1xuICAgICAgICAgICAgICAgIGlmICggbmV4dCA9PT0gLTEgKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICggaWdub3JlICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbmV4dCA9IHBvcyArIDE7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHVuY2xvc2VkKCdzdHJpbmcnKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlc2NhcGVQb3MgPSBuZXh0O1xuICAgICAgICAgICAgICAgIHdoaWxlICggY3NzLmNoYXJDb2RlQXQoZXNjYXBlUG9zIC0gMSkgPT09IEJBQ0tTTEFTSCApIHtcbiAgICAgICAgICAgICAgICAgICAgZXNjYXBlUG9zIC09IDE7XG4gICAgICAgICAgICAgICAgICAgIGVzY2FwZWQgPSAhZXNjYXBlZDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IHdoaWxlICggZXNjYXBlZCApO1xuXG4gICAgICAgICAgICBjb250ZW50ID0gY3NzLnNsaWNlKHBvcywgbmV4dCArIDEpO1xuICAgICAgICAgICAgbGluZXMgICA9IGNvbnRlbnQuc3BsaXQoJ1xcbicpO1xuICAgICAgICAgICAgbGFzdCAgICA9IGxpbmVzLmxlbmd0aCAtIDE7XG5cbiAgICAgICAgICAgIGlmICggbGFzdCA+IDAgKSB7XG4gICAgICAgICAgICAgICAgbmV4dExpbmUgICA9IGxpbmUgKyBsYXN0O1xuICAgICAgICAgICAgICAgIG5leHRPZmZzZXQgPSBuZXh0IC0gbGluZXNbbGFzdF0ubGVuZ3RoO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBuZXh0TGluZSAgID0gbGluZTtcbiAgICAgICAgICAgICAgICBuZXh0T2Zmc2V0ID0gb2Zmc2V0O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjdXJyZW50VG9rZW4gPSBbJ3N0cmluZycsIGNzcy5zbGljZShwb3MsIG5leHQgKyAxKSxcbiAgICAgICAgICAgICAgICBsaW5lLCBwb3MgIC0gb2Zmc2V0LFxuICAgICAgICAgICAgICAgIG5leHRMaW5lLCBuZXh0IC0gbmV4dE9mZnNldFxuICAgICAgICAgICAgXTtcblxuICAgICAgICAgICAgb2Zmc2V0ID0gbmV4dE9mZnNldDtcbiAgICAgICAgICAgIGxpbmUgICA9IG5leHRMaW5lO1xuICAgICAgICAgICAgcG9zICAgID0gbmV4dDtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQVQ6XG4gICAgICAgICAgICBSRV9BVF9FTkQubGFzdEluZGV4ID0gcG9zICsgMTtcbiAgICAgICAgICAgIFJFX0FUX0VORC50ZXN0KGNzcyk7XG4gICAgICAgICAgICBpZiAoIFJFX0FUX0VORC5sYXN0SW5kZXggPT09IDAgKSB7XG4gICAgICAgICAgICAgICAgbmV4dCA9IGNzcy5sZW5ndGggLSAxO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBuZXh0ID0gUkVfQVRfRU5ELmxhc3RJbmRleCAtIDI7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnYXQtd29yZCcsIGNzcy5zbGljZShwb3MsIG5leHQgKyAxKSxcbiAgICAgICAgICAgICAgICBsaW5lLCBwb3MgIC0gb2Zmc2V0LFxuICAgICAgICAgICAgICAgIGxpbmUsIG5leHQgLSBvZmZzZXRcbiAgICAgICAgICAgIF07XG5cbiAgICAgICAgICAgIHBvcyA9IG5leHQ7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIEJBQ0tTTEFTSDpcbiAgICAgICAgICAgIG5leHQgICA9IHBvcztcbiAgICAgICAgICAgIGVzY2FwZSA9IHRydWU7XG4gICAgICAgICAgICB3aGlsZSAoIGNzcy5jaGFyQ29kZUF0KG5leHQgKyAxKSA9PT0gQkFDS1NMQVNIICkge1xuICAgICAgICAgICAgICAgIG5leHQgICs9IDE7XG4gICAgICAgICAgICAgICAgZXNjYXBlID0gIWVzY2FwZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNvZGUgPSBjc3MuY2hhckNvZGVBdChuZXh0ICsgMSk7XG4gICAgICAgICAgICBpZiAoIGVzY2FwZSAmJiAoY29kZSAhPT0gU0xBU0ggICAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUgIT09IFNQQUNFICAgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlICE9PSBORVdMSU5FICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZSAhPT0gVEFCICAgICAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUgIT09IENSICAgICAgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlICE9PSBGRUVEICkgKSB7XG4gICAgICAgICAgICAgICAgbmV4dCArPSAxO1xuICAgICAgICAgICAgICAgIGlmICggUkVfSEVYX0VTQ0FQRS50ZXN0KGNzcy5jaGFyQXQobmV4dCkpICkge1xuICAgICAgICAgICAgICAgICAgICB3aGlsZSAoIFJFX0hFWF9FU0NBUEUudGVzdChjc3MuY2hhckF0KG5leHQgKyAxKSkgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXh0ICs9IDE7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCBjc3MuY2hhckNvZGVBdChuZXh0ICsgMSkgPT09IFNQQUNFICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbmV4dCArPSAxO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjdXJyZW50VG9rZW4gPSBbJ3dvcmQnLCBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSksXG4gICAgICAgICAgICAgICAgbGluZSwgcG9zICAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICBsaW5lLCBuZXh0IC0gb2Zmc2V0XG4gICAgICAgICAgICBdO1xuXG4gICAgICAgICAgICBwb3MgPSBuZXh0O1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIGlmICggY29kZSA9PT0gU0xBU0ggJiYgY3NzLmNoYXJDb2RlQXQocG9zICsgMSkgPT09IEFTVEVSSVNLICkge1xuICAgICAgICAgICAgICAgIG5leHQgPSBjc3MuaW5kZXhPZignKi8nLCBwb3MgKyAyKSArIDE7XG4gICAgICAgICAgICAgICAgaWYgKCBuZXh0ID09PSAwICkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIGlnbm9yZSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQgPSBjc3MubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdW5jbG9zZWQoJ2NvbW1lbnQnKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGNvbnRlbnQgPSBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSk7XG4gICAgICAgICAgICAgICAgbGluZXMgICA9IGNvbnRlbnQuc3BsaXQoJ1xcbicpO1xuICAgICAgICAgICAgICAgIGxhc3QgICAgPSBsaW5lcy5sZW5ndGggLSAxO1xuXG4gICAgICAgICAgICAgICAgaWYgKCBsYXN0ID4gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgbmV4dExpbmUgICA9IGxpbmUgKyBsYXN0O1xuICAgICAgICAgICAgICAgICAgICBuZXh0T2Zmc2V0ID0gbmV4dCAtIGxpbmVzW2xhc3RdLmxlbmd0aDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBuZXh0TGluZSAgID0gbGluZTtcbiAgICAgICAgICAgICAgICAgICAgbmV4dE9mZnNldCA9IG9mZnNldDtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjdXJyZW50VG9rZW4gPSBbJ2NvbW1lbnQnLCBjb250ZW50LFxuICAgICAgICAgICAgICAgICAgICBsaW5lLCAgICAgcG9zICAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbmV4dExpbmUsIG5leHQgLSBuZXh0T2Zmc2V0XG4gICAgICAgICAgICAgICAgXTtcblxuICAgICAgICAgICAgICAgIG9mZnNldCA9IG5leHRPZmZzZXQ7XG4gICAgICAgICAgICAgICAgbGluZSAgID0gbmV4dExpbmU7XG4gICAgICAgICAgICAgICAgcG9zICAgID0gbmV4dDtcblxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBSRV9XT1JEX0VORC5sYXN0SW5kZXggPSBwb3MgKyAxO1xuICAgICAgICAgICAgICAgIFJFX1dPUkRfRU5ELnRlc3QoY3NzKTtcbiAgICAgICAgICAgICAgICBpZiAoIFJFX1dPUkRfRU5ELmxhc3RJbmRleCA9PT0gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgbmV4dCA9IGNzcy5sZW5ndGggLSAxO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG5leHQgPSBSRV9XT1JEX0VORC5sYXN0SW5kZXggLSAyO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnd29yZCcsIGNzcy5zbGljZShwb3MsIG5leHQgKyAxKSxcbiAgICAgICAgICAgICAgICAgICAgbGluZSwgcG9zICAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbGluZSwgbmV4dCAtIG9mZnNldFxuICAgICAgICAgICAgICAgIF07XG5cbiAgICAgICAgICAgICAgICBidWZmZXIucHVzaChjdXJyZW50VG9rZW4pO1xuXG4gICAgICAgICAgICAgICAgcG9zID0gbmV4dDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICBwb3MrKztcbiAgICAgICAgcmV0dXJuIGN1cnJlbnRUb2tlbjtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBiYWNrKHRva2VuKSB7XG4gICAgICAgIHJldHVybmVkLnB1c2godG9rZW4pO1xuICAgIH1cblxuICAgIHJldHVybiB7XG4gICAgICAgIGJhY2ssXG4gICAgICAgIG5leHRUb2tlbixcbiAgICAgICAgZW5kT2ZGaWxlXG4gICAgfTtcbn1cbiJdfQ==
  10192. /***/ }),
  10193. /* 46 */
  10194. /***/ (function(module, exports, __webpack_require__) {
  10195. "use strict";
  10196. exports.__esModule = true;
  10197. exports.default = warnOnce;
  10198. var printed = {};
  10199. function warnOnce(message) {
  10200. if (printed[message]) return;
  10201. printed[message] = true;
  10202. if (typeof console !== 'undefined' && console.warn) console.warn(message);
  10203. }
  10204. module.exports = exports['default'];
  10205. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndhcm4tb25jZS5lczYiXSwibmFtZXMiOlsid2Fybk9uY2UiLCJwcmludGVkIiwibWVzc2FnZSIsImNvbnNvbGUiLCJ3YXJuIl0sIm1hcHBpbmdzIjoiOzs7a0JBRXdCQSxRO0FBRnhCLElBQUlDLFVBQVUsRUFBZDs7QUFFZSxTQUFTRCxRQUFULENBQWtCRSxPQUFsQixFQUEyQjtBQUN0QyxRQUFLRCxRQUFRQyxPQUFSLENBQUwsRUFBd0I7QUFDeEJELFlBQVFDLE9BQVIsSUFBbUIsSUFBbkI7O0FBRUEsUUFBSyxPQUFPQyxPQUFQLEtBQW1CLFdBQW5CLElBQWtDQSxRQUFRQyxJQUEvQyxFQUFzREQsUUFBUUMsSUFBUixDQUFhRixPQUFiO0FBQ3pEIiwiZmlsZSI6Indhcm4tb25jZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImxldCBwcmludGVkID0geyB9O1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiB3YXJuT25jZShtZXNzYWdlKSB7XG4gICAgaWYgKCBwcmludGVkW21lc3NhZ2VdICkgcmV0dXJuO1xuICAgIHByaW50ZWRbbWVzc2FnZV0gPSB0cnVlO1xuXG4gICAgaWYgKCB0eXBlb2YgY29uc29sZSAhPT0gJ3VuZGVmaW5lZCcgJiYgY29uc29sZS53YXJuICkgY29uc29sZS53YXJuKG1lc3NhZ2UpO1xufVxuIl19
  10206. /***/ }),
  10207. /* 47 */
  10208. /***/ (function(module, exports, __webpack_require__) {
  10209. /* -*- Mode: js; js-indent-level: 2; -*- */
  10210. /*
  10211. * Copyright 2011 Mozilla Foundation and contributors
  10212. * Licensed under the New BSD license. See LICENSE or:
  10213. * http://opensource.org/licenses/BSD-3-Clause
  10214. */
  10215. var util = __webpack_require__(8);
  10216. var has = Object.prototype.hasOwnProperty;
  10217. var hasNativeMap = typeof Map !== "undefined";
  10218. /**
  10219. * A data structure which is a combination of an array and a set. Adding a new
  10220. * member is O(1), testing for membership is O(1), and finding the index of an
  10221. * element is O(1). Removing elements from the set is not supported. Only
  10222. * strings are supported for membership.
  10223. */
  10224. function ArraySet() {
  10225. this._array = [];
  10226. this._set = hasNativeMap ? new Map() : Object.create(null);
  10227. }
  10228. /**
  10229. * Static method for creating ArraySet instances from an existing array.
  10230. */
  10231. ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
  10232. var set = new ArraySet();
  10233. for (var i = 0, len = aArray.length; i < len; i++) {
  10234. set.add(aArray[i], aAllowDuplicates);
  10235. }
  10236. return set;
  10237. };
  10238. /**
  10239. * Return how many unique items are in this ArraySet. If duplicates have been
  10240. * added, than those do not count towards the size.
  10241. *
  10242. * @returns Number
  10243. */
  10244. ArraySet.prototype.size = function ArraySet_size() {
  10245. return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
  10246. };
  10247. /**
  10248. * Add the given string to this set.
  10249. *
  10250. * @param String aStr
  10251. */
  10252. ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
  10253. var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
  10254. var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
  10255. var idx = this._array.length;
  10256. if (!isDuplicate || aAllowDuplicates) {
  10257. this._array.push(aStr);
  10258. }
  10259. if (!isDuplicate) {
  10260. if (hasNativeMap) {
  10261. this._set.set(aStr, idx);
  10262. } else {
  10263. this._set[sStr] = idx;
  10264. }
  10265. }
  10266. };
  10267. /**
  10268. * Is the given string a member of this set?
  10269. *
  10270. * @param String aStr
  10271. */
  10272. ArraySet.prototype.has = function ArraySet_has(aStr) {
  10273. if (hasNativeMap) {
  10274. return this._set.has(aStr);
  10275. } else {
  10276. var sStr = util.toSetString(aStr);
  10277. return has.call(this._set, sStr);
  10278. }
  10279. };
  10280. /**
  10281. * What is the index of the given string in the array?
  10282. *
  10283. * @param String aStr
  10284. */
  10285. ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
  10286. if (hasNativeMap) {
  10287. var idx = this._set.get(aStr);
  10288. if (idx >= 0) {
  10289. return idx;
  10290. }
  10291. } else {
  10292. var sStr = util.toSetString(aStr);
  10293. if (has.call(this._set, sStr)) {
  10294. return this._set[sStr];
  10295. }
  10296. }
  10297. throw new Error('"' + aStr + '" is not in the set.');
  10298. };
  10299. /**
  10300. * What is the element at the given index?
  10301. *
  10302. * @param Number aIdx
  10303. */
  10304. ArraySet.prototype.at = function ArraySet_at(aIdx) {
  10305. if (aIdx >= 0 && aIdx < this._array.length) {
  10306. return this._array[aIdx];
  10307. }
  10308. throw new Error('No element indexed by ' + aIdx);
  10309. };
  10310. /**
  10311. * Returns the array representation of this set (which has the proper indices
  10312. * indicated by indexOf). Note that this is a copy of the internal array used
  10313. * for storing the members so that no one can mess with internal state.
  10314. */
  10315. ArraySet.prototype.toArray = function ArraySet_toArray() {
  10316. return this._array.slice();
  10317. };
  10318. exports.ArraySet = ArraySet;
  10319. /***/ }),
  10320. /* 48 */
  10321. /***/ (function(module, exports, __webpack_require__) {
  10322. /* -*- Mode: js; js-indent-level: 2; -*- */
  10323. /*
  10324. * Copyright 2011 Mozilla Foundation and contributors
  10325. * Licensed under the New BSD license. See LICENSE or:
  10326. * http://opensource.org/licenses/BSD-3-Clause
  10327. *
  10328. * Based on the Base 64 VLQ implementation in Closure Compiler:
  10329. * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
  10330. *
  10331. * Copyright 2011 The Closure Compiler Authors. All rights reserved.
  10332. * Redistribution and use in source and binary forms, with or without
  10333. * modification, are permitted provided that the following conditions are
  10334. * met:
  10335. *
  10336. * * Redistributions of source code must retain the above copyright
  10337. * notice, this list of conditions and the following disclaimer.
  10338. * * Redistributions in binary form must reproduce the above
  10339. * copyright notice, this list of conditions and the following
  10340. * disclaimer in the documentation and/or other materials provided
  10341. * with the distribution.
  10342. * * Neither the name of Google Inc. nor the names of its
  10343. * contributors may be used to endorse or promote products derived
  10344. * from this software without specific prior written permission.
  10345. *
  10346. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  10347. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  10348. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  10349. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  10350. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  10351. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  10352. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  10353. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  10354. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  10355. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  10356. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  10357. */
  10358. var base64 = __webpack_require__(139);
  10359. // A single base 64 digit can contain 6 bits of data. For the base 64 variable
  10360. // length quantities we use in the source map spec, the first bit is the sign,
  10361. // the next four bits are the actual value, and the 6th bit is the
  10362. // continuation bit. The continuation bit tells us whether there are more
  10363. // digits in this value following this digit.
  10364. //
  10365. // Continuation
  10366. // | Sign
  10367. // | |
  10368. // V V
  10369. // 101011
  10370. var VLQ_BASE_SHIFT = 5;
  10371. // binary: 100000
  10372. var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
  10373. // binary: 011111
  10374. var VLQ_BASE_MASK = VLQ_BASE - 1;
  10375. // binary: 100000
  10376. var VLQ_CONTINUATION_BIT = VLQ_BASE;
  10377. /**
  10378. * Converts from a two-complement value to a value where the sign bit is
  10379. * placed in the least significant bit. For example, as decimals:
  10380. * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
  10381. * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
  10382. */
  10383. function toVLQSigned(aValue) {
  10384. return aValue < 0
  10385. ? ((-aValue) << 1) + 1
  10386. : (aValue << 1) + 0;
  10387. }
  10388. /**
  10389. * Converts to a two-complement value from a value where the sign bit is
  10390. * placed in the least significant bit. For example, as decimals:
  10391. * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
  10392. * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
  10393. */
  10394. function fromVLQSigned(aValue) {
  10395. var isNegative = (aValue & 1) === 1;
  10396. var shifted = aValue >> 1;
  10397. return isNegative
  10398. ? -shifted
  10399. : shifted;
  10400. }
  10401. /**
  10402. * Returns the base 64 VLQ encoded value.
  10403. */
  10404. exports.encode = function base64VLQ_encode(aValue) {
  10405. var encoded = "";
  10406. var digit;
  10407. var vlq = toVLQSigned(aValue);
  10408. do {
  10409. digit = vlq & VLQ_BASE_MASK;
  10410. vlq >>>= VLQ_BASE_SHIFT;
  10411. if (vlq > 0) {
  10412. // There are still more digits in this value, so we must make sure the
  10413. // continuation bit is marked.
  10414. digit |= VLQ_CONTINUATION_BIT;
  10415. }
  10416. encoded += base64.encode(digit);
  10417. } while (vlq > 0);
  10418. return encoded;
  10419. };
  10420. /**
  10421. * Decodes the next base 64 VLQ value from the given string and returns the
  10422. * value and the rest of the string via the out parameter.
  10423. */
  10424. exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
  10425. var strLen = aStr.length;
  10426. var result = 0;
  10427. var shift = 0;
  10428. var continuation, digit;
  10429. do {
  10430. if (aIndex >= strLen) {
  10431. throw new Error("Expected more digits in base 64 VLQ value.");
  10432. }
  10433. digit = base64.decode(aStr.charCodeAt(aIndex++));
  10434. if (digit === -1) {
  10435. throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
  10436. }
  10437. continuation = !!(digit & VLQ_CONTINUATION_BIT);
  10438. digit &= VLQ_BASE_MASK;
  10439. result = result + (digit << shift);
  10440. shift += VLQ_BASE_SHIFT;
  10441. } while (continuation);
  10442. aOutParam.value = fromVLQSigned(result);
  10443. aOutParam.rest = aIndex;
  10444. };
  10445. /***/ }),
  10446. /* 49 */
  10447. /***/ (function(module, exports, __webpack_require__) {
  10448. /* -*- Mode: js; js-indent-level: 2; -*- */
  10449. /*
  10450. * Copyright 2011 Mozilla Foundation and contributors
  10451. * Licensed under the New BSD license. See LICENSE or:
  10452. * http://opensource.org/licenses/BSD-3-Clause
  10453. */
  10454. var base64VLQ = __webpack_require__(48);
  10455. var util = __webpack_require__(8);
  10456. var ArraySet = __webpack_require__(47).ArraySet;
  10457. var MappingList = __webpack_require__(141).MappingList;
  10458. /**
  10459. * An instance of the SourceMapGenerator represents a source map which is
  10460. * being built incrementally. You may pass an object with the following
  10461. * properties:
  10462. *
  10463. * - file: The filename of the generated source.
  10464. * - sourceRoot: A root for all relative URLs in this source map.
  10465. */
  10466. function SourceMapGenerator(aArgs) {
  10467. if (!aArgs) {
  10468. aArgs = {};
  10469. }
  10470. this._file = util.getArg(aArgs, 'file', null);
  10471. this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
  10472. this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
  10473. this._sources = new ArraySet();
  10474. this._names = new ArraySet();
  10475. this._mappings = new MappingList();
  10476. this._sourcesContents = null;
  10477. }
  10478. SourceMapGenerator.prototype._version = 3;
  10479. /**
  10480. * Creates a new SourceMapGenerator based on a SourceMapConsumer
  10481. *
  10482. * @param aSourceMapConsumer The SourceMap.
  10483. */
  10484. SourceMapGenerator.fromSourceMap =
  10485. function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
  10486. var sourceRoot = aSourceMapConsumer.sourceRoot;
  10487. var generator = new SourceMapGenerator({
  10488. file: aSourceMapConsumer.file,
  10489. sourceRoot: sourceRoot
  10490. });
  10491. aSourceMapConsumer.eachMapping(function (mapping) {
  10492. var newMapping = {
  10493. generated: {
  10494. line: mapping.generatedLine,
  10495. column: mapping.generatedColumn
  10496. }
  10497. };
  10498. if (mapping.source != null) {
  10499. newMapping.source = mapping.source;
  10500. if (sourceRoot != null) {
  10501. newMapping.source = util.relative(sourceRoot, newMapping.source);
  10502. }
  10503. newMapping.original = {
  10504. line: mapping.originalLine,
  10505. column: mapping.originalColumn
  10506. };
  10507. if (mapping.name != null) {
  10508. newMapping.name = mapping.name;
  10509. }
  10510. }
  10511. generator.addMapping(newMapping);
  10512. });
  10513. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  10514. var sourceRelative = sourceFile;
  10515. if (sourceRoot !== null) {
  10516. sourceRelative = util.relative(sourceRoot, sourceFile);
  10517. }
  10518. if (!generator._sources.has(sourceRelative)) {
  10519. generator._sources.add(sourceRelative);
  10520. }
  10521. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  10522. if (content != null) {
  10523. generator.setSourceContent(sourceFile, content);
  10524. }
  10525. });
  10526. return generator;
  10527. };
  10528. /**
  10529. * Add a single mapping from original source line and column to the generated
  10530. * source's line and column for this source map being created. The mapping
  10531. * object should have the following properties:
  10532. *
  10533. * - generated: An object with the generated line and column positions.
  10534. * - original: An object with the original line and column positions.
  10535. * - source: The original source file (relative to the sourceRoot).
  10536. * - name: An optional original token name for this mapping.
  10537. */
  10538. SourceMapGenerator.prototype.addMapping =
  10539. function SourceMapGenerator_addMapping(aArgs) {
  10540. var generated = util.getArg(aArgs, 'generated');
  10541. var original = util.getArg(aArgs, 'original', null);
  10542. var source = util.getArg(aArgs, 'source', null);
  10543. var name = util.getArg(aArgs, 'name', null);
  10544. if (!this._skipValidation) {
  10545. this._validateMapping(generated, original, source, name);
  10546. }
  10547. if (source != null) {
  10548. source = String(source);
  10549. if (!this._sources.has(source)) {
  10550. this._sources.add(source);
  10551. }
  10552. }
  10553. if (name != null) {
  10554. name = String(name);
  10555. if (!this._names.has(name)) {
  10556. this._names.add(name);
  10557. }
  10558. }
  10559. this._mappings.add({
  10560. generatedLine: generated.line,
  10561. generatedColumn: generated.column,
  10562. originalLine: original != null && original.line,
  10563. originalColumn: original != null && original.column,
  10564. source: source,
  10565. name: name
  10566. });
  10567. };
  10568. /**
  10569. * Set the source content for a source file.
  10570. */
  10571. SourceMapGenerator.prototype.setSourceContent =
  10572. function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
  10573. var source = aSourceFile;
  10574. if (this._sourceRoot != null) {
  10575. source = util.relative(this._sourceRoot, source);
  10576. }
  10577. if (aSourceContent != null) {
  10578. // Add the source content to the _sourcesContents map.
  10579. // Create a new _sourcesContents map if the property is null.
  10580. if (!this._sourcesContents) {
  10581. this._sourcesContents = Object.create(null);
  10582. }
  10583. this._sourcesContents[util.toSetString(source)] = aSourceContent;
  10584. } else if (this._sourcesContents) {
  10585. // Remove the source file from the _sourcesContents map.
  10586. // If the _sourcesContents map is empty, set the property to null.
  10587. delete this._sourcesContents[util.toSetString(source)];
  10588. if (Object.keys(this._sourcesContents).length === 0) {
  10589. this._sourcesContents = null;
  10590. }
  10591. }
  10592. };
  10593. /**
  10594. * Applies the mappings of a sub-source-map for a specific source file to the
  10595. * source map being generated. Each mapping to the supplied source file is
  10596. * rewritten using the supplied source map. Note: The resolution for the
  10597. * resulting mappings is the minimium of this map and the supplied map.
  10598. *
  10599. * @param aSourceMapConsumer The source map to be applied.
  10600. * @param aSourceFile Optional. The filename of the source file.
  10601. * If omitted, SourceMapConsumer's file property will be used.
  10602. * @param aSourceMapPath Optional. The dirname of the path to the source map
  10603. * to be applied. If relative, it is relative to the SourceMapConsumer.
  10604. * This parameter is needed when the two source maps aren't in the same
  10605. * directory, and the source map to be applied contains relative source
  10606. * paths. If so, those relative source paths need to be rewritten
  10607. * relative to the SourceMapGenerator.
  10608. */
  10609. SourceMapGenerator.prototype.applySourceMap =
  10610. function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
  10611. var sourceFile = aSourceFile;
  10612. // If aSourceFile is omitted, we will use the file property of the SourceMap
  10613. if (aSourceFile == null) {
  10614. if (aSourceMapConsumer.file == null) {
  10615. throw new Error(
  10616. 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
  10617. 'or the source map\'s "file" property. Both were omitted.'
  10618. );
  10619. }
  10620. sourceFile = aSourceMapConsumer.file;
  10621. }
  10622. var sourceRoot = this._sourceRoot;
  10623. // Make "sourceFile" relative if an absolute Url is passed.
  10624. if (sourceRoot != null) {
  10625. sourceFile = util.relative(sourceRoot, sourceFile);
  10626. }
  10627. // Applying the SourceMap can add and remove items from the sources and
  10628. // the names array.
  10629. var newSources = new ArraySet();
  10630. var newNames = new ArraySet();
  10631. // Find mappings for the "sourceFile"
  10632. this._mappings.unsortedForEach(function (mapping) {
  10633. if (mapping.source === sourceFile && mapping.originalLine != null) {
  10634. // Check if it can be mapped by the source map, then update the mapping.
  10635. var original = aSourceMapConsumer.originalPositionFor({
  10636. line: mapping.originalLine,
  10637. column: mapping.originalColumn
  10638. });
  10639. if (original.source != null) {
  10640. // Copy mapping
  10641. mapping.source = original.source;
  10642. if (aSourceMapPath != null) {
  10643. mapping.source = util.join(aSourceMapPath, mapping.source)
  10644. }
  10645. if (sourceRoot != null) {
  10646. mapping.source = util.relative(sourceRoot, mapping.source);
  10647. }
  10648. mapping.originalLine = original.line;
  10649. mapping.originalColumn = original.column;
  10650. if (original.name != null) {
  10651. mapping.name = original.name;
  10652. }
  10653. }
  10654. }
  10655. var source = mapping.source;
  10656. if (source != null && !newSources.has(source)) {
  10657. newSources.add(source);
  10658. }
  10659. var name = mapping.name;
  10660. if (name != null && !newNames.has(name)) {
  10661. newNames.add(name);
  10662. }
  10663. }, this);
  10664. this._sources = newSources;
  10665. this._names = newNames;
  10666. // Copy sourcesContents of applied map.
  10667. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  10668. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  10669. if (content != null) {
  10670. if (aSourceMapPath != null) {
  10671. sourceFile = util.join(aSourceMapPath, sourceFile);
  10672. }
  10673. if (sourceRoot != null) {
  10674. sourceFile = util.relative(sourceRoot, sourceFile);
  10675. }
  10676. this.setSourceContent(sourceFile, content);
  10677. }
  10678. }, this);
  10679. };
  10680. /**
  10681. * A mapping can have one of the three levels of data:
  10682. *
  10683. * 1. Just the generated position.
  10684. * 2. The Generated position, original position, and original source.
  10685. * 3. Generated and original position, original source, as well as a name
  10686. * token.
  10687. *
  10688. * To maintain consistency, we validate that any new mapping being added falls
  10689. * in to one of these categories.
  10690. */
  10691. SourceMapGenerator.prototype._validateMapping =
  10692. function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
  10693. aName) {
  10694. // When aOriginal is truthy but has empty values for .line and .column,
  10695. // it is most likely a programmer error. In this case we throw a very
  10696. // specific error message to try to guide them the right way.
  10697. // For example: https://github.com/Polymer/polymer-bundler/pull/519
  10698. if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
  10699. throw new Error(
  10700. 'original.line and original.column are not numbers -- you probably meant to omit ' +
  10701. 'the original mapping entirely and only map the generated position. If so, pass ' +
  10702. 'null for the original mapping instead of an object with empty or null values.'
  10703. );
  10704. }
  10705. if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
  10706. && aGenerated.line > 0 && aGenerated.column >= 0
  10707. && !aOriginal && !aSource && !aName) {
  10708. // Case 1.
  10709. return;
  10710. }
  10711. else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
  10712. && aOriginal && 'line' in aOriginal && 'column' in aOriginal
  10713. && aGenerated.line > 0 && aGenerated.column >= 0
  10714. && aOriginal.line > 0 && aOriginal.column >= 0
  10715. && aSource) {
  10716. // Cases 2 and 3.
  10717. return;
  10718. }
  10719. else {
  10720. throw new Error('Invalid mapping: ' + JSON.stringify({
  10721. generated: aGenerated,
  10722. source: aSource,
  10723. original: aOriginal,
  10724. name: aName
  10725. }));
  10726. }
  10727. };
  10728. /**
  10729. * Serialize the accumulated mappings in to the stream of base 64 VLQs
  10730. * specified by the source map format.
  10731. */
  10732. SourceMapGenerator.prototype._serializeMappings =
  10733. function SourceMapGenerator_serializeMappings() {
  10734. var previousGeneratedColumn = 0;
  10735. var previousGeneratedLine = 1;
  10736. var previousOriginalColumn = 0;
  10737. var previousOriginalLine = 0;
  10738. var previousName = 0;
  10739. var previousSource = 0;
  10740. var result = '';
  10741. var next;
  10742. var mapping;
  10743. var nameIdx;
  10744. var sourceIdx;
  10745. var mappings = this._mappings.toArray();
  10746. for (var i = 0, len = mappings.length; i < len; i++) {
  10747. mapping = mappings[i];
  10748. next = ''
  10749. if (mapping.generatedLine !== previousGeneratedLine) {
  10750. previousGeneratedColumn = 0;
  10751. while (mapping.generatedLine !== previousGeneratedLine) {
  10752. next += ';';
  10753. previousGeneratedLine++;
  10754. }
  10755. }
  10756. else {
  10757. if (i > 0) {
  10758. if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
  10759. continue;
  10760. }
  10761. next += ',';
  10762. }
  10763. }
  10764. next += base64VLQ.encode(mapping.generatedColumn
  10765. - previousGeneratedColumn);
  10766. previousGeneratedColumn = mapping.generatedColumn;
  10767. if (mapping.source != null) {
  10768. sourceIdx = this._sources.indexOf(mapping.source);
  10769. next += base64VLQ.encode(sourceIdx - previousSource);
  10770. previousSource = sourceIdx;
  10771. // lines are stored 0-based in SourceMap spec version 3
  10772. next += base64VLQ.encode(mapping.originalLine - 1
  10773. - previousOriginalLine);
  10774. previousOriginalLine = mapping.originalLine - 1;
  10775. next += base64VLQ.encode(mapping.originalColumn
  10776. - previousOriginalColumn);
  10777. previousOriginalColumn = mapping.originalColumn;
  10778. if (mapping.name != null) {
  10779. nameIdx = this._names.indexOf(mapping.name);
  10780. next += base64VLQ.encode(nameIdx - previousName);
  10781. previousName = nameIdx;
  10782. }
  10783. }
  10784. result += next;
  10785. }
  10786. return result;
  10787. };
  10788. SourceMapGenerator.prototype._generateSourcesContent =
  10789. function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
  10790. return aSources.map(function (source) {
  10791. if (!this._sourcesContents) {
  10792. return null;
  10793. }
  10794. if (aSourceRoot != null) {
  10795. source = util.relative(aSourceRoot, source);
  10796. }
  10797. var key = util.toSetString(source);
  10798. return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
  10799. ? this._sourcesContents[key]
  10800. : null;
  10801. }, this);
  10802. };
  10803. /**
  10804. * Externalize the source map.
  10805. */
  10806. SourceMapGenerator.prototype.toJSON =
  10807. function SourceMapGenerator_toJSON() {
  10808. var map = {
  10809. version: this._version,
  10810. sources: this._sources.toArray(),
  10811. names: this._names.toArray(),
  10812. mappings: this._serializeMappings()
  10813. };
  10814. if (this._file != null) {
  10815. map.file = this._file;
  10816. }
  10817. if (this._sourceRoot != null) {
  10818. map.sourceRoot = this._sourceRoot;
  10819. }
  10820. if (this._sourcesContents) {
  10821. map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
  10822. }
  10823. return map;
  10824. };
  10825. /**
  10826. * Render the source map being generated to a string.
  10827. */
  10828. SourceMapGenerator.prototype.toString =
  10829. function SourceMapGenerator_toString() {
  10830. return JSON.stringify(this.toJSON());
  10831. };
  10832. exports.SourceMapGenerator = SourceMapGenerator;
  10833. /***/ }),
  10834. /* 50 */
  10835. /***/ (function(module, exports, __webpack_require__) {
  10836. /*
  10837. * Copyright 2009-2011 Mozilla Foundation and contributors
  10838. * Licensed under the New BSD license. See LICENSE.txt or:
  10839. * http://opensource.org/licenses/BSD-3-Clause
  10840. */
  10841. exports.SourceMapGenerator = __webpack_require__(49).SourceMapGenerator;
  10842. exports.SourceMapConsumer = __webpack_require__(143).SourceMapConsumer;
  10843. exports.SourceNode = __webpack_require__(144).SourceNode;
  10844. /***/ }),
  10845. /* 51 */
  10846. /***/ (function(module, exports, __webpack_require__) {
  10847. "use strict";
  10848. exports.__esModule = true;
  10849. var _namespace = __webpack_require__(9);
  10850. var _namespace2 = _interopRequireDefault(_namespace);
  10851. var _types = __webpack_require__(0);
  10852. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10853. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10854. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  10855. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  10856. var Attribute = function (_Namespace) {
  10857. _inherits(Attribute, _Namespace);
  10858. function Attribute(opts) {
  10859. _classCallCheck(this, Attribute);
  10860. var _this = _possibleConstructorReturn(this, _Namespace.call(this, opts));
  10861. _this.type = _types.ATTRIBUTE;
  10862. _this.raws = {};
  10863. return _this;
  10864. }
  10865. Attribute.prototype.toString = function toString() {
  10866. var selector = [this.spaces.before, '[', this.ns, this.attribute];
  10867. if (this.operator) {
  10868. selector.push(this.operator);
  10869. }
  10870. if (this.value) {
  10871. selector.push(this.value);
  10872. }
  10873. if (this.raws.insensitive) {
  10874. selector.push(this.raws.insensitive);
  10875. } else if (this.insensitive) {
  10876. selector.push(' i');
  10877. }
  10878. selector.push(']');
  10879. return selector.concat(this.spaces.after).join('');
  10880. };
  10881. return Attribute;
  10882. }(_namespace2.default);
  10883. exports.default = Attribute;
  10884. module.exports = exports['default'];
  10885. /***/ }),
  10886. /* 52 */
  10887. /***/ (function(module, exports, __webpack_require__) {
  10888. "use strict";
  10889. exports.__esModule = true;
  10890. var _namespace = __webpack_require__(9);
  10891. var _namespace2 = _interopRequireDefault(_namespace);
  10892. var _types = __webpack_require__(0);
  10893. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10894. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10895. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  10896. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  10897. var ClassName = function (_Namespace) {
  10898. _inherits(ClassName, _Namespace);
  10899. function ClassName(opts) {
  10900. _classCallCheck(this, ClassName);
  10901. var _this = _possibleConstructorReturn(this, _Namespace.call(this, opts));
  10902. _this.type = _types.CLASS;
  10903. return _this;
  10904. }
  10905. ClassName.prototype.toString = function toString() {
  10906. return [this.spaces.before, this.ns, String('.' + this.value), this.spaces.after].join('');
  10907. };
  10908. return ClassName;
  10909. }(_namespace2.default);
  10910. exports.default = ClassName;
  10911. module.exports = exports['default'];
  10912. /***/ }),
  10913. /* 53 */
  10914. /***/ (function(module, exports, __webpack_require__) {
  10915. "use strict";
  10916. exports.__esModule = true;
  10917. var _node = __webpack_require__(6);
  10918. var _node2 = _interopRequireDefault(_node);
  10919. var _types = __webpack_require__(0);
  10920. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10921. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10922. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  10923. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  10924. var Combinator = function (_Node) {
  10925. _inherits(Combinator, _Node);
  10926. function Combinator(opts) {
  10927. _classCallCheck(this, Combinator);
  10928. var _this = _possibleConstructorReturn(this, _Node.call(this, opts));
  10929. _this.type = _types.COMBINATOR;
  10930. return _this;
  10931. }
  10932. return Combinator;
  10933. }(_node2.default);
  10934. exports.default = Combinator;
  10935. module.exports = exports['default'];
  10936. /***/ }),
  10937. /* 54 */
  10938. /***/ (function(module, exports, __webpack_require__) {
  10939. "use strict";
  10940. exports.__esModule = true;
  10941. var _node = __webpack_require__(6);
  10942. var _node2 = _interopRequireDefault(_node);
  10943. var _types = __webpack_require__(0);
  10944. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10945. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10946. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  10947. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  10948. var Comment = function (_Node) {
  10949. _inherits(Comment, _Node);
  10950. function Comment(opts) {
  10951. _classCallCheck(this, Comment);
  10952. var _this = _possibleConstructorReturn(this, _Node.call(this, opts));
  10953. _this.type = _types.COMMENT;
  10954. return _this;
  10955. }
  10956. return Comment;
  10957. }(_node2.default);
  10958. exports.default = Comment;
  10959. module.exports = exports['default'];
  10960. /***/ }),
  10961. /* 55 */
  10962. /***/ (function(module, exports, __webpack_require__) {
  10963. "use strict";
  10964. exports.__esModule = true;
  10965. var _namespace = __webpack_require__(9);
  10966. var _namespace2 = _interopRequireDefault(_namespace);
  10967. var _types = __webpack_require__(0);
  10968. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10969. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10970. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  10971. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  10972. var ID = function (_Namespace) {
  10973. _inherits(ID, _Namespace);
  10974. function ID(opts) {
  10975. _classCallCheck(this, ID);
  10976. var _this = _possibleConstructorReturn(this, _Namespace.call(this, opts));
  10977. _this.type = _types.ID;
  10978. return _this;
  10979. }
  10980. ID.prototype.toString = function toString() {
  10981. return [this.spaces.before, this.ns, String('#' + this.value), this.spaces.after].join('');
  10982. };
  10983. return ID;
  10984. }(_namespace2.default);
  10985. exports.default = ID;
  10986. module.exports = exports['default'];
  10987. /***/ }),
  10988. /* 56 */
  10989. /***/ (function(module, exports, __webpack_require__) {
  10990. "use strict";
  10991. exports.__esModule = true;
  10992. var _node = __webpack_require__(6);
  10993. var _node2 = _interopRequireDefault(_node);
  10994. var _types = __webpack_require__(0);
  10995. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  10996. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10997. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  10998. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  10999. var Nesting = function (_Node) {
  11000. _inherits(Nesting, _Node);
  11001. function Nesting(opts) {
  11002. _classCallCheck(this, Nesting);
  11003. var _this = _possibleConstructorReturn(this, _Node.call(this, opts));
  11004. _this.type = _types.NESTING;
  11005. _this.value = '&';
  11006. return _this;
  11007. }
  11008. return Nesting;
  11009. }(_node2.default);
  11010. exports.default = Nesting;
  11011. module.exports = exports['default'];
  11012. /***/ }),
  11013. /* 57 */
  11014. /***/ (function(module, exports, __webpack_require__) {
  11015. "use strict";
  11016. exports.__esModule = true;
  11017. var _container = __webpack_require__(22);
  11018. var _container2 = _interopRequireDefault(_container);
  11019. var _types = __webpack_require__(0);
  11020. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11021. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11022. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11023. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11024. var Pseudo = function (_Container) {
  11025. _inherits(Pseudo, _Container);
  11026. function Pseudo(opts) {
  11027. _classCallCheck(this, Pseudo);
  11028. var _this = _possibleConstructorReturn(this, _Container.call(this, opts));
  11029. _this.type = _types.PSEUDO;
  11030. return _this;
  11031. }
  11032. Pseudo.prototype.toString = function toString() {
  11033. var params = this.length ? '(' + this.map(String).join(',') + ')' : '';
  11034. return [this.spaces.before, String(this.value), params, this.spaces.after].join('');
  11035. };
  11036. return Pseudo;
  11037. }(_container2.default);
  11038. exports.default = Pseudo;
  11039. module.exports = exports['default'];
  11040. /***/ }),
  11041. /* 58 */
  11042. /***/ (function(module, exports, __webpack_require__) {
  11043. "use strict";
  11044. exports.__esModule = true;
  11045. var _container = __webpack_require__(22);
  11046. var _container2 = _interopRequireDefault(_container);
  11047. var _types = __webpack_require__(0);
  11048. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11049. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11050. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11051. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11052. var Root = function (_Container) {
  11053. _inherits(Root, _Container);
  11054. function Root(opts) {
  11055. _classCallCheck(this, Root);
  11056. var _this = _possibleConstructorReturn(this, _Container.call(this, opts));
  11057. _this.type = _types.ROOT;
  11058. return _this;
  11059. }
  11060. Root.prototype.toString = function toString() {
  11061. var str = this.reduce(function (memo, selector) {
  11062. var sel = String(selector);
  11063. return sel ? memo + sel + ',' : '';
  11064. }, '').slice(0, -1);
  11065. return this.trailingComma ? str + ',' : str;
  11066. };
  11067. return Root;
  11068. }(_container2.default);
  11069. exports.default = Root;
  11070. module.exports = exports['default'];
  11071. /***/ }),
  11072. /* 59 */
  11073. /***/ (function(module, exports, __webpack_require__) {
  11074. "use strict";
  11075. exports.__esModule = true;
  11076. var _container = __webpack_require__(22);
  11077. var _container2 = _interopRequireDefault(_container);
  11078. var _types = __webpack_require__(0);
  11079. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11080. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11081. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11082. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11083. var Selector = function (_Container) {
  11084. _inherits(Selector, _Container);
  11085. function Selector(opts) {
  11086. _classCallCheck(this, Selector);
  11087. var _this = _possibleConstructorReturn(this, _Container.call(this, opts));
  11088. _this.type = _types.SELECTOR;
  11089. return _this;
  11090. }
  11091. return Selector;
  11092. }(_container2.default);
  11093. exports.default = Selector;
  11094. module.exports = exports['default'];
  11095. /***/ }),
  11096. /* 60 */
  11097. /***/ (function(module, exports, __webpack_require__) {
  11098. "use strict";
  11099. exports.__esModule = true;
  11100. var _node = __webpack_require__(6);
  11101. var _node2 = _interopRequireDefault(_node);
  11102. var _types = __webpack_require__(0);
  11103. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11104. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11105. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11106. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11107. var String = function (_Node) {
  11108. _inherits(String, _Node);
  11109. function String(opts) {
  11110. _classCallCheck(this, String);
  11111. var _this = _possibleConstructorReturn(this, _Node.call(this, opts));
  11112. _this.type = _types.STRING;
  11113. return _this;
  11114. }
  11115. return String;
  11116. }(_node2.default);
  11117. exports.default = String;
  11118. module.exports = exports['default'];
  11119. /***/ }),
  11120. /* 61 */
  11121. /***/ (function(module, exports, __webpack_require__) {
  11122. "use strict";
  11123. exports.__esModule = true;
  11124. var _namespace = __webpack_require__(9);
  11125. var _namespace2 = _interopRequireDefault(_namespace);
  11126. var _types = __webpack_require__(0);
  11127. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11128. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11129. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11130. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11131. var Tag = function (_Namespace) {
  11132. _inherits(Tag, _Namespace);
  11133. function Tag(opts) {
  11134. _classCallCheck(this, Tag);
  11135. var _this = _possibleConstructorReturn(this, _Namespace.call(this, opts));
  11136. _this.type = _types.TAG;
  11137. return _this;
  11138. }
  11139. return Tag;
  11140. }(_namespace2.default);
  11141. exports.default = Tag;
  11142. module.exports = exports['default'];
  11143. /***/ }),
  11144. /* 62 */
  11145. /***/ (function(module, exports, __webpack_require__) {
  11146. "use strict";
  11147. exports.__esModule = true;
  11148. var _namespace = __webpack_require__(9);
  11149. var _namespace2 = _interopRequireDefault(_namespace);
  11150. var _types = __webpack_require__(0);
  11151. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11152. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11153. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11154. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11155. var Universal = function (_Namespace) {
  11156. _inherits(Universal, _Namespace);
  11157. function Universal(opts) {
  11158. _classCallCheck(this, Universal);
  11159. var _this = _possibleConstructorReturn(this, _Namespace.call(this, opts));
  11160. _this.type = _types.UNIVERSAL;
  11161. _this.value = '*';
  11162. return _this;
  11163. }
  11164. return Universal;
  11165. }(_namespace2.default);
  11166. exports.default = Universal;
  11167. module.exports = exports['default'];
  11168. /***/ }),
  11169. /* 63 */
  11170. /***/ (function(module, exports, __webpack_require__) {
  11171. "use strict";
  11172. const Container = __webpack_require__(1);
  11173. class AtWord extends Container {
  11174. constructor (opts) {
  11175. super(opts);
  11176. this.type = 'atword';
  11177. }
  11178. toString () {
  11179. let quote = this.quoted ? this.raws.quote : '';
  11180. return [
  11181. this.raws.before,
  11182. '@',
  11183. // we can't use String() here because it'll try using itself
  11184. // as the constructor
  11185. String.prototype.toString.call(this.value),
  11186. this.raws.after
  11187. ].join('');
  11188. }
  11189. }
  11190. Container.registerWalker(AtWord);
  11191. module.exports = AtWord;
  11192. /***/ }),
  11193. /* 64 */
  11194. /***/ (function(module, exports, __webpack_require__) {
  11195. "use strict";
  11196. const Container = __webpack_require__(1);
  11197. const Node = __webpack_require__(3);
  11198. class Colon extends Node {
  11199. constructor (opts) {
  11200. super(opts);
  11201. this.type = 'colon';
  11202. }
  11203. }
  11204. Container.registerWalker(Colon);
  11205. module.exports = Colon;
  11206. /***/ }),
  11207. /* 65 */
  11208. /***/ (function(module, exports, __webpack_require__) {
  11209. "use strict";
  11210. const Container = __webpack_require__(1);
  11211. const Node = __webpack_require__(3);
  11212. class Comma extends Node {
  11213. constructor (opts) {
  11214. super(opts);
  11215. this.type = 'comma';
  11216. }
  11217. }
  11218. Container.registerWalker(Comma);
  11219. module.exports = Comma;
  11220. /***/ }),
  11221. /* 66 */
  11222. /***/ (function(module, exports, __webpack_require__) {
  11223. "use strict";
  11224. const Container = __webpack_require__(1);
  11225. const Node = __webpack_require__(3);
  11226. class Comment extends Node {
  11227. constructor (opts) {
  11228. super(opts);
  11229. this.type = 'comment';
  11230. this.inline = opts.inline || false;
  11231. }
  11232. toString () {
  11233. return [
  11234. this.raws.before,
  11235. this.inline ? '//' : '/*',
  11236. String(this.value),
  11237. this.inline ? '' : '*/',
  11238. this.raws.after
  11239. ].join('');
  11240. }
  11241. };
  11242. Container.registerWalker(Comment);
  11243. module.exports = Comment;
  11244. /***/ }),
  11245. /* 67 */
  11246. /***/ (function(module, exports, __webpack_require__) {
  11247. "use strict";
  11248. const Container = __webpack_require__(1);
  11249. class FunctionNode extends Container {
  11250. constructor (opts) {
  11251. super(opts);
  11252. this.type = 'func';
  11253. // start off at -1 so we know there haven't been any parens added
  11254. this.unbalanced = -1;
  11255. }
  11256. };
  11257. Container.registerWalker(FunctionNode);
  11258. module.exports = FunctionNode;
  11259. /***/ }),
  11260. /* 68 */
  11261. /***/ (function(module, exports, __webpack_require__) {
  11262. "use strict";
  11263. const Container = __webpack_require__(1);
  11264. const Node = __webpack_require__(3);
  11265. class NumberNode extends Node {
  11266. constructor (opts) {
  11267. super(opts);
  11268. this.type = 'number';
  11269. this.unit = opts.unit || '';
  11270. }
  11271. toString () {
  11272. return [
  11273. this.raws.before,
  11274. String(this.value),
  11275. this.unit,
  11276. this.raws.after
  11277. ].join('');
  11278. }
  11279. };
  11280. Container.registerWalker(NumberNode);
  11281. module.exports = NumberNode;
  11282. /***/ }),
  11283. /* 69 */
  11284. /***/ (function(module, exports, __webpack_require__) {
  11285. "use strict";
  11286. const Container = __webpack_require__(1);
  11287. const Node = __webpack_require__(3);
  11288. class Operator extends Node {
  11289. constructor (opts) {
  11290. super(opts);
  11291. this.type = 'operator';
  11292. }
  11293. }
  11294. Container.registerWalker(Operator);
  11295. module.exports = Operator;
  11296. /***/ }),
  11297. /* 70 */
  11298. /***/ (function(module, exports, __webpack_require__) {
  11299. "use strict";
  11300. const Container = __webpack_require__(1);
  11301. const Node = __webpack_require__(3);
  11302. class Parenthesis extends Node {
  11303. constructor (opts) {
  11304. super(opts);
  11305. this.type = 'paren';
  11306. this.parenType = '';
  11307. }
  11308. }
  11309. Container.registerWalker(Parenthesis);
  11310. module.exports = Parenthesis;
  11311. /***/ }),
  11312. /* 71 */
  11313. /***/ (function(module, exports, __webpack_require__) {
  11314. "use strict";
  11315. const Container = __webpack_require__(1);
  11316. const Node = __webpack_require__(3);
  11317. class StringNode extends Node {
  11318. constructor (opts) {
  11319. super(opts);
  11320. this.type = 'string';
  11321. }
  11322. toString () {
  11323. let quote = this.quoted ? this.raws.quote : '';
  11324. return [
  11325. this.raws.before,
  11326. quote,
  11327. // we can't use String() here because it'll try using itself
  11328. // as the constructor
  11329. this.value + '',
  11330. quote,
  11331. this.raws.after
  11332. ].join('');
  11333. }
  11334. }
  11335. Container.registerWalker(StringNode);
  11336. module.exports = StringNode;
  11337. /***/ }),
  11338. /* 72 */
  11339. /***/ (function(module, exports, __webpack_require__) {
  11340. "use strict";
  11341. const Container = __webpack_require__(1);
  11342. const Node = __webpack_require__(3);
  11343. class UnicodeRange extends Node {
  11344. constructor (opts) {
  11345. super(opts);
  11346. this.type = 'unicode-range';
  11347. }
  11348. }
  11349. Container.registerWalker(UnicodeRange);
  11350. module.exports = UnicodeRange;
  11351. /***/ }),
  11352. /* 73 */
  11353. /***/ (function(module, exports, __webpack_require__) {
  11354. "use strict";
  11355. const Container = __webpack_require__(1);
  11356. module.exports = class Value extends Container {
  11357. constructor (opts) {
  11358. super(opts);
  11359. this.type = 'value';
  11360. this.unbalanced = 0;
  11361. }
  11362. };
  11363. /***/ }),
  11364. /* 74 */
  11365. /***/ (function(module, exports, __webpack_require__) {
  11366. "use strict";
  11367. const Container = __webpack_require__(1);
  11368. const Node = __webpack_require__(3);
  11369. class Word extends Node {
  11370. constructor (opts) {
  11371. super(opts);
  11372. this.type = 'word';
  11373. }
  11374. }
  11375. Container.registerWalker(Word);
  11376. module.exports = Word;
  11377. /***/ }),
  11378. /* 75 */
  11379. /***/ (function(module, exports, __webpack_require__) {
  11380. "use strict";
  11381. exports.__esModule = true;
  11382. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  11383. var _supportsColor = __webpack_require__(170);
  11384. var _supportsColor2 = _interopRequireDefault(_supportsColor);
  11385. var _chalk = __webpack_require__(82);
  11386. var _chalk2 = _interopRequireDefault(_chalk);
  11387. var _terminalHighlight = __webpack_require__(159);
  11388. var _terminalHighlight2 = _interopRequireDefault(_terminalHighlight);
  11389. var _warnOnce = __webpack_require__(4);
  11390. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  11391. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11392. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11393. /**
  11394. * The CSS parser throws this error for broken CSS.
  11395. *
  11396. * Custom parsers can throw this error for broken custom syntax using
  11397. * the {@link Node#error} method.
  11398. *
  11399. * PostCSS will use the input source map to detect the original error location.
  11400. * If you wrote a Sass file, compiled it to CSS and then parsed it with PostCSS,
  11401. * PostCSS will show the original position in the Sass file.
  11402. *
  11403. * If you need the position in the PostCSS input
  11404. * (e.g., to debug the previous compiler), use `error.input.file`.
  11405. *
  11406. * @example
  11407. * // Catching and checking syntax error
  11408. * try {
  11409. * postcss.parse('a{')
  11410. * } catch (error) {
  11411. * if ( error.name === 'CssSyntaxError' ) {
  11412. * error //=> CssSyntaxError
  11413. * }
  11414. * }
  11415. *
  11416. * @example
  11417. * // Raising error from plugin
  11418. * throw node.error('Unknown variable', { plugin: 'postcss-vars' });
  11419. */
  11420. var CssSyntaxError = function () {
  11421. /**
  11422. * @param {string} message - error message
  11423. * @param {number} [line] - source line of the error
  11424. * @param {number} [column] - source column of the error
  11425. * @param {string} [source] - source code of the broken file
  11426. * @param {string} [file] - absolute path to the broken file
  11427. * @param {string} [plugin] - PostCSS plugin name, if error came from plugin
  11428. */
  11429. function CssSyntaxError(message, line, column, source, file, plugin) {
  11430. _classCallCheck(this, CssSyntaxError);
  11431. /**
  11432. * @member {string} - Always equal to `'CssSyntaxError'`. You should
  11433. * always check error type
  11434. * by `error.name === 'CssSyntaxError'` instead of
  11435. * `error instanceof CssSyntaxError`, because
  11436. * npm could have several PostCSS versions.
  11437. *
  11438. * @example
  11439. * if ( error.name === 'CssSyntaxError' ) {
  11440. * error //=> CssSyntaxError
  11441. * }
  11442. */
  11443. this.name = 'CssSyntaxError';
  11444. /**
  11445. * @member {string} - Error message.
  11446. *
  11447. * @example
  11448. * error.message //=> 'Unclosed block'
  11449. */
  11450. this.reason = message;
  11451. if (file) {
  11452. /**
  11453. * @member {string} - Absolute path to the broken file.
  11454. *
  11455. * @example
  11456. * error.file //=> 'a.sass'
  11457. * error.input.file //=> 'a.css'
  11458. */
  11459. this.file = file;
  11460. }
  11461. if (source) {
  11462. /**
  11463. * @member {string} - Source code of the broken file.
  11464. *
  11465. * @example
  11466. * error.source //=> 'a { b {} }'
  11467. * error.input.column //=> 'a b { }'
  11468. */
  11469. this.source = source;
  11470. }
  11471. if (plugin) {
  11472. /**
  11473. * @member {string} - Plugin name, if error came from plugin.
  11474. *
  11475. * @example
  11476. * error.plugin //=> 'postcss-vars'
  11477. */
  11478. this.plugin = plugin;
  11479. }
  11480. if (typeof line !== 'undefined' && typeof column !== 'undefined') {
  11481. /**
  11482. * @member {number} - Source line of the error.
  11483. *
  11484. * @example
  11485. * error.line //=> 2
  11486. * error.input.line //=> 4
  11487. */
  11488. this.line = line;
  11489. /**
  11490. * @member {number} - Source column of the error.
  11491. *
  11492. * @example
  11493. * error.column //=> 1
  11494. * error.input.column //=> 4
  11495. */
  11496. this.column = column;
  11497. }
  11498. this.setMessage();
  11499. if (Error.captureStackTrace) {
  11500. Error.captureStackTrace(this, CssSyntaxError);
  11501. }
  11502. }
  11503. CssSyntaxError.prototype.setMessage = function setMessage() {
  11504. /**
  11505. * @member {string} - Full error text in the GNU error format
  11506. * with plugin, file, line and column.
  11507. *
  11508. * @example
  11509. * error.message //=> 'a.css:1:1: Unclosed block'
  11510. */
  11511. this.message = this.plugin ? this.plugin + ': ' : '';
  11512. this.message += this.file ? this.file : '<css input>';
  11513. if (typeof this.line !== 'undefined') {
  11514. this.message += ':' + this.line + ':' + this.column;
  11515. }
  11516. this.message += ': ' + this.reason;
  11517. };
  11518. /**
  11519. * Returns a few lines of CSS source that caused the error.
  11520. *
  11521. * If the CSS has an input source map without `sourceContent`,
  11522. * this method will return an empty string.
  11523. *
  11524. * @param {boolean} [color] whether arrow will be colored red by terminal
  11525. * color codes. By default, PostCSS will detect
  11526. * color support by `process.stdout.isTTY`
  11527. * and `process.env.NODE_DISABLE_COLORS`.
  11528. *
  11529. * @example
  11530. * error.showSourceCode() //=> " 4 | }
  11531. * // 5 | a {
  11532. * // > 6 | bad
  11533. * // | ^
  11534. * // 7 | }
  11535. * // 8 | b {"
  11536. *
  11537. * @return {string} few lines of CSS source that caused the error
  11538. */
  11539. CssSyntaxError.prototype.showSourceCode = function showSourceCode(color) {
  11540. var _this = this;
  11541. if (!this.source) return '';
  11542. var css = this.source;
  11543. if (typeof color === 'undefined') color = _supportsColor2.default;
  11544. if (color) css = (0, _terminalHighlight2.default)(css);
  11545. var lines = css.split(/\r?\n/);
  11546. var start = Math.max(this.line - 3, 0);
  11547. var end = Math.min(this.line + 2, lines.length);
  11548. var maxWidth = String(end).length;
  11549. var colors = new _chalk2.default.constructor({ enabled: true });
  11550. function mark(text) {
  11551. if (color) {
  11552. return colors.red.bold(text);
  11553. } else {
  11554. return text;
  11555. }
  11556. }
  11557. function aside(text) {
  11558. if (color) {
  11559. return colors.gray(text);
  11560. } else {
  11561. return text;
  11562. }
  11563. }
  11564. return lines.slice(start, end).map(function (line, index) {
  11565. var number = start + 1 + index;
  11566. var gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | ';
  11567. if (number === _this.line) {
  11568. var spacing = aside(gutter.replace(/\d/g, ' ')) + line.slice(0, _this.column - 1).replace(/[^\t]/g, ' ');
  11569. return mark('>') + aside(gutter) + line + '\n ' + spacing + mark('^');
  11570. } else {
  11571. return ' ' + aside(gutter) + line;
  11572. }
  11573. }).join('\n');
  11574. };
  11575. /**
  11576. * Returns error position, message and source code of the broken part.
  11577. *
  11578. * @example
  11579. * error.toString() //=> "CssSyntaxError: app.css:1:1: Unclosed block
  11580. * // > 1 | a {
  11581. * // | ^"
  11582. *
  11583. * @return {string} error position, message and source code
  11584. */
  11585. CssSyntaxError.prototype.toString = function toString() {
  11586. var code = this.showSourceCode();
  11587. if (code) {
  11588. code = '\n\n' + code + '\n';
  11589. }
  11590. return this.name + ': ' + this.message + code;
  11591. };
  11592. _createClass(CssSyntaxError, [{
  11593. key: 'generated',
  11594. get: function get() {
  11595. (0, _warnOnce2.default)('CssSyntaxError#generated is deprecated. Use input instead.');
  11596. return this.input;
  11597. }
  11598. /**
  11599. * @memberof CssSyntaxError#
  11600. * @member {Input} input - Input object with PostCSS internal information
  11601. * about input file. If input has source map
  11602. * from previous tool, PostCSS will use origin
  11603. * (for example, Sass) source. You can use this
  11604. * object to get PostCSS input source.
  11605. *
  11606. * @example
  11607. * error.input.file //=> 'a.css'
  11608. * error.file //=> 'a.sass'
  11609. */
  11610. }]);
  11611. return CssSyntaxError;
  11612. }();
  11613. exports.default = CssSyntaxError;
  11614. module.exports = exports['default'];
  11615. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNzcy1ze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9yIGNhbWUgZnJvbSBwbHVnaW5cbiAgICAgKi9cbiAgICBjb25zdHJ1Y3RvcihtZXNzYWdlLCBsaW5lLCBjb2x1bW4sIHNvdXJjZSwgZmlsZSwgcGx1Z2luKSB7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtzdHJpbmd9IC0gQWx3YXlzIGVxdWFsIHRvIGAnQ3NzU3ludGF4RXJyb3InYC4gWW91IHNob3VsZFxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgYWx3YXlzIGNoZWNrIGVycm9yIHR5cGVcbiAgICAgICAgICogICAgICAgICAgICAgICAgICAgIGJ5IGBlcnJvci5uYW1lID09PSAnQ3NzU3ludGF4RXJyb3InYCBpbnN0ZWFkIG9mXG4gICAgICAgICAqICAgICAgICAgICAgICAgICAgICBgZXJyb3IgaW5zdGFuY2VvZiBDc3NTeW50YXhFcnJvcmAsIGJlY2F1c2VcbiAgICAgICAgICogICAgICAgICAgICAgICAgICAgIG5wbSBjb3VsZCBoYXZlIHNldmVyYWwgUG9zdENTUyB2ZXJzaW9ucy5cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogaWYgKCBlcnJvci5uYW1lID09PSAnQ3NzU3ludGF4RXJyb3InICkge1xuICAgICAgICAgKiAgIGVycm9yIC8vPT4gQ3NzU3ludGF4RXJyb3JcbiAgICAgICAgICogfVxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5uYW1lICAgPSAnQ3NzU3ludGF4RXJyb3InO1xuICAgICAgICAvKipcbiAgICAgICAgICogQG1lbWJlciB7c3RyaW5nfSAtIEVycm9yIG1lc3NhZ2UuXG4gICAgICAgICAqXG4gICAgICAgICAqIEBleGFtcGxlXG4gICAgICAgICAqIGVycm9yLm1lc3NhZ2UgLy89PiAnVW5jbG9zZWQgYmxvY2snXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnJlYXNvbiA9IG1lc3NhZ2U7XG5cbiAgICAgICAgaWYgKCBmaWxlICkge1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBAbWVtYmVyIHtzdHJpbmd9IC0gQWJzb2x1dGUgcGF0aCB0byB0aGUgYnJva2VuIGZpbGUuXG4gICAgICAgICAgICAgKlxuICAgICAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICAgICAqIGVycm9yLmZpbGUgICAgICAgLy89PiAnYS5zYXNzJ1xuICAgICAgICAgICAgICogZXJyb3IuaW5wdXQuZmlsZSAvLz0+ICdhLmNzcydcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy5maWxlID0gZmlsZTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIHNvdXJjZSApIHtcbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQG1lbWJlciB7c3RyaW5nfSAtIFNvdXJjZSBjb2RlIG9mIHRoZSBicm9rZW4gZmlsZS5cbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgICAgICogZXJyb3Iuc291cmNlICAgICAgIC8vPT4gJ2EgeyBiIHt9IH0nXG4gICAgICAgICAgICAgKiBlcnJvci5pbnB1dC5jb2x1bW4gLy89PiAnYSBiIHsgfSdcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy5zb3VyY2UgPSBzb3VyY2U7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCBwbHVnaW4gKSB7XG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIEBtZW1iZXIge3N0cmluZ30gLSBQbHVnaW4gbmFtZSwgaWYgZXJyb3IgY2FtZSBmcm9tIHBsdWdpbi5cbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgICAgICogZXJyb3IucGx1Z2luIC8vPT4gJ3Bvc3Rjc3MtdmFycydcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy5wbHVnaW4gPSBwbHVnaW47XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCB0eXBlb2YgbGluZSAhPT0gJ3VuZGVmaW5lZCcgJiYgdHlwZW9mIGNvbHVtbiAhPT0gJ3VuZGVmaW5lZCcgKSB7XG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIEBtZW1iZXIge251bWJlcn0gLSBTb3VyY2UgbGluZSBvZiB0aGUgZXJyb3IuXG4gICAgICAgICAgICAgKlxuICAgICAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICAgICAqIGVycm9yLmxpbmUgICAgICAgLy89PiAyXG4gICAgICAgICAgICAgKiBlcnJvci5pbnB1dC5saW5lIC8vPT4gNFxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICB0aGlzLmxpbmUgICA9IGxpbmU7XG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIEBtZW1iZXIge251bWJlcn0gLSBTb3VyY2UgY29sdW1uIG9mIHRoZSBlcnJvci5cbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgICAgICogZXJyb3IuY29sdW1uICAgICAgIC8vPT4gMVxuICAgICAgICAgICAgICogZXJyb3IuaW5wdXQuY29sdW1uIC8vPT4gNFxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICB0aGlzLmNvbHVtbiA9IGNvbHVtbjtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuc2V0TWVzc2FnZSgpO1xuXG4gICAgICAgIGlmICggRXJyb3IuY2FwdHVyZVN0YWNrVHJhY2UgKSB7XG4gICAgICAgICAgICBFcnJvci5jYXB0dXJlU3RhY2tUcmFjZSh0aGlzLCBDc3NTeW50YXhFcnJvcik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBzZXRNZXNzYWdlKCkge1xuICAgICAgICAvKipcbiAgICAgICAgICogQG1lbWJlciB7c3RyaW5nfSAtIEZ1bGwgZXJyb3IgdGV4dCBpbiB0aGUgR05VIGVycm9yIGZvcm1hdFxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgd2l0aCBwbHVnaW4sIGZpbGUsIGxpbmUgYW5kIGNvbHVtbi5cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogZXJyb3IubWVzc2FnZSAvLz0+ICdhLmNzczoxOjE6IFVuY2xvc2VkIGJsb2NrJ1xuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5tZXNzYWdlICA9IHRoaXMucGx1Z2luID8gdGhpcy5wbHVnaW4gKyAnOiAnIDogJyc7XG4gICAgICAgIHRoaXMubWVzc2FnZSArPSB0aGlzLmZpbGUgPyB0aGlzLmZpbGUgOiAnPGNzcyBpbnB1dD4nO1xuICAgICAgICBpZiAoIHR5cGVvZiB0aGlzLmxpbmUgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgdGhpcy5tZXNzYWdlICs9ICc6JyArIHRoaXMubGluZSArICc6JyArIHRoaXMuY29sdW1uO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMubWVzc2FnZSArPSAnOiAnICsgdGhpcy5yZWFzb247XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogUmV0dXJucyBhIGZldyBsaW5lcyBvZiBDU1Mgc291cmNlIHRoYXQgY2F1c2VkIHRoZSBlcnJvci5cbiAgICAgKlxuICAgICAqIElmIHRoZSBDU1MgaGFzIGFuIGlucHV0IHNvdXJjZSBtYXAgd2l0aG91dCBgc291cmNlQ29udGVudGAsXG4gICAgICogdGhpcyBtZXRob2Qgd2lsbCByZXR1cm4gYW4gZW1wdHkgc3RyaW5nLlxuICAgICAqXG4gICAgICogQHBhcmFtIHtib29sZWFufSBbY29sb3JdIHdoZXRoZXIgYXJyb3cgd2lsbCBiZSBjb2xvcmVkIHJlZCBieSB0ZXJtaW5hbFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvciBjb2Rlcy4gQnkgZGVmYXVsdCwgUG9zdENTUyB3aWxsIGRldGVjdFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvciBzdXBwb3J0IGJ5IGBwcm9jZXNzLnN0ZG91dC5pc1RUWWBcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgYW5kIGBwcm9jZXNzLmVudi5OT0RFX0RJU0FCTEVfQ09MT1JTYC5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogZXJyb3Iuc2hvd1NvdXJjZUNvZGUoKSAvLz0+IFwiICA0IHwgfVxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICA1IHwgYSB7XG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAvLyAgICA+IDYgfCAgIGJhZFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgLy8gICAgICAgIHwgICBeXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgIDcgfCB9XG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAvLyAgICAgIDggfCBiIHtcIlxuICAgICAqXG4gICAgICogQHJldHVybiB7c3RyaW5nfSBmZXcgbGluZXMgb2YgQ1NTIHNvdXJjZSB0aGF0IGNhdXNlZCB0aGUgZXJyb3JcbiAgICAgKi9cbiAgICBzaG93U291cmNlQ29kZShjb2xvcikge1xuICAgICAgICBpZiAoICF0aGlzLnNvdXJjZSApIHJldHVybiAnJztcblxuICAgICAgICBsZXQgY3NzID0gdGhpcy5zb3VyY2U7XG4gICAgICAgIGlmICggdHlwZW9mIGNvbG9yID09PSAndW5kZWZpbmVkJyApIGNvbG9yID0gc3VwcG9ydHNDb2xvcjtcbiAgICAgICAgaWYgKCBjb2xvciApIGNzcyA9IHRlcm1pbmFsSGlnaGxpZ2h0KGNzcyk7XG5cbiAgICAgICAgbGV0IGxpbmVzID0gY3NzLnNwbGl0KC9cXHI/XFxuLyk7XG4gICAgICAgIGxldCBzdGFydCA9IE1hdGgubWF4KHRoaXMubGluZSAtIDMsIDApO1xuICAgICAgICBsZXQgZW5kICAgPSBNYXRoLm1pbih0aGlzLmxpbmUgKyAyLCBsaW5lcy5sZW5ndGgpO1xuXG4gICAgICAgIGxldCBtYXhXaWR0aCA9IFN0cmluZyhlbmQpLmxlbmd0aDtcbiAgICAgICAgbGV0IGNvbG9ycyA9IG5ldyBjaGFsay5jb25zdHJ1Y3Rvcih7IGVuYWJsZWQ6IHRydWUgfSk7XG5cbiAgICAgICAgZnVuY3Rpb24gbWFyayh0ZXh0KSB7XG4gICAgICAgICAgICBpZiAoIGNvbG9yICkge1xuICAgICAgICAgICAgICAgIHJldHVybiBjb2xvcnMucmVkLmJvbGQodGV4dCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIGFzaWRlKHRleHQpIHtcbiAgICAgICAgICAgIGlmICggY29sb3IgKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbG9ycy5ncmF5KHRleHQpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGV4dDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBsaW5lcy5zbGljZShzdGFydCwgZW5kKS5tYXAoIChsaW5lLCBpbmRleCkgPT4ge1xuICAgICAgICAgICAgbGV0IG51bWJlciA9IHN0YXJ0ICsgMSArIGluZGV4O1xuICAgICAgICAgICAgbGV0IGd1dHRlciA9ICcgJyArICgnICcgKyBudW1iZXIpLnNsaWNlKC1tYXhXaWR0aCkgKyAnIHwgJztcbiAgICAgICAgICAgIGlmICggbnVtYmVyID09PSB0aGlzLmxpbmUgKSB7XG4gICAgICAgICAgICAgICAgbGV0IHNwYWNpbmcgPVxuICAgICAgICAgICAgICAgICAgICBhc2lkZShndXR0ZXIucmVwbGFjZSgvXFxkL2csICcgJykpICtcbiAgICAgICAgICAgICAgICAgICAgbGluZS5zbGljZSgwLCB0aGlzLmNvbHVtbiAtIDEpLnJlcGxhY2UoL1teXFx0XS9nLCAnICcpO1xuICAgICAgICAgICAgICAgIHJldHVybiBtYXJrKCc+JykgKyBhc2lkZShndXR0ZXIpICsgbGluZSArICdcXG4gJyArXG4gICAgICAgICAgICAgICAgICAgICAgIHNwYWNpbmcgKyBtYXJrKCdeJyk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiAnICcgKyBhc2lkZShndXR0ZXIpICsgbGluZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSkuam9pbignXFxuJyk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogUmV0dXJucyBlcnJvciBwb3NpdGlvbiwgbWVzc2FnZSBhbmQgc291cmNlIGNvZGUgb2YgdGhlIGJyb2tlbiBwYXJ0LlxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiBlcnJvci50b1N0cmluZygpIC8vPT4gXCJDc3NTeW50YXhFcnJvcjogYXBwLmNzczoxOjE6IFVuY2xvc2VkIGJsb2NrXG4gICAgICogICAgICAgICAgICAgICAgICAvLyAgICA+IDEgfCBhIHtcbiAgICAgKiAgICAgICAgICAgICAgICAgIC8vICAgICAgICB8IF5cIlxuICAgICAqXG4gICAgICogQHJldHVybiB7c3RyaW5nfSBlcnJvciBwb3NpdGlvbiwgbWVzc2FnZSBhbmQgc291cmNlIGNvZGVcbiAgICAgKi9cbiAgICB0b1N0cmluZygpIHtcbiAgICAgICAgbGV0IGNvZGUgPSB0aGlzLnNob3dTb3VyY2VDb2RlKCk7XG4gICAgICAgIGlmICggY29kZSApIHtcbiAgICAgICAgICAgIGNvZGUgPSAnXFxuXFxuJyArIGNvZGUgKyAnXFxuJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5uYW1lICsgJzogJyArIHRoaXMubWVzc2FnZSArIGNvZGU7XG4gICAgfVxuXG4gICAgZ2V0IGdlbmVyYXRlZCgpIHtcbiAgICAgICAgd2Fybk9uY2UoJ0Nzc1N5bnRheEVycm9yI2dlbmVyYXRlZCBpcyBkZXByZWNhdGVkLiBVc2UgaW5wdXQgaW5zdGVhZC4nKTtcbiAgICAgICAgcmV0dXJuIHRoaXMuaW5wdXQ7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQG1lbWJlcm9mIENzc1N5bnRheEVycm9yI1xuICAgICAqIEBtZW1iZXIge0lucHV0fSBpbnB1dCAtIElucHV0IG9iamVjdCB3aXRoIFBvc3RDU1MgaW50ZXJuYWwgaW5mb3JtYXRpb25cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICBhYm91dCBpbnB1dCBmaWxlLiBJZiBpbnB1dCBoYXMgc291cmNlIG1hcFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIGZyb20gcHJldmlvdXMgdG9vbCwgUG9zdENTUyB3aWxsIHVzZSBvcmlnaW5cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAoZm9yIGV4YW1wbGUsIFNhc3MpIHNvdXJjZS4gWW91IGNhbiB1c2UgdGhpc1xuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIG9iamVjdCB0byBnZXQgUG9zdENTUyBpbnB1dCBzb3VyY2UuXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIGVycm9yLmlucHV0LmZpbGUgLy89PiAnYS5jc3MnXG4gICAgICogZXJyb3IuZmlsZSAgICAgICAvLz0+ICdhLnNhc3MnXG4gICAgICovXG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgQ3NzU3ludGF4RXJyb3I7XG4iXX0=
  11616. /***/ }),
  11617. /* 76 */
  11618. /***/ (function(module, exports, __webpack_require__) {
  11619. "use strict";
  11620. exports.__esModule = true;
  11621. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  11622. var _warnOnce = __webpack_require__(4);
  11623. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  11624. var _node = __webpack_require__(27);
  11625. var _node2 = _interopRequireDefault(_node);
  11626. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11627. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11628. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11629. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11630. /**
  11631. * Represents a CSS declaration.
  11632. *
  11633. * @extends Node
  11634. *
  11635. * @example
  11636. * const root = postcss.parse('a { color: black }');
  11637. * const decl = root.first.first;
  11638. * decl.type //=> 'decl'
  11639. * decl.toString() //=> ' color: black'
  11640. */
  11641. var Declaration = function (_Node) {
  11642. _inherits(Declaration, _Node);
  11643. function Declaration(defaults) {
  11644. _classCallCheck(this, Declaration);
  11645. var _this = _possibleConstructorReturn(this, _Node.call(this, defaults));
  11646. _this.type = 'decl';
  11647. return _this;
  11648. }
  11649. _createClass(Declaration, [{
  11650. key: '_value',
  11651. get: function get() {
  11652. (0, _warnOnce2.default)('Node#_value was deprecated. Use Node#raws.value');
  11653. return this.raws.value;
  11654. },
  11655. set: function set(val) {
  11656. (0, _warnOnce2.default)('Node#_value was deprecated. Use Node#raws.value');
  11657. this.raws.value = val;
  11658. }
  11659. }, {
  11660. key: '_important',
  11661. get: function get() {
  11662. (0, _warnOnce2.default)('Node#_important was deprecated. Use Node#raws.important');
  11663. return this.raws.important;
  11664. },
  11665. set: function set(val) {
  11666. (0, _warnOnce2.default)('Node#_important was deprecated. Use Node#raws.important');
  11667. this.raws.important = val;
  11668. }
  11669. /**
  11670. * @memberof Declaration#
  11671. * @member {string} prop - the declaration’s property name
  11672. *
  11673. * @example
  11674. * const root = postcss.parse('a { color: black }');
  11675. * const decl = root.first.first;
  11676. * decl.prop //=> 'color'
  11677. */
  11678. /**
  11679. * @memberof Declaration#
  11680. * @member {string} value - the declaration’s value
  11681. *
  11682. * @example
  11683. * const root = postcss.parse('a { color: black }');
  11684. * const decl = root.first.first;
  11685. * decl.value //=> 'black'
  11686. */
  11687. /**
  11688. * @memberof Declaration#
  11689. * @member {boolean} important - `true` if the declaration
  11690. * has an !important annotation.
  11691. *
  11692. * @example
  11693. * const root = postcss.parse('a { color: black !important; color: red }');
  11694. * root.first.first.important //=> true
  11695. * root.first.last.important //=> undefined
  11696. */
  11697. /**
  11698. * @memberof Declaration#
  11699. * @member {object} raws - Information to generate byte-to-byte equal
  11700. * node string as it was in the origin input.
  11701. *
  11702. * Every parser saves its own properties,
  11703. * but the default CSS parser uses:
  11704. *
  11705. * * `before`: the space symbols before the node. It also stores `*`
  11706. * and `_` symbols before the declaration (IE hack).
  11707. * * `between`: the symbols between the property and value
  11708. * for declarations.
  11709. * * `important`: the content of the important statement,
  11710. * if it is not just `!important`.
  11711. *
  11712. * PostCSS cleans declaration from comments and extra spaces,
  11713. * but it stores origin content in raws properties.
  11714. * As such, if you don’t change a declaration’s value,
  11715. * PostCSS will use the raw value with comments.
  11716. *
  11717. * @example
  11718. * const root = postcss.parse('a {\n color:black\n}')
  11719. * root.first.first.raws //=> { before: '\n ', between: ':' }
  11720. */
  11721. }]);
  11722. return Declaration;
  11723. }(_node2.default);
  11724. exports.default = Declaration;
  11725. module.exports = exports['default'];
  11726. //# sourceMappingURL=data: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VzdCBgIWltcG9ydGFudGAuXG4gICAgICpcbiAgICAgKiBQb3N0Q1NTIGNsZWFucyBkZWNsYXJhdGlvbiBmcm9tIGNvbW1lbnRzIGFuZCBleHRyYSBzcGFjZXMsXG4gICAgICogYnV0IGl0IHN0b3JlcyBvcmlnaW4gY29udGVudCBpbiByYXdzIHByb3BlcnRpZXMuXG4gICAgICogQXMgc3VjaCwgaWYgeW91IGRvbuKAmXQgY2hhbmdlIGEgZGVjbGFyYXRpb27igJlzIHZhbHVlLFxuICAgICAqIFBvc3RDU1Mgd2lsbCB1c2UgdGhlIHJhdyB2YWx1ZSB3aXRoIGNvbW1lbnRzLlxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiBjb25zdCByb290ID0gcG9zdGNzcy5wYXJzZSgnYSB7XFxuICBjb2xvcjpibGFja1xcbn0nKVxuICAgICAqIHJvb3QuZmlyc3QuZmlyc3QucmF3cyAvLz0+IHsgYmVmb3JlOiAnXFxuICAnLCBiZXR3ZWVuOiAnOicgfVxuICAgICAqL1xuXG59XG5cbmV4cG9ydCBkZWZhdWx0IERlY2xhcmF0aW9uO1xuIl19
  11727. /***/ }),
  11728. /* 77 */
  11729. /***/ (function(module, exports, __webpack_require__) {
  11730. "use strict";
  11731. exports.__esModule = true;
  11732. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  11733. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  11734. var _mapGenerator = __webpack_require__(155);
  11735. var _mapGenerator2 = _interopRequireDefault(_mapGenerator);
  11736. var _stringify2 = __webpack_require__(80);
  11737. var _stringify3 = _interopRequireDefault(_stringify2);
  11738. var _warnOnce = __webpack_require__(4);
  11739. var _warnOnce2 = _interopRequireDefault(_warnOnce);
  11740. var _result = __webpack_require__(158);
  11741. var _result2 = _interopRequireDefault(_result);
  11742. var _parse = __webpack_require__(78);
  11743. var _parse2 = _interopRequireDefault(_parse);
  11744. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  11745. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11746. function isPromise(obj) {
  11747. return (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && typeof obj.then === 'function';
  11748. }
  11749. /**
  11750. * A Promise proxy for the result of PostCSS transformations.
  11751. *
  11752. * A `LazyResult` instance is returned by {@link Processor#process}.
  11753. *
  11754. * @example
  11755. * const lazy = postcss([cssnext]).process(css);
  11756. */
  11757. var LazyResult = function () {
  11758. function LazyResult(processor, css, opts) {
  11759. _classCallCheck(this, LazyResult);
  11760. this.stringified = false;
  11761. this.processed = false;
  11762. var root = void 0;
  11763. if ((typeof css === 'undefined' ? 'undefined' : _typeof(css)) === 'object' && css.type === 'root') {
  11764. root = css;
  11765. } else if (css instanceof LazyResult || css instanceof _result2.default) {
  11766. root = css.root;
  11767. if (css.map) {
  11768. if (typeof opts.map === 'undefined') opts.map = {};
  11769. if (!opts.map.inline) opts.map.inline = false;
  11770. opts.map.prev = css.map;
  11771. }
  11772. } else {
  11773. var parser = _parse2.default;
  11774. if (opts.syntax) parser = opts.syntax.parse;
  11775. if (opts.parser) parser = opts.parser;
  11776. if (parser.parse) parser = parser.parse;
  11777. try {
  11778. root = parser(css, opts);
  11779. } catch (error) {
  11780. this.error = error;
  11781. }
  11782. }
  11783. this.result = new _result2.default(processor, root, opts);
  11784. }
  11785. /**
  11786. * Returns a {@link Processor} instance, which will be used
  11787. * for CSS transformations.
  11788. * @type {Processor}
  11789. */
  11790. /**
  11791. * Processes input CSS through synchronous plugins
  11792. * and calls {@link Result#warnings()}.
  11793. *
  11794. * @return {Warning[]} warnings from plugins
  11795. */
  11796. LazyResult.prototype.warnings = function warnings() {
  11797. return this.sync().warnings();
  11798. };
  11799. /**
  11800. * Alias for the {@link LazyResult#css} property.
  11801. *
  11802. * @example
  11803. * lazy + '' === lazy.css;
  11804. *
  11805. * @return {string} output CSS
  11806. */
  11807. LazyResult.prototype.toString = function toString() {
  11808. return this.css;
  11809. };
  11810. /**
  11811. * Processes input CSS through synchronous and asynchronous plugins
  11812. * and calls `onFulfilled` with a Result instance. If a plugin throws
  11813. * an error, the `onRejected` callback will be executed.
  11814. *
  11815. * It implements standard Promise API.
  11816. *
  11817. * @param {onFulfilled} onFulfilled - callback will be executed
  11818. * when all plugins will finish work
  11819. * @param {onRejected} onRejected - callback will be executed on any error
  11820. *
  11821. * @return {Promise} Promise API to make queue
  11822. *
  11823. * @example
  11824. * postcss([cssnext]).process(css).then(result => {
  11825. * console.log(result.css);
  11826. * });
  11827. */
  11828. LazyResult.prototype.then = function then(onFulfilled, onRejected) {
  11829. return this.async().then(onFulfilled, onRejected);
  11830. };
  11831. /**
  11832. * Processes input CSS through synchronous and asynchronous plugins
  11833. * and calls onRejected for each error thrown in any plugin.
  11834. *
  11835. * It implements standard Promise API.
  11836. *
  11837. * @param {onRejected} onRejected - callback will be executed on any error
  11838. *
  11839. * @return {Promise} Promise API to make queue
  11840. *
  11841. * @example
  11842. * postcss([cssnext]).process(css).then(result => {
  11843. * console.log(result.css);
  11844. * }).catch(error => {
  11845. * console.error(error);
  11846. * });
  11847. */
  11848. LazyResult.prototype.catch = function _catch(onRejected) {
  11849. return this.async().catch(onRejected);
  11850. };
  11851. LazyResult.prototype.handleError = function handleError(error, plugin) {
  11852. try {
  11853. this.error = error;
  11854. if (error.name === 'CssSyntaxError' && !error.plugin) {
  11855. error.plugin = plugin.postcssPlugin;
  11856. error.setMessage();
  11857. } else if (plugin.postcssVersion) {
  11858. var pluginName = plugin.postcssPlugin;
  11859. var pluginVer = plugin.postcssVersion;
  11860. var runtimeVer = this.result.processor.version;
  11861. var a = pluginVer.split('.');
  11862. var b = runtimeVer.split('.');
  11863. if (a[0] !== b[0] || parseInt(a[1]) > parseInt(b[1])) {
  11864. (0, _warnOnce2.default)('Your current PostCSS version ' + 'is ' + runtimeVer + ', but ' + pluginName + ' ' + 'uses ' + pluginVer + '. Perhaps this is ' + 'the source of the error below.');
  11865. }
  11866. }
  11867. } catch (err) {
  11868. if (console && console.error) console.error(err);
  11869. }
  11870. };
  11871. LazyResult.prototype.asyncTick = function asyncTick(resolve, reject) {
  11872. var _this = this;
  11873. if (this.plugin >= this.processor.plugins.length) {
  11874. this.processed = true;
  11875. return resolve();
  11876. }
  11877. try {
  11878. var plugin = this.processor.plugins[this.plugin];
  11879. var promise = this.run(plugin);
  11880. this.plugin += 1;
  11881. if (isPromise(promise)) {
  11882. promise.then(function () {
  11883. _this.asyncTick(resolve, reject);
  11884. }).catch(function (error) {
  11885. _this.handleError(error, plugin);
  11886. _this.processed = true;
  11887. reject(error);
  11888. });
  11889. } else {
  11890. this.asyncTick(resolve, reject);
  11891. }
  11892. } catch (error) {
  11893. this.processed = true;
  11894. reject(error);
  11895. }
  11896. };
  11897. LazyResult.prototype.async = function async() {
  11898. var _this2 = this;
  11899. if (this.processed) {
  11900. return new Promise(function (resolve, reject) {
  11901. if (_this2.error) {
  11902. reject(_this2.error);
  11903. } else {
  11904. resolve(_this2.stringify());
  11905. }
  11906. });
  11907. }
  11908. if (this.processing) {
  11909. return this.processing;
  11910. }
  11911. this.processing = new Promise(function (resolve, reject) {
  11912. if (_this2.error) return reject(_this2.error);
  11913. _this2.plugin = 0;
  11914. _this2.asyncTick(resolve, reject);
  11915. }).then(function () {
  11916. _this2.processed = true;
  11917. return _this2.stringify();
  11918. });
  11919. return this.processing;
  11920. };
  11921. LazyResult.prototype.sync = function sync() {
  11922. if (this.processed) return this.result;
  11923. this.processed = true;
  11924. if (this.processing) {
  11925. throw new Error('Use process(css).then(cb) to work with async plugins');
  11926. }
  11927. if (this.error) throw this.error;
  11928. for (var _iterator = this.result.processor.plugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  11929. var _ref;
  11930. if (_isArray) {
  11931. if (_i >= _iterator.length) break;
  11932. _ref = _iterator[_i++];
  11933. } else {
  11934. _i = _iterator.next();
  11935. if (_i.done) break;
  11936. _ref = _i.value;
  11937. }
  11938. var plugin = _ref;
  11939. var promise = this.run(plugin);
  11940. if (isPromise(promise)) {
  11941. throw new Error('Use process(css).then(cb) to work with async plugins');
  11942. }
  11943. }
  11944. return this.result;
  11945. };
  11946. LazyResult.prototype.run = function run(plugin) {
  11947. this.result.lastPlugin = plugin;
  11948. try {
  11949. return plugin(this.result.root, this.result);
  11950. } catch (error) {
  11951. this.handleError(error, plugin);
  11952. throw error;
  11953. }
  11954. };
  11955. LazyResult.prototype.stringify = function stringify() {
  11956. if (this.stringified) return this.result;
  11957. this.stringified = true;
  11958. this.sync();
  11959. var opts = this.result.opts;
  11960. var str = _stringify3.default;
  11961. if (opts.syntax) str = opts.syntax.stringify;
  11962. if (opts.stringifier) str = opts.stringifier;
  11963. if (str.stringify) str = str.stringify;
  11964. var map = new _mapGenerator2.default(str, this.result.root, this.result.opts);
  11965. var data = map.generate();
  11966. this.result.css = data[0];
  11967. this.result.map = data[1];
  11968. return this.result;
  11969. };
  11970. _createClass(LazyResult, [{
  11971. key: 'processor',
  11972. get: function get() {
  11973. return this.result.processor;
  11974. }
  11975. /**
  11976. * Options from the {@link Processor#process} call.
  11977. * @type {processOptions}
  11978. */
  11979. }, {
  11980. key: 'opts',
  11981. get: function get() {
  11982. return this.result.opts;
  11983. }
  11984. /**
  11985. * Processes input CSS through synchronous plugins, converts `Root`
  11986. * to a CSS string and returns {@link Result#css}.
  11987. *
  11988. * This property will only work with synchronous plugins.
  11989. * If the processor contains any asynchronous plugins
  11990. * it will throw an error. This is why this method is only
  11991. * for debug purpose, you should always use {@link LazyResult#then}.
  11992. *
  11993. * @type {string}
  11994. * @see Result#css
  11995. */
  11996. }, {
  11997. key: 'css',
  11998. get: function get() {
  11999. return this.stringify().css;
  12000. }
  12001. /**
  12002. * An alias for the `css` property. Use it with syntaxes
  12003. * that generate non-CSS output.
  12004. *
  12005. * This property will only work with synchronous plugins.
  12006. * If the processor contains any asynchronous plugins
  12007. * it will throw an error. This is why this method is only
  12008. * for debug purpose, you should always use {@link LazyResult#then}.
  12009. *
  12010. * @type {string}
  12011. * @see Result#content
  12012. */
  12013. }, {
  12014. key: 'content',
  12015. get: function get() {
  12016. return this.stringify().content;
  12017. }
  12018. /**
  12019. * Processes input CSS through synchronous plugins
  12020. * and returns {@link Result#map}.
  12021. *
  12022. * This property will only work with synchronous plugins.
  12023. * If the processor contains any asynchronous plugins
  12024. * it will throw an error. This is why this method is only
  12025. * for debug purpose, you should always use {@link LazyResult#then}.
  12026. *
  12027. * @type {SourceMapGenerator}
  12028. * @see Result#map
  12029. */
  12030. }, {
  12031. key: 'map',
  12032. get: function get() {
  12033. return this.stringify().map;
  12034. }
  12035. /**
  12036. * Processes input CSS through synchronous plugins
  12037. * and returns {@link Result#root}.
  12038. *
  12039. * This property will only work with synchronous plugins. If the processor
  12040. * contains any asynchronous plugins it will throw an error.
  12041. *
  12042. * This is why this method is only for debug purpose,
  12043. * you should always use {@link LazyResult#then}.
  12044. *
  12045. * @type {Root}
  12046. * @see Result#root
  12047. */
  12048. }, {
  12049. key: 'root',
  12050. get: function get() {
  12051. return this.sync().root;
  12052. }
  12053. /**
  12054. * Processes input CSS through synchronous plugins
  12055. * and returns {@link Result#messages}.
  12056. *
  12057. * This property will only work with synchronous plugins. If the processor
  12058. * contains any asynchronous plugins it will throw an error.
  12059. *
  12060. * This is why this method is only for debug purpose,
  12061. * you should always use {@link LazyResult#then}.
  12062. *
  12063. * @type {Message[]}
  12064. * @see Result#messages
  12065. */
  12066. }, {
  12067. key: 'messages',
  12068. get: function get() {
  12069. return this.sync().messages;
  12070. }
  12071. }]);
  12072. return LazyResult;
  12073. }();
  12074. exports.default = LazyResult;
  12075. /**
  12076. * @callback onFulfilled
  12077. * @param {Result} result
  12078. */
  12079. /**
  12080. * @callback onRejected
  12081. * @param {Error} error
  12082. */
  12083. module.exports = exports['default'];
  12084. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxhenktcmVzdWx0LmVzNiJdLCJuYW1lcyI6WyJpc1Byb21pc2UiLCJvYmoiLCJ0aGVuIiwiTGF6eVJlc3VsdCIsInByb2Nlc3NvciIsImNzcyIsIm9wdHMiLCJzdHJpbmdpZmllZCIsInByb2Nlc3NlZCIsInJvb3QiLCJ0eXBlIiwibWFwIiwiaW5saW5lIiwicHJldiIsInBhcnNlciIsInN5bnRheCIsInBhcnNlIiwiZXJyb3IiLCJyZXN1bHQiLCJ3YXJuaW5ncyIsInN5bmMiLCJ0b1N0cmluZyIsIm9uRnVsZmlsbGVkIiwib25SZWplY3RlZCIsImFzeW5jIiwiY2F0Y2giLCJoYW5kbGVFcnJvciIsInBsdWdpbiIsIm5hbWUiLCJwb3N0Y3NzUGx1Z2luIiwic2V0TWVzc2FnZSIsInBvc3Rjc3NWZXJzaW9uIiwicGx1Z2luTmFtZSIsInBsdWdpblZlciIsInJ1bnRpbWVWZXIiLCJ2ZXJzaW9uIiwiYSIsInNwbGl0IiwiYiIsInBhcnNlSW50IiwiZXJyIiwiY29uc29sZSIsImFzeW5jVGljayIsInJlc29sdmUiLCJyZWplY3QiLCJwbHVnaW5zIiwibGVuZ3RoIiwicHJvbWlzZSIsInJ1biIsIlByb21pc2UiLCJzdHJpbmdpZnkiLCJwcm9jZXNzaW5nIiwiRXJyb3IiLCJsYXN0UGx1Z2luIiwic3RyIiwic3RyaW5naWZpZXIiLCJkYXRhIiwiZ2VuZXJhdGUi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gICAgICAgIH0gZWxzZSBpZiAoIGNzcyBpbnN0YW5jZW9mIExhenlSZXN1bHQgfHwgY3NzIGluc3RhbmNlb2YgUmVzdWx0ICkge1xuICAgICAgICAgICAgcm9vdCA9IGNzcy5yb290O1xuICAgICAgICAgICAgaWYgKCBjc3MubWFwICkge1xuICAgICAgICAgICAgICAgIGlmICggdHlwZW9mIG9wdHMubWFwID09PSAndW5kZWZpbmVkJyApIG9wdHMubWFwID0geyB9O1xuICAgICAgICAgICAgICAgIGlmICggIW9wdHMubWFwLmlubGluZSApIG9wdHMubWFwLmlubGluZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIG9wdHMubWFwLnByZXYgPSBjc3MubWFwO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IHBhcnNlciA9IHBhcnNlO1xuICAgICAgICAgICAgaWYgKCBvcHRzLnN5bnRheCApICBwYXJzZXIgPSBvcHRzLnN5bnRheC5wYXJzZTtcbiAgICAgICAgICAgIGlmICggb3B0cy5wYXJzZXIgKSAgcGFyc2VyID0gb3B0cy5wYXJzZXI7XG4gICAgICAgICAgICBpZiAoIHBhcnNlci5wYXJzZSApIHBhcnNlciA9IHBhcnNlci5wYXJzZTtcblxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICByb290ID0gcGFyc2VyKGNzcywgb3B0cyk7XG4gICAgICAgICAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgICAgIHRoaXMuZXJyb3IgPSBlcnJvcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMucmVzdWx0ID0gbmV3IFJlc3VsdChwcm9jZXNzb3IsIHJvb3QsIG9wdHMpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgYSB7QGxpbmsgUHJvY2Vzc29yfSBpbnN0YW5jZSwgd2hpY2ggd2lsbCBiZSB1c2VkXG4gICAgICogZm9yIENTUy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CkudGhlbihvbkZ1bGZpbGxlZCwgb25SZWplY3RlZCk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogUHJvY2Vzc2VzIGlucHV0IENTUyB0aHJvdWdoIHN5bmNocm9ub3VzIGFuZCBhc3luY2hyb25vdXMgcGx1Z2luc1xuICAgICAqIGFuZCBjYWxscyBvblJlamVjdGVkIGZvciBlYWNoIGVycm9yIHRocm93biBpbiBhbnkgcGx1Z2luLlxuICAgICAqXG4gICAgICogSXQgaW1wbGVtZW50cyBzdGFuZGFyZCBQcm9taXNlIEFQSS5cbiAgICAgKlxuICAgICAqIEBwYXJhbSB7b25SZWplY3RlZH0gb25SZWplY3RlZCAtIGNhbGxiYWNrIHdpbGwgYmUgZXhlY3V0ZWQgb24gYW55IGVycm9yXG4gICAgICpcbiAgICAgKiBAcmV0dXJuIHtQcm9taXNlfSBQcm9taXNlIEFQSSB0byBtYWtlIHF1ZXVlXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHBvc3Rjc3MoW2Nzc25leHRdKS5wcm9jZXNzKGNzcykudGhlbihyZXN1bHQgPT4ge1xuICAgICAqICAgY29uc29sZS5sb2cocmVzdWx0LmNzcyk7XG4gICAgICogfSkuY2F0Y2goZXJyb3IgPT4ge1xuICAgICAqICAgY29uc29sZS5lcnJvcihlcnJvcik7XG4gICAgICogfSk7XG4gICAgICovXG4gICAgY2F0Y2gob25SZWplY3RlZCkge1xuICAgICAgICByZXR1cm4gdGhpcy5hc3luYygpLmNhdGNoKG9uUmVqZWN0ZWQpO1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9yKGVycm9yLCBwbHVnaW4pIHtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHRoaXMuZXJyb3IgPSBlcnJvcjtcbiAgICAgICAgICAgIGlmICggZXJyb3IubmFtZSA9PT0gJ0Nzc1N5bnRheEVycm9yJyAmJiAhZXJyb3IucGx1Z2luICkge1xuICAgICAgICAgICAgICAgIGVycm9yLnBsdWdpbiA9IHBsdWdpbi5wb3N0Y3NzUGx1Z2luO1xuICAgICAgICAgICAgICAgIGVycm9yLnNldE1lc3NhZ2UoKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHBsdWdpbi5wb3N0Y3NzVmVyc2lvbiApIHtcbiAgICAgICAgICAgICAgICBsZXQgcGx1Z2luTmFtZSA9IHBsdWdpbi5wb3N0Y3NzUGx1Z2luO1xuICAgICAgICAgICAgICAgIGxldCBwbHVnaW5WZXIgID0gcGx1Z2luLnBvc3Rjc3NWZXJzaW9uO1xuICAgICAgICAgICAgICAgIGxldCBydW50aW1lVmVyID0gdGhpcy5yZXN1bHQucHJvY2Vzc29yLnZlcnNpb247XG4gICAgICAgICAgICAgICAgbGV0IGEgPSBwbHVnaW5WZXIuc3BsaXQoJy4nKTtcbiAgICAgICAgICAgICAgICBsZXQgYiA9IHJ1bnRpbWVWZXIuc3BsaXQoJy4nKTtcblxuICAgICAgICAgICAgICAgIGlmICggYVswXSAhPT0gYlswXSB8fCBwYXJzZUludChhWzFdKSA+IHBhcnNlSW50KGJbMV0pICkge1xuICAgICAgICAgICAgICAgICAgICB3YXJuT25jZSgnWW91ciBjdXJyZW50IFBvc3RDU1MgdmVyc2lvbiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2lzICcgKyBydW50aW1lVmVyICsgJywgYnV0ICcgKyBwbHVnaW5OYW1lICsgJyAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXMgJyArIHBsdWdpblZlciArICcuIFBlcmhhcHMgdGhpcyBpcyAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3RoZSBzb3VyY2Ugb2YgdGhlIGVycm9yIGJlbG93LicpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBjYXRjaCAoZXJyKSB7XG4gICAgICAgICAgICBpZiAoIGNvbnNvbGUgJiYgY29uc29sZS5lcnJvciApIGNvbnNvbGUuZXJyb3IoZXJyKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGFzeW5jVGljayhyZXNvbHZlLCByZWplY3QpIHtcbiAgICAgICAgaWYgKCB0aGlzLnBsdWdpbiA+PSB0aGlzLnByb2Nlc3Nvci5wbHVnaW5zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIHRoaXMucHJvY2Vzc2VkID0gdHJ1ZTtcbiAgICAgICAgICAgIHJldHVybiByZXNvbHZlKCk7XG4gICAgICAgIH1cblxuICAgICAgICB0cnkge1xuICAgICAgICAgICAgbGV0IHBsdWdpbiAgPSB0aGlzLnByb2Nlc3Nvci5wbHVnaW5zW3RoaXMucGx1Z2luXTtcbiAgICAgICAgICAgIGxldCBwcm9taXNlID0gdGhpcy5ydW4ocGx1Z2luKTtcbiAgICAgICAgICAgIHRoaXMucGx1Z2luICs9IDE7XG5cbiAgICAgICAgICAgIGlmICggaXNQcm9taXNlKHByb21pc2UpICkge1xuICAgICAgICAgICAgICAgIHByb21pc2UudGhlbiggKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmFzeW5jVGljayhyZXNvbHZlLCByZWplY3QpO1xuICAgICAgICAgICAgICAgIH0pLmNhdGNoKCBlcnJvciA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaGFuZGxlRXJyb3IoZXJyb3IsIHBsdWdpbik7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucHJvY2Vzc2VkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgcmVqZWN0KGVycm9yKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5hc3luY1RpY2socmVzb2x2ZSwgcmVqZWN0KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgICAgICAgdGhpcy5wcm9jZXNzZWQgPSB0cnVlO1xuICAgICAgICAgICAgcmVqZWN0KGVycm9yKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGFzeW5jKCkge1xuICAgICAgICBpZiAoIHRoaXMucHJvY2Vzc2VkICkge1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKCAocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCB0aGlzLmVycm9yICkge1xuICAgICAgICAgICAgICAgICAgICByZWplY3QodGhpcy5lcnJvcik7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSh0aGlzLnN0cmluZ2lmeSgpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIHRoaXMucHJvY2Vzc2luZyApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnByb2Nlc3Npbmc7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnByb2Nlc3NpbmcgPSBuZXcgUHJvbWlzZSggKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgICAgICAgICAgaWYgKCB0aGlzLmVycm9yICkgcmV0dXJuIHJlamVjdCh0aGlzLmVycm9yKTtcbiAgICAgICAgICAgIHRoaXMucGx1Z2luID0gMDtcbiAgICAgICAgICAgIHRoaXMuYXN5bmNUaWNrKHJlc29sdmUsIHJlamVjdCk7XG4gICAgICAgIH0pLnRoZW4oICgpID0+IHtcbiAgICAgICAgICAgIHRoaXMucHJvY2Vzc2VkID0gdHJ1ZTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnN0cmluZ2lmeSgpO1xuICAgICAgICB9KTtcblxuICAgICAgICByZXR1cm4gdGhpcy5wcm9jZXNzaW5nO1xuICAgIH1cblxuICAgIHN5bmMoKSB7XG4gICAgICAgIGlmICggdGhpcy5wcm9jZXNzZWQgKSByZXR1cm4gdGhpcy5yZXN1bHQ7XG4gICAgICAgIHRoaXMucHJvY2Vzc2VkID0gdHJ1ZTtcblxuICAgICAgICBpZiAoIHRoaXMucHJvY2Vzc2luZyApIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgICAnVXNlIHByb2Nlc3MoY3NzKS50aGVuKGNiKSB0byB3b3JrIHdpdGggYXN5bmMgcGx1Z2lucycpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCB0aGlzLmVycm9yICkgdGhyb3cgdGhpcy5lcnJvcjtcblxuICAgICAgICBmb3IgKCBsZXQgcGx1Z2luIG9mIHRoaXMucmVzdWx0LnByb2Nlc3Nvci5wbHVnaW5zICkge1xuICAgICAgICAgICAgbGV0IHByb21pc2UgPSB0aGlzLnJ1bihwbHVnaW4pO1xuICAgICAgICAgICAgaWYgKCBpc1Byb21pc2UocHJvbWlzZSkgKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxuICAgICAgICAgICAgICAgICAgICAnVXNlIHByb2Nlc3MoY3NzKS50aGVuKGNiKSB0byB3b3JrIHdpdGggYXN5bmMgcGx1Z2lucycpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRoaXMucmVzdWx0O1xuICAgIH1cblxuICAgIHJ1bihwbHVnaW4pIHtcbiAgICAgICAgdGhpcy5yZXN1bHQubGFzdFBsdWdpbiA9IHBsdWdpbjtcblxuICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmV0dXJuIHBsdWdpbih0aGlzLnJlc3VsdC5yb290LCB0aGlzLnJlc3VsdCk7XG4gICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICB0aGlzLmhhbmRsZUVycm9yKGVycm9yLCBwbHVnaW4pO1xuICAgICAgICAgICAgdGhyb3cgZXJyb3I7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBzdHJpbmdpZnkoKSB7XG4gICAgICAgIGlmICggdGhpcy5zdHJpbmdpZmllZCApIHJldHVybiB0aGlzLnJlc3VsdDtcbiAgICAgICAgdGhpcy5zdHJpbmdpZmllZCA9IHRydWU7XG5cbiAgICAgICAgdGhpcy5zeW5jKCk7XG5cbiAgICAgICAgbGV0IG9wdHMgPSB0aGlzLnJlc3VsdC5vcHRzO1xuICAgICAgICBsZXQgc3RyICA9IHN0cmluZ2lmeTtcbiAgICAgICAgaWYgKCBvcHRzLnN5bnRheCApICAgICAgc3RyID0gb3B0cy5zeW50YXguc3RyaW5naWZ5O1xuICAgICAgICBpZiAoIG9wdHMuc3RyaW5naWZpZXIgKSBzdHIgPSBvcHRzLnN0cmluZ2lmaWVyO1xuICAgICAgICBpZiAoIHN0ci5zdHJpbmdpZnkgKSAgICBzdHIgPSBzdHIuc3RyaW5naWZ5O1xuXG4gICAgICAgIGxldCBtYXAgID0gbmV3IE1hcEdlbmVyYXRvcihzdHIsIHRoaXMucmVzdWx0LnJvb3QsIHRoaXMucmVzdWx0Lm9wdHMpO1xuICAgICAgICBsZXQgZGF0YSA9IG1hcC5nZW5lcmF0ZSgpO1xuICAgICAgICB0aGlzLnJlc3VsdC5jc3MgPSBkYXRhWzBdO1xuICAgICAgICB0aGlzLnJlc3VsdC5tYXAgPSBkYXRhWzFdO1xuXG4gICAgICAgIHJldHVybiB0aGlzLnJlc3VsdDtcbiAgICB9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgTGF6eVJlc3VsdDtcblxuLyoqXG4gKiBAY2FsbGJhY2sgb25GdWxmaWxsZWRcbiAqIEBwYXJhbSB7UmVzdWx0fSByZXN1bHRcbiAqL1xuXG4vKipcbiAqIEBjYWxsYmFjayBvblJlamVjdGVkXG4gKiBAcGFyYW0ge0Vycm9yfSBlcnJvclxuICovXG4iXX0=
  12085. /***/ }),
  12086. /* 78 */
  12087. /***/ (function(module, exports, __webpack_require__) {
  12088. "use strict";
  12089. exports.__esModule = true;
  12090. exports.default = parse;
  12091. var _parser = __webpack_require__(79);
  12092. var _parser2 = _interopRequireDefault(_parser);
  12093. var _input = __webpack_require__(26);
  12094. var _input2 = _interopRequireDefault(_input);
  12095. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  12096. function parse(css, opts) {
  12097. if (opts && opts.safe) {
  12098. throw new Error('Option safe was removed. ' + 'Use parser: require("postcss-safe-parser")');
  12099. }
  12100. var input = new _input2.default(css, opts);
  12101. var parser = new _parser2.default(input);
  12102. try {
  12103. parser.tokenize();
  12104. parser.loop();
  12105. } catch (e) {
  12106. if (e.name === 'CssSyntaxError' && opts && opts.from) {
  12107. if (/\.scss$/i.test(opts.from)) {
  12108. e.message += '\nYou tried to parse SCSS with ' + 'the standard CSS parser; ' + 'try again with the postcss-scss parser';
  12109. } else if (/\.sass/i.test(opts.from)) {
  12110. e.message += '\nYou tried to parse Sass with ' + 'the standard CSS parser; ' + 'try again with the postcss-sass parser';
  12111. } else if (/\.less$/i.test(opts.from)) {
  12112. e.message += '\nYou tried to parse Less with ' + 'the standard CSS parser; ' + 'try again with the postcss-less parser';
  12113. }
  12114. }
  12115. throw e;
  12116. }
  12117. return parser.root;
  12118. }
  12119. module.exports = exports['default'];
  12120. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBhcnNlLmVzNiJdLCJuYW1lcyI6WyJwYXJzZSIsImNzcyIsIm9wdHMiLCJzYWZlIiwiRXJyb3IiLCJpbnB1dCIsInBhcnNlciIsInRva2VuaXplIiwibG9vcCIsImUiLCJuYW1lIiwiZnJvbSIsInRlc3QiLCJtZXNzYWdlIiwicm9vdCJdLCJtYXBwaW5ncyI6Ijs7O2tCQUd3QkEsSzs7QUFIeEI7Ozs7QUFDQTs7Ozs7O0FBRWUsU0FBU0EsS0FBVCxDQUFlQyxHQUFmLEVBQW9CQyxJQUFwQixFQUEwQjtBQUNyQyxRQUFLQSxRQUFRQSxLQUFLQyxJQUFsQixFQUF5QjtBQUNyQixjQUFNLElBQUlDLEtBQUosQ0FBVSw4QkFDQSw0Q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gdGhyb3cgbmV3IEVycm9yKCdPcHRpb24gc2FmZSB3YXMgcmVtb3ZlZC4gJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAnVXNlIHBhcnNlcjogcmVxdWlyZShcInBvc3Rjc3Mtc2FmZS1wYXJzZXJcIiknKTtcbiAgICB9XG5cbiAgICBsZXQgaW5wdXQgPSBuZXcgSW5wdXQoY3NzLCBvcHRzKTtcblxuICAgIGxldCBwYXJzZXIgPSBuZXcgUGFyc2VyKGlucHV0KTtcbiAgICB0cnkge1xuICAgICAgICBwYXJzZXIudG9rZW5pemUoKTtcbiAgICAgICAgcGFyc2VyLmxvb3AoKTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIGlmICggZS5uYW1lID09PSAnQ3NzU3ludGF4RXJyb3InICYmIG9wdHMgJiYgb3B0cy5mcm9tICkge1xuICAgICAgICAgICAgaWYgKCAvXFwuc2NzcyQvaS50ZXN0KG9wdHMuZnJvbSkgKSB7XG4gICAgICAgICAgICAgICAgZS5tZXNzYWdlICs9ICdcXG5Zb3UgdHJpZWQgdG8gcGFyc2UgU0NTUyB3aXRoICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAndGhlIHN0YW5kYXJkIENTUyBwYXJzZXI7ICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAndHJ5IGFnYWluIHdpdGggdGhlIHBvc3Rjc3Mtc2NzcyBwYXJzZXInO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggL1xcLnNhc3MvaS50ZXN0KG9wdHMuZnJvbSkgKSB7XG4gICAgICAgICAgICAgICAgZS5tZXNzYWdlICs9ICdcXG5Zb3UgdHJpZWQgdG8gcGFyc2UgU2FzcyB3aXRoICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAndGhlIHN0YW5kYXJkIENTUyBwYXJzZXI7ICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAndHJ5IGFnYWluIHdpdGggdGhlIHBvc3Rjc3Mtc2FzcyBwYXJzZXInO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggL1xcLmxlc3MkL2kudGVzdChvcHRzLmZyb20pICkge1xuICAgICAgICAgICAgICAgIGUubWVzc2FnZSArPSAnXFxuWW91IHRyaWVkIHRvIHBhcnNlIExlc3Mgd2l0aCAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3RoZSBzdGFuZGFyZCBDU1MgcGFyc2VyOyAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3RyeSBhZ2FpbiB3aXRoIHRoZSBwb3N0Y3NzLWxlc3MgcGFyc2VyJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aHJvdyBlO1xuICAgIH1cblxuICAgIHJldHVybiBwYXJzZXIucm9vdDtcbn1cbiJdfQ==
  12121. /***/ }),
  12122. /* 79 */
  12123. /***/ (function(module, exports, __webpack_require__) {
  12124. "use strict";
  12125. exports.__esModule = true;
  12126. var _declaration = __webpack_require__(76);
  12127. var _declaration2 = _interopRequireDefault(_declaration);
  12128. var _tokenize = __webpack_require__(81);
  12129. var _tokenize2 = _interopRequireDefault(_tokenize);
  12130. var _comment = __webpack_require__(24);
  12131. var _comment2 = _interopRequireDefault(_comment);
  12132. var _atRule = __webpack_require__(23);
  12133. var _atRule2 = _interopRequireDefault(_atRule);
  12134. var _root = __webpack_require__(28);
  12135. var _root2 = _interopRequireDefault(_root);
  12136. var _rule = __webpack_require__(10);
  12137. var _rule2 = _interopRequireDefault(_rule);
  12138. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  12139. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12140. var Parser = function () {
  12141. function Parser(input) {
  12142. _classCallCheck(this, Parser);
  12143. this.input = input;
  12144. this.pos = 0;
  12145. this.root = new _root2.default();
  12146. this.current = this.root;
  12147. this.spaces = '';
  12148. this.semicolon = false;
  12149. this.root.source = { input: input, start: { line: 1, column: 1 } };
  12150. }
  12151. Parser.prototype.tokenize = function tokenize() {
  12152. this.tokens = (0, _tokenize2.default)(this.input);
  12153. };
  12154. Parser.prototype.loop = function loop() {
  12155. var token = void 0;
  12156. while (this.pos < this.tokens.length) {
  12157. token = this.tokens[this.pos];
  12158. switch (token[0]) {
  12159. case 'space':
  12160. case ';':
  12161. this.spaces += token[1];
  12162. break;
  12163. case '}':
  12164. this.end(token);
  12165. break;
  12166. case 'comment':
  12167. this.comment(token);
  12168. break;
  12169. case 'at-word':
  12170. this.atrule(token);
  12171. break;
  12172. case '{':
  12173. this.emptyRule(token);
  12174. break;
  12175. default:
  12176. this.other();
  12177. break;
  12178. }
  12179. this.pos += 1;
  12180. }
  12181. this.endFile();
  12182. };
  12183. Parser.prototype.comment = function comment(token) {
  12184. var node = new _comment2.default();
  12185. this.init(node, token[2], token[3]);
  12186. node.source.end = { line: token[4], column: token[5] };
  12187. var text = token[1].slice(2, -2);
  12188. if (/^\s*$/.test(text)) {
  12189. node.text = '';
  12190. node.raws.left = text;
  12191. node.raws.right = '';
  12192. } else {
  12193. var match = text.match(/^(\s*)([^]*[^\s])(\s*)$/);
  12194. node.text = match[2];
  12195. node.raws.left = match[1];
  12196. node.raws.right = match[3];
  12197. }
  12198. };
  12199. Parser.prototype.emptyRule = function emptyRule(token) {
  12200. var node = new _rule2.default();
  12201. this.init(node, token[2], token[3]);
  12202. node.selector = '';
  12203. node.raws.between = '';
  12204. this.current = node;
  12205. };
  12206. Parser.prototype.other = function other() {
  12207. var token = void 0;
  12208. var end = false;
  12209. var type = null;
  12210. var colon = false;
  12211. var bracket = null;
  12212. var brackets = [];
  12213. var start = this.pos;
  12214. while (this.pos < this.tokens.length) {
  12215. token = this.tokens[this.pos];
  12216. type = token[0];
  12217. if (type === '(' || type === '[') {
  12218. if (!bracket) bracket = token;
  12219. brackets.push(type === '(' ? ')' : ']');
  12220. } else if (brackets.length === 0) {
  12221. if (type === ';') {
  12222. if (colon) {
  12223. this.decl(this.tokens.slice(start, this.pos + 1));
  12224. return;
  12225. } else {
  12226. break;
  12227. }
  12228. } else if (type === '{') {
  12229. this.rule(this.tokens.slice(start, this.pos + 1));
  12230. return;
  12231. } else if (type === '}') {
  12232. this.pos -= 1;
  12233. end = true;
  12234. break;
  12235. } else if (type === ':') {
  12236. colon = true;
  12237. }
  12238. } else if (type === brackets[brackets.length - 1]) {
  12239. brackets.pop();
  12240. if (brackets.length === 0) bracket = null;
  12241. }
  12242. this.pos += 1;
  12243. }
  12244. if (this.pos === this.tokens.length) {
  12245. this.pos -= 1;
  12246. end = true;
  12247. }
  12248. if (brackets.length > 0) this.unclosedBracket(bracket);
  12249. if (end && colon) {
  12250. while (this.pos > start) {
  12251. token = this.tokens[this.pos][0];
  12252. if (token !== 'space' && token !== 'comment') break;
  12253. this.pos -= 1;
  12254. }
  12255. this.decl(this.tokens.slice(start, this.pos + 1));
  12256. return;
  12257. }
  12258. this.unknownWord(start);
  12259. };
  12260. Parser.prototype.rule = function rule(tokens) {
  12261. tokens.pop();
  12262. var node = new _rule2.default();
  12263. this.init(node, tokens[0][2], tokens[0][3]);
  12264. node.raws.between = this.spacesAndCommentsFromEnd(tokens);
  12265. this.raw(node, 'selector', tokens);
  12266. this.current = node;
  12267. };
  12268. Parser.prototype.decl = function decl(tokens) {
  12269. var node = new _declaration2.default();
  12270. this.init(node);
  12271. var last = tokens[tokens.length - 1];
  12272. if (last[0] === ';') {
  12273. this.semicolon = true;
  12274. tokens.pop();
  12275. }
  12276. if (last[4]) {
  12277. node.source.end = { line: last[4], column: last[5] };
  12278. } else {
  12279. node.source.end = { line: last[2], column: last[3] };
  12280. }
  12281. while (tokens[0][0] !== 'word') {
  12282. node.raws.before += tokens.shift()[1];
  12283. }
  12284. node.source.start = { line: tokens[0][2], column: tokens[0][3] };
  12285. node.prop = '';
  12286. while (tokens.length) {
  12287. var type = tokens[0][0];
  12288. if (type === ':' || type === 'space' || type === 'comment') {
  12289. break;
  12290. }
  12291. node.prop += tokens.shift()[1];
  12292. }
  12293. node.raws.between = '';
  12294. var token = void 0;
  12295. while (tokens.length) {
  12296. token = tokens.shift();
  12297. if (token[0] === ':') {
  12298. node.raws.between += token[1];
  12299. break;
  12300. } else {
  12301. node.raws.between += token[1];
  12302. }
  12303. }
  12304. if (node.prop[0] === '_' || node.prop[0] === '*') {
  12305. node.raws.before += node.prop[0];
  12306. node.prop = node.prop.slice(1);
  12307. }
  12308. node.raws.between += this.spacesAndCommentsFromStart(tokens);
  12309. this.precheckMissedSemicolon(tokens);
  12310. for (var i = tokens.length - 1; i > 0; i--) {
  12311. token = tokens[i];
  12312. if (token[1] === '!important') {
  12313. node.important = true;
  12314. var string = this.stringFrom(tokens, i);
  12315. string = this.spacesFromEnd(tokens) + string;
  12316. if (string !== ' !important') node.raws.important = string;
  12317. break;
  12318. } else if (token[1] === 'important') {
  12319. var cache = tokens.slice(0);
  12320. var str = '';
  12321. for (var j = i; j > 0; j--) {
  12322. var _type = cache[j][0];
  12323. if (str.trim().indexOf('!') === 0 && _type !== 'space') {
  12324. break;
  12325. }
  12326. str = cache.pop()[1] + str;
  12327. }
  12328. if (str.trim().indexOf('!') === 0) {
  12329. node.important = true;
  12330. node.raws.important = str;
  12331. tokens = cache;
  12332. }
  12333. }
  12334. if (token[0] !== 'space' && token[0] !== 'comment') {
  12335. break;
  12336. }
  12337. }
  12338. this.raw(node, 'value', tokens);
  12339. if (node.value.indexOf(':') !== -1) this.checkMissedSemicolon(tokens);
  12340. };
  12341. Parser.prototype.atrule = function atrule(token) {
  12342. var node = new _atRule2.default();
  12343. node.name = token[1].slice(1);
  12344. if (node.name === '') {
  12345. this.unnamedAtrule(node, token);
  12346. }
  12347. this.init(node, token[2], token[3]);
  12348. var last = false;
  12349. var open = false;
  12350. var params = [];
  12351. this.pos += 1;
  12352. while (this.pos < this.tokens.length) {
  12353. token = this.tokens[this.pos];
  12354. if (token[0] === ';') {
  12355. node.source.end = { line: token[2], column: token[3] };
  12356. this.semicolon = true;
  12357. break;
  12358. } else if (token[0] === '{') {
  12359. open = true;
  12360. break;
  12361. } else if (token[0] === '}') {
  12362. this.end(token);
  12363. break;
  12364. } else {
  12365. params.push(token);
  12366. }
  12367. this.pos += 1;
  12368. }
  12369. if (this.pos === this.tokens.length) {
  12370. last = true;
  12371. }
  12372. node.raws.between = this.spacesAndCommentsFromEnd(params);
  12373. if (params.length) {
  12374. node.raws.afterName = this.spacesAndCommentsFromStart(params);
  12375. this.raw(node, 'params', params);
  12376. if (last) {
  12377. token = params[params.length - 1];
  12378. node.source.end = { line: token[4], column: token[5] };
  12379. this.spaces = node.raws.between;
  12380. node.raws.between = '';
  12381. }
  12382. } else {
  12383. node.raws.afterName = '';
  12384. node.params = '';
  12385. }
  12386. if (open) {
  12387. node.nodes = [];
  12388. this.current = node;
  12389. }
  12390. };
  12391. Parser.prototype.end = function end(token) {
  12392. if (this.current.nodes && this.current.nodes.length) {
  12393. this.current.raws.semicolon = this.semicolon;
  12394. }
  12395. this.semicolon = false;
  12396. this.current.raws.after = (this.current.raws.after || '') + this.spaces;
  12397. this.spaces = '';
  12398. if (this.current.parent) {
  12399. this.current.source.end = { line: token[2], column: token[3] };
  12400. this.current = this.current.parent;
  12401. } else {
  12402. this.unexpectedClose(token);
  12403. }
  12404. };
  12405. Parser.prototype.endFile = function endFile() {
  12406. if (this.current.parent) this.unclosedBlock();
  12407. if (this.current.nodes && this.current.nodes.length) {
  12408. this.current.raws.semicolon = this.semicolon;
  12409. }
  12410. this.current.raws.after = (this.current.raws.after || '') + this.spaces;
  12411. };
  12412. // Helpers
  12413. Parser.prototype.init = function init(node, line, column) {
  12414. this.current.push(node);
  12415. node.source = { start: { line: line, column: column }, input: this.input };
  12416. node.raws.before = this.spaces;
  12417. this.spaces = '';
  12418. if (node.type !== 'comment') this.semicolon = false;
  12419. };
  12420. Parser.prototype.raw = function raw(node, prop, tokens) {
  12421. var token = void 0,
  12422. type = void 0;
  12423. var length = tokens.length;
  12424. var value = '';
  12425. var clean = true;
  12426. for (var i = 0; i < length; i += 1) {
  12427. token = tokens[i];
  12428. type = token[0];
  12429. if (type === 'comment' || type === 'space' && i === length - 1) {
  12430. clean = false;
  12431. } else {
  12432. value += token[1];
  12433. }
  12434. }
  12435. if (!clean) {
  12436. var raw = tokens.reduce(function (all, i) {
  12437. return all + i[1];
  12438. }, '');
  12439. node.raws[prop] = { value: value, raw: raw };
  12440. }
  12441. node[prop] = value;
  12442. };
  12443. Parser.prototype.spacesAndCommentsFromEnd = function spacesAndCommentsFromEnd(tokens) {
  12444. var lastTokenType = void 0;
  12445. var spaces = '';
  12446. while (tokens.length) {
  12447. lastTokenType = tokens[tokens.length - 1][0];
  12448. if (lastTokenType !== 'space' && lastTokenType !== 'comment') break;
  12449. spaces = tokens.pop()[1] + spaces;
  12450. }
  12451. return spaces;
  12452. };
  12453. Parser.prototype.spacesAndCommentsFromStart = function spacesAndCommentsFromStart(tokens) {
  12454. var next = void 0;
  12455. var spaces = '';
  12456. while (tokens.length) {
  12457. next = tokens[0][0];
  12458. if (next !== 'space' && next !== 'comment') break;
  12459. spaces += tokens.shift()[1];
  12460. }
  12461. return spaces;
  12462. };
  12463. Parser.prototype.spacesFromEnd = function spacesFromEnd(tokens) {
  12464. var lastTokenType = void 0;
  12465. var spaces = '';
  12466. while (tokens.length) {
  12467. lastTokenType = tokens[tokens.length - 1][0];
  12468. if (lastTokenType !== 'space') break;
  12469. spaces = tokens.pop()[1] + spaces;
  12470. }
  12471. return spaces;
  12472. };
  12473. Parser.prototype.stringFrom = function stringFrom(tokens, from) {
  12474. var result = '';
  12475. for (var i = from; i < tokens.length; i++) {
  12476. result += tokens[i][1];
  12477. }
  12478. tokens.splice(from, tokens.length - from);
  12479. return result;
  12480. };
  12481. Parser.prototype.colon = function colon(tokens) {
  12482. var brackets = 0;
  12483. var token = void 0,
  12484. type = void 0,
  12485. prev = void 0;
  12486. for (var i = 0; i < tokens.length; i++) {
  12487. token = tokens[i];
  12488. type = token[0];
  12489. if (type === '(') {
  12490. brackets += 1;
  12491. } else if (type === ')') {
  12492. brackets -= 1;
  12493. } else if (brackets === 0 && type === ':') {
  12494. if (!prev) {
  12495. this.doubleColon(token);
  12496. } else if (prev[0] === 'word' && prev[1] === 'progid') {
  12497. continue;
  12498. } else {
  12499. return i;
  12500. }
  12501. }
  12502. prev = token;
  12503. }
  12504. return false;
  12505. };
  12506. // Errors
  12507. Parser.prototype.unclosedBracket = function unclosedBracket(bracket) {
  12508. throw this.input.error('Unclosed bracket', bracket[2], bracket[3]);
  12509. };
  12510. Parser.prototype.unknownWord = function unknownWord(start) {
  12511. var token = this.tokens[start];
  12512. throw this.input.error('Unknown word', token[2], token[3]);
  12513. };
  12514. Parser.prototype.unexpectedClose = function unexpectedClose(token) {
  12515. throw this.input.error('Unexpected }', token[2], token[3]);
  12516. };
  12517. Parser.prototype.unclosedBlock = function unclosedBlock() {
  12518. var pos = this.current.source.start;
  12519. throw this.input.error('Unclosed block', pos.line, pos.column);
  12520. };
  12521. Parser.prototype.doubleColon = function doubleColon(token) {
  12522. throw this.input.error('Double colon', token[2], token[3]);
  12523. };
  12524. Parser.prototype.unnamedAtrule = function unnamedAtrule(node, token) {
  12525. throw this.input.error('At-rule without name', token[2], token[3]);
  12526. };
  12527. Parser.prototype.precheckMissedSemicolon = function precheckMissedSemicolon(tokens) {
  12528. // Hook for Safe Parser
  12529. tokens;
  12530. };
  12531. Parser.prototype.checkMissedSemicolon = function checkMissedSemicolon(tokens) {
  12532. var colon = this.colon(tokens);
  12533. if (colon === false) return;
  12534. var founded = 0;
  12535. var token = void 0;
  12536. for (var j = colon - 1; j >= 0; j--) {
  12537. token = tokens[j];
  12538. if (token[0] !== 'space') {
  12539. founded += 1;
  12540. if (founded === 2) break;
  12541. }
  12542. }
  12543. throw this.input.error('Missed semicolon', token[2], token[3]);
  12544. };
  12545. return Parser;
  12546. }();
  12547. exports.default = Parser;
  12548. module.exports = exports['default'];
  12549. //# sourceMappingURL=data:application/json;charset=utf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2VyLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IERlY2xhcmF0aW9uIGZyb20gJy4vZGVjbGFyYXRpb24nO1xuaW1wb3J0IHRva2VuaXplciAgIGZyb20gJy4vdG9rZW5pemUnO1xuaW1wb3J0IENvbW1lbnQgICAgIGZyb20gJy4vY29tbWVudCc7XG5pbXBvcnQgQXRSdWxlICAgICAgZnJvbSAnLi9hdC1ydWxlJztcbmltcG9ydCBSb290ICAgICAgICBmcm9tICcuL3Jvb3QnO1xuaW1wb3J0IFJ1bGUgICAgICAgIGZyb20gJy4vcnVsZSc7XG5cbmV4cG9ydCBkZWZhdWx0IGNsYXNzIFBhcnNlciB7XG5cbiAgICBjb25zdHJ1Y3RvcihpbnB1dCkge1xuICAgICAgICB0aGlzLmlucHV0ID0gaW5wdXQ7XG5cbiAgICAgICAgdGhpcy5wb3MgICAgICAgPSAwO1xuICAgICAgICB0aGlzLnJvb3QgICAgICA9IG5ldyBSb290KCk7XG4gICAgICAgIHRoaXMuY3VycmVudCAgID0gdGhpcy5yb290O1xuICAgICAgICB0aGlzLnNwYWNlcyAgICA9ICcnO1xuICAgICAgICB0aGlzLnNlbWljb2xvbiA9IGZhbHNlO1xuXG4gICAgICAgIHRoaXMucm9vdC5zb3VyY2UgPSB7IGlucHV0LCBzdGFydDogeyBsaW5lOiAxLCBjb2x1bW46IDEgfSB9O1xuICAgIH1cblxuICAgIHRva2VuaXplKCkge1xuICAgICAgICB0aGlzLnRva2VucyA9IHRva2VuaXplcih0aGlzLmlucHV0KTtcbiAgICB9XG5cbiAgICBsb29wKCkge1xuICAgICAgICBsZXQgdG9rZW47XG4gICAgICAgIHdoaWxlICggdGhpcy5wb3MgPCB0aGlzLnRva2Vucy5sZW5ndGggKSB7XG4gICAgICAgICAgICB0b2tlbiA9IHRoaXMudG9rZW5zW3RoaXMucG9zXTtcblxuICAgICAgICAgICAgc3dpdGNoICggdG9rZW5bMF0gKSB7XG5cbiAgICAgICAgICAgIGNhc2UgJ3NwYWNlJzpcbiAgICAgICAgICAgIGNhc2UgJzsnOlxuICAgICAgICAgICAgICAgIHRoaXMuc3BhY2VzICs9IHRva2VuWzFdO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBjYXNlICd9JzpcbiAgICAgICAgICAgICAgICB0aGlzLmVuZCh0b2tlbik7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIGNhc2UgJ2NvbW1lbnQnOlxuICAgICAgICAgICAgICAgIHRoaXMuY29tbWVudCh0b2tlbik7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIGNhc2UgJ2F0LXdvcmQnOlxuICAgICAgICAgICAgICAgIHRoaXMuYXRydWxlKHRva2VuKTtcbiAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgY2FzZSAneyc6XG4gICAgICAgICAgICAgICAgdGhpcy5lbXB0eVJ1bGUodG9rZW4pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIHRoaXMub3RoZXIoKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5wb3MgKz0gMTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmVuZEZpbGUoKTtcbiAgICB9XG5cbiAgICBjb21tZW50KHRva2VuKSB7XG4gICAgICAgIGxldCBub2RlID0gbmV3IENvbW1lbnQoKTtcbiAgICAgICAgdGhpcy5pbml0KG5vZGUsIHRva2VuWzJdLCB0b2tlblszXSk7XG4gICAgICAgIG5vZGUuc291cmNlLmVuZCA9IHsgbGluZTogdG9rZW5bNF0sIGNvbHVtbjogdG9rZW5bNV0gfTtcblxuICAgICAgICBsZXQgdGV4dCA9IHRva2VuWzFdLnNsaWNlKDIsIC0yKTtcbiAgICAgICAgaWYgKCAvXlxccyokLy50ZXN0KHRleHQpICkge1xuICAgICAgICAgICAgbm9kZS50ZXh0ICAgICAgID0gJyc7XG4gICAgICAgICAgICBub2RlLnJhd3MubGVmdCAgPSB0ZXh0O1xuICAgICAgICAgICAgbm9kZS5yYXdzLnJpZ2h0ID0gJyc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBsZXQgbWF0Y2ggPSB0ZXh0Lm1hdGNoKC9eKFxccyopKFteXSpbXlxcc10pKFxccyopJC8pO1xuICAgICAgICAgICAgbm9kZS50ZXh0ICAgICAgID0gbWF0Y2hbMl07XG4gICAgICAgICAgICBub2RlLnJhd3MubGVmdCAgPSBtYXRjaFsxXTtcbiAgICAgICAgICAgIG5vZGUucmF3cy5yaWdodCA9IG1hdGNoWzNdO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZW1wdHlSdWxlKHRva2VuKSB7XG4gICAgICAgIGxldCBub2RlID0gbmV3IFJ1bGUoKTtcbiAgICAgICAgdGhpcy5pbml0KG5vZGUsIHRva2VuWzJdLCB0b2tlblszXSk7XG4gICAgICAgIG5vZGUuc2VsZWN0b3IgPSAnJztcbiAgICAgICAgbm9kZS5yYXdzLmJldHdlZW4gPSAnJztcbiAgICAgICAgdGhpcy5jdXJyZW50ID0gbm9kZTtcbiAgICB9XG5cbiAgICBvdGhlcigpIHtcbiAgICAgICAgbGV0IHRva2VuO1xuICAgICAgICBsZXQgZW5kICAgICAgPSBmYWxzZTtcbiAgICAgICAgbGV0IHR5cGUgICAgID0gbnVsbDtcbiAgICAgICAgbGV0IGNvbG9uICAgID0gZmFsc2U7XG4gICAgICAgIGxldCBicmFja2V0ICA9IG51bGw7XG4gICAgICAgIGxldCBicmFja2V0cyA9IFtdO1xuXG4gICAgICAgIGxldCBzdGFydCA9IHRoaXMucG9zO1xuICAgICAgICB3aGlsZSAoIHRoaXMucG9zIDwgdGhpcy50b2tlbnMubGVuZ3RoICkge1xuICAgICAgICAgICAgdG9rZW4gPSB0aGlzLnRva2Vuc1t0aGlzLnBvc107XG4gICAgICAgICAgICB0eXBlICA9IHRva2VuWzBdO1xuXG4gICAgICAgICAgICBpZiAoIHR5cGUgPT09ICcoJyB8fCB0eXBlID09PSAnWycgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCAhYnJhY2tldCApIGJyYWNrZXQgPSB0b2tlbjtcbiAgICAgICAgICAgICAgICBicmFja2V0cy5wdXNoKHR5cGUgPT09ICcoJyA/ICcpJyA6ICddJyk7XG5cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIGJyYWNrZXRzLmxlbmd0aCA9PT0gMCApIHtcbiAgICAgICAgICAgICAgICBpZiAoIHR5cGUgPT09ICc7JyApIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCBjb2xvbiApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZGVjbCh0aGlzLnRva2Vucy5zbGljZShzdGFydCwgdGhpcy5wb3MgKyAxKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICggdHlwZSA9PT0gJ3snICkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnJ1bGUodGhpcy50b2tlbnMuc2xpY2Uoc3RhcnQsIHRoaXMucG9zICsgMSkpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG5cbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSAnfScgKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucG9zIC09IDE7XG4gICAgICAgICAgICAgICAgICAgIGVuZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICggdHlwZSA9PT0gJzonICkge1xuICAgICAgICAgICAgICAgICAgICBjb2xvbiA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSBicmFja2V0c1ticmFja2V0cy5sZW5ndGggLSAxXSApIHtcbiAgICAgICAgICAgICAgICBicmFja2V0cy5wb3AoKTtcbiAgICAgICAgICAgICAgICBpZiAoIGJyYWNrZXRzLmxlbmd0aCA9PT0gMCApIGJyYWNrZXQgPSBudWxsO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0aGlzLnBvcyArPSAxO1xuICAgICAgICB9XG4gICAgICAgIGlmICggdGhpcy5wb3MgPT09IHRoaXMudG9rZW5zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIHRoaXMucG9zIC09IDE7XG4gICAgICAgICAgICBlbmQgPSB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCBicmFja2V0cy5sZW5ndGggPiAwICkgdGhpcy51bmNsb3NlZEJyYWNrZXQoYnJhY2tldCk7XG5cbiAgICAgICAgaWYgKCBlbmQgJiYgY29sb24gKSB7XG4gICAgICAgICAgICB3aGlsZSAoIHRoaXMucG9zID4gc3RhcnQgKSB7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSB0aGlzLnRva2Vuc1t0aGlzLnBvc11bMF07XG4gICAgICAgICAgICAgICAgaWYgKCB0b2tlbiAhPT0gJ3NwYWNlJyAmJiB0b2tlbiAhPT0gJ2NvbW1lbnQnICkgYnJlYWs7XG4gICAgICAgICAgICAgICAgdGhpcy5wb3MgLT0gMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuZGVjbCh0aGlzLnRva2Vucy5zbGljZShzdGFydCwgdGhpcy5wb3MgKyAxKSk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnVua25vd25Xb3JkKHN0YXJ0KTtcbiAgICB9XG5cbiAgICBydWxlKHRva2Vucykge1xuICAgICAgICB0b2tlbnMucG9wKCk7XG5cbiAgICAgICAgbGV0IG5v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NdIH07XG5cbiAgICAgICAgbm9kZS5wcm9wID0gJyc7XG4gICAgICAgIHdoaWxlICggdG9rZW5zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIGxldCB0eXBlID0gdG9rZW5zWzBdWzBdO1xuICAgICAgICAgICAgaWYgKCB0eXBlID09PSAnOicgfHwgdHlwZSA9PT0gJ3NwYWNlJyB8fCB0eXBlID09PSAnY29tbWVudCcgKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBub2RlLnByb3AgKz0gdG9rZW5zLnNoaWZ0KClbMV07XG4gICAgICAgIH1cblxuICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9ICcnO1xuXG4gICAgICAgIGxldCB0b2tlbjtcbiAgICAgICAgd2hpbGUgKCB0b2tlbnMubGVuZ3RoICkge1xuICAgICAgICAgICAgdG9rZW4gPSB0b2tlbnMuc2hpZnQoKTtcblxuICAgICAgICAgICAgaWYgKCB0b2tlblswXSA9PT0gJzonICkge1xuICAgICAgICAgICAgICAgIG5vZGUucmF3cy5iZXR3ZWVuICs9IHRva2VuWzFdO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiArPSB0b2tlblsxXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICggbm9kZS5wcm9wWzBdID09PSAnXycgfHwgbm9kZS5wcm9wWzBdID09PSAnKicgKSB7XG4gICAgICAgICAgICBub2RlLnJhd3MuYmVmb3JlICs9IG5vZGUucHJvcFswXTtcbiAgICAgICAgICAgIG5vZGUucHJvcCA9IG5vZGUucHJvcC5zbGljZSgxKTtcbiAgICAgICAgfVxuICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiArPSB0aGlzLnNwYWNlc0FuZENvbW1lbnRzRnJvbVN0YXJ0KHRva2Vucyk7XG4gICAgICAgIHRoaXMucHJlY2hlY2tNaXNzZWRTZW1pY29sb24odG9rZW5zKTtcblxuICAgICAgICBmb3IgKCBsZXQgaSA9IHRva2Vucy5sZW5ndGggLSAxOyBpID4gMDsgaS0tICkge1xuICAgICAgICAgICAgdG9rZW4gPSB0b2tlbnNbaV07XG4gICAgICAgICAgICBpZiAoIHRva2VuWzFdID09PSAnIWltcG9ydGFudCcgKSB7XG4gICAgICAgICAgICAgICAgbm9kZS5pbXBvcnRhbnQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGxldCBzdHJpbmcgPSB0aGlzLnN0cmluZ0Zyb20odG9rZW5zLCBpKTtcbiAgICAgICAgICAgICAgICBzdHJpbmcgPSB0aGlzLnNwYWNlc0Zyb21FbmQodG9rZW5zKSArIHN0cmluZztcbiAgICAgICAgICAgICAgICBpZiAoIHN0cmluZyAhPT0gJyAhaW1wb3J0YW50JyApIG5vZGUucmF3cy5pbXBvcnRhbnQgPSBzdHJpbmc7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIH0gZWxzZSBpZiAodG9rZW5bMV0gPT09ICdpbXBvcnRhbnQnKSB7XG4gICAgICAgICAgICAgICAgbGV0IGNhY2hlID0gdG9rZW5zLnNsaWNlKDApO1xuICAgICAgICAgICAgICAgIGxldCBzdHIgICA9ICcnO1xuICAgICAgICAgICAgICAgIGZvciAoIGxldCBqID0gaTsgaiA+IDA7IGotLSApIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHR5cGUgPSBjYWNoZVtqXVswXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCBzdHIudHJpbSgpLmluZGV4T2YoJyEnKSA9PT0gMCAmJiB0eXBlICE9PSAnc3BhY2UnICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgc3RyID0gY2FjaGUucG9wKClbMV0gKyBzdHI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICggc3RyLnRyaW0oKS5pbmRleE9mKCchJykgPT09IDAgKSB7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUuaW1wb3J0YW50ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5yYXdzLmltcG9ydGFudCA9IHN0cjtcbiAgICAgICAgICAgICAgICAgICAgdG9rZW5zID0gY2FjaGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoIHRva2VuWzBdICE9PSAnc3BhY2UnICYmIHRva2VuWzBdICE9PSAnY29tbWVudCcgKSB7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnJhdyhub2RlLCAndmFsdWUnLCB0b2tlbnMpO1xuXG4gICAgICAgIGlmICggbm9kZS52YWx1ZS5pbmRleE9mKCc6JykgIT09IC0xICkgdGhpcy5jaGVja01pc3NlZFNlbWljb2xvbih0b2tlbnMpO1xuICAgIH1cblxuICAgIGF0cnVsZSh0b2tlbikge1xuICAgICAgICBsZXQgbm9kZSAgPSBuZXcgQXRSdWxlKCk7XG4gICAgICAgIG5vZGUubmFtZSA9IHRva2VuWzFdLnNsaWNlKDEpO1xuICAgICAgICBpZiAoIG5vZGUubmFtZSA9PT0gJycgKSB7XG4gICAgICAgICAgICB0aGlzLnVubmFtZWRBdHJ1bGUobm9kZSwgdG9rZW4pO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMuaW5pdChub2RlLCB0b2tlblsyXSwgdG9rZW5bM10pO1xuXG4gICAgICAgIGxldCBsYXN0ICAgPSBmYWxzZTtcbiAgICAgICAgbGV0IG9wZW4gICA9IGZhbHNlO1xuICAgICAgICBsZXQgcGFyYW1zID0gW107XG5cbiAgICAgICAgdGhpcy5wb3MgKz0gMTtcbiAgICAgICAgd2hpbGUgKCB0aGlzLnBvcyA8IHRoaXMudG9rZW5zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIHRva2VuID0gdGhpcy50b2tlbnNbdGhpcy5wb3NdO1xuXG4gICAgICAgICAgICBpZiAoIHRva2VuWzBdID09PSAnOycgKSB7XG4gICAgICAgICAgICAgICAgbm9kZS5zb3VyY2UuZW5kID0geyBsaW5lOiB0b2tlblsyXSwgY29sdW1uOiB0b2tlblszXSB9O1xuICAgICAgICAgICAgICAgIHRoaXMuc2VtaWNvbG9uID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHRva2VuWzBdID09PSAneycgKSB7XG4gICAgICAgICAgICAgICAgb3BlbiA9IHRydWU7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCB0b2tlblswXSA9PT0gJ30nKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5lbmQodG9rZW4pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBwYXJhbXMucHVzaCh0b2tlbik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMucG9zICs9IDE7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCB0aGlzLnBvcyA9PT0gdGhpcy50b2tlbnMubGVuZ3RoICkge1xuICAgICAgICAgICAgbGFzdCA9IHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9IHRoaXMuc3BhY2VzQW5kQ29tbWVudHNGcm9tRW5kKHBhcmFtcyk7XG4gICAgICAgIGlmICggcGFyYW1zLmxlbmd0aCApIHtcbiAgICAgICAgICAgIG5vZGUucmF3cy5hZnRlck5hbWUgPSB0aGlzLnNwYWNlc0FuZENvbW1lbnRzRnJvbVN0YXJ0KHBhcmFtcyk7XG4gICAgICAgICAgICB0aGlzLnJhdyhub2RlLCAncGFyYW1zJywgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmICggbGFzdCApIHtcbiAgICAgICAgICAgICAgICB0b2tlbiA9IHBhcmFtc1twYXJhbXMubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICAgICAgbm9kZS5zb3VyY2UuZW5kICAgPSB7IGxpbmU6IHRva2VuWzRdLCBjb2x1bW46IHRva2VuWzVdIH07XG4gICAgICAgICAgICAgICAgdGhpcy5zcGFjZXMgICAgICAgPSBub2RlLnJhd3MuYmV0d2VlbjtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9ICcnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbm9kZS5yYXdzLmFmdGVyTmFtZSA9ICcnO1xuICAgICAgICAgICAgbm9kZS5wYXJhbXMgICAgICAgICA9ICcnO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCBvcGVuICkge1xuICAgICAgICAgICAgbm9kZS5ub2RlcyAgID0gW107XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnQgPSBub2RlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZW5kKHRva2VuKSB7XG4gICAgICAgIGlmICggdGhpcy5jdXJyZW50Lm5vZGVzICYmIHRoaXMuY3VycmVudC5ub2Rlcy5sZW5ndGggKSB7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnQucmF3cy5zZW1pY29sb24gPSB0aGlzLnNlbWljb2xvbjtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnNlbWljb2xvbiA9IGZhbHNlO1xuXG4gICAgICAgIHRoaXMuY3VycmVudC5yYXdzLmFmdGVyID0gKHRoaXMuY3VycmVudC5yYXdzLmFmdGVyIHx8ICcnKSArIHRoaXMuc3BhY2VzO1xuICAgICAgICB0aGlzLnNwYWNlcyA9ICcnO1xuXG4gICAgICAgIGlmICggdGhpcy5jdXJyZW50LnBhcmVudCApIHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudC5zb3VyY2UuZW5kID0geyBsaW5lOi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G9rZW5zLmxlbmd0aDtcbiAgICAgICAgbGV0IHZhbHVlICA9ICcnO1xuICAgICAgICBsZXQgY2xlYW4gID0gdHJ1ZTtcbiAgICAgICAgZm9yICggbGV0IGkgPSAwOyBpIDwgbGVuZ3RoOyBpICs9IDEgKSB7XG4gICAgICAgICAgICB0b2tlbiA9IHRva2Vuc1tpXTtcbiAgICAgICAgICAgIHR5cGUgID0gdG9rZW5bMF07XG4gICAgICAgICAgICBpZiAoIHR5cGUgPT09ICdjb21tZW50JyB8fCB0eXBlID09PSAnc3BhY2UnICYmIGkgPT09IGxlbmd0aCAtIDEgKSB7XG4gICAgICAgICAgICAgICAgY2xlYW4gPSBmYWxzZTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFsdWUgKz0gdG9rZW5bMV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCAhY2xlYW4gKSB7XG4gICAgICAgICAgICBsZXQgcmF3ID0gdG9rZW5zLnJlZHVjZSggKGFsbCwgaSkgPT4gYWxsICsgaVsxXSwgJycpO1xuICAgICAgICAgICAgbm9kZS5yYXdzW3Byb3BdID0geyB2YWx1ZSwgcmF3IH07XG4gICAgICAgIH1cbiAgICAgICAgbm9kZVtwcm9wXSA9IHZhbHVlO1xuICAgIH1cblxuICAgIHNwYWNlc0FuZENvbW1lbnRzRnJvbUVuZCh0b2tlbnMpIHtcbiAgICAgICAgbGV0IGxhc3RUb2tlblR5cGU7XG4gICAgICAgIGxldCBzcGFjZXMgPSAnJztcbiAgICAgICAgd2hpbGUgKCB0b2tlbnMubGVuZ3RoICkge1xuICAgICAgICAgICAgbGFzdFRva2VuVHlwZSA9IHRva2Vuc1t0b2tlbnMubGVuZ3RoIC0gMV1bMF07XG4gICAgICAgICAgICBpZiAoIGxhc3RUb2tlblR5cGUgIT09ICdzcGFjZScgJiZcbiAgICAgICAgICAgICAgICBsYXN0VG9rZW5UeXBlICE9PSAnY29tbWVudCcgKSBicmVhaztcbiAgICAgICAgICAgIHNwYWNlcyA9IHRva2Vucy5wb3AoKVsxXSArIHNwYWNlcztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc3BhY2VzO1xuICAgIH1cblxuICAgIHNwYWNlc0FuZENvbW1lbnRzRnJvbVN0YXJ0KHRva2Vucykge1xuICAgICAgICBsZXQgbmV4dDtcbiAgICAgICAgbGV0IHNwYWNlcyA9ICcnO1xuICAgICAgICB3aGlsZSAoIHRva2Vucy5sZW5ndGggKSB7XG4gICAgICAgICAgICBuZXh0ID0gdG9rZW5zWzBdWzBdO1xuICAgICAgICAgICAgaWYgKCBuZXh0ICE9PSAnc3BhY2UnICYmIG5leHQgIT09ICdjb21tZW50JyApIGJyZWFrO1xuICAgICAgICAgICAgc3BhY2VzICs9IHRva2Vucy5zaGlmdCgpWzFdO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzcGFjZXM7XG4gICAgfVxuXG4gICAgc3BhY2VzRnJvbUVuZCh0b2tlbnMpIHtcbiAgICAgICAgbGV0IGxhc3RUb2tlblR5cGU7XG4gICAgICAgIGxldCBzcGFjZXMgPSAnJztcbiAgICAgICAgd2hpbGUgKCB0b2tlbnMubGVuZ3RoICkge1xuICAgICAgICAgICAgbGFzdFRva2VuVHlwZSA9IHRva2Vuc1t0b2tlbnMubGVuZ3RoIC0gMV1bMF07XG4gICAgICAgICAgICBpZiAoIGxhc3RUb2tlblR5cGUgIT09ICdzcGFjZScgKSBicmVhaztcbiAgICAgICAgICAgIHNwYWNlcyA9IHRva2Vucy5wb3AoKVsxXSArIHNwYWNlcztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc3BhY2VzO1xuICAgIH1cblxuICAgIHN0cmluZ0Zyb20odG9rZW5zLCBmcm9tKSB7XG4gICAgICAgIGxldCByZXN1bHQgPSAnJztcbiAgICAgICAgZm9yICggbGV0IGkgPSBmcm9tOyBpIDwgdG9rZW5zLmxlbmd0aDsgaSsrICkge1xuICAgICAgICAgICAgcmVzdWx0ICs9IHRva2Vuc1tpXVsxXTtcbiAgICAgICAgfVxuICAgICAgICB0b2tlbnMuc3BsaWNlKGZyb20sIHRva2Vucy5sZW5ndGggLSBmcm9tKTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBjb2xvbih0b2tlbnMpIHtcbiAgICAgICAgbGV0IGJyYWNrZXRzID0gMDtcbiAgICAgICAgbGV0IHRva2VuLCB0eXBlLCBwcmV2O1xuICAgICAgICBmb3IgKCBsZXQgaSA9IDA7IGkgPCB0b2tlbnMubGVuZ3RoOyBpKysgKSB7XG4gICAgICAgICAgICB0b2tlbiA9IHRva2Vuc1tpXTtcbiAgICAgICAgICAgIHR5cGUgID0gdG9rZW5bMF07XG5cbiAgICAgICAgICAgIGlmICggdHlwZSA9PT0gJygnICkge1xuICAgICAgICAgICAgICAgIGJyYWNrZXRzICs9IDE7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlID09PSAnKScgKSB7XG4gICAgICAgICAgICAgICAgYnJhY2tldHMgLT0gMTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIGJyYWNrZXRzID09PSAwICYmIHR5cGUgPT09ICc6JyApIHtcbiAgICAgICAgICAgICAgICBpZiAoICFwcmV2ICkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmRvdWJsZUNvbG9uKHRva2VuKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCBwcmV2WzBdID09PSAnd29yZCcgJiYgcHJldlsxXSA9PT0gJ3Byb2dpZCcgKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcHJldiA9IHRva2VuO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9X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VyXG4gICAgICAgIHRva2VucztcbiAgICB9XG5cbiAgICBjaGVja01pc3NlZFNlbWljb2xvbih0b2tlbnMpIHtcbiAgICAgICAgbGV0IGNvbG9uID0gdGhpcy5jb2xvbih0b2tlbnMpO1xuICAgICAgICBpZiAoIGNvbG9uID09PSBmYWxzZSApIHJldHVybjtcblxuICAgICAgICBsZXQgZm91bmRlZCA9IDA7XG4gICAgICAgIGxldCB0b2tlbjtcbiAgICAgICAgZm9yICggbGV0IGogPSBjb2xvbiAtIDE7IGogPj0gMDsgai0tICkge1xuICAgICAgICAgICAgdG9rZW4gPSB0b2tlbnNbal07XG4gICAgICAgICAgICBpZiAoIHRva2VuWzBdICE9PSAnc3BhY2UnICkge1xuICAgICAgICAgICAgICAgIGZvdW5kZWQgKz0gMTtcbiAgICAgICAgICAgICAgICBpZiAoIGZvdW5kZWQgPT09IDIgKSBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB0aHJvdyB0aGlzLmlucHV0LmVycm9yKCdNaXNzZWQgc2VtaWNvbG9uJywgdG9rZW5bMl0sIHRva2VuWzNdKTtcbiAgICB9XG5cbn1cbiJdfQ==
  12550. /***/ }),
  12551. /* 80 */
  12552. /***/ (function(module, exports, __webpack_require__) {
  12553. "use strict";
  12554. exports.__esModule = true;
  12555. exports.default = stringify;
  12556. var _stringifier = __webpack_require__(29);
  12557. var _stringifier2 = _interopRequireDefault(_stringifier);
  12558. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  12559. function stringify(node, builder) {
  12560. var str = new _stringifier2.default(builder);
  12561. str.stringify(node);
  12562. }
  12563. module.exports = exports['default'];
  12564. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0cmluZ2lmeS5lczYiXSwibmFtZXMiOlsic3RyaW5naWZ5Iiwibm9kZSIsImJ1aWxkZXIiLCJzdHIiXSwibWFwcGluZ3MiOiI7OztrQkFFd0JBLFM7O0FBRnhCOzs7Ozs7QUFFZSxTQUFTQSxTQUFULENBQW1CQyxJQUFuQixFQUF5QkMsT0FBekIsRUFBa0M7QUFDN0MsUUFBSUMsTUFBTSwwQkFBZ0JELE9BQWhCLENBQVY7QUFDQUMsUUFBSUgsU0FBSixDQUFjQyxJQUFkO0FBQ0giLCJmaWxlIjoic3RyaW5naWZ5LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFN0cmluZ2lmaWVyIGZyb20gJy4vc3RyaW5naWZpZXInO1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBzdHJpbmdpZnkobm9kZSwgYnVpbGRlcikge1xuICAgIGxldCBzdHIgPSBuZXcgU3RyaW5naWZpZXIoYnVpbGRlcik7XG4gICAgc3RyLnN0cmluZ2lmeShub2RlKTtcbn1cbiJdfQ==
  12565. /***/ }),
  12566. /* 81 */
  12567. /***/ (function(module, exports, __webpack_require__) {
  12568. "use strict";
  12569. exports.__esModule = true;
  12570. exports.default = tokenize;
  12571. var SINGLE_QUOTE = 39;
  12572. var DOUBLE_QUOTE = 34;
  12573. var BACKSLASH = 92;
  12574. var SLASH = 47;
  12575. var NEWLINE = 10;
  12576. var SPACE = 32;
  12577. var FEED = 12;
  12578. var TAB = 9;
  12579. var CR = 13;
  12580. var OPEN_SQUARE = 91;
  12581. var CLOSE_SQUARE = 93;
  12582. var OPEN_PARENTHESES = 40;
  12583. var CLOSE_PARENTHESES = 41;
  12584. var OPEN_CURLY = 123;
  12585. var CLOSE_CURLY = 125;
  12586. var SEMICOLON = 59;
  12587. var ASTERISK = 42;
  12588. var COLON = 58;
  12589. var AT = 64;
  12590. var RE_AT_END = /[ \n\t\r\f\{\(\)'"\\;/\[\]#]/g;
  12591. var RE_WORD_END = /[ \n\t\r\f\(\)\{\}:;@!'"\\\]\[#]|\/(?=\*)/g;
  12592. var RE_BAD_BRACKET = /.[\\\/\("'\n]/;
  12593. function tokenize(input) {
  12594. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12595. var tokens = [];
  12596. var css = input.css.valueOf();
  12597. var ignore = options.ignoreErrors;
  12598. var code = void 0,
  12599. next = void 0,
  12600. quote = void 0,
  12601. lines = void 0,
  12602. last = void 0,
  12603. content = void 0,
  12604. escape = void 0,
  12605. nextLine = void 0,
  12606. nextOffset = void 0,
  12607. escaped = void 0,
  12608. escapePos = void 0,
  12609. prev = void 0,
  12610. n = void 0;
  12611. var length = css.length;
  12612. var offset = -1;
  12613. var line = 1;
  12614. var pos = 0;
  12615. function unclosed(what) {
  12616. throw input.error('Unclosed ' + what, line, pos - offset);
  12617. }
  12618. while (pos < length) {
  12619. code = css.charCodeAt(pos);
  12620. if (code === NEWLINE || code === FEED || code === CR && css.charCodeAt(pos + 1) !== NEWLINE) {
  12621. offset = pos;
  12622. line += 1;
  12623. }
  12624. switch (code) {
  12625. case NEWLINE:
  12626. case SPACE:
  12627. case TAB:
  12628. case CR:
  12629. case FEED:
  12630. next = pos;
  12631. do {
  12632. next += 1;
  12633. code = css.charCodeAt(next);
  12634. if (code === NEWLINE) {
  12635. offset = next;
  12636. line += 1;
  12637. }
  12638. } while (code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED);
  12639. tokens.push(['space', css.slice(pos, next)]);
  12640. pos = next - 1;
  12641. break;
  12642. case OPEN_SQUARE:
  12643. tokens.push(['[', '[', line, pos - offset]);
  12644. break;
  12645. case CLOSE_SQUARE:
  12646. tokens.push([']', ']', line, pos - offset]);
  12647. break;
  12648. case OPEN_CURLY:
  12649. tokens.push(['{', '{', line, pos - offset]);
  12650. break;
  12651. case CLOSE_CURLY:
  12652. tokens.push(['}', '}', line, pos - offset]);
  12653. break;
  12654. case COLON:
  12655. tokens.push([':', ':', line, pos - offset]);
  12656. break;
  12657. case SEMICOLON:
  12658. tokens.push([';', ';', line, pos - offset]);
  12659. break;
  12660. case OPEN_PARENTHESES:
  12661. prev = tokens.length ? tokens[tokens.length - 1][1] : '';
  12662. n = css.charCodeAt(pos + 1);
  12663. if (prev === 'url' && n !== SINGLE_QUOTE && n !== DOUBLE_QUOTE && n !== SPACE && n !== NEWLINE && n !== TAB && n !== FEED && n !== CR) {
  12664. next = pos;
  12665. do {
  12666. escaped = false;
  12667. next = css.indexOf(')', next + 1);
  12668. if (next === -1) {
  12669. if (ignore) {
  12670. next = pos;
  12671. break;
  12672. } else {
  12673. unclosed('bracket');
  12674. }
  12675. }
  12676. escapePos = next;
  12677. while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
  12678. escapePos -= 1;
  12679. escaped = !escaped;
  12680. }
  12681. } while (escaped);
  12682. tokens.push(['brackets', css.slice(pos, next + 1), line, pos - offset, line, next - offset]);
  12683. pos = next;
  12684. } else {
  12685. next = css.indexOf(')', pos + 1);
  12686. content = css.slice(pos, next + 1);
  12687. if (next === -1 || RE_BAD_BRACKET.test(content)) {
  12688. tokens.push(['(', '(', line, pos - offset]);
  12689. } else {
  12690. tokens.push(['brackets', content, line, pos - offset, line, next - offset]);
  12691. pos = next;
  12692. }
  12693. }
  12694. break;
  12695. case CLOSE_PARENTHESES:
  12696. tokens.push([')', ')', line, pos - offset]);
  12697. break;
  12698. case SINGLE_QUOTE:
  12699. case DOUBLE_QUOTE:
  12700. quote = code === SINGLE_QUOTE ? '\'' : '"';
  12701. next = pos;
  12702. do {
  12703. escaped = false;
  12704. next = css.indexOf(quote, next + 1);
  12705. if (next === -1) {
  12706. if (ignore) {
  12707. next = pos + 1;
  12708. break;
  12709. } else {
  12710. unclosed('string');
  12711. }
  12712. }
  12713. escapePos = next;
  12714. while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
  12715. escapePos -= 1;
  12716. escaped = !escaped;
  12717. }
  12718. } while (escaped);
  12719. content = css.slice(pos, next + 1);
  12720. lines = content.split('\n');
  12721. last = lines.length - 1;
  12722. if (last > 0) {
  12723. nextLine = line + last;
  12724. nextOffset = next - lines[last].length;
  12725. } else {
  12726. nextLine = line;
  12727. nextOffset = offset;
  12728. }
  12729. tokens.push(['string', css.slice(pos, next + 1), line, pos - offset, nextLine, next - nextOffset]);
  12730. offset = nextOffset;
  12731. line = nextLine;
  12732. pos = next;
  12733. break;
  12734. case AT:
  12735. RE_AT_END.lastIndex = pos + 1;
  12736. RE_AT_END.test(css);
  12737. if (RE_AT_END.lastIndex === 0) {
  12738. next = css.length - 1;
  12739. } else {
  12740. next = RE_AT_END.lastIndex - 2;
  12741. }
  12742. tokens.push(['at-word', css.slice(pos, next + 1), line, pos - offset, line, next - offset]);
  12743. pos = next;
  12744. break;
  12745. case BACKSLASH:
  12746. next = pos;
  12747. escape = true;
  12748. while (css.charCodeAt(next + 1) === BACKSLASH) {
  12749. next += 1;
  12750. escape = !escape;
  12751. }
  12752. code = css.charCodeAt(next + 1);
  12753. if (escape && code !== SLASH && code !== SPACE && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED) {
  12754. next += 1;
  12755. }
  12756. tokens.push(['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset]);
  12757. pos = next;
  12758. break;
  12759. default:
  12760. if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) {
  12761. next = css.indexOf('*/', pos + 2) + 1;
  12762. if (next === 0) {
  12763. if (ignore) {
  12764. next = css.length;
  12765. } else {
  12766. unclosed('comment');
  12767. }
  12768. }
  12769. content = css.slice(pos, next + 1);
  12770. lines = content.split('\n');
  12771. last = lines.length - 1;
  12772. if (last > 0) {
  12773. nextLine = line + last;
  12774. nextOffset = next - lines[last].length;
  12775. } else {
  12776. nextLine = line;
  12777. nextOffset = offset;
  12778. }
  12779. tokens.push(['comment', content, line, pos - offset, nextLine, next - nextOffset]);
  12780. offset = nextOffset;
  12781. line = nextLine;
  12782. pos = next;
  12783. } else {
  12784. RE_WORD_END.lastIndex = pos + 1;
  12785. RE_WORD_END.test(css);
  12786. if (RE_WORD_END.lastIndex === 0) {
  12787. next = css.length - 1;
  12788. } else {
  12789. next = RE_WORD_END.lastIndex - 2;
  12790. }
  12791. tokens.push(['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset]);
  12792. pos = next;
  12793. }
  12794. break;
  12795. }
  12796. pos++;
  12797. }
  12798. return tokens;
  12799. }
  12800. module.exports = exports['default'];
  12801. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRva2VuaXplLmVzNiJdLCJuYW1lcyI6WyJ0b2tlbml6ZSIsIlNJTkdMRV9RVU9URSIsIkRPVUJMRV9RVU9URSIsIkJBQ0tTTEFTSCIsIlNMQVNIIiwiTkVXTElORSIsIlNQQUNFIiwiRkVFRCIsIlRBQiIsIkNSIiwiT1BFTl9TUVVBUkUiLCJDTE9TRV9TUVVBUkUiLCJPUEVOX1BBUkVOVEhFU0VTIiwiQ0xPU0VfUEFSRU5USEVTRVMiLCJPUEVOX0NVUkxZIiwiQ0xPU0VfQ1VSTFkiLCJTRU1JQ09MT04iLCJBU1RFUklTSyIsIkNPTE9OIiwiQVQiLCJSRV9BVF9FTkQiLCJSRV9XT1JEX0VORCIsIlJFX0JBRF9CUkFDS0VUIiwiaW5wdXQiLCJvcHRpb25zIiwidG9rZW5zIiwiY3NzIiwidmFsdWVPZiIsImlnbm9yZSIsImlnbm9yZUVycm9ycyIsImNvZGUiLCJuZXh0IiwicXVvdGUiLCJsaW5lcyIsImxhc3QiLCJjb250ZW50IiwiZXNjYXBlIiwibmV4dExpbmUiLCJuZXh0T2Zmc2V0IiwiZXNjYXBlZCIsImVzY2FwZVBvcyIsInByZXYiLCJuIiwibGVuZ3RoIiwib2Zmc2V0IiwibGluZSIsInBvcyIsInVuY2xvc2VkIiwid2hhdCIsImVycm9yIiwiY2hhckNvZGVBdCIsInB1c2giLCJzbGljZSIsImluZGV4T2YiLCJ0ZXN0Iiwic3BsaXQiLCJsYXN0SW5kZXgiXSwibWFwcGluZ3MiOiI7OztrQkF3QndCQSxRO0FBeEJ4QixJQUFNQyxpQkFBTjtBQUNBLElBQU1DLGlCQUFOO0F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EFDRTpcbiAgICAgICAgY2FzZSBUQUI6XG4gICAgICAgIGNhc2UgQ1I6XG4gICAgICAgIGNhc2UgRkVFRDpcbiAgICAgICAgICAgIG5leHQgPSBwb3M7XG4gICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgbmV4dCArPSAxO1xuICAgICAgICAgICAgICAgIGNvZGUgPSBjc3MuY2hhckNvZGVBdChuZXh0KTtcbiAgICAgICAgICAgICAgICBpZiAoIGNvZGUgPT09IE5FV0xJTkUgKSB7XG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IG5leHQ7XG4gICAgICAgICAgICAgICAgICAgIGxpbmUgICs9IDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSB3aGlsZSAoIGNvZGUgPT09IFNQQUNFICAgfHxcbiAgICAgICAgICAgICAgICAgICAgICBjb2RlID09PSBORVdMSU5FIHx8XG4gICAgICAgICAgICAgICAgICAgICAgY29kZSA9PT0gVEFCICAgICB8fFxuICAgICAgICAgICAgICAgICAgICAgIGNvZGUgPT09IENSICAgICAgfHxcbiAgICAgICAgICAgICAgICAgICAgICBjb2RlID09PSBGRUVEICk7XG5cbiAgICAgICAgICAgIHRva2Vucy5wdXNoKFsnc3BhY2UnLCBjc3Muc2xpY2UocG9zLCBuZXh0KV0pO1xuICAgICAgICAgICAgcG9zID0gbmV4dCAtIDE7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIE9QRU5fU1FVQVJFOlxuICAgICAgICAgICAgdG9rZW5zLnB1c2goWydbJywgJ1snLCBsaW5lLCBwb3MgLSBvZmZzZXRdKTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQ0xPU0VfU1FVQVJFOlxuICAgICAgICAgICAgdG9rZW5zLnB1c2goWyddJywgJ10nLCBsaW5lLCBwb3MgLSBvZmZzZXRdKTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgT1BFTl9DVVJMWTpcbiAgICAgICAgICAgIHRva2Vucy5wdXNoKFsneycsICd7JywgbGluZSwgcG9zIC0gb2Zmc2V0XSk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIENMT1NFX0NVUkxZOlxuICAgICAgICAgICAgdG9rZW5zLnB1c2goWyd9JywgJ30nLCBsaW5lLCBwb3MgLSBvZmZzZXRdKTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQ09MT046XG4gICAgICAgICAgICB0b2tlbnMucHVzaChbJzonLCAnOicsIGxpbmUsIHBvcyAtIG9mZnNldF0pO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBTRU1JQ09MT046XG4gICAgICAgICAgICB0b2tlbnMucHVzaChbJzsnLCAnOycsIGxpbmUsIHBvcyAtIG9mZnNldF0pO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBPUEVOX1BBUkVOVEhFU0VTOlxuICAgICAgICAgICAgcHJldiA9IHRva2Vucy5sZW5ndGggPyB0b2tlbnNbdG9rZW5zLmxlbmd0aCAtIDFdWzFdIDogJyc7XG4gICAgICAgICAgICBuICAgID0gY3NzLmNoYXJDb2RlQXQocG9zICsgMSk7XG4gICAgICAgICAgICBpZiAoIHByZXYgPT09ICd1cmwnICYmIG4gIT09IFNJTkdMRV9RVU9URSAmJiBuICE9PSBET1VCTEVfUVVPVEUgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbiAhPT0gU1BBQ0UgJiYgbiAhPT0gTkVXTElORSAmJiBuICE9PSBUQUIgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbiAhPT0gRkVFRCAmJiBuICE9PSBDUiApIHtcbiAgICAgICAgICAgICAgICBuZXh0ID0gcG9zO1xuICAgICAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICAgICAgZXNjYXBlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBuZXh0ICAgID0gY3NzLmluZGV4T2YoJyknLCBuZXh0ICsgMSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICggbmV4dCA9PT0gLTEgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIGlnbm9yZSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID0gcG9zO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmNsb3NlZCgnYnJhY2tldCcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVzY2FwZVBvcyA9IG5leHQ7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICggY3NzLmNoYXJDb2RlQXQoZXNjYXBlUG9zIC0gMSkgPT09IEJBQ0tTTEFTSCApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVzY2FwZVBvcyAtPSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgZXNjYXBlZCA9ICFlc2NhcGVkO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSB3aGlsZSAoIGVzY2FwZWQgKTtcblxuICAgICAgICAgICAgICAgIHRva2Vucy5wdXNoKFsnYnJhY2tldHMnLCBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSksXG4gICAgICAgICAgICAgICAgICAgIGxpbmUsIHBvcyAgLSBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgIGxpbmUsIG5leHQgLSBvZmZzZXRcbiAgICAgICAgICAgICAgICBdKTtcbiAgICAgICAgICAgICAgICBwb3MgPSBuZXh0O1xuXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG5leHQgICAgPSBjc3MuaW5kZXhPZignKScsIHBvcyArIDEpO1xuICAgICAgICAgICAgICAgIGNvbnRlbnQgPSBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSk7XG5cbiAgICAgICAgICAgICAgICBpZiAoIG5leHQgPT09IC0xIHx8IFJFX0JBRF9CUkFDS0VULnRlc3QoY29udGVudCkgKSB7XG4gICAgICAgICAgICAgICAgICAgIHRva2Vucy5wdXNoKFsnKCcsICcoJywgbGluZSwgcG9zIC0gb2Zmc2V0XSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdG9rZW5zLnB1c2goWydicmFja2V0cycsIGNvbnRlbnQsXG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lLCBwb3MgIC0gb2Zmc2V0LFxuICAgICAgICAgICAgICAgICAgICAgICAgbGluZSwgbmV4dCAtIG9mZnNldFxuICAgICAgICAgICAgICAgICAgICBdKTtcbiAgICAgICAgICAgICAgICAgICAgcG9zID0gbmV4dDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQ0xPU0VfUEFSRU5USEVTRVM6XG4gICAgICAgICAgICB0b2tlbnMucHVzaChbJyknLCAnKScsIGxpbmUsIHBvcyAtIG9mZnNldF0pO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBTSU5HTEVfUVVPVEU6XG4gICAgICAgIGNhc2UgRE9VQkxFX1FVT1RFOlxuICAgICAgICAgICAgcXVvdGUgPSBjb2RlID09PSBTSU5HTEVfUVVPVEUgPyAnXFwnJyA6ICdcIic7XG4gICAgICAgICAgICBuZXh0ICA9IHBvcztcbiAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICBlc2NhcGVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgbmV4dCAgICA9IGNzcy5pbmRleE9mKHF1b3RlLCBuZXh0ICsgMSk7XG4gICAgICAgICAgICAgICAgaWYgKCBuZXh0ID09PSAtMSApIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCBpZ25vcmUgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID0gcG9zICsgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdW5jbG9zZWQoJ3N0cmluZycpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVzY2FwZVBvcyA9IG5leHQ7XG4gICAgICAgICAgICAgICAgd2hpbGUgKCBjc3MuY2hhckNvZGVBdChlc2NhcGVQb3MgLSAxKSA9PT0gQkFDS1NMQVNIICkge1xuICAgICAgICAgICAgICAgICAgICBlc2NhcGVQb3MgLT0gMTtcbiAgICAgICAgICAgICAgICAgICAgZXNjYXBlZCA9ICFlc2NhcGVkO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gd2hpbGUgKCBlc2NhcGVkICk7XG5cbiAgICAgICAgICAgIGNvbnRlbnQgPSBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSk7XG4gICAgICAgICAgICBsaW5lcyAgID0gY29udGVudC5zcGxpdCgnXFxuJyk7XG4gICAgICAgICAgICBsYXN0ICAgID0gbGluZXMubGVuZ3RoIC0gMTtcblxuICAgICAgICAgICAgaWYgKCBsYXN0ID4gMCApIHtcbiAgICAgICAgICAgICAgICBuZXh0TGluZSAgID0gbGluZSArIGxhc3Q7XG4gICAgICAgICAgICAgICAgbmV4dE9mZnNldCA9IG5leHQgLSBsaW5lc1tsYXN0XS5sZW5ndGg7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG5leHRMaW5lICAgPSBsaW5lO1xuICAgICAgICAgICAgICAgIG5leHRPZmZzZXQgPSBvZmZzZXQ7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRva2Vucy5wdXNoKFsnc3RyaW5nJywgY3NzLnNsaWNlKHBvcywgbmV4dCArIDEpLFxuICAgICAgICAgICAgICAgIGxpbmUsIHBvcyAgLSBvZmZzZXQsXG4gICAgICAgICAgICAgICAgbmV4dExpbmUsIG5leHQgLSBuZXh0T2Zmc2V0XG4gICAgICAgICAgICBdKTtcblxuICAgICAgICAgICAgb2Zmc2V0ID0gbmV4dE9mZnNldDtcbiAgICAgICAgICAgIGxpbmUgICA9IG5leHRMaW5lO1xuICAgICAgICAgICAgcG9zICAgID0gbmV4dDtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQVQ6XG4gICAgICAgICAgICBSRV9BVF9FTkQubGFzdEluZGV4ID0gcG9zICsgMTtcbiAgICAgICAgICAgIFJFX0FUX0VORC50ZXN0KGNzcyk7XG4gICAgICAgICAgICBpZiAoIFJFX0FUX0VORC5sYXN0SW5kZXggPT09IDAgKSB7XG4gICAgICAgICAgICAgICAgbmV4dCA9IGNzcy5sZW5ndGggLSAxO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBuZXh0ID0gUkVfQVRfRU5ELmxhc3RJbmRleCAtIDI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0b2tlbnMucHVzaChbJ2F0LXdvcmQnLCBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSksXG4gICAgICAgICAgICAgICAgbGluZSwgcG9zICAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICBsaW5lLCBuZXh0IC0gb2Zmc2V0XG4gICAgICAgICAgICBdKTtcbiAgICAgICAgICAgIHBvcyA9IG5leHQ7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIEJBQ0tTTEFTSDpcbiAgICAgICAgICAgIG5leHQgICA9IHBvcztcbiAgICAgICAgICAgIGVzY2FwZSA9IHRydWU7XG4gICAgICAgICAgICB3aGlsZSAoIGNzcy5jaGFyQ29kZUF0KG5leHQgKyAxKSA9PT0gQkFDS1NMQVNIICkge1xuICAgICAgICAgICAgICAgIG5leHQgICs9IDE7XG4gICAgICAgICAgICAgICAgZXNjYXBlID0gIWVzY2FwZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNvZGUgPSBjc3MuY2hhckNvZGVBdChuZXh0ICsgMSk7XG4gICAgICAgICAgICBpZiAoIGVzY2FwZSAmJiAoY29kZSAhPT0gU0xBU0ggICAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUgIT09IFNQQUNFICAgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlICE9PSBORVdMSU5FICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZSAhPT0gVEFCICAgICAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUgIT09IENSICAgICAgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlICE9PSBGRUVEICkgKSB7XG4gICAgICAgICAgICAgICAgbmV4dCArPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdG9rZW5zLnB1c2goWyd3b3JkJywgY3NzLnNsaWNlKHBvcywgbmV4dCArIDEpLFxuICAgICAgICAgICAgICAgIGxpbmUsIHBvcyAgLSBvZmZzZXQsXG4gICAgICAgICAgICAgICAgbGluZSwgbmV4dCAtIG9mZnNldFxuICAgICAgICAgICAgXSk7XG4gICAgICAgICAgICBwb3MgPSBuZXh0O1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIGlmICggY29kZSA9PT0gU0xBU0ggJiYgY3NzLmNoYXJDb2RlQXQocG9zICsgMSkgPT09IEFTVEVSSVNLICkge1xuICAgICAgICAgICAgICAgIG5leHQgPSBjc3MuaW5kZXhPZignKi8nLCBwb3MgKyAyKSArIDE7XG4gICAgICAgICAgICAgICAgaWYgKCBuZXh0ID09PSAwICkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIGlnbm9yZSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQgPSBjc3MubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdW5jbG9zZWQoJ2NvbW1lbnQnKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGNvbnRlbnQgPSBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSk7XG4gICAgICAgICAgICAgICAgbGluZXMgICA9IGNvbnRlbnQuc3BsaXQoJ1xcbicpO1xuICAgICAgICAgICAgICAgIGxhc3QgICAgPSBsaW5lcy5sZW5ndGggLSAxO1xuXG4gICAgICAgICAgICAgICAgaWYgKCBsYXN0ID4gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgbmV4dExpbmUgICA9IGxpbmUgKyBsYXN0O1xuICAgICAgICAgICAgICAgICAgICBuZXh0T2Zmc2V0ID0gbmV4dCAtIGxpbmVzW2xhc3RdLmxlbmd0aDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBuZXh0TGluZSAgID0gbGluZTtcbiAgICAgICAgICAgICAgICAgICAgbmV4dE9mZnNldCA9IG9mZnNldDtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0b2tlbnMucHVzaChbJ2NvbW1lbnQnLCBjb250ZW50LFxuICAgICAgICAgICAgICAgICAgICBsaW5lLCAgICAgcG9zICAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbmV4dExpbmUsIG5leHQgLSBuZXh0T2Zmc2V0XG4gICAgICAgICAgICAgICAgXSk7XG5cbiAgICAgICAgICAgICAgICBvZmZzZXQgPSBuZXh0T2Zmc2V0O1xuICAgICAgICAgICAgICAgIGxpbmUgICA9IG5leHRMaW5lO1xuICAgICAgICAgICAgICAgIHBvcyAgICA9IG5leHQ7XG5cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgUkVfV09SRF9FTkQubGFzdEluZGV4ID0gcG9zICsgMTtcbiAgICAgICAgICAgICAgICBSRV9XT1JEX0VORC50ZXN0KGNzcyk7XG4gICAgICAgICAgICAgICAgaWYgKCBSRV9XT1JEX0VORC5sYXN0SW5kZXggPT09IDAgKSB7XG4gICAgICAgICAgICAgICAgICAgIG5leHQgPSBjc3MubGVuZ3RoIC0gMTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBuZXh0ID0gUkVfV09SRF9FTkQubGFzdEluZGV4IC0gMjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0b2tlbnMucHVzaChbJ3dvcmQnLCBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSksXG4gICAgICAgICAgICAgICAgICAgIGxpbmUsIHBvcyAgLSBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgIGxpbmUsIG5leHQgLSBvZmZzZXRcbiAgICAgICAgICAgICAgICBdKTtcbiAgICAgICAgICAgICAgICBwb3MgPSBuZXh0O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIHBvcysrO1xuICAgIH1cblxuICAgIHJldHVybiB0b2tlbnM7XG59XG4iXX0=
  12802. /***/ }),
  12803. /* 82 */
  12804. /***/ (function(module, exports, __webpack_require__) {
  12805. "use strict";
  12806. /* WEBPACK VAR INJECTION */(function(process) {
  12807. var escapeStringRegexp = __webpack_require__(99);
  12808. var ansiStyles = __webpack_require__(161);
  12809. var stripAnsi = __webpack_require__(163);
  12810. var hasAnsi = __webpack_require__(100);
  12811. var supportsColor = __webpack_require__(162);
  12812. var defineProps = Object.defineProperties;
  12813. var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM);
  12814. function Chalk(options) {
  12815. // detect mode if not set manually
  12816. this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled;
  12817. }
  12818. // use bright blue on Windows as the normal blue color is illegible
  12819. if (isSimpleWindowsTerm) {
  12820. ansiStyles.blue.open = '\u001b[94m';
  12821. }
  12822. var styles = (function () {
  12823. var ret = {};
  12824. Object.keys(ansiStyles).forEach(function (key) {
  12825. ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
  12826. ret[key] = {
  12827. get: function () {
  12828. return build.call(this, this._styles.concat(key));
  12829. }
  12830. };
  12831. });
  12832. return ret;
  12833. })();
  12834. var proto = defineProps(function chalk() {}, styles);
  12835. function build(_styles) {
  12836. var builder = function () {
  12837. return applyStyle.apply(builder, arguments);
  12838. };
  12839. builder._styles = _styles;
  12840. builder.enabled = this.enabled;
  12841. // __proto__ is used because we must return a function, but there is
  12842. // no way to create a function with a different prototype.
  12843. /* eslint-disable no-proto */
  12844. builder.__proto__ = proto;
  12845. return builder;
  12846. }
  12847. function applyStyle() {
  12848. // support varags, but simply cast to string in case there's only one arg
  12849. var args = arguments;
  12850. var argsLen = args.length;
  12851. var str = argsLen !== 0 && String(arguments[0]);
  12852. if (argsLen > 1) {
  12853. // don't slice `arguments`, it prevents v8 optimizations
  12854. for (var a = 1; a < argsLen; a++) {
  12855. str += ' ' + args[a];
  12856. }
  12857. }
  12858. if (!this.enabled || !str) {
  12859. return str;
  12860. }
  12861. var nestedStyles = this._styles;
  12862. var i = nestedStyles.length;
  12863. // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
  12864. // see https://github.com/chalk/chalk/issues/58
  12865. // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
  12866. var originalDim = ansiStyles.dim.open;
  12867. if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) {
  12868. ansiStyles.dim.open = '';
  12869. }
  12870. while (i--) {
  12871. var code = ansiStyles[nestedStyles[i]];
  12872. // Replace any instances already present with a re-opening code
  12873. // otherwise only the part of the string until said closing code
  12874. // will be colored, and the rest will simply be 'plain'.
  12875. str = code.open + str.replace(code.closeRe, code.open) + code.close;
  12876. }
  12877. // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue.
  12878. ansiStyles.dim.open = originalDim;
  12879. return str;
  12880. }
  12881. function init() {
  12882. var ret = {};
  12883. Object.keys(styles).forEach(function (name) {
  12884. ret[name] = {
  12885. get: function () {
  12886. return build.call(this, [name]);
  12887. }
  12888. };
  12889. });
  12890. return ret;
  12891. }
  12892. defineProps(Chalk.prototype, init());
  12893. module.exports = new Chalk();
  12894. module.exports.styles = ansiStyles;
  12895. module.exports.hasColor = hasAnsi;
  12896. module.exports.stripColor = stripAnsi;
  12897. module.exports.supportsColor = supportsColor;
  12898. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(14)))
  12899. /***/ }),
  12900. /* 83 */
  12901. /***/ (function(module, exports, __webpack_require__) {
  12902. /* -*- Mode: js; js-indent-level: 2; -*- */
  12903. /*
  12904. * Copyright 2011 Mozilla Foundation and contributors
  12905. * Licensed under the New BSD license. See LICENSE or:
  12906. * http://opensource.org/licenses/BSD-3-Clause
  12907. */
  12908. var util = __webpack_require__(11);
  12909. var has = Object.prototype.hasOwnProperty;
  12910. /**
  12911. * A data structure which is a combination of an array and a set. Adding a new
  12912. * member is O(1), testing for membership is O(1), and finding the index of an
  12913. * element is O(1). Removing elements from the set is not supported. Only
  12914. * strings are supported for membership.
  12915. */
  12916. function ArraySet() {
  12917. this._array = [];
  12918. this._set = Object.create(null);
  12919. }
  12920. /**
  12921. * Static method for creating ArraySet instances from an existing array.
  12922. */
  12923. ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
  12924. var set = new ArraySet();
  12925. for (var i = 0, len = aArray.length; i < len; i++) {
  12926. set.add(aArray[i], aAllowDuplicates);
  12927. }
  12928. return set;
  12929. };
  12930. /**
  12931. * Return how many unique items are in this ArraySet. If duplicates have been
  12932. * added, than those do not count towards the size.
  12933. *
  12934. * @returns Number
  12935. */
  12936. ArraySet.prototype.size = function ArraySet_size() {
  12937. return Object.getOwnPropertyNames(this._set).length;
  12938. };
  12939. /**
  12940. * Add the given string to this set.
  12941. *
  12942. * @param String aStr
  12943. */
  12944. ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
  12945. var sStr = util.toSetString(aStr);
  12946. var isDuplicate = has.call(this._set, sStr);
  12947. var idx = this._array.length;
  12948. if (!isDuplicate || aAllowDuplicates) {
  12949. this._array.push(aStr);
  12950. }
  12951. if (!isDuplicate) {
  12952. this._set[sStr] = idx;
  12953. }
  12954. };
  12955. /**
  12956. * Is the given string a member of this set?
  12957. *
  12958. * @param String aStr
  12959. */
  12960. ArraySet.prototype.has = function ArraySet_has(aStr) {
  12961. var sStr = util.toSetString(aStr);
  12962. return has.call(this._set, sStr);
  12963. };
  12964. /**
  12965. * What is the index of the given string in the array?
  12966. *
  12967. * @param String aStr
  12968. */
  12969. ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
  12970. var sStr = util.toSetString(aStr);
  12971. if (has.call(this._set, sStr)) {
  12972. return this._set[sStr];
  12973. }
  12974. throw new Error('"' + aStr + '" is not in the set.');
  12975. };
  12976. /**
  12977. * What is the element at the given index?
  12978. *
  12979. * @param Number aIdx
  12980. */
  12981. ArraySet.prototype.at = function ArraySet_at(aIdx) {
  12982. if (aIdx >= 0 && aIdx < this._array.length) {
  12983. return this._array[aIdx];
  12984. }
  12985. throw new Error('No element indexed by ' + aIdx);
  12986. };
  12987. /**
  12988. * Returns the array representation of this set (which has the proper indices
  12989. * indicated by indexOf). Note that this is a copy of the internal array used
  12990. * for storing the members so that no one can mess with internal state.
  12991. */
  12992. ArraySet.prototype.toArray = function ArraySet_toArray() {
  12993. return this._array.slice();
  12994. };
  12995. exports.ArraySet = ArraySet;
  12996. /***/ }),
  12997. /* 84 */
  12998. /***/ (function(module, exports, __webpack_require__) {
  12999. /* -*- Mode: js; js-indent-level: 2; -*- */
  13000. /*
  13001. * Copyright 2011 Mozilla Foundation and contributors
  13002. * Licensed under the New BSD license. See LICENSE or:
  13003. * http://opensource.org/licenses/BSD-3-Clause
  13004. *
  13005. * Based on the Base 64 VLQ implementation in Closure Compiler:
  13006. * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
  13007. *
  13008. * Copyright 2011 The Closure Compiler Authors. All rights reserved.
  13009. * Redistribution and use in source and binary forms, with or without
  13010. * modification, are permitted provided that the following conditions are
  13011. * met:
  13012. *
  13013. * * Redistributions of source code must retain the above copyright
  13014. * notice, this list of conditions and the following disclaimer.
  13015. * * Redistributions in binary form must reproduce the above
  13016. * copyright notice, this list of conditions and the following
  13017. * disclaimer in the documentation and/or other materials provided
  13018. * with the distribution.
  13019. * * Neither the name of Google Inc. nor the names of its
  13020. * contributors may be used to endorse or promote products derived
  13021. * from this software without specific prior written permission.
  13022. *
  13023. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  13024. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  13025. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  13026. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  13027. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  13028. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  13029. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  13030. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  13031. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  13032. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  13033. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  13034. */
  13035. var base64 = __webpack_require__(164);
  13036. // A single base 64 digit can contain 6 bits of data. For the base 64 variable
  13037. // length quantities we use in the source map spec, the first bit is the sign,
  13038. // the next four bits are the actual value, and the 6th bit is the
  13039. // continuation bit. The continuation bit tells us whether there are more
  13040. // digits in this value following this digit.
  13041. //
  13042. // Continuation
  13043. // | Sign
  13044. // | |
  13045. // V V
  13046. // 101011
  13047. var VLQ_BASE_SHIFT = 5;
  13048. // binary: 100000
  13049. var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
  13050. // binary: 011111
  13051. var VLQ_BASE_MASK = VLQ_BASE - 1;
  13052. // binary: 100000
  13053. var VLQ_CONTINUATION_BIT = VLQ_BASE;
  13054. /**
  13055. * Converts from a two-complement value to a value where the sign bit is
  13056. * placed in the least significant bit. For example, as decimals:
  13057. * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
  13058. * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
  13059. */
  13060. function toVLQSigned(aValue) {
  13061. return aValue < 0
  13062. ? ((-aValue) << 1) + 1
  13063. : (aValue << 1) + 0;
  13064. }
  13065. /**
  13066. * Converts to a two-complement value from a value where the sign bit is
  13067. * placed in the least significant bit. For example, as decimals:
  13068. * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
  13069. * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
  13070. */
  13071. function fromVLQSigned(aValue) {
  13072. var isNegative = (aValue & 1) === 1;
  13073. var shifted = aValue >> 1;
  13074. return isNegative
  13075. ? -shifted
  13076. : shifted;
  13077. }
  13078. /**
  13079. * Returns the base 64 VLQ encoded value.
  13080. */
  13081. exports.encode = function base64VLQ_encode(aValue) {
  13082. var encoded = "";
  13083. var digit;
  13084. var vlq = toVLQSigned(aValue);
  13085. do {
  13086. digit = vlq & VLQ_BASE_MASK;
  13087. vlq >>>= VLQ_BASE_SHIFT;
  13088. if (vlq > 0) {
  13089. // There are still more digits in this value, so we must make sure the
  13090. // continuation bit is marked.
  13091. digit |= VLQ_CONTINUATION_BIT;
  13092. }
  13093. encoded += base64.encode(digit);
  13094. } while (vlq > 0);
  13095. return encoded;
  13096. };
  13097. /**
  13098. * Decodes the next base 64 VLQ value from the given string and returns the
  13099. * value and the rest of the string via the out parameter.
  13100. */
  13101. exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
  13102. var strLen = aStr.length;
  13103. var result = 0;
  13104. var shift = 0;
  13105. var continuation, digit;
  13106. do {
  13107. if (aIndex >= strLen) {
  13108. throw new Error("Expected more digits in base 64 VLQ value.");
  13109. }
  13110. digit = base64.decode(aStr.charCodeAt(aIndex++));
  13111. if (digit === -1) {
  13112. throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
  13113. }
  13114. continuation = !!(digit & VLQ_CONTINUATION_BIT);
  13115. digit &= VLQ_BASE_MASK;
  13116. result = result + (digit << shift);
  13117. shift += VLQ_BASE_SHIFT;
  13118. } while (continuation);
  13119. aOutParam.value = fromVLQSigned(result);
  13120. aOutParam.rest = aIndex;
  13121. };
  13122. /***/ }),
  13123. /* 85 */
  13124. /***/ (function(module, exports, __webpack_require__) {
  13125. /* -*- Mode: js; js-indent-level: 2; -*- */
  13126. /*
  13127. * Copyright 2011 Mozilla Foundation and contributors
  13128. * Licensed under the New BSD license. See LICENSE or:
  13129. * http://opensource.org/licenses/BSD-3-Clause
  13130. */
  13131. var base64VLQ = __webpack_require__(84);
  13132. var util = __webpack_require__(11);
  13133. var ArraySet = __webpack_require__(83).ArraySet;
  13134. var MappingList = __webpack_require__(166).MappingList;
  13135. /**
  13136. * An instance of the SourceMapGenerator represents a source map which is
  13137. * being built incrementally. You may pass an object with the following
  13138. * properties:
  13139. *
  13140. * - file: The filename of the generated source.
  13141. * - sourceRoot: A root for all relative URLs in this source map.
  13142. */
  13143. function SourceMapGenerator(aArgs) {
  13144. if (!aArgs) {
  13145. aArgs = {};
  13146. }
  13147. this._file = util.getArg(aArgs, 'file', null);
  13148. this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
  13149. this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
  13150. this._sources = new ArraySet();
  13151. this._names = new ArraySet();
  13152. this._mappings = new MappingList();
  13153. this._sourcesContents = null;
  13154. }
  13155. SourceMapGenerator.prototype._version = 3;
  13156. /**
  13157. * Creates a new SourceMapGenerator based on a SourceMapConsumer
  13158. *
  13159. * @param aSourceMapConsumer The SourceMap.
  13160. */
  13161. SourceMapGenerator.fromSourceMap =
  13162. function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
  13163. var sourceRoot = aSourceMapConsumer.sourceRoot;
  13164. var generator = new SourceMapGenerator({
  13165. file: aSourceMapConsumer.file,
  13166. sourceRoot: sourceRoot
  13167. });
  13168. aSourceMapConsumer.eachMapping(function (mapping) {
  13169. var newMapping = {
  13170. generated: {
  13171. line: mapping.generatedLine,
  13172. column: mapping.generatedColumn
  13173. }
  13174. };
  13175. if (mapping.source != null) {
  13176. newMapping.source = mapping.source;
  13177. if (sourceRoot != null) {
  13178. newMapping.source = util.relative(sourceRoot, newMapping.source);
  13179. }
  13180. newMapping.original = {
  13181. line: mapping.originalLine,
  13182. column: mapping.originalColumn
  13183. };
  13184. if (mapping.name != null) {
  13185. newMapping.name = mapping.name;
  13186. }
  13187. }
  13188. generator.addMapping(newMapping);
  13189. });
  13190. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  13191. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  13192. if (content != null) {
  13193. generator.setSourceContent(sourceFile, content);
  13194. }
  13195. });
  13196. return generator;
  13197. };
  13198. /**
  13199. * Add a single mapping from original source line and column to the generated
  13200. * source's line and column for this source map being created. The mapping
  13201. * object should have the following properties:
  13202. *
  13203. * - generated: An object with the generated line and column positions.
  13204. * - original: An object with the original line and column positions.
  13205. * - source: The original source file (relative to the sourceRoot).
  13206. * - name: An optional original token name for this mapping.
  13207. */
  13208. SourceMapGenerator.prototype.addMapping =
  13209. function SourceMapGenerator_addMapping(aArgs) {
  13210. var generated = util.getArg(aArgs, 'generated');
  13211. var original = util.getArg(aArgs, 'original', null);
  13212. var source = util.getArg(aArgs, 'source', null);
  13213. var name = util.getArg(aArgs, 'name', null);
  13214. if (!this._skipValidation) {
  13215. this._validateMapping(generated, original, source, name);
  13216. }
  13217. if (source != null) {
  13218. source = String(source);
  13219. if (!this._sources.has(source)) {
  13220. this._sources.add(source);
  13221. }
  13222. }
  13223. if (name != null) {
  13224. name = String(name);
  13225. if (!this._names.has(name)) {
  13226. this._names.add(name);
  13227. }
  13228. }
  13229. this._mappings.add({
  13230. generatedLine: generated.line,
  13231. generatedColumn: generated.column,
  13232. originalLine: original != null && original.line,
  13233. originalColumn: original != null && original.column,
  13234. source: source,
  13235. name: name
  13236. });
  13237. };
  13238. /**
  13239. * Set the source content for a source file.
  13240. */
  13241. SourceMapGenerator.prototype.setSourceContent =
  13242. function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
  13243. var source = aSourceFile;
  13244. if (this._sourceRoot != null) {
  13245. source = util.relative(this._sourceRoot, source);
  13246. }
  13247. if (aSourceContent != null) {
  13248. // Add the source content to the _sourcesContents map.
  13249. // Create a new _sourcesContents map if the property is null.
  13250. if (!this._sourcesContents) {
  13251. this._sourcesContents = Object.create(null);
  13252. }
  13253. this._sourcesContents[util.toSetString(source)] = aSourceContent;
  13254. } else if (this._sourcesContents) {
  13255. // Remove the source file from the _sourcesContents map.
  13256. // If the _sourcesContents map is empty, set the property to null.
  13257. delete this._sourcesContents[util.toSetString(source)];
  13258. if (Object.keys(this._sourcesContents).length === 0) {
  13259. this._sourcesContents = null;
  13260. }
  13261. }
  13262. };
  13263. /**
  13264. * Applies the mappings of a sub-source-map for a specific source file to the
  13265. * source map being generated. Each mapping to the supplied source file is
  13266. * rewritten using the supplied source map. Note: The resolution for the
  13267. * resulting mappings is the minimium of this map and the supplied map.
  13268. *
  13269. * @param aSourceMapConsumer The source map to be applied.
  13270. * @param aSourceFile Optional. The filename of the source file.
  13271. * If omitted, SourceMapConsumer's file property will be used.
  13272. * @param aSourceMapPath Optional. The dirname of the path to the source map
  13273. * to be applied. If relative, it is relative to the SourceMapConsumer.
  13274. * This parameter is needed when the two source maps aren't in the same
  13275. * directory, and the source map to be applied contains relative source
  13276. * paths. If so, those relative source paths need to be rewritten
  13277. * relative to the SourceMapGenerator.
  13278. */
  13279. SourceMapGenerator.prototype.applySourceMap =
  13280. function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
  13281. var sourceFile = aSourceFile;
  13282. // If aSourceFile is omitted, we will use the file property of the SourceMap
  13283. if (aSourceFile == null) {
  13284. if (aSourceMapConsumer.file == null) {
  13285. throw new Error(
  13286. 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
  13287. 'or the source map\'s "file" property. Both were omitted.'
  13288. );
  13289. }
  13290. sourceFile = aSourceMapConsumer.file;
  13291. }
  13292. var sourceRoot = this._sourceRoot;
  13293. // Make "sourceFile" relative if an absolute Url is passed.
  13294. if (sourceRoot != null) {
  13295. sourceFile = util.relative(sourceRoot, sourceFile);
  13296. }
  13297. // Applying the SourceMap can add and remove items from the sources and
  13298. // the names array.
  13299. var newSources = new ArraySet();
  13300. var newNames = new ArraySet();
  13301. // Find mappings for the "sourceFile"
  13302. this._mappings.unsortedForEach(function (mapping) {
  13303. if (mapping.source === sourceFile && mapping.originalLine != null) {
  13304. // Check if it can be mapped by the source map, then update the mapping.
  13305. var original = aSourceMapConsumer.originalPositionFor({
  13306. line: mapping.originalLine,
  13307. column: mapping.originalColumn
  13308. });
  13309. if (original.source != null) {
  13310. // Copy mapping
  13311. mapping.source = original.source;
  13312. if (aSourceMapPath != null) {
  13313. mapping.source = util.join(aSourceMapPath, mapping.source)
  13314. }
  13315. if (sourceRoot != null) {
  13316. mapping.source = util.relative(sourceRoot, mapping.source);
  13317. }
  13318. mapping.originalLine = original.line;
  13319. mapping.originalColumn = original.column;
  13320. if (original.name != null) {
  13321. mapping.name = original.name;
  13322. }
  13323. }
  13324. }
  13325. var source = mapping.source;
  13326. if (source != null && !newSources.has(source)) {
  13327. newSources.add(source);
  13328. }
  13329. var name = mapping.name;
  13330. if (name != null && !newNames.has(name)) {
  13331. newNames.add(name);
  13332. }
  13333. }, this);
  13334. this._sources = newSources;
  13335. this._names = newNames;
  13336. // Copy sourcesContents of applied map.
  13337. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  13338. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  13339. if (content != null) {
  13340. if (aSourceMapPath != null) {
  13341. sourceFile = util.join(aSourceMapPath, sourceFile);
  13342. }
  13343. if (sourceRoot != null) {
  13344. sourceFile = util.relative(sourceRoot, sourceFile);
  13345. }
  13346. this.setSourceContent(sourceFile, content);
  13347. }
  13348. }, this);
  13349. };
  13350. /**
  13351. * A mapping can have one of the three levels of data:
  13352. *
  13353. * 1. Just the generated position.
  13354. * 2. The Generated position, original position, and original source.
  13355. * 3. Generated and original position, original source, as well as a name
  13356. * token.
  13357. *
  13358. * To maintain consistency, we validate that any new mapping being added falls
  13359. * in to one of these categories.
  13360. */
  13361. SourceMapGenerator.prototype._validateMapping =
  13362. function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
  13363. aName) {
  13364. if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
  13365. && aGenerated.line > 0 && aGenerated.column >= 0
  13366. && !aOriginal && !aSource && !aName) {
  13367. // Case 1.
  13368. return;
  13369. }
  13370. else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
  13371. && aOriginal && 'line' in aOriginal && 'column' in aOriginal
  13372. && aGenerated.line > 0 && aGenerated.column >= 0
  13373. && aOriginal.line > 0 && aOriginal.column >= 0
  13374. && aSource) {
  13375. // Cases 2 and 3.
  13376. return;
  13377. }
  13378. else {
  13379. throw new Error('Invalid mapping: ' + JSON.stringify({
  13380. generated: aGenerated,
  13381. source: aSource,
  13382. original: aOriginal,
  13383. name: aName
  13384. }));
  13385. }
  13386. };
  13387. /**
  13388. * Serialize the accumulated mappings in to the stream of base 64 VLQs
  13389. * specified by the source map format.
  13390. */
  13391. SourceMapGenerator.prototype._serializeMappings =
  13392. function SourceMapGenerator_serializeMappings() {
  13393. var previousGeneratedColumn = 0;
  13394. var previousGeneratedLine = 1;
  13395. var previousOriginalColumn = 0;
  13396. var previousOriginalLine = 0;
  13397. var previousName = 0;
  13398. var previousSource = 0;
  13399. var result = '';
  13400. var next;
  13401. var mapping;
  13402. var nameIdx;
  13403. var sourceIdx;
  13404. var mappings = this._mappings.toArray();
  13405. for (var i = 0, len = mappings.length; i < len; i++) {
  13406. mapping = mappings[i];
  13407. next = ''
  13408. if (mapping.generatedLine !== previousGeneratedLine) {
  13409. previousGeneratedColumn = 0;
  13410. while (mapping.generatedLine !== previousGeneratedLine) {
  13411. next += ';';
  13412. previousGeneratedLine++;
  13413. }
  13414. }
  13415. else {
  13416. if (i > 0) {
  13417. if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
  13418. continue;
  13419. }
  13420. next += ',';
  13421. }
  13422. }
  13423. next += base64VLQ.encode(mapping.generatedColumn
  13424. - previousGeneratedColumn);
  13425. previousGeneratedColumn = mapping.generatedColumn;
  13426. if (mapping.source != null) {
  13427. sourceIdx = this._sources.indexOf(mapping.source);
  13428. next += base64VLQ.encode(sourceIdx - previousSource);
  13429. previousSource = sourceIdx;
  13430. // lines are stored 0-based in SourceMap spec version 3
  13431. next += base64VLQ.encode(mapping.originalLine - 1
  13432. - previousOriginalLine);
  13433. previousOriginalLine = mapping.originalLine - 1;
  13434. next += base64VLQ.encode(mapping.originalColumn
  13435. - previousOriginalColumn);
  13436. previousOriginalColumn = mapping.originalColumn;
  13437. if (mapping.name != null) {
  13438. nameIdx = this._names.indexOf(mapping.name);
  13439. next += base64VLQ.encode(nameIdx - previousName);
  13440. previousName = nameIdx;
  13441. }
  13442. }
  13443. result += next;
  13444. }
  13445. return result;
  13446. };
  13447. SourceMapGenerator.prototype._generateSourcesContent =
  13448. function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
  13449. return aSources.map(function (source) {
  13450. if (!this._sourcesContents) {
  13451. return null;
  13452. }
  13453. if (aSourceRoot != null) {
  13454. source = util.relative(aSourceRoot, source);
  13455. }
  13456. var key = util.toSetString(source);
  13457. return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
  13458. ? this._sourcesContents[key]
  13459. : null;
  13460. }, this);
  13461. };
  13462. /**
  13463. * Externalize the source map.
  13464. */
  13465. SourceMapGenerator.prototype.toJSON =
  13466. function SourceMapGenerator_toJSON() {
  13467. var map = {
  13468. version: this._version,
  13469. sources: this._sources.toArray(),
  13470. names: this._names.toArray(),
  13471. mappings: this._serializeMappings()
  13472. };
  13473. if (this._file != null) {
  13474. map.file = this._file;
  13475. }
  13476. if (this._sourceRoot != null) {
  13477. map.sourceRoot = this._sourceRoot;
  13478. }
  13479. if (this._sourcesContents) {
  13480. map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
  13481. }
  13482. return map;
  13483. };
  13484. /**
  13485. * Render the source map being generated to a string.
  13486. */
  13487. SourceMapGenerator.prototype.toString =
  13488. function SourceMapGenerator_toString() {
  13489. return JSON.stringify(this.toJSON());
  13490. };
  13491. exports.SourceMapGenerator = SourceMapGenerator;
  13492. /***/ }),
  13493. /* 86 */
  13494. /***/ (function(module, exports, __webpack_require__) {
  13495. /*
  13496. * Copyright 2009-2011 Mozilla Foundation and contributors
  13497. * Licensed under the New BSD license. See LICENSE.txt or:
  13498. * http://opensource.org/licenses/BSD-3-Clause
  13499. */
  13500. exports.SourceMapGenerator = __webpack_require__(85).SourceMapGenerator;
  13501. exports.SourceMapConsumer = __webpack_require__(168).SourceMapConsumer;
  13502. exports.SourceNode = __webpack_require__(169).SourceNode;
  13503. /***/ }),
  13504. /* 87 */
  13505. /***/ (function(module, exports, __webpack_require__) {
  13506. "use strict";
  13507. function unique_pred(list, compare) {
  13508. var ptr = 1
  13509. , len = list.length
  13510. , a=list[0], b=list[0]
  13511. for(var i=1; i<len; ++i) {
  13512. b = a
  13513. a = list[i]
  13514. if(compare(a, b)) {
  13515. if(i === ptr) {
  13516. ptr++
  13517. continue
  13518. }
  13519. list[ptr++] = a
  13520. }
  13521. }
  13522. list.length = ptr
  13523. return list
  13524. }
  13525. function unique_eq(list) {
  13526. var ptr = 1
  13527. , len = list.length
  13528. , a=list[0], b = list[0]
  13529. for(var i=1; i<len; ++i, b=a) {
  13530. b = a
  13531. a = list[i]
  13532. if(a !== b) {
  13533. if(i === ptr) {
  13534. ptr++
  13535. continue
  13536. }
  13537. list[ptr++] = a
  13538. }
  13539. }
  13540. list.length = ptr
  13541. return list
  13542. }
  13543. function unique(list, compare, sorted) {
  13544. if(list.length === 0) {
  13545. return list
  13546. }
  13547. if(compare) {
  13548. if(!sorted) {
  13549. list.sort(compare)
  13550. }
  13551. return unique_pred(list, compare)
  13552. }
  13553. if(!sorted) {
  13554. list.sort()
  13555. }
  13556. return unique_eq(list)
  13557. }
  13558. module.exports = unique
  13559. /***/ }),
  13560. /* 88 */
  13561. /***/ (function(module, exports) {
  13562. /* (ignored) */
  13563. /***/ }),
  13564. /* 89 */
  13565. /***/ (function(module, exports, __webpack_require__) {
  13566. "use strict";
  13567. Object.defineProperty(exports, "__esModule", {
  13568. value: true
  13569. });
  13570. var _lessParse = __webpack_require__(107);
  13571. var _lessParse2 = _interopRequireDefault(_lessParse);
  13572. var _lessStringify = __webpack_require__(12);
  13573. var _lessStringify2 = _interopRequireDefault(_lessStringify);
  13574. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13575. exports.default = { parse: _lessParse2.default, stringify: _lessStringify2.default };
  13576. module.exports = exports['default'];
  13577. /***/ }),
  13578. /* 90 */
  13579. /***/ (function(module, exports, __webpack_require__) {
  13580. "use strict";
  13581. Object.defineProperty(exports, "__esModule", {
  13582. value: true
  13583. });
  13584. exports.default = parseMedia;
  13585. var _Container = __webpack_require__(36);
  13586. var _Container2 = _interopRequireDefault(_Container);
  13587. var _parsers = __webpack_require__(125);
  13588. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13589. /**
  13590. * Parses a media query list into an array of nodes. A typical node signature:
  13591. * {string} node.type -- one of: 'media-query', 'media-type', 'keyword',
  13592. * 'media-feature-expression', 'media-feature', 'colon', 'value'
  13593. * {string} node.value -- the contents of a particular element, trimmed
  13594. * e.g.: `screen`, `max-width`, `1024px`
  13595. * {string} node.after -- whitespaces that follow the element
  13596. * {string} node.before -- whitespaces that precede the element
  13597. * {string} node.sourceIndex -- the index of the element in a source media
  13598. * query list, 0-based
  13599. * {object} node.parent -- a link to the parent node (a container)
  13600. *
  13601. * Some nodes (media queries, media feature expressions) contain other nodes.
  13602. * They additionally have:
  13603. * {array} node.nodes -- an array of nodes of the type described here
  13604. * {funciton} node.each -- traverses direct children of the node, calling
  13605. * a callback for each one
  13606. * {funciton} node.walk -- traverses ALL descendants of the node, calling
  13607. * a callback for each one
  13608. */
  13609. function parseMedia(value) {
  13610. return new _Container2.default({
  13611. nodes: (0, _parsers.parseMediaList)(value),
  13612. type: 'media-query-list',
  13613. value: value.trim()
  13614. });
  13615. }
  13616. /***/ }),
  13617. /* 91 */
  13618. /***/ (function(module, exports, __webpack_require__) {
  13619. "use strict";
  13620. exports.__esModule = true;
  13621. var _scssStringify = __webpack_require__(130);
  13622. var _scssStringify2 = _interopRequireDefault(_scssStringify);
  13623. var _scssParse = __webpack_require__(127);
  13624. var _scssParse2 = _interopRequireDefault(_scssParse);
  13625. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13626. exports.default = { parse: _scssParse2.default, stringify: _scssStringify2.default };
  13627. module.exports = exports['default'];
  13628. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjc3Mtc3ludGF4LmVzNiJdLCJuYW1lcyI6WyJwYXJzZSIsInN0cmluZ2lmeSJdLCJtYXBwaW5ncyI6Ijs7OztBQUFBOzs7O0FBQ0E7Ozs7OztrQkFFZSxFQUFFQSwwQkFBRixFQUFTQyxrQ0FBVCxFIiwiZmlsZSI6InNjc3Mtc3ludGF4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0cmluZ2lmeSBmcm9tICcuL3Njc3Mtc3RyaW5naWZ5JztcbmltcG9ydCBwYXJzZSAgICAgZnJvbSAnLi9zY3NzLXBhcnNlJztcblxuZXhwb3J0IGRlZmF1bHQgeyBwYXJzZSwgc3RyaW5naWZ5IH07XG4iXX0=
  13629. /***/ }),
  13630. /* 92 */
  13631. /***/ (function(module, exports, __webpack_require__) {
  13632. "use strict";
  13633. exports.__esModule = true;
  13634. var _processor = __webpack_require__(146);
  13635. var _processor2 = _interopRequireDefault(_processor);
  13636. var _attribute = __webpack_require__(51);
  13637. var _attribute2 = _interopRequireDefault(_attribute);
  13638. var _className = __webpack_require__(52);
  13639. var _className2 = _interopRequireDefault(_className);
  13640. var _combinator = __webpack_require__(53);
  13641. var _combinator2 = _interopRequireDefault(_combinator);
  13642. var _comment = __webpack_require__(54);
  13643. var _comment2 = _interopRequireDefault(_comment);
  13644. var _id = __webpack_require__(55);
  13645. var _id2 = _interopRequireDefault(_id);
  13646. var _nesting = __webpack_require__(56);
  13647. var _nesting2 = _interopRequireDefault(_nesting);
  13648. var _pseudo = __webpack_require__(57);
  13649. var _pseudo2 = _interopRequireDefault(_pseudo);
  13650. var _root = __webpack_require__(58);
  13651. var _root2 = _interopRequireDefault(_root);
  13652. var _selector = __webpack_require__(59);
  13653. var _selector2 = _interopRequireDefault(_selector);
  13654. var _string = __webpack_require__(60);
  13655. var _string2 = _interopRequireDefault(_string);
  13656. var _tag = __webpack_require__(61);
  13657. var _tag2 = _interopRequireDefault(_tag);
  13658. var _universal = __webpack_require__(62);
  13659. var _universal2 = _interopRequireDefault(_universal);
  13660. var _types = __webpack_require__(0);
  13661. var types = _interopRequireWildcard(_types);
  13662. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  13663. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  13664. var parser = function parser(processor) {
  13665. return new _processor2.default(processor);
  13666. };
  13667. parser.attribute = function (opts) {
  13668. return new _attribute2.default(opts);
  13669. };
  13670. parser.className = function (opts) {
  13671. return new _className2.default(opts);
  13672. };
  13673. parser.combinator = function (opts) {
  13674. return new _combinator2.default(opts);
  13675. };
  13676. parser.comment = function (opts) {
  13677. return new _comment2.default(opts);
  13678. };
  13679. parser.id = function (opts) {
  13680. return new _id2.default(opts);
  13681. };
  13682. parser.nesting = function (opts) {
  13683. return new _nesting2.default(opts);
  13684. };
  13685. parser.pseudo = function (opts) {
  13686. return new _pseudo2.default(opts);
  13687. };
  13688. parser.root = function (opts) {
  13689. return new _root2.default(opts);
  13690. };
  13691. parser.selector = function (opts) {
  13692. return new _selector2.default(opts);
  13693. };
  13694. parser.string = function (opts) {
  13695. return new _string2.default(opts);
  13696. };
  13697. parser.tag = function (opts) {
  13698. return new _tag2.default(opts);
  13699. };
  13700. parser.universal = function (opts) {
  13701. return new _universal2.default(opts);
  13702. };
  13703. Object.keys(types).forEach(function (type) {
  13704. if (type === '__esModule') {
  13705. return;
  13706. }
  13707. parser[type] = types[type]; // eslint-disable-line
  13708. });
  13709. exports.default = parser;
  13710. module.exports = exports['default'];
  13711. /***/ }),
  13712. /* 93 */
  13713. /***/ (function(module, exports, __webpack_require__) {
  13714. "use strict";
  13715. const Parser = __webpack_require__(151);
  13716. const AtWord = __webpack_require__(63);
  13717. const Colon = __webpack_require__(64);
  13718. const Comma = __webpack_require__(65);
  13719. const Comment = __webpack_require__(66);
  13720. const Func = __webpack_require__(67);
  13721. const Num = __webpack_require__(68);
  13722. const Operator = __webpack_require__(69);
  13723. const Paren = __webpack_require__(70);
  13724. const Str = __webpack_require__(71);
  13725. const UnicodeRange = __webpack_require__(72);
  13726. const Value = __webpack_require__(73);
  13727. const Word = __webpack_require__(74);
  13728. let parser = function (source, options) {
  13729. return new Parser(source, options);
  13730. };
  13731. parser.atword = function (opts) {
  13732. return new AtWord(opts);
  13733. };
  13734. parser.colon = function (opts) {
  13735. opts.value = opts.value || ':';
  13736. return new Colon(opts);
  13737. };
  13738. parser.comma = function (opts) {
  13739. opts.value = opts.value || ',';
  13740. return new Comma(opts);
  13741. };
  13742. parser.comment = function (opts) {
  13743. return new Comment(opts);
  13744. };
  13745. parser.func = function (opts) {
  13746. return new Func(opts);
  13747. };
  13748. parser.number = function (opts) {
  13749. return new Num(opts);
  13750. };
  13751. parser.operator = function (opts) {
  13752. return new Operator(opts);
  13753. };
  13754. parser.paren = function (opts) {
  13755. opts.value = opts.value || '(';
  13756. return new Paren(opts);
  13757. };
  13758. parser.string = function (opts) {
  13759. opts.quote = opts.quote || '\'';
  13760. return new Str(opts);
  13761. };
  13762. parser.value = function (opts) {
  13763. return new Value(opts);
  13764. };
  13765. parser.word = function (opts) {
  13766. return new Word(opts);
  13767. };
  13768. parser.unicodeRange = function (opts) {
  13769. return new UnicodeRange(opts);
  13770. };
  13771. module.exports = parser;
  13772. /***/ }),
  13773. /* 94 */
  13774. /***/ (function(module, exports, __webpack_require__) {
  13775. "use strict";
  13776. function createError(message, loc) {
  13777. // Construct an error similar to the ones thrown by Babylon.
  13778. const error = new SyntaxError(
  13779. message + " (" + loc.start.line + ":" + loc.start.column + ")"
  13780. );
  13781. error.loc = loc;
  13782. return error;
  13783. }
  13784. module.exports = createError;
  13785. /***/ }),
  13786. /* 95 */
  13787. /***/ (function(module, exports, __webpack_require__) {
  13788. "use strict";
  13789. const htmlTagNames = __webpack_require__(101);
  13790. const colorAdjusterFunctions = [
  13791. "red",
  13792. "green",
  13793. "blue",
  13794. "alpha",
  13795. "a",
  13796. "rgb",
  13797. "hue",
  13798. "h",
  13799. "saturation",
  13800. "s",
  13801. "lightness",
  13802. "l",
  13803. "whiteness",
  13804. "w",
  13805. "blackness",
  13806. "b",
  13807. "tint",
  13808. "shade",
  13809. "blend",
  13810. "blenda",
  13811. "contrast",
  13812. "hsl",
  13813. "hsla",
  13814. "hwb",
  13815. "hwba"
  13816. ];
  13817. function getAncestorCounter(path, typeOrTypes) {
  13818. const types = [].concat(typeOrTypes);
  13819. let counter = -1;
  13820. let ancestorNode;
  13821. while ((ancestorNode = path.getParentNode(++counter))) {
  13822. if (types.indexOf(ancestorNode.type) !== -1) {
  13823. return counter;
  13824. }
  13825. }
  13826. return -1;
  13827. }
  13828. function getAncestorNode(path, typeOrTypes) {
  13829. const counter = getAncestorCounter(path, typeOrTypes);
  13830. return counter === -1 ? null : path.getParentNode(counter);
  13831. }
  13832. function getPropOfDeclNode(path) {
  13833. const declAncestorNode = getAncestorNode(path, "css-decl");
  13834. return (
  13835. declAncestorNode &&
  13836. declAncestorNode.prop &&
  13837. declAncestorNode.prop.toLowerCase()
  13838. );
  13839. }
  13840. function isSCSS(parser, text) {
  13841. const hasExplicitParserChoice = parser === "less" || parser === "scss";
  13842. const IS_POSSIBLY_SCSS = /(\w\s*: [^}:]+|#){|@import[^\n]+(url|,)/;
  13843. return hasExplicitParserChoice
  13844. ? parser === "scss"
  13845. : IS_POSSIBLY_SCSS.test(text);
  13846. }
  13847. function isWideKeywords(value) {
  13848. return (
  13849. ["initial", "inherit", "unset", "revert"].indexOf(value.toLowerCase()) !==
  13850. -1
  13851. );
  13852. }
  13853. function isKeyframeAtRuleKeywords(path, value) {
  13854. const atRuleAncestorNode = getAncestorNode(path, "css-atrule");
  13855. return (
  13856. atRuleAncestorNode &&
  13857. atRuleAncestorNode.name &&
  13858. atRuleAncestorNode.name.toLowerCase().endsWith("keyframes") &&
  13859. ["from", "to"].indexOf(value.toLowerCase()) !== -1
  13860. );
  13861. }
  13862. function maybeToLowerCase(value) {
  13863. return value.includes("$") ||
  13864. value.includes("@") ||
  13865. value.includes("#") ||
  13866. value.startsWith("%") ||
  13867. value.startsWith("--") ||
  13868. value.startsWith(":--") ||
  13869. (value.includes("(") && value.includes(")"))
  13870. ? value
  13871. : value.toLowerCase();
  13872. }
  13873. function insideValueFunctionNode(path, functionName) {
  13874. const funcAncestorNode = getAncestorNode(path, "value-func");
  13875. return (
  13876. funcAncestorNode &&
  13877. funcAncestorNode.value &&
  13878. funcAncestorNode.value.toLowerCase() === functionName
  13879. );
  13880. }
  13881. function insideICSSRuleNode(path) {
  13882. const ruleAncestorNode = getAncestorNode(path, "css-rule");
  13883. return (
  13884. ruleAncestorNode &&
  13885. ruleAncestorNode.raws &&
  13886. ruleAncestorNode.raws.selector &&
  13887. (ruleAncestorNode.raws.selector.startsWith(":import") ||
  13888. ruleAncestorNode.raws.selector.startsWith(":export"))
  13889. );
  13890. }
  13891. function insideAtRuleNode(path, atRuleNameOrAtRuleNames) {
  13892. const atRuleNames = [].concat(atRuleNameOrAtRuleNames);
  13893. const atRuleAncestorNode = getAncestorNode(path, "css-atrule");
  13894. return (
  13895. atRuleAncestorNode &&
  13896. atRuleNames.indexOf(atRuleAncestorNode.name.toLowerCase()) !== -1
  13897. );
  13898. }
  13899. function insideURLFunctionInImportAtRuleNode(path) {
  13900. const node = path.getValue();
  13901. const atRuleAncestorNode = getAncestorNode(path, "css-atrule");
  13902. return (
  13903. atRuleAncestorNode &&
  13904. atRuleAncestorNode.name === "import" &&
  13905. node.groups[0].value === "url" &&
  13906. node.groups.length === 2
  13907. );
  13908. }
  13909. function isURLFunctionNode(node) {
  13910. return node.type === "value-func" && node.value.toLowerCase() === "url";
  13911. }
  13912. function isLastNode(path, node) {
  13913. const parentNode = path.getParentNode();
  13914. if (!parentNode) {
  13915. return false;
  13916. }
  13917. const nodes = parentNode.nodes;
  13918. return nodes && nodes.indexOf(node) === nodes.length - 1;
  13919. }
  13920. function isHTMLTag(value) {
  13921. return htmlTagNames.indexOf(value.toLowerCase()) !== -1;
  13922. }
  13923. function isDetachedRulesetDeclarationNode(node) {
  13924. // If a Less file ends up being parsed with the SCSS parser, Less
  13925. // variable declarations will be parsed as atrules with names ending
  13926. // with a colon, so keep the original case then.
  13927. if (!node.selector) {
  13928. return false;
  13929. }
  13930. return (
  13931. (typeof node.selector === "string" && /^@.+:.*$/.test(node.selector)) ||
  13932. (node.selector.value && /^@.+:.*$/.test(node.selector.value))
  13933. );
  13934. }
  13935. function isForKeywordNode(node) {
  13936. return (
  13937. node.type === "value-word" &&
  13938. ["from", "through", "end"].indexOf(node.value) !== -1
  13939. );
  13940. }
  13941. function isIfElseKeywordNode(node) {
  13942. return (
  13943. node.type === "value-word" &&
  13944. ["and", "or", "not"].indexOf(node.value) !== -1
  13945. );
  13946. }
  13947. function isEachKeywordNode(node) {
  13948. return node.type === "value-word" && node.value === "in";
  13949. }
  13950. function isMultiplicationNode(node) {
  13951. return node.type === "value-operator" && node.value === "*";
  13952. }
  13953. function isDivisionNode(node) {
  13954. return node.type === "value-operator" && node.value === "/";
  13955. }
  13956. function isAdditionNode(node) {
  13957. return node.type === "value-operator" && node.value === "+";
  13958. }
  13959. function isSubtractionNode(node) {
  13960. return node.type === "value-operator" && node.value === "-";
  13961. }
  13962. function isModuloNode(node) {
  13963. return node.type === "value-operator" && node.value === "%";
  13964. }
  13965. function isMathOperatorNode(node) {
  13966. return (
  13967. isMultiplicationNode(node) ||
  13968. isDivisionNode(node) ||
  13969. isAdditionNode(node) ||
  13970. isSubtractionNode(node) ||
  13971. isModuloNode(node)
  13972. );
  13973. }
  13974. function isEqualityOperatorNode(node) {
  13975. return node.type === "value-word" && ["==", "!="].indexOf(node.value) !== -1;
  13976. }
  13977. function isRelationalOperatorNode(node) {
  13978. return (
  13979. node.type === "value-word" &&
  13980. ["<", ">", "<=", ">="].indexOf(node.value) !== -1
  13981. );
  13982. }
  13983. function isSCSSControlDirectiveNode(node) {
  13984. return (
  13985. node.type === "css-atrule" &&
  13986. ["if", "else", "for", "each", "while"].indexOf(node.name) !== -1
  13987. );
  13988. }
  13989. function isSCSSNestedPropertyNode(node) {
  13990. if (!node.selector) {
  13991. return false;
  13992. }
  13993. return node.selector
  13994. .replace(/\/\*.*?\*\//, "")
  13995. .replace(/\/\/.*?\n/, "")
  13996. .trim()
  13997. .endsWith(":");
  13998. }
  13999. function isDetachedRulesetCallNode(node) {
  14000. return node.raws && node.raws.params && /^\(\s*\)$/.test(node.raws.params);
  14001. }
  14002. function isPostcssSimpleVarNode(currentNode, nextNode) {
  14003. return (
  14004. currentNode.value === "$$" &&
  14005. currentNode.type === "value-func" &&
  14006. nextNode &&
  14007. nextNode.type === "value-word" &&
  14008. !nextNode.raws.before
  14009. );
  14010. }
  14011. function hasComposesNode(node) {
  14012. return (
  14013. node.value &&
  14014. node.value.type === "value-root" &&
  14015. node.value.group &&
  14016. node.value.group.type === "value-value" &&
  14017. node.prop.toLowerCase() === "composes"
  14018. );
  14019. }
  14020. function hasParensAroundNode(node) {
  14021. return (
  14022. node.value &&
  14023. node.value.group &&
  14024. node.value.group.group &&
  14025. node.value.group.group.type === "value-paren_group" &&
  14026. node.value.group.group.open !== null &&
  14027. node.value.group.group.close !== null
  14028. );
  14029. }
  14030. function hasEmptyRawBefore(node) {
  14031. return node.raws && node.raws.before === "";
  14032. }
  14033. function isKeyValuePairNode(node) {
  14034. return (
  14035. node.type === "value-comma_group" &&
  14036. node.groups &&
  14037. node.groups[1] &&
  14038. node.groups[1].type === "value-colon"
  14039. );
  14040. }
  14041. function isKeyValuePairInParenGroupNode(node) {
  14042. return (
  14043. node.type === "value-paren_group" &&
  14044. node.groups &&
  14045. node.groups[0] &&
  14046. isKeyValuePairNode(node.groups[0])
  14047. );
  14048. }
  14049. function isSCSSMapItemNode(path) {
  14050. const node = path.getValue();
  14051. // Ignore empty item (i.e. `$key: ()`)
  14052. if (node.groups.length === 0) {
  14053. return false;
  14054. }
  14055. const parentParentNode = path.getParentNode(1);
  14056. // Check open parens contain key/value pair (i.e. `(key: value)` and `(key: (value, other-value)`)
  14057. if (
  14058. !isKeyValuePairInParenGroupNode(node) &&
  14059. !(parentParentNode && isKeyValuePairInParenGroupNode(parentParentNode))
  14060. ) {
  14061. return false;
  14062. }
  14063. const declNode = getAncestorNode(path, "css-decl");
  14064. // SCSS map declaration (i.e. `$map: (key: value, other-key: other-value)`)
  14065. if (declNode && declNode.prop && declNode.prop.startsWith("$")) {
  14066. return true;
  14067. }
  14068. // List as value of key inside SCSS map (i.e. `$map: (key: (value other-value other-other-value))`)
  14069. if (isKeyValuePairInParenGroupNode(parentParentNode)) {
  14070. return true;
  14071. }
  14072. // SCSS Map is argument of function (i.e. `func((key: value, other-key: other-value))`)
  14073. if (parentParentNode.type === "value-func") {
  14074. return true;
  14075. }
  14076. return false;
  14077. }
  14078. function isInlineValueCommentNode(node) {
  14079. return node.type === "value-comment" && node.inline;
  14080. }
  14081. function isHashNode(node) {
  14082. return node.type === "value-word" && node.value === "#";
  14083. }
  14084. function isLeftCurlyBraceNode(node) {
  14085. return node.type === "value-word" && node.value === "{";
  14086. }
  14087. function isRightCurlyBraceNode(node) {
  14088. return node.type === "value-word" && node.value === "}";
  14089. }
  14090. function isWordNode(node) {
  14091. return ["value-word", "value-atword"].indexOf(node.type) !== -1;
  14092. }
  14093. function isColonNode(node) {
  14094. return node.type === "value-colon";
  14095. }
  14096. function isMediaAndSupportsKeywords(node) {
  14097. return (
  14098. node.value && ["not", "and", "or"].indexOf(node.value.toLowerCase()) !== -1
  14099. );
  14100. }
  14101. function isColorAdjusterFuncNode(node) {
  14102. if (node.type !== "value-func") {
  14103. return false;
  14104. }
  14105. return colorAdjusterFunctions.indexOf(node.value.toLowerCase()) !== -1;
  14106. }
  14107. module.exports = {
  14108. getAncestorCounter,
  14109. getAncestorNode,
  14110. getPropOfDeclNode,
  14111. maybeToLowerCase,
  14112. insideValueFunctionNode,
  14113. insideICSSRuleNode,
  14114. insideAtRuleNode,
  14115. insideURLFunctionInImportAtRuleNode,
  14116. isKeyframeAtRuleKeywords,
  14117. isHTMLTag,
  14118. isWideKeywords,
  14119. isSCSS,
  14120. isLastNode,
  14121. isSCSSControlDirectiveNode,
  14122. isDetachedRulesetDeclarationNode,
  14123. isRelationalOperatorNode,
  14124. isEqualityOperatorNode,
  14125. isMultiplicationNode,
  14126. isDivisionNode,
  14127. isAdditionNode,
  14128. isSubtractionNode,
  14129. isModuloNode,
  14130. isMathOperatorNode,
  14131. isEachKeywordNode,
  14132. isForKeywordNode,
  14133. isURLFunctionNode,
  14134. isIfElseKeywordNode,
  14135. hasComposesNode,
  14136. hasParensAroundNode,
  14137. hasEmptyRawBefore,
  14138. isSCSSNestedPropertyNode,
  14139. isDetachedRulesetCallNode,
  14140. isPostcssSimpleVarNode,
  14141. isKeyValuePairNode,
  14142. isKeyValuePairInParenGroupNode,
  14143. isSCSSMapItemNode,
  14144. isInlineValueCommentNode,
  14145. isHashNode,
  14146. isLeftCurlyBraceNode,
  14147. isRightCurlyBraceNode,
  14148. isWordNode,
  14149. isColonNode,
  14150. isMediaAndSupportsKeywords,
  14151. isColorAdjusterFuncNode
  14152. };
  14153. /***/ }),
  14154. /* 96 */
  14155. /***/ (function(module, exports, __webpack_require__) {
  14156. "use strict";
  14157. function parse(text) {
  14158. let delimiter;
  14159. if (text.indexOf("---") === 0) {
  14160. delimiter = "---";
  14161. } else if (text.indexOf("+++") === 0) {
  14162. delimiter = "+++";
  14163. }
  14164. let end = -1;
  14165. if (!delimiter || (end = text.indexOf(`\n${delimiter}`, 3)) === -1) {
  14166. return { frontMatter: null, content: text };
  14167. }
  14168. end = end + 4;
  14169. return {
  14170. frontMatter: text.slice(0, end),
  14171. content: text.slice(end)
  14172. };
  14173. }
  14174. module.exports = parse;
  14175. /***/ }),
  14176. /* 97 */
  14177. /***/ (function(module, exports, __webpack_require__) {
  14178. "use strict";
  14179. // Super inefficient, needs to be cached.
  14180. module.exports = function(lineColumn, text) {
  14181. let index = 0;
  14182. for (let i = 0; i < lineColumn.line - 1; ++i) {
  14183. index = text.indexOf("\n", index) + 1;
  14184. if (index === -1) {
  14185. return -1;
  14186. }
  14187. }
  14188. return index + lineColumn.column;
  14189. };
  14190. /***/ }),
  14191. /* 98 */
  14192. /***/ (function(module, exports, __webpack_require__) {
  14193. "use strict";
  14194. exports.byteLength = byteLength
  14195. exports.toByteArray = toByteArray
  14196. exports.fromByteArray = fromByteArray
  14197. var lookup = []
  14198. var revLookup = []
  14199. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  14200. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  14201. for (var i = 0, len = code.length; i < len; ++i) {
  14202. lookup[i] = code[i]
  14203. revLookup[code.charCodeAt(i)] = i
  14204. }
  14205. revLookup['-'.charCodeAt(0)] = 62
  14206. revLookup['_'.charCodeAt(0)] = 63
  14207. function placeHoldersCount (b64) {
  14208. var len = b64.length
  14209. if (len % 4 > 0) {
  14210. throw new Error('Invalid string. Length must be a multiple of 4')
  14211. }
  14212. // the number of equal signs (place holders)
  14213. // if there are two placeholders, than the two characters before it
  14214. // represent one byte
  14215. // if there is only one, then the three characters before it represent 2 bytes
  14216. // this is just a cheap hack to not do indexOf twice
  14217. return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
  14218. }
  14219. function byteLength (b64) {
  14220. // base64 is 4/3 + up to two characters of the original data
  14221. return b64.length * 3 / 4 - placeHoldersCount(b64)
  14222. }
  14223. function toByteArray (b64) {
  14224. var i, j, l, tmp, placeHolders, arr
  14225. var len = b64.length
  14226. placeHolders = placeHoldersCount(b64)
  14227. arr = new Arr(len * 3 / 4 - placeHolders)
  14228. // if there are placeholders, only get up to the last complete 4 chars
  14229. l = placeHolders > 0 ? len - 4 : len
  14230. var L = 0
  14231. for (i = 0, j = 0; i < l; i += 4, j += 3) {
  14232. tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
  14233. arr[L++] = (tmp >> 16) & 0xFF
  14234. arr[L++] = (tmp >> 8) & 0xFF
  14235. arr[L++] = tmp & 0xFF
  14236. }
  14237. if (placeHolders === 2) {
  14238. tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
  14239. arr[L++] = tmp & 0xFF
  14240. } else if (placeHolders === 1) {
  14241. tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
  14242. arr[L++] = (tmp >> 8) & 0xFF
  14243. arr[L++] = tmp & 0xFF
  14244. }
  14245. return arr
  14246. }
  14247. function tripletToBase64 (num) {
  14248. return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
  14249. }
  14250. function encodeChunk (uint8, start, end) {
  14251. var tmp
  14252. var output = []
  14253. for (var i = start; i < end; i += 3) {
  14254. tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
  14255. output.push(tripletToBase64(tmp))
  14256. }
  14257. return output.join('')
  14258. }
  14259. function fromByteArray (uint8) {
  14260. var tmp
  14261. var len = uint8.length
  14262. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  14263. var output = ''
  14264. var parts = []
  14265. var maxChunkLength = 16383 // must be multiple of 3
  14266. // go through the array every three bytes, we'll deal with trailing stuff later
  14267. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  14268. parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
  14269. }
  14270. // pad the end with zeros, but make sure to not forget the extra bytes
  14271. if (extraBytes === 1) {
  14272. tmp = uint8[len - 1]
  14273. output += lookup[tmp >> 2]
  14274. output += lookup[(tmp << 4) & 0x3F]
  14275. output += '=='
  14276. } else if (extraBytes === 2) {
  14277. tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
  14278. output += lookup[tmp >> 10]
  14279. output += lookup[(tmp >> 4) & 0x3F]
  14280. output += lookup[(tmp << 2) & 0x3F]
  14281. output += '='
  14282. }
  14283. parts.push(output)
  14284. return parts.join('')
  14285. }
  14286. /***/ }),
  14287. /* 99 */
  14288. /***/ (function(module, exports, __webpack_require__) {
  14289. "use strict";
  14290. var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
  14291. module.exports = function (str) {
  14292. if (typeof str !== 'string') {
  14293. throw new TypeError('Expected a string');
  14294. }
  14295. return str.replace(matchOperatorsRe, '\\$&');
  14296. };
  14297. /***/ }),
  14298. /* 100 */
  14299. /***/ (function(module, exports, __webpack_require__) {
  14300. "use strict";
  14301. var ansiRegex = __webpack_require__(32);
  14302. var re = new RegExp(ansiRegex().source); // remove the `g` flag
  14303. module.exports = re.test.bind(re);
  14304. /***/ }),
  14305. /* 101 */
  14306. /***/ (function(module, exports) {
  14307. module.exports = [
  14308. "a",
  14309. "abbr",
  14310. "acronym",
  14311. "address",
  14312. "applet",
  14313. "area",
  14314. "article",
  14315. "aside",
  14316. "audio",
  14317. "b",
  14318. "base",
  14319. "basefont",
  14320. "bdi",
  14321. "bdo",
  14322. "bgsound",
  14323. "big",
  14324. "blink",
  14325. "blockquote",
  14326. "body",
  14327. "br",
  14328. "button",
  14329. "canvas",
  14330. "caption",
  14331. "center",
  14332. "cite",
  14333. "code",
  14334. "col",
  14335. "colgroup",
  14336. "command",
  14337. "content",
  14338. "data",
  14339. "datalist",
  14340. "dd",
  14341. "del",
  14342. "details",
  14343. "dfn",
  14344. "dialog",
  14345. "dir",
  14346. "div",
  14347. "dl",
  14348. "dt",
  14349. "element",
  14350. "em",
  14351. "embed",
  14352. "fieldset",
  14353. "figcaption",
  14354. "figure",
  14355. "font",
  14356. "footer",
  14357. "form",
  14358. "frame",
  14359. "frameset",
  14360. "h1",
  14361. "h2",
  14362. "h3",
  14363. "h4",
  14364. "h5",
  14365. "h6",
  14366. "head",
  14367. "header",
  14368. "hgroup",
  14369. "hr",
  14370. "html",
  14371. "i",
  14372. "iframe",
  14373. "image",
  14374. "img",
  14375. "input",
  14376. "ins",
  14377. "isindex",
  14378. "kbd",
  14379. "keygen",
  14380. "label",
  14381. "legend",
  14382. "li",
  14383. "link",
  14384. "listing",
  14385. "main",
  14386. "map",
  14387. "mark",
  14388. "marquee",
  14389. "math",
  14390. "menu",
  14391. "menuitem",
  14392. "meta",
  14393. "meter",
  14394. "multicol",
  14395. "nav",
  14396. "nextid",
  14397. "nobr",
  14398. "noembed",
  14399. "noframes",
  14400. "noscript",
  14401. "object",
  14402. "ol",
  14403. "optgroup",
  14404. "option",
  14405. "output",
  14406. "p",
  14407. "param",
  14408. "picture",
  14409. "plaintext",
  14410. "pre",
  14411. "progress",
  14412. "q",
  14413. "rb",
  14414. "rbc",
  14415. "rp",
  14416. "rt",
  14417. "rtc",
  14418. "ruby",
  14419. "s",
  14420. "samp",
  14421. "script",
  14422. "section",
  14423. "select",
  14424. "shadow",
  14425. "slot",
  14426. "small",
  14427. "source",
  14428. "spacer",
  14429. "span",
  14430. "strike",
  14431. "strong",
  14432. "style",
  14433. "sub",
  14434. "summary",
  14435. "sup",
  14436. "svg",
  14437. "table",
  14438. "tbody",
  14439. "td",
  14440. "template",
  14441. "textarea",
  14442. "tfoot",
  14443. "th",
  14444. "thead",
  14445. "time",
  14446. "title",
  14447. "tr",
  14448. "track",
  14449. "tt",
  14450. "u",
  14451. "ul",
  14452. "var",
  14453. "video",
  14454. "wbr",
  14455. "xmp"
  14456. ];
  14457. /***/ }),
  14458. /* 102 */
  14459. /***/ (function(module, exports) {
  14460. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  14461. var e, m
  14462. var eLen = nBytes * 8 - mLen - 1
  14463. var eMax = (1 << eLen) - 1
  14464. var eBias = eMax >> 1
  14465. var nBits = -7
  14466. var i = isLE ? (nBytes - 1) : 0
  14467. var d = isLE ? -1 : 1
  14468. var s = buffer[offset + i]
  14469. i += d
  14470. e = s & ((1 << (-nBits)) - 1)
  14471. s >>= (-nBits)
  14472. nBits += eLen
  14473. for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
  14474. m = e & ((1 << (-nBits)) - 1)
  14475. e >>= (-nBits)
  14476. nBits += mLen
  14477. for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
  14478. if (e === 0) {
  14479. e = 1 - eBias
  14480. } else if (e === eMax) {
  14481. return m ? NaN : ((s ? -1 : 1) * Infinity)
  14482. } else {
  14483. m = m + Math.pow(2, mLen)
  14484. e = e - eBias
  14485. }
  14486. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  14487. }
  14488. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  14489. var e, m, c
  14490. var eLen = nBytes * 8 - mLen - 1
  14491. var eMax = (1 << eLen) - 1
  14492. var eBias = eMax >> 1
  14493. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  14494. var i = isLE ? 0 : (nBytes - 1)
  14495. var d = isLE ? 1 : -1
  14496. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  14497. value = Math.abs(value)
  14498. if (isNaN(value) || value === Infinity) {
  14499. m = isNaN(value) ? 1 : 0
  14500. e = eMax
  14501. } else {
  14502. e = Math.floor(Math.log(value) / Math.LN2)
  14503. if (value * (c = Math.pow(2, -e)) < 1) {
  14504. e--
  14505. c *= 2
  14506. }
  14507. if (e + eBias >= 1) {
  14508. value += rt / c
  14509. } else {
  14510. value += rt * Math.pow(2, 1 - eBias)
  14511. }
  14512. if (value * c >= 2) {
  14513. e++
  14514. c /= 2
  14515. }
  14516. if (e + eBias >= eMax) {
  14517. m = 0
  14518. e = eMax
  14519. } else if (e + eBias >= 1) {
  14520. m = (value * c - 1) * Math.pow(2, mLen)
  14521. e = e + eBias
  14522. } else {
  14523. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  14524. e = 0
  14525. }
  14526. }
  14527. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  14528. e = (e << mLen) | m
  14529. eLen += mLen
  14530. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  14531. buffer[offset + i - d] |= s * 128
  14532. }
  14533. /***/ }),
  14534. /* 103 */
  14535. /***/ (function(module, exports) {
  14536. var toString = {}.toString;
  14537. module.exports = Array.isArray || function (arr) {
  14538. return toString.call(arr) == '[object Array]';
  14539. };
  14540. /***/ }),
  14541. /* 104 */
  14542. /***/ (function(module, exports, __webpack_require__) {
  14543. "use strict";
  14544. Object.defineProperty(exports, "__esModule", {
  14545. value: true
  14546. });
  14547. exports.default = findExtendRule;
  14548. var extendRuleKeyWords = ['&', ':', 'extend'];
  14549. var extendRuleKeyWordsCount = extendRuleKeyWords.length;
  14550. function findExtendRule(tokens) {
  14551. var start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  14552. var stack = [];
  14553. var len = tokens.length;
  14554. var end = start;
  14555. while (end < len) {
  14556. var token = tokens[end];
  14557. if (extendRuleKeyWords.indexOf(token[1]) >= 0) {
  14558. stack.push(token[1]);
  14559. } else if (token[0] !== 'space') {
  14560. break;
  14561. }
  14562. end++;
  14563. }
  14564. for (var index = 0; index < extendRuleKeyWordsCount; index++) {
  14565. if (stack[index] !== extendRuleKeyWords[index]) {
  14566. return null;
  14567. }
  14568. }
  14569. return tokens.slice(start, end);
  14570. }
  14571. module.exports = exports['default'];
  14572. /***/ }),
  14573. /* 105 */
  14574. /***/ (function(module, exports, __webpack_require__) {
  14575. "use strict";
  14576. Object.defineProperty(exports, "__esModule", {
  14577. value: true
  14578. });
  14579. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14580. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  14581. var _rule = __webpack_require__(10);
  14582. var _rule2 = _interopRequireDefault(_rule);
  14583. var _lessStringify = __webpack_require__(12);
  14584. var _lessStringify2 = _interopRequireDefault(_lessStringify);
  14585. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  14586. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14587. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  14588. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  14589. var Import = function (_PostCssRule) {
  14590. _inherits(Import, _PostCssRule);
  14591. function Import(defaults) {
  14592. _classCallCheck(this, Import);
  14593. var _this = _possibleConstructorReturn(this, (Import.__proto__ || Object.getPrototypeOf(Import)).call(this, defaults));
  14594. _this.type = 'import';
  14595. return _this;
  14596. }
  14597. _createClass(Import, [{
  14598. key: 'toString',
  14599. value: function toString(stringifier) {
  14600. if (!stringifier) {
  14601. stringifier = {
  14602. stringify: _lessStringify2.default
  14603. };
  14604. }
  14605. return _get(Import.prototype.__proto__ || Object.getPrototypeOf(Import.prototype), 'toString', this).call(this, stringifier);
  14606. }
  14607. }]);
  14608. return Import;
  14609. }(_rule2.default);
  14610. exports.default = Import;
  14611. module.exports = exports['default'];
  14612. /***/ }),
  14613. /* 106 */
  14614. /***/ (function(module, exports, __webpack_require__) {
  14615. "use strict";
  14616. Object.defineProperty(exports, "__esModule", {
  14617. value: true
  14618. });
  14619. exports.default = isMixinToken;
  14620. var _globals = __webpack_require__(2);
  14621. var unpaddedFractionalNumbersPattern = /\.[0-9]/;
  14622. function isMixinToken(token) {
  14623. var symbol = token[1];
  14624. var firstSymbolCode = symbol ? symbol[0].charCodeAt(0) : null;
  14625. return (firstSymbolCode === _globals.dot || firstSymbolCode === _globals.hash) &&
  14626. // ignore hashes used for colors
  14627. _globals.hashColorPattern.test(symbol) === false &&
  14628. // ignore dots used for unpadded fractional numbers
  14629. unpaddedFractionalNumbersPattern.test(symbol) === false;
  14630. }
  14631. module.exports = exports['default'];
  14632. /***/ }),
  14633. /* 107 */
  14634. /***/ (function(module, exports, __webpack_require__) {
  14635. "use strict";
  14636. Object.defineProperty(exports, "__esModule", {
  14637. value: true
  14638. });
  14639. exports.default = lessParse;
  14640. var _input = __webpack_require__(26);
  14641. var _input2 = _interopRequireDefault(_input);
  14642. var _lessParser = __webpack_require__(31);
  14643. var _lessParser2 = _interopRequireDefault(_lessParser);
  14644. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  14645. function lessParse(less, opts) {
  14646. var input = new _input2.default(less, opts);
  14647. var parser = new _lessParser2.default(input, opts);
  14648. // const parser = new Parser(input, opts);
  14649. parser.tokenize();
  14650. parser.loop();
  14651. return parser.root;
  14652. }
  14653. // import Parser from 'postcss/lib/parser';
  14654. module.exports = exports['default'];
  14655. /***/ }),
  14656. /* 108 */
  14657. /***/ (function(module, exports, __webpack_require__) {
  14658. "use strict";
  14659. Object.defineProperty(exports, "__esModule", {
  14660. value: true
  14661. });
  14662. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14663. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  14664. var _stringifier = __webpack_require__(29);
  14665. var _stringifier2 = _interopRequireDefault(_stringifier);
  14666. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  14667. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14668. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  14669. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  14670. var LessStringifier = function (_Stringifier) {
  14671. _inherits(LessStringifier, _Stringifier);
  14672. function LessStringifier() {
  14673. _classCallCheck(this, LessStringifier);
  14674. return _possibleConstructorReturn(this, (LessStringifier.__proto__ || Object.getPrototypeOf(LessStringifier)).apply(this, arguments));
  14675. }
  14676. _createClass(LessStringifier, [{
  14677. key: 'comment',
  14678. value: function comment(node) {
  14679. this.builder(node.raws.content, node);
  14680. }
  14681. }, {
  14682. key: 'import',
  14683. value: function _import(node) {
  14684. this.builder('@' + node.name);
  14685. this.builder((node.raws.afterName || '') + (node.directives || '') + (node.raws.between || '') + (node.urlFunc ? 'url(' : '') + (node.raws.beforeUrl || '') + (node.importPath || '') + (node.raws.afterUrl || '') + (node.urlFunc ? ')' : '') + (node.raws.after || ''));
  14686. if (node.raws.semicolon) {
  14687. this.builder(';');
  14688. }
  14689. }
  14690. }, {
  14691. key: 'rule',
  14692. value: function rule(node) {
  14693. _get(LessStringifier.prototype.__proto__ || Object.getPrototypeOf(LessStringifier.prototype), 'rule', this).call(this, node);
  14694. if (node.empty && node.raws.semicolon) {
  14695. if (node.important) {
  14696. if (node.raws.important) {
  14697. this.builder(node.raws.important);
  14698. } else {
  14699. this.builder(' !important');
  14700. }
  14701. }
  14702. if (node.raws.semicolon) {
  14703. this.builder(';');
  14704. }
  14705. }
  14706. }
  14707. }, {
  14708. key: 'block',
  14709. value: function block(node, start) {
  14710. var empty = node.empty;
  14711. var between = this.raw(node, 'between', 'beforeOpen');
  14712. var after = '';
  14713. if (empty) {
  14714. this.builder(start + between, node, 'start');
  14715. } else {
  14716. this.builder(start + between + '{', node, 'start');
  14717. }
  14718. if (node.nodes && node.nodes.length) {
  14719. this.body(node);
  14720. after = this.raw(node, 'after');
  14721. } else {
  14722. after = this.raw(node, 'after', 'emptyBody');
  14723. }
  14724. if (after) {
  14725. this.builder(after);
  14726. }
  14727. if (!empty) {
  14728. this.builder('}', node, 'end');
  14729. }
  14730. }
  14731. }]);
  14732. return LessStringifier;
  14733. }(_stringifier2.default);
  14734. exports.default = LessStringifier;
  14735. module.exports = exports['default'];
  14736. /***/ }),
  14737. /* 109 */
  14738. /***/ (function(module, exports, __webpack_require__) {
  14739. "use strict";
  14740. Object.defineProperty(exports, "__esModule", {
  14741. value: true
  14742. });
  14743. exports.default = lessTokenize;
  14744. var _globals = __webpack_require__(2);
  14745. var _tokenizeSymbol = __webpack_require__(123);
  14746. var _tokenizeSymbol2 = _interopRequireDefault(_tokenizeSymbol);
  14747. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  14748. function lessTokenize(input) {
  14749. var state = {
  14750. input: input,
  14751. tokens: [],
  14752. css: input.css.valueOf(),
  14753. offset: -1,
  14754. line: 1,
  14755. pos: 0
  14756. };
  14757. state.length = state.css.length;
  14758. while (state.pos < state.length) {
  14759. state.symbolCode = state.css.charCodeAt(state.pos);
  14760. state.symbol = state.css[state.pos];
  14761. state.nextPos = null;
  14762. state.escaped = null;
  14763. state.lines = null;
  14764. state.lastLine = null;
  14765. state.cssPart = null;
  14766. state.escape = null;
  14767. state.nextLine = null;
  14768. state.nextOffset = null;
  14769. state.escapePos = null;
  14770. state.token = null;
  14771. if (state.symbolCode === _globals.newline) {
  14772. state.offset = state.pos;
  14773. state.line += 1;
  14774. }
  14775. (0, _tokenizeSymbol2.default)(state);
  14776. state.pos++;
  14777. }
  14778. return state.tokens;
  14779. }
  14780. module.exports = exports['default'];
  14781. /***/ }),
  14782. /* 110 */
  14783. /***/ (function(module, exports, __webpack_require__) {
  14784. "use strict";
  14785. Object.defineProperty(exports, "__esModule", {
  14786. value: true
  14787. });
  14788. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14789. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  14790. var _root = __webpack_require__(28);
  14791. var _root2 = _interopRequireDefault(_root);
  14792. var _lessStringify = __webpack_require__(12);
  14793. var _lessStringify2 = _interopRequireDefault(_lessStringify);
  14794. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  14795. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14796. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  14797. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  14798. var Root = function (_PostCssRoot) {
  14799. _inherits(Root, _PostCssRoot);
  14800. function Root() {
  14801. _classCallCheck(this, Root);
  14802. return _possibleConstructorReturn(this, (Root.__proto__ || Object.getPrototypeOf(Root)).apply(this, arguments));
  14803. }
  14804. _createClass(Root, [{
  14805. key: 'toString',
  14806. value: function toString(stringifier) {
  14807. if (!stringifier) {
  14808. stringifier = {
  14809. stringify: _lessStringify2.default
  14810. };
  14811. }
  14812. return _get(Root.prototype.__proto__ || Object.getPrototypeOf(Root.prototype), 'toString', this).call(this, stringifier);
  14813. }
  14814. }]);
  14815. return Root;
  14816. }(_root2.default);
  14817. exports.default = Root;
  14818. module.exports = exports['default'];
  14819. /***/ }),
  14820. /* 111 */
  14821. /***/ (function(module, exports, __webpack_require__) {
  14822. "use strict";
  14823. Object.defineProperty(exports, "__esModule", {
  14824. value: true
  14825. });
  14826. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14827. var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
  14828. var _rule = __webpack_require__(10);
  14829. var _rule2 = _interopRequireDefault(_rule);
  14830. var _lessStringify = __webpack_require__(12);
  14831. var _lessStringify2 = _interopRequireDefault(_lessStringify);
  14832. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  14833. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14834. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  14835. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  14836. var Rule = function (_PostCssRule) {
  14837. _inherits(Rule, _PostCssRule);
  14838. function Rule() {
  14839. _classCallCheck(this, Rule);
  14840. return _possibleConstructorReturn(this, (Rule.__proto__ || Object.getPrototypeOf(Rule)).apply(this, arguments));
  14841. }
  14842. _createClass(Rule, [{
  14843. key: 'toString',
  14844. value: function toString(stringifier) {
  14845. if (!stringifier) {
  14846. stringifier = {
  14847. stringify: _lessStringify2.default
  14848. };
  14849. }
  14850. return _get(Rule.prototype.__proto__ || Object.getPrototypeOf(Rule.prototype), 'toString', this).call(this, stringifier);
  14851. }
  14852. }]);
  14853. return Rule;
  14854. }(_rule2.default);
  14855. exports.default = Rule;
  14856. module.exports = exports['default'];
  14857. /***/ }),
  14858. /* 112 */
  14859. /***/ (function(module, exports, __webpack_require__) {
  14860. "use strict";
  14861. Object.defineProperty(exports, "__esModule", {
  14862. value: true
  14863. });
  14864. exports.default = findEndOfEscaping;
  14865. var _globals = __webpack_require__(2);
  14866. /**
  14867. * @param state
  14868. * @returns {number}
  14869. */
  14870. function findEndOfEscaping(state) {
  14871. var openQuotesCount = 0,
  14872. quoteCode = -1;
  14873. for (var i = state.pos + 1; i < state.length; i++) {
  14874. var symbolCode = state.css.charCodeAt(i);
  14875. var prevSymbolCode = state.css.charCodeAt(i - 1);
  14876. if (prevSymbolCode !== _globals.backslash && (symbolCode === _globals.singleQuote || symbolCode === _globals.doubleQuote || symbolCode === _globals.backTick)) {
  14877. if (quoteCode === -1) {
  14878. quoteCode = symbolCode;
  14879. openQuotesCount++;
  14880. } else if (symbolCode === quoteCode) {
  14881. openQuotesCount--;
  14882. if (!openQuotesCount) {
  14883. return i;
  14884. }
  14885. }
  14886. }
  14887. }
  14888. return -1;
  14889. }
  14890. module.exports = exports['default'];
  14891. /***/ }),
  14892. /* 113 */
  14893. /***/ (function(module, exports, __webpack_require__) {
  14894. "use strict";
  14895. Object.defineProperty(exports, "__esModule", {
  14896. value: true
  14897. });
  14898. exports.default = isEscaping;
  14899. var _globals = __webpack_require__(2);
  14900. var nextSymbolVariants = [_globals.backTick, _globals.doubleQuote, _globals.singleQuote];
  14901. function isEscaping(state) {
  14902. var nextSymbolCode = state.css.charCodeAt(state.pos + 1);
  14903. return state.symbolCode === _globals.tilde && nextSymbolVariants.indexOf(nextSymbolCode) >= 0;
  14904. }
  14905. module.exports = exports['default'];
  14906. /***/ }),
  14907. /* 114 */
  14908. /***/ (function(module, exports, __webpack_require__) {
  14909. "use strict";
  14910. Object.defineProperty(exports, "__esModule", {
  14911. value: true
  14912. });
  14913. exports.default = tokenizeAtRule;
  14914. var _globals = __webpack_require__(2);
  14915. var _unclosed = __webpack_require__(7);
  14916. var _unclosed2 = _interopRequireDefault(_unclosed);
  14917. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  14918. function tokenizeAtRule(state) {
  14919. // it's an interpolation
  14920. if (state.css.charCodeAt(state.pos + 1) === _globals.openedCurlyBracket) {
  14921. state.nextPos = state.css.indexOf('}', state.pos + 2);
  14922. if (state.nextPos === -1) {
  14923. (0, _unclosed2.default)(state, 'interpolation');
  14924. }
  14925. state.cssPart = state.css.slice(state.pos, state.nextPos + 1);
  14926. state.lines = state.cssPart.split('\n');
  14927. state.lastLine = state.lines.length - 1;
  14928. if (state.lastLine > 0) {
  14929. state.nextLine = state.line + state.lastLine;
  14930. state.nextOffset = state.nextPos - state.lines[state.lastLine].length;
  14931. } else {
  14932. state.nextLine = state.line;
  14933. state.nextOffset = state.offset;
  14934. }
  14935. state.tokens.push(['word', state.cssPart, state.line, state.pos - state.offset, state.nextLine, state.nextPos - state.nextOffset]);
  14936. state.offset = state.nextOffset;
  14937. state.line = state.nextLine;
  14938. } else {
  14939. _globals.atEndPattern.lastIndex = state.pos + 1;
  14940. _globals.atEndPattern.test(state.css);
  14941. if (_globals.atEndPattern.lastIndex === 0) {
  14942. state.nextPos = state.css.length - 1;
  14943. } else {
  14944. state.nextPos = _globals.atEndPattern.lastIndex - 2;
  14945. }
  14946. state.cssPart = state.css.slice(state.pos, state.nextPos + 1);
  14947. state.token = 'at-word';
  14948. // check if it's a variable
  14949. if (_globals.variablePattern.test(state.cssPart)) {
  14950. _globals.wordEndPattern.lastIndex = state.pos + 1;
  14951. _globals.wordEndPattern.test(state.css);
  14952. if (_globals.wordEndPattern.lastIndex === 0) {
  14953. state.nextPos = state.css.length - 1;
  14954. } else {
  14955. state.nextPos = _globals.wordEndPattern.lastIndex - 2;
  14956. }
  14957. state.cssPart = state.css.slice(state.pos, state.nextPos + 1);
  14958. state.token = 'word';
  14959. }
  14960. state.tokens.push([state.token, state.cssPart, state.line, state.pos - state.offset, state.line, state.nextPos - state.offset]);
  14961. }
  14962. state.pos = state.nextPos;
  14963. }
  14964. module.exports = exports['default'];
  14965. /***/ }),
  14966. /* 115 */
  14967. /***/ (function(module, exports, __webpack_require__) {
  14968. "use strict";
  14969. Object.defineProperty(exports, "__esModule", {
  14970. value: true
  14971. });
  14972. exports.default = tokenizeBackslash;
  14973. var _globals = __webpack_require__(2);
  14974. function tokenizeBackslash(state) {
  14975. state.nextPos = state.pos;
  14976. state.escape = true;
  14977. while (state.css.charCodeAt(state.nextPos + 1) === _globals.backslash) {
  14978. state.nextPos += 1;
  14979. state.escape = !state.escape;
  14980. }
  14981. state.symbolCode = state.css.charCodeAt(state.nextPos + 1);
  14982. if (state.escape && state.symbolCode !== _globals.slash && state.symbolCode !== _globals.space && state.symbolCode !== _globals.newline && state.symbolCode !== _globals.tab && state.symbolCode !== _globals.carriageReturn && state.symbolCode !== _globals.feed) {
  14983. state.nextPos += 1;
  14984. }
  14985. state.tokens.push(['word', state.css.slice(state.pos, state.nextPos + 1), state.line, state.pos - state.offset, state.line, state.nextPos - state.offset]);
  14986. state.pos = state.nextPos;
  14987. }
  14988. module.exports = exports['default'];
  14989. /***/ }),
  14990. /* 116 */
  14991. /***/ (function(module, exports, __webpack_require__) {
  14992. "use strict";
  14993. Object.defineProperty(exports, "__esModule", {
  14994. value: true
  14995. });
  14996. exports.default = tokenizeBasicSymbol;
  14997. function tokenizeBasicSymbol(state) {
  14998. state.tokens.push([state.symbol, state.symbol, state.line, state.pos - state.offset]);
  14999. }
  15000. module.exports = exports["default"];
  15001. /***/ }),
  15002. /* 117 */
  15003. /***/ (function(module, exports, __webpack_require__) {
  15004. "use strict";
  15005. Object.defineProperty(exports, "__esModule", {
  15006. value: true
  15007. });
  15008. exports.default = tokenizeComma;
  15009. function tokenizeComma(state) {
  15010. state.tokens.push(['word', state.symbol, state.line, state.pos - state.offset, state.line, state.pos - state.offset + 1]);
  15011. }
  15012. module.exports = exports['default'];
  15013. /***/ }),
  15014. /* 118 */
  15015. /***/ (function(module, exports, __webpack_require__) {
  15016. "use strict";
  15017. Object.defineProperty(exports, "__esModule", {
  15018. value: true
  15019. });
  15020. exports.default = tokenizeDefault;
  15021. var _globals = __webpack_require__(2);
  15022. var _findEndOfEscaping = __webpack_require__(112);
  15023. var _findEndOfEscaping2 = _interopRequireDefault(_findEndOfEscaping);
  15024. var _isEscaping = __webpack_require__(113);
  15025. var _isEscaping2 = _interopRequireDefault(_isEscaping);
  15026. var _tokenizeInlineComment = __webpack_require__(119);
  15027. var _tokenizeInlineComment2 = _interopRequireDefault(_tokenizeInlineComment);
  15028. var _tokenizeMultilineComment = __webpack_require__(120);
  15029. var _tokenizeMultilineComment2 = _interopRequireDefault(_tokenizeMultilineComment);
  15030. var _unclosed = __webpack_require__(7);
  15031. var _unclosed2 = _interopRequireDefault(_unclosed);
  15032. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  15033. function tokenizeDefault(state) {
  15034. var nextSymbolCode = state.css.charCodeAt(state.pos + 1);
  15035. if (state.symbolCode === _globals.slash && nextSymbolCode === _globals.asterisk) {
  15036. (0, _tokenizeMultilineComment2.default)(state);
  15037. } else if (state.symbolCode === _globals.slash && nextSymbolCode === _globals.slash) {
  15038. (0, _tokenizeInlineComment2.default)(state);
  15039. } else {
  15040. if ((0, _isEscaping2.default)(state)) {
  15041. var pos = (0, _findEndOfEscaping2.default)(state);
  15042. if (pos < 0) {
  15043. (0, _unclosed2.default)(state, 'escaping');
  15044. } else {
  15045. state.nextPos = pos;
  15046. }
  15047. } else {
  15048. _globals.wordEndPattern.lastIndex = state.pos + 1;
  15049. _globals.wordEndPattern.test(state.css);
  15050. if (_globals.wordEndPattern.lastIndex === 0) {
  15051. state.nextPos = state.css.length - 1;
  15052. } else {
  15053. state.nextPos = _globals.wordEndPattern.lastIndex - 2;
  15054. }
  15055. }
  15056. state.cssPart = state.css.slice(state.pos, state.nextPos + 1);
  15057. state.tokens.push(['word', state.cssPart, state.line, state.pos - state.offset, state.line, state.nextPos - state.offset]);
  15058. state.pos = state.nextPos;
  15059. }
  15060. }
  15061. module.exports = exports['default'];
  15062. /***/ }),
  15063. /* 119 */
  15064. /***/ (function(module, exports, __webpack_require__) {
  15065. "use strict";
  15066. Object.defineProperty(exports, "__esModule", {
  15067. value: true
  15068. });
  15069. exports.default = tokenizeInlineComment;
  15070. function tokenizeInlineComment(state) {
  15071. state.nextPos = state.css.indexOf('\n', state.pos + 2) - 1;
  15072. if (state.nextPos === -2) {
  15073. state.nextPos = state.css.length - 1;
  15074. }
  15075. state.tokens.push(['comment', state.css.slice(state.pos, state.nextPos + 1), state.line, state.pos - state.offset, state.line, state.nextPos - state.offset, 'inline']);
  15076. state.pos = state.nextPos;
  15077. }
  15078. module.exports = exports['default'];
  15079. /***/ }),
  15080. /* 120 */
  15081. /***/ (function(module, exports, __webpack_require__) {
  15082. "use strict";
  15083. Object.defineProperty(exports, "__esModule", {
  15084. value: true
  15085. });
  15086. exports.default = tokenizeMultilineComment;
  15087. var _unclosed = __webpack_require__(7);
  15088. var _unclosed2 = _interopRequireDefault(_unclosed);
  15089. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  15090. function tokenizeMultilineComment(state) {
  15091. state.nextPos = state.css.indexOf('*/', state.pos + 2) + 1;
  15092. if (state.nextPos === 0) {
  15093. (0, _unclosed2.default)(state, 'comment');
  15094. }
  15095. state.cssPart = state.css.slice(state.pos, state.nextPos + 1);
  15096. state.lines = state.cssPart.split('\n');
  15097. state.lastLine = state.lines.length - 1;
  15098. if (state.lastLine > 0) {
  15099. state.nextLine = state.line + state.lastLine;
  15100. state.nextOffset = state.nextPos - state.lines[state.lastLine].length;
  15101. } else {
  15102. state.nextLine = state.line;
  15103. state.nextOffset = state.offset;
  15104. }
  15105. state.tokens.push(['comment', state.cssPart, state.line, state.pos - state.offset, state.nextLine, state.nextPos - state.nextOffset]);
  15106. state.offset = state.nextOffset;
  15107. state.line = state.nextLine;
  15108. state.pos = state.nextPos;
  15109. }
  15110. module.exports = exports['default'];
  15111. /***/ }),
  15112. /* 121 */
  15113. /***/ (function(module, exports, __webpack_require__) {
  15114. "use strict";
  15115. Object.defineProperty(exports, "__esModule", {
  15116. value: true
  15117. });
  15118. exports.default = tokenizeOpenedParenthesis;
  15119. var _globals = __webpack_require__(2);
  15120. var _unclosed = __webpack_require__(7);
  15121. var _unclosed2 = _interopRequireDefault(_unclosed);
  15122. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  15123. function findClosedParenthesisPosition(css, length, start) {
  15124. var openedParenthesisCount = 0;
  15125. for (var i = start; i < length; i++) {
  15126. var symbol = css[i];
  15127. if (symbol === '(') {
  15128. openedParenthesisCount++;
  15129. } else if (symbol === ')') {
  15130. openedParenthesisCount--;
  15131. if (!openedParenthesisCount) {
  15132. return i;
  15133. }
  15134. }
  15135. }
  15136. return -1;
  15137. }
  15138. // it is not very reasonable to reduce complexity beyond this level
  15139. // eslint-disable-next-line complexity
  15140. function tokenizeOpenedParenthesis(state) {
  15141. var nextSymbolCode = state.css.charCodeAt(state.pos + 1);
  15142. var tokensCount = state.tokens.length;
  15143. var prevTokenCssPart = tokensCount ? state.tokens[tokensCount - 1][1] : '';
  15144. if (prevTokenCssPart === 'url' && nextSymbolCode !== _globals.singleQuote && nextSymbolCode !== _globals.doubleQuote && nextSymbolCode !== _globals.space && nextSymbolCode !== _globals.newline && nextSymbolCode !== _globals.tab && nextSymbolCode !== _globals.feed && nextSymbolCode !== _globals.carriageReturn) {
  15145. state.nextPos = state.pos;
  15146. do {
  15147. state.escaped = false;
  15148. state.nextPos = state.css.indexOf(')', state.nextPos + 1);
  15149. if (state.nextPos === -1) {
  15150. (0, _unclosed2.default)(state, 'bracket');
  15151. }
  15152. state.escapePos = state.nextPos;
  15153. while (state.css.charCodeAt(state.escapePos - 1) === _globals.backslash) {
  15154. state.escapePos -= 1;
  15155. state.escaped = !state.escaped;
  15156. }
  15157. } while (state.escaped);
  15158. state.tokens.push(['brackets', state.css.slice(state.pos, state.nextPos + 1), state.line, state.pos - state.offset, state.line, state.nextPos - state.offset]);
  15159. state.pos = state.nextPos;
  15160. } else {
  15161. state.nextPos = findClosedParenthesisPosition(state.css, state.length, state.pos);
  15162. state.cssPart = state.css.slice(state.pos, state.nextPos + 1);
  15163. var foundParam = state.cssPart.indexOf('@') >= 0;
  15164. var foundString = /['"]/.test(state.cssPart);
  15165. if (state.cssPart.length === 0 || state.cssPart === '...' || foundParam && !foundString) {
  15166. // we're dealing with a mixin param block
  15167. if (state.nextPos === -1) {
  15168. (0, _unclosed2.default)(state, 'bracket');
  15169. }
  15170. state.tokens.push([state.symbol, state.symbol, state.line, state.pos - state.offset]);
  15171. } else {
  15172. var badBracket = _globals.badBracketPattern.test(state.cssPart);
  15173. if (state.nextPos === -1 || badBracket) {
  15174. state.tokens.push([state.symbol, state.symbol, state.line, state.pos - state.offset]);
  15175. } else {
  15176. state.tokens.push(['brackets', state.cssPart, state.line, state.pos - state.offset, state.line, state.nextPos - state.offset]);
  15177. state.pos = state.nextPos;
  15178. }
  15179. }
  15180. }
  15181. }
  15182. module.exports = exports['default'];
  15183. /***/ }),
  15184. /* 122 */
  15185. /***/ (function(module, exports, __webpack_require__) {
  15186. "use strict";
  15187. Object.defineProperty(exports, "__esModule", {
  15188. value: true
  15189. });
  15190. exports.default = tokenizeQuotes;
  15191. var _globals = __webpack_require__(2);
  15192. var _unclosed = __webpack_require__(7);
  15193. var _unclosed2 = _interopRequireDefault(_unclosed);
  15194. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  15195. function tokenizeQuotes(state) {
  15196. state.nextPos = state.pos;
  15197. do {
  15198. state.escaped = false;
  15199. state.nextPos = state.css.indexOf(state.symbol, state.nextPos + 1);
  15200. if (state.nextPos === -1) {
  15201. (0, _unclosed2.default)(state, 'quote');
  15202. }
  15203. state.escapePos = state.nextPos;
  15204. while (state.css.charCodeAt(state.escapePos - 1) === _globals.backslash) {
  15205. state.escapePos -= 1;
  15206. state.escaped = !state.escaped;
  15207. }
  15208. } while (state.escaped);
  15209. state.tokens.push(['string', state.css.slice(state.pos, state.nextPos + 1), state.line, state.pos - state.offset, state.line, state.nextPos - state.offset]);
  15210. state.pos = state.nextPos;
  15211. }
  15212. module.exports = exports['default'];
  15213. /***/ }),
  15214. /* 123 */
  15215. /***/ (function(module, exports, __webpack_require__) {
  15216. "use strict";
  15217. Object.defineProperty(exports, "__esModule", {
  15218. value: true
  15219. });
  15220. exports.default = tokenizeSymbol;
  15221. var _globals = __webpack_require__(2);
  15222. var _tokenizeAtRule = __webpack_require__(114);
  15223. var _tokenizeAtRule2 = _interopRequireDefault(_tokenizeAtRule);
  15224. var _tokenizeBackslash = __webpack_require__(115);
  15225. var _tokenizeBackslash2 = _interopRequireDefault(_tokenizeBackslash);
  15226. var _tokenizeBasicSymbol = __webpack_require__(116);
  15227. var _tokenizeBasicSymbol2 = _interopRequireDefault(_tokenizeBasicSymbol);
  15228. var _tokenizeComma = __webpack_require__(117);
  15229. var _tokenizeComma2 = _interopRequireDefault(_tokenizeComma);
  15230. var _tokenizeDefault = __webpack_require__(118);
  15231. var _tokenizeDefault2 = _interopRequireDefault(_tokenizeDefault);
  15232. var _tokenizeOpenedParenthesis = __webpack_require__(121);
  15233. var _tokenizeOpenedParenthesis2 = _interopRequireDefault(_tokenizeOpenedParenthesis);
  15234. var _tokenizeQuotes = __webpack_require__(122);
  15235. var _tokenizeQuotes2 = _interopRequireDefault(_tokenizeQuotes);
  15236. var _tokenizeWhitespace = __webpack_require__(124);
  15237. var _tokenizeWhitespace2 = _interopRequireDefault(_tokenizeWhitespace);
  15238. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  15239. // we cannot reduce complexity beyond this level
  15240. // eslint-disable-next-line complexity
  15241. function tokenizeSymbol(state) {
  15242. switch (state.symbolCode) {
  15243. case _globals.newline:
  15244. case _globals.space:
  15245. case _globals.tab:
  15246. case _globals.carriageReturn:
  15247. case _globals.feed:
  15248. (0, _tokenizeWhitespace2.default)(state);
  15249. break;
  15250. case _globals.comma:
  15251. (0, _tokenizeComma2.default)(state);
  15252. break;
  15253. case _globals.colon:
  15254. case _globals.semicolon:
  15255. case _globals.openedCurlyBracket:
  15256. case _globals.closedCurlyBracket:
  15257. case _globals.closedParenthesis:
  15258. case _globals.openSquareBracket:
  15259. case _globals.closeSquareBracket:
  15260. (0, _tokenizeBasicSymbol2.default)(state);
  15261. break;
  15262. case _globals.openedParenthesis:
  15263. (0, _tokenizeOpenedParenthesis2.default)(state);
  15264. break;
  15265. case _globals.singleQuote:
  15266. case _globals.doubleQuote:
  15267. (0, _tokenizeQuotes2.default)(state);
  15268. break;
  15269. case _globals.atRule:
  15270. (0, _tokenizeAtRule2.default)(state);
  15271. break;
  15272. case _globals.backslash:
  15273. (0, _tokenizeBackslash2.default)(state);
  15274. break;
  15275. default:
  15276. (0, _tokenizeDefault2.default)(state);
  15277. break;
  15278. }
  15279. }
  15280. module.exports = exports['default'];
  15281. /***/ }),
  15282. /* 124 */
  15283. /***/ (function(module, exports, __webpack_require__) {
  15284. "use strict";
  15285. Object.defineProperty(exports, "__esModule", {
  15286. value: true
  15287. });
  15288. exports.default = tokenizeWhitespace;
  15289. var _globals = __webpack_require__(2);
  15290. function tokenizeWhitespace(state) {
  15291. state.nextPos = state.pos;
  15292. // collect all neighbour space symbols
  15293. do {
  15294. state.nextPos += 1;
  15295. state.symbolCode = state.css.charCodeAt(state.nextPos);
  15296. if (state.symbolCode === _globals.newline) {
  15297. state.offset = state.nextPos;
  15298. state.line += 1;
  15299. }
  15300. } while (state.symbolCode === _globals.space || state.symbolCode === _globals.newline || state.symbolCode === _globals.tab || state.symbolCode === _globals.carriageReturn || state.symbolCode === _globals.feed);
  15301. state.tokens.push(['space', state.css.slice(state.pos, state.nextPos)]);
  15302. state.pos = state.nextPos - 1;
  15303. }
  15304. module.exports = exports['default'];
  15305. /***/ }),
  15306. /* 125 */
  15307. /***/ (function(module, exports, __webpack_require__) {
  15308. "use strict";
  15309. Object.defineProperty(exports, "__esModule", {
  15310. value: true
  15311. });
  15312. exports.parseMediaFeature = parseMediaFeature;
  15313. exports.parseMediaQuery = parseMediaQuery;
  15314. exports.parseMediaList = parseMediaList;
  15315. var _Node = __webpack_require__(37);
  15316. var _Node2 = _interopRequireDefault(_Node);
  15317. var _Container = __webpack_require__(36);
  15318. var _Container2 = _interopRequireDefault(_Container);
  15319. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  15320. /**
  15321. * Parses a media feature expression, e.g. `max-width: 10px`, `(color)`
  15322. *
  15323. * @param {string} string - the source expression string, can be inside parens
  15324. * @param {Number} index - the index of `string` in the overall input
  15325. *
  15326. * @return {Array} an array of Nodes, the first element being a media feature,
  15327. * the secont - its value (may be missing)
  15328. */
  15329. function parseMediaFeature(string) {
  15330. var index = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];
  15331. var modesEntered = [{
  15332. mode: 'normal',
  15333. character: null
  15334. }];
  15335. var result = [];
  15336. var lastModeIndex = 0;
  15337. var mediaFeature = '';
  15338. var colon = null;
  15339. var mediaFeatureValue = null;
  15340. var indexLocal = index;
  15341. var stringNormalized = string;
  15342. // Strip trailing parens (if any), and correct the starting index
  15343. if (string[0] === '(' && string[string.length - 1] === ')') {
  15344. stringNormalized = string.substring(1, string.length - 1);
  15345. indexLocal++;
  15346. }
  15347. for (var i = 0; i < stringNormalized.length; i++) {
  15348. var character = stringNormalized[i];
  15349. // If entering/exiting a string
  15350. if (character === '\'' || character === '"') {
  15351. if (modesEntered[lastModeIndex].isCalculationEnabled === true) {
  15352. modesEntered.push({
  15353. mode: 'string',
  15354. isCalculationEnabled: false,
  15355. character: character
  15356. });
  15357. lastModeIndex++;
  15358. } else if (modesEntered[lastModeIndex].mode === 'string' && modesEntered[lastModeIndex].character === character && stringNormalized[i - 1] !== '\\') {
  15359. modesEntered.pop();
  15360. lastModeIndex--;
  15361. }
  15362. }
  15363. // If entering/exiting interpolation
  15364. if (character === '{') {
  15365. modesEntered.push({
  15366. mode: 'interpolation',
  15367. isCalculationEnabled: true
  15368. });
  15369. lastModeIndex++;
  15370. } else if (character === '}') {
  15371. modesEntered.pop();
  15372. lastModeIndex--;
  15373. }
  15374. // If a : is met outside of a string, function call or interpolation, than
  15375. // this : separates a media feature and a value
  15376. if (modesEntered[lastModeIndex].mode === 'normal' && character === ':') {
  15377. var mediaFeatureValueStr = stringNormalized.substring(i + 1);
  15378. mediaFeatureValue = {
  15379. type: 'value',
  15380. before: /^(\s*)/.exec(mediaFeatureValueStr)[1],
  15381. after: /(\s*)$/.exec(mediaFeatureValueStr)[1],
  15382. value: mediaFeatureValueStr.trim()
  15383. };
  15384. // +1 for the colon
  15385. mediaFeatureValue.sourceIndex = mediaFeatureValue.before.length + i + 1 + indexLocal;
  15386. colon = {
  15387. type: 'colon',
  15388. sourceIndex: i + indexLocal,
  15389. after: mediaFeatureValue.before,
  15390. value: ':' };
  15391. break;
  15392. }
  15393. mediaFeature += character;
  15394. }
  15395. // Forming a media feature node
  15396. mediaFeature = {
  15397. type: 'media-feature',
  15398. before: /^(\s*)/.exec(mediaFeature)[1],
  15399. after: /(\s*)$/.exec(mediaFeature)[1],
  15400. value: mediaFeature.trim()
  15401. };
  15402. mediaFeature.sourceIndex = mediaFeature.before.length + indexLocal;
  15403. result.push(mediaFeature);
  15404. if (colon !== null) {
  15405. colon.before = mediaFeature.after;
  15406. result.push(colon);
  15407. }
  15408. if (mediaFeatureValue !== null) {
  15409. result.push(mediaFeatureValue);
  15410. }
  15411. return result;
  15412. }
  15413. /**
  15414. * Parses a media query, e.g. `screen and (color)`, `only tv`
  15415. *
  15416. * @param {string} string - the source media query string
  15417. * @param {Number} index - the index of `string` in the overall input
  15418. *
  15419. * @return {Array} an array of Nodes and Containers
  15420. */
  15421. function parseMediaQuery(string) {
  15422. var index = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];
  15423. var result = [];
  15424. // How many timies the parser entered parens/curly braces
  15425. var localLevel = 0;
  15426. // Has any keyword, media type, media feature expression or interpolation
  15427. // ('element' hereafter) started
  15428. var insideSomeValue = false;
  15429. var node = void 0;
  15430. function resetNode() {
  15431. return {
  15432. before: '',
  15433. after: '',
  15434. value: ''
  15435. };
  15436. }
  15437. node = resetNode();
  15438. for (var i = 0; i < string.length; i++) {
  15439. var character = string[i];
  15440. // If not yet entered any element
  15441. if (!insideSomeValue) {
  15442. if (character.search(/\s/) !== -1) {
  15443. // A whitespace
  15444. // Don't form 'after' yet; will do it later
  15445. node.before += character;
  15446. } else {
  15447. // Not a whitespace - entering an element
  15448. // Expression start
  15449. if (character === '(') {
  15450. node.type = 'media-feature-expression';
  15451. localLevel++;
  15452. }
  15453. node.value = character;
  15454. node.sourceIndex = index + i;
  15455. insideSomeValue = true;
  15456. }
  15457. } else {
  15458. // Already in the middle of some alement
  15459. node.value += character;
  15460. // Here parens just increase localLevel and don't trigger a start of
  15461. // a media feature expression (since they can't be nested)
  15462. // Interpolation start
  15463. if (character === '{' || character === '(') {
  15464. localLevel++;
  15465. }
  15466. // Interpolation/function call/media feature expression end
  15467. if (character === ')' || character === '}') {
  15468. localLevel--;
  15469. }
  15470. }
  15471. // If exited all parens/curlies and the next symbol
  15472. if (insideSomeValue && localLevel === 0 && (character === ')' || i === string.length - 1 || string[i + 1].search(/\s/) !== -1)) {
  15473. if (['not', 'only', 'and'].indexOf(node.value) !== -1) {
  15474. node.type = 'keyword';
  15475. }
  15476. // if it's an expression, parse its contents
  15477. if (node.type === 'media-feature-expression') {
  15478. node.nodes = parseMediaFeature(node.value, node.sourceIndex);
  15479. }
  15480. result.push(Array.isArray(node.nodes) ? new _Container2.default(node) : new _Node2.default(node));
  15481. node = resetNode();
  15482. insideSomeValue = false;
  15483. }
  15484. }
  15485. // Now process the result array - to specify undefined types of the nodes
  15486. // and specify the `after` prop
  15487. for (var _i = 0; _i < result.length; _i++) {
  15488. node = result[_i];
  15489. if (_i > 0) {
  15490. result[_i - 1].after = node.before;
  15491. }
  15492. // Node types. Might not be set because contains interpolation/function
  15493. // calls or fully consists of them
  15494. if (node.type === undefined) {
  15495. if (_i > 0) {
  15496. // only `and` can follow an expression
  15497. if (result[_i - 1].type === 'media-feature-expression') {
  15498. node.type = 'keyword';
  15499. continue;
  15500. }
  15501. // Anything after 'only|not' is a media type
  15502. if (result[_i - 1].value === 'not' || result[_i - 1].value === 'only') {
  15503. node.type = 'media-type';
  15504. continue;
  15505. }
  15506. // Anything after 'and' is an expression
  15507. if (result[_i - 1].value === 'and') {
  15508. node.type = 'media-feature-expression';
  15509. continue;
  15510. }
  15511. if (result[_i - 1].type === 'media-type') {
  15512. // if it is the last element - it might be an expression
  15513. // or 'and' depending on what is after it
  15514. if (!result[_i + 1]) {
  15515. node.type = 'media-feature-expression';
  15516. } else {
  15517. node.type = result[_i + 1].type === 'media-feature-expression' ? 'keyword' : 'media-feature-expression';
  15518. }
  15519. }
  15520. }
  15521. if (_i === 0) {
  15522. // `screen`, `fn( ... )`, `#{ ... }`. Not an expression, since then
  15523. // its type would have been set by now
  15524. if (!result[_i + 1]) {
  15525. node.type = 'media-type';
  15526. continue;
  15527. }
  15528. // `screen and` or `#{...} (max-width: 10px)`
  15529. if (result[_i + 1] && (result[_i + 1].type === 'media-feature-expression' || result[_i + 1].type === 'keyword')) {
  15530. node.type = 'media-type';
  15531. continue;
  15532. }
  15533. if (result[_i + 2]) {
  15534. // `screen and (color) ...`
  15535. if (result[_i + 2].type === 'media-feature-expression') {
  15536. node.type = 'media-type';
  15537. result[_i + 1].type = 'keyword';
  15538. continue;
  15539. }
  15540. // `only screen and ...`
  15541. if (result[_i + 2].type === 'keyword') {
  15542. node.type = 'keyword';
  15543. result[_i + 1].type = 'media-type';
  15544. continue;
  15545. }
  15546. }
  15547. if (result[_i + 3]) {
  15548. // `screen and (color) ...`
  15549. if (result[_i + 3].type === 'media-feature-expression') {
  15550. node.type = 'keyword';
  15551. result[_i + 1].type = 'media-type';
  15552. result[_i + 2].type = 'keyword';
  15553. continue;
  15554. }
  15555. }
  15556. }
  15557. }
  15558. }
  15559. return result;
  15560. }
  15561. /**
  15562. * Parses a media query list. Takes a possible `url()` at the start into
  15563. * account, and divides the list into media queries that are parsed separately
  15564. *
  15565. * @param {string} string - the source media query list string
  15566. *
  15567. * @return {Array} an array of Nodes/Containers
  15568. */
  15569. function parseMediaList(string) {
  15570. var result = [];
  15571. var interimIndex = 0;
  15572. var levelLocal = 0;
  15573. // Check for a `url(...)` part (if it is contents of an @import rule)
  15574. var doesHaveUrl = /^(\s*)url\s*\(/.exec(string);
  15575. if (doesHaveUrl !== null) {
  15576. var i = doesHaveUrl[0].length;
  15577. var parenthesesLv = 1;
  15578. while (parenthesesLv > 0) {
  15579. var character = string[i];
  15580. if (character === '(') {
  15581. parenthesesLv++;
  15582. }
  15583. if (character === ')') {
  15584. parenthesesLv--;
  15585. }
  15586. i++;
  15587. }
  15588. result.unshift(new _Node2.default({
  15589. type: 'url',
  15590. value: string.substring(0, i).trim(),
  15591. sourceIndex: doesHaveUrl[1].length,
  15592. before: doesHaveUrl[1],
  15593. after: /^(\s*)/.exec(string.substring(i))[1]
  15594. }));
  15595. interimIndex = i;
  15596. }
  15597. // Start processing the media query list
  15598. for (var _i2 = interimIndex; _i2 < string.length; _i2++) {
  15599. var _character = string[_i2];
  15600. // Dividing the media query list into comma-separated media queries
  15601. // Only count commas that are outside of any parens
  15602. // (i.e., not part of function call params list, etc.)
  15603. if (_character === '(') {
  15604. levelLocal++;
  15605. }
  15606. if (_character === ')') {
  15607. levelLocal--;
  15608. }
  15609. if (levelLocal === 0 && _character === ',') {
  15610. var _mediaQueryString = string.substring(interimIndex, _i2);
  15611. var _spaceBefore = /^(\s*)/.exec(_mediaQueryString)[1];
  15612. result.push(new _Container2.default({
  15613. type: 'media-query',
  15614. value: _mediaQueryString.trim(),
  15615. sourceIndex: interimIndex + _spaceBefore.length,
  15616. nodes: parseMediaQuery(_mediaQueryString, interimIndex),
  15617. before: _spaceBefore,
  15618. after: /(\s*)$/.exec(_mediaQueryString)[1]
  15619. }));
  15620. interimIndex = _i2 + 1;
  15621. }
  15622. }
  15623. var mediaQueryString = string.substring(interimIndex);
  15624. var spaceBefore = /^(\s*)/.exec(mediaQueryString)[1];
  15625. result.push(new _Container2.default({
  15626. type: 'media-query',
  15627. value: mediaQueryString.trim(),
  15628. sourceIndex: interimIndex + spaceBefore.length,
  15629. nodes: parseMediaQuery(mediaQueryString, interimIndex),
  15630. before: spaceBefore,
  15631. after: /(\s*)$/.exec(mediaQueryString)[1]
  15632. }));
  15633. return result;
  15634. }
  15635. /***/ }),
  15636. /* 126 */
  15637. /***/ (function(module, exports, __webpack_require__) {
  15638. "use strict";
  15639. exports.__esModule = true;
  15640. var _container = __webpack_require__(13);
  15641. var _container2 = _interopRequireDefault(_container);
  15642. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  15643. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15644. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  15645. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  15646. var NestedDeclaration = function (_Container) {
  15647. _inherits(NestedDeclaration, _Container);
  15648. function NestedDeclaration(defaults) {
  15649. _classCallCheck(this, NestedDeclaration);
  15650. var _this = _possibleConstructorReturn(this, _Container.call(this, defaults));
  15651. _this.type = 'decl';
  15652. _this.isNested = true;
  15653. if (!_this.nodes) _this.nodes = [];
  15654. return _this;
  15655. }
  15656. return NestedDeclaration;
  15657. }(_container2.default);
  15658. exports.default = NestedDeclaration;
  15659. module.exports = exports['default'];
  15660. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5lc3RlZC1kZWNsYXJhdGlvbi5lczYiXSwibmFtZXMiOlsiTmVzdGVkRGVjbGFyYXRpb24iLCJkZWZhdWx0cyIsInR5cGUiLCJpc05lc3RlZCIsIm5vZGVzIl0sIm1hcHBpbmdzIjoiOzs7O0FBQUE7Ozs7Ozs7Ozs7OztJQUVNQSxpQjs7O0FBRUYsK0JBQVlDLFFBQVosRUFBc0I7QUFBQTs7QUFBQSxxREFDbEIsc0JBQU1BLFFBQU4sQ0FEa0I7O0FBRWxCLGNBQUtDLElBQUwsR0FBZ0IsTUFBaEI7QUFDQSxjQUFLQyxRQUFMLEdBQWdCLElBQWhCO0FBQ0EsWUFBSyxDQUFDLE1BQUtDLEtBQVgsRUFBbUIsTUFBS0EsS0FBTCxHQUFhLEVBQWI7QUFKRDtBQUtyQjs7Ozs7a0JBSVVKLGlCIiwiZmlsZSI6Im5lc3RlZC1kZWNsYXJhdGlvbi5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBDb250YWluZXIgZnJvbSAncG9zdGNzcy9saWIvY29udGFpbmVyJztcblxuY2xhc3MgTmVzdGVkRGVjbGFyYXRpb24gZXh0ZW5kcyBDb250YWluZXIge1xuXG4gICAgY29uc3RydWN0b3IoZGVmYXVsdHMpIHtcbiAgICAgICAgc3VwZXIoZGVmYXVsdHMpO1xuICAgICAgICB0aGlzLnR5cGUgICAgID0gJ2RlY2wnO1xuICAgICAgICB0aGlzLmlzTmVzdGVkID0gdHJ1ZTtcbiAgICAgICAgaWYgKCAhdGhpcy5ub2RlcyApIHRoaXMubm9kZXMgPSBbXTtcbiAgICB9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgTmVzdGVkRGVjbGFyYXRpb247XG4iXX0=
  15661. /***/ }),
  15662. /* 127 */
  15663. /***/ (function(module, exports, __webpack_require__) {
  15664. "use strict";
  15665. exports.__esModule = true;
  15666. exports.default = scssParse;
  15667. var _input = __webpack_require__(18);
  15668. var _input2 = _interopRequireDefault(_input);
  15669. var _scssParser = __webpack_require__(128);
  15670. var _scssParser2 = _interopRequireDefault(_scssParser);
  15671. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  15672. function scssParse(scss, opts) {
  15673. var input = new _input2.default(scss, opts);
  15674. var parser = new _scssParser2.default(input);
  15675. parser.parse();
  15676. return parser.root;
  15677. }
  15678. module.exports = exports['default'];
  15679. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjc3MtcGFyc2UuZXM2Il0sIm5hbWVzIjpbInNjc3NQYXJzZSIsInNjc3MiLCJvcHRzIiwiaW5wdXQiLCJwYXJzZXIiLCJwYXJzZSIsInJvb3QiXSwibWFwcGluZ3MiOiI7OztrQkFJd0JBLFM7O0FBSnhCOzs7O0FBRUE7Ozs7OztBQUVlLFNBQVNBLFNBQVQsQ0FBbUJDLElBQW5CLEVBQXlCQyxJQUF6QixFQUErQjtBQUMxQyxRQUFJQyxRQUFRLG9CQUFVRixJQUFWLEVBQWdCQyxJQUFoQixDQUFaOztBQUVBLFFBQUlFLFNBQVMseUJBQWVELEtBQWYsQ0FBYjtBQUNBQyxXQUFPQyxLQUFQOztBQUVBLFdBQU9ELE9BQU9FLElBQWQ7QUFDSCIsImZpbGUiOiJzY3NzLXBhcnNlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IElucHV0IGZyb20gJ3Bvc3Rjc3MvbGliL2lucHV0JztcblxuaW1wb3J0IFNjc3NQYXJzZXIgZnJvbSAnLi9zY3NzLXBhcnNlcic7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIHNjc3NQYXJzZShzY3NzLCBvcHRzKSB7XG4gICAgbGV0IGlucHV0ID0gbmV3IElucHV0KHNjc3MsIG9wdHMpO1xuXG4gICAgbGV0IHBhcnNlciA9IG5ldyBTY3NzUGFyc2VyKGlucHV0KTtcbiAgICBwYXJzZXIucGFyc2UoKTtcblxuICAgIHJldHVybiBwYXJzZXIucm9vdDtcbn1cbiJdfQ==
  15680. /***/ }),
  15681. /* 128 */
  15682. /***/ (function(module, exports, __webpack_require__) {
  15683. "use strict";
  15684. exports.__esModule = true;
  15685. var _comment = __webpack_require__(17);
  15686. var _comment2 = _interopRequireDefault(_comment);
  15687. var _parser = __webpack_require__(42);
  15688. var _parser2 = _interopRequireDefault(_parser);
  15689. var _nestedDeclaration = __webpack_require__(126);
  15690. var _nestedDeclaration2 = _interopRequireDefault(_nestedDeclaration);
  15691. var _scssTokenize = __webpack_require__(131);
  15692. var _scssTokenize2 = _interopRequireDefault(_scssTokenize);
  15693. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  15694. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15695. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  15696. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  15697. var ScssParser = function (_Parser) {
  15698. _inherits(ScssParser, _Parser);
  15699. function ScssParser() {
  15700. _classCallCheck(this, ScssParser);
  15701. return _possibleConstructorReturn(this, _Parser.apply(this, arguments));
  15702. }
  15703. ScssParser.prototype.createTokenizer = function createTokenizer() {
  15704. this.tokenizer = (0, _scssTokenize2.default)(this.input);
  15705. };
  15706. ScssParser.prototype.rule = function rule(tokens) {
  15707. var withColon = false;
  15708. var brackets = 0;
  15709. var value = '';
  15710. for (var _iterator = tokens, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  15711. var _ref;
  15712. if (_isArray) {
  15713. if (_i >= _iterator.length) break;
  15714. _ref = _iterator[_i++];
  15715. } else {
  15716. _i = _iterator.next();
  15717. if (_i.done) break;
  15718. _ref = _i.value;
  15719. }
  15720. var i = _ref;
  15721. if (withColon) {
  15722. if (i[0] !== 'comment' && i[0] !== '{') {
  15723. value += i[1];
  15724. }
  15725. } else if (i[0] === 'space' && i[1].indexOf('\n') !== -1) {
  15726. break;
  15727. } else if (i[0] === '(') {
  15728. brackets += 1;
  15729. } else if (i[0] === ')') {
  15730. brackets -= 1;
  15731. } else if (brackets === 0 && i[0] === ':') {
  15732. withColon = true;
  15733. }
  15734. }
  15735. if (!withColon || value.trim() === '' || /^[a-zA-Z-:#]/.test(value)) {
  15736. _Parser.prototype.rule.call(this, tokens);
  15737. } else {
  15738. tokens.pop();
  15739. var node = new _nestedDeclaration2.default();
  15740. this.init(node);
  15741. var last = tokens[tokens.length - 1];
  15742. if (last[4]) {
  15743. node.source.end = { line: last[4], column: last[5] };
  15744. } else {
  15745. node.source.end = { line: last[2], column: last[3] };
  15746. }
  15747. while (tokens[0][0] !== 'word') {
  15748. node.raws.before += tokens.shift()[1];
  15749. }
  15750. node.source.start = { line: tokens[0][2], column: tokens[0][3] };
  15751. node.prop = '';
  15752. while (tokens.length) {
  15753. var type = tokens[0][0];
  15754. if (type === ':' || type === 'space' || type === 'comment') {
  15755. break;
  15756. }
  15757. node.prop += tokens.shift()[1];
  15758. }
  15759. node.raws.between = '';
  15760. var token = void 0;
  15761. while (tokens.length) {
  15762. token = tokens.shift();
  15763. if (token[0] === ':') {
  15764. node.raws.between += token[1];
  15765. break;
  15766. } else {
  15767. node.raws.between += token[1];
  15768. }
  15769. }
  15770. if (node.prop[0] === '_' || node.prop[0] === '*') {
  15771. node.raws.before += node.prop[0];
  15772. node.prop = node.prop.slice(1);
  15773. }
  15774. node.raws.between += this.spacesAndCommentsFromStart(tokens);
  15775. this.precheckMissedSemicolon(tokens);
  15776. for (var _i2 = tokens.length - 1; _i2 > 0; _i2--) {
  15777. token = tokens[_i2];
  15778. if (token[1] === '!important') {
  15779. node.important = true;
  15780. var string = this.stringFrom(tokens, _i2);
  15781. string = this.spacesFromEnd(tokens) + string;
  15782. if (string !== ' !important') {
  15783. node.raws.important = string;
  15784. }
  15785. break;
  15786. } else if (token[1] === 'important') {
  15787. var cache = tokens.slice(0);
  15788. var str = '';
  15789. for (var j = _i2; j > 0; j--) {
  15790. var _type = cache[j][0];
  15791. if (str.trim().indexOf('!') === 0 && _type !== 'space') {
  15792. break;
  15793. }
  15794. str = cache.pop()[1] + str;
  15795. }
  15796. if (str.trim().indexOf('!') === 0) {
  15797. node.important = true;
  15798. node.raws.important = str;
  15799. tokens = cache;
  15800. }
  15801. }
  15802. if (token[0] !== 'space' && token[0] !== 'comment') {
  15803. break;
  15804. }
  15805. }
  15806. this.raw(node, 'value', tokens);
  15807. if (node.value.indexOf(':') !== -1) {
  15808. this.checkMissedSemicolon(tokens);
  15809. }
  15810. this.current = node;
  15811. }
  15812. };
  15813. ScssParser.prototype.comment = function comment(token) {
  15814. if (token[6] === 'inline') {
  15815. var node = new _comment2.default();
  15816. this.init(node, token[2], token[3]);
  15817. node.raws.inline = true;
  15818. node.source.end = { line: token[4], column: token[5] };
  15819. var text = token[1].slice(2);
  15820. if (/^\s*$/.test(text)) {
  15821. node.text = '';
  15822. node.raws.left = text;
  15823. node.raws.right = '';
  15824. } else {
  15825. var match = text.match(/^(\s*)([^]*[^\s])(\s*)$/);
  15826. var fixed = match[2].replace(/(\*\/|\/\*)/g, '*//*');
  15827. node.text = fixed;
  15828. node.raws.left = match[1];
  15829. node.raws.right = match[3];
  15830. node.raws.text = match[2];
  15831. }
  15832. } else {
  15833. _Parser.prototype.comment.call(this, token);
  15834. }
  15835. };
  15836. ScssParser.prototype.raw = function raw(node, prop, tokens) {
  15837. _Parser.prototype.raw.call(this, node, prop, tokens);
  15838. if (node.raws[prop]) {
  15839. var scss = node.raws[prop].raw;
  15840. node.raws[prop].raw = tokens.reduce(function (all, i) {
  15841. if (i[0] === 'comment' && i[6] === 'inline') {
  15842. var text = i[1].slice(2).replace(/(\*\/|\/\*)/g, '*//*');
  15843. return all + '/*' + text + '*/';
  15844. } else {
  15845. return all + i[1];
  15846. }
  15847. }, '');
  15848. if (scss !== node.raws[prop].raw) {
  15849. node.raws[prop].scss = scss;
  15850. }
  15851. }
  15852. };
  15853. return ScssParser;
  15854. }(_parser2.default);
  15855. exports.default = ScssParser;
  15856. module.exports = exports['default'];
  15857. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjc3MtcGFyc2VyLmVzNiJdLCJuYW1lcyI6WyJTY3NzUGFyc2VyIiwiY3JlYXRlVG9rZW5pemVyIiwidG9rZW5pemVyIiwiaW5wdXQiLCJydWxlIiwidG9rZW5zIiwid2l0aENvbG9uIiwiYnJhY2tldHMiLCJ2YWx1ZSIsImkiLCJpbmRleE9mIiwidHJpbSIsInRlc3QiLCJwb3AiLCJub2RlIiwiaW5pdCIsImxhc3QiLCJsZW5ndGgiLCJzb3VyY2UiLCJlbmQiLCJsaW5lIiwiY29sdW1uIiwicmF3cyIsImJlZm9yZSIsInNoaWZ0Iiwic3RhcnQiLCJwcm9wIiwidHlwZSIsImJldHdlZW4iLCJ0b2tlbiIsInNsaWNlIiwic3BhY2VzQW5kQ29tbWVudHNGcm9tU3RhcnQiLCJwcmVjaGVja01pc3NlZFNlbWljb2xvbiIsImltcG9ydGFudCIsInN0cmluZyIsInN0cmluZ0Zyb20iLCJzcGFjZXNGcm9tRW5kIiwiY2FjaGUiLCJzdHIiLCJqIiwicmF3IiwiY2hlY2tNaXNzZWRTZ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RGVjbGFyYXRpb24gZnJvbSAnLi9uZXN0ZWQtZGVjbGFyYXRpb24nO1xuaW1wb3J0IHNjc3NUb2tlbml6ZXIgICAgIGZyb20gJy4vc2Nzcy10b2tlbml6ZSc7XG5cbmV4cG9ydCBkZWZhdWx0IGNsYXNzIFNjc3NQYXJzZXIgZXh0ZW5kcyBQYXJzZXIge1xuXG4gICAgY3JlYXRlVG9rZW5pemVyKCkge1xuICAgICAgICB0aGlzLnRva2VuaXplciA9IHNjc3NUb2tlbml6ZXIodGhpcy5pbnB1dCk7XG4gICAgfVxuXG4gICAgcnVsZSh0b2tlbnMpIHtcbiAgICAgICAgbGV0IHdpdGhDb2xvbiA9IGZhbHNlO1xuICAgICAgICBsZXQgYnJhY2tldHMgID0gMDtcbiAgICAgICAgbGV0IHZhbHVlICAgICA9ICcnO1xuICAgICAgICBmb3IgKCBsZXQgaSBvZiB0b2tlbnMgKSB7XG4gICAgICAgICAgICBpZiAoIHdpdGhDb2xvbiApIHtcbiAgICAgICAgICAgICAgICBpZiAoIGlbMF0gIT09ICdjb21tZW50JyAmJiBpWzBdICE9PSAneycgKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlICs9IGlbMV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmICggaVswXSA9PT0gJ3NwYWNlJyAmJiBpWzFdLmluZGV4T2YoJ1xcbicpICE9PSAtMSApIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIGlbMF0gPT09ICcoJyApIHtcbiAgICAgICAgICAgICAgICBicmFja2V0cyArPSAxO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggaVswXSA9PT0gJyknICkge1xuICAgICAgICAgICAgICAgIGJyYWNrZXRzIC09IDE7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBicmFja2V0cyA9PT0gMCAmJiBpWzBdID09PSAnOicgKSB7XG4gICAgICAgICAgICAgICAgd2l0aENvbG9uID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICggIXdpdGhDb2xvbiB8fCB2YWx1ZS50cmltKCkgPT09ICcnIHx8IC9eW2EtekEtWi06I10vLnRlc3QodmFsdWUpICkge1xuICAgICAgICAgICAgc3VwZXIucnVsZSh0b2tlbnMpO1xuICAgICAgICB9IGVsc2Uge1xuXG4gICAgICAgICAgICB0b2tlbnMucG9wKCk7XG4gICAgICAgICAgICBsZXQgbm9kZSA9IG5ldyBOZXN0ZWREZWNsYXJhdGlvbigpO1xuICAgICAgICAgICAgdGhpcy5pbml0KG5vZGUpO1xuXG4gICAgICAgICAgICBsZXQgbGFzdCA9IHRva2Vuc1t0b2tlbnMubGVuZ3RoIC0gMV07XG4gICAgICAgICAgICBpZiAobGFzdFs0XSkge1xuICAgICAgICAgICAgICAgIG5vZGUuc291cmNlLmVuZCA9IHsgbGluZTogbGFzdFs0XSwgY29sdW1uOiBsYXN0WzVdIH07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG5vZGUuc291cmNlLmVuZCA9IHsgbGluZTogbGFzdFsyXSwgY29sdW1uOiBsYXN0WzNdIH07XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHdoaWxlICh0b2tlbnNbMF1bMF0gIT09ICd3b3JkJykge1xuICAgICAgICAgICAgICAgIG5vZGUucmF3cy5iZWZvcmUgKz0gdG9rZW5zLnNoaWZ0KClbMV07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBub2RlLnNvdXJjZS5zdGFydCA9IHsgbGluZTogdG9rZW5zWzBdWzJdLCBjb2x1bW46IHRva2Vuc1swXVszXSB9O1xuXG4gICAgICAgICAgICBub2RlLnByb3AgPSAnJztcbiAgICAgICAgICAgIHdoaWxlICh0b2tlbnMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgbGV0IHR5cGUgPSB0b2tlbnNbMF1bMF07XG4gICAgICAgICAgICAgICAgaWYgKHR5cGUgPT09ICc6JyB8fCB0eXBlID09PSAnc3BhY2UnIHx8IHR5cGUgPT09ICdjb21tZW50Jykge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbm9kZS5wcm9wICs9IHRva2Vucy5zaGlmdCgpWzFdO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiA9ICcnO1xuXG4gICAgICAgICAgICBsZXQgdG9rZW47XG4gICAgICAgICAgICB3aGlsZSAodG9rZW5zLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHRva2VuID0gdG9rZW5zLnNoaWZ0KCk7XG5cbiAgICAgICAgICAgICAgICBpZiAodG9rZW5bMF0gPT09ICc6Jykge1xuICAgICAgICAgICAgICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiArPSB0b2tlblsxXTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5yYXdzLmJldHdlZW4gKz0gdG9rZW5bMV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAobm9kZS5wcm9wWzBdID09PSAnXycgfHwgbm9kZS5wcm9wWzBdID09PSAnKicpIHtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MuYmVmb3JlICs9IG5vZGUucHJvcFswXTtcbiAgICAgICAgICAgICAgICBub2RlLnByb3AgPSBub2RlLnByb3Auc2xpY2UoMSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiArPSB0aGlzLnNwYWNlc0FuZENvbW1lbnRzRnJvbVN0YXJ0KHRva2Vucyk7XG4gICAgICAgICAgICB0aGlzLnByZWNoZWNrTWlzc2VkU2VtaWNvbG9uKHRva2Vucyk7XG5cbiAgICAgICAgICAgIGZvciAobGV0IGkgPSB0b2tlbnMubGVuZ3RoIC0gMTsgaSA+IDA7IGktLSkge1xuICAgICAgICAgICAgICAgIHRva2VuID0gdG9rZW5zW2ldO1xuICAgICAgICAgICAgICAgIGlmICh0b2tlblsxXSA9PT0gJyFpbXBvcnRhbnQnKSB7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUuaW1wb3J0YW50ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHN0cmluZyA9IHRoaXMuc3RyaW5nRnJvbSh0b2tlbnMsIGkpO1xuICAgICAgICAgICAgICAgICAgICBzdHJpbmcgPSB0aGlzLnNwYWNlc0Zyb21FbmQodG9rZW5zKSArIHN0cmluZztcbiAgICAgICAgICAgICAgICAgICAgaWYgKHN0cmluZyAhPT0gJyAhaW1wb3J0YW50Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5yYXdzLmltcG9ydGFudCA9IHN0cmluZztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodG9rZW5bMV0gPT09ICdpbXBvcnRhbnQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBjYWNoZSA9IHRva2Vucy5zbGljZSgwKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHN0ciAgID0gJyc7XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGogPSBpOyBqID4gMDsgai0tKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdHlwZSA9IGNhY2hlW2pdWzBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0ci50cmltKCkuaW5kZXhPZignIScpID09PSAwICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSAhPT0gJ3NwYWNlJ1xuICAgICAgICAgICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHIgPSBjYWNoZS5wb3AoKVsxXSArIHN0cjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoc3RyLnRyaW0oKS5pbmRleE9mKCchJykgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUuaW1wb3J0YW50ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUucmF3cy5pbXBvcnRhbnQgPSBzdHI7XG4gICAgICAgICAgICAgICAgICAgICAgICB0b2tlbnMgPSBjYWNoZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmICh0b2tlblswXSAhPT0gJ3NwYWNlJyAmJiB0b2tlblswXSAhPT0gJ2NvbW1lbnQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5yYXcobm9kZSwgJ3ZhbHVlJywgdG9rZW5zKTtcblxuICAgICAgICAgICAgaWYgKG5vZGUudmFsdWUuaW5kZXhPZignOicpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgIHRoaXMuY2hlY2tNaXNzZWRTZW1pY29sb24odG9rZW5zKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5jdXJyZW50ID0gbm9kZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGNvbW1lbnQodG9rZW4pIHtcbiAgICAgICAgaWYgKHRva2VuWzZdID09PSAnaW5saW5lJykge1xuICAgICAgICAgICAgbGV0IG5vZGUgPSBuZXcgQ29tbWVudCgpO1xuICAgICAgICAgICAgdGhpcy5pbml0KG5vZGUsIHRva2VuWzJdLCB0b2tlblszXSk7XG4gICAgICAgICAgICBub2RlLnJhd3MuaW5saW5lID0gdHJ1ZTtcbiAgICAgICAgICAgIG5vZGUuc291cmNlLmVuZCAgPSB7IGxpbmU6IHRva2VuWzRdLCBjb2x1bW46IHRva2VuWzVdIH07XG5cbiAgICAgICAgICAgIGxldCB0ZXh0ID0gdG9rZW5bMV0uc2xpY2UoMik7XG4gICAgICAgICAgICBpZiAoIC9eXFxzKiQvLnRlc3QodGV4dCkgKSB7XG4gICAgICAgICAgICAgICAgbm9kZS50ZXh0ICAgICAgID0gJyc7XG4gICAgICAgICAgICAgICAgbm9kZS5yYXdzLmxlZnQgID0gdGV4dDtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MucmlnaHQgPSAnJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hdGNoID0gdGV4dC5tYXRjaCgvXihcXHMqKShbXl0qW15cXHNdKShcXHMqKSQvKTtcbiAgICAgICAgICAgICAgICBsZXQgZml4ZWQgPSBtYXRjaFsyXS5yZXBsYWNlKC8oXFwqXFwvfFxcL1xcKikvZywgJyovLyonKTtcbiAgICAgICAgICAgICAgICBub2RlLnRleHQgICAgICAgPSBmaXhlZDtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MubGVmdCAgPSBtYXRjaFsxXTtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MucmlnaHQgPSBtYXRjaFszXTtcbiAgICAgICAgICAgICAgICBub2RlLnJhd3MudGV4dCAgPSBtYXRjaFsyXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHN1cGVyLmNvbW1lbnQodG9rZW4pO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmF3KG5vZGUsIHByb3AsIHRva2Vucykge1xuICAgICAgICBzdXBlci5yYXcobm9kZSwgcHJvcCwgdG9rZW5zKTtcbiAgICAgICAgaWYgKCBub2RlLnJhd3NbcHJvcF0gKSB7XG4gICAgICAgICAgICBsZXQgc2NzcyA9IG5vZGUucmF3c1twcm9wXS5yYXc7XG4gICAgICAgICAgICBub2RlLnJhd3NbcHJvcF0ucmF3ID0gdG9rZW5zLnJlZHVjZSggKGFsbCwgaSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmICggaVswXSA9PT0gJ2NvbW1lbnQnICYmIGlbNl0gPT09ICdpbmxpbmUnICkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgdGV4dCA9IGlbMV0uc2xpY2UoMikucmVwbGFjZSgvKFxcKlxcL3xcXC9cXCopL2csICcqLy8qJyk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhbGwgKyAnLyonICsgdGV4dCArICcqLyc7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFsbCArIGlbMV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSwgJycpO1xuICAgICAgICAgICAgaWYgKCBzY3NzICE9PSBub2RlLnJhd3NbcHJvcF0ucmF3ICkge1xuICAgICAgICAgICAgICAgIG5vZGUucmF3c1twcm9wXS5zY3NzID0gc2NzcztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxufVxuIl19
  15858. /***/ }),
  15859. /* 129 */
  15860. /***/ (function(module, exports, __webpack_require__) {
  15861. "use strict";
  15862. exports.__esModule = true;
  15863. var _stringifier = __webpack_require__(21);
  15864. var _stringifier2 = _interopRequireDefault(_stringifier);
  15865. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  15866. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15867. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  15868. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  15869. var ScssStringifier = function (_Stringifier) {
  15870. _inherits(ScssStringifier, _Stringifier);
  15871. function ScssStringifier() {
  15872. _classCallCheck(this, ScssStringifier);
  15873. return _possibleConstructorReturn(this, _Stringifier.apply(this, arguments));
  15874. }
  15875. ScssStringifier.prototype.comment = function comment(node) {
  15876. var left = this.raw(node, 'left', 'commentLeft');
  15877. var right = this.raw(node, 'right', 'commentRight');
  15878. if (node.raws.inline) {
  15879. var text = node.raws.text || node.text;
  15880. this.builder('//' + left + text + right, node);
  15881. } else {
  15882. this.builder('/*' + left + node.text + right + '*/', node);
  15883. }
  15884. };
  15885. ScssStringifier.prototype.decl = function decl(node, semicolon) {
  15886. if (!node.isNested) {
  15887. _Stringifier.prototype.decl.call(this, node, semicolon);
  15888. } else {
  15889. var between = this.raw(node, 'between', 'colon');
  15890. var string = node.prop + between + this.rawValue(node, 'value');
  15891. if (node.important) {
  15892. string += node.raws.important || ' !important';
  15893. }
  15894. this.builder(string + '{', node, 'start');
  15895. var after = void 0;
  15896. if (node.nodes && node.nodes.length) {
  15897. this.body(node);
  15898. after = this.raw(node, 'after');
  15899. } else {
  15900. after = this.raw(node, 'after', 'emptyBody');
  15901. }
  15902. if (after) this.builder(after);
  15903. this.builder('}', node, 'end');
  15904. }
  15905. };
  15906. ScssStringifier.prototype.rawValue = function rawValue(node, prop) {
  15907. var value = node[prop];
  15908. var raw = node.raws[prop];
  15909. if (raw && raw.value === value) {
  15910. return raw.scss ? raw.scss : raw.raw;
  15911. } else {
  15912. return value;
  15913. }
  15914. };
  15915. return ScssStringifier;
  15916. }(_stringifier2.default);
  15917. exports.default = ScssStringifier;
  15918. module.exports = exports['default'];
  15919. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjc3Mtc3RyaW5naWZpZXIuZXM2Il0sIm5hbWVzIjp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iByYXcudmFsdWUgPT09IHZhbHVlICkge1xuICAgICAgICAgICAgcmV0dXJuIHJhdy5zY3NzID8gcmF3LnNjc3MgOiByYXcucmF3O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICB9XG4gICAgfVxuXG59XG4iXX0=
  15920. /***/ }),
  15921. /* 130 */
  15922. /***/ (function(module, exports, __webpack_require__) {
  15923. "use strict";
  15924. exports.__esModule = true;
  15925. exports.default = scssStringify;
  15926. var _scssStringifier = __webpack_require__(129);
  15927. var _scssStringifier2 = _interopRequireDefault(_scssStringifier);
  15928. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  15929. function scssStringify(node, builder) {
  15930. var str = new _scssStringifier2.default(builder);
  15931. str.stringify(node);
  15932. }
  15933. module.exports = exports['default'];
  15934. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjc3Mtc3RyaW5naWZ5LmVzNiJdLCJuYW1lcyI6WyJzY3NzU3RyaW5naWZ5Iiwibm9kZSIsImJ1aWxkZXIiLCJzdHIiLCJzdHJpbmdpZnkiXSwibWFwcGluZ3MiOiI7OztrQkFFd0JBLGE7O0FBRnhCOzs7Ozs7QUFFZSxTQUFTQSxhQUFULENBQXVCQyxJQUF2QixFQUE2QkMsT0FBN0IsRUFBc0M7QUFDakQsUUFBSUMsTUFBTSw4QkFBb0JELE9BQXBCLENBQVY7QUFDQUMsUUFBSUMsU0FBSixDQUFjSCxJQUFkO0FBQ0giLCJmaWxlIjoic2Nzcy1zdHJpbmdpZnkuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgU2Nzc1N0cmluZ2lmaWVyIGZyb20gJy4vc2Nzcy1zdHJpbmdpZmllcic7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIHNjc3NTdHJpbmdpZnkobm9kZSwgYnVpbGRlcikge1xuICAgIGxldCBzdHIgPSBuZXcgU2Nzc1N0cmluZ2lmaWVyKGJ1aWxkZXIpO1xuICAgIHN0ci5zdHJpbmdpZnkobm9kZSk7XG59XG4iXX0=
  15935. /***/ }),
  15936. /* 131 */
  15937. /***/ (function(module, exports, __webpack_require__) {
  15938. "use strict";
  15939. exports.__esModule = true;
  15940. exports.default = scssTokenize;
  15941. var SINGLE_QUOTE = 39;
  15942. var DOUBLE_QUOTE = 34;
  15943. var BACKSLASH = 92;
  15944. var SLASH = 47;
  15945. var NEWLINE = 10;
  15946. var SPACE = 32;
  15947. var FEED = 12;
  15948. var TAB = 9;
  15949. var CR = 13;
  15950. var OPEN_SQUARE = 91;
  15951. var CLOSE_SQUARE = 93;
  15952. var OPEN_PARENTHESES = 40;
  15953. var CLOSE_PARENTHESES = 41;
  15954. var OPEN_CURLY = 123;
  15955. var CLOSE_CURLY = 125;
  15956. var SEMICOLON = 59;
  15957. var ASTERISK = 42;
  15958. var COLON = 58;
  15959. var AT = 64;
  15960. // SCSS PATCH {
  15961. var COMMA = 44;
  15962. var HASH = 35;
  15963. // } SCSS PATCH
  15964. var RE_AT_END = /[ \n\t\r\f\{\(\)'"\\;/\[\]#]/g;
  15965. var RE_WORD_END = /[ \n\t\r\f\(\)\{\}:;@!'"\\\]\[#]|\/(?=\*)/g;
  15966. var RE_BAD_BRACKET = /.[\\\/\("'\n]/;
  15967. var RE_HEX_ESCAPE = /[a-f0-9]/i;
  15968. var RE_NEW_LINE = /[\r\f\n]/g; // SCSS PATCH
  15969. // SCSS PATCH function name was changed
  15970. function scssTokenize(input) {
  15971. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15972. var css = input.css.valueOf();
  15973. var ignore = options.ignoreErrors;
  15974. var code = void 0,
  15975. next = void 0,
  15976. quote = void 0,
  15977. lines = void 0,
  15978. last = void 0,
  15979. content = void 0,
  15980. escape = void 0,
  15981. nextLine = void 0,
  15982. nextOffset = void 0,
  15983. escaped = void 0,
  15984. escapePos = void 0,
  15985. prev = void 0,
  15986. n = void 0,
  15987. currentToken = void 0;
  15988. var brackets = void 0; // SCSS PATCH
  15989. var length = css.length;
  15990. var offset = -1;
  15991. var line = 1;
  15992. var pos = 0;
  15993. var buffer = [];
  15994. var returned = [];
  15995. function unclosed(what) {
  15996. throw input.error('Unclosed ' + what, line, pos - offset);
  15997. }
  15998. function endOfFile() {
  15999. return returned.length === 0 && pos >= length;
  16000. }
  16001. function nextToken() {
  16002. if (returned.length) return returned.pop();
  16003. if (pos >= length) return;
  16004. code = css.charCodeAt(pos);
  16005. if (code === NEWLINE || code === FEED || code === CR && css.charCodeAt(pos + 1) !== NEWLINE) {
  16006. offset = pos;
  16007. line += 1;
  16008. }
  16009. switch (code) {
  16010. case NEWLINE:
  16011. case SPACE:
  16012. case TAB:
  16013. case CR:
  16014. case FEED:
  16015. next = pos;
  16016. do {
  16017. next += 1;
  16018. code = css.charCodeAt(next);
  16019. if (code === NEWLINE) {
  16020. offset = next;
  16021. line += 1;
  16022. }
  16023. } while (code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED);
  16024. currentToken = ['space', css.slice(pos, next)];
  16025. pos = next - 1;
  16026. break;
  16027. case OPEN_SQUARE:
  16028. currentToken = ['[', '[', line, pos - offset];
  16029. break;
  16030. case CLOSE_SQUARE:
  16031. currentToken = [']', ']', line, pos - offset];
  16032. break;
  16033. case OPEN_CURLY:
  16034. currentToken = ['{', '{', line, pos - offset];
  16035. break;
  16036. case CLOSE_CURLY:
  16037. currentToken = ['}', '}', line, pos - offset];
  16038. break;
  16039. // SCSS PATCH {
  16040. case COMMA:
  16041. currentToken = ['word', ',', line, pos - offset, line, pos - offset + 1];
  16042. break;
  16043. // } SCSS PATCH
  16044. case COLON:
  16045. currentToken = [':', ':', line, pos - offset];
  16046. break;
  16047. case SEMICOLON:
  16048. currentToken = [';', ';', line, pos - offset];
  16049. break;
  16050. case OPEN_PARENTHESES:
  16051. prev = buffer.length ? buffer.pop()[1] : '';
  16052. n = css.charCodeAt(pos + 1);
  16053. // SCSS PATCH {
  16054. if (prev === 'url' && n !== SINGLE_QUOTE && n !== DOUBLE_QUOTE) {
  16055. brackets = 1;
  16056. escaped = false;
  16057. next = pos + 1;
  16058. while (next <= css.length - 1) {
  16059. n = css.charCodeAt(next);
  16060. if (n === BACKSLASH) {
  16061. escaped = !escaped;
  16062. } else if (n === OPEN_PARENTHESES) {
  16063. brackets += 1;
  16064. } else if (n === CLOSE_PARENTHESES) {
  16065. brackets -= 1;
  16066. if (brackets === 0) break;
  16067. }
  16068. next += 1;
  16069. }
  16070. content = css.slice(pos, next + 1);
  16071. lines = content.split('\n');
  16072. last = lines.length - 1;
  16073. if (last > 0) {
  16074. nextLine = line + last;
  16075. nextOffset = next - lines[last].length;
  16076. } else {
  16077. nextLine = line;
  16078. nextOffset = offset;
  16079. }
  16080. currentToken = ['brackets', content, line, pos - offset, nextLine, next - nextOffset];
  16081. offset = nextOffset;
  16082. line = nextLine;
  16083. pos = next;
  16084. // } SCSS PATCH
  16085. } else {
  16086. next = css.indexOf(')', pos + 1);
  16087. content = css.slice(pos, next + 1);
  16088. if (next === -1 || RE_BAD_BRACKET.test(content)) {
  16089. currentToken = ['(', '(', line, pos - offset];
  16090. } else {
  16091. currentToken = ['brackets', content, line, pos - offset, line, next - offset];
  16092. pos = next;
  16093. }
  16094. }
  16095. break;
  16096. case CLOSE_PARENTHESES:
  16097. currentToken = [')', ')', line, pos - offset];
  16098. break;
  16099. case SINGLE_QUOTE:
  16100. case DOUBLE_QUOTE:
  16101. quote = code === SINGLE_QUOTE ? '\'' : '"';
  16102. next = pos;
  16103. do {
  16104. escaped = false;
  16105. next = css.indexOf(quote, next + 1);
  16106. if (next === -1) {
  16107. if (ignore) {
  16108. next = pos + 1;
  16109. break;
  16110. } else {
  16111. unclosed('string');
  16112. }
  16113. }
  16114. escapePos = next;
  16115. while (css.charCodeAt(escapePos - 1) === BACKSLASH) {
  16116. escapePos -= 1;
  16117. escaped = !escaped;
  16118. }
  16119. } while (escaped);
  16120. content = css.slice(pos, next + 1);
  16121. lines = content.split('\n');
  16122. last = lines.length - 1;
  16123. if (last > 0) {
  16124. nextLine = line + last;
  16125. nextOffset = next - lines[last].length;
  16126. } else {
  16127. nextLine = line;
  16128. nextOffset = offset;
  16129. }
  16130. currentToken = ['string', css.slice(pos, next + 1), line, pos - offset, nextLine, next - nextOffset];
  16131. offset = nextOffset;
  16132. line = nextLine;
  16133. pos = next;
  16134. break;
  16135. case AT:
  16136. RE_AT_END.lastIndex = pos + 1;
  16137. RE_AT_END.test(css);
  16138. if (RE_AT_END.lastIndex === 0) {
  16139. next = css.length - 1;
  16140. } else {
  16141. next = RE_AT_END.lastIndex - 2;
  16142. }
  16143. currentToken = ['at-word', css.slice(pos, next + 1), line, pos - offset, line, next - offset];
  16144. pos = next;
  16145. break;
  16146. case BACKSLASH:
  16147. next = pos;
  16148. escape = true;
  16149. while (css.charCodeAt(next + 1) === BACKSLASH) {
  16150. next += 1;
  16151. escape = !escape;
  16152. }
  16153. code = css.charCodeAt(next + 1);
  16154. if (escape && code !== SLASH && code !== SPACE && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED) {
  16155. next += 1;
  16156. if (RE_HEX_ESCAPE.test(css.charAt(next))) {
  16157. while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) {
  16158. next += 1;
  16159. }
  16160. if (css.charCodeAt(next + 1) === SPACE) {
  16161. next += 1;
  16162. }
  16163. }
  16164. }
  16165. currentToken = ['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset];
  16166. pos = next;
  16167. break;
  16168. default:
  16169. // SCSS PATCH {
  16170. n = css.charCodeAt(pos + 1);
  16171. if (code === HASH && n === OPEN_CURLY) {
  16172. var deep = 1;
  16173. next = pos;
  16174. while (deep > 0) {
  16175. next += 1;
  16176. if (css.length <= next) unclosed('interpolation');
  16177. code = css.charCodeAt(next);
  16178. n = css.charCodeAt(next + 1);
  16179. if (code === CLOSE_CURLY) {
  16180. deep -= 1;
  16181. } else if (code === HASH && n === OPEN_CURLY) {
  16182. deep += 1;
  16183. }
  16184. }
  16185. content = css.slice(pos, next + 1);
  16186. lines = content.split('\n');
  16187. last = lines.length - 1;
  16188. if (last > 0) {
  16189. nextLine = line + last;
  16190. nextOffset = next - lines[last].length;
  16191. } else {
  16192. nextLine = line;
  16193. nextOffset = offset;
  16194. }
  16195. currentToken = ['word', content, line, pos - offset, nextLine, next - nextOffset];
  16196. offset = nextOffset;
  16197. line = nextLine;
  16198. pos = next;
  16199. } else if (code === SLASH && n === ASTERISK) {
  16200. // } SCSS PATCH
  16201. next = css.indexOf('*/', pos + 2) + 1;
  16202. if (next === 0) {
  16203. if (ignore) {
  16204. next = css.length;
  16205. } else {
  16206. unclosed('comment');
  16207. }
  16208. }
  16209. content = css.slice(pos, next + 1);
  16210. lines = content.split('\n');
  16211. last = lines.length - 1;
  16212. if (last > 0) {
  16213. nextLine = line + last;
  16214. nextOffset = next - lines[last].length;
  16215. } else {
  16216. nextLine = line;
  16217. nextOffset = offset;
  16218. }
  16219. currentToken = ['comment', content, line, pos - offset, nextLine, next - nextOffset];
  16220. offset = nextOffset;
  16221. line = nextLine;
  16222. pos = next;
  16223. // SCSS PATCH {
  16224. } else if (code === SLASH && n === SLASH) {
  16225. RE_NEW_LINE.lastIndex = pos + 1;
  16226. RE_NEW_LINE.test(css);
  16227. if (RE_NEW_LINE.lastIndex === 0) {
  16228. next = css.length - 1;
  16229. } else {
  16230. next = RE_NEW_LINE.lastIndex - 2;
  16231. }
  16232. content = css.slice(pos, next + 1);
  16233. currentToken = ['comment', content, line, pos - offset, line, next - offset, 'inline'];
  16234. pos = next;
  16235. // } SCSS PATCH
  16236. } else {
  16237. RE_WORD_END.lastIndex = pos + 1;
  16238. RE_WORD_END.test(css);
  16239. if (RE_WORD_END.lastIndex === 0) {
  16240. next = css.length - 1;
  16241. } else {
  16242. next = RE_WORD_END.lastIndex - 2;
  16243. }
  16244. currentToken = ['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset];
  16245. buffer.push(currentToken);
  16246. pos = next;
  16247. }
  16248. break;
  16249. }
  16250. pos++;
  16251. return currentToken;
  16252. }
  16253. function back(token) {
  16254. returned.push(token);
  16255. }
  16256. return {
  16257. back: back,
  16258. nextToken: nextToken,
  16259. endOfFile: endOfFile
  16260. };
  16261. }
  16262. module.exports = exports['default'];
  16263. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjc3MtdG9rZW5pemUuZXM2Il0sIm5hbWVzIjpbInNjc3NUb2tlbml6ZSIsIlNJTkdMRV9RVU9URSIsIkRPVUJMRV9RVU9URSIsIkJBQ0tTTEFTSCIsIlNMQVNIIiwiTkVXTElORSIsIlNQQUNFIiwiRkVFRCIsIlRBQiIsIkNSIiwiT1BFTl9TUVVBUkUiLCJDTE9TRV9TUVVBUkUiLCJPUEVOX1BBUkVOVEhFU0VTIiwiQ0xPU0VfUEFSRU5USEVTRVMiLCJPUEVOX0NVUkxZIiwiQ0xPU0VfQ1VSTFkiLCJTRU1JQ09MT04iLCJBU1RFUklTSyIsIkNPTE9OIiwiQVQiLCJDT01NQSIsIkhBU0giLCJSRV9BVF9FTkQiLCJSRV9XT1JEX0VORCIsIlJFX0JBRF9CUkFDS0VUIiwiUkVfSEVYX0VTQ0FQRSIsIlJFX05FV19MSU5FIiwiaW5wdXQiLCJvcHRpb25zIiwiY3NzIiwidmFsdWVPZiIsImlnbm9yZSIsImlnbm9yZUVycm9ycyIsImNvZGUiLCJuZXh0IiwicXVvdGUiLCJsaW5lcyIsImxhc3QiLCJjb250ZW50IiwiZXNjYXBlIiwibmV4dExpbmUiLCJuZXh0T2Zmc2V0IiwiZXNjYXBlZCIsImVzY2FwZVBvcyIsInByZXYiLCJuIiwiY3VycmVudFRva2VuIiwiYnJhY2tldHMiLCJsZW5ndGgiLCJvZmZzZXQiLCJsaW5lIiwicG9zIiwiYnVmZmVyIiwicmV0dXJuZWQiLCJ1bmNsb3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AgICAgIGNvZGUgPSBjc3MuY2hhckNvZGVBdChuZXh0KTtcbiAgICAgICAgICAgICAgICBpZiAoIGNvZGUgPT09IE5FV0xJTkUgKSB7XG4gICAgICAgICAgICAgICAgICAgIG9mZnNldCA9IG5leHQ7XG4gICAgICAgICAgICAgICAgICAgIGxpbmUgKz0gMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IHdoaWxlICggY29kZSA9PT0gU1BBQ0UgICB8fFxuICAgICAgICAgICAgICAgICAgICAgIGNvZGUgPT09IE5FV0xJTkUgfHxcbiAgICAgICAgICAgICAgICAgICAgICBjb2RlID09PSBUQUIgICAgIHx8XG4gICAgICAgICAgICAgICAgICAgICAgY29kZSA9PT0gQ1IgICAgICB8fFxuICAgICAgICAgICAgICAgICAgICAgIGNvZGUgPT09IEZFRUQgKTtcblxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gWydzcGFjZScsIGNzcy5zbGljZShwb3MsIG5leHQpXTtcbiAgICAgICAgICAgIHBvcyA9IG5leHQgLSAxO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBPUEVOX1NRVUFSRTpcbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnWycsICdbJywgbGluZSwgcG9zIC0gb2Zmc2V0XTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQ0xPU0VfU1FVQVJFOlxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gWyddJywgJ10nLCBsaW5lLCBwb3MgLSBvZmZzZXRdO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBPUEVOX0NVUkxZOlxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gWyd7JywgJ3snLCBsaW5lLCBwb3MgLSBvZmZzZXRdO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBDTE9TRV9DVVJMWTpcbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnfScsICd9JywgbGluZSwgcG9zIC0gb2Zmc2V0XTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIC8vIFNDU1MgUEFUQ0gge1xuICAgICAgICBjYXNlIENPTU1BOlxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gW1xuICAgICAgICAgICAgICAgICd3b3JkJyxcbiAgICAgICAgICAgICAgICAnLCcsXG4gICAgICAgICAgICAgICAgbGluZSwgcG9zIC0gb2Zmc2V0LFxuICAgICAgICAgICAgICAgIGxpbmUsIHBvcyAtIG9mZnNldCArIDFcbiAgICAgICAgICAgIF07XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgLy8gfSBTQ1NTIFBBVENIXG5cbiAgICAgICAgY2FzZSBDT0xPTjpcbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnOicsICc6JywgbGluZSwgcG9zIC0gb2Zmc2V0XTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgU0VNSUNPTE9OOlxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gWyc7JywgJzsnLCBsaW5lLCBwb3MgLSBvZmZzZXRdO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBPUEVOX1BBUkVOVEhFU0VTOlxuICAgICAgICAgICAgcHJldiA9IGJ1ZmZlci5sZW5ndGggPyBidWZmZXIucG9wKClbMV0gOiAnJztcbiAgICAgICAgICAgIG4gICAgPSBjc3MuY2hhckNvZGVBdChwb3MgKyAxKTtcblxuICAgICAgICAgICAgLy8gU0NTUyBQQVRDSCB7XG4gICAgICAgICAgICBpZiAoIHByZXYgPT09ICd1cmwnICYmIG4gIT09IFNJTkdMRV9RVU9URSAmJiBuICE9PSBET1VCTEVfUVVPVEUgKSB7XG4gICAgICAgICAgICAgICAgYnJhY2tldHMgPSAxO1xuICAgICAgICAgICAgICAgIGVzY2FwZWQgID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgbmV4dCAgICAgPSBwb3MgKyAxO1xuICAgICAgICAgICAgICAgIHdoaWxlICggbmV4dCA8PSBjc3MubGVuZ3RoIC0gMSApIHtcbiAgICAgICAgICAgICAgICAgICAgbiA9IGNzcy5jaGFyQ29kZUF0KG5leHQpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIG4gPT09IEJBQ0tTTEFTSCApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVzY2FwZWQgPSAhZXNjYXBlZDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICggbiA9PT0gT1BFTl9QQVJFTlRIRVNFUyApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyYWNrZXRzICs9IDE7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIG4gPT09IENMT1NFX1BBUkVOVEhFU0VTICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJhY2tldHMgLT0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICggYnJhY2tldHMgPT09IDAgKSBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBuZXh0ICs9IDE7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgY29udGVudCA9IGNzcy5zbGljZShwb3MsIG5leHQgKyAxKTtcbiAgICAgICAgICAgICAgICBsaW5lcyAgID0gY29udGVudC5zcGxpdCgnXFxuJyk7XG4gICAgICAgICAgICAgICAgbGFzdCAgICA9IGxpbmVzLmxlbmd0aCAtIDE7XG5cbiAgICAgICAgICAgICAgICBpZiAoIGxhc3QgPiAwICkge1xuICAgICAgICAgICAgICAgICAgICBuZXh0TGluZSAgID0gbGluZSArIGxhc3Q7XG4gICAgICAgICAgICAgICAgICAgIG5leHRPZmZzZXQgPSBuZXh0IC0gbGluZXNbbGFzdF0ubGVuZ3RoO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG5leHRMaW5lICAgPSBsaW5lO1xuICAgICAgICAgICAgICAgICAgICBuZXh0T2Zmc2V0ID0gb2Zmc2V0O1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnYnJhY2tldHMnLCBjb250ZW50LFxuICAgICAgICAgICAgICAgICAgICBsaW5lLCAgICAgcG9zICAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbmV4dExpbmUsIG5leHQgLSBuZXh0T2Zmc2V0XG4gICAgICAgICAgICAgICAgXTtcblxuICAgICAgICAgICAgICAgIG9mZnNldCA9IG5leHRPZmZzZXQ7XG4gICAgICAgICAgICAgICAgbGluZSAgID0gbmV4dExpbmU7XG4gICAgICAgICAgICAgICAgcG9zICAgID0gbmV4dDtcbiAgICAgICAgICAgIC8vIH0gU0NTUyBQQVRDSFxuXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG5leHQgICAgPSBjc3MuaW5kZXhPZignKScsIHBvcyArIDEpO1xuICAgICAgICAgICAgICAgIGNvbnRlbnQgPSBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSk7XG5cbiAgICAgICAgICAgICAgICBpZiAoIG5leHQgPT09IC0xIHx8IFJFX0JBRF9CUkFDS0VULnRlc3QoY29udGVudCkgKSB7XG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnKCcsICcoJywgbGluZSwgcG9zIC0gb2Zmc2V0XTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBjdXJyZW50VG9rZW4gPSBbJ2JyYWNrZXRzJywgY29udGVudCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmUsIHBvcyAgLSBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lLCBuZXh0IC0gb2Zmc2V0XG4gICAgICAgICAgICAgICAgICAgIF07XG4gICAgICAgICAgICAgICAgICAgIHBvcyA9IG5leHQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIENMT1NFX1BBUkVOVEhFU0VTOlxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gWycpJywgJyknLCBsaW5lLCBwb3MgLSBvZmZzZXRdO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBTSU5HTEVfUVVPVEU6XG4gICAgICAgIGNhc2UgRE9VQkxFX1FVT1RFOlxuICAgICAgICAgICAgcXVvdGUgPSBjb2RlID09PSBTSU5HTEVfUVVPVEUgPyAnXFwnJyA6ICdcIic7XG4gICAgICAgICAgICBuZXh0ICA9IHBvcztcbiAgICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgICAgICBlc2NhcGVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgbmV4dCAgICA9IGNzcy5pbmRleE9mKHF1b3RlLCBuZXh0ICsgMSk7XG4gICAgICAgICAgICAgICAgaWYgKCBuZXh0ID09PSAtMSApIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCBpZ25vcmUgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID0gcG9zICsgMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdW5jbG9zZWQoJ3N0cmluZycpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVzY2FwZVBvcyA9IG5leHQ7XG4gICAgICAgICAgICAgICAgd2hpbGUgKCBjc3MuY2hhckNvZGVBdChlc2NhcGVQb3MgLSAxKSA9PT0gQkFDS1NMQVNIICkge1xuICAgICAgICAgICAgICAgICAgICBlc2NhcGVQb3MgLT0gMTtcbiAgICAgICAgICAgICAgICAgICAgZXNjYXBlZCA9ICFlc2NhcGVkO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gd2hpbGUgKCBlc2NhcGVkICk7XG5cbiAgICAgICAgICAgIGNvbnRlbnQgPSBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSk7XG4gICAgICAgICAgICBsaW5lcyAgID0gY29udGVudC5zcGxpdCgnXFxuJyk7XG4gICAgICAgICAgICBsYXN0ICAgID0gbGluZXMubGVuZ3RoIC0gMTtcblxuICAgICAgICAgICAgaWYgKCBsYXN0ID4gMCApIHtcbiAgICAgICAgICAgICAgICBuZXh0TGluZSAgID0gbGluZSArIGxhc3Q7XG4gICAgICAgICAgICAgICAgbmV4dE9mZnNldCA9IG5leHQgLSBsaW5lc1tsYXN0XS5sZW5ndGg7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG5leHRMaW5lICAgPSBsaW5lO1xuICAgICAgICAgICAgICAgIG5leHRPZmZzZXQgPSBvZmZzZXQ7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnc3RyaW5nJywgY3NzLnNsaWNlKHBvcywgbmV4dCArIDEpLFxuICAgICAgICAgICAgICAgIGxpbmUsIHBvcyAgLSBvZmZzZXQsXG4gICAgICAgICAgICAgICAgbmV4dExpbmUsIG5leHQgLSBuZXh0T2Zmc2V0XG4gICAgICAgICAgICBdO1xuXG4gICAgICAgICAgICBvZmZzZXQgPSBuZXh0T2Zmc2V0O1xuICAgICAgICAgICAgbGluZSAgID0gbmV4dExpbmU7XG4gICAgICAgICAgICBwb3MgICAgPSBuZXh0O1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBBVDpcbiAgICAgICAgICAgIFJFX0FUX0VORC5sYXN0SW5kZXggPSBwb3MgKyAxO1xuICAgICAgICAgICAgUkVfQVRfRU5ELnRlc3QoY3NzKTtcbiAgICAgICAgICAgIGlmICggUkVfQVRfRU5ELmxhc3RJbmRleCA9PT0gMCApIHtcbiAgICAgICAgICAgICAgICBuZXh0ID0gY3NzLmxlbmd0aCAtIDE7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG5leHQgPSBSRV9BVF9FTkQubGFzdEluZGV4IC0gMjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY3VycmVudFRva2VuID0gWydhdC13b3JkJywgY3NzLnNsaWNlKHBvcywgbmV4dCArIDEpLFxuICAgICAgICAgICAgICAgIGxpbmUsIHBvcyAgLSBvZmZzZXQsXG4gICAgICAgICAgICAgICAgbGluZSwgbmV4dCAtIG9mZnNldFxuICAgICAgICAgICAgXTtcblxuICAgICAgICAgICAgcG9zID0gbmV4dDtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQkFDS1NMQVNIOlxuICAgICAgICAgICAgbmV4dCAgID0gcG9zO1xuICAgICAgICAgICAgZXNjYXBlID0gdHJ1ZTtcbiAgICAgICAgICAgIHdoaWxlICggY3NzLmNoYXJDb2RlQXQobmV4dCArIDEpID09PSBCQUNLU0xBU0ggKSB7XG4gICAgICAgICAgICAgICAgbmV4dCAgKz0gMTtcbiAgICAgICAgICAgICAgICBlc2NhcGUgPSAhZXNjYXBlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY29kZSA9IGNzcy5jaGFyQ29kZUF0KG5leHQgKyAxKTtcbiAgICAgICAgICAgIGlmICggZXNjYXBlICYmIChjb2RlICE9PSBTTEFTSCAgICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZSAhPT0gU1BBQ0UgICAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUgIT09IE5FV0xJTkUgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlICE9PSBUQUIgICAgICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZSAhPT0gQ1IgICAgICAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUgIT09IEZFRUQgKSApIHtcbiAgICAgICAgICAgICAgICBuZXh0ICs9IDE7XG4gICAgICAgICAgICAgICAgaWYgKCBSRV9IRVhfRVNDQVBFLnRlc3QoY3NzLmNoYXJBdChuZXh0KSkgKSB7XG4gICAgICAgICAgICAgICAgICAgIHdoaWxlICggUkVfSEVYX0VTQ0FQRS50ZXN0KGNzcy5jaGFyQXQobmV4dCArIDEpKSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5leHQgKz0gMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoIGNzcy5jaGFyQ29kZUF0KG5leHQgKyAxKSA9PT0gU1BBQ0UgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXh0ICs9IDE7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnd29yZCcsIGNzcy5zbGljZShwb3MsIG5leHQgKyAxKSxcbiAgICAgICAgICAgICAgICBsaW5lLCBwb3MgIC0gb2Zmc2V0LFxuICAgICAgICAgICAgICAgIGxpbmUsIG5leHQgLSBvZmZzZXRcbiAgICAgICAgICAgIF07XG5cbiAgICAgICAgICAgIHBvcyA9IG5leHQ7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgLy8gU0NTUyBQQVRDSCB7XG4gICAgICAgICAgICBuID0gY3NzLmNoYXJDb2RlQXQocG9zICsgMSk7XG5cbiAgICAgICAgICAgIGlmICggY29kZSA9PT0gSEFTSCAmJiBuID09PSBPUEVOX0NVUkxZICkge1xuICAgICAgICAgICAgICAgIGxldCBkZWVwID0gMTtcbiAgICAgICAgICAgICAgICBuZXh0ID0gcG9zO1xuICAgICAgICAgICAgICAgIHdoaWxlICggZGVlcCA+IDAgKSB7XG4gICAgICAgICAgICAgICAgICAgIG5leHQgKz0gMTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCBjc3MubGVuZ3RoIDw9IG5leHQgKSB1bmNsb3NlZCgnaW50ZXJwb2xhdGlvbicpO1xuXG4gICAgICAgICAgICAgICAgICAgIGNvZGUgID0gY3NzLmNoYXJDb2RlQXQobmV4dCk7XG4gICAgICAgICAgICAgICAgICAgIG4gICAgID0gY3NzLmNoYXJDb2RlQXQobmV4dCArIDEpO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICggY29kZSA9PT0gQ0xPU0VfQ1VSTFkgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkZWVwIC09IDE7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIGNvZGUgPT09IEhBU0ggJiYgbiA9PT0gT1BFTl9DVVJMWSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZXAgKz0gMTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGNvbnRlbnQgPSBjc3Muc2xpY2UocG9zLCBuZXh0ICsgMSk7XG4gICAgICAgICAgICAgICAgbGluZXMgICA9IGNvbnRlbnQuc3BsaXQoJ1xcbicpO1xuICAgICAgICAgICAgICAgIGxhc3QgICAgPSBsaW5lcy5sZW5ndGggLSAxO1xuXG4gICAgICAgICAgICAgICAgaWYgKCBsYXN0ID4gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgbmV4dExpbmUgICA9IGxpbmUgKyBsYXN0O1xuICAgICAgICAgICAgICAgICAgICBuZXh0T2Zmc2V0ID0gbmV4dCAtIGxpbmVzW2xhc3RdLmxlbmd0aDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBuZXh0TGluZSAgID0gbGluZTtcbiAgICAgICAgICAgICAgICAgICAgbmV4dE9mZnNldCA9IG9mZnNldDtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjdXJyZW50VG9rZW4gPSBbJ3dvcmQnLCBjb250ZW50LFxuICAgICAgICAgICAgICAgICAgICBsaW5lLCAgICAgcG9zICAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbmV4dExpbmUsIG5leHQgLSBuZXh0T2Zmc2V0XG4gICAgICAgICAgICAgICAgXTtcblxuICAgICAgICAgICAgICAgIG9mZnNldCA9IG5leHRPZmZzZXQ7XG4gICAgICAgICAgICAgICAgbGluZSAgID0gbmV4dExpbmU7XG4gICAgICAgICAgICAgICAgcG9zICAgID0gbmV4dDtcblxuICAgICAgICAgICAgfSBlbHNlIGlmICggY29kZSA9PT0gU0xBU0ggJiYgbiA9PT0gQVNURVJJU0sgKSB7XG4gICAgICAgICAgICAvLyB9IFNDU1MgUEFUQ0hcbiAgICAgICAgICAgICAgICBuZXh0ID0gY3NzLmluZGV4T2YoJyovJywgcG9zICsgMikgKyAxO1xuICAgICAgICAgICAgICAgIGlmICggbmV4dCA9PT0gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCBpZ25vcmUgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID0gY3NzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHVuY2xvc2VkKCdjb21tZW50Jyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjb250ZW50ID0gY3NzLnNsaWNlKHBvcywgbmV4dCArIDEpO1xuICAgICAgICAgICAgICAgIGxpbmVzICAgPSBjb250ZW50LnNwbGl0KCdcXG4nKTtcbiAgICAgICAgICAgICAgICBsYXN0ICAgID0gbGluZXMubGVuZ3RoIC0gMTtcblxuICAgICAgICAgICAgICAgIGlmICggbGFzdCA+IDAgKSB7XG4gICAgICAgICAgICAgICAgICAgIG5leHRMaW5lICAgPSBsaW5lICsgbGFzdDtcbiAgICAgICAgICAgICAgICAgICAgbmV4dE9mZnNldCA9IG5leHQgLSBsaW5lc1tsYXN0XS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgbmV4dExpbmUgICA9IGxpbmU7XG4gICAgICAgICAgICAgICAgICAgIG5leHRPZmZzZXQgPSBvZmZzZXQ7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgY3VycmVudFRva2VuID0gWydjb21tZW50JywgY29udGVudCxcbiAgICAgICAgICAgICAgICAgICAgbGluZSwgICAgIHBvcyAgLSBvZmZzZXQsXG4gICAgICAgICAgICAgICAgICAgIG5leHRMaW5lLCBuZXh0IC0gbmV4dE9mZnNldFxuICAgICAgICAgICAgICAgIF07XG5cbiAgICAgICAgICAgICAgICBvZmZzZXQgPSBuZXh0T2Zmc2V0O1xuICAgICAgICAgICAgICAgIGxpbmUgICA9IG5leHRMaW5lO1xuICAgICAgICAgICAgICAgIHBvcyAgICA9IG5leHQ7XG5cbiAgICAgICAgICAgIC8vIFNDU1MgUEFUQ0gge1xuICAgICAgICAgICAgfSBlbHNlIGlmICggY29kZSA9PT0gU0xBU0ggJiYgbiA9PT0gU0xBU0ggKSB7XG4gICAgICAgICAgICAgICAgUkVfTkVXX0xJTkUubGFzdEluZGV4ID0gcG9zICsgMTtcbiAgICAgICAgICAgICAgICBSRV9ORVdfTElORS50ZXN0KGNzcyk7XG4gICAgICAgICAgICAgICAgaWYgKCBSRV9ORVdfTElORS5sYXN0SW5kZXggPT09IDAgKSB7XG4gICAgICAgICAgICAgICAgICAgIG5leHQgPSBjc3MubGVuZ3RoIC0gMTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBuZXh0ID0gUkVfTkVXX0xJTkUubGFzdEluZGV4IC0gMjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBjb250ZW50ID0gY3NzLnNsaWNlKHBvcywgbmV4dCArIDEpO1xuXG4gICAgICAgICAgICAgICAgY3VycmVudFRva2VuID0gWydjb21tZW50JywgY29udGVudCxcbiAgICAgICAgICAgICAgICAgICAgbGluZSwgcG9zICAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbGluZSwgbmV4dCAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgJ2lubGluZSdcbiAgICAgICAgICAgICAgICBdO1xuXG4gICAgICAgICAgICAgICAgcG9zID0gbmV4dDtcbiAgICAgICAgICAgICAgICAvLyB9IFNDU1MgUEFUQ0hcblxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBSRV9XT1JEX0VORC5sYXN0SW5kZXggPSBwb3MgKyAxO1xuICAgICAgICAgICAgICAgIFJFX1dPUkRfRU5ELnRlc3QoY3NzKTtcbiAgICAgICAgICAgICAgICBpZiAoIFJFX1dPUkRfRU5ELmxhc3RJbmRleCA9PT0gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgbmV4dCA9IGNzcy5sZW5ndGggLSAxO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG5leHQgPSBSRV9XT1JEX0VORC5sYXN0SW5kZXggLSAyO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGN1cnJlbnRUb2tlbiA9IFsnd29yZCcsIGNzcy5zbGljZShwb3MsIG5leHQgKyAxKSxcbiAgICAgICAgICAgICAgICAgICAgbGluZSwgcG9zICAtIG9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgbGluZSwgbmV4dCAtIG9mZnNldFxuICAgICAgICAgICAgICAgIF07XG5cbiAgICAgICAgICAgICAgICBidWZmZXIucHVzaChjdXJyZW50VG9rZW4pO1xuXG4gICAgICAgICAgICAgICAgcG9zID0gbmV4dDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICBwb3MrKztcbiAgICAgICAgcmV0dXJuIGN1cnJlbnRUb2tlbjtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBiYWNrKHRva2VuKSB7XG4gICAgICAgIHJldHVybmVkLnB1c2godG9rZW4pO1xuICAgIH1cblxuICAgIHJldHVybiB7XG4gICAgICAgIGJhY2ssXG4gICAgICAgIG5leHRUb2tlbixcbiAgICAgICAgZW5kT2ZGaWxlXG4gICAgfTtcbn1cbiJdfQ==
  16264. /***/ }),
  16265. /* 132 */
  16266. /***/ (function(module, exports, __webpack_require__) {
  16267. "use strict";
  16268. exports.__esModule = true;
  16269. /**
  16270. * Contains helpers for safely splitting lists of CSS values,
  16271. * preserving parentheses and quotes.
  16272. *
  16273. * @example
  16274. * const list = postcss.list;
  16275. *
  16276. * @namespace list
  16277. */
  16278. var list = {
  16279. split: function split(string, separators, last) {
  16280. var array = [];
  16281. var current = '';
  16282. var split = false;
  16283. var func = 0;
  16284. var quote = false;
  16285. var escape = false;
  16286. for (var i = 0; i < string.length; i++) {
  16287. var letter = string[i];
  16288. if (quote) {
  16289. if (escape) {
  16290. escape = false;
  16291. } else if (letter === '\\') {
  16292. escape = true;
  16293. } else if (letter === quote) {
  16294. quote = false;
  16295. }
  16296. } else if (letter === '"' || letter === '\'') {
  16297. quote = letter;
  16298. } else if (letter === '(') {
  16299. func += 1;
  16300. } else if (letter === ')') {
  16301. if (func > 0) func -= 1;
  16302. } else if (func === 0) {
  16303. if (separators.indexOf(letter) !== -1) split = true;
  16304. }
  16305. if (split) {
  16306. if (current !== '') array.push(current.trim());
  16307. current = '';
  16308. split = false;
  16309. } else {
  16310. current += letter;
  16311. }
  16312. }
  16313. if (last || current !== '') array.push(current.trim());
  16314. return array;
  16315. },
  16316. /**
  16317. * Safely splits space-separated values (such as those for `background`,
  16318. * `border-radius`, and other shorthand properties).
  16319. *
  16320. * @param {string} string - space-separated values
  16321. *
  16322. * @return {string[]} split values
  16323. *
  16324. * @example
  16325. * postcss.list.space('1px calc(10% + 1px)') //=> ['1px', 'calc(10% + 1px)']
  16326. */
  16327. space: function space(string) {
  16328. var spaces = [' ', '\n', '\t'];
  16329. return list.split(string, spaces);
  16330. },
  16331. /**
  16332. * Safely splits comma-separated values (such as those for `transition-*`
  16333. * and `background` properties).
  16334. *
  16335. * @param {string} string - comma-separated values
  16336. *
  16337. * @return {string[]} split values
  16338. *
  16339. * @example
  16340. * postcss.list.comma('black, linear-gradient(white, black)')
  16341. * //=> ['black', 'linear-gradient(white, black)']
  16342. */
  16343. comma: function comma(string) {
  16344. var comma = ',';
  16345. return list.split(string, [comma], true);
  16346. }
  16347. };
  16348. exports.default = list;
  16349. module.exports = exports['default'];
  16350. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpc3QuZXM2Il0sIm5hbWVzIjpbImxpc3QiLCJzcGxpdCIsInN0cmluZyIsInNlcGFyYXRvcnMiLCJsYXN0IiwiYXJyYXkiLCJjdXJyZW50IiwiZnVuYyIsInF1b3RlIiwiZXNjYXBlIiwiaSIsImxlbmd0aCIsImxldHRlciIsImluZGV4T2YiLCJwdXNoIiwidHJpbSIsInNwYWNlIiwic3BhY2VzIiwiY29tbWEiXSwibWFwcGluZ3MiOiI7OztBQUFBOzs7Ozs7Ozs7QUFTQSxJQUFJQSxPQUFPO0FBRVBDLFNBRk8saUJBRURDLE1BRkMsRUFFT0MsVUFGUCxFQUVtQkMsSUFGbkIsRUFFeUI7QUFDNUIsWUFBSUMsUUFBVSxFQUFkO0FBQ0EsWUFBSUMsVUFBVSxFQUFkO0FBQ0EsWUFBSUwsUUFBVSxLQUFkOztBQUVBLFlBQUlNLE9BQVUsQ0FBZDtBQUNBLFlBQUlDLFFBQVUsS0FBZDtBQUNBLFlBQUlDLFNBQVUsS0FBZDs7QUFFQSxhQUFNLElBQUlDLElBQUksQ0FBZCxFQUFpQkEsSUFBSVIsT0FBT1MsTUFBNUIsRUFBb0NELEdBQXBDLEVBQTBDO0FBQ3RDLGdCQUFJRSxTQUFTVixPQUFPUSxDQUFQLENBQWI7O0FBRUEsZ0JBQUtGL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ICAgICAgICBsZXQgbGV0dGVyID0gc3RyaW5nW2ldO1xuXG4gICAgICAgICAgICBpZiAoIHF1b3RlICkge1xuICAgICAgICAgICAgICAgIGlmICggZXNjYXBlICkge1xuICAgICAgICAgICAgICAgICAgICBlc2NhcGUgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCBsZXR0ZXIgPT09ICdcXFxcJyApIHtcbiAgICAgICAgICAgICAgICAgICAgZXNjYXBlID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCBsZXR0ZXIgPT09IHF1b3RlICkge1xuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIGxldHRlciA9PT0gJ1wiJyB8fCBsZXR0ZXIgPT09ICdcXCcnICkge1xuICAgICAgICAgICAgICAgIHF1b3RlID0gbGV0dGVyO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggbGV0dGVyID09PSAnKCcgKSB7XG4gICAgICAgICAgICAgICAgZnVuYyArPSAxO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggbGV0dGVyID09PSAnKScgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBmdW5jID4gMCApIGZ1bmMgLT0gMTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIGZ1bmMgPT09IDAgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBzZXBhcmF0b3JzLmluZGV4T2YobGV0dGVyKSAhPT0gLTEgKSBzcGxpdCA9IHRydWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICggc3BsaXQgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBjdXJyZW50ICE9PSAnJyApIGFycmF5LnB1c2goY3VycmVudC50cmltKCkpO1xuICAgICAgICAgICAgICAgIGN1cnJlbnQgPSAnJztcbiAgICAgICAgICAgICAgICBzcGxpdCAgID0gZmFsc2U7XG4gICA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HJpbmcgLSBjb21tYS1zZXBhcmF0ZWQgdmFsdWVzXG4gICAgICpcbiAgICAgKiBAcmV0dXJuIHtzdHJpbmdbXX0gc3BsaXQgdmFsdWVzXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHBvc3Rjc3MubGlzdC5jb21tYSgnYmxhY2ssIGxpbmVhci1ncmFkaWVudCh3aGl0ZSwgYmxhY2spJylcbiAgICAgKiAvLz0+IFsnYmxhY2snLCAnbGluZWFyLWdyYWRpZW50KHdoaXRlLCBibGFjayknXVxuICAgICAqL1xuICAgIGNvbW1hKHN0cmluZykge1xuICAgICAgICBsZXQgY29tbWEgPSAnLCc7XG4gICAgICAgIHJldHVybiBsaXN0LnNwbGl0KHN0cmluZywgW2NvbW1hXSwgdHJ1ZSk7XG4gICAgfVxuXG59O1xuXG5leHBvcnQgZGVmYXVsdCBsaXN0O1xuIl19
  16351. /***/ }),
  16352. /* 133 */
  16353. /***/ (function(module, exports, __webpack_require__) {
  16354. "use strict";
  16355. /* WEBPACK VAR INJECTION */(function(Buffer) {
  16356. exports.__esModule = true;
  16357. var _sourceMap = __webpack_require__(50);
  16358. var _sourceMap2 = _interopRequireDefault(_sourceMap);
  16359. var _path = __webpack_require__(5);
  16360. var _path2 = _interopRequireDefault(_path);
  16361. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  16362. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16363. var MapGenerator = function () {
  16364. function MapGenerator(stringify, root, opts) {
  16365. _classCallCheck(this, MapGenerator);
  16366. this.stringify = stringify;
  16367. this.mapOpts = opts.map || {};
  16368. this.root = root;
  16369. this.opts = opts;
  16370. }
  16371. MapGenerator.prototype.isMap = function isMap() {
  16372. if (typeof this.opts.map !== 'undefined') {
  16373. return !!this.opts.map;
  16374. } else {
  16375. return this.previous().length > 0;
  16376. }
  16377. };
  16378. MapGenerator.prototype.previous = function previous() {
  16379. var _this = this;
  16380. if (!this.previousMaps) {
  16381. this.previousMaps = [];
  16382. this.root.walk(function (node) {
  16383. if (node.source && node.source.input.map) {
  16384. var map = node.source.input.map;
  16385. if (_this.previousMaps.indexOf(map) === -1) {
  16386. _this.previousMaps.push(map);
  16387. }
  16388. }
  16389. });
  16390. }
  16391. return this.previousMaps;
  16392. };
  16393. MapGenerator.prototype.isInline = function isInline() {
  16394. if (typeof this.mapOpts.inline !== 'undefined') {
  16395. return this.mapOpts.inline;
  16396. }
  16397. var annotation = this.mapOpts.annotation;
  16398. if (typeof annotation !== 'undefined' && annotation !== true) {
  16399. return false;
  16400. }
  16401. if (this.previous().length) {
  16402. return this.previous().some(function (i) {
  16403. return i.inline;
  16404. });
  16405. } else {
  16406. return true;
  16407. }
  16408. };
  16409. MapGenerator.prototype.isSourcesContent = function isSourcesContent() {
  16410. if (typeof this.mapOpts.sourcesContent !== 'undefined') {
  16411. return this.mapOpts.sourcesContent;
  16412. }
  16413. if (this.previous().length) {
  16414. return this.previous().some(function (i) {
  16415. return i.withContent();
  16416. });
  16417. } else {
  16418. return true;
  16419. }
  16420. };
  16421. MapGenerator.prototype.clearAnnotation = function clearAnnotation() {
  16422. if (this.mapOpts.annotation === false) return;
  16423. var node = void 0;
  16424. for (var i = this.root.nodes.length - 1; i >= 0; i--) {
  16425. node = this.root.nodes[i];
  16426. if (node.type !== 'comment') continue;
  16427. if (node.text.indexOf('# sourceMappingURL=') === 0) {
  16428. this.root.removeChild(i);
  16429. }
  16430. }
  16431. };
  16432. MapGenerator.prototype.setSourcesContent = function setSourcesContent() {
  16433. var _this2 = this;
  16434. var already = {};
  16435. this.root.walk(function (node) {
  16436. if (node.source) {
  16437. var from = node.source.input.from;
  16438. if (from && !already[from]) {
  16439. already[from] = true;
  16440. var relative = _this2.relative(from);
  16441. _this2.map.setSourceContent(relative, node.source.input.css);
  16442. }
  16443. }
  16444. });
  16445. };
  16446. MapGenerator.prototype.applyPrevMaps = function applyPrevMaps() {
  16447. for (var _iterator = this.previous(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  16448. var _ref;
  16449. if (_isArray) {
  16450. if (_i >= _iterator.length) break;
  16451. _ref = _iterator[_i++];
  16452. } else {
  16453. _i = _iterator.next();
  16454. if (_i.done) break;
  16455. _ref = _i.value;
  16456. }
  16457. var prev = _ref;
  16458. var from = this.relative(prev.file);
  16459. var root = prev.root || _path2.default.dirname(prev.file);
  16460. var map = void 0;
  16461. if (this.mapOpts.sourcesContent === false) {
  16462. map = new _sourceMap2.default.SourceMapConsumer(prev.text);
  16463. if (map.sourcesContent) {
  16464. map.sourcesContent = map.sourcesContent.map(function () {
  16465. return null;
  16466. });
  16467. }
  16468. } else {
  16469. map = prev.consumer();
  16470. }
  16471. this.map.applySourceMap(map, from, this.relative(root));
  16472. }
  16473. };
  16474. MapGenerator.prototype.isAnnotation = function isAnnotation() {
  16475. if (this.isInline()) {
  16476. return true;
  16477. } else if (typeof this.mapOpts.annotation !== 'undefined') {
  16478. return this.mapOpts.annotation;
  16479. } else if (this.previous().length) {
  16480. return this.previous().some(function (i) {
  16481. return i.annotation;
  16482. });
  16483. } else {
  16484. return true;
  16485. }
  16486. };
  16487. MapGenerator.prototype.toBase64 = function toBase64(str) {
  16488. if (Buffer) {
  16489. if (Buffer.from && Buffer.from !== Uint8Array.from) {
  16490. return Buffer.from(str).toString('base64');
  16491. } else {
  16492. return new Buffer(str).toString('base64');
  16493. }
  16494. } else {
  16495. return window.btoa(unescape(encodeURIComponent(str)));
  16496. }
  16497. };
  16498. MapGenerator.prototype.addAnnotation = function addAnnotation() {
  16499. var content = void 0;
  16500. if (this.isInline()) {
  16501. content = 'data:application/json;base64,' + this.toBase64(this.map.toString());
  16502. } else if (typeof this.mapOpts.annotation === 'string') {
  16503. content = this.mapOpts.annotation;
  16504. } else {
  16505. content = this.outputFile() + '.map';
  16506. }
  16507. var eol = '\n';
  16508. if (this.css.indexOf('\r\n') !== -1) eol = '\r\n';
  16509. this.css += eol + '/*# sourceMappingURL=' + content + ' */';
  16510. };
  16511. MapGenerator.prototype.outputFile = function outputFile() {
  16512. if (this.opts.to) {
  16513. return this.relative(this.opts.to);
  16514. } else if (this.opts.from) {
  16515. return this.relative(this.opts.from);
  16516. } else {
  16517. return 'to.css';
  16518. }
  16519. };
  16520. MapGenerator.prototype.generateMap = function generateMap() {
  16521. this.generateString();
  16522. if (this.isSourcesContent()) this.setSourcesContent();
  16523. if (this.previous().length > 0) this.applyPrevMaps();
  16524. if (this.isAnnotation()) this.addAnnotation();
  16525. if (this.isInline()) {
  16526. return [this.css];
  16527. } else {
  16528. return [this.css, this.map];
  16529. }
  16530. };
  16531. MapGenerator.prototype.relative = function relative(file) {
  16532. if (file.indexOf('<') === 0) return file;
  16533. if (/^\w+:\/\//.test(file)) return file;
  16534. var from = this.opts.to ? _path2.default.dirname(this.opts.to) : '.';
  16535. if (typeof this.mapOpts.annotation === 'string') {
  16536. from = _path2.default.dirname(_path2.default.resolve(from, this.mapOpts.annotation));
  16537. }
  16538. file = _path2.default.relative(from, file);
  16539. if (_path2.default.sep === '\\') {
  16540. return file.replace(/\\/g, '/');
  16541. } else {
  16542. return file;
  16543. }
  16544. };
  16545. MapGenerator.prototype.sourcePath = function sourcePath(node) {
  16546. if (this.mapOpts.from) {
  16547. return this.mapOpts.from;
  16548. } else {
  16549. return this.relative(node.source.input.from);
  16550. }
  16551. };
  16552. MapGenerator.prototype.generateString = function generateString() {
  16553. var _this3 = this;
  16554. this.css = '';
  16555. this.map = new _sourceMap2.default.SourceMapGenerator({ file: this.outputFile() });
  16556. var line = 1;
  16557. var column = 1;
  16558. var lines = void 0,
  16559. last = void 0;
  16560. this.stringify(this.root, function (str, node, type) {
  16561. _this3.css += str;
  16562. if (node && type !== 'end') {
  16563. if (node.source && node.source.start) {
  16564. _this3.map.addMapping({
  16565. source: _this3.sourcePath(node),
  16566. generated: { line: line, column: column - 1 },
  16567. original: {
  16568. line: node.source.start.line,
  16569. column: node.source.start.column - 1
  16570. }
  16571. });
  16572. } else {
  16573. _this3.map.addMapping({
  16574. source: '<no source>',
  16575. original: { line: 1, column: 0 },
  16576. generated: { line: line, column: column - 1 }
  16577. });
  16578. }
  16579. }
  16580. lines = str.match(/\n/g);
  16581. if (lines) {
  16582. line += lines.length;
  16583. last = str.lastIndexOf('\n');
  16584. column = str.length - last;
  16585. } else {
  16586. column += str.length;
  16587. }
  16588. if (node && type !== 'start') {
  16589. if (node.source && node.source.end) {
  16590. _this3.map.addMapping({
  16591. source: _this3.sourcePath(node),
  16592. generated: { line: line, column: column - 1 },
  16593. original: {
  16594. line: node.source.end.line,
  16595. column: node.source.end.column
  16596. }
  16597. });
  16598. } else {
  16599. _this3.map.addMapping({
  16600. source: '<no source>',
  16601. original: { line: 1, column: 0 },
  16602. generated: { line: line, column: column - 1 }
  16603. });
  16604. }
  16605. }
  16606. });
  16607. };
  16608. MapGenerator.prototype.generate = function generate() {
  16609. this.clearAnnotation();
  16610. if (this.isMap()) {
  16611. return this.generateMap();
  16612. } else {
  16613. var result = '';
  16614. this.stringify(this.root, function (i) {
  16615. result += i;
  16616. });
  16617. return [result];
  16618. }
  16619. };
  16620. return MapGenerator;
  16621. }();
  16622. exports.default = MapGenerator;
  16623. module.exports = exports['default'];
  16624. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1hcC1nZW5lcmF0b3IuZXM2Il0sIm5hbWVzIjpbIk1hcEdlbmVyYXRvciIsInN0cmluZ2lmeSIsInJvb3QiLCJvcHRzIiwibWFwT3B0cyIsIm1hcCIsImlzTWFwIiwicHJldmlvdXMiLCJsZW5ndGgiLCJwcmV2aW91c01hcHMiLCJ3YWxrIiwibm9kZSIsInNvdXJjZSIsImlucHV0IiwiaW5kZXhPZiIsInB1c2giLCJpc0lubGluZSIsImlubGluZSIsImFubm90YXRpb24iLCJzb21lIiwiaSIsImlzU291cmNlc0Nvbn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1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcHJldmlvdXMoKSB7XG4gICAgICAgIGlmICggIXRoaXMucHJldmlvdXNNYXBzICkge1xuICAgICAgICAgICAgdGhpcy5wcmV2aW91c01hcHMgPSBbXTtcbiAgICAgICAgICAgIHRoaXMucm9vdC53YWxrKCBub2RlID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoIG5vZGUuc291cmNlICYmIG5vZGUuc291cmNlLmlucHV0Lm1hcCApIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IG1hcCA9IG5vZGUuc291cmNlLmlucHV0Lm1hcDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCB0aGlzLnByZXZpb3VzTWFwcy5pbmRleE9mKG1hcCkgPT09IC0xICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wcmV2aW91c01hcHMucHVzaChtYXApO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGhpcy5wcmV2aW91c01hcHM7XG4gICAgfVxuXG4gICAgaXNJbmxpbmUoKSB7XG4gICAgICAgIGlmICggdHlwZW9mIHRoaXMubWFwT3B0cy5pbmxpbmUgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMubWFwT3B0cy5pbmxpbmU7XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgYW5ub3RhdGlvbiA9IHRoaXMubWFwT3B0cy5hbm5vdGF0aW9uO1xuICAgICAgICBpZiAoIHR5cGVvZiBhbm5vdGF0aW9uICE9PSAndW5kZWZpbmVkJyAmJiBhbm5vdGF0aW9uICE9PSB0cnVlICkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCB0aGlzLnByZXZpb3VzKCkubGVuZ3RoICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMucHJldmlvdXMoKS5zb21lKCBpID0+IGkuaW5saW5lICk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlzU291cmNlc0NvbnRlbnQoKSB7XG4gICAgICAgIGlmICggdHlwZW9mIHRoaXMubWFwT3B0cy5zb3VyY2VzQ29udGVudCAhPT0gJ3VuZGVmaW5lZCcgKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5tYXBPcHRzLnNvdXJjZXNDb250ZW50O1xuICAgICAgICB9XG4gICAgICAgIGlmICggdGhpcy5wcmV2aW91cygpLmxlbmd0aCApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnByZXZpb3VzKCkuc29tZSggaSA9PiBpLndpdGhDb250ZW50KCkgKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgY2xlYXJBbm5vdGF0aW9uKCkge1xuICAgICAgICBpZiAoIHRoaXMubWFwT3B0cy5hbm5vdGF0aW9uID09PSBmYWxzZSApIHJldHVybjtcblxuICAgICAgICBsZXQgbm9kZTtcbiAgICAgICAgZm9yICggbGV0IGkgPSB0aGlzLnJvb3Qubm9kZXMubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0gKSB7XG4gICAgICAgICAgICBub2RlID0gdGhpcy5yb290Lm5vZGVzW2ldO1xuICAgICAgICAgICAgaWYgKCBub2RlLnR5cGUgIT09ICdjb21tZW50JyApIGNvbnRpbnVlO1xuICAgICAgICAgICAgaWYgKCBub2RlLnRleHQuaW5kZXhPZignIyBzb3VyY2VNYXBwaW5nVVJMPScpID09PSAwICkge1xuICAgICAgICAgICAgICAgIHRoaXMucm9vdC5yZW1vdmVDaGlsZChpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIHNldFNvdXJjZXNDb250ZW50KCkge1xuICAgICAgICBsZXQgYWxyZWFkeSA9IHsgfTtcbiAgICAgICAgdGhpcy5yb290LndhbGsoIG5vZGUgPT4ge1xuICAgICAgICAgICAgaWYgKCBub2RlLnNvdXJjZSApIHtcbiAgICAgICAgICAgICAgICBsZXQgZnJvbSA9IG5vZGUuc291cmNlLmlucHV0LmZyb207XG4gICAgICAgICAgICAgICAgaWYgKCBmcm9tICYmICFhbHJlYWR5W2Zyb21dICkge1xuICAgICAgICAgICAgICAgICAgICBhbHJlYWR5W2Zyb21dID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlbGF0aXZlID0gdGhpcy5yZWxhdGl2ZShmcm9tKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tYXAuc2V0U291cmNlQ29udGVudChyZWxhdGl2ZSwgbm9kZS5zb3VyY2UuaW5wdXQuY3NzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFwcGx5UHJldk1hcHMoKSB7XG4gICAgICAgIGZvciAoIGxldCBwcmV2IG9mIHRoaXMucHJldmlvdXMoKSApIHtcbiAgICAgICAgICAgIGxldCBmcm9tID0gdGhpcy5yZWxhdGl2ZShwcmV2LmZpbGUpO1xuICAgICAgICAgICAgbGV0IHJvb3QgPSBwcmV2LnJvb3QgfHwgcGF0aC5kaXJuYW1lKHByZXYuZmlsZSk7XG4gICAgICAgICAgICBsZXQgbWFwO1xuXG4gICAgICAgICAgICBpZiAoIHRoaXMubWFwT3B0cy5zb3VyY2VzQ29udGVudCA9PT0gZmFsc2UgKSB7XG4gICAgICAgICAgICAgICAgbWFwID0gbmV3IG1vemlsbGEuU291cmNlTWFwQ29uc3VtZXIocHJldi50ZXh0KTtcbiAgICAgICAgICAgICAgICBpZiAoIG1hcC5zb3VyY2VzQ29udGVudCApIHtcbiAgICAgICAgICAgICAgICAgICAgbWFwLnNvdXJjZXNDb250ZW50ID0gbWFwLnNvdXJjZXNDb250ZW50Lm1hcCggKCkgPT4gbnVsbCApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbWFwID0gcHJldi5jb25zdW1lcigpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0aGlzLm1hcC5hcHBseVNvdXJjZU1hcChtYXAsIGZyb20sIHRoaXMucmVsYXRpdmUocm9vdCkpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgaXNBbm5vdGF0aW9uKCkge1xuICAgICAgICBpZiAoIHRoaXMuaXNJbmxpbmUoKSApIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9IGVsc2UgaWYgKCB0eXBlb2YgdGhpcy5tYXBPcHRzLmFubm90YXRpb24gIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMubWFwT3B0cy5hbm5vdGF0aW9uO1xuICAgICAgICB9IGVsc2UgaWYgKCB0aGlzLnByZXZpb3VzKCkubGVuZ3RoICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMucHJldmlvdXMoKS5zb21lKCBpID0+IGkuYW5ub3RhdGlvbiApO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB0b0Jhc2U2NChzdHIpIHtcbiAgICAgICAgaWYgKCBCdWZmZXIgKSB7XG4gICAgICAgICAgICBpZiAoIEJ1ZmZlci5mcm9tICYmIEJ1ZmZlci5mcm9tICE9PSBVaW50OEFycmF5LmZyb20gKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEJ1ZmZlci5mcm9tKHN0cikudG9TdHJpbmcoJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IEJ1ZmZlcihzdHIpLnRvU3RyaW5nKCdiYXNlNjQnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB3aW5kb3cuYnRvYSh1bmVzY2FwZShlbmNvZGVVUklDb21wb25lbnQoc3RyKSkpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgYWRkQW5ub3RhdGlvbigpIHtcbiAgICAgICAgbGV0IGNvbnRlbnQ7XG5cbiAgICAgICAgaWYgKCB0aGlzLmlzSW5saW5lKCkgKSB7XG5cbiAgICAgICAgICAgIGNvbnRlbnQgPSAnZGF0YTphcHBsaWNhdGlvbi9qc29uO2Jhc2U2NCwnICtcbiAgICAgICAgICAgICAgICB0aGlzLnRvQmFzZTY0KHRoaXMubWFwLnRvU3RyaW5nKCkpO1xuXG4gICAgICAgIH0gZWxzZSBpZiAoIHR5cGVvZiB0aGlzLm1hcE9wdHMuYW5ub3RhdGlvbiA9PT0gJ3N0cmluZycgKSB7XG4gICAgICAgICAgICBjb250ZW50ID0gdGhpcy5tYXBPcHRzLmFubm90YXRpb247XG5cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnRlbnQgPSB0aGlzLm91dHB1dEZpbGUoKSArICcubWFwJztcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCBlb2wgICA9ICdcXG4nO1xuICAgICAgICBpZiAoIHRoaXMuY3NzLmluZGV4T2YoJ1xcclxcbicpICE9PSAtMSApIGVvbCA9ICdcXHJcXG4nO1xuXG4gICAgICAgIHRoaXMuY3NzICs9IGVvbCArICcvKiMgc291cmNlTWFwcGluZ1VSTD0nICsgY29udGVudCArICcgKi8nO1xuICAgIH1cblxuICAgIG91dHB1dEZpbGUoKSB7XG4gICAgICAgIGlmICggdGhpcy5vcHRzLnRvICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMucmVsYXRpdmUodGhpcy5vcHRzLnRvKTtcbiAgICAgICAgfSBlbHNlIGlmICggdGhpcy5vcHRzLmZyb20gKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5yZWxhdGl2ZSh0aGlzLm9wdHMuZnJvbSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gJ3RvLmNzcyc7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBnZW5lcmF0ZU1hcCgpIHtcbiAgICAgICAgdGhpcy5nZW5lcmF0ZVN0cmluZygpO1xuICAgICAgICBpZiAoIHRoaXMuaXNTb3VyY2VzQ29udGVudCgpICkgICAgdGhpcy5zZXRTb3VyY2VzQ29udGVudCgpO1xuICAgICAgICBpZiAoIHRoaXMucHJldmlvdXMoKS5sZW5ndGggPiAwICkgdGhpcy5hcHBseVByZXZNYXBzKCk7XG4gICAgICAgIGlmICggdGhpcy5pc0Fubm90YXRpb24oKSApICAgICAgICB0aGlzLmFkZEFubm90YXRpb24oKTtcblxuICAgICAgICBpZiAoIHRoaXMuaXNJbmxpbmUoKSApIHtcbiAgICAgICAgICAgIHJldHVybiBbdGhpcy5jc3NdO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIFt0aGlzLmNzcywgdGhpcy5tYXBdO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmVsYXRpdmUoZmlsZSkge1xuICAgICAgICBpZiAoIGZpbGUuaW5kZXhPZignPCcpID09PSAwICkgcmV0dXJuIGZpbGU7XG4gICAgICAgIGlmICggL15cXHcrOlxcL1xcLy8udGVzdChmaWxlKSApIHJldHVybiBmaWxlO1xuXG4gICAgICAgIGxldCBmcm9tID0gdGhpcy5vcHRzLnRvID8gcGF0aC5kaXJuYW1lKHRoaXMub3B0cy50bykgOiAnLic7XG5cbiAgICAgICAgaWYgKCB0eXBlb2YgdGhpcy5tYXBPcHRzLmFubm90YXRpb24gPT09ICdzdHJpbmcnICkge1xuICAgICAgICAgICAgZnJvbSA9IHBhdGguZGlybmFtZSggcGF0aC5yZXNvbHZlKGZyb20sIHRoaXMubWFwT3B0cy5hbm5vdGF0aW9uKSApO1xuICAgICAgICB9XG5cbiAgICAgICAgZmlsZSA9IHBhdGgucmVsYXRpdmUoZnJvbSwgZmlsZSk7XG4gICAgICAgIGlmICggcGF0aC5zZXAgPT09ICdcXFxcJyApIHtcbiAgICAgICAgICAgIHJldHVybiBmaWxlLnJlcGxhY2UoL1xcXFwvZywgJy8nKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBmaWxlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgc291cmNlUGF0aChub2RlKSB7XG4gICAgICAgIGlmICggdGhpcy5tYXBPcHRzLmZyb20gKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5tYXBPcHRzLmZyb207XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5yZWxhdGl2ZShub2RlLnNvdXJjZS5pbnB1dC5mcm9tKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGdlbmVyYXRlU3RyaW5nKCkge1xuICAgICAgICB0aGlzLmNzcyA9ICcnO1xuICAgICAgICB0aGlzLm1hcCA9IG5ldyBtb3ppbGxhLlNvdXJjZU1hcEdlbmVyYXRvcih7IGZpbGU6IHRoaXMub3V0cHV0RmlsZSgpIH0pO1xuXG4gICAgICAgIGxldCBsaW5lICAgPSAxO1xuICAgICAgICBsZXQgY29sdW1uID0gMTtcblxuICAgICAgICBsZXQgbGluZXMsIGxhc3Q7XG4gICAgICAgIHRoaXMuc3RyaW5naWZ5KHRoaXMucm9vdCwgKHN0ciwgbm9kZSwgdHlwZSkgPT4ge1xuICAgICAgICAgICAgdGhpcy5jc3MgKz0gc3RyO1xuXG4gICAgICAgICAgICBpZiAoIG5vZGUgJiYgdHlwZSAhPT0gJ2VuZCcgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBub2RlLnNvdXJjZSAmJiBub2RlLnNvdXJjZS5zdGFydCApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tYXAuYWRkTWFwcGluZyh7XG4gICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2U6ICAgIHRoaXMuc291cmNlUGF0aChub2RlKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGdlbmVyYXRlZDogeyBsaW5lLCBjb2x1bW46IGNvbHVtbiAtIDEgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9yaWdpbmFsOiAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmU6ICAgbm9kZS5zb3VyY2Uuc3RhcnQubGluZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW46IG5vZGUuc291cmNlLnN0YXJ0LmNvbHVtbiAtIDFcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tYXAuYWRkTWFwcGluZyh7XG4gICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2U6ICAgICc8bm8gc291cmNlPicsXG4gICAgICAgICAgICAgICAgICAgICAgICBvcmlnaW5hbDogIHsgbGluZTogMSwgY29sdW1uOiAwIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBnZW5lcmF0ZWQ6IHsgbGluZSwgY29sdW1uOiBjb2x1bW4gLSAxIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBsaW5lcyA9IHN0ci5tYXRjaCgvXFxuL2cpO1xuICAgICAgICAgICAgaWYgKCBsaW5lcyApIHtcbiAgICAgICAgICAgICAgICBsaW5lICArPSBsaW5lcy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgbGFzdCAgID0gc3RyLmxhc3RJbmRleE9mKCdcXG4nKTtcbiAgICAgICAgICAgICAgICBjb2x1bW4gPSBzdHIubGVuZ3RoIC0gbGFzdDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgY29sdW1uICs9IHN0ci5sZW5ndGg7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICggbm9kZSAmJiB0eXBlICE9PSAnc3RhcnQnICkge1xuICAgICAgICAgICAgICAgIGlmICggbm9kZS5zb3VyY2UgJiYgbm9kZS5zb3VyY2UuZW5kICkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm1hcC5hZGRNYXBwaW5nKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZTogICAgdGhpcy5zb3VyY2VQYXRoKG5vZGUpLFxuICAgICAgICAgICAgICAgICAgICAgICAgZ2VuZXJhdGVkOiB7IGxpbmUsIGNvbHVtbjogY29sdW1uIC0gMSB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgb3JpZ2luYWw6ICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZTogICBub2RlLnNvdXJjZS5lbmQubGluZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2x1bW46IG5vZGUuc291cmNlLmVuZC5jb2x1bW5cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tYXAuYWRkTWFwcGluZyh7XG4gICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2U6ICAgICc8bm8gc291cmNlPicsXG4gICAgICAgICAgICAgICAgICAgICAgICBvcmlnaW5hbDogIHsgbGluZTogMSwgY29sdW1uOiAwIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBnZW5lcmF0ZWQ6IHsgbGluZSwgY29sdW1uOiBjb2x1bW4gLSAxIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBnZW5lcmF0ZSgpIHtcbiAgICAgICAgdGhpcy5jbGVhckFubm90YXRpb24oKTtcblxuICAgICAgICBpZiAoIHRoaXMuaXNNYXAoKSApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLmdlbmVyYXRlTWFwKCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0gJyc7XG4gICAgICAgICAgICB0aGlzLnN0cmluZ2lmeSh0aGlzLnJvb3QsIGkgPT4ge1xuICAgICAgICAgICAgICAgIHJlc3VsdCArPSBpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXR1cm4gW3Jlc3VsdF07XG4gICAgICAgIH1cbiAgICB9XG5cbn1cbiJdfQ==
  16625. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(15).Buffer))
  16626. /***/ }),
  16627. /* 134 */
  16628. /***/ (function(module, exports, __webpack_require__) {
  16629. "use strict";
  16630. /* WEBPACK VAR INJECTION */(function(Buffer) {
  16631. exports.__esModule = true;
  16632. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  16633. var _sourceMap = __webpack_require__(50);
  16634. var _sourceMap2 = _interopRequireDefault(_sourceMap);
  16635. var _path = __webpack_require__(5);
  16636. var _path2 = _interopRequireDefault(_path);
  16637. var _fs = __webpack_require__(176);
  16638. var _fs2 = _interopRequireDefault(_fs);
  16639. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  16640. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16641. function fromBase64(str) {
  16642. if (Buffer) {
  16643. if (Buffer.from && Buffer.from !== Uint8Array.from) {
  16644. return Buffer.from(str, 'base64').toString();
  16645. } else {
  16646. return new Buffer(str, 'base64').toString();
  16647. }
  16648. } else {
  16649. return window.atob(str);
  16650. }
  16651. }
  16652. /**
  16653. * Source map information from input CSS.
  16654. * For example, source map after Sass compiler.
  16655. *
  16656. * This class will automatically find source map in input CSS or in file system
  16657. * near input file (according `from` option).
  16658. *
  16659. * @example
  16660. * const root = postcss.parse(css, { from: 'a.sass.css' });
  16661. * root.input.map //=> PreviousMap
  16662. */
  16663. var PreviousMap = function () {
  16664. /**
  16665. * @param {string} css - input CSS source
  16666. * @param {processOptions} [opts] - {@link Processor#process} options
  16667. */
  16668. function PreviousMap(css, opts) {
  16669. _classCallCheck(this, PreviousMap);
  16670. this.loadAnnotation(css);
  16671. /**
  16672. * @member {boolean} - Was source map inlined by data-uri to input CSS.
  16673. */
  16674. this.inline = this.startWith(this.annotation, 'data:');
  16675. var prev = opts.map ? opts.map.prev : undefined;
  16676. var text = this.loadMap(opts.from, prev);
  16677. if (text) this.text = text;
  16678. }
  16679. /**
  16680. * Create a instance of `SourceMapGenerator` class
  16681. * from the `source-map` library to work with source map information.
  16682. *
  16683. * It is lazy method, so it will create object only on first call
  16684. * and then it will use cache.
  16685. *
  16686. * @return {SourceMapGenerator} object with source map information
  16687. */
  16688. PreviousMap.prototype.consumer = function consumer() {
  16689. if (!this.consumerCache) {
  16690. this.consumerCache = new _sourceMap2.default.SourceMapConsumer(this.text);
  16691. }
  16692. return this.consumerCache;
  16693. };
  16694. /**
  16695. * Does source map contains `sourcesContent` with input source text.
  16696. *
  16697. * @return {boolean} Is `sourcesContent` present
  16698. */
  16699. PreviousMap.prototype.withContent = function withContent() {
  16700. return !!(this.consumer().sourcesContent && this.consumer().sourcesContent.length > 0);
  16701. };
  16702. PreviousMap.prototype.startWith = function startWith(string, start) {
  16703. if (!string) return false;
  16704. return string.substr(0, start.length) === start;
  16705. };
  16706. PreviousMap.prototype.loadAnnotation = function loadAnnotation(css) {
  16707. var match = css.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//);
  16708. if (match) this.annotation = match[1].trim();
  16709. };
  16710. PreviousMap.prototype.decodeInline = function decodeInline(text) {
  16711. // data:application/json;charset=utf-8;base64,
  16712. // data:application/json;charset=utf8;base64,
  16713. // data:application/json;base64,
  16714. var baseUri = /^data:application\/json;(?:charset=utf-?8;)?base64,/;
  16715. var uri = 'data:application/json,';
  16716. if (this.startWith(text, uri)) {
  16717. return decodeURIComponent(text.substr(uri.length));
  16718. } else if (baseUri.test(text)) {
  16719. return fromBase64(text.substr(RegExp.lastMatch.length));
  16720. } else {
  16721. var encoding = text.match(/data:application\/json;([^,]+),/)[1];
  16722. throw new Error('Unsupported source map encoding ' + encoding);
  16723. }
  16724. };
  16725. PreviousMap.prototype.loadMap = function loadMap(file, prev) {
  16726. if (prev === false) return false;
  16727. if (prev) {
  16728. if (typeof prev === 'string') {
  16729. return prev;
  16730. } else if (typeof prev === 'function') {
  16731. var prevPath = prev(file);
  16732. if (prevPath && _fs2.default.existsSync && _fs2.default.existsSync(prevPath)) {
  16733. return _fs2.default.readFileSync(prevPath, 'utf-8').toString().trim();
  16734. } else {
  16735. throw new Error('Unable to load previous source map: ' + prevPath.toString());
  16736. }
  16737. } else if (prev instanceof _sourceMap2.default.SourceMapConsumer) {
  16738. return _sourceMap2.default.SourceMapGenerator.fromSourceMap(prev).toString();
  16739. } else if (prev instanceof _sourceMap2.default.SourceMapGenerator) {
  16740. return prev.toString();
  16741. } else if (this.isMap(prev)) {
  16742. return JSON.stringify(prev);
  16743. } else {
  16744. throw new Error('Unsupported previous source map format: ' + prev.toString());
  16745. }
  16746. } else if (this.inline) {
  16747. return this.decodeInline(this.annotation);
  16748. } else if (this.annotation) {
  16749. var map = this.annotation;
  16750. if (file) map = _path2.default.join(_path2.default.dirname(file), map);
  16751. this.root = _path2.default.dirname(map);
  16752. if (_fs2.default.existsSync && _fs2.default.existsSync(map)) {
  16753. return _fs2.default.readFileSync(map, 'utf-8').toString().trim();
  16754. } else {
  16755. return false;
  16756. }
  16757. }
  16758. };
  16759. PreviousMap.prototype.isMap = function isMap(map) {
  16760. if ((typeof map === 'undefined' ? 'undefined' : _typeof(map)) !== 'object') return false;
  16761. return typeof map.mappings === 'string' || typeof map._mappings === 'string';
  16762. };
  16763. return PreviousMap;
  16764. }();
  16765. exports.default = PreviousMap;
  16766. module.exports = exports['default'];
  16767. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByZXZpb3VzLW1hcC5lczYiXSwibmFtZXMiOlsiZnJvbUJhc2U2NCIsInN0ciIsIkJ1ZmZlciIsImZyb20iLCJVaW50OEFycmF5IiwidG9TdHJpbmciLCJ3aW5kb3ciLCJhdG9iIiwiUHJldmlvdXNNYXAiLCJjc3MiLCJvcHRzIiwibG9hZEFubm90YXRpb24iLCJpbmxpbmUiLCJzdGFydFdpdGgiLCJhbm5vdGF0aW9uIiwicHJldiIsIm1hcCIsInVuZGVmaW5lZCIsInRleHQiLCJsb2FkTWFwIiwiY29uc3VtZXIiLCJjb25zdW1lckNhY2hlIiwiU291cmNlTWFwQ29uc3VtZXIiLCJ3aXRoQ29udGVudCIsInNvdXJjZXNDb250ZW50IiwibGVuZ3RoIiwic3RyaW5nIiwic3RhcnQiLCJzdWJzdHIiLCJtYXRjaCIsInRyaW0iLCJkZWNvZGVJbmxpbmUiLCJiYXNlVXJpIiwidXJpIiwiZGVjb2RlVVJJQ29tcG9uZW50IiwidGVzdCIsIlJlZ0V4cCIsImxhc3RNYXRjaCIsImVuY29kaW5nIiwiRXJyb3IiLCJmaWxlIiwicHJldlBhdGgiLCJleGlzdHNTeW5jIiwicmVhZEZpbGVTeW5jIiwiU291cmNlTWFwR2VuZXJhdG9yIiwiZnJvbVNvdXJjZU1hcCIsImlzTWFwIiwiSlNPTiIsInN0cmluZ2lmeSIsImpvaW4iLCJkaXJuYW1lIiwicm9vdCIsIm1hcHBpbmdzIiwiX21hcHBpbmdzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQTs7OztBQUNBOzs7O0FBQ0E7Ozs7Ozs7O0FBRUEsU0FBU0EsVUFBVCxDQUFvQkMsR0FBcEIsRUFBeUI7QUFDckIsUUFBS0M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gIH1cbiAgICB9XG5cbiAgICBsb2FkTWFwKGZpbGUsIHByZXYpIHtcbiAgICAgICAgaWYgKCBwcmV2ID09PSBmYWxzZSApIHJldHVybiBmYWxzZTtcblxuICAgICAgICBpZiAoIHByZXYgKSB7XG4gICAgICAgICAgICBpZiAoIHR5cGVvZiBwcmV2ID09PSAnc3RyaW5nJyApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcHJldjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHR5cGVvZiBwcmV2ID09PSAnZnVuY3Rpb24nICkge1xuICAgICAgICAgICAgICAgIGxldCBwcmV2UGF0aCA9IHByZXYoZmlsZSk7XG4gICAgICAgICAgICAgICAgaWYgKCBwcmV2UGF0aCAmJiBmcy5leGlzdHNTeW5jICYmIGZzLmV4aXN0c1N5bmMocHJldlBhdGgpICkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnMucmVhZEZpbGVTeW5jKHByZXZQYXRoLCAndXRmLTgnKS50b1N0cmluZygpLnRyaW0oKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1VuYWJsZSB0byBsb2FkIHByZXZpb3VzIHNvdXJjZSBtYXA6ICcgK1xuICAgICAgICAgICAgICAgICAgICBwcmV2UGF0aC50b1N0cmluZygpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBwcmV2IGluc3RhbmNlb2YgbW96aWxsYS5Tb3VyY2VNYXBDb25zdW1lciApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbW96aWxsYS5Tb3VyY2VNYXBHZW5lcmF0b3JcbiAgICAgICAgICAgICAgICAgICAgLmZyb21Tb3VyY2VNYXAocHJldikudG9TdHJpbmcoKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHByZXYgaW5zdGFuY2VvZiBtb3ppbGxhLlNvdXJjZU1hcEdlbmVyYXRvciApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcHJldi50b1N0cmluZygpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggdGhpcy5pc01hcChwcmV2KSApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkocHJldik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVW5zdXBwb3J0ZWQgcHJldmlvdXMgc291cmNlIG1hcCBmb3JtYXQ6ICcgK1xuICAgICAgICAgICAgICAgICAgICBwcmV2LnRvU3RyaW5nKCkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgIH0gZWxzZSBpZiAoIHRoaXMuaW5saW5lICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuZGVjb2RlSW5saW5lKHRoaXMuYW5ub3RhdGlvbik7XG5cbiAgICAgICAgfSBlbHNlIGlmICggdGhpcy5hbm5vdGF0aW9uICkge1xuICAgICAgICAgICAgbGV0IG1hcCA9IHRoaXMuYW5ub3RhdGlvbjtcbiAgICAgICAgICAgIGlmICggZmlsZSApIG1hcCA9IHBhdGguam9pbihwYXRoLmRpcm5hbWUoZmlsZSksIG1hcCk7XG5cbiAgICAgICAgICAgIHRoaXMucm9vdCA9IHBhdGguZGlybmFtZShtYXApO1xuICAgICAgICAgICAgaWYgKCBmcy5leGlzdHNTeW5jICYmIGZzLmV4aXN0c1N5bmMobWFwKSApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZnMucmVhZEZpbGVTeW5jKG1hcCwgJ3V0Zi04JykudG9TdHJpbmcoKS50cmltKCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlzTWFwKG1hcCkge1xuICAgICAgICBpZiAoIHR5cGVvZiBtYXAgIT09ICdvYmplY3QnICkgcmV0dXJuIGZhbHNlO1xuICAgICAgICByZXR1cm4gdHlwZW9mIG1hcC5tYXBwaW5ncyA9PT0gJ3N0cmluZycgfHxcbiAgICAgICAgICAgICAgIHR5cGVvZiBtYXAuX21hcHBpbmdzID09PSAnc3RyaW5nJztcbiAgICB9XG59XG5cbmV4cG9ydCBkZWZhdWx0IFByZXZpb3VzTWFwO1xuIl19
  16768. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(15).Buffer))
  16769. /***/ }),
  16770. /* 135 */
  16771. /***/ (function(module, exports, __webpack_require__) {
  16772. "use strict";
  16773. exports.__esModule = true;
  16774. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  16775. var _lazyResult = __webpack_require__(40);
  16776. var _lazyResult2 = _interopRequireDefault(_lazyResult);
  16777. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  16778. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16779. /**
  16780. * Contains plugins to process CSS. Create one `Processor` instance,
  16781. * initialize its plugins, and then use that instance on numerous CSS files.
  16782. *
  16783. * @example
  16784. * const processor = postcss([autoprefixer, precss]);
  16785. * processor.process(css1).then(result => console.log(result.css));
  16786. * processor.process(css2).then(result => console.log(result.css));
  16787. */
  16788. var Processor = function () {
  16789. /**
  16790. * @param {Array.<Plugin|pluginFunction>|Processor} plugins - PostCSS
  16791. * plugins. See {@link Processor#use} for plugin format.
  16792. */
  16793. function Processor() {
  16794. var plugins = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  16795. _classCallCheck(this, Processor);
  16796. /**
  16797. * @member {string} - Current PostCSS version.
  16798. *
  16799. * @example
  16800. * if ( result.processor.version.split('.')[0] !== '6' ) {
  16801. * throw new Error('This plugin works only with PostCSS 6');
  16802. * }
  16803. */
  16804. this.version = '6.0.21';
  16805. /**
  16806. * @member {pluginFunction[]} - Plugins added to this processor.
  16807. *
  16808. * @example
  16809. * const processor = postcss([autoprefixer, precss]);
  16810. * processor.plugins.length //=> 2
  16811. */
  16812. this.plugins = this.normalize(plugins);
  16813. }
  16814. /**
  16815. * Adds a plugin to be used as a CSS processor.
  16816. *
  16817. * PostCSS plugin can be in 4 formats:
  16818. * * A plugin created by {@link postcss.plugin} method.
  16819. * * A function. PostCSS will pass the function a @{link Root}
  16820. * as the first argument and current {@link Result} instance
  16821. * as the second.
  16822. * * An object with a `postcss` method. PostCSS will use that method
  16823. * as described in #2.
  16824. * * Another {@link Processor} instance. PostCSS will copy plugins
  16825. * from that instance into this one.
  16826. *
  16827. * Plugins can also be added by passing them as arguments when creating
  16828. * a `postcss` instance (see [`postcss(plugins)`]).
  16829. *
  16830. * Asynchronous plugins should return a `Promise` instance.
  16831. *
  16832. * @param {Plugin|pluginFunction|Processor} plugin - PostCSS plugin
  16833. * or {@link Processor}
  16834. * with plugins
  16835. *
  16836. * @example
  16837. * const processor = postcss()
  16838. * .use(autoprefixer)
  16839. * .use(precss);
  16840. *
  16841. * @return {Processes} current processor to make methods chain
  16842. */
  16843. Processor.prototype.use = function use(plugin) {
  16844. this.plugins = this.plugins.concat(this.normalize([plugin]));
  16845. return this;
  16846. };
  16847. /**
  16848. * Parses source CSS and returns a {@link LazyResult} Promise proxy.
  16849. * Because some plugins can be asynchronous it doesn’t make
  16850. * any transformations. Transformations will be applied
  16851. * in the {@link LazyResult} methods.
  16852. *
  16853. * @param {string|toString|Result} css - String with input CSS or
  16854. * any object with a `toString()`
  16855. * method, like a Buffer.
  16856. * Optionally, send a {@link Result}
  16857. * instance and the processor will
  16858. * take the {@link Root} from it.
  16859. * @param {processOptions} [opts] - options
  16860. *
  16861. * @return {LazyResult} Promise proxy
  16862. *
  16863. * @example
  16864. * processor.process(css, { from: 'a.css', to: 'a.out.css' })
  16865. * .then(result => {
  16866. * console.log(result.css);
  16867. * });
  16868. */
  16869. Processor.prototype.process = function process(css) {
  16870. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16871. return new _lazyResult2.default(this, css, opts);
  16872. };
  16873. Processor.prototype.normalize = function normalize(plugins) {
  16874. var normalized = [];
  16875. for (var _iterator = plugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  16876. var _ref;
  16877. if (_isArray) {
  16878. if (_i >= _iterator.length) break;
  16879. _ref = _iterator[_i++];
  16880. } else {
  16881. _i = _iterator.next();
  16882. if (_i.done) break;
  16883. _ref = _i.value;
  16884. }
  16885. var i = _ref;
  16886. if (i.postcss) i = i.postcss;
  16887. if ((typeof i === 'undefined' ? 'undefined' : _typeof(i)) === 'object' && Array.isArray(i.plugins)) {
  16888. normalized = normalized.concat(i.plugins);
  16889. } else if (typeof i === 'function') {
  16890. normalized.push(i);
  16891. } else if ((typeof i === 'undefined' ? 'undefined' : _typeof(i)) === 'object' && (i.parse || i.stringify)) {
  16892. throw new Error('PostCSS syntaxes cannot be used as plugins. ' + 'Instead, please use one of the ' + 'syntax/parser/stringifier options as ' + 'outlined in your PostCSS ' + 'runner documentation.');
  16893. } else {
  16894. throw new Error(i + ' is not a PostCSS plugin');
  16895. }
  16896. }
  16897. return normalized;
  16898. };
  16899. return Processor;
  16900. }();
  16901. exports.default = Processor;
  16902. /**
  16903. * @callback builder
  16904. * @param {string} part - part of generated CSS connected to this node
  16905. * @param {Node} node - AST node
  16906. * @param {"start"|"end"} [type] - node’s part type
  16907. */
  16908. /**
  16909. * @callback parser
  16910. *
  16911. * @param {string|toString} css - string with input CSS or any object
  16912. * with toString() method, like a Buffer
  16913. * @param {processOptions} [opts] - options with only `from` and `map` keys
  16914. *
  16915. * @return {Root} PostCSS AST
  16916. */
  16917. /**
  16918. * @callback stringifier
  16919. *
  16920. * @param {Node} node - start node for stringifing. Usually {@link Root}.
  16921. * @param {builder} builder - function to concatenate CSS from node’s parts
  16922. * or generate string and source map
  16923. *
  16924. * @return {void}
  16925. */
  16926. /**
  16927. * @typedef {object} syntax
  16928. * @property {parser} parse - function to generate AST by string
  16929. * @property {stringifier} stringify - function to generate string by AST
  16930. */
  16931. /**
  16932. * @typedef {object} toString
  16933. * @property {function} toString
  16934. */
  16935. /**
  16936. * @callback pluginFunction
  16937. * @param {Root} root - parsed input CSS
  16938. * @param {Result} result - result to set warnings or check other plugins
  16939. */
  16940. /**
  16941. * @typedef {object} Plugin
  16942. * @property {function} postcss - PostCSS plugin function
  16943. */
  16944. /**
  16945. * @typedef {object} processOptions
  16946. * @property {string} from - the path of the CSS source file.
  16947. * You should always set `from`,
  16948. * because it is used in source map
  16949. * generation and syntax error messages.
  16950. * @property {string} to - the path where you’ll put the output
  16951. * CSS file. You should always set `to`
  16952. * to generate correct source maps.
  16953. * @property {parser} parser - function to generate AST by string
  16954. * @property {stringifier} stringifier - class to generate string by AST
  16955. * @property {syntax} syntax - object with `parse` and `stringify`
  16956. * @property {object} map - source map options
  16957. * @property {boolean} map.inline - does source map should
  16958. * be embedded in the output
  16959. * CSS as a base64-encoded
  16960. * comment
  16961. * @property {string|object|false|function} map.prev - source map content
  16962. * from a previous
  16963. * processing step
  16964. * (for example, Sass).
  16965. * PostCSS will try to find
  16966. * previous map
  16967. * automatically, so you
  16968. * could disable it by
  16969. * `false` value.
  16970. * @property {boolean} map.sourcesContent - does PostCSS should set
  16971. * the origin content to map
  16972. * @property {string|false} map.annotation - does PostCSS should set
  16973. * annotation comment to map
  16974. * @property {string} map.from - override `from` in map’s
  16975. * `sources`
  16976. */
  16977. module.exports = exports['default'];
  16978. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByb2Nlc3Nvci5lczYiXSwibmFtZXMiOlsiUHJvY2Vzc29yIiwicGx1Z2lucyIsInZlcnNpb24iLCJub3JtYWxpemUiLCJ1c2UiLCJwbHVnaW4iLCJjb25jYXQiLCJwcm9j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GFuY2UgaW50byB0aGlzIG9uZS5cbiAgICAgKlxuICAgICAqIFBsdWdpbnMgY2FuIGFsc28gYmUgYWRkZWQgYnkgcGFzc2luZyB0aGVtIGFzIGFyZ3VtZW50cyB3aGVuIGNyZWF0aW5nXG4gICAgICogYSBgcG9zdGNzc2AgaW5zdGFuY2UgKHNlZSBbYHBvc3Rjc3MocGx1Z2lucylgXSkuXG4gICAgICpcbiAgICAgKiBBc3luY2hyb25vdXMgcGx1Z2lucyBzaG91bGQgcmV0dXJuIGEgYFByb21pc2VgIGluc3RhbmNlLlxuICAgICAqXG4gICAgICogQHBhcmFtIHtQbHVnaW58cGx1Z2luRnVuY3Rpb258UHJvY2Vzc29yfSBwbHVnaW4gLSBQb3N0Q1NTIHBsdWdpblxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3Ige0BsaW5rIFByb2Nlc3Nvcn1cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGggcGx1Z2luc1xuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiBjb25zdCBwcm9jZXNzb3IgPSBwb3N0Y3NzKClcbiAgICAgKiAgIC51c2UoYXV0b3ByZWZpeGVyKVxuICAgICAqICAgLnVzZShwcmVjc3MpO1xuICAgICAqXG4gICAgICogQHJldHVybiB7UHJvY2Vzc2VzfSBjdXJyZW50IHByb2Nlc3NvciB0byBtYWtlIG1ldGhvZHMgY2hhaW5cbiAgICAgKi9cbiAgICB1c2UocGx1Z2luKSB7XG4gICAgICAgIHRoaXMucGx1Z2lucyA9IHRoaXMucGx1Z2lucy5jb25jYXQodGhpcy5ub3JtYWxpemUoW3BsdWdpbl0pKTtcbiAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogUGFyc2VzIHNvdXJjZSBDU1MgYW5kIHJldHVybnMgYSB7QGxpbmsgTGF6eVJlc3VsdH0gUHJvbWlzZSBwcm94eS5cbiAgICAgKiBCZWNhdXNlIHNvbWUgcGx1Z2lucyBjYW4gYmUgYXN5bmNocm9ub3VzIGl0IGRvZXNu4oCZdCBtYWtlXG4gICAgICogYW55IHRyYW5zZm9ybWF0aW9ucy4gVHJhbnNmb3JtYXRpb25zIHdpbGwgYmUgYXBwbGllZFxuICAgICAqIGluIHRoZSB7QGxpbmsgTGF6eVJlc3VsdH0gbWV0aG9kcy5cbiAgICAgKlxuICAgICAqIEBwYXJhbSB7c3RyaW5nfHRvU3RyaW5nfFJlc3VsdH0gY3NzIC0gU3RyaW5nIHdpdGggaW5wdXQgQ1NTIG9yXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbnkgb2JqZWN0IHdpdGggYSBgdG9TdHJpbmcoKWBcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZCwgbGlrZSBhIEJ1ZmZlci5cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9wdGlvbmFsbHksIHNlbmQgYSB7QGxpbmsgUmVzdWx0fVxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5zdGFuY2UgYW5kIHRoZSBwcm9jZXNzb3Igd2lsbFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFrZSB0aGUge0BsaW5rIFJvb3R9IGZyb20gaXQuXG4gICAgICogQHBhcmFtIHtwcm9jZXNzT3B0aW9uc30gW29wdHNdICAgICAgLSBvcHRpb25zXG4gICAgICpcbiAgICAgKiBAcmV0dXJuIHtMYXp5UmVzdWx0fSBQcm9taXNlIHByb3h5XG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHByb2Nlc3Nvci5wcm9jZXNzKGNzcywgeyBmcm9tOiAnYS5jc3MnLCB0bzogJ2Eub3V0LmNzcycgfSlcbiAgICAgKiAgIC50aGVuKHJlc3VsdCA9PiB7XG4gICAgICogICAgICBjb25zb2xlLmxvZyhyZXN1bHQuY3NzKTtcbiAgICAgKiAgIH0pO1xuICAgICAqL1xuICAgIHByb2Nlc3MoY3NzLCBvcHRzID0geyB9KSB7XG4gICAgICAgIHJldHVybiBuZXcgTGF6eVJlc3VsdCh0aGlzLCBjc3MsIG9wdHMpO1xuICAgIH1cblxuICAgIG5vcm1hbGl6ZShwbHVnaW5zKSB7XG4gICAgICAgIGxldCBub3JtYWxpemVkID0gW107XG4gICAgICAgIGZvciAoIGxldCBpIG9mIHBsdWdpbnMgKSB7XG4gICAgICAgICAgICBpZiAoIGkucG9zdGNzcyApIGkgPSBpLnBvc3Rjc3M7XG5cbiAgICAgICAgICAgIGlmICggdHlwZW9mIGkgPT09ICdvYmplY3QnICYmIEFycmF5LmlzQXJyYXkoaS5wbHVnaW5zKSApIHtcbiAgICAgICAgICAgICAgICBub3JtYWxpemVkID0gbm9ybWFsaXplZC5jb25jYXQoaS5wbHVnaW5zKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHR5cGVvZiBpID09PSAnZnVuY3Rpb24nICkge1xuICAgICAgICAgICAgICAgIG5vcm1hbGl6ZWQucHVzaChpKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHR5cGVvZiBpID09PSAnb2JqZWN0JyAmJiAoaS5wYXJzZSB8fCBpLnN0cmluZ2lmeSkgKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdQb3N0Q1NTIHN5bnRheGVzIGNhbm5vdCBiZSB1c2VkIGFzIHBsdWdpbnMuICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnSW5zdGVhZCwgcGxlYXNlIHVzZSBvbmUgb2YgdGhlICcgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnc3ludGF4L3BhcnNlci9zdHJpbmdpZmllciBvcHRpb25zIGFzICcgK1xuICAgICAgIC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XBlZGVmIHtvYmplY3R9IHByb2Nlc3NPcHRpb25zXG4gKiBAcHJvcGVydHkge3N0cmluZ30gZnJvbSAgICAgICAgICAgICAtIHRoZSBwYXRoIG9mIHRoZSBDU1Mgc291cmNlIGZpbGUuXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFlvdSBzaG91bGQgYWx3YXlzIHNldCBgZnJvbWAsXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJlY2F1c2UgaXQgaXMgdXNlZCBpbiBzb3VyY2UgbWFwXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdlbmVyYXRpb24gYW5kIHN5bnRheCBlcnJvciBtZXNzYWdlcy5cbiAqIEBwcm9wZXJ0eSB7c3RyaW5nfSB0byAgICAgICAgICAgICAgIC0gdGhlIHBhdGggd2hlcmUgeW914oCZbGwgcHV0IHRoZSBvdXRwdXRcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ1NTIGZpbGUuIFlvdSBzaG91bGQgYWx3YXlzIHNldCBgdG9gXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvIGdlbmVyYXRlIGNvcnJlY3Qgc291cmNlIG1hcHMuXG4gKiBAcHJvcGVydHkge3BhcnNlcn0gcGFyc2VyICAgICAgICAgICAtIGZ1bmN0aW9uIHRvIGdlbmVyYXRlIEFTVCBieSBzdHJpbmdcbiAqIEBwcm9wZXJ0eSB7c3RyaW5naWZpZXJ9IHN0cmluZ2lmaWVyIC0gY2xhc3MgdG8gZ2VuZXJhdGUgc3RyaW5nIGJ5IEFTVFxuICogQHByb3BlcnR5IHtzeW50YXh9IHN5bnRheCAgICAgICAgICAgLSBvYmplY3Qgd2l0aCBgcGFyc2VgIGFuZCBgc3RyaW5naWZ5YFxuICogQHByb3BlcnR5IHtvYmplY3R9IG1hcCAgICAgICAgICAgICAgLSBzb3VyY2UgbWFwIG9wdGlvbnNcbiAqIEBwcm9wZXJ0eSB7Ym9vbGVhbn0gbWFwLmlubGluZSAgICAgICAgICAgICAgICAgICAgLSBkb2VzIHNvdXJjZSBtYXAgc2hvdWxkXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmUgZW1iZWRkZWQgaW4gdGhlIG91dHB1dFxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENTUyBhcyBhIGJhc2U2NC1lbmNvZGVkXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tbWVudFxuICogQHByb3BlcnR5IHtzdHJpbmd8b2JqZWN0fGZhbHNlfGZ1bmN0aW9ufSBtYXAucHJldiAtIHNvdXJjZSBtYXAgY29udGVudFxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb20gYSBwcmV2aW91c1xuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb2Nlc3Npbmcgc3RlcFxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmb3IgZXhhbXBsZSwgU2FzcykuXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUG9zdENTUyB3aWxsIHRyeSB0byBmaW5kXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldmlvdXMgbWFwXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0b21hdGljYWxseSwgc28geW91XG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY291bGQgZGlzYWJsZSBpdCBieVxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGBmYWxzZWAgdmFsdWUuXG4gKiBAcHJvcGVydHkge2Jvb2xlYW59IG1hcC5zb3VyY2VzQ29udGVudCAgICAgICAgICAgIC0gZG9lcyBQb3N0Q1NTIHNob3VsZCBzZXRcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgb3JpZ2luIGNvbnRlbnQgdG8gbWFwXG4gKiBAcHJvcGVydHkge3N0cmluZ3xmYWxzZX0gbWFwLmFubm90YXRpb24gICAgICAgICAgIC0gZG9lcyBQb3N0Q1NTIHNob3VsZCBzZXRcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbm5vdGF0aW9uIGNvbW1lbnQgdG8gbWFwXG4gKiBAcHJvcGVydHkge3N0cmluZ30gbWFwLmZyb20gICAgICAgICAgICAgICAgICAgICAgIC0gb3ZlcnJpZGUgYGZyb21gIGluIG1hcOKAmXNcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgc291cmNlc2BcbiAqL1xuIl19
  16979. /***/ }),
  16980. /* 136 */
  16981. /***/ (function(module, exports, __webpack_require__) {
  16982. "use strict";
  16983. exports.__esModule = true;
  16984. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  16985. var _warning = __webpack_require__(138);
  16986. var _warning2 = _interopRequireDefault(_warning);
  16987. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  16988. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16989. /**
  16990. * Provides the result of the PostCSS transformations.
  16991. *
  16992. * A Result instance is returned by {@link LazyResult#then}
  16993. * or {@link Root#toResult} methods.
  16994. *
  16995. * @example
  16996. * postcss([cssnext]).process(css).then(function (result) {
  16997. * console.log(result.css);
  16998. * });
  16999. *
  17000. * @example
  17001. * var result2 = postcss.parse(css).toResult();
  17002. */
  17003. var Result = function () {
  17004. /**
  17005. * @param {Processor} processor - processor used for this transformation.
  17006. * @param {Root} root - Root node after all transformations.
  17007. * @param {processOptions} opts - options from the {@link Processor#process}
  17008. * or {@link Root#toResult}
  17009. */
  17010. function Result(processor, root, opts) {
  17011. _classCallCheck(this, Result);
  17012. /**
  17013. * @member {Processor} - The Processor instance used
  17014. * for this transformation.
  17015. *
  17016. * @example
  17017. * for ( let plugin of result.processor.plugins) {
  17018. * if ( plugin.postcssPlugin === 'postcss-bad' ) {
  17019. * throw 'postcss-good is incompatible with postcss-bad';
  17020. * }
  17021. * });
  17022. */
  17023. this.processor = processor;
  17024. /**
  17025. * @member {Message[]} - Contains messages from plugins
  17026. * (e.g., warnings or custom messages).
  17027. * Each message should have type
  17028. * and plugin properties.
  17029. *
  17030. * @example
  17031. * postcss.plugin('postcss-min-browser', () => {
  17032. * return (root, result) => {
  17033. * var browsers = detectMinBrowsersByCanIUse(root);
  17034. * result.messages.push({
  17035. * type: 'min-browser',
  17036. * plugin: 'postcss-min-browser',
  17037. * browsers: browsers
  17038. * });
  17039. * };
  17040. * });
  17041. */
  17042. this.messages = [];
  17043. /**
  17044. * @member {Root} - Root node after all transformations.
  17045. *
  17046. * @example
  17047. * root.toResult().root == root;
  17048. */
  17049. this.root = root;
  17050. /**
  17051. * @member {processOptions} - Options from the {@link Processor#process}
  17052. * or {@link Root#toResult} call
  17053. * that produced this Result instance.
  17054. *
  17055. * @example
  17056. * root.toResult(opts).opts == opts;
  17057. */
  17058. this.opts = opts;
  17059. /**
  17060. * @member {string} - A CSS string representing of {@link Result#root}.
  17061. *
  17062. * @example
  17063. * postcss.parse('a{}').toResult().css //=> "a{}"
  17064. */
  17065. this.css = undefined;
  17066. /**
  17067. * @member {SourceMapGenerator} - An instance of `SourceMapGenerator`
  17068. * class from the `source-map` library,
  17069. * representing changes
  17070. * to the {@link Result#root} instance.
  17071. *
  17072. * @example
  17073. * result.map.toJSON() //=> { version: 3, file: 'a.css', … }
  17074. *
  17075. * @example
  17076. * if ( result.map ) {
  17077. * fs.writeFileSync(result.opts.to + '.map', result.map.toString());
  17078. * }
  17079. */
  17080. this.map = undefined;
  17081. }
  17082. /**
  17083. * Returns for @{link Result#css} content.
  17084. *
  17085. * @example
  17086. * result + '' === result.css
  17087. *
  17088. * @return {string} string representing of {@link Result#root}
  17089. */
  17090. Result.prototype.toString = function toString() {
  17091. return this.css;
  17092. };
  17093. /**
  17094. * Creates an instance of {@link Warning} and adds it
  17095. * to {@link Result#messages}.
  17096. *
  17097. * @param {string} text - warning message
  17098. * @param {Object} [opts] - warning options
  17099. * @param {Node} opts.node - CSS node that caused the warning
  17100. * @param {string} opts.word - word in CSS source that caused the warning
  17101. * @param {number} opts.index - index in CSS node string that caused
  17102. * the warning
  17103. * @param {string} opts.plugin - name of the plugin that created
  17104. * this warning. {@link Result#warn} fills
  17105. * this property automatically.
  17106. *
  17107. * @return {Warning} created warning
  17108. */
  17109. Result.prototype.warn = function warn(text) {
  17110. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17111. if (!opts.plugin) {
  17112. if (this.lastPlugin && this.lastPlugin.postcssPlugin) {
  17113. opts.plugin = this.lastPlugin.postcssPlugin;
  17114. }
  17115. }
  17116. var warning = new _warning2.default(text, opts);
  17117. this.messages.push(warning);
  17118. return warning;
  17119. };
  17120. /**
  17121. * Returns warnings from plugins. Filters {@link Warning} instances
  17122. * from {@link Result#messages}.
  17123. *
  17124. * @example
  17125. * result.warnings().forEach(warn => {
  17126. * console.warn(warn.toString());
  17127. * });
  17128. *
  17129. * @return {Warning[]} warnings from plugins
  17130. */
  17131. Result.prototype.warnings = function warnings() {
  17132. return this.messages.filter(function (i) {
  17133. return i.type === 'warning';
  17134. });
  17135. };
  17136. /**
  17137. * An alias for the {@link Result#css} property.
  17138. * Use it with syntaxes that generate non-CSS output.
  17139. * @type {string}
  17140. *
  17141. * @example
  17142. * result.css === result.content;
  17143. */
  17144. _createClass(Result, [{
  17145. key: 'content',
  17146. get: function get() {
  17147. return this.css;
  17148. }
  17149. }]);
  17150. return Result;
  17151. }();
  17152. exports.default = Result;
  17153. /**
  17154. * @typedef {object} Message
  17155. * @property {string} type - message type
  17156. * @property {string} plugin - source PostCSS plugin name
  17157. */
  17158. module.exports = exports['default'];
  17159. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJlc3VsdC5lczYiXSwibmFtZXMiOlsiUmVzdWx0IiwicHJvY2Vzc29yIiwicm9vdCIsIm9wdHMiLCJtZXNzYWdlcyIsImNzcyIsInVuZGVmaW5lZCIsIm1hcCIsInRvU3RyaW5nIiwid2FybiIsInRleHQiLCJwbHVnaW4iLCJsYXN0UGx1Z2luIiwicG9zdGNzc1BsdWdpbiIsIndhcm5pbmciLCJwdXNoIiwid2FybmluZ3MiLCJmaWx0ZXIiLCJpIiwidHlwZSJdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUE7Ozs7Ozs7O0FBRUE7Ozs7Ozs7Ozs7Ozs7O0lBY01BLE07O0FBRUY7Ozs7OztBQU1BLGtCQUFZQyxTQUFaLEVBQXVCQyxJQUF2QixFQUE2QkMsSUFBN0IsRUFBbUM7QUFBQTs7QUFDL0I7Ozs7Ozs7Ozs7O0FBV0EsU0FBS0YsU0FBTCxHQUFpQkEsU0FBakI7QUFDQTs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBa0JBLFNBQUtHLFFBQUwsR0FBZ0IsRUFBaEI7QUFDQTs7Ozs7O0FBTUEsU0FBS0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29yfSAtIFRoZSBQcm9jZXNzb3IgaW5zdGFuY2UgdXNlZFxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgZm9yIHRoaXMgdHJhbnNmb3JtYXRpb24uXG4gICAgICAgICAqXG4gICAgICAgICAqIEBleGFtcGxlXG4gICAgICAgICAqIGZvciAoIGxldCBwbHVnaW4gb2YgcmVzdWx0LnByb2Nlc3Nvci5wbHVnaW5zKSB7XG4gICAgICAgICAqICAgaWYgKCBwbHVnaW4ucG9zdGNzc1BsdWdpbiA9PT0gJ3Bvc3Rjc3MtYmFkJyApIHtcbiAgICAgICAgICogICAgIHRocm93ICdwb3N0Y3NzLWdvb2QgaXMgaW5jb21wYXRpYmxlIHdpdGggcG9zdGNzcy1iYWQnO1xuICAgICAgICAgKiAgIH1cbiAgICAgICAgICogfSk7XG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnByb2Nlc3NvciA9IHByb2Nlc3NvcjtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge01lc3NhZ2VbXX0gLSBDb250YWlucyBtZXNzYWdlcyBmcm9tIHBsdWdpbnNcbiAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgIChlLmcuLCB3YXJuaW5ncyBvciBjdXN0b20gbWVzc2FnZXMpLlxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgRWFjaCBtZXNzYWdlIHNob3VsZCBoYXZlIHR5cGVcbiAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgIGFuZCBwbHVnaW4gcHJvcGVydGllcy5cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogcG9zdGNzcy5wbHVnaW4oJ3Bvc3Rjc3MtbWluLWJyb3dzZXInLCAoKSA9PiB7XG4gICAgICAgICAqICAgcmV0dXJuIChyb290LCByZXN1bHQpID0+IHtcbiAgICAgICAgICogICAgIHZhciBicm93c2VycyA9IGRldGVjdE1pbkJyb3dzZXJzQnlDYW5JVXNlKHJvb3QpO1xuICAgICAgICAgKiAgICAgcmVzdWx0Lm1lc3NhZ2VzLnB1c2goe1xuICAgICAgICAgKiAgICAgICB0eXBlOiAgICAnbWluLWJyb3dzZXInLFxuICAgICAgICAgKiAgICAgICBwbHVnaW46ICAncG9zdGNzcy1taW4tYnJvd3NlcicsXG4gICAgICAgICAqICAgICAgIGJyb3dzZXJzOiBicm93c2Vyc1xuICAgICAgICAgKiAgICAgfSk7XG4gICAgICAgICAqICAgfTtcbiAgICAgICAgICogfSk7XG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLm1lc3NhZ2VzID0gW107XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtSb290fSAtIFJvb3Qgbm9kZSBhZnRlciBhbGwgdHJhbnNmb3JtYXRpb25zLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgKiByb290LnRvUmVzdWx0KCkucm9vdCA9PSByb290O1xuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5yb290ID0gcm9vdDtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge3Byb2Nlc3NPcHRpb25zfSAtIE9wdGlvbnMgZnJvbSB0aGUge0BsaW5rIFByb2Nlc3NvciNwcm9jZXNzfVxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvciB7QGxpbmsgUm9vdCN0b1Jlc3VsdH0gY2FsbFxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGF0IHByb2R1Y2VkIHRoaXMgUmVzdWx0IGluc3RhbmNlLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgKiByb290LnRvUmVzdWx0KG9wdHMpLm9wdHMgPT0gb3B0cztcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMub3B0cyA9IG9wdHM7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtzdHJpbmd9IC0gQSBDU1Mgc3RyaW5nIHJlcHJlc2VudGluZyBvZiB7QGxpbmsgUmVzdWx0I3Jvb3R9LlxuICAgICAgICAgKlxuICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgKiBwb3N0Y3NzLnBhcnNlKCdhe30nKS50b1Jlc3VsdCgpLmNzcyAvLz0+IFwiYXt9XCJcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuY3NzID0gdW5kZWZpbmVkO1xuICAgICAgICAvKipcbiAgICAgICAgICogQG1lbWJlciB7U291cmNlTWFwR2VuZXJhdG9yfSAtIEFuIGluc3RhbmNlIG9mIGBTb3VyY2VNYXBHZW5lcmF0b3JgXG4gICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzcyBmcm9tIHRoZSBgc291cmNlLW1hcGAgbGlicmFyeSxcbiAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcHJlc2VudGluZyBjaGFuZ2VzXG4gICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byB0aGUge0BsaW5rIFJlc3VsdCNyb290fSBpbnN0YW5jZS5cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogcmVzdWx0Lm1hcC50b0pTT04oKSAvLz0+IHsgdmVyc2lvbjogMywgZmlsZTogJ2EuY3NzJywg4oCmIH1cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogaWYgKCByZXN1bHQubWFwICkge1xuICAgICAgICAgKiAgIGZzLndyaXRlRmlsZVN5bmMocmVzdWx0Lm9wdHMudG8gKyAnLm1hcCcsIHJlc3VsdC5tYXAudG9TdHJpbmcoKSk7XG4gICAgICAgICAqIH1cbiAgICAgICAgICovXG4gICAgICAgIHRoaXMubWFwID0gdW5kZWZpbmVkO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgZm9yIEB7bGluayBSZXN1bHQjY3NzfSBjb250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sdCN3YXJufSBmaWxsc1xuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMgcHJvcGVydHkgYXV0b21hdGljYWxseS5cbiAgICAgKlxuICAgICAqIEByZXR1cm4ge1dhcm5pbmd9IGNyZWF0ZWQgd2FybmluZ1xuICAgICAqL1xuICAgIHdhcm4odGV4dCwgb3B0cyA9IHsgfSkge1xuICAgICAgICBpZiAoICFvcHRzLnBsdWdpbiApIHtcbiAgICAgICAgICAgIGlmICggdGhpcy5sYXN0UGx1Z2luICYmIHRoaXMubGFzdFBsdWdpbi5wb3N0Y3NzUGx1Z2luICkge1xuICAgICAgICAgICAgICAgIG9wdHMucGx1Z2luID0gdGhpcy5sYXN0UGx1Z2luLnBvc3Rjc3NQbHVnaW47XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgd2FybmluZyA9IG5ldyBXYXJuaW5nKHRleHQsIG9wdHMpO1xuICAgICAgICB0aGlzLm1lc3NhZ2VzLnB1c2god2FybmluZyk7XG5cbiAgICAgICAgcmV0dXJuIHdhcm5pbmc7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogUmV0dXJucyB3YXJuaW5ncyBmcm9tIHBsdWdpbnMuIEZpbHRlcnMge0BsaW5rIFdhcm5pbmd9IGluc3RhbmNlc1xuICAgICAqIGZyb20ge0BsaW5rIFJlc3VsdCNtZXNzYWdlc30uXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHJlc3VsdC53YXJuaW5ncygpLmZvckVhY2god2FybiA9PiB7XG4gICAgICogICBjb25zb2xlLndhcm4od2Fybi50b1N0cmluZygpKTtcbiAgICAgKiB9KTtcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge1dhcm5pbmdbXX0gd2FybmluZ3MgZnJvbSBwbHVnaW5zXG4gICAgICovXG4gICAgd2FybmluZ3MoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1lc3NhZ2VzLmZpbHRlciggaSA9PiBpLnR5cGUgPT09ICd3YXJuaW5nJyApO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEFuIGFsaWFzIGZvciB0aGUge0BsaW5rIFJlc3VsdCNjc3N9IHByb3BlcnR5LlxuICAgICAqIFVzZSBpdCB3aXRoIHN5bnRheGVzIHRoYXQgZ2VuZXJhdGUgbm9uLUNTUyBvdXRwdXQuXG4gICAgICogQHR5cGUge3N0cmluZ31cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogcmVzdWx0LmNzcyA9PT0gcmVzdWx0LmNvbnRlbnQ7XG4gICAgICovXG4gICAgZ2V0IGNvbnRlbnQoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmNzcztcbiAgICB9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgUmVzdWx0O1xuXG4vKipcbiAqIEB0eXBlZGVmICB7b2JqZWN0fSBNZXNzYWdlXG4gKiBAcHJvcGVydHkge3N0cmluZ30gdHlwZSAgIC0gbWVzc2FnZSB0eXBlXG4gKiBAcHJvcGVydHkge3N0cmluZ30gcGx1Z2luIC0gc291cmNlIFBvc3RDU1MgcGx1Z2luIG5hbWVcbiAqL1xuIl19
  17160. /***/ }),
  17161. /* 137 */
  17162. /***/ (function(module, exports, __webpack_require__) {
  17163. "use strict";
  17164. exports.__esModule = true;
  17165. var _chalk = __webpack_require__(88);
  17166. var _chalk2 = _interopRequireDefault(_chalk);
  17167. var _tokenize = __webpack_require__(45);
  17168. var _tokenize2 = _interopRequireDefault(_tokenize);
  17169. var _input = __webpack_require__(18);
  17170. var _input2 = _interopRequireDefault(_input);
  17171. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  17172. var HIGHLIGHT_THEME = {
  17173. 'brackets': _chalk2.default.cyan,
  17174. 'at-word': _chalk2.default.cyan,
  17175. 'call': _chalk2.default.cyan,
  17176. 'comment': _chalk2.default.gray,
  17177. 'string': _chalk2.default.green,
  17178. 'class': _chalk2.default.yellow,
  17179. 'hash': _chalk2.default.magenta,
  17180. '(': _chalk2.default.cyan,
  17181. ')': _chalk2.default.cyan,
  17182. '{': _chalk2.default.yellow,
  17183. '}': _chalk2.default.yellow,
  17184. '[': _chalk2.default.yellow,
  17185. ']': _chalk2.default.yellow,
  17186. ':': _chalk2.default.yellow,
  17187. ';': _chalk2.default.yellow
  17188. };
  17189. function getTokenType(_ref, processor) {
  17190. var type = _ref[0],
  17191. value = _ref[1];
  17192. if (type === 'word') {
  17193. if (value[0] === '.') {
  17194. return 'class';
  17195. }
  17196. if (value[0] === '#') {
  17197. return 'hash';
  17198. }
  17199. }
  17200. if (!processor.endOfFile()) {
  17201. var next = processor.nextToken();
  17202. processor.back(next);
  17203. if (next[0] === 'brackets' || next[0] === '(') return 'call';
  17204. }
  17205. return type;
  17206. }
  17207. function terminalHighlight(css) {
  17208. var processor = (0, _tokenize2.default)(new _input2.default(css), { ignoreErrors: true });
  17209. var result = '';
  17210. var _loop = function _loop() {
  17211. var token = processor.nextToken();
  17212. var color = HIGHLIGHT_THEME[getTokenType(token, processor)];
  17213. if (color) {
  17214. result += token[1].split(/\r?\n/).map(function (i) {
  17215. return color(i);
  17216. }).join('\n');
  17217. } else {
  17218. result += token[1];
  17219. }
  17220. };
  17221. while (!processor.endOfFile()) {
  17222. _loop();
  17223. }
  17224. return result;
  17225. }
  17226. exports.default = terminalHighlight;
  17227. module.exports = exports['default'];
  17228. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlcm1pbmFsLWhpZ2hsaWdodC5lczYiXSwibmFtZXMiOlsiSElHSExJR0hUX1RIRU1FIiwiY3lhbiIsImdyYXkiLCJncmVlbiIsInllbGxvdyIsIm1hZ2VudGEiLCJnZXRUb2tlblR5cGUiLCJwcm9jZXNzb3IiLCJ0eXBlIiwidmFsdWUiLCJlbmRPZkZpbGUiLCJuZXh0IiwibmV4dFRva2VuIiwiYmFjayIsInRlcm1pbmFsSGlnaGxpZ2h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4vaW5wdXQnO1xuXG5jb25zdCBISUdITElHSFRfVEhFTUUgPSB7XG4gICAgJ2JyYWNrZXRzJzogY2hhbGsuY3lhbixcbiAgICAnYXQtd29yZCc6ICBjaGFsay5jeWFuLFxuICAgICdjYWxsJzogICAgIGNoYWxrLmN5YW4sXG4gICAgJ2NvbW1lbnQnOiAgY2hhbGsuZ3JheSxcbiAgICAnc3RyaW5nJzogICBjaGFsay5ncmVlbixcbiAgICAnY2xhc3MnOiAgICBjaGFsay55ZWxsb3csXG4gICAgJ2hhc2gnOiAgICAgY2hhbGsubWFnZW50YSxcbiAgICAnKCc6ICAgICAgICBjaGFsay5jeWFuLFxuICAgICcpJzogICAgICAgIGNoYWxrLmN5YW4sXG4gICAgJ3snOiAgICAgICAgY2hhbGsueWVsbG93LFxuICAgICd9JzogICAgICAgIGNoYWxrLnllbGxvdyxcbiAgICAnWyc6ICAgICAgICBjaGFsay55ZWxsb3csXG4gICAgJ10nOiAgICAgICAgY2hhbGsueWVsbG93LFxuICAgICc6JzogICAgICAgIGNoYWxrLnllbGxvdyxcbiAgICAnOyc6ICAgICAgICBjaGFsay55ZWxsb3dcbn07XG5cbmZ1bmN0aW9uIGdldFRva2VuVHlwZShbdHlwZSwgdmFsdWVdLCBwcm9jZXNzb3IpIHtcbiAgICBpZiAoIHR5cGUgPT09ICd3b3JkJyApIHtcbiAgICAgICAgaWYgKCB2YWx1ZVswXSA9PT0gJy4nICkge1xuICAgICAgICAgICAgcmV0dXJuICdjbGFzcyc7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCB2YWx1ZVswXSA9PT0gJyMnICkge1xuICAgICAgICAgICAgcmV0dXJuICdoYXNoJztcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlmICggIXByb2Nlc3Nvci5lbmRPZkZpbGUoKSApIHtcbiAgICAgICAgbGV0IG5leHQgPSBwcm9jZXNzb3IubmV4dFRva2VuKCk7XG4gICAgICAgIHByb2Nlc3Nvci5iYWNrKG5leHQpO1xuICAgICAgICBpZiAoIG5leHRbMF0gPT09ICdicmFja2V0cycgfHwgbmV4dFswXSA9PT0gJygnICkgcmV0dXJuICdjYWxsJztcbiAgICB9XG5cbiAgICByZXR1cm4gdHlwZTtcbn1cblxuZnVuY3Rpb24gdGVybWluYWxIaWdobGlnaHQoY3NzKSB7XG4gICAgbGV0IHByb2Nlc3NvciA9IHRva2VuaXplcihuZXcgSW5wdXQoY3NzKSwgeyBpZ25vcmVFcnJvcnM6IHRydWUgfSk7XG4gICAgbGV0IHJlc3VsdCA9ICcnO1xuICAgIHdoaWxlICggIXByb2Nlc3Nvci5lbmRPZkZpbGUoKSApIHtcbiAgICAgICAgbGV0IHRva2VuID0gcHJvY2Vzc29yLm5leHRUb2tlbigpO1xuICAgICAgICBsZXQgY29sb3IgPSBISUdITElHSFRfVEhFTUVbZ2V0VG9rZW5UeXBlKHRva2VuLCBwcm9jZXNzb3IpXTtcbiAgICAgICAgaWYgKCBjb2xvciApIHtcbiAgICAgICAgICAgIHJlc3VsdCArPSB0b2tlblsxXS5zcGxpdCgvXFxyP1xcbi8pXG4gICAgICAgICAgICAgICAgLm1hcCggaSA9PiBjb2xvcihpKSApXG4gICAgICAgICAgICAgICAgLmpvaW4oJ1xcbicpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmVzdWx0ICs9IHRva2VuWzFdO1xuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiByZXN1bHQ7XG59XG5cbmV4cG9ydCBkZWZhdWx0IHRlcm1pbmFsSGlnaGxpZ2h0O1xuIl19
  17229. /***/ }),
  17230. /* 138 */
  17231. /***/ (function(module, exports, __webpack_require__) {
  17232. "use strict";
  17233. exports.__esModule = true;
  17234. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17235. /**
  17236. * Represents a plugin’s warning. It can be created using {@link Node#warn}.
  17237. *
  17238. * @example
  17239. * if ( decl.important ) {
  17240. * decl.warn(result, 'Avoid !important', { word: '!important' });
  17241. * }
  17242. */
  17243. var Warning = function () {
  17244. /**
  17245. * @param {string} text - warning message
  17246. * @param {Object} [opts] - warning options
  17247. * @param {Node} opts.node - CSS node that caused the warning
  17248. * @param {string} opts.word - word in CSS source that caused the warning
  17249. * @param {number} opts.index - index in CSS node string that caused
  17250. * the warning
  17251. * @param {string} opts.plugin - name of the plugin that created
  17252. * this warning. {@link Result#warn} fills
  17253. * this property automatically.
  17254. */
  17255. function Warning(text) {
  17256. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17257. _classCallCheck(this, Warning);
  17258. /**
  17259. * @member {string} - Type to filter warnings from
  17260. * {@link Result#messages}. Always equal
  17261. * to `"warning"`.
  17262. *
  17263. * @example
  17264. * const nonWarning = result.messages.filter(i => i.type !== 'warning')
  17265. */
  17266. this.type = 'warning';
  17267. /**
  17268. * @member {string} - The warning message.
  17269. *
  17270. * @example
  17271. * warning.text //=> 'Try to avoid !important'
  17272. */
  17273. this.text = text;
  17274. if (opts.node && opts.node.source) {
  17275. var pos = opts.node.positionBy(opts);
  17276. /**
  17277. * @member {number} - Line in the input file
  17278. * with this warning’s source
  17279. *
  17280. * @example
  17281. * warning.line //=> 5
  17282. */
  17283. this.line = pos.line;
  17284. /**
  17285. * @member {number} - Column in the input file
  17286. * with this warning’s source.
  17287. *
  17288. * @example
  17289. * warning.column //=> 6
  17290. */
  17291. this.column = pos.column;
  17292. }
  17293. for (var opt in opts) {
  17294. this[opt] = opts[opt];
  17295. }
  17296. }
  17297. /**
  17298. * Returns a warning position and message.
  17299. *
  17300. * @example
  17301. * warning.toString() //=> 'postcss-lint:a.css:10:14: Avoid !important'
  17302. *
  17303. * @return {string} warning position and message
  17304. */
  17305. Warning.prototype.toString = function toString() {
  17306. if (this.node) {
  17307. return this.node.error(this.text, {
  17308. plugin: this.plugin,
  17309. index: this.index,
  17310. word: this.word
  17311. }).message;
  17312. } else if (this.plugin) {
  17313. return this.plugin + ': ' + this.text;
  17314. } else {
  17315. return this.text;
  17316. }
  17317. };
  17318. /**
  17319. * @memberof Warning#
  17320. * @member {string} plugin - The name of the plugin that created
  17321. * it will fill this property automatically.
  17322. * this warning. When you call {@link Node#warn}
  17323. *
  17324. * @example
  17325. * warning.plugin //=> 'postcss-important'
  17326. */
  17327. /**
  17328. * @memberof Warning#
  17329. * @member {Node} node - Contains the CSS node that caused the warning.
  17330. *
  17331. * @example
  17332. * warning.node.toString() //=> 'color: white !important'
  17333. */
  17334. return Warning;
  17335. }();
  17336. exports.default = Warning;
  17337. module.exports = exports['default'];
  17338. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndhcm5pbmcuZXM2Il0sIm5hbWVzIjpbIldhcm5pbmciLCJ0ZXh0Iiwib3B0cyIsInR5cGUiLCJub2RlIiwic291cmNlIiwicG9zIiwicG9zaXRpb25CeSIsImxpbmUiLCJjb2x1bW4iLCJvcHQiLCJ0b1N0cmluZyIsImVycm9yIiwicGx1Z2luIiwiaW5kZXgiLCJ3b3JkIiwibWVzc2FnZSJdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUE7Ozs7Ozs7O0lBUU1BLE87O0FBRUY7Ozs7Ozs7Ozs7O0FBV0EsbUJBQVlDLElBQVosRUFBOEI7QUFBQSxRQUFaQyxJQUFZLHVFQUFMLEVBQUs7O0FBQUE7O0FBQzFCOzs7Ozs7OztBQVFBLFNBQUtDLElBQUwsR0FBWSxTQUFaO0FBQ0E7Ozs7OztBQU1BLFNBQUtGLElBQUwsR0FBWUEsSUFBWjs7QUFFQSxRQUFLQyxLQUFLRSxJQUFMLElBQWFGLEtBQUtFLElBQUwsQ0FBVUMsTUFBNUIsRUFBcUM7QUFDakMsVUFBSUMsTUFBVUosS0FBS0UsSUFBTCxDQUFVRyxVQUFWLENBQXFCTCxJQUFyQixDQUFkO0FBQ0E7Ozs7Ozs7QUFPQSxXQUFLTSxJQUFMLEdBQWNGLElBQUlFLEl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luZyB7XG5cbiAgICAvKipcbiAgICAgKiBAcGFyYW0ge3N0cmluZ30gdGV4dCAgICAgICAgLSB3YXJuaW5nIG1lc3NhZ2VcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gW29wdHNdICAgICAgLSB3YXJuaW5nIG9wdGlvbnNcbiAgICAgKiBAcGFyYW0ge05vZGV9ICAgb3B0cy5ub2RlICAgLSBDU1Mgbm9kZSB0aGF0IGNhdXNlZCB0aGUgd2FybmluZ1xuICAgICAqIEBwYXJhbSB7c3RyaW5nfSBvcHRzLndvcmQgICAtIHdvcmQgaW4gQ1NTIHNvdXJjZSB0aGF0IGNhdXNlZCB0aGUgd2FybmluZ1xuICAgICAqIEBwYXJhbSB7bnVtYmVyfSBvcHRzLmluZGV4ICAtIGluZGV4IGluIENTUyBub2RlIHN0cmluZyB0aGF0IGNhdXNlZFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSB3YXJuaW5nXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IG9wdHMucGx1Z2luIC0gbmFtZSBvZiB0aGUgcGx1Z2luIHRoYXQgY3JlYXRlZFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMgd2FybmluZy4ge0BsaW5rIFJlc3VsdCN3YXJufSBmaWxsc1xuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMgcHJvcGVydHkgYXV0b21hdGljYWxseS5cbiAgICAgKi9cbiAgICBjb25zdHJ1Y3Rvcih0ZXh0LCBvcHRzID0geyB9KSB7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtzdHJpbmd9IC0gVHlwZSB0byBmaWx0ZXIgd2FybmluZ3MgZnJvbVxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAge0BsaW5rIFJlc3VsdCNtZXNzYWdlc30uIEFsd2F5cyBlcXVhbFxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgdG8gYFwid2FybmluZ1wiYC5cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogY29uc3Qgbm9uV2FybmluZyA9IHJlc3VsdC5tZXNzYWdlcy5maWx0ZXIoaSA9PiBpLnR5cGUgIT09ICd3YXJuaW5nJylcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMudHlwZSA9ICd3YXJuaW5nJztcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge3N0cmluZ30gLSBUaGUgd2FybmluZyBtZXNzYWdlLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgKiB3YXJuaW5nLnRleHQgLy89PiAnVHJ5IHRvIGF2b2lkICFpbXBvcnRhbnQnXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnRleHQgPSB0ZXh0O1xuXG4gICAgICAgIGlmICggb3B0cy5ub2RlICYmIG9wdHMubm9kZS5zb3VyY2UgKSB7XG4gICAgICAgICAgICBsZXQgcG9zICAgICA9IG9wdHMubm9kZS5wb3NpdGlvbkJ5KG9wdHMpO1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBAbWVtYmVyIHtudW1iZXJ9IC0gTGluZSBpbiB0aGUgaW5wdXQgZmlsZVxuICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgIHdpdGggdGhpcyB3YXJuaW5n4oCZcyBzb3VyY2VcbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgICAgICogd2FybmluZy5saW5lIC8vPT4gNVxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICB0aGlzLmxpbmUgICA9IHBvcy5saW5lO1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBAbWVtYmVyIHtudW1iZXJ9IC0gQ29sdW1uIGluIHRoZSBpbnB1dCBmaWxlXG4gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgd2l0aCB0aGlzIHdhcm5pbmfigJlzIHNvdXJjZS5cbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgICAgICogd2FybmluZy5jb2x1bW4gLy89PiA2XG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIHRoaXMuY29sdW1uID0gcG9zLmNvbHVtbjtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAoIGxldCBvcHQgaW4gb3B0cyApIHRoaXNbb3B0XSA9IG9wdHNbb3B0XTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBSZXR1cm5zIGEgd2FybmluZyBwb3NpdGlvbiBhbmQgbWVzc2FnZS5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogd2FybmluZy50b1N0cmluZygpIC8vPT4gJ3Bvc3Rjc3MtbGludDphLmNzczoxMDoxNDogQXZvaWQgIWltcG9ydGFudCdcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge3N0cmluZ30gd2FybmluZyBwb3NpdGlvbiBhbmQgbWVzc2FnZVxuICAgICAqL1xuICAgIHRvU3RyaW5nKCkge1xuICAgICAgICBpZiAoIHRoaXMubm9kZSApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm5vZGUuZXJyb3IodGhpcy50ZXh0LCB7XG4gICAgICAgICAgICAgICAgcGx1Z2luOiB0aGlzLnBsdWdpbixcbiAgICAgICAgICAgICAgICBpbmRleDogIHRoaXMuaW5kZXgsXG4gICAgICAgICAgICAgICAgd29yZDogICB0aGlzLndvcmRcbiAgICAgICAgICAgIH0pLm1lc3NhZ2U7XG4gICAgICAgIH0gZWxzZSBpZiAoIHRoaXMucGx1Z2luICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMucGx1Z2luICsgJzogJyArIHRoaXMudGV4dDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnRleHQ7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBAbWVtYmVyb2YgV2FybmluZyNcbiAgICAgKiBAbWVtYmVyIHtzdHJpbmd9IHBsdWdpbiAtIFRoZSBuYW1lIG9mIHRoZSBwbHVnaW4gdGhhdCBjcmVhdGVkXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICBpdCB3aWxsIGZpbGwgdGhpcyBwcm9wZXJ0eSBhdXRvbWF0aWNhbGx5LlxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcyB3YXJuaW5nLiBXaGVuIHlvdSBjYWxsIHtAbGluayBOb2RlI3dhcm59XG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHdhcm5pbmcucGx1Z2luIC8vPT4gJ3Bvc3Rjc3MtaW1wb3J0YW50J1xuICAgICAqL1xuXG4gICAgLyoqXG4gICAgICogQG1lbWJlcm9mIFdhcm5pbmcjXG4gICAgICogQG1lbWJlciB7Tm9kZX0gbm9kZSAtIENvbnRhaW5zIHRoZSBDU1Mgbm9kZSB0aGF0IGNhdXNlZCB0aGUgd2FybmluZy5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogd2FybmluZy5ub2RlLnRvU3RyaW5nKCkgLy89PiAnY29sb3I6IHdoaXRlICFpbXBvcnRhbnQnXG4gICAgICovXG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgV2FybmluZztcbiJdfQ==
  17339. /***/ }),
  17340. /* 139 */
  17341. /***/ (function(module, exports) {
  17342. /* -*- Mode: js; js-indent-level: 2; -*- */
  17343. /*
  17344. * Copyright 2011 Mozilla Foundation and contributors
  17345. * Licensed under the New BSD license. See LICENSE or:
  17346. * http://opensource.org/licenses/BSD-3-Clause
  17347. */
  17348. var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
  17349. /**
  17350. * Encode an integer in the range of 0 to 63 to a single base 64 digit.
  17351. */
  17352. exports.encode = function (number) {
  17353. if (0 <= number && number < intToCharMap.length) {
  17354. return intToCharMap[number];
  17355. }
  17356. throw new TypeError("Must be between 0 and 63: " + number);
  17357. };
  17358. /**
  17359. * Decode a single base 64 character code digit to an integer. Returns -1 on
  17360. * failure.
  17361. */
  17362. exports.decode = function (charCode) {
  17363. var bigA = 65; // 'A'
  17364. var bigZ = 90; // 'Z'
  17365. var littleA = 97; // 'a'
  17366. var littleZ = 122; // 'z'
  17367. var zero = 48; // '0'
  17368. var nine = 57; // '9'
  17369. var plus = 43; // '+'
  17370. var slash = 47; // '/'
  17371. var littleOffset = 26;
  17372. var numberOffset = 52;
  17373. // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  17374. if (bigA <= charCode && charCode <= bigZ) {
  17375. return (charCode - bigA);
  17376. }
  17377. // 26 - 51: abcdefghijklmnopqrstuvwxyz
  17378. if (littleA <= charCode && charCode <= littleZ) {
  17379. return (charCode - littleA + littleOffset);
  17380. }
  17381. // 52 - 61: 0123456789
  17382. if (zero <= charCode && charCode <= nine) {
  17383. return (charCode - zero + numberOffset);
  17384. }
  17385. // 62: +
  17386. if (charCode == plus) {
  17387. return 62;
  17388. }
  17389. // 63: /
  17390. if (charCode == slash) {
  17391. return 63;
  17392. }
  17393. // Invalid base64 digit.
  17394. return -1;
  17395. };
  17396. /***/ }),
  17397. /* 140 */
  17398. /***/ (function(module, exports) {
  17399. /* -*- Mode: js; js-indent-level: 2; -*- */
  17400. /*
  17401. * Copyright 2011 Mozilla Foundation and contributors
  17402. * Licensed under the New BSD license. See LICENSE or:
  17403. * http://opensource.org/licenses/BSD-3-Clause
  17404. */
  17405. exports.GREATEST_LOWER_BOUND = 1;
  17406. exports.LEAST_UPPER_BOUND = 2;
  17407. /**
  17408. * Recursive implementation of binary search.
  17409. *
  17410. * @param aLow Indices here and lower do not contain the needle.
  17411. * @param aHigh Indices here and higher do not contain the needle.
  17412. * @param aNeedle The element being searched for.
  17413. * @param aHaystack The non-empty array being searched.
  17414. * @param aCompare Function which takes two elements and returns -1, 0, or 1.
  17415. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
  17416. * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
  17417. * closest element that is smaller than or greater than the one we are
  17418. * searching for, respectively, if the exact element cannot be found.
  17419. */
  17420. function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
  17421. // This function terminates when one of the following is true:
  17422. //
  17423. // 1. We find the exact element we are looking for.
  17424. //
  17425. // 2. We did not find the exact element, but we can return the index of
  17426. // the next-closest element.
  17427. //
  17428. // 3. We did not find the exact element, and there is no next-closest
  17429. // element than the one we are searching for, so we return -1.
  17430. var mid = Math.floor((aHigh - aLow) / 2) + aLow;
  17431. var cmp = aCompare(aNeedle, aHaystack[mid], true);
  17432. if (cmp === 0) {
  17433. // Found the element we are looking for.
  17434. return mid;
  17435. }
  17436. else if (cmp > 0) {
  17437. // Our needle is greater than aHaystack[mid].
  17438. if (aHigh - mid > 1) {
  17439. // The element is in the upper half.
  17440. return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
  17441. }
  17442. // The exact needle element was not found in this haystack. Determine if
  17443. // we are in termination case (3) or (2) and return the appropriate thing.
  17444. if (aBias == exports.LEAST_UPPER_BOUND) {
  17445. return aHigh < aHaystack.length ? aHigh : -1;
  17446. } else {
  17447. return mid;
  17448. }
  17449. }
  17450. else {
  17451. // Our needle is less than aHaystack[mid].
  17452. if (mid - aLow > 1) {
  17453. // The element is in the lower half.
  17454. return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
  17455. }
  17456. // we are in termination case (3) or (2) and return the appropriate thing.
  17457. if (aBias == exports.LEAST_UPPER_BOUND) {
  17458. return mid;
  17459. } else {
  17460. return aLow < 0 ? -1 : aLow;
  17461. }
  17462. }
  17463. }
  17464. /**
  17465. * This is an implementation of binary search which will always try and return
  17466. * the index of the closest element if there is no exact hit. This is because
  17467. * mappings between original and generated line/col pairs are single points,
  17468. * and there is an implicit region between each of them, so a miss just means
  17469. * that you aren't on the very start of a region.
  17470. *
  17471. * @param aNeedle The element you are looking for.
  17472. * @param aHaystack The array that is being searched.
  17473. * @param aCompare A function which takes the needle and an element in the
  17474. * array and returns -1, 0, or 1 depending on whether the needle is less
  17475. * than, equal to, or greater than the element, respectively.
  17476. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
  17477. * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
  17478. * closest element that is smaller than or greater than the one we are
  17479. * searching for, respectively, if the exact element cannot be found.
  17480. * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
  17481. */
  17482. exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
  17483. if (aHaystack.length === 0) {
  17484. return -1;
  17485. }
  17486. var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
  17487. aCompare, aBias || exports.GREATEST_LOWER_BOUND);
  17488. if (index < 0) {
  17489. return -1;
  17490. }
  17491. // We have found either the exact element, or the next-closest element than
  17492. // the one we are searching for. However, there may be more than one such
  17493. // element. Make sure we always return the smallest of these.
  17494. while (index - 1 >= 0) {
  17495. if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
  17496. break;
  17497. }
  17498. --index;
  17499. }
  17500. return index;
  17501. };
  17502. /***/ }),
  17503. /* 141 */
  17504. /***/ (function(module, exports, __webpack_require__) {
  17505. /* -*- Mode: js; js-indent-level: 2; -*- */
  17506. /*
  17507. * Copyright 2014 Mozilla Foundation and contributors
  17508. * Licensed under the New BSD license. See LICENSE or:
  17509. * http://opensource.org/licenses/BSD-3-Clause
  17510. */
  17511. var util = __webpack_require__(8);
  17512. /**
  17513. * Determine whether mappingB is after mappingA with respect to generated
  17514. * position.
  17515. */
  17516. function generatedPositionAfter(mappingA, mappingB) {
  17517. // Optimized for most common case
  17518. var lineA = mappingA.generatedLine;
  17519. var lineB = mappingB.generatedLine;
  17520. var columnA = mappingA.generatedColumn;
  17521. var columnB = mappingB.generatedColumn;
  17522. return lineB > lineA || lineB == lineA && columnB >= columnA ||
  17523. util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
  17524. }
  17525. /**
  17526. * A data structure to provide a sorted view of accumulated mappings in a
  17527. * performance conscious manner. It trades a neglibable overhead in general
  17528. * case for a large speedup in case of mappings being added in order.
  17529. */
  17530. function MappingList() {
  17531. this._array = [];
  17532. this._sorted = true;
  17533. // Serves as infimum
  17534. this._last = {generatedLine: -1, generatedColumn: 0};
  17535. }
  17536. /**
  17537. * Iterate through internal items. This method takes the same arguments that
  17538. * `Array.prototype.forEach` takes.
  17539. *
  17540. * NOTE: The order of the mappings is NOT guaranteed.
  17541. */
  17542. MappingList.prototype.unsortedForEach =
  17543. function MappingList_forEach(aCallback, aThisArg) {
  17544. this._array.forEach(aCallback, aThisArg);
  17545. };
  17546. /**
  17547. * Add the given source mapping.
  17548. *
  17549. * @param Object aMapping
  17550. */
  17551. MappingList.prototype.add = function MappingList_add(aMapping) {
  17552. if (generatedPositionAfter(this._last, aMapping)) {
  17553. this._last = aMapping;
  17554. this._array.push(aMapping);
  17555. } else {
  17556. this._sorted = false;
  17557. this._array.push(aMapping);
  17558. }
  17559. };
  17560. /**
  17561. * Returns the flat, sorted array of mappings. The mappings are sorted by
  17562. * generated position.
  17563. *
  17564. * WARNING: This method returns internal data without copying, for
  17565. * performance. The return value must NOT be mutated, and should be treated as
  17566. * an immutable borrow. If you want to take ownership, you must make your own
  17567. * copy.
  17568. */
  17569. MappingList.prototype.toArray = function MappingList_toArray() {
  17570. if (!this._sorted) {
  17571. this._array.sort(util.compareByGeneratedPositionsInflated);
  17572. this._sorted = true;
  17573. }
  17574. return this._array;
  17575. };
  17576. exports.MappingList = MappingList;
  17577. /***/ }),
  17578. /* 142 */
  17579. /***/ (function(module, exports) {
  17580. /* -*- Mode: js; js-indent-level: 2; -*- */
  17581. /*
  17582. * Copyright 2011 Mozilla Foundation and contributors
  17583. * Licensed under the New BSD license. See LICENSE or:
  17584. * http://opensource.org/licenses/BSD-3-Clause
  17585. */
  17586. // It turns out that some (most?) JavaScript engines don't self-host
  17587. // `Array.prototype.sort`. This makes sense because C++ will likely remain
  17588. // faster than JS when doing raw CPU-intensive sorting. However, when using a
  17589. // custom comparator function, calling back and forth between the VM's C++ and
  17590. // JIT'd JS is rather slow *and* loses JIT type information, resulting in
  17591. // worse generated code for the comparator function than would be optimal. In
  17592. // fact, when sorting with a comparator, these costs outweigh the benefits of
  17593. // sorting in C++. By using our own JS-implemented Quick Sort (below), we get
  17594. // a ~3500ms mean speed-up in `bench/bench.html`.
  17595. /**
  17596. * Swap the elements indexed by `x` and `y` in the array `ary`.
  17597. *
  17598. * @param {Array} ary
  17599. * The array.
  17600. * @param {Number} x
  17601. * The index of the first item.
  17602. * @param {Number} y
  17603. * The index of the second item.
  17604. */
  17605. function swap(ary, x, y) {
  17606. var temp = ary[x];
  17607. ary[x] = ary[y];
  17608. ary[y] = temp;
  17609. }
  17610. /**
  17611. * Returns a random integer within the range `low .. high` inclusive.
  17612. *
  17613. * @param {Number} low
  17614. * The lower bound on the range.
  17615. * @param {Number} high
  17616. * The upper bound on the range.
  17617. */
  17618. function randomIntInRange(low, high) {
  17619. return Math.round(low + (Math.random() * (high - low)));
  17620. }
  17621. /**
  17622. * The Quick Sort algorithm.
  17623. *
  17624. * @param {Array} ary
  17625. * An array to sort.
  17626. * @param {function} comparator
  17627. * Function to use to compare two items.
  17628. * @param {Number} p
  17629. * Start index of the array
  17630. * @param {Number} r
  17631. * End index of the array
  17632. */
  17633. function doQuickSort(ary, comparator, p, r) {
  17634. // If our lower bound is less than our upper bound, we (1) partition the
  17635. // array into two pieces and (2) recurse on each half. If it is not, this is
  17636. // the empty array and our base case.
  17637. if (p < r) {
  17638. // (1) Partitioning.
  17639. //
  17640. // The partitioning chooses a pivot between `p` and `r` and moves all
  17641. // elements that are less than or equal to the pivot to the before it, and
  17642. // all the elements that are greater than it after it. The effect is that
  17643. // once partition is done, the pivot is in the exact place it will be when
  17644. // the array is put in sorted order, and it will not need to be moved
  17645. // again. This runs in O(n) time.
  17646. // Always choose a random pivot so that an input array which is reverse
  17647. // sorted does not cause O(n^2) running time.
  17648. var pivotIndex = randomIntInRange(p, r);
  17649. var i = p - 1;
  17650. swap(ary, pivotIndex, r);
  17651. var pivot = ary[r];
  17652. // Immediately after `j` is incremented in this loop, the following hold
  17653. // true:
  17654. //
  17655. // * Every element in `ary[p .. i]` is less than or equal to the pivot.
  17656. //
  17657. // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
  17658. for (var j = p; j < r; j++) {
  17659. if (comparator(ary[j], pivot) <= 0) {
  17660. i += 1;
  17661. swap(ary, i, j);
  17662. }
  17663. }
  17664. swap(ary, i + 1, j);
  17665. var q = i + 1;
  17666. // (2) Recurse on each half.
  17667. doQuickSort(ary, comparator, p, q - 1);
  17668. doQuickSort(ary, comparator, q + 1, r);
  17669. }
  17670. }
  17671. /**
  17672. * Sort the given array in-place with the given comparator function.
  17673. *
  17674. * @param {Array} ary
  17675. * An array to sort.
  17676. * @param {function} comparator
  17677. * Function to use to compare two items.
  17678. */
  17679. exports.quickSort = function (ary, comparator) {
  17680. doQuickSort(ary, comparator, 0, ary.length - 1);
  17681. };
  17682. /***/ }),
  17683. /* 143 */
  17684. /***/ (function(module, exports, __webpack_require__) {
  17685. /* -*- Mode: js; js-indent-level: 2; -*- */
  17686. /*
  17687. * Copyright 2011 Mozilla Foundation and contributors
  17688. * Licensed under the New BSD license. See LICENSE or:
  17689. * http://opensource.org/licenses/BSD-3-Clause
  17690. */
  17691. var util = __webpack_require__(8);
  17692. var binarySearch = __webpack_require__(140);
  17693. var ArraySet = __webpack_require__(47).ArraySet;
  17694. var base64VLQ = __webpack_require__(48);
  17695. var quickSort = __webpack_require__(142).quickSort;
  17696. function SourceMapConsumer(aSourceMap, aSourceMapURL) {
  17697. var sourceMap = aSourceMap;
  17698. if (typeof aSourceMap === 'string') {
  17699. sourceMap = util.parseSourceMapInput(aSourceMap);
  17700. }
  17701. return sourceMap.sections != null
  17702. ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)
  17703. : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
  17704. }
  17705. SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
  17706. return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
  17707. }
  17708. /**
  17709. * The version of the source mapping spec that we are consuming.
  17710. */
  17711. SourceMapConsumer.prototype._version = 3;
  17712. // `__generatedMappings` and `__originalMappings` are arrays that hold the
  17713. // parsed mapping coordinates from the source map's "mappings" attribute. They
  17714. // are lazily instantiated, accessed via the `_generatedMappings` and
  17715. // `_originalMappings` getters respectively, and we only parse the mappings
  17716. // and create these arrays once queried for a source location. We jump through
  17717. // these hoops because there can be many thousands of mappings, and parsing
  17718. // them is expensive, so we only want to do it if we must.
  17719. //
  17720. // Each object in the arrays is of the form:
  17721. //
  17722. // {
  17723. // generatedLine: The line number in the generated code,
  17724. // generatedColumn: The column number in the generated code,
  17725. // source: The path to the original source file that generated this
  17726. // chunk of code,
  17727. // originalLine: The line number in the original source that
  17728. // corresponds to this chunk of generated code,
  17729. // originalColumn: The column number in the original source that
  17730. // corresponds to this chunk of generated code,
  17731. // name: The name of the original symbol which generated this chunk of
  17732. // code.
  17733. // }
  17734. //
  17735. // All properties except for `generatedLine` and `generatedColumn` can be
  17736. // `null`.
  17737. //
  17738. // `_generatedMappings` is ordered by the generated positions.
  17739. //
  17740. // `_originalMappings` is ordered by the original positions.
  17741. SourceMapConsumer.prototype.__generatedMappings = null;
  17742. Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
  17743. configurable: true,
  17744. enumerable: true,
  17745. get: function () {
  17746. if (!this.__generatedMappings) {
  17747. this._parseMappings(this._mappings, this.sourceRoot);
  17748. }
  17749. return this.__generatedMappings;
  17750. }
  17751. });
  17752. SourceMapConsumer.prototype.__originalMappings = null;
  17753. Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
  17754. configurable: true,
  17755. enumerable: true,
  17756. get: function () {
  17757. if (!this.__originalMappings) {
  17758. this._parseMappings(this._mappings, this.sourceRoot);
  17759. }
  17760. return this.__originalMappings;
  17761. }
  17762. });
  17763. SourceMapConsumer.prototype._charIsMappingSeparator =
  17764. function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
  17765. var c = aStr.charAt(index);
  17766. return c === ";" || c === ",";
  17767. };
  17768. /**
  17769. * Parse the mappings in a string in to a data structure which we can easily
  17770. * query (the ordered arrays in the `this.__generatedMappings` and
  17771. * `this.__originalMappings` properties).
  17772. */
  17773. SourceMapConsumer.prototype._parseMappings =
  17774. function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  17775. throw new Error("Subclasses must implement _parseMappings");
  17776. };
  17777. SourceMapConsumer.GENERATED_ORDER = 1;
  17778. SourceMapConsumer.ORIGINAL_ORDER = 2;
  17779. SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
  17780. SourceMapConsumer.LEAST_UPPER_BOUND = 2;
  17781. /**
  17782. * Iterate over each mapping between an original source/line/column and a
  17783. * generated line/column in this source map.
  17784. *
  17785. * @param Function aCallback
  17786. * The function that is called with each mapping.
  17787. * @param Object aContext
  17788. * Optional. If specified, this object will be the value of `this` every
  17789. * time that `aCallback` is called.
  17790. * @param aOrder
  17791. * Either `SourceMapConsumer.GENERATED_ORDER` or
  17792. * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
  17793. * iterate over the mappings sorted by the generated file's line/column
  17794. * order or the original's source/line/column order, respectively. Defaults to
  17795. * `SourceMapConsumer.GENERATED_ORDER`.
  17796. */
  17797. SourceMapConsumer.prototype.eachMapping =
  17798. function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
  17799. var context = aContext || null;
  17800. var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
  17801. var mappings;
  17802. switch (order) {
  17803. case SourceMapConsumer.GENERATED_ORDER:
  17804. mappings = this._generatedMappings;
  17805. break;
  17806. case SourceMapConsumer.ORIGINAL_ORDER:
  17807. mappings = this._originalMappings;
  17808. break;
  17809. default:
  17810. throw new Error("Unknown order of iteration.");
  17811. }
  17812. var sourceRoot = this.sourceRoot;
  17813. mappings.map(function (mapping) {
  17814. var source = mapping.source === null ? null : this._sources.at(mapping.source);
  17815. source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);
  17816. return {
  17817. source: source,
  17818. generatedLine: mapping.generatedLine,
  17819. generatedColumn: mapping.generatedColumn,
  17820. originalLine: mapping.originalLine,
  17821. originalColumn: mapping.originalColumn,
  17822. name: mapping.name === null ? null : this._names.at(mapping.name)
  17823. };
  17824. }, this).forEach(aCallback, context);
  17825. };
  17826. /**
  17827. * Returns all generated line and column information for the original source,
  17828. * line, and column provided. If no column is provided, returns all mappings
  17829. * corresponding to a either the line we are searching for or the next
  17830. * closest line that has any mappings. Otherwise, returns all mappings
  17831. * corresponding to the given line and either the column we are searching for
  17832. * or the next closest column that has any offsets.
  17833. *
  17834. * The only argument is an object with the following properties:
  17835. *
  17836. * - source: The filename of the original source.
  17837. * - line: The line number in the original source. The line number is 1-based.
  17838. * - column: Optional. the column number in the original source.
  17839. * The column number is 0-based.
  17840. *
  17841. * and an array of objects is returned, each with the following properties:
  17842. *
  17843. * - line: The line number in the generated source, or null. The
  17844. * line number is 1-based.
  17845. * - column: The column number in the generated source, or null.
  17846. * The column number is 0-based.
  17847. */
  17848. SourceMapConsumer.prototype.allGeneratedPositionsFor =
  17849. function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
  17850. var line = util.getArg(aArgs, 'line');
  17851. // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
  17852. // returns the index of the closest mapping less than the needle. By
  17853. // setting needle.originalColumn to 0, we thus find the last mapping for
  17854. // the given line, provided such a mapping exists.
  17855. var needle = {
  17856. source: util.getArg(aArgs, 'source'),
  17857. originalLine: line,
  17858. originalColumn: util.getArg(aArgs, 'column', 0)
  17859. };
  17860. needle.source = this._findSourceIndex(needle.source);
  17861. if (needle.source < 0) {
  17862. return [];
  17863. }
  17864. var mappings = [];
  17865. var index = this._findMapping(needle,
  17866. this._originalMappings,
  17867. "originalLine",
  17868. "originalColumn",
  17869. util.compareByOriginalPositions,
  17870. binarySearch.LEAST_UPPER_BOUND);
  17871. if (index >= 0) {
  17872. var mapping = this._originalMappings[index];
  17873. if (aArgs.column === undefined) {
  17874. var originalLine = mapping.originalLine;
  17875. // Iterate until either we run out of mappings, or we run into
  17876. // a mapping for a different line than the one we found. Since
  17877. // mappings are sorted, this is guaranteed to find all mappings for
  17878. // the line we found.
  17879. while (mapping && mapping.originalLine === originalLine) {
  17880. mappings.push({
  17881. line: util.getArg(mapping, 'generatedLine', null),
  17882. column: util.getArg(mapping, 'generatedColumn', null),
  17883. lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
  17884. });
  17885. mapping = this._originalMappings[++index];
  17886. }
  17887. } else {
  17888. var originalColumn = mapping.originalColumn;
  17889. // Iterate until either we run out of mappings, or we run into
  17890. // a mapping for a different line than the one we were searching for.
  17891. // Since mappings are sorted, this is guaranteed to find all mappings for
  17892. // the line we are searching for.
  17893. while (mapping &&
  17894. mapping.originalLine === line &&
  17895. mapping.originalColumn == originalColumn) {
  17896. mappings.push({
  17897. line: util.getArg(mapping, 'generatedLine', null),
  17898. column: util.getArg(mapping, 'generatedColumn', null),
  17899. lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
  17900. });
  17901. mapping = this._originalMappings[++index];
  17902. }
  17903. }
  17904. }
  17905. return mappings;
  17906. };
  17907. exports.SourceMapConsumer = SourceMapConsumer;
  17908. /**
  17909. * A BasicSourceMapConsumer instance represents a parsed source map which we can
  17910. * query for information about the original file positions by giving it a file
  17911. * position in the generated source.
  17912. *
  17913. * The first parameter is the raw source map (either as a JSON string, or
  17914. * already parsed to an object). According to the spec, source maps have the
  17915. * following attributes:
  17916. *
  17917. * - version: Which version of the source map spec this map is following.
  17918. * - sources: An array of URLs to the original source files.
  17919. * - names: An array of identifiers which can be referrenced by individual mappings.
  17920. * - sourceRoot: Optional. The URL root from which all sources are relative.
  17921. * - sourcesContent: Optional. An array of contents of the original source files.
  17922. * - mappings: A string of base64 VLQs which contain the actual mappings.
  17923. * - file: Optional. The generated file this source map is associated with.
  17924. *
  17925. * Here is an example source map, taken from the source map spec[0]:
  17926. *
  17927. * {
  17928. * version : 3,
  17929. * file: "out.js",
  17930. * sourceRoot : "",
  17931. * sources: ["foo.js", "bar.js"],
  17932. * names: ["src", "maps", "are", "fun"],
  17933. * mappings: "AA,AB;;ABCDE;"
  17934. * }
  17935. *
  17936. * The second parameter, if given, is a string whose value is the URL
  17937. * at which the source map was found. This URL is used to compute the
  17938. * sources array.
  17939. *
  17940. * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
  17941. */
  17942. function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
  17943. var sourceMap = aSourceMap;
  17944. if (typeof aSourceMap === 'string') {
  17945. sourceMap = util.parseSourceMapInput(aSourceMap);
  17946. }
  17947. var version = util.getArg(sourceMap, 'version');
  17948. var sources = util.getArg(sourceMap, 'sources');
  17949. // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
  17950. // requires the array) to play nice here.
  17951. var names = util.getArg(sourceMap, 'names', []);
  17952. var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
  17953. var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
  17954. var mappings = util.getArg(sourceMap, 'mappings');
  17955. var file = util.getArg(sourceMap, 'file', null);
  17956. // Once again, Sass deviates from the spec and supplies the version as a
  17957. // string rather than a number, so we use loose equality checking here.
  17958. if (version != this._version) {
  17959. throw new Error('Unsupported version: ' + version);
  17960. }
  17961. if (sourceRoot) {
  17962. sourceRoot = util.normalize(sourceRoot);
  17963. }
  17964. sources = sources
  17965. .map(String)
  17966. // Some source maps produce relative source paths like "./foo.js" instead of
  17967. // "foo.js". Normalize these first so that future comparisons will succeed.
  17968. // See bugzil.la/1090768.
  17969. .map(util.normalize)
  17970. // Always ensure that absolute sources are internally stored relative to
  17971. // the source root, if the source root is absolute. Not doing this would
  17972. // be particularly problematic when the source root is a prefix of the
  17973. // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
  17974. .map(function (source) {
  17975. return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)
  17976. ? util.relative(sourceRoot, source)
  17977. : source;
  17978. });
  17979. // Pass `true` below to allow duplicate names and sources. While source maps
  17980. // are intended to be compressed and deduplicated, the TypeScript compiler
  17981. // sometimes generates source maps with duplicates in them. See Github issue
  17982. // #72 and bugzil.la/889492.
  17983. this._names = ArraySet.fromArray(names.map(String), true);
  17984. this._sources = ArraySet.fromArray(sources, true);
  17985. this._absoluteSources = this._sources.toArray().map(function (s) {
  17986. return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
  17987. });
  17988. this.sourceRoot = sourceRoot;
  17989. this.sourcesContent = sourcesContent;
  17990. this._mappings = mappings;
  17991. this._sourceMapURL = aSourceMapURL;
  17992. this.file = file;
  17993. }
  17994. BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
  17995. BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
  17996. /**
  17997. * Utility function to find the index of a source. Returns -1 if not
  17998. * found.
  17999. */
  18000. BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
  18001. var relativeSource = aSource;
  18002. if (this.sourceRoot != null) {
  18003. relativeSource = util.relative(this.sourceRoot, relativeSource);
  18004. }
  18005. if (this._sources.has(relativeSource)) {
  18006. return this._sources.indexOf(relativeSource);
  18007. }
  18008. // Maybe aSource is an absolute URL as returned by |sources|. In
  18009. // this case we can't simply undo the transform.
  18010. var i;
  18011. for (i = 0; i < this._absoluteSources.length; ++i) {
  18012. if (this._absoluteSources[i] == aSource) {
  18013. return i;
  18014. }
  18015. }
  18016. return -1;
  18017. };
  18018. /**
  18019. * Create a BasicSourceMapConsumer from a SourceMapGenerator.
  18020. *
  18021. * @param SourceMapGenerator aSourceMap
  18022. * The source map that will be consumed.
  18023. * @param String aSourceMapURL
  18024. * The URL at which the source map can be found (optional)
  18025. * @returns BasicSourceMapConsumer
  18026. */
  18027. BasicSourceMapConsumer.fromSourceMap =
  18028. function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
  18029. var smc = Object.create(BasicSourceMapConsumer.prototype);
  18030. var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
  18031. var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
  18032. smc.sourceRoot = aSourceMap._sourceRoot;
  18033. smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
  18034. smc.sourceRoot);
  18035. smc.file = aSourceMap._file;
  18036. smc._sourceMapURL = aSourceMapURL;
  18037. smc._absoluteSources = smc._sources.toArray().map(function (s) {
  18038. return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
  18039. });
  18040. // Because we are modifying the entries (by converting string sources and
  18041. // names to indices into the sources and names ArraySets), we have to make
  18042. // a copy of the entry or else bad things happen. Shared mutable state
  18043. // strikes again! See github issue #191.
  18044. var generatedMappings = aSourceMap._mappings.toArray().slice();
  18045. var destGeneratedMappings = smc.__generatedMappings = [];
  18046. var destOriginalMappings = smc.__originalMappings = [];
  18047. for (var i = 0, length = generatedMappings.length; i < length; i++) {
  18048. var srcMapping = generatedMappings[i];
  18049. var destMapping = new Mapping;
  18050. destMapping.generatedLine = srcMapping.generatedLine;
  18051. destMapping.generatedColumn = srcMapping.generatedColumn;
  18052. if (srcMapping.source) {
  18053. destMapping.source = sources.indexOf(srcMapping.source);
  18054. destMapping.originalLine = srcMapping.originalLine;
  18055. destMapping.originalColumn = srcMapping.originalColumn;
  18056. if (srcMapping.name) {
  18057. destMapping.name = names.indexOf(srcMapping.name);
  18058. }
  18059. destOriginalMappings.push(destMapping);
  18060. }
  18061. destGeneratedMappings.push(destMapping);
  18062. }
  18063. quickSort(smc.__originalMappings, util.compareByOriginalPositions);
  18064. return smc;
  18065. };
  18066. /**
  18067. * The version of the source mapping spec that we are consuming.
  18068. */
  18069. BasicSourceMapConsumer.prototype._version = 3;
  18070. /**
  18071. * The list of original sources.
  18072. */
  18073. Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
  18074. get: function () {
  18075. return this._absoluteSources.slice();
  18076. }
  18077. });
  18078. /**
  18079. * Provide the JIT with a nice shape / hidden class.
  18080. */
  18081. function Mapping() {
  18082. this.generatedLine = 0;
  18083. this.generatedColumn = 0;
  18084. this.source = null;
  18085. this.originalLine = null;
  18086. this.originalColumn = null;
  18087. this.name = null;
  18088. }
  18089. /**
  18090. * Parse the mappings in a string in to a data structure which we can easily
  18091. * query (the ordered arrays in the `this.__generatedMappings` and
  18092. * `this.__originalMappings` properties).
  18093. */
  18094. BasicSourceMapConsumer.prototype._parseMappings =
  18095. function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  18096. var generatedLine = 1;
  18097. var previousGeneratedColumn = 0;
  18098. var previousOriginalLine = 0;
  18099. var previousOriginalColumn = 0;
  18100. var previousSource = 0;
  18101. var previousName = 0;
  18102. var length = aStr.length;
  18103. var index = 0;
  18104. var cachedSegments = {};
  18105. var temp = {};
  18106. var originalMappings = [];
  18107. var generatedMappings = [];
  18108. var mapping, str, segment, end, value;
  18109. while (index < length) {
  18110. if (aStr.charAt(index) === ';') {
  18111. generatedLine++;
  18112. index++;
  18113. previousGeneratedColumn = 0;
  18114. }
  18115. else if (aStr.charAt(index) === ',') {
  18116. index++;
  18117. }
  18118. else {
  18119. mapping = new Mapping();
  18120. mapping.generatedLine = generatedLine;
  18121. // Because each offset is encoded relative to the previous one,
  18122. // many segments often have the same encoding. We can exploit this
  18123. // fact by caching the parsed variable length fields of each segment,
  18124. // allowing us to avoid a second parse if we encounter the same
  18125. // segment again.
  18126. for (end = index; end < length; end++) {
  18127. if (this._charIsMappingSeparator(aStr, end)) {
  18128. break;
  18129. }
  18130. }
  18131. str = aStr.slice(index, end);
  18132. segment = cachedSegments[str];
  18133. if (segment) {
  18134. index += str.length;
  18135. } else {
  18136. segment = [];
  18137. while (index < end) {
  18138. base64VLQ.decode(aStr, index, temp);
  18139. value = temp.value;
  18140. index = temp.rest;
  18141. segment.push(value);
  18142. }
  18143. if (segment.length === 2) {
  18144. throw new Error('Found a source, but no line and column');
  18145. }
  18146. if (segment.length === 3) {
  18147. throw new Error('Found a source and line, but no column');
  18148. }
  18149. cachedSegments[str] = segment;
  18150. }
  18151. // Generated column.
  18152. mapping.generatedColumn = previousGeneratedColumn + segment[0];
  18153. previousGeneratedColumn = mapping.generatedColumn;
  18154. if (segment.length > 1) {
  18155. // Original source.
  18156. mapping.source = previousSource + segment[1];
  18157. previousSource += segment[1];
  18158. // Original line.
  18159. mapping.originalLine = previousOriginalLine + segment[2];
  18160. previousOriginalLine = mapping.originalLine;
  18161. // Lines are stored 0-based
  18162. mapping.originalLine += 1;
  18163. // Original column.
  18164. mapping.originalColumn = previousOriginalColumn + segment[3];
  18165. previousOriginalColumn = mapping.originalColumn;
  18166. if (segment.length > 4) {
  18167. // Original name.
  18168. mapping.name = previousName + segment[4];
  18169. previousName += segment[4];
  18170. }
  18171. }
  18172. generatedMappings.push(mapping);
  18173. if (typeof mapping.originalLine === 'number') {
  18174. originalMappings.push(mapping);
  18175. }
  18176. }
  18177. }
  18178. quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
  18179. this.__generatedMappings = generatedMappings;
  18180. quickSort(originalMappings, util.compareByOriginalPositions);
  18181. this.__originalMappings = originalMappings;
  18182. };
  18183. /**
  18184. * Find the mapping that best matches the hypothetical "needle" mapping that
  18185. * we are searching for in the given "haystack" of mappings.
  18186. */
  18187. BasicSourceMapConsumer.prototype._findMapping =
  18188. function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
  18189. aColumnName, aComparator, aBias) {
  18190. // To return the position we are searching for, we must first find the
  18191. // mapping for the given position and then return the opposite position it
  18192. // points to. Because the mappings are sorted, we can use binary search to
  18193. // find the best mapping.
  18194. if (aNeedle[aLineName] <= 0) {
  18195. throw new TypeError('Line must be greater than or equal to 1, got '
  18196. + aNeedle[aLineName]);
  18197. }
  18198. if (aNeedle[aColumnName] < 0) {
  18199. throw new TypeError('Column must be greater than or equal to 0, got '
  18200. + aNeedle[aColumnName]);
  18201. }
  18202. return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
  18203. };
  18204. /**
  18205. * Compute the last column for each generated mapping. The last column is
  18206. * inclusive.
  18207. */
  18208. BasicSourceMapConsumer.prototype.computeColumnSpans =
  18209. function SourceMapConsumer_computeColumnSpans() {
  18210. for (var index = 0; index < this._generatedMappings.length; ++index) {
  18211. var mapping = this._generatedMappings[index];
  18212. // Mappings do not contain a field for the last generated columnt. We
  18213. // can come up with an optimistic estimate, however, by assuming that
  18214. // mappings are contiguous (i.e. given two consecutive mappings, the
  18215. // first mapping ends where the second one starts).
  18216. if (index + 1 < this._generatedMappings.length) {
  18217. var nextMapping = this._generatedMappings[index + 1];
  18218. if (mapping.generatedLine === nextMapping.generatedLine) {
  18219. mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
  18220. continue;
  18221. }
  18222. }
  18223. // The last mapping for each line spans the entire line.
  18224. mapping.lastGeneratedColumn = Infinity;
  18225. }
  18226. };
  18227. /**
  18228. * Returns the original source, line, and column information for the generated
  18229. * source's line and column positions provided. The only argument is an object
  18230. * with the following properties:
  18231. *
  18232. * - line: The line number in the generated source. The line number
  18233. * is 1-based.
  18234. * - column: The column number in the generated source. The column
  18235. * number is 0-based.
  18236. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
  18237. * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
  18238. * closest element that is smaller than or greater than the one we are
  18239. * searching for, respectively, if the exact element cannot be found.
  18240. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
  18241. *
  18242. * and an object is returned with the following properties:
  18243. *
  18244. * - source: The original source file, or null.
  18245. * - line: The line number in the original source, or null. The
  18246. * line number is 1-based.
  18247. * - column: The column number in the original source, or null. The
  18248. * column number is 0-based.
  18249. * - name: The original identifier, or null.
  18250. */
  18251. BasicSourceMapConsumer.prototype.originalPositionFor =
  18252. function SourceMapConsumer_originalPositionFor(aArgs) {
  18253. var needle = {
  18254. generatedLine: util.getArg(aArgs, 'line'),
  18255. generatedColumn: util.getArg(aArgs, 'column')
  18256. };
  18257. var index = this._findMapping(
  18258. needle,
  18259. this._generatedMappings,
  18260. "generatedLine",
  18261. "generatedColumn",
  18262. util.compareByGeneratedPositionsDeflated,
  18263. util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
  18264. );
  18265. if (index >= 0) {
  18266. var mapping = this._generatedMappings[index];
  18267. if (mapping.generatedLine === needle.generatedLine) {
  18268. var source = util.getArg(mapping, 'source', null);
  18269. if (source !== null) {
  18270. source = this._sources.at(source);
  18271. source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
  18272. }
  18273. var name = util.getArg(mapping, 'name', null);
  18274. if (name !== null) {
  18275. name = this._names.at(name);
  18276. }
  18277. return {
  18278. source: source,
  18279. line: util.getArg(mapping, 'originalLine', null),
  18280. column: util.getArg(mapping, 'originalColumn', null),
  18281. name: name
  18282. };
  18283. }
  18284. }
  18285. return {
  18286. source: null,
  18287. line: null,
  18288. column: null,
  18289. name: null
  18290. };
  18291. };
  18292. /**
  18293. * Return true if we have the source content for every source in the source
  18294. * map, false otherwise.
  18295. */
  18296. BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
  18297. function BasicSourceMapConsumer_hasContentsOfAllSources() {
  18298. if (!this.sourcesContent) {
  18299. return false;
  18300. }
  18301. return this.sourcesContent.length >= this._sources.size() &&
  18302. !this.sourcesContent.some(function (sc) { return sc == null; });
  18303. };
  18304. /**
  18305. * Returns the original source content. The only argument is the url of the
  18306. * original source file. Returns null if no original source content is
  18307. * available.
  18308. */
  18309. BasicSourceMapConsumer.prototype.sourceContentFor =
  18310. function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
  18311. if (!this.sourcesContent) {
  18312. return null;
  18313. }
  18314. var index = this._findSourceIndex(aSource);
  18315. if (index >= 0) {
  18316. return this.sourcesContent[index];
  18317. }
  18318. var relativeSource = aSource;
  18319. if (this.sourceRoot != null) {
  18320. relativeSource = util.relative(this.sourceRoot, relativeSource);
  18321. }
  18322. var url;
  18323. if (this.sourceRoot != null
  18324. && (url = util.urlParse(this.sourceRoot))) {
  18325. // XXX: file:// URIs and absolute paths lead to unexpected behavior for
  18326. // many users. We can help them out when they expect file:// URIs to
  18327. // behave like it would if they were running a local HTTP server. See
  18328. // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
  18329. var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
  18330. if (url.scheme == "file"
  18331. && this._sources.has(fileUriAbsPath)) {
  18332. return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
  18333. }
  18334. if ((!url.path || url.path == "/")
  18335. && this._sources.has("/" + relativeSource)) {
  18336. return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
  18337. }
  18338. }
  18339. // This function is used recursively from
  18340. // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
  18341. // don't want to throw if we can't find the source - we just want to
  18342. // return null, so we provide a flag to exit gracefully.
  18343. if (nullOnMissing) {
  18344. return null;
  18345. }
  18346. else {
  18347. throw new Error('"' + relativeSource + '" is not in the SourceMap.');
  18348. }
  18349. };
  18350. /**
  18351. * Returns the generated line and column information for the original source,
  18352. * line, and column positions provided. The only argument is an object with
  18353. * the following properties:
  18354. *
  18355. * - source: The filename of the original source.
  18356. * - line: The line number in the original source. The line number
  18357. * is 1-based.
  18358. * - column: The column number in the original source. The column
  18359. * number is 0-based.
  18360. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
  18361. * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
  18362. * closest element that is smaller than or greater than the one we are
  18363. * searching for, respectively, if the exact element cannot be found.
  18364. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
  18365. *
  18366. * and an object is returned with the following properties:
  18367. *
  18368. * - line: The line number in the generated source, or null. The
  18369. * line number is 1-based.
  18370. * - column: The column number in the generated source, or null.
  18371. * The column number is 0-based.
  18372. */
  18373. BasicSourceMapConsumer.prototype.generatedPositionFor =
  18374. function SourceMapConsumer_generatedPositionFor(aArgs) {
  18375. var source = util.getArg(aArgs, 'source');
  18376. source = this._findSourceIndex(source);
  18377. if (source < 0) {
  18378. return {
  18379. line: null,
  18380. column: null,
  18381. lastColumn: null
  18382. };
  18383. }
  18384. var needle = {
  18385. source: source,
  18386. originalLine: util.getArg(aArgs, 'line'),
  18387. originalColumn: util.getArg(aArgs, 'column')
  18388. };
  18389. var index = this._findMapping(
  18390. needle,
  18391. this._originalMappings,
  18392. "originalLine",
  18393. "originalColumn",
  18394. util.compareByOriginalPositions,
  18395. util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
  18396. );
  18397. if (index >= 0) {
  18398. var mapping = this._originalMappings[index];
  18399. if (mapping.source === needle.source) {
  18400. return {
  18401. line: util.getArg(mapping, 'generatedLine', null),
  18402. column: util.getArg(mapping, 'generatedColumn', null),
  18403. lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
  18404. };
  18405. }
  18406. }
  18407. return {
  18408. line: null,
  18409. column: null,
  18410. lastColumn: null
  18411. };
  18412. };
  18413. exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
  18414. /**
  18415. * An IndexedSourceMapConsumer instance represents a parsed source map which
  18416. * we can query for information. It differs from BasicSourceMapConsumer in
  18417. * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
  18418. * input.
  18419. *
  18420. * The first parameter is a raw source map (either as a JSON string, or already
  18421. * parsed to an object). According to the spec for indexed source maps, they
  18422. * have the following attributes:
  18423. *
  18424. * - version: Which version of the source map spec this map is following.
  18425. * - file: Optional. The generated file this source map is associated with.
  18426. * - sections: A list of section definitions.
  18427. *
  18428. * Each value under the "sections" field has two fields:
  18429. * - offset: The offset into the original specified at which this section
  18430. * begins to apply, defined as an object with a "line" and "column"
  18431. * field.
  18432. * - map: A source map definition. This source map could also be indexed,
  18433. * but doesn't have to be.
  18434. *
  18435. * Instead of the "map" field, it's also possible to have a "url" field
  18436. * specifying a URL to retrieve a source map from, but that's currently
  18437. * unsupported.
  18438. *
  18439. * Here's an example source map, taken from the source map spec[0], but
  18440. * modified to omit a section which uses the "url" field.
  18441. *
  18442. * {
  18443. * version : 3,
  18444. * file: "app.js",
  18445. * sections: [{
  18446. * offset: {line:100, column:10},
  18447. * map: {
  18448. * version : 3,
  18449. * file: "section.js",
  18450. * sources: ["foo.js", "bar.js"],
  18451. * names: ["src", "maps", "are", "fun"],
  18452. * mappings: "AAAA,E;;ABCDE;"
  18453. * }
  18454. * }],
  18455. * }
  18456. *
  18457. * The second parameter, if given, is a string whose value is the URL
  18458. * at which the source map was found. This URL is used to compute the
  18459. * sources array.
  18460. *
  18461. * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
  18462. */
  18463. function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
  18464. var sourceMap = aSourceMap;
  18465. if (typeof aSourceMap === 'string') {
  18466. sourceMap = util.parseSourceMapInput(aSourceMap);
  18467. }
  18468. var version = util.getArg(sourceMap, 'version');
  18469. var sections = util.getArg(sourceMap, 'sections');
  18470. if (version != this._version) {
  18471. throw new Error('Unsupported version: ' + version);
  18472. }
  18473. this._sources = new ArraySet();
  18474. this._names = new ArraySet();
  18475. var lastOffset = {
  18476. line: -1,
  18477. column: 0
  18478. };
  18479. this._sections = sections.map(function (s) {
  18480. if (s.url) {
  18481. // The url field will require support for asynchronicity.
  18482. // See https://github.com/mozilla/source-map/issues/16
  18483. throw new Error('Support for url field in sections not implemented.');
  18484. }
  18485. var offset = util.getArg(s, 'offset');
  18486. var offsetLine = util.getArg(offset, 'line');
  18487. var offsetColumn = util.getArg(offset, 'column');
  18488. if (offsetLine < lastOffset.line ||
  18489. (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
  18490. throw new Error('Section offsets must be ordered and non-overlapping.');
  18491. }
  18492. lastOffset = offset;
  18493. return {
  18494. generatedOffset: {
  18495. // The offset fields are 0-based, but we use 1-based indices when
  18496. // encoding/decoding from VLQ.
  18497. generatedLine: offsetLine + 1,
  18498. generatedColumn: offsetColumn + 1
  18499. },
  18500. consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)
  18501. }
  18502. });
  18503. }
  18504. IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
  18505. IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
  18506. /**
  18507. * The version of the source mapping spec that we are consuming.
  18508. */
  18509. IndexedSourceMapConsumer.prototype._version = 3;
  18510. /**
  18511. * The list of original sources.
  18512. */
  18513. Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
  18514. get: function () {
  18515. var sources = [];
  18516. for (var i = 0; i < this._sections.length; i++) {
  18517. for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
  18518. sources.push(this._sections[i].consumer.sources[j]);
  18519. }
  18520. }
  18521. return sources;
  18522. }
  18523. });
  18524. /**
  18525. * Returns the original source, line, and column information for the generated
  18526. * source's line and column positions provided. The only argument is an object
  18527. * with the following properties:
  18528. *
  18529. * - line: The line number in the generated source. The line number
  18530. * is 1-based.
  18531. * - column: The column number in the generated source. The column
  18532. * number is 0-based.
  18533. *
  18534. * and an object is returned with the following properties:
  18535. *
  18536. * - source: The original source file, or null.
  18537. * - line: The line number in the original source, or null. The
  18538. * line number is 1-based.
  18539. * - column: The column number in the original source, or null. The
  18540. * column number is 0-based.
  18541. * - name: The original identifier, or null.
  18542. */
  18543. IndexedSourceMapConsumer.prototype.originalPositionFor =
  18544. function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
  18545. var needle = {
  18546. generatedLine: util.getArg(aArgs, 'line'),
  18547. generatedColumn: util.getArg(aArgs, 'column')
  18548. };
  18549. // Find the section containing the generated position we're trying to map
  18550. // to an original position.
  18551. var sectionIndex = binarySearch.search(needle, this._sections,
  18552. function(needle, section) {
  18553. var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
  18554. if (cmp) {
  18555. return cmp;
  18556. }
  18557. return (needle.generatedColumn -
  18558. section.generatedOffset.generatedColumn);
  18559. });
  18560. var section = this._sections[sectionIndex];
  18561. if (!section) {
  18562. return {
  18563. source: null,
  18564. line: null,
  18565. column: null,
  18566. name: null
  18567. };
  18568. }
  18569. return section.consumer.originalPositionFor({
  18570. line: needle.generatedLine -
  18571. (section.generatedOffset.generatedLine - 1),
  18572. column: needle.generatedColumn -
  18573. (section.generatedOffset.generatedLine === needle.generatedLine
  18574. ? section.generatedOffset.generatedColumn - 1
  18575. : 0),
  18576. bias: aArgs.bias
  18577. });
  18578. };
  18579. /**
  18580. * Return true if we have the source content for every source in the source
  18581. * map, false otherwise.
  18582. */
  18583. IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
  18584. function IndexedSourceMapConsumer_hasContentsOfAllSources() {
  18585. return this._sections.every(function (s) {
  18586. return s.consumer.hasContentsOfAllSources();
  18587. });
  18588. };
  18589. /**
  18590. * Returns the original source content. The only argument is the url of the
  18591. * original source file. Returns null if no original source content is
  18592. * available.
  18593. */
  18594. IndexedSourceMapConsumer.prototype.sourceContentFor =
  18595. function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
  18596. for (var i = 0; i < this._sections.length; i++) {
  18597. var section = this._sections[i];
  18598. var content = section.consumer.sourceContentFor(aSource, true);
  18599. if (content) {
  18600. return content;
  18601. }
  18602. }
  18603. if (nullOnMissing) {
  18604. return null;
  18605. }
  18606. else {
  18607. throw new Error('"' + aSource + '" is not in the SourceMap.');
  18608. }
  18609. };
  18610. /**
  18611. * Returns the generated line and column information for the original source,
  18612. * line, and column positions provided. The only argument is an object with
  18613. * the following properties:
  18614. *
  18615. * - source: The filename of the original source.
  18616. * - line: The line number in the original source. The line number
  18617. * is 1-based.
  18618. * - column: The column number in the original source. The column
  18619. * number is 0-based.
  18620. *
  18621. * and an object is returned with the following properties:
  18622. *
  18623. * - line: The line number in the generated source, or null. The
  18624. * line number is 1-based.
  18625. * - column: The column number in the generated source, or null.
  18626. * The column number is 0-based.
  18627. */
  18628. IndexedSourceMapConsumer.prototype.generatedPositionFor =
  18629. function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
  18630. for (var i = 0; i < this._sections.length; i++) {
  18631. var section = this._sections[i];
  18632. // Only consider this section if the requested source is in the list of
  18633. // sources of the consumer.
  18634. if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {
  18635. continue;
  18636. }
  18637. var generatedPosition = section.consumer.generatedPositionFor(aArgs);
  18638. if (generatedPosition) {
  18639. var ret = {
  18640. line: generatedPosition.line +
  18641. (section.generatedOffset.generatedLine - 1),
  18642. column: generatedPosition.column +
  18643. (section.generatedOffset.generatedLine === generatedPosition.line
  18644. ? section.generatedOffset.generatedColumn - 1
  18645. : 0)
  18646. };
  18647. return ret;
  18648. }
  18649. }
  18650. return {
  18651. line: null,
  18652. column: null
  18653. };
  18654. };
  18655. /**
  18656. * Parse the mappings in a string in to a data structure which we can easily
  18657. * query (the ordered arrays in the `this.__generatedMappings` and
  18658. * `this.__originalMappings` properties).
  18659. */
  18660. IndexedSourceMapConsumer.prototype._parseMappings =
  18661. function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  18662. this.__generatedMappings = [];
  18663. this.__originalMappings = [];
  18664. for (var i = 0; i < this._sections.length; i++) {
  18665. var section = this._sections[i];
  18666. var sectionMappings = section.consumer._generatedMappings;
  18667. for (var j = 0; j < sectionMappings.length; j++) {
  18668. var mapping = sectionMappings[j];
  18669. var source = section.consumer._sources.at(mapping.source);
  18670. source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
  18671. this._sources.add(source);
  18672. source = this._sources.indexOf(source);
  18673. var name = null;
  18674. if (mapping.name) {
  18675. name = section.consumer._names.at(mapping.name);
  18676. this._names.add(name);
  18677. name = this._names.indexOf(name);
  18678. }
  18679. // The mappings coming from the consumer for the section have
  18680. // generated positions relative to the start of the section, so we
  18681. // need to offset them to be relative to the start of the concatenated
  18682. // generated file.
  18683. var adjustedMapping = {
  18684. source: source,
  18685. generatedLine: mapping.generatedLine +
  18686. (section.generatedOffset.generatedLine - 1),
  18687. generatedColumn: mapping.generatedColumn +
  18688. (section.generatedOffset.generatedLine === mapping.generatedLine
  18689. ? section.generatedOffset.generatedColumn - 1
  18690. : 0),
  18691. originalLine: mapping.originalLine,
  18692. originalColumn: mapping.originalColumn,
  18693. name: name
  18694. };
  18695. this.__generatedMappings.push(adjustedMapping);
  18696. if (typeof adjustedMapping.originalLine === 'number') {
  18697. this.__originalMappings.push(adjustedMapping);
  18698. }
  18699. }
  18700. }
  18701. quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
  18702. quickSort(this.__originalMappings, util.compareByOriginalPositions);
  18703. };
  18704. exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
  18705. /***/ }),
  18706. /* 144 */
  18707. /***/ (function(module, exports, __webpack_require__) {
  18708. /* -*- Mode: js; js-indent-level: 2; -*- */
  18709. /*
  18710. * Copyright 2011 Mozilla Foundation and contributors
  18711. * Licensed under the New BSD license. See LICENSE or:
  18712. * http://opensource.org/licenses/BSD-3-Clause
  18713. */
  18714. var SourceMapGenerator = __webpack_require__(49).SourceMapGenerator;
  18715. var util = __webpack_require__(8);
  18716. // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
  18717. // operating systems these days (capturing the result).
  18718. var REGEX_NEWLINE = /(\r?\n)/;
  18719. // Newline character code for charCodeAt() comparisons
  18720. var NEWLINE_CODE = 10;
  18721. // Private symbol for identifying `SourceNode`s when multiple versions of
  18722. // the source-map library are loaded. This MUST NOT CHANGE across
  18723. // versions!
  18724. var isSourceNode = "$$$isSourceNode$$$";
  18725. /**
  18726. * SourceNodes provide a way to abstract over interpolating/concatenating
  18727. * snippets of generated JavaScript source code while maintaining the line and
  18728. * column information associated with the original source code.
  18729. *
  18730. * @param aLine The original line number.
  18731. * @param aColumn The original column number.
  18732. * @param aSource The original source's filename.
  18733. * @param aChunks Optional. An array of strings which are snippets of
  18734. * generated JS, or other SourceNodes.
  18735. * @param aName The original identifier.
  18736. */
  18737. function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
  18738. this.children = [];
  18739. this.sourceContents = {};
  18740. this.line = aLine == null ? null : aLine;
  18741. this.column = aColumn == null ? null : aColumn;
  18742. this.source = aSource == null ? null : aSource;
  18743. this.name = aName == null ? null : aName;
  18744. this[isSourceNode] = true;
  18745. if (aChunks != null) this.add(aChunks);
  18746. }
  18747. /**
  18748. * Creates a SourceNode from generated code and a SourceMapConsumer.
  18749. *
  18750. * @param aGeneratedCode The generated code
  18751. * @param aSourceMapConsumer The SourceMap for the generated code
  18752. * @param aRelativePath Optional. The path that relative sources in the
  18753. * SourceMapConsumer should be relative to.
  18754. */
  18755. SourceNode.fromStringWithSourceMap =
  18756. function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
  18757. // The SourceNode we want to fill with the generated code
  18758. // and the SourceMap
  18759. var node = new SourceNode();
  18760. // All even indices of this array are one line of the generated code,
  18761. // while all odd indices are the newlines between two adjacent lines
  18762. // (since `REGEX_NEWLINE` captures its match).
  18763. // Processed fragments are accessed by calling `shiftNextLine`.
  18764. var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
  18765. var remainingLinesIndex = 0;
  18766. var shiftNextLine = function() {
  18767. var lineContents = getNextLine();
  18768. // The last line of a file might not have a newline.
  18769. var newLine = getNextLine() || "";
  18770. return lineContents + newLine;
  18771. function getNextLine() {
  18772. return remainingLinesIndex < remainingLines.length ?
  18773. remainingLines[remainingLinesIndex++] : undefined;
  18774. }
  18775. };
  18776. // We need to remember the position of "remainingLines"
  18777. var lastGeneratedLine = 1, lastGeneratedColumn = 0;
  18778. // The generate SourceNodes we need a code range.
  18779. // To extract it current and last mapping is used.
  18780. // Here we store the last mapping.
  18781. var lastMapping = null;
  18782. aSourceMapConsumer.eachMapping(function (mapping) {
  18783. if (lastMapping !== null) {
  18784. // We add the code from "lastMapping" to "mapping":
  18785. // First check if there is a new line in between.
  18786. if (lastGeneratedLine < mapping.generatedLine) {
  18787. // Associate first line with "lastMapping"
  18788. addMappingWithCode(lastMapping, shiftNextLine());
  18789. lastGeneratedLine++;
  18790. lastGeneratedColumn = 0;
  18791. // The remaining code is added without mapping
  18792. } else {
  18793. // There is no new line in between.
  18794. // Associate the code between "lastGeneratedColumn" and
  18795. // "mapping.generatedColumn" with "lastMapping"
  18796. var nextLine = remainingLines[remainingLinesIndex] || '';
  18797. var code = nextLine.substr(0, mapping.generatedColumn -
  18798. lastGeneratedColumn);
  18799. remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
  18800. lastGeneratedColumn);
  18801. lastGeneratedColumn = mapping.generatedColumn;
  18802. addMappingWithCode(lastMapping, code);
  18803. // No more remaining code, continue
  18804. lastMapping = mapping;
  18805. return;
  18806. }
  18807. }
  18808. // We add the generated code until the first mapping
  18809. // to the SourceNode without any mapping.
  18810. // Each line is added as separate string.
  18811. while (lastGeneratedLine < mapping.generatedLine) {
  18812. node.add(shiftNextLine());
  18813. lastGeneratedLine++;
  18814. }
  18815. if (lastGeneratedColumn < mapping.generatedColumn) {
  18816. var nextLine = remainingLines[remainingLinesIndex] || '';
  18817. node.add(nextLine.substr(0, mapping.generatedColumn));
  18818. remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
  18819. lastGeneratedColumn = mapping.generatedColumn;
  18820. }
  18821. lastMapping = mapping;
  18822. }, this);
  18823. // We have processed all mappings.
  18824. if (remainingLinesIndex < remainingLines.length) {
  18825. if (lastMapping) {
  18826. // Associate the remaining code in the current line with "lastMapping"
  18827. addMappingWithCode(lastMapping, shiftNextLine());
  18828. }
  18829. // and add the remaining lines without any mapping
  18830. node.add(remainingLines.splice(remainingLinesIndex).join(""));
  18831. }
  18832. // Copy sourcesContent into SourceNode
  18833. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  18834. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  18835. if (content != null) {
  18836. if (aRelativePath != null) {
  18837. sourceFile = util.join(aRelativePath, sourceFile);
  18838. }
  18839. node.setSourceContent(sourceFile, content);
  18840. }
  18841. });
  18842. return node;
  18843. function addMappingWithCode(mapping, code) {
  18844. if (mapping === null || mapping.source === undefined) {
  18845. node.add(code);
  18846. } else {
  18847. var source = aRelativePath
  18848. ? util.join(aRelativePath, mapping.source)
  18849. : mapping.source;
  18850. node.add(new SourceNode(mapping.originalLine,
  18851. mapping.originalColumn,
  18852. source,
  18853. code,
  18854. mapping.name));
  18855. }
  18856. }
  18857. };
  18858. /**
  18859. * Add a chunk of generated JS to this source node.
  18860. *
  18861. * @param aChunk A string snippet of generated JS code, another instance of
  18862. * SourceNode, or an array where each member is one of those things.
  18863. */
  18864. SourceNode.prototype.add = function SourceNode_add(aChunk) {
  18865. if (Array.isArray(aChunk)) {
  18866. aChunk.forEach(function (chunk) {
  18867. this.add(chunk);
  18868. }, this);
  18869. }
  18870. else if (aChunk[isSourceNode] || typeof aChunk === "string") {
  18871. if (aChunk) {
  18872. this.children.push(aChunk);
  18873. }
  18874. }
  18875. else {
  18876. throw new TypeError(
  18877. "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
  18878. );
  18879. }
  18880. return this;
  18881. };
  18882. /**
  18883. * Add a chunk of generated JS to the beginning of this source node.
  18884. *
  18885. * @param aChunk A string snippet of generated JS code, another instance of
  18886. * SourceNode, or an array where each member is one of those things.
  18887. */
  18888. SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
  18889. if (Array.isArray(aChunk)) {
  18890. for (var i = aChunk.length-1; i >= 0; i--) {
  18891. this.prepend(aChunk[i]);
  18892. }
  18893. }
  18894. else if (aChunk[isSourceNode] || typeof aChunk === "string") {
  18895. this.children.unshift(aChunk);
  18896. }
  18897. else {
  18898. throw new TypeError(
  18899. "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
  18900. );
  18901. }
  18902. return this;
  18903. };
  18904. /**
  18905. * Walk over the tree of JS snippets in this node and its children. The
  18906. * walking function is called once for each snippet of JS and is passed that
  18907. * snippet and the its original associated source's line/column location.
  18908. *
  18909. * @param aFn The traversal function.
  18910. */
  18911. SourceNode.prototype.walk = function SourceNode_walk(aFn) {
  18912. var chunk;
  18913. for (var i = 0, len = this.children.length; i < len; i++) {
  18914. chunk = this.children[i];
  18915. if (chunk[isSourceNode]) {
  18916. chunk.walk(aFn);
  18917. }
  18918. else {
  18919. if (chunk !== '') {
  18920. aFn(chunk, { source: this.source,
  18921. line: this.line,
  18922. column: this.column,
  18923. name: this.name });
  18924. }
  18925. }
  18926. }
  18927. };
  18928. /**
  18929. * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
  18930. * each of `this.children`.
  18931. *
  18932. * @param aSep The separator.
  18933. */
  18934. SourceNode.prototype.join = function SourceNode_join(aSep) {
  18935. var newChildren;
  18936. var i;
  18937. var len = this.children.length;
  18938. if (len > 0) {
  18939. newChildren = [];
  18940. for (i = 0; i < len-1; i++) {
  18941. newChildren.push(this.children[i]);
  18942. newChildren.push(aSep);
  18943. }
  18944. newChildren.push(this.children[i]);
  18945. this.children = newChildren;
  18946. }
  18947. return this;
  18948. };
  18949. /**
  18950. * Call String.prototype.replace on the very right-most source snippet. Useful
  18951. * for trimming whitespace from the end of a source node, etc.
  18952. *
  18953. * @param aPattern The pattern to replace.
  18954. * @param aReplacement The thing to replace the pattern with.
  18955. */
  18956. SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
  18957. var lastChild = this.children[this.children.length - 1];
  18958. if (lastChild[isSourceNode]) {
  18959. lastChild.replaceRight(aPattern, aReplacement);
  18960. }
  18961. else if (typeof lastChild === 'string') {
  18962. this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
  18963. }
  18964. else {
  18965. this.children.push(''.replace(aPattern, aReplacement));
  18966. }
  18967. return this;
  18968. };
  18969. /**
  18970. * Set the source content for a source file. This will be added to the SourceMapGenerator
  18971. * in the sourcesContent field.
  18972. *
  18973. * @param aSourceFile The filename of the source file
  18974. * @param aSourceContent The content of the source file
  18975. */
  18976. SourceNode.prototype.setSourceContent =
  18977. function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
  18978. this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
  18979. };
  18980. /**
  18981. * Walk over the tree of SourceNodes. The walking function is called for each
  18982. * source file content and is passed the filename and source content.
  18983. *
  18984. * @param aFn The traversal function.
  18985. */
  18986. SourceNode.prototype.walkSourceContents =
  18987. function SourceNode_walkSourceContents(aFn) {
  18988. for (var i = 0, len = this.children.length; i < len; i++) {
  18989. if (this.children[i][isSourceNode]) {
  18990. this.children[i].walkSourceContents(aFn);
  18991. }
  18992. }
  18993. var sources = Object.keys(this.sourceContents);
  18994. for (var i = 0, len = sources.length; i < len; i++) {
  18995. aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
  18996. }
  18997. };
  18998. /**
  18999. * Return the string representation of this source node. Walks over the tree
  19000. * and concatenates all the various snippets together to one string.
  19001. */
  19002. SourceNode.prototype.toString = function SourceNode_toString() {
  19003. var str = "";
  19004. this.walk(function (chunk) {
  19005. str += chunk;
  19006. });
  19007. return str;
  19008. };
  19009. /**
  19010. * Returns the string representation of this source node along with a source
  19011. * map.
  19012. */
  19013. SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
  19014. var generated = {
  19015. code: "",
  19016. line: 1,
  19017. column: 0
  19018. };
  19019. var map = new SourceMapGenerator(aArgs);
  19020. var sourceMappingActive = false;
  19021. var lastOriginalSource = null;
  19022. var lastOriginalLine = null;
  19023. var lastOriginalColumn = null;
  19024. var lastOriginalName = null;
  19025. this.walk(function (chunk, original) {
  19026. generated.code += chunk;
  19027. if (original.source !== null
  19028. && original.line !== null
  19029. && original.column !== null) {
  19030. if(lastOriginalSource !== original.source
  19031. || lastOriginalLine !== original.line
  19032. || lastOriginalColumn !== original.column
  19033. || lastOriginalName !== original.name) {
  19034. map.addMapping({
  19035. source: original.source,
  19036. original: {
  19037. line: original.line,
  19038. column: original.column
  19039. },
  19040. generated: {
  19041. line: generated.line,
  19042. column: generated.column
  19043. },
  19044. name: original.name
  19045. });
  19046. }
  19047. lastOriginalSource = original.source;
  19048. lastOriginalLine = original.line;
  19049. lastOriginalColumn = original.column;
  19050. lastOriginalName = original.name;
  19051. sourceMappingActive = true;
  19052. } else if (sourceMappingActive) {
  19053. map.addMapping({
  19054. generated: {
  19055. line: generated.line,
  19056. column: generated.column
  19057. }
  19058. });
  19059. lastOriginalSource = null;
  19060. sourceMappingActive = false;
  19061. }
  19062. for (var idx = 0, length = chunk.length; idx < length; idx++) {
  19063. if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
  19064. generated.line++;
  19065. generated.column = 0;
  19066. // Mappings end at eol
  19067. if (idx + 1 === length) {
  19068. lastOriginalSource = null;
  19069. sourceMappingActive = false;
  19070. } else if (sourceMappingActive) {
  19071. map.addMapping({
  19072. source: original.source,
  19073. original: {
  19074. line: original.line,
  19075. column: original.column
  19076. },
  19077. generated: {
  19078. line: generated.line,
  19079. column: generated.column
  19080. },
  19081. name: original.name
  19082. });
  19083. }
  19084. } else {
  19085. generated.column++;
  19086. }
  19087. }
  19088. });
  19089. this.walkSourceContents(function (sourceFile, sourceContent) {
  19090. map.setSourceContent(sourceFile, sourceContent);
  19091. });
  19092. return { code: generated.code, map: map };
  19093. };
  19094. exports.SourceNode = SourceNode;
  19095. /***/ }),
  19096. /* 145 */
  19097. /***/ (function(module, exports, __webpack_require__) {
  19098. "use strict";
  19099. exports.__esModule = true;
  19100. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19101. var _flatten = __webpack_require__(33);
  19102. var _flatten2 = _interopRequireDefault(_flatten);
  19103. var _indexesOf = __webpack_require__(34);
  19104. var _indexesOf2 = _interopRequireDefault(_indexesOf);
  19105. var _uniq = __webpack_require__(87);
  19106. var _uniq2 = _interopRequireDefault(_uniq);
  19107. var _root = __webpack_require__(58);
  19108. var _root2 = _interopRequireDefault(_root);
  19109. var _selector = __webpack_require__(59);
  19110. var _selector2 = _interopRequireDefault(_selector);
  19111. var _className = __webpack_require__(52);
  19112. var _className2 = _interopRequireDefault(_className);
  19113. var _comment = __webpack_require__(54);
  19114. var _comment2 = _interopRequireDefault(_comment);
  19115. var _id = __webpack_require__(55);
  19116. var _id2 = _interopRequireDefault(_id);
  19117. var _tag = __webpack_require__(61);
  19118. var _tag2 = _interopRequireDefault(_tag);
  19119. var _string = __webpack_require__(60);
  19120. var _string2 = _interopRequireDefault(_string);
  19121. var _pseudo = __webpack_require__(57);
  19122. var _pseudo2 = _interopRequireDefault(_pseudo);
  19123. var _attribute = __webpack_require__(51);
  19124. var _attribute2 = _interopRequireDefault(_attribute);
  19125. var _universal = __webpack_require__(62);
  19126. var _universal2 = _interopRequireDefault(_universal);
  19127. var _combinator = __webpack_require__(53);
  19128. var _combinator2 = _interopRequireDefault(_combinator);
  19129. var _nesting = __webpack_require__(56);
  19130. var _nesting2 = _interopRequireDefault(_nesting);
  19131. var _sortAscending = __webpack_require__(147);
  19132. var _sortAscending2 = _interopRequireDefault(_sortAscending);
  19133. var _tokenize = __webpack_require__(148);
  19134. var _tokenize2 = _interopRequireDefault(_tokenize);
  19135. var _types = __webpack_require__(0);
  19136. var types = _interopRequireWildcard(_types);
  19137. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  19138. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  19139. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19140. var Parser = function () {
  19141. function Parser(input) {
  19142. _classCallCheck(this, Parser);
  19143. this.input = input;
  19144. this.lossy = input.options.lossless === false;
  19145. this.position = 0;
  19146. this.root = new _root2.default();
  19147. var selectors = new _selector2.default();
  19148. this.root.append(selectors);
  19149. this.current = selectors;
  19150. if (this.lossy) {
  19151. this.tokens = (0, _tokenize2.default)({ safe: input.safe, css: input.css.trim() });
  19152. } else {
  19153. this.tokens = (0, _tokenize2.default)(input);
  19154. }
  19155. return this.loop();
  19156. }
  19157. Parser.prototype.attribute = function attribute() {
  19158. var str = '';
  19159. var attr = void 0;
  19160. var startingToken = this.currToken;
  19161. this.position++;
  19162. while (this.position < this.tokens.length && this.currToken[0] !== ']') {
  19163. str += this.tokens[this.position][1];
  19164. this.position++;
  19165. }
  19166. if (this.position === this.tokens.length && !~str.indexOf(']')) {
  19167. this.error('Expected a closing square bracket.');
  19168. }
  19169. var parts = str.split(/((?:[*~^$|]?=))([^]*)/);
  19170. var namespace = parts[0].split(/(\|)/g);
  19171. var attributeProps = {
  19172. operator: parts[1],
  19173. value: parts[2],
  19174. source: {
  19175. start: {
  19176. line: startingToken[2],
  19177. column: startingToken[3]
  19178. },
  19179. end: {
  19180. line: this.currToken[2],
  19181. column: this.currToken[3]
  19182. }
  19183. },
  19184. sourceIndex: startingToken[4]
  19185. };
  19186. if (namespace.length > 1) {
  19187. if (namespace[0] === '') {
  19188. namespace[0] = true;
  19189. }
  19190. attributeProps.attribute = this.parseValue(namespace[2]);
  19191. attributeProps.namespace = this.parseNamespace(namespace[0]);
  19192. } else {
  19193. attributeProps.attribute = this.parseValue(parts[0]);
  19194. }
  19195. attr = new _attribute2.default(attributeProps);
  19196. if (parts[2]) {
  19197. var insensitive = parts[2].split(/(\s+i\s*?)$/);
  19198. var trimmedValue = insensitive[0].trim();
  19199. attr.value = this.lossy ? trimmedValue : insensitive[0];
  19200. if (insensitive[1]) {
  19201. attr.insensitive = true;
  19202. if (!this.lossy) {
  19203. attr.raws.insensitive = insensitive[1];
  19204. }
  19205. }
  19206. attr.quoted = trimmedValue[0] === '\'' || trimmedValue[0] === '"';
  19207. attr.raws.unquoted = attr.quoted ? trimmedValue.slice(1, -1) : trimmedValue;
  19208. }
  19209. this.newNode(attr);
  19210. this.position++;
  19211. };
  19212. Parser.prototype.combinator = function combinator() {
  19213. if (this.currToken[1] === '|') {
  19214. return this.namespace();
  19215. }
  19216. var node = new _combinator2.default({
  19217. value: '',
  19218. source: {
  19219. start: {
  19220. line: this.currToken[2],
  19221. column: this.currToken[3]
  19222. },
  19223. end: {
  19224. line: this.currToken[2],
  19225. column: this.currToken[3]
  19226. }
  19227. },
  19228. sourceIndex: this.currToken[4]
  19229. });
  19230. while (this.position < this.tokens.length && this.currToken && (this.currToken[0] === 'space' || this.currToken[0] === 'combinator')) {
  19231. if (this.nextToken && this.nextToken[0] === 'combinator') {
  19232. node.spaces.before = this.parseSpace(this.currToken[1]);
  19233. node.source.start.line = this.nextToken[2];
  19234. node.source.start.column = this.nextToken[3];
  19235. node.source.end.column = this.nextToken[3];
  19236. node.source.end.line = this.nextToken[2];
  19237. node.sourceIndex = this.nextToken[4];
  19238. } else if (this.prevToken && this.prevToken[0] === 'combinator') {
  19239. node.spaces.after = this.parseSpace(this.currToken[1]);
  19240. } else if (this.currToken[0] === 'combinator') {
  19241. node.value = this.currToken[1];
  19242. } else if (this.currToken[0] === 'space') {
  19243. node.value = this.parseSpace(this.currToken[1], ' ');
  19244. }
  19245. this.position++;
  19246. }
  19247. return this.newNode(node);
  19248. };
  19249. Parser.prototype.comma = function comma() {
  19250. if (this.position === this.tokens.length - 1) {
  19251. this.root.trailingComma = true;
  19252. this.position++;
  19253. return;
  19254. }
  19255. var selectors = new _selector2.default();
  19256. this.current.parent.append(selectors);
  19257. this.current = selectors;
  19258. this.position++;
  19259. };
  19260. Parser.prototype.comment = function comment() {
  19261. var node = new _comment2.default({
  19262. value: this.currToken[1],
  19263. source: {
  19264. start: {
  19265. line: this.currToken[2],
  19266. column: this.currToken[3]
  19267. },
  19268. end: {
  19269. line: this.currToken[4],
  19270. column: this.currToken[5]
  19271. }
  19272. },
  19273. sourceIndex: this.currToken[6]
  19274. });
  19275. this.newNode(node);
  19276. this.position++;
  19277. };
  19278. Parser.prototype.error = function error(message) {
  19279. throw new this.input.error(message); // eslint-disable-line new-cap
  19280. };
  19281. Parser.prototype.missingBackslash = function missingBackslash() {
  19282. return this.error('Expected a backslash preceding the semicolon.');
  19283. };
  19284. Parser.prototype.missingParenthesis = function missingParenthesis() {
  19285. return this.error('Expected opening parenthesis.');
  19286. };
  19287. Parser.prototype.missingSquareBracket = function missingSquareBracket() {
  19288. return this.error('Expected opening square bracket.');
  19289. };
  19290. Parser.prototype.namespace = function namespace() {
  19291. var before = this.prevToken && this.prevToken[1] || true;
  19292. if (this.nextToken[0] === 'word') {
  19293. this.position++;
  19294. return this.word(before);
  19295. } else if (this.nextToken[0] === '*') {
  19296. this.position++;
  19297. return this.universal(before);
  19298. }
  19299. };
  19300. Parser.prototype.nesting = function nesting() {
  19301. this.newNode(new _nesting2.default({
  19302. value: this.currToken[1],
  19303. source: {
  19304. start: {
  19305. line: this.currToken[2],
  19306. column: this.currToken[3]
  19307. },
  19308. end: {
  19309. line: this.currToken[2],
  19310. column: this.currToken[3]
  19311. }
  19312. },
  19313. sourceIndex: this.currToken[4]
  19314. }));
  19315. this.position++;
  19316. };
  19317. Parser.prototype.parentheses = function parentheses() {
  19318. var last = this.current.last;
  19319. if (last && last.type === types.PSEUDO) {
  19320. var selector = new _selector2.default();
  19321. var cache = this.current;
  19322. last.append(selector);
  19323. this.current = selector;
  19324. var balanced = 1;
  19325. this.position++;
  19326. while (this.position < this.tokens.length && balanced) {
  19327. if (this.currToken[0] === '(') {
  19328. balanced++;
  19329. }
  19330. if (this.currToken[0] === ')') {
  19331. balanced--;
  19332. }
  19333. if (balanced) {
  19334. this.parse();
  19335. } else {
  19336. selector.parent.source.end.line = this.currToken[2];
  19337. selector.parent.source.end.column = this.currToken[3];
  19338. this.position++;
  19339. }
  19340. }
  19341. if (balanced) {
  19342. this.error('Expected closing parenthesis.');
  19343. }
  19344. this.current = cache;
  19345. } else {
  19346. var _balanced = 1;
  19347. this.position++;
  19348. last.value += '(';
  19349. while (this.position < this.tokens.length && _balanced) {
  19350. if (this.currToken[0] === '(') {
  19351. _balanced++;
  19352. }
  19353. if (this.currToken[0] === ')') {
  19354. _balanced--;
  19355. }
  19356. last.value += this.parseParenthesisToken(this.currToken);
  19357. this.position++;
  19358. }
  19359. if (_balanced) {
  19360. this.error('Expected closing parenthesis.');
  19361. }
  19362. }
  19363. };
  19364. Parser.prototype.pseudo = function pseudo() {
  19365. var _this = this;
  19366. var pseudoStr = '';
  19367. var startingToken = this.currToken;
  19368. while (this.currToken && this.currToken[0] === ':') {
  19369. pseudoStr += this.currToken[1];
  19370. this.position++;
  19371. }
  19372. if (!this.currToken) {
  19373. return this.error('Expected pseudo-class or pseudo-element');
  19374. }
  19375. if (this.currToken[0] === 'word') {
  19376. var pseudo = void 0;
  19377. this.splitWord(false, function (first, length) {
  19378. pseudoStr += first;
  19379. pseudo = new _pseudo2.default({
  19380. value: pseudoStr,
  19381. source: {
  19382. start: {
  19383. line: startingToken[2],
  19384. column: startingToken[3]
  19385. },
  19386. end: {
  19387. line: _this.currToken[4],
  19388. column: _this.currToken[5]
  19389. }
  19390. },
  19391. sourceIndex: startingToken[4]
  19392. });
  19393. _this.newNode(pseudo);
  19394. if (length > 1 && _this.nextToken && _this.nextToken[0] === '(') {
  19395. _this.error('Misplaced parenthesis.');
  19396. }
  19397. });
  19398. } else {
  19399. this.error('Unexpected "' + this.currToken[0] + '" found.');
  19400. }
  19401. };
  19402. Parser.prototype.space = function space() {
  19403. var token = this.currToken;
  19404. // Handle space before and after the selector
  19405. if (this.position === 0 || this.prevToken[0] === ',' || this.prevToken[0] === '(') {
  19406. this.spaces = this.parseSpace(token[1]);
  19407. this.position++;
  19408. } else if (this.position === this.tokens.length - 1 || this.nextToken[0] === ',' || this.nextToken[0] === ')') {
  19409. this.current.last.spaces.after = this.parseSpace(token[1]);
  19410. this.position++;
  19411. } else {
  19412. this.combinator();
  19413. }
  19414. };
  19415. Parser.prototype.string = function string() {
  19416. var token = this.currToken;
  19417. this.newNode(new _string2.default({
  19418. value: this.currToken[1],
  19419. source: {
  19420. start: {
  19421. line: token[2],
  19422. column: token[3]
  19423. },
  19424. end: {
  19425. line: token[4],
  19426. column: token[5]
  19427. }
  19428. },
  19429. sourceIndex: token[6]
  19430. }));
  19431. this.position++;
  19432. };
  19433. Parser.prototype.universal = function universal(namespace) {
  19434. var nextToken = this.nextToken;
  19435. if (nextToken && nextToken[1] === '|') {
  19436. this.position++;
  19437. return this.namespace();
  19438. }
  19439. this.newNode(new _universal2.default({
  19440. value: this.currToken[1],
  19441. source: {
  19442. start: {
  19443. line: this.currToken[2],
  19444. column: this.currToken[3]
  19445. },
  19446. end: {
  19447. line: this.currToken[2],
  19448. column: this.currToken[3]
  19449. }
  19450. },
  19451. sourceIndex: this.currToken[4]
  19452. }), namespace);
  19453. this.position++;
  19454. };
  19455. Parser.prototype.splitWord = function splitWord(namespace, firstCallback) {
  19456. var _this2 = this;
  19457. var nextToken = this.nextToken;
  19458. var word = this.currToken[1];
  19459. while (nextToken && nextToken[0] === 'word') {
  19460. this.position++;
  19461. var current = this.currToken[1];
  19462. word += current;
  19463. if (current.lastIndexOf('\\') === current.length - 1) {
  19464. var next = this.nextToken;
  19465. if (next && next[0] === 'space') {
  19466. word += this.parseSpace(next[1], ' ');
  19467. this.position++;
  19468. }
  19469. }
  19470. nextToken = this.nextToken;
  19471. }
  19472. var hasClass = (0, _indexesOf2.default)(word, '.');
  19473. var hasId = (0, _indexesOf2.default)(word, '#');
  19474. // Eliminate Sass interpolations from the list of id indexes
  19475. var interpolations = (0, _indexesOf2.default)(word, '#{');
  19476. if (interpolations.length) {
  19477. hasId = hasId.filter(function (hashIndex) {
  19478. return !~interpolations.indexOf(hashIndex);
  19479. });
  19480. }
  19481. var indices = (0, _sortAscending2.default)((0, _uniq2.default)((0, _flatten2.default)([[0], hasClass, hasId])));
  19482. indices.forEach(function (ind, i) {
  19483. var index = indices[i + 1] || word.length;
  19484. var value = word.slice(ind, index);
  19485. if (i === 0 && firstCallback) {
  19486. return firstCallback.call(_this2, value, indices.length);
  19487. }
  19488. var node = void 0;
  19489. if (~hasClass.indexOf(ind)) {
  19490. node = new _className2.default({
  19491. value: value.slice(1),
  19492. source: {
  19493. start: {
  19494. line: _this2.currToken[2],
  19495. column: _this2.currToken[3] + ind
  19496. },
  19497. end: {
  19498. line: _this2.currToken[4],
  19499. column: _this2.currToken[3] + (index - 1)
  19500. }
  19501. },
  19502. sourceIndex: _this2.currToken[6] + indices[i]
  19503. });
  19504. } else if (~hasId.indexOf(ind)) {
  19505. node = new _id2.default({
  19506. value: value.slice(1),
  19507. source: {
  19508. start: {
  19509. line: _this2.currToken[2],
  19510. column: _this2.currToken[3] + ind
  19511. },
  19512. end: {
  19513. line: _this2.currToken[4],
  19514. column: _this2.currToken[3] + (index - 1)
  19515. }
  19516. },
  19517. sourceIndex: _this2.currToken[6] + indices[i]
  19518. });
  19519. } else {
  19520. node = new _tag2.default({
  19521. value: value,
  19522. source: {
  19523. start: {
  19524. line: _this2.currToken[2],
  19525. column: _this2.currToken[3] + ind
  19526. },
  19527. end: {
  19528. line: _this2.currToken[4],
  19529. column: _this2.currToken[3] + (index - 1)
  19530. }
  19531. },
  19532. sourceIndex: _this2.currToken[6] + indices[i]
  19533. });
  19534. }
  19535. _this2.newNode(node, namespace);
  19536. });
  19537. this.position++;
  19538. };
  19539. Parser.prototype.word = function word(namespace) {
  19540. var nextToken = this.nextToken;
  19541. if (nextToken && nextToken[1] === '|') {
  19542. this.position++;
  19543. return this.namespace();
  19544. }
  19545. return this.splitWord(namespace);
  19546. };
  19547. Parser.prototype.loop = function loop() {
  19548. while (this.position < this.tokens.length) {
  19549. this.parse(true);
  19550. }
  19551. return this.root;
  19552. };
  19553. Parser.prototype.parse = function parse(throwOnParenthesis) {
  19554. switch (this.currToken[0]) {
  19555. case 'space':
  19556. this.space();
  19557. break;
  19558. case 'comment':
  19559. this.comment();
  19560. break;
  19561. case '(':
  19562. this.parentheses();
  19563. break;
  19564. case ')':
  19565. if (throwOnParenthesis) {
  19566. this.missingParenthesis();
  19567. }
  19568. break;
  19569. case '[':
  19570. this.attribute();
  19571. break;
  19572. case ']':
  19573. this.missingSquareBracket();
  19574. break;
  19575. case 'at-word':
  19576. case 'word':
  19577. this.word();
  19578. break;
  19579. case ':':
  19580. this.pseudo();
  19581. break;
  19582. case ';':
  19583. this.missingBackslash();
  19584. break;
  19585. case ',':
  19586. this.comma();
  19587. break;
  19588. case '*':
  19589. this.universal();
  19590. break;
  19591. case '&':
  19592. this.nesting();
  19593. break;
  19594. case 'combinator':
  19595. this.combinator();
  19596. break;
  19597. case 'string':
  19598. this.string();
  19599. break;
  19600. }
  19601. };
  19602. /**
  19603. * Helpers
  19604. */
  19605. Parser.prototype.parseNamespace = function parseNamespace(namespace) {
  19606. if (this.lossy && typeof namespace === 'string') {
  19607. var trimmed = namespace.trim();
  19608. if (!trimmed.length) {
  19609. return true;
  19610. }
  19611. return trimmed;
  19612. }
  19613. return namespace;
  19614. };
  19615. Parser.prototype.parseSpace = function parseSpace(space, replacement) {
  19616. return this.lossy ? replacement || '' : space;
  19617. };
  19618. Parser.prototype.parseValue = function parseValue(value) {
  19619. return this.lossy && value && typeof value === 'string' ? value.trim() : value;
  19620. };
  19621. Parser.prototype.parseParenthesisToken = function parseParenthesisToken(token) {
  19622. if (!this.lossy) {
  19623. return token[1];
  19624. }
  19625. if (token[0] === 'space') {
  19626. return this.parseSpace(token[1], ' ');
  19627. }
  19628. return this.parseValue(token[1]);
  19629. };
  19630. Parser.prototype.newNode = function newNode(node, namespace) {
  19631. if (namespace) {
  19632. node.namespace = this.parseNamespace(namespace);
  19633. }
  19634. if (this.spaces) {
  19635. node.spaces.before = this.spaces;
  19636. this.spaces = '';
  19637. }
  19638. return this.current.append(node);
  19639. };
  19640. _createClass(Parser, [{
  19641. key: 'currToken',
  19642. get: function get() {
  19643. return this.tokens[this.position];
  19644. }
  19645. }, {
  19646. key: 'nextToken',
  19647. get: function get() {
  19648. return this.tokens[this.position + 1];
  19649. }
  19650. }, {
  19651. key: 'prevToken',
  19652. get: function get() {
  19653. return this.tokens[this.position - 1];
  19654. }
  19655. }]);
  19656. return Parser;
  19657. }();
  19658. exports.default = Parser;
  19659. module.exports = exports['default'];
  19660. /***/ }),
  19661. /* 146 */
  19662. /***/ (function(module, exports, __webpack_require__) {
  19663. "use strict";
  19664. exports.__esModule = true;
  19665. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19666. var _parser = __webpack_require__(145);
  19667. var _parser2 = _interopRequireDefault(_parser);
  19668. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  19669. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19670. var Processor = function () {
  19671. function Processor(func) {
  19672. _classCallCheck(this, Processor);
  19673. this.func = func || function noop() {};
  19674. return this;
  19675. }
  19676. Processor.prototype.process = function process(selectors) {
  19677. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  19678. var input = new _parser2.default({
  19679. css: selectors,
  19680. error: function error(e) {
  19681. throw new Error(e);
  19682. },
  19683. options: options
  19684. });
  19685. this.res = input;
  19686. this.func(input);
  19687. return this;
  19688. };
  19689. _createClass(Processor, [{
  19690. key: 'result',
  19691. get: function get() {
  19692. return String(this.res);
  19693. }
  19694. }]);
  19695. return Processor;
  19696. }();
  19697. exports.default = Processor;
  19698. module.exports = exports['default'];
  19699. /***/ }),
  19700. /* 147 */
  19701. /***/ (function(module, exports, __webpack_require__) {
  19702. "use strict";
  19703. exports.__esModule = true;
  19704. exports.default = sortAscending;
  19705. function sortAscending(list) {
  19706. return list.sort(function (a, b) {
  19707. return a - b;
  19708. });
  19709. };
  19710. module.exports = exports["default"];
  19711. /***/ }),
  19712. /* 148 */
  19713. /***/ (function(module, exports, __webpack_require__) {
  19714. "use strict";
  19715. exports.__esModule = true;
  19716. exports.default = tokenize;
  19717. var singleQuote = 39,
  19718. doubleQuote = 34,
  19719. backslash = 92,
  19720. slash = 47,
  19721. newline = 10,
  19722. space = 32,
  19723. feed = 12,
  19724. tab = 9,
  19725. cr = 13,
  19726. plus = 43,
  19727. gt = 62,
  19728. tilde = 126,
  19729. pipe = 124,
  19730. comma = 44,
  19731. openBracket = 40,
  19732. closeBracket = 41,
  19733. openSq = 91,
  19734. closeSq = 93,
  19735. semicolon = 59,
  19736. asterisk = 42,
  19737. colon = 58,
  19738. ampersand = 38,
  19739. at = 64,
  19740. atEnd = /[ \n\t\r\{\(\)'"\\;/]/g,
  19741. wordEnd = /[ \n\t\r\(\)\*:;@!&'"\+\|~>,\[\]\\]|\/(?=\*)/g;
  19742. function tokenize(input) {
  19743. var tokens = [];
  19744. var css = input.css.valueOf();
  19745. var code = void 0,
  19746. next = void 0,
  19747. quote = void 0,
  19748. lines = void 0,
  19749. last = void 0,
  19750. content = void 0,
  19751. escape = void 0,
  19752. nextLine = void 0,
  19753. nextOffset = void 0,
  19754. escaped = void 0,
  19755. escapePos = void 0;
  19756. var length = css.length;
  19757. var offset = -1;
  19758. var line = 1;
  19759. var pos = 0;
  19760. var unclosed = function unclosed(what, end) {
  19761. if (input.safe) {
  19762. css += end;
  19763. next = css.length - 1;
  19764. } else {
  19765. throw input.error('Unclosed ' + what, line, pos - offset, pos);
  19766. }
  19767. };
  19768. while (pos < length) {
  19769. code = css.charCodeAt(pos);
  19770. if (code === newline) {
  19771. offset = pos;
  19772. line += 1;
  19773. }
  19774. switch (code) {
  19775. case newline:
  19776. case space:
  19777. case tab:
  19778. case cr:
  19779. case feed:
  19780. next = pos;
  19781. do {
  19782. next += 1;
  19783. code = css.charCodeAt(next);
  19784. if (code === newline) {
  19785. offset = next;
  19786. line += 1;
  19787. }
  19788. } while (code === space || code === newline || code === tab || code === cr || code === feed);
  19789. tokens.push(['space', css.slice(pos, next), line, pos - offset, pos]);
  19790. pos = next - 1;
  19791. break;
  19792. case plus:
  19793. case gt:
  19794. case tilde:
  19795. case pipe:
  19796. next = pos;
  19797. do {
  19798. next += 1;
  19799. code = css.charCodeAt(next);
  19800. } while (code === plus || code === gt || code === tilde || code === pipe);
  19801. tokens.push(['combinator', css.slice(pos, next), line, pos - offset, pos]);
  19802. pos = next - 1;
  19803. break;
  19804. case asterisk:
  19805. tokens.push(['*', '*', line, pos - offset, pos]);
  19806. break;
  19807. case ampersand:
  19808. tokens.push(['&', '&', line, pos - offset, pos]);
  19809. break;
  19810. case comma:
  19811. tokens.push([',', ',', line, pos - offset, pos]);
  19812. break;
  19813. case openSq:
  19814. tokens.push(['[', '[', line, pos - offset, pos]);
  19815. break;
  19816. case closeSq:
  19817. tokens.push([']', ']', line, pos - offset, pos]);
  19818. break;
  19819. case colon:
  19820. tokens.push([':', ':', line, pos - offset, pos]);
  19821. break;
  19822. case semicolon:
  19823. tokens.push([';', ';', line, pos - offset, pos]);
  19824. break;
  19825. case openBracket:
  19826. tokens.push(['(', '(', line, pos - offset, pos]);
  19827. break;
  19828. case closeBracket:
  19829. tokens.push([')', ')', line, pos - offset, pos]);
  19830. break;
  19831. case singleQuote:
  19832. case doubleQuote:
  19833. quote = code === singleQuote ? "'" : '"';
  19834. next = pos;
  19835. do {
  19836. escaped = false;
  19837. next = css.indexOf(quote, next + 1);
  19838. if (next === -1) {
  19839. unclosed('quote', quote);
  19840. }
  19841. escapePos = next;
  19842. while (css.charCodeAt(escapePos - 1) === backslash) {
  19843. escapePos -= 1;
  19844. escaped = !escaped;
  19845. }
  19846. } while (escaped);
  19847. tokens.push(['string', css.slice(pos, next + 1), line, pos - offset, line, next - offset, pos]);
  19848. pos = next;
  19849. break;
  19850. case at:
  19851. atEnd.lastIndex = pos + 1;
  19852. atEnd.test(css);
  19853. if (atEnd.lastIndex === 0) {
  19854. next = css.length - 1;
  19855. } else {
  19856. next = atEnd.lastIndex - 2;
  19857. }
  19858. tokens.push(['at-word', css.slice(pos, next + 1), line, pos - offset, line, next - offset, pos]);
  19859. pos = next;
  19860. break;
  19861. case backslash:
  19862. next = pos;
  19863. escape = true;
  19864. while (css.charCodeAt(next + 1) === backslash) {
  19865. next += 1;
  19866. escape = !escape;
  19867. }
  19868. code = css.charCodeAt(next + 1);
  19869. if (escape && code !== slash && code !== space && code !== newline && code !== tab && code !== cr && code !== feed) {
  19870. next += 1;
  19871. }
  19872. tokens.push(['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset, pos]);
  19873. pos = next;
  19874. break;
  19875. default:
  19876. if (code === slash && css.charCodeAt(pos + 1) === asterisk) {
  19877. next = css.indexOf('*/', pos + 2) + 1;
  19878. if (next === 0) {
  19879. unclosed('comment', '*/');
  19880. }
  19881. content = css.slice(pos, next + 1);
  19882. lines = content.split('\n');
  19883. last = lines.length - 1;
  19884. if (last > 0) {
  19885. nextLine = line + last;
  19886. nextOffset = next - lines[last].length;
  19887. } else {
  19888. nextLine = line;
  19889. nextOffset = offset;
  19890. }
  19891. tokens.push(['comment', content, line, pos - offset, nextLine, next - nextOffset, pos]);
  19892. offset = nextOffset;
  19893. line = nextLine;
  19894. pos = next;
  19895. } else {
  19896. wordEnd.lastIndex = pos + 1;
  19897. wordEnd.test(css);
  19898. if (wordEnd.lastIndex === 0) {
  19899. next = css.length - 1;
  19900. } else {
  19901. next = wordEnd.lastIndex - 2;
  19902. }
  19903. tokens.push(['word', css.slice(pos, next + 1), line, pos - offset, line, next - offset, pos]);
  19904. pos = next;
  19905. }
  19906. break;
  19907. }
  19908. pos++;
  19909. }
  19910. return tokens;
  19911. }
  19912. module.exports = exports['default'];
  19913. /***/ }),
  19914. /* 149 */
  19915. /***/ (function(module, exports, __webpack_require__) {
  19916. "use strict";
  19917. class ParserError extends Error {
  19918. constructor(message) {
  19919. super(message);
  19920. this.name = this.constructor.name;
  19921. this.message = message || 'An error ocurred while parsing.';
  19922. if (typeof Error.captureStackTrace === 'function') {
  19923. Error.captureStackTrace(this, this.constructor);
  19924. }
  19925. else {
  19926. this.stack = (new Error(message)).stack;
  19927. }
  19928. }
  19929. }
  19930. module.exports = ParserError;
  19931. /***/ }),
  19932. /* 150 */
  19933. /***/ (function(module, exports, __webpack_require__) {
  19934. "use strict";
  19935. class TokenizeError extends Error {
  19936. constructor(message) {
  19937. super(message);
  19938. this.name = this.constructor.name;
  19939. this.message = message || 'An error ocurred while tokzenizing.';
  19940. if (typeof Error.captureStackTrace === 'function') {
  19941. Error.captureStackTrace(this, this.constructor);
  19942. }
  19943. else {
  19944. this.stack = (new Error(message)).stack;
  19945. }
  19946. }
  19947. }
  19948. module.exports = TokenizeError;
  19949. /***/ }),
  19950. /* 151 */
  19951. /***/ (function(module, exports, __webpack_require__) {
  19952. "use strict";
  19953. const Root = __webpack_require__(152);
  19954. const Value = __webpack_require__(73);
  19955. const AtWord = __webpack_require__(63);
  19956. const Colon = __webpack_require__(64);
  19957. const Comma = __webpack_require__(65);
  19958. const Comment = __webpack_require__(66);
  19959. const Func = __webpack_require__(67);
  19960. const Numbr = __webpack_require__(68);
  19961. const Operator = __webpack_require__(69);
  19962. const Paren = __webpack_require__(70);
  19963. const Str = __webpack_require__(71);
  19964. const Word = __webpack_require__(74);
  19965. const UnicodeRange = __webpack_require__(72);
  19966. const tokenize = __webpack_require__(153);
  19967. const flatten = __webpack_require__(33);
  19968. const indexesOf = __webpack_require__(34);
  19969. const uniq = __webpack_require__(87);
  19970. const ParserError = __webpack_require__(149);
  19971. function sortAscending (list) {
  19972. return list.sort((a, b) => a - b);
  19973. }
  19974. module.exports = class Parser {
  19975. constructor (input, options) {
  19976. const defaults = { loose: false };
  19977. // cache needs to be an array for values with more than 1 level of function nesting
  19978. this.cache = [];
  19979. this.input = input;
  19980. this.options = Object.assign({}, defaults, options);
  19981. this.position = 0;
  19982. // we'll use this to keep track of the paren balance
  19983. this.unbalanced = 0;
  19984. this.root = new Root();
  19985. let value = new Value();
  19986. this.root.append(value);
  19987. this.current = value;
  19988. this.tokens = tokenize(input, this.options);
  19989. }
  19990. parse () {
  19991. return this.loop();
  19992. }
  19993. colon () {
  19994. let token = this.currToken;
  19995. this.newNode(new Colon({
  19996. value: token[1],
  19997. source: {
  19998. start: {
  19999. line: token[2],
  20000. column: token[3]
  20001. },
  20002. end: {
  20003. line: token[4],
  20004. column: token[5]
  20005. }
  20006. },
  20007. sourceIndex: token[6]
  20008. }));
  20009. this.position ++;
  20010. }
  20011. comma () {
  20012. let token = this.currToken;
  20013. this.newNode(new Comma({
  20014. value: token[1],
  20015. source: {
  20016. start: {
  20017. line: token[2],
  20018. column: token[3]
  20019. },
  20020. end: {
  20021. line: token[4],
  20022. column: token[5]
  20023. }
  20024. },
  20025. sourceIndex: token[6]
  20026. }));
  20027. this.position ++;
  20028. }
  20029. comment () {
  20030. let inline = false,
  20031. value = this.currToken[1].replace(/\/\*|\*\//g, ''),
  20032. node;
  20033. if (this.options.loose && value.startsWith("//")) {
  20034. value = value.substring(2);
  20035. inline = true;
  20036. }
  20037. node = new Comment({
  20038. value: value,
  20039. inline: inline,
  20040. source: {
  20041. start: {
  20042. line: this.currToken[2],
  20043. column: this.currToken[3]
  20044. },
  20045. end: {
  20046. line: this.currToken[4],
  20047. column: this.currToken[5]
  20048. }
  20049. },
  20050. sourceIndex: this.currToken[6]
  20051. });
  20052. this.newNode(node);
  20053. this.position++;
  20054. }
  20055. error (message, token) {
  20056. throw new ParserError(message + ` at line: ${token[2]}, column ${token[3]}`);
  20057. }
  20058. loop () {
  20059. while (this.position < this.tokens.length) {
  20060. this.parseTokens();
  20061. }
  20062. if (!this.current.last && this.spaces) {
  20063. this.current.raws.before += this.spaces;
  20064. }
  20065. else if (this.spaces) {
  20066. this.current.last.raws.after += this.spaces;
  20067. }
  20068. this.spaces = '';
  20069. return this.root;
  20070. }
  20071. operator () {
  20072. // if a +|- operator is followed by a non-word character (. is allowed) and
  20073. // is preceded by a non-word character. (5+5)
  20074. let char = this.currToken[1],
  20075. node;
  20076. if (char === '+' || char === '-') {
  20077. // only inspect if the operator is not the first token, and we're only
  20078. // within a calc() function: the only spec-valid place for math expressions
  20079. if (!this.options.loose) {
  20080. if (this.position > 0) {
  20081. if (this.current.type === 'func' && this.current.value === 'calc') {
  20082. // allow operators to be proceeded by spaces and opening parens
  20083. if (this.prevToken[0] !== 'space' && this.prevToken[0] !== '(') {
  20084. this.error('Syntax Error', this.currToken);
  20085. }
  20086. // valid: calc(1 - +2)
  20087. // invalid: calc(1 -+2)
  20088. else if (this.nextToken[0] !== 'space' && this.nextToken[0] !== 'word') {
  20089. this.error('Syntax Error', this.currToken);
  20090. }
  20091. // valid: calc(1 - +2)
  20092. // valid: calc(-0.5 + 2)
  20093. // invalid: calc(1 -2)
  20094. else if (this.nextToken[0] === 'word' && this.current.last.type !== 'operator' &&
  20095. this.current.last.value !== '(') {
  20096. this.error('Syntax Error', this.currToken);
  20097. }
  20098. }
  20099. // if we're not in a function and someone has doubled up on operators,
  20100. // or they're trying to perform a calc outside of a calc
  20101. // eg. +-4px or 5+ 5, throw an error
  20102. else if (this.nextToken[0] === 'space'
  20103. || this.nextToken[0] === 'operator'
  20104. || this.prevToken[0] === 'operator') {
  20105. this.error('Syntax Error', this.currToken);
  20106. }
  20107. }
  20108. }
  20109. if (!this.options.loose) {
  20110. if (this.nextToken[0] === 'word') {
  20111. return this.word();
  20112. }
  20113. }
  20114. else {
  20115. if ((!this.current.nodes.length || (this.current.last && this.current.last.type === 'operator')) && this.nextToken[0] === 'word') {
  20116. return this.word();
  20117. }
  20118. }
  20119. }
  20120. node = new Operator({
  20121. value: this.currToken[1],
  20122. source: {
  20123. start: {
  20124. line: this.currToken[2],
  20125. column: this.currToken[3]
  20126. },
  20127. end: {
  20128. line: this.currToken[2],
  20129. column: this.currToken[3]
  20130. }
  20131. },
  20132. sourceIndex: this.currToken[4]
  20133. });
  20134. this.position ++;
  20135. return this.newNode(node);
  20136. }
  20137. parseTokens () {
  20138. switch (this.currToken[0]) {
  20139. case 'space':
  20140. this.space();
  20141. break;
  20142. case 'colon':
  20143. this.colon();
  20144. break;
  20145. case 'comma':
  20146. this.comma();
  20147. break;
  20148. case 'comment':
  20149. this.comment();
  20150. break;
  20151. case '(':
  20152. this.parenOpen();
  20153. break;
  20154. case ')':
  20155. this.parenClose();
  20156. break;
  20157. case 'atword':
  20158. case 'word':
  20159. this.word();
  20160. break;
  20161. case 'operator':
  20162. this.operator();
  20163. break;
  20164. case 'string':
  20165. this.string();
  20166. break;
  20167. case 'unicoderange':
  20168. this.unicodeRange();
  20169. break;
  20170. default:
  20171. this.word();
  20172. break;
  20173. }
  20174. }
  20175. parenOpen () {
  20176. let unbalanced = 1,
  20177. pos = this.position + 1,
  20178. token = this.currToken,
  20179. last;
  20180. // check for balanced parens
  20181. while (pos < this.tokens.length && unbalanced) {
  20182. let tkn = this.tokens[pos];
  20183. if (tkn[0] === '(') {
  20184. unbalanced++;
  20185. }
  20186. if (tkn[0] === ')') {
  20187. unbalanced--;
  20188. }
  20189. pos ++;
  20190. }
  20191. if (unbalanced) {
  20192. this.error('Expected closing parenthesis', token);
  20193. }
  20194. // ok, all parens are balanced. continue on
  20195. last = this.current.last;
  20196. if (last && last.type === 'func' && last.unbalanced < 0) {
  20197. last.unbalanced = 0; // ok we're ready to add parens now
  20198. this.current = last;
  20199. }
  20200. this.current.unbalanced ++;
  20201. this.newNode(new Paren({
  20202. value: token[1],
  20203. source: {
  20204. start: {
  20205. line: token[2],
  20206. column: token[3]
  20207. },
  20208. end: {
  20209. line: token[4],
  20210. column: token[5]
  20211. }
  20212. },
  20213. sourceIndex: token[6]
  20214. }));
  20215. this.position ++;
  20216. // url functions get special treatment, and anything between the function
  20217. // parens get treated as one word, if the contents aren't not a string.
  20218. if (this.current.type === 'func' && this.current.unbalanced &&
  20219. this.current.value === 'url' && this.currToken[0] !== 'string' &&
  20220. this.currToken[0] !== ')' && !this.options.loose) {
  20221. let nextToken = this.nextToken,
  20222. value = this.currToken[1],
  20223. start = {
  20224. line: this.currToken[2],
  20225. column: this.currToken[3]
  20226. };
  20227. while (nextToken && nextToken[0] !== ')' && this.current.unbalanced) {
  20228. this.position ++;
  20229. value += this.currToken[1];
  20230. nextToken = this.nextToken;
  20231. }
  20232. if (this.position !== this.tokens.length - 1) {
  20233. // skip the following word definition, or it'll be a duplicate
  20234. this.position ++;
  20235. this.newNode(new Word({
  20236. value,
  20237. source: {
  20238. start,
  20239. end: {
  20240. line: this.currToken[4],
  20241. column: this.currToken[5]
  20242. }
  20243. },
  20244. sourceIndex: this.currToken[6]
  20245. }));
  20246. }
  20247. }
  20248. }
  20249. parenClose () {
  20250. let token = this.currToken;
  20251. this.newNode(new Paren({
  20252. value: token[1],
  20253. source: {
  20254. start: {
  20255. line: token[2],
  20256. column: token[3]
  20257. },
  20258. end: {
  20259. line: token[4],
  20260. column: token[5]
  20261. }
  20262. },
  20263. sourceIndex: token[6]
  20264. }));
  20265. this.position ++;
  20266. if (this.position >= this.tokens.length - 1 && !this.current.unbalanced) {
  20267. return;
  20268. }
  20269. this.current.unbalanced --;
  20270. if (this.current.unbalanced < 0) {
  20271. this.error('Expected opening parenthesis', token);
  20272. }
  20273. if (!this.current.unbalanced && this.cache.length) {
  20274. this.current = this.cache.pop();
  20275. }
  20276. }
  20277. space () {
  20278. let token = this.currToken;
  20279. // Handle space before and after the selector
  20280. if (this.position === (this.tokens.length - 1) || this.nextToken[0] === ',' || this.nextToken[0] === ')') {
  20281. this.current.last.raws.after += token[1];
  20282. this.position ++;
  20283. }
  20284. else {
  20285. this.spaces = token[1];
  20286. this.position ++;
  20287. }
  20288. }
  20289. unicodeRange () {
  20290. let token = this.currToken;
  20291. this.newNode(new UnicodeRange({
  20292. value: token[1],
  20293. source: {
  20294. start: {
  20295. line: token[2],
  20296. column: token[3]
  20297. },
  20298. end: {
  20299. line: token[4],
  20300. column: token[5]
  20301. }
  20302. },
  20303. sourceIndex: token[6]
  20304. }));
  20305. this.position ++;
  20306. }
  20307. splitWord () {
  20308. let nextToken = this.nextToken,
  20309. word = this.currToken[1],
  20310. rNumber = /^[\+\-]?((\d+(\.\d*)?)|(\.\d+))([eE][\+\-]?\d+)?/,
  20311. // treat css-like groupings differently so they can be inspected,
  20312. // but don't address them as anything but a word, but allow hex values
  20313. // to pass through.
  20314. rNoFollow = /^(?!\#([a-z0-9]+))[\#\{\}]/gi,
  20315. hasAt, indices;
  20316. if (!rNoFollow.test(word)) {
  20317. while (nextToken && nextToken[0] === 'word') {
  20318. this.position ++;
  20319. let current = this.currToken[1];
  20320. word += current;
  20321. nextToken = this.nextToken;
  20322. }
  20323. }
  20324. hasAt = indexesOf(word, '@');
  20325. indices = sortAscending(uniq(flatten([[0], hasAt])));
  20326. indices.forEach((ind, i) => {
  20327. let index = indices[i + 1] || word.length,
  20328. value = word.slice(ind, index),
  20329. node;
  20330. if (~hasAt.indexOf(ind)) {
  20331. node = new AtWord({
  20332. value: value.slice(1),
  20333. source: {
  20334. start: {
  20335. line: this.currToken[2],
  20336. column: this.currToken[3] + ind
  20337. },
  20338. end: {
  20339. line: this.currToken[4],
  20340. column: this.currToken[3] + (index - 1)
  20341. }
  20342. },
  20343. sourceIndex: this.currToken[6] + indices[i]
  20344. });
  20345. }
  20346. else if (rNumber.test(this.currToken[1])) {
  20347. let unit = value.replace(rNumber, '');
  20348. node = new Numbr({
  20349. value: value.replace(unit, ''),
  20350. source: {
  20351. start: {
  20352. line: this.currToken[2],
  20353. column: this.currToken[3] + ind
  20354. },
  20355. end: {
  20356. line: this.currToken[4],
  20357. column: this.currToken[3] + (index - 1)
  20358. }
  20359. },
  20360. sourceIndex: this.currToken[6] + indices[i],
  20361. unit
  20362. });
  20363. }
  20364. else {
  20365. node = new (nextToken && nextToken[0] === '(' ? Func : Word)({
  20366. value,
  20367. source: {
  20368. start: {
  20369. line: this.currToken[2],
  20370. column: this.currToken[3] + ind
  20371. },
  20372. end: {
  20373. line: this.currToken[4],
  20374. column: this.currToken[3] + (index - 1)
  20375. }
  20376. },
  20377. sourceIndex: this.currToken[6] + indices[i]
  20378. });
  20379. if (node.constructor.name === 'Word') {
  20380. node.isHex = /^#(.+)/.test(value);
  20381. node.isColor = /^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(value);
  20382. }
  20383. else {
  20384. this.cache.push(this.current);
  20385. }
  20386. }
  20387. this.newNode(node);
  20388. });
  20389. this.position ++;
  20390. }
  20391. string () {
  20392. let token = this.currToken,
  20393. value = this.currToken[1],
  20394. rQuote = /^(\"|\')/,
  20395. quoted = rQuote.test(value),
  20396. quote = '',
  20397. node;
  20398. if (quoted) {
  20399. quote = value.match(rQuote)[0];
  20400. // set value to the string within the quotes
  20401. // quotes are stored in raws
  20402. value = value.slice(1, value.length - 1);
  20403. }
  20404. node = new Str({
  20405. value,
  20406. source: {
  20407. start: {
  20408. line: token[2],
  20409. column: token[3]
  20410. },
  20411. end: {
  20412. line: token[4],
  20413. column: token[5]
  20414. }
  20415. },
  20416. sourceIndex: token[6],
  20417. quoted
  20418. });
  20419. node.raws.quote = quote;
  20420. this.newNode(node);
  20421. this.position++;
  20422. }
  20423. word () {
  20424. return this.splitWord();
  20425. }
  20426. newNode (node) {
  20427. if (this.spaces) {
  20428. node.raws.before += this.spaces;
  20429. this.spaces = '';
  20430. }
  20431. return this.current.append(node);
  20432. }
  20433. get currToken () {
  20434. return this.tokens[this.position];
  20435. }
  20436. get nextToken () {
  20437. return this.tokens[this.position + 1];
  20438. }
  20439. get prevToken () {
  20440. return this.tokens[this.position - 1];
  20441. }
  20442. };
  20443. /***/ }),
  20444. /* 152 */
  20445. /***/ (function(module, exports, __webpack_require__) {
  20446. "use strict";
  20447. const Container = __webpack_require__(1);
  20448. module.exports = class Root extends Container {
  20449. constructor (opts) {
  20450. super(opts);
  20451. this.type = 'root';
  20452. }
  20453. };
  20454. /***/ }),
  20455. /* 153 */
  20456. /***/ (function(module, exports, __webpack_require__) {
  20457. "use strict";
  20458. const openBracket = '{'.charCodeAt(0);
  20459. const closeBracket = '}'.charCodeAt(0);
  20460. const openParen = '('.charCodeAt(0);
  20461. const closeParen = ')'.charCodeAt(0);
  20462. const singleQuote = '\''.charCodeAt(0);
  20463. const doubleQuote = '"'.charCodeAt(0);
  20464. const backslash = '\\'.charCodeAt(0);
  20465. const slash = '/'.charCodeAt(0);
  20466. const period = '.'.charCodeAt(0);
  20467. const comma = ','.charCodeAt(0);
  20468. const colon = ':'.charCodeAt(0);
  20469. const asterisk = '*'.charCodeAt(0);
  20470. const minus = '-'.charCodeAt(0);
  20471. const plus = '+'.charCodeAt(0);
  20472. const pound = '#'.charCodeAt(0);
  20473. const newline = '\n'.charCodeAt(0);
  20474. const space = ' '.charCodeAt(0);
  20475. const feed = '\f'.charCodeAt(0);
  20476. const tab = '\t'.charCodeAt(0);
  20477. const cr = '\r'.charCodeAt(0);
  20478. const at = '@'.charCodeAt(0);
  20479. const lowerE = 'e'.charCodeAt(0);
  20480. const upperE = 'E'.charCodeAt(0);
  20481. const digit0 = '0'.charCodeAt(0);
  20482. const digit9 = '9'.charCodeAt(0);
  20483. const lowerU = 'u'.charCodeAt(0);
  20484. const upperU = 'U'.charCodeAt(0);
  20485. const atEnd = /[ \n\t\r\{\(\)'"\\;,/]/g;
  20486. const wordEnd = /[ \n\t\r\(\)\{\}\*:;@!&'"\+\|~>,\[\]\\]|\/(?=\*)/g;
  20487. const wordEndNum = /[ \n\t\r\(\)\{\}\*:;@!&'"\-\+\|~>,\[\]\\]|\//g;
  20488. const alphaNum = /^[a-z0-9]/i;
  20489. const unicodeRange = /^[a-f0-9?\-]/i;
  20490. const util = __webpack_require__(173);
  20491. const TokenizeError = __webpack_require__(150);
  20492. module.exports = function tokenize (input, options) {
  20493. options = options || {};
  20494. let tokens = [],
  20495. css = input.valueOf(),
  20496. length = css.length,
  20497. offset = -1,
  20498. line = 1,
  20499. pos = 0,
  20500. parentCount = 0,
  20501. isURLArg = null,
  20502. code, next, quote, lines, last, content, escape, nextLine, nextOffset,
  20503. escaped, escapePos, nextChar;
  20504. function unclosed (what) {
  20505. let message = util.format('Unclosed %s at line: %d, column: %d, token: %d', what, line, pos - offset, pos);
  20506. throw new TokenizeError(message);
  20507. }
  20508. function tokenizeError () {
  20509. let message = util.format('Syntax error at line: %d, column: %d, token: %d', line, pos - offset, pos);
  20510. throw new TokenizeError(message);
  20511. }
  20512. while (pos < length) {
  20513. code = css.charCodeAt(pos);
  20514. if (code === newline) {
  20515. offset = pos;
  20516. line += 1;
  20517. }
  20518. switch (code) {
  20519. case newline:
  20520. case space:
  20521. case tab:
  20522. case cr:
  20523. case feed:
  20524. next = pos;
  20525. do {
  20526. next += 1;
  20527. code = css.charCodeAt(next);
  20528. if (code === newline) {
  20529. offset = next;
  20530. line += 1;
  20531. }
  20532. } while (code === space ||
  20533. code === newline ||
  20534. code === tab ||
  20535. code === cr ||
  20536. code === feed);
  20537. tokens.push(['space', css.slice(pos, next),
  20538. line, pos - offset,
  20539. line, next - offset,
  20540. pos
  20541. ]);
  20542. pos = next - 1;
  20543. break;
  20544. case colon:
  20545. next = pos + 1;
  20546. tokens.push(['colon', css.slice(pos, next),
  20547. line, pos - offset,
  20548. line, next - offset,
  20549. pos
  20550. ]);
  20551. pos = next - 1;
  20552. break;
  20553. case comma:
  20554. next = pos + 1;
  20555. tokens.push(['comma', css.slice(pos, next),
  20556. line, pos - offset,
  20557. line, next - offset,
  20558. pos
  20559. ]);
  20560. pos = next - 1;
  20561. break;
  20562. case openBracket:
  20563. tokens.push(['{', '{',
  20564. line, pos - offset,
  20565. line, next - offset,
  20566. pos
  20567. ]);
  20568. break;
  20569. case closeBracket:
  20570. tokens.push(['}', '}',
  20571. line, pos - offset,
  20572. line, next - offset,
  20573. pos
  20574. ]);
  20575. break;
  20576. case openParen:
  20577. parentCount++;
  20578. isURLArg = !isURLArg && parentCount === 1 &&
  20579. tokens.length > 0 &&
  20580. tokens[tokens.length - 1][0] === "word" &&
  20581. tokens[tokens.length - 1][1] === "url";
  20582. tokens.push(['(', '(',
  20583. line, pos - offset,
  20584. line, next - offset,
  20585. pos
  20586. ]);
  20587. break;
  20588. case closeParen:
  20589. parentCount--;
  20590. isURLArg = !isURLArg && parentCount === 1;
  20591. tokens.push([')', ')',
  20592. line, pos - offset,
  20593. line, next - offset,
  20594. pos
  20595. ]);
  20596. break;
  20597. case singleQuote:
  20598. case doubleQuote:
  20599. quote = code === singleQuote ? '\'' : '"';
  20600. next = pos;
  20601. do {
  20602. escaped = false;
  20603. next = css.indexOf(quote, next + 1);
  20604. if (next === -1) {
  20605. unclosed('quote', quote);
  20606. }
  20607. escapePos = next;
  20608. while (css.charCodeAt(escapePos - 1) === backslash) {
  20609. escapePos -= 1;
  20610. escaped = !escaped;
  20611. }
  20612. } while (escaped);
  20613. tokens.push(['string', css.slice(pos, next + 1),
  20614. line, pos - offset,
  20615. line, next - offset,
  20616. pos
  20617. ]);
  20618. pos = next;
  20619. break;
  20620. case at:
  20621. atEnd.lastIndex = pos + 1;
  20622. atEnd.test(css);
  20623. if (atEnd.lastIndex === 0) {
  20624. next = css.length - 1;
  20625. }
  20626. else {
  20627. next = atEnd.lastIndex - 2;
  20628. }
  20629. tokens.push(['atword', css.slice(pos, next + 1),
  20630. line, pos - offset,
  20631. line, next - offset,
  20632. pos
  20633. ]);
  20634. pos = next;
  20635. break;
  20636. case backslash:
  20637. next = pos;
  20638. code = css.charCodeAt(next + 1);
  20639. if (escape && (code !== slash && code !== space &&
  20640. code !== newline && code !== tab &&
  20641. code !== cr && code !== feed)) {
  20642. next += 1;
  20643. }
  20644. tokens.push(['word', css.slice(pos, next + 1),
  20645. line, pos - offset,
  20646. line, next - offset,
  20647. pos
  20648. ]);
  20649. pos = next;
  20650. break;
  20651. case plus:
  20652. case minus:
  20653. case asterisk:
  20654. next = pos + 1;
  20655. nextChar = css.slice(pos + 1, next + 1);
  20656. let prevChar = css.slice(pos - 1, pos);
  20657. // if the operator is immediately followed by a word character, then we
  20658. // have a prefix of some kind, and should fall-through. eg. -webkit
  20659. // look for --* for custom variables
  20660. if (code === minus && nextChar.charCodeAt(0) === minus) {
  20661. next++;
  20662. tokens.push(['word', css.slice(pos, next),
  20663. line, pos - offset,
  20664. line, next - offset,
  20665. pos
  20666. ]);
  20667. pos = next - 1;
  20668. break;
  20669. }
  20670. tokens.push(['operator', css.slice(pos, next),
  20671. line, pos - offset,
  20672. line, next - offset,
  20673. pos
  20674. ]);
  20675. pos = next - 1;
  20676. break;
  20677. default:
  20678. if (code === slash && (css.charCodeAt(pos + 1) === asterisk || (options.loose && !isURLArg && css.charCodeAt(pos + 1) === slash))) {
  20679. const isStandardComment = css.charCodeAt(pos + 1) === asterisk;
  20680. if (isStandardComment) {
  20681. next = css.indexOf('*/', pos + 2) + 1;
  20682. if (next === 0) {
  20683. unclosed('comment', '*/');
  20684. }
  20685. }
  20686. else {
  20687. const newlinePos = css.indexOf('\n', pos + 2);
  20688. next = newlinePos !== -1 ? newlinePos - 1 : length;
  20689. }
  20690. content = css.slice(pos, next + 1);
  20691. lines = content.split('\n');
  20692. last = lines.length - 1;
  20693. if (last > 0) {
  20694. nextLine = line + last;
  20695. nextOffset = next - lines[last].length;
  20696. }
  20697. else {
  20698. nextLine = line;
  20699. nextOffset = offset;
  20700. }
  20701. tokens.push(['comment', content,
  20702. line, pos - offset,
  20703. nextLine, next - nextOffset,
  20704. pos
  20705. ]);
  20706. offset = nextOffset;
  20707. line = nextLine;
  20708. pos = next;
  20709. }
  20710. else if (code === pound && !alphaNum.test(css.slice(pos + 1, pos + 2))) {
  20711. next = pos + 1;
  20712. tokens.push(['#', css.slice(pos, next),
  20713. line, pos - offset,
  20714. line, next - offset,
  20715. pos
  20716. ]);
  20717. pos = next - 1;
  20718. }
  20719. else if ((code === lowerU || code === upperU) && css.charCodeAt(pos + 1) === plus) {
  20720. next = pos + 2;
  20721. do {
  20722. next += 1;
  20723. code = css.charCodeAt(next);
  20724. } while (next < length && unicodeRange.test(css.slice(next, next + 1)));
  20725. tokens.push(['unicoderange', css.slice(pos, next),
  20726. line, pos - offset,
  20727. line, next - offset,
  20728. pos
  20729. ]);
  20730. pos = next - 1;
  20731. }
  20732. // catch a regular slash, that isn't a comment
  20733. else if (code === slash) {
  20734. next = pos + 1;
  20735. tokens.push(['operator', css.slice(pos, next),
  20736. line, pos - offset,
  20737. line, next - offset,
  20738. pos
  20739. ]);
  20740. pos = next - 1;
  20741. }
  20742. else {
  20743. let regex = wordEnd;
  20744. // we're dealing with a word that starts with a number
  20745. // those get treated differently
  20746. if (code >= digit0 && code <= digit9) {
  20747. regex = wordEndNum;
  20748. }
  20749. regex.lastIndex = pos + 1;
  20750. regex.test(css);
  20751. if (regex.lastIndex === 0) {
  20752. next = css.length - 1;
  20753. }
  20754. else {
  20755. next = regex.lastIndex - 2;
  20756. }
  20757. // Exponential number notation with minus or plus: 1e-10, 1e+10
  20758. if (regex === wordEndNum || code === period) {
  20759. let ncode = css.charCodeAt(next),
  20760. ncode1 = css.charCodeAt(next + 1),
  20761. ncode2 = css.charCodeAt(next + 2);
  20762. if (
  20763. (ncode === lowerE || ncode === upperE) &&
  20764. (ncode1 === minus || ncode1 === plus) &&
  20765. (ncode2 >= digit0 && ncode2 <= digit9)
  20766. ) {
  20767. wordEndNum.lastIndex = next + 2;
  20768. wordEndNum.test(css);
  20769. if (wordEndNum.lastIndex === 0) {
  20770. next = css.length - 1;
  20771. }
  20772. else {
  20773. next = wordEndNum.lastIndex - 2;
  20774. }
  20775. }
  20776. }
  20777. tokens.push(['word', css.slice(pos, next + 1),
  20778. line, pos - offset,
  20779. line, next - offset,
  20780. pos
  20781. ]);
  20782. pos = next;
  20783. }
  20784. break;
  20785. }
  20786. pos ++;
  20787. }
  20788. return tokens;
  20789. };
  20790. /***/ }),
  20791. /* 154 */
  20792. /***/ (function(module, exports, __webpack_require__) {
  20793. "use strict";
  20794. exports.__esModule = true;
  20795. /**
  20796. * Contains helpers for safely splitting lists of CSS values,
  20797. * preserving parentheses and quotes.
  20798. *
  20799. * @example
  20800. * const list = postcss.list;
  20801. *
  20802. * @namespace list
  20803. */
  20804. var list = {
  20805. split: function split(string, separators, last) {
  20806. var array = [];
  20807. var current = '';
  20808. var split = false;
  20809. var func = 0;
  20810. var quote = false;
  20811. var escape = false;
  20812. for (var i = 0; i < string.length; i++) {
  20813. var letter = string[i];
  20814. if (quote) {
  20815. if (escape) {
  20816. escape = false;
  20817. } else if (letter === '\\') {
  20818. escape = true;
  20819. } else if (letter === quote) {
  20820. quote = false;
  20821. }
  20822. } else if (letter === '"' || letter === '\'') {
  20823. quote = letter;
  20824. } else if (letter === '(') {
  20825. func += 1;
  20826. } else if (letter === ')') {
  20827. if (func > 0) func -= 1;
  20828. } else if (func === 0) {
  20829. if (separators.indexOf(letter) !== -1) split = true;
  20830. }
  20831. if (split) {
  20832. if (current !== '') array.push(current.trim());
  20833. current = '';
  20834. split = false;
  20835. } else {
  20836. current += letter;
  20837. }
  20838. }
  20839. if (last || current !== '') array.push(current.trim());
  20840. return array;
  20841. },
  20842. /**
  20843. * Safely splits space-separated values (such as those for `background`,
  20844. * `border-radius`, and other shorthand properties).
  20845. *
  20846. * @param {string} string - space-separated values
  20847. *
  20848. * @return {string[]} split values
  20849. *
  20850. * @example
  20851. * postcss.list.space('1px calc(10% + 1px)') //=> ['1px', 'calc(10% + 1px)']
  20852. */
  20853. space: function space(string) {
  20854. var spaces = [' ', '\n', '\t'];
  20855. return list.split(string, spaces);
  20856. },
  20857. /**
  20858. * Safely splits comma-separated values (such as those for `transition-*`
  20859. * and `background` properties).
  20860. *
  20861. * @param {string} string - comma-separated values
  20862. *
  20863. * @return {string[]} split values
  20864. *
  20865. * @example
  20866. * postcss.list.comma('black, linear-gradient(white, black)')
  20867. * //=> ['black', 'linear-gradient(white, black)']
  20868. */
  20869. comma: function comma(string) {
  20870. var comma = ',';
  20871. return list.split(string, [comma], true);
  20872. }
  20873. };
  20874. exports.default = list;
  20875. module.exports = exports['default'];
  20876. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpc3QuZXM2Il0sIm5hbWVzIjpbImxpc3QiLCJzcGxpdCIsInN0cmluZyIsInNlcGFyYXRvcnMiLCJsYXN0IiwiYXJyYXkiLCJjdXJyZW50IiwiZnVuYyIsInF1b3RlIiwiZXNjYXBlIiwiaSIsImxlbmd0aCIsImxldHRlciIsImluZGV4T2YiLCJwdXNoIiwidHJpbSIsInNwYWNlIiwic3BhY2VzIiwiY29tbWEiXSwibWFwcGluZ3MiOiI7OztBQUFBOzs7Ozs7Ozs7QUFTQSxJQUFJQSxPQUFPO0FBRVBDLFNBRk8saUJBRURDLE1BRkMsRUFFT0MsVUFGUCxFQUVtQkMsSUFGbkIsRUFFeUI7QUFDNUIsWUFBSUMsUUFBVSxFQUFkO0FBQ0EsWUFBSUMsVUFBVSxFQUFkO0FBQ0EsWUFBSUwsUUFBVSxLQUFkOztBQUVBLFlBQUlNLE9BQVUsQ0FBZDtBQUNBLFlBQUlDLFFBQVUsS0FBZDtBQUNBLF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ICAgICAgIGxldCBmdW5jICAgID0gMDtcbiAgICAgICAgbGV0IHF1b3RlICAgPSBmYWxzZTtcbiAgICAgICAgbGV0IGVzY2FwZSAgPSBmYWxzZTtcblxuICAgICAgICBmb3IgKCBsZXQgaSA9IDA7IGkgPCBzdHJpbmcubGVuZ3RoOyBpKysgKSB7XG4gICAgICAgICAgICBsZXQgbGV0dGVyID0gc3RyaW5nW2ldO1xuXG4gICAgICAgICAgICBpZiAoIHF1b3RlICkge1xuICAgICAgICAgICAgICAgIGlmICggZXNjYXBlICkge1xuICAgICAgICAgICAgICAgICAgICBlc2NhcGUgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCBsZXR0ZXIgPT09ICdcXFxcJyApIHtcbiAgICAgICAgICAgICAgICAgICAgZXNjYXBlID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCBsZXR0ZXIgPT09IHF1b3RlICkge1xuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIGxldHRlciA9PT0gJ1wiJyB8fCBsZXR0ZXIgPT09ICdcXCcnICkge1xuICAgICAgICAgICAgICAgIHF1b3RlID0gbGV0dGVyO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggbGV0dGVyID09PSAnKCcgKSB7XG4gICAgICAgICAgICAgICAgZnVuYyArPSAxO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggbGV0dGVyID09PSAnKScgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBmdW5jID4gMCApIGZ1bmMgLT0gMTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIGZ1bmMgPT09IDAgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBzZXBhcmF0b3JzLmluZGV4T2YobGV0dGVyKSAhPT0gLTEgKSBzcGxpdCA9IHRydWU7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICggc3BsaXQgKSB7XG4gICAgICAgICAgICAgICAgaWYgKCBjdXJyZW50ICE9PSAnJyApIGFycmF5LnB1c2goY3VycmVudC50cmltKCkpO1xuICAgICAgICAgICAgICAgIGN1cnJlbnQgPSAnJztcbiAgICAgICAgICAgICAgICBzcGxpdCAgID0gZmFsc2U7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGN1cnJlbnQgKz0gbGV0dGVyO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCBsYXN0IHx8IGN1cnJlbnQgIT09ICcnICkgYXJyYXkucHVzaChjdXJyZW50LnRyaW0oKSk7XG4gICAgICAgIHJldHVybiBhcnJheTtcbiAgICB9LFxuXG4gICAgLyoqXG4gICAgICogU2FmZWx5IHNwbGl0cyBzcGFjZS1zZXBhcmF0ZWQgdmFsdWVzIChzdWNoIGFzIHRob3NlIGZvciBgYmFja2dyb3VuZGAsXG4gICAgICogYGJvcmRlci1yYWRpdXNgLCBhbmQgb3RoZXIgc2hvcnRoYW5kIHByb3BlcnRpZXMpLlxuICAgICAqXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IHN0cmluZyAtIHNwYWNlLXNlcGFyYXRlZCB2YWx1ZXNcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge3N0cmluZ1tdfSBzcGxpdCB2YWx1ZXNcbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogcG9zdGNzcy5saXN0LnNwYWNlKCcxcHggY2FsYygxMCUgKyAxcHgpJykgLy89PiBbJzFweCcsICdjYWxjKDEwJSArIDFweCknXVxuICAgICAqL1xuICAgIHNwYWNlKHN0cmluZykge1xuICAgICAgICBsZXQgc3BhY2VzID0gWycgJywgJ1xcbicsICdcXHQnXTtcbiAgICAgICAgcmV0dXJuIGxpc3Quc3BsaXQoc3RyaW5nLCBzcGFjZXMpO1xuICAgIH0sXG5cbiAgICAvKipcbiAgICAgKiBTYWZlbHkgc3BsaXRzIGNvbW1hLXNlcGFyYXRlZCB2YWx1ZXMgKHN1Y2ggYXMgdGhvc2UgZm9yIGB0cmFuc2l0aW9uLSpgXG4gICAgICogYW5kIGBiYWNrZ3JvdW5kYCBwcm9wZXJ0aWVzKS5cbiAgICAgKlxuICAgICAqIEBwYXJhbSB7c3RyaW5nfSBzdHJpbmcgLSBjb21tYS1zZXBhcmF0ZWQgdmFsdWVzXG4gICAgICpcbiAgICAgKiBAcmV0dXJuIHtzdHJpbmdbXX0gc3BsaXQgdmFsdWVzXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHBvc3Rjc3MubGlzdC5jb21tYSgnYmxhY2ssIGxpbmVhci1ncmFkaWVudCh3aGl0ZSwgYmxhY2spJylcbiAgICAgKiAvLz0+IFsnYmxhY2snLCAnbGluZWFyLWdyYWRpZW50KHdoaXRlLCBibGFjayknXVxuICAgICAqL1xuICAgIGNvbW1hKHN0cmluZykge1xuICAgICAgICBsZXQgY29tbWEgPSAnLCc7XG4gICAgICAgIHJldHVybiBsaXN0LnNwbGl0KHN0cmluZywgW2NvbW1hXSwgdHJ1ZSk7XG4gICAgfVxuXG59O1xuXG5leHBvcnQgZGVmYXVsdCBsaXN0O1xuIl19
  20877. /***/ }),
  20878. /* 155 */
  20879. /***/ (function(module, exports, __webpack_require__) {
  20880. "use strict";
  20881. exports.__esModule = true;
  20882. var _jsBase = __webpack_require__(35);
  20883. var _sourceMap = __webpack_require__(86);
  20884. var _sourceMap2 = _interopRequireDefault(_sourceMap);
  20885. var _path = __webpack_require__(5);
  20886. var _path2 = _interopRequireDefault(_path);
  20887. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  20888. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20889. var MapGenerator = function () {
  20890. function MapGenerator(stringify, root, opts) {
  20891. _classCallCheck(this, MapGenerator);
  20892. this.stringify = stringify;
  20893. this.mapOpts = opts.map || {};
  20894. this.root = root;
  20895. this.opts = opts;
  20896. }
  20897. MapGenerator.prototype.isMap = function isMap() {
  20898. if (typeof this.opts.map !== 'undefined') {
  20899. return !!this.opts.map;
  20900. } else {
  20901. return this.previous().length > 0;
  20902. }
  20903. };
  20904. MapGenerator.prototype.previous = function previous() {
  20905. var _this = this;
  20906. if (!this.previousMaps) {
  20907. this.previousMaps = [];
  20908. this.root.walk(function (node) {
  20909. if (node.source && node.source.input.map) {
  20910. var map = node.source.input.map;
  20911. if (_this.previousMaps.indexOf(map) === -1) {
  20912. _this.previousMaps.push(map);
  20913. }
  20914. }
  20915. });
  20916. }
  20917. return this.previousMaps;
  20918. };
  20919. MapGenerator.prototype.isInline = function isInline() {
  20920. if (typeof this.mapOpts.inline !== 'undefined') {
  20921. return this.mapOpts.inline;
  20922. }
  20923. var annotation = this.mapOpts.annotation;
  20924. if (typeof annotation !== 'undefined' && annotation !== true) {
  20925. return false;
  20926. }
  20927. if (this.previous().length) {
  20928. return this.previous().some(function (i) {
  20929. return i.inline;
  20930. });
  20931. } else {
  20932. return true;
  20933. }
  20934. };
  20935. MapGenerator.prototype.isSourcesContent = function isSourcesContent() {
  20936. if (typeof this.mapOpts.sourcesContent !== 'undefined') {
  20937. return this.mapOpts.sourcesContent;
  20938. }
  20939. if (this.previous().length) {
  20940. return this.previous().some(function (i) {
  20941. return i.withContent();
  20942. });
  20943. } else {
  20944. return true;
  20945. }
  20946. };
  20947. MapGenerator.prototype.clearAnnotation = function clearAnnotation() {
  20948. if (this.mapOpts.annotation === false) return;
  20949. var node = void 0;
  20950. for (var i = this.root.nodes.length - 1; i >= 0; i--) {
  20951. node = this.root.nodes[i];
  20952. if (node.type !== 'comment') continue;
  20953. if (node.text.indexOf('# sourceMappingURL=') === 0) {
  20954. this.root.removeChild(i);
  20955. }
  20956. }
  20957. };
  20958. MapGenerator.prototype.setSourcesContent = function setSourcesContent() {
  20959. var _this2 = this;
  20960. var already = {};
  20961. this.root.walk(function (node) {
  20962. if (node.source) {
  20963. var from = node.source.input.from;
  20964. if (from && !already[from]) {
  20965. already[from] = true;
  20966. var relative = _this2.relative(from);
  20967. _this2.map.setSourceContent(relative, node.source.input.css);
  20968. }
  20969. }
  20970. });
  20971. };
  20972. MapGenerator.prototype.applyPrevMaps = function applyPrevMaps() {
  20973. for (var _iterator = this.previous(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  20974. var _ref;
  20975. if (_isArray) {
  20976. if (_i >= _iterator.length) break;
  20977. _ref = _iterator[_i++];
  20978. } else {
  20979. _i = _iterator.next();
  20980. if (_i.done) break;
  20981. _ref = _i.value;
  20982. }
  20983. var prev = _ref;
  20984. var from = this.relative(prev.file);
  20985. var root = prev.root || _path2.default.dirname(prev.file);
  20986. var map = void 0;
  20987. if (this.mapOpts.sourcesContent === false) {
  20988. map = new _sourceMap2.default.SourceMapConsumer(prev.text);
  20989. if (map.sourcesContent) {
  20990. map.sourcesContent = map.sourcesContent.map(function () {
  20991. return null;
  20992. });
  20993. }
  20994. } else {
  20995. map = prev.consumer();
  20996. }
  20997. this.map.applySourceMap(map, from, this.relative(root));
  20998. }
  20999. };
  21000. MapGenerator.prototype.isAnnotation = function isAnnotation() {
  21001. if (this.isInline()) {
  21002. return true;
  21003. } else if (typeof this.mapOpts.annotation !== 'undefined') {
  21004. return this.mapOpts.annotation;
  21005. } else if (this.previous().length) {
  21006. return this.previous().some(function (i) {
  21007. return i.annotation;
  21008. });
  21009. } else {
  21010. return true;
  21011. }
  21012. };
  21013. MapGenerator.prototype.addAnnotation = function addAnnotation() {
  21014. var content = void 0;
  21015. if (this.isInline()) {
  21016. content = 'data:application/json;base64,' + _jsBase.Base64.encode(this.map.toString());
  21017. } else if (typeof this.mapOpts.annotation === 'string') {
  21018. content = this.mapOpts.annotation;
  21019. } else {
  21020. content = this.outputFile() + '.map';
  21021. }
  21022. var eol = '\n';
  21023. if (this.css.indexOf('\r\n') !== -1) eol = '\r\n';
  21024. this.css += eol + '/*# sourceMappingURL=' + content + ' */';
  21025. };
  21026. MapGenerator.prototype.outputFile = function outputFile() {
  21027. if (this.opts.to) {
  21028. return this.relative(this.opts.to);
  21029. } else if (this.opts.from) {
  21030. return this.relative(this.opts.from);
  21031. } else {
  21032. return 'to.css';
  21033. }
  21034. };
  21035. MapGenerator.prototype.generateMap = function generateMap() {
  21036. this.generateString();
  21037. if (this.isSourcesContent()) this.setSourcesContent();
  21038. if (this.previous().length > 0) this.applyPrevMaps();
  21039. if (this.isAnnotation()) this.addAnnotation();
  21040. if (this.isInline()) {
  21041. return [this.css];
  21042. } else {
  21043. return [this.css, this.map];
  21044. }
  21045. };
  21046. MapGenerator.prototype.relative = function relative(file) {
  21047. if (file.indexOf('<') === 0) return file;
  21048. if (/^\w+:\/\//.test(file)) return file;
  21049. var from = this.opts.to ? _path2.default.dirname(this.opts.to) : '.';
  21050. if (typeof this.mapOpts.annotation === 'string') {
  21051. from = _path2.default.dirname(_path2.default.resolve(from, this.mapOpts.annotation));
  21052. }
  21053. file = _path2.default.relative(from, file);
  21054. if (_path2.default.sep === '\\') {
  21055. return file.replace(/\\/g, '/');
  21056. } else {
  21057. return file;
  21058. }
  21059. };
  21060. MapGenerator.prototype.sourcePath = function sourcePath(node) {
  21061. if (this.mapOpts.from) {
  21062. return this.mapOpts.from;
  21063. } else {
  21064. return this.relative(node.source.input.from);
  21065. }
  21066. };
  21067. MapGenerator.prototype.generateString = function generateString() {
  21068. var _this3 = this;
  21069. this.css = '';
  21070. this.map = new _sourceMap2.default.SourceMapGenerator({ file: this.outputFile() });
  21071. var line = 1;
  21072. var column = 1;
  21073. var lines = void 0,
  21074. last = void 0;
  21075. this.stringify(this.root, function (str, node, type) {
  21076. _this3.css += str;
  21077. if (node && type !== 'end') {
  21078. if (node.source && node.source.start) {
  21079. _this3.map.addMapping({
  21080. source: _this3.sourcePath(node),
  21081. generated: { line: line, column: column - 1 },
  21082. original: {
  21083. line: node.source.start.line,
  21084. column: node.source.start.column - 1
  21085. }
  21086. });
  21087. } else {
  21088. _this3.map.addMapping({
  21089. source: '<no source>',
  21090. original: { line: 1, column: 0 },
  21091. generated: { line: line, column: column - 1 }
  21092. });
  21093. }
  21094. }
  21095. lines = str.match(/\n/g);
  21096. if (lines) {
  21097. line += lines.length;
  21098. last = str.lastIndexOf('\n');
  21099. column = str.length - last;
  21100. } else {
  21101. column += str.length;
  21102. }
  21103. if (node && type !== 'start') {
  21104. if (node.source && node.source.end) {
  21105. _this3.map.addMapping({
  21106. source: _this3.sourcePath(node),
  21107. generated: { line: line, column: column - 1 },
  21108. original: {
  21109. line: node.source.end.line,
  21110. column: node.source.end.column
  21111. }
  21112. });
  21113. } else {
  21114. _this3.map.addMapping({
  21115. source: '<no source>',
  21116. original: { line: 1, column: 0 },
  21117. generated: { line: line, column: column - 1 }
  21118. });
  21119. }
  21120. }
  21121. });
  21122. };
  21123. MapGenerator.prototype.generate = function generate() {
  21124. this.clearAnnotation();
  21125. if (this.isMap()) {
  21126. return this.generateMap();
  21127. } else {
  21128. var result = '';
  21129. this.stringify(this.root, function (i) {
  21130. result += i;
  21131. });
  21132. return [result];
  21133. }
  21134. };
  21135. return MapGenerator;
  21136. }();
  21137. exports.default = MapGenerator;
  21138. module.exports = exports['default'];
  21139. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1hcC1nZW5lcmF0b3IuZXM2Il0sIm5hbWVzIjpbIk1hcEdlbmVyYXRvciIsInN0cmluZ2lmeSIsInJvb3QiLCJvcHRzIiwibWFwT3B0cyIsIm1hcCIsImlzTWFwIiwicHJldmlvdXMiLCJsZW5ndGgiLCJwcmV2aW91c01hcHMiLCJ3YWxrIiwibm9kZSIsInNvdXJjZSIsImlucHV0IiwiaW5kZXhPZiIsInB1c2giLCJpc0lubGluZSIsImlubGluZSIsImFubm90YXRpb24iLCJzb21lIiwiaSIsImlzU291cmNlc0NvbnRlbnQi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Zyb20gJ3BhdGgnO1xuXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBNYXBHZW5lcmF0b3Ige1xuXG4gICAgY29uc3RydWN0b3Ioc3RyaW5naWZ5LCByb290LCBvcHRzKSB7XG4gICAgICAgIHRoaXMuc3RyaW5naWZ5ID0gc3RyaW5naWZ5O1xuICAgICAgICB0aGlzLm1hcE9wdHMgICA9IG9wdHMubWFwIHx8IHsgfTtcbiAgICAgICAgdGhpcy5yb290ICAgICAgPSByb290O1xuICAgICAgICB0aGlzLm9wdHMgICAgICA9IG9wdHM7XG4gICAgfVxuXG4gICAgaXNNYXAoKSB7XG4gICAgICAgIGlmICggdHlwZW9mIHRoaXMub3B0cy5tYXAgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgcmV0dXJuICEhdGhpcy5vcHRzLm1hcDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnByZXZpb3VzKCkubGVuZ3RoID4gMDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHByZXZpb3VzKCkge1xuICAgICAgICBpZiAoICF0aGlzLnByZXZpb3VzTWFwcyApIHtcbiAgICAgICAgICAgIHRoaXMucHJldmlvdXNNYXBzID0gW107XG4gICAgICAgICAgICB0aGlzLnJvb3Qud2Fsayggbm9kZSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKCBub2RlLnNvdXJjZSAmJiBub2RlLnNvdXJjZS5pbnB1dC5tYXAgKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBtYXAgPSBub2RlLnNvdXJjZS5pbnB1dC5tYXA7XG4gICAgICAgICAgICAgICAgICAgIGlmICggdGhpcy5wcmV2aW91c01hcHMuaW5kZXhPZihtYXApID09PSAtMSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucHJldmlvdXNNYXBzLnB1c2gobWFwKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRoaXMucHJldmlvdXNNYXBzO1xuICAgIH1cblxuICAgIGlzSW5saW5lKCkge1xuICAgICAgICBpZiAoIHR5cGVvZiB0aGlzLm1hcE9wdHMuaW5saW5lICE9PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm1hcE9wdHMuaW5saW5lO1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IGFubm90YXRpb24gPSB0aGlzLm1hcE9wdHMuYW5ub3RhdGlvbjtcbiAgICAgICAgaWYgKCB0eXBlb2YgYW5ub3RhdGlvbiAhPT0gJ3VuZGVmaW5lZCcgJiYgYW5ub3RhdGlvbiAhPT0gdHJ1ZSApIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICggdGhpcy5wcmV2aW91cygpLmxlbmd0aCApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnByZXZpb3VzKCkuc29tZSggaSA9PiBpLmlubGluZSApO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBpc1NvdXJjZXNDb250ZW50KCkge1xuICAgICAgICBpZiAoIHR5cGVvZiB0aGlzLm1hcE9wdHMuc291cmNlc0NvbnRlbnQgIT09ICd1bmRlZmluZWQnICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMubWFwT3B0cy5zb3VyY2VzQ29udGVudDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIHRoaXMucHJldmlvdXMoKS5sZW5ndGggKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5wcmV2aW91cygpLnNvbWUoIGkgPT4gaS53aXRoQ29udGVudCgpICk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGNsZWFyQW5ub3RhdGlvbigpIHtcbiAgICAgICAgaWYgKCB0aGlzLm1hcE9wdHMuYW5ub3RhdGlvbiA9PT0gZmFsc2UgKSByZXR1cm47XG5cbiAgICAgICAgbGV0IG5vZGU7XG4gICAgICAgIGZvciAoIGxldCBpID0gdGhpcy5yb290Lm5vZGVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgaS0tICkge1xuICAgICAgICAgICAgbm9kZSA9IHRoaXMucm9vdC5ub2Rlc1tpXTtcbiAgICAgICAgICAgIGlmICggbm9kZS50eXBlICE9PSAnY29tbWVudCcgKSBjb250aW51ZTtcbiAgICAgICAgICAgIGlmICggbm9kZS50ZXh0LmluZGV4T2YoJyMgc291cmNlTWFwcGluZ1VSTD0nKSA9PT0gMCApIHtcbiAgICAgICAgICAgICAgICB0aGlzLnJvb3QucmVtb3ZlQ2hpbGQoaSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBzZXRTb3VyY2VzQ29udGVudCgpIHtcbiAgICAgICAgbGV0IGFscmVhZHkgPSB7IH07XG4gICAgICAgIHRoaXMucm9vdC53YWxrKCBub2RlID0+IHtcbiAgICAgICAgICAgIGlmICggbm9kZS5zb3VyY2UgKSB7XG4gICAgICAgICAgICAgICAgbGV0IGZyb20gPSBub2RlLnNvdXJjZS5pbnB1dC5mcm9tO1xuICAgICAgICAgICAgICAgIGlmICggZnJvbSAmJiAhYWxyZWFkeVtmcm9tXSApIHtcbiAgICAgICAgICAgICAgICAgICAgYWxyZWFkeVtmcm9tXSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGxldCByZWxhdGl2ZSA9IHRoaXMucmVsYXRpdmUoZnJvbSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubWFwLnNldFNvdXJjZUNvbnRlbnQocmVsYXRpdmUsIG5vZGUuc291cmNlLmlucHV0LmNzcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhcHBseVByZXZNYXBzKCkge1xuICAgICAgICBmb3IgKCBsZXQgcHJldiBvZiB0aGlzLnByZXZpb3VzKCkgKSB7XG4gICAgICAgICAgICBsZXQgZnJvbSA9IHRoaXMucmVsYXRpdmUocHJldi5maWxlKTtcbiAgICAgICAgICAgIGxldCByb290ID0gcHJldi5yb290IHx8IHBhdGguZGlybmFtZShwcmV2LmZpbGUpO1xuICAgICAgICAgICAgbGV0IG1hcDtcblxuICAgICAgICAgICAgaWYgKCB0aGlzLm1hcE9wdHMuc291cmNlc0NvbnRlbnQgPT09IGZhbHNlICkge1xuICAgICAgICAgICAgICAgIG1hcCA9IG5ldyBtb3ppbGxhLlNvdXJjZU1hcENvbnN1bWVyKHByZXYudGV4dCk7XG4gICAgICAgICAgICAgICAgaWYgKCBtYXAuc291cmNlc0NvbnRlbnQgKSB7XG4gICAgICAgICAgICAgICAgICAgIG1hcC5zb3VyY2VzQ29udGVudCA9IG1hcC5zb3VyY2VzQ29udGVudC5tYXAoICgpID0+IG51bGwgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG1hcCA9IHByZXYuY29uc3VtZXIoKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5tYXAuYXBwbHlTb3VyY2VNYXAobWFwLCBmcm9tLCB0aGlzLnJlbGF0aXZlKHJvb3QpKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlzQW5ub3RhdGlvbigpIHtcbiAgICAgICAgaWYgKCB0aGlzLmlzSW5saW5lKCkgKSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfSBlbHNlIGlmICggdHlwZW9mIHRoaXMubWFwT3B0cy5hbm5vdGF0aW9uICE9PSAndW5kZWZpbmVkJyApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm1hcE9wdHMuYW5ub3RhdGlvbjtcbiAgICAgICAgfSBlbHNlIGlmICggdGhpcy5wcmV2aW91cygpLmxlbmd0aCApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnByZXZpb3VzKCkuc29tZSggaSA9PiBpLmFubm90YXRpb24gKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgYWRkQW5ub3RhdGlvbigpIHtcbiAgICAgICAgbGV0IGNvbnRlbnQ7XG5cbiAgICAgICAgaWYgKCB0aGlzLmlzSW5saW5lKCkgKSB7XG4gICAgICAgICAgICBjb250ZW50ID0gJ2RhdGE6YXBwbGljYXRpb24vanNvbjtiYXNlNjQsJyArXG4gICAgICAgICAgICAgICAgICAgICAgIEJhc2U2NC5lbmNvZGUoIHRoaXMubWFwLnRvU3RyaW5nKCkgKTtcblxuICAgICAgICB9IGVsc2UgaWYgKCB0eXBlb2YgdGhpcy5tYXBPcHRzLmFubm90YXRpb24gPT09ICdzdHJpbmcnICkge1xuICAgICAgICAgICAgY29udGVudCA9IHRoaXMubWFwT3B0cy5hbm5vdGF0aW9uO1xuXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjb250ZW50ID0gdGhpcy5vdXRwdXRGaWxlKCkgKyAnLm1hcCc7XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgZW9sICAgPSAnXFxuJztcbiAgICAgICAgaWYgKCB0aGlzLmNzcy5pbmRleE9mKCdcXHJcXG4nKSAhPT0gLTEgKSBlb2wgPSAnXFxyXFxuJztcblxuICAgICAgICB0aGlzLmNzcyArPSBlb2wgKyAnLyojIHNvdXJjZU1hcHBpbmdVUkw9JyArIGNvbnRlbnQgKyAnICovJztcbiAgICB9XG5cbiAgICBvdXRwdXRGaWxlKCkge1xuICAgICAgICBpZiAoIHRoaXMub3B0cy50byApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnJlbGF0aXZlKHRoaXMub3B0cy50byk7XG4gICAgICAgIH0gZWxz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Uuc3RhcnQgKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubWFwLmFkZE1hcHBpbmcoe1xuICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlOiAgICB0aGlzLnNvdXJjZVBhdGgobm9kZSksXG4gICAgICAgICAgICAgICAgICAgICAgICBnZW5lcmF0ZWQ6IHsgbGluZSwgY29sdW1uOiBjb2x1bW4gLSAxIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICBvcmlnaW5hbDogIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lOiAgIG5vZGUuc291cmNlLnN0YXJ0LmxpbmUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sdW1uOiBub2RlLnNvdXJjZS5zdGFydC5jb2x1bW4gLSAxXG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubWFwLmFkZE1hcHBpbmcoe1xuICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlOiAgICAnPG5vIHNvdXJjZT4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgb3JpZ2luYWw6ICB7IGxpbmU6IDEsIGNvbHVtbjogMCB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgZ2VuZXJhdGVkOiB7IGxpbmUsIGNvbHVtbjogY29sdW1uIC0gMSB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgbGluZXMgPSBzdHIubWF0Y2goL1xcbi9nKTtcbiAgICAgICAgICAgIGlmICggbGluZXMgKSB7XG4gICAgICAgICAgICAgICAgbGluZSAgKz0gbGluZXMubGVuZ3RoO1xuICAgICAgICAgICAgICAgIGxhc3QgICA9IHN0ci5sYXN0SW5kZXhPZignXFxuJyk7XG4gICAgICAgICAgICAgICAgY29sdW1uID0gc3RyLmxlbmd0aCAtIGxhc3Q7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvbHVtbiArPSBzdHIubGVuZ3RoO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoIG5vZGUgJiYgdHlwZSAhPT0gJ3N0YXJ0JyApIHtcbiAgICAgICAgICAgICAgICBpZiAoIG5vZGUuc291cmNlICYmIG5vZGUuc291cmNlLmVuZCApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tYXAuYWRkTWFwcGluZyh7XG4gICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2U6ICAgIHRoaXMuc291cmNlUGF0aChub2RlKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGdlbmVyYXRlZDogeyBsaW5lLCBjb2x1bW46IGNvbHVtbiAtIDEgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9yaWdpbmFsOiAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmU6ICAgbm9kZS5zb3VyY2UuZW5kLmxpbmUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sdW1uOiBub2RlLnNvdXJjZS5lbmQuY29sdW1uXG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubWFwLmFkZE1hcHBpbmcoe1xuICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlOiAgICAnPG5vIHNvdXJjZT4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgb3JpZ2luYWw6ICB7IGxpbmU6IDEsIGNvbHVtbjogMCB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgZ2VuZXJhdGVkOiB7IGxpbmUsIGNvbHVtbjogY29sdW1uIC0gMSB9XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgZ2VuZXJhdGUoKSB7XG4gICAgICAgIHRoaXMuY2xlYXJBbm5vdGF0aW9uKCk7XG5cbiAgICAgICAgaWYgKCB0aGlzLmlzTWFwKCkgKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5nZW5lcmF0ZU1hcCgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IHJlc3VsdCA9ICcnO1xuICAgICAgICAgICAgdGhpcy5zdHJpbmdpZnkodGhpcy5yb290LCBpID0+IHtcbiAgICAgICAgICAgICAgICByZXN1bHQgKz0gaTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcmV0dXJuIFtyZXN1bHRdO1xuICAgICAgICB9XG4gICAgfVxuXG59XG4iXX0=
  21140. /***/ }),
  21141. /* 156 */
  21142. /***/ (function(module, exports, __webpack_require__) {
  21143. "use strict";
  21144. exports.__esModule = true;
  21145. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  21146. var _jsBase = __webpack_require__(35);
  21147. var _sourceMap = __webpack_require__(86);
  21148. var _sourceMap2 = _interopRequireDefault(_sourceMap);
  21149. var _path = __webpack_require__(5);
  21150. var _path2 = _interopRequireDefault(_path);
  21151. var _fs = __webpack_require__(178);
  21152. var _fs2 = _interopRequireDefault(_fs);
  21153. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  21154. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21155. /**
  21156. * Source map information from input CSS.
  21157. * For example, source map after Sass compiler.
  21158. *
  21159. * This class will automatically find source map in input CSS or in file system
  21160. * near input file (according `from` option).
  21161. *
  21162. * @example
  21163. * const root = postcss.parse(css, { from: 'a.sass.css' });
  21164. * root.input.map //=> PreviousMap
  21165. */
  21166. var PreviousMap = function () {
  21167. /**
  21168. * @param {string} css - input CSS source
  21169. * @param {processOptions} [opts] - {@link Processor#process} options
  21170. */
  21171. function PreviousMap(css, opts) {
  21172. _classCallCheck(this, PreviousMap);
  21173. this.loadAnnotation(css);
  21174. /**
  21175. * @member {boolean} - Was source map inlined by data-uri to input CSS.
  21176. */
  21177. this.inline = this.startWith(this.annotation, 'data:');
  21178. var prev = opts.map ? opts.map.prev : undefined;
  21179. var text = this.loadMap(opts.from, prev);
  21180. if (text) this.text = text;
  21181. }
  21182. /**
  21183. * Create a instance of `SourceMapGenerator` class
  21184. * from the `source-map` library to work with source map information.
  21185. *
  21186. * It is lazy method, so it will create object only on first call
  21187. * and then it will use cache.
  21188. *
  21189. * @return {SourceMapGenerator} object with source map information
  21190. */
  21191. PreviousMap.prototype.consumer = function consumer() {
  21192. if (!this.consumerCache) {
  21193. this.consumerCache = new _sourceMap2.default.SourceMapConsumer(this.text);
  21194. }
  21195. return this.consumerCache;
  21196. };
  21197. /**
  21198. * Does source map contains `sourcesContent` with input source text.
  21199. *
  21200. * @return {boolean} Is `sourcesContent` present
  21201. */
  21202. PreviousMap.prototype.withContent = function withContent() {
  21203. return !!(this.consumer().sourcesContent && this.consumer().sourcesContent.length > 0);
  21204. };
  21205. PreviousMap.prototype.startWith = function startWith(string, start) {
  21206. if (!string) return false;
  21207. return string.substr(0, start.length) === start;
  21208. };
  21209. PreviousMap.prototype.loadAnnotation = function loadAnnotation(css) {
  21210. var match = css.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//);
  21211. if (match) this.annotation = match[1].trim();
  21212. };
  21213. PreviousMap.prototype.decodeInline = function decodeInline(text) {
  21214. var utfd64 = 'data:application/json;charset=utf-8;base64,';
  21215. var utf64 = 'data:application/json;charset=utf8;base64,';
  21216. var b64 = 'data:application/json;base64,';
  21217. var uri = 'data:application/json,';
  21218. if (this.startWith(text, uri)) {
  21219. return decodeURIComponent(text.substr(uri.length));
  21220. } else if (this.startWith(text, b64)) {
  21221. return _jsBase.Base64.decode(text.substr(b64.length));
  21222. } else if (this.startWith(text, utf64)) {
  21223. return _jsBase.Base64.decode(text.substr(utf64.length));
  21224. } else if (this.startWith(text, utfd64)) {
  21225. return _jsBase.Base64.decode(text.substr(utfd64.length));
  21226. } else {
  21227. var encoding = text.match(/data:application\/json;([^,]+),/)[1];
  21228. throw new Error('Unsupported source map encoding ' + encoding);
  21229. }
  21230. };
  21231. PreviousMap.prototype.loadMap = function loadMap(file, prev) {
  21232. if (prev === false) return false;
  21233. if (prev) {
  21234. if (typeof prev === 'string') {
  21235. return prev;
  21236. } else if (typeof prev === 'function') {
  21237. var prevPath = prev(file);
  21238. if (prevPath && _fs2.default.existsSync && _fs2.default.existsSync(prevPath)) {
  21239. return _fs2.default.readFileSync(prevPath, 'utf-8').toString().trim();
  21240. } else {
  21241. throw new Error('Unable to load previous source map: ' + prevPath.toString());
  21242. }
  21243. } else if (prev instanceof _sourceMap2.default.SourceMapConsumer) {
  21244. return _sourceMap2.default.SourceMapGenerator.fromSourceMap(prev).toString();
  21245. } else if (prev instanceof _sourceMap2.default.SourceMapGenerator) {
  21246. return prev.toString();
  21247. } else if (this.isMap(prev)) {
  21248. return JSON.stringify(prev);
  21249. } else {
  21250. throw new Error('Unsupported previous source map format: ' + prev.toString());
  21251. }
  21252. } else if (this.inline) {
  21253. return this.decodeInline(this.annotation);
  21254. } else if (this.annotation) {
  21255. var map = this.annotation;
  21256. if (file) map = _path2.default.join(_path2.default.dirname(file), map);
  21257. this.root = _path2.default.dirname(map);
  21258. if (_fs2.default.existsSync && _fs2.default.existsSync(map)) {
  21259. return _fs2.default.readFileSync(map, 'utf-8').toString().trim();
  21260. } else {
  21261. return false;
  21262. }
  21263. }
  21264. };
  21265. PreviousMap.prototype.isMap = function isMap(map) {
  21266. if ((typeof map === 'undefined' ? 'undefined' : _typeof(map)) !== 'object') return false;
  21267. return typeof map.mappings === 'string' || typeof map._mappings === 'string';
  21268. };
  21269. return PreviousMap;
  21270. }();
  21271. exports.default = PreviousMap;
  21272. module.exports = exports['default'];
  21273. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByZXZpb3VzLW1hcC5lczYiXSwibmFtZXMiOlsiUHJldmlvdXNNYXAiLCJjc3MiLCJvcHRzIiwibG9hZEFubm90YXRpb24iLCJpbmxpbmUiLCJzdGFydFdpdGgiLCJhbm5vdGF0aW9uIiwicHJldiIsIm1hcCIsInVuZGVmaW5lZCIsInRleHQiLCJsb2FkTWFwIiwiZnJvbSIsImNvbnN1bWVyIiwiY29uc3VtZXJDYWNoZSIsIlNvdXJjZU1hcENvbnN1bWVyIiwid2l0aENvbnRlbnQiLCJzb3VyY2VzQ29udGVudCIsImxlbmd0aCIsInN0cmluZyIsInN0YXJ0Iiwic3Vic3RyIiwibWF0Y2giLCJ0cmltIiwiZGVjb2RlSW5saW5lIiwidXRmZDY0IiwidXRmNjQiLCJiNjQiLCJ1cmkiLCJkZWNvZGVVUklDb21wb25lbnQiLCJkZWNvZGUiLCJlbmNvZGluZyIsIkVycm9yIiwiZmlsZSIsInByZXZQYXRoIiwiZXhpc3RzU3luYyIsInJlYWRGaWxlU3luYyIsInRvU3RyaW5nIiwiU291cmNlTWFwR2VuZXJhdG9yIiwiZnJvbVNvdXJjZU1hcCIsImlzTWFwIiwiSlNPTiIsInN0cmluZ2lmeSIsImpvaW4iLCJkaXJuYW1lIiwicm9vdCIsIm1hcHBpbmdzIiwiX21hcHBpbmdzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQTs7QUFDQTs7OztBQUNBOzs7O0FBQ0E7Ozs7Ozs7O0FBRUE7Ozs7Ozs7Ozs7O0lBV01BLFc7O0FBRUY7Ozs7QUFJQSx5QkFBWUMsR0FBWixFQUFpQkMsSUFBakIsRUFBdUI7QUFBQTs7QUFDbkIsYUFBS0MsY0FBTCxDQUFvQkYsR0FBcEI7QUFDQTs7O0FBR0E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gICByZXR1cm4gcHJldjtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHR5cGVvZiBwcmV2ID09PSAnZnVuY3Rpb24nICkge1xuICAgICAgICAgICAgICAgIGxldCBwcmV2UGF0aCA9IHByZXYoZmlsZSk7XG4gICAgICAgICAgICAgICAgaWYgKCBwcmV2UGF0aCAmJiBmcy5leGlzdHNTeW5jICYmIGZzLmV4aXN0c1N5bmMocHJldlBhdGgpICkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnMucmVhZEZpbGVTeW5jKHByZXZQYXRoLCAndXRmLTgnKS50b1N0cmluZygpLnRyaW0oKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ1VuYWJsZSB0byBsb2FkIHByZXZpb3VzIHNvdXJjZSBtYXA6ICcgK1xuICAgICAgICAgICAgICAgICAgICBwcmV2UGF0aC50b1N0cmluZygpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCBwcmV2IGluc3RhbmNlb2YgbW96aWxsYS5Tb3VyY2VNYXBDb25zdW1lciApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbW96aWxsYS5Tb3VyY2VNYXBHZW5lcmF0b3JcbiAgICAgICAgICAgICAgICAgICAgLmZyb21Tb3VyY2VNYXAocHJldikudG9TdHJpbmcoKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoIHByZXYgaW5zdGFuY2VvZiBtb3ppbGxhLlNvdXJjZU1hcEdlbmVyYXRvciApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcHJldi50b1N0cmluZygpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICggdGhpcy5pc01hcChwcmV2KSApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkocHJldik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignVW5zdXBwb3J0ZWQgcHJldmlvdXMgc291cmNlIG1hcCBmb3JtYXQ6ICcgK1xuICAgICAgICAgICAgICAgICAgICBwcmV2LnRvU3RyaW5nKCkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgIH0gZWxzZSBpZiAoIHRoaXMuaW5saW5lICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuZGVjb2RlSW5saW5lKHRoaXMuYW5ub3RhdGlvbik7XG5cbiAgICAgICAgfSBlbHNlIGlmICggdGhpcy5hbm5vdGF0aW9uICkge1xuICAgICAgICAgICAgbGV0IG1hcCA9IHRoaXMuYW5ub3RhdGlvbjtcbiAgICAgICAgICAgIGlmICggZmlsZSApIG1hcCA9IHBhdGguam9pbihwYXRoLmRpcm5hbWUoZmlsZSksIG1hcCk7XG5cbiAgICAgICAgICAgIHRoaXMucm9vdCA9IHBhdGguZGlybmFtZShtYXApO1xuICAgICAgICAgICAgaWYgKCBmcy5leGlzdHNTeW5jICYmIGZzLmV4aXN0c1N5bmMobWFwKSApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZnMucmVhZEZpbGVTeW5jKG1hcCwgJ3V0Zi04JykudG9TdHJpbmcoKS50cmltKCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlzTWFwKG1hcCkge1xuICAgICAgICBpZiAoIHR5cGVvZiBtYXAgIT09ICdvYmplY3QnICkgcmV0dXJuIGZhbHNlO1xuICAgICAgICByZXR1cm4gdHlwZW9mIG1hcC5tYXBwaW5ncyA9PT0gJ3N0cmluZycgfHxcbiAgICAgICAgICAgICAgIHR5cGVvZiBtYXAuX21hcHBpbmdzID09PSAnc3RyaW5nJztcbiAgICB9XG59XG5cbmV4cG9ydCBkZWZhdWx0IFByZXZpb3VzTWFwO1xuIl19
  21274. /***/ }),
  21275. /* 157 */
  21276. /***/ (function(module, exports, __webpack_require__) {
  21277. "use strict";
  21278. exports.__esModule = true;
  21279. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  21280. var _lazyResult = __webpack_require__(77);
  21281. var _lazyResult2 = _interopRequireDefault(_lazyResult);
  21282. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  21283. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21284. /**
  21285. * Contains plugins to process CSS. Create one `Processor` instance,
  21286. * initialize its plugins, and then use that instance on numerous CSS files.
  21287. *
  21288. * @example
  21289. * const processor = postcss([autoprefixer, precss]);
  21290. * processor.process(css1).then(result => console.log(result.css));
  21291. * processor.process(css2).then(result => console.log(result.css));
  21292. */
  21293. var Processor = function () {
  21294. /**
  21295. * @param {Array.<Plugin|pluginFunction>|Processor} plugins - PostCSS
  21296. * plugins. See {@link Processor#use} for plugin format.
  21297. */
  21298. function Processor() {
  21299. var plugins = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  21300. _classCallCheck(this, Processor);
  21301. /**
  21302. * @member {string} - Current PostCSS version.
  21303. *
  21304. * @example
  21305. * if ( result.processor.version.split('.')[0] !== '5' ) {
  21306. * throw new Error('This plugin works only with PostCSS 5');
  21307. * }
  21308. */
  21309. this.version = '5.2.17';
  21310. /**
  21311. * @member {pluginFunction[]} - Plugins added to this processor.
  21312. *
  21313. * @example
  21314. * const processor = postcss([autoprefixer, precss]);
  21315. * processor.plugins.length //=> 2
  21316. */
  21317. this.plugins = this.normalize(plugins);
  21318. }
  21319. /**
  21320. * Adds a plugin to be used as a CSS processor.
  21321. *
  21322. * PostCSS plugin can be in 4 formats:
  21323. * * A plugin created by {@link postcss.plugin} method.
  21324. * * A function. PostCSS will pass the function a @{link Root}
  21325. * as the first argument and current {@link Result} instance
  21326. * as the second.
  21327. * * An object with a `postcss` method. PostCSS will use that method
  21328. * as described in #2.
  21329. * * Another {@link Processor} instance. PostCSS will copy plugins
  21330. * from that instance into this one.
  21331. *
  21332. * Plugins can also be added by passing them as arguments when creating
  21333. * a `postcss` instance (see [`postcss(plugins)`]).
  21334. *
  21335. * Asynchronous plugins should return a `Promise` instance.
  21336. *
  21337. * @param {Plugin|pluginFunction|Processor} plugin - PostCSS plugin
  21338. * or {@link Processor}
  21339. * with plugins
  21340. *
  21341. * @example
  21342. * const processor = postcss()
  21343. * .use(autoprefixer)
  21344. * .use(precss);
  21345. *
  21346. * @return {Processes} current processor to make methods chain
  21347. */
  21348. Processor.prototype.use = function use(plugin) {
  21349. this.plugins = this.plugins.concat(this.normalize([plugin]));
  21350. return this;
  21351. };
  21352. /**
  21353. * Parses source CSS and returns a {@link LazyResult} Promise proxy.
  21354. * Because some plugins can be asynchronous it doesn’t make
  21355. * any transformations. Transformations will be applied
  21356. * in the {@link LazyResult} methods.
  21357. *
  21358. * @param {string|toString|Result} css - String with input CSS or
  21359. * any object with a `toString()`
  21360. * method, like a Buffer.
  21361. * Optionally, send a {@link Result}
  21362. * instance and the processor will
  21363. * take the {@link Root} from it.
  21364. * @param {processOptions} [opts] - options
  21365. *
  21366. * @return {LazyResult} Promise proxy
  21367. *
  21368. * @example
  21369. * processor.process(css, { from: 'a.css', to: 'a.out.css' })
  21370. * .then(result => {
  21371. * console.log(result.css);
  21372. * });
  21373. */
  21374. Processor.prototype.process = function process(css) {
  21375. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  21376. return new _lazyResult2.default(this, css, opts);
  21377. };
  21378. Processor.prototype.normalize = function normalize(plugins) {
  21379. var normalized = [];
  21380. for (var _iterator = plugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  21381. var _ref;
  21382. if (_isArray) {
  21383. if (_i >= _iterator.length) break;
  21384. _ref = _iterator[_i++];
  21385. } else {
  21386. _i = _iterator.next();
  21387. if (_i.done) break;
  21388. _ref = _i.value;
  21389. }
  21390. var i = _ref;
  21391. if (i.postcss) i = i.postcss;
  21392. if ((typeof i === 'undefined' ? 'undefined' : _typeof(i)) === 'object' && Array.isArray(i.plugins)) {
  21393. normalized = normalized.concat(i.plugins);
  21394. } else if (typeof i === 'function') {
  21395. normalized.push(i);
  21396. } else if ((typeof i === 'undefined' ? 'undefined' : _typeof(i)) === 'object' && (i.parse || i.stringify)) {
  21397. throw new Error('PostCSS syntaxes cannot be used as plugins. ' + 'Instead, please use one of the ' + 'syntax/parser/stringifier options as ' + 'outlined in your PostCSS ' + 'runner documentation.');
  21398. } else {
  21399. throw new Error(i + ' is not a PostCSS plugin');
  21400. }
  21401. }
  21402. return normalized;
  21403. };
  21404. return Processor;
  21405. }();
  21406. exports.default = Processor;
  21407. /**
  21408. * @callback builder
  21409. * @param {string} part - part of generated CSS connected to this node
  21410. * @param {Node} node - AST node
  21411. * @param {"start"|"end"} [type] - node’s part type
  21412. */
  21413. /**
  21414. * @callback parser
  21415. *
  21416. * @param {string|toString} css - string with input CSS or any object
  21417. * with toString() method, like a Buffer
  21418. * @param {processOptions} [opts] - options with only `from` and `map` keys
  21419. *
  21420. * @return {Root} PostCSS AST
  21421. */
  21422. /**
  21423. * @callback stringifier
  21424. *
  21425. * @param {Node} node - start node for stringifing. Usually {@link Root}.
  21426. * @param {builder} builder - function to concatenate CSS from node’s parts
  21427. * or generate string and source map
  21428. *
  21429. * @return {void}
  21430. */
  21431. /**
  21432. * @typedef {object} syntax
  21433. * @property {parser} parse - function to generate AST by string
  21434. * @property {stringifier} stringify - function to generate string by AST
  21435. */
  21436. /**
  21437. * @typedef {object} toString
  21438. * @property {function} toString
  21439. */
  21440. /**
  21441. * @callback pluginFunction
  21442. * @param {Root} root - parsed input CSS
  21443. * @param {Result} result - result to set warnings or check other plugins
  21444. */
  21445. /**
  21446. * @typedef {object} Plugin
  21447. * @property {function} postcss - PostCSS plugin function
  21448. */
  21449. /**
  21450. * @typedef {object} processOptions
  21451. * @property {string} from - the path of the CSS source file.
  21452. * You should always set `from`,
  21453. * because it is used in source map
  21454. * generation and syntax error messages.
  21455. * @property {string} to - the path where you’ll put the output
  21456. * CSS file. You should always set `to`
  21457. * to generate correct source maps.
  21458. * @property {parser} parser - function to generate AST by string
  21459. * @property {stringifier} stringifier - class to generate string by AST
  21460. * @property {syntax} syntax - object with `parse` and `stringify`
  21461. * @property {object} map - source map options
  21462. * @property {boolean} map.inline - does source map should
  21463. * be embedded in the output
  21464. * CSS as a base64-encoded
  21465. * comment
  21466. * @property {string|object|false|function} map.prev - source map content
  21467. * from a previous
  21468. * processing step
  21469. * (for example, Sass).
  21470. * PostCSS will try to find
  21471. * previous map
  21472. * automatically, so you
  21473. * could disable it by
  21474. * `false` value.
  21475. * @property {boolean} map.sourcesContent - does PostCSS should set
  21476. * the origin content to map
  21477. * @property {string|false} map.annotation - does PostCSS should set
  21478. * annotation comment to map
  21479. * @property {string} map.from - override `from` in map’s
  21480. * `sources`
  21481. */
  21482. module.exports = exports['default'];
  21483. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInByb2Nlc3Nvci5lczYiXSwibmFtZXMiOlsiUHJvY2Vzc29yIiwicGx1Z2lucyIsInZlcnNpb24iLCJub3JtYWxpemUiLCJ1c2UiLCJwbHVnaW4iLCJjb25jYXQiLCJwcm9jZXNzIiwiY3NzIiwib3B0cyIsIm5vcm1hbGl6ZWQiLCJpIiwicG9zdGNzcyIsIkFycmF5IiwiaXNBcnJheSIsInB1c2giLCJwYXJzZSIsInN0cmluZ2lmeSIsIkVycm9yIl0sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQTs7Ozs7Ozs7QUFFQTs7Ozs7Ozs7O0lBU01BLFM7O0FBRUY7Ozs7QUFJQSx1QkFBMEI7QUFBQSxRQUFkQyxPQUFjLH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5bmNocm9ub3VzIHBsdWdpbnMgc2hvdWxkIHJldHVybiBhIGBQcm9taXNlYCBpbnN0YW5jZS5cbiAgICAgKlxuICAgICAqIEBwYXJhbSB7UGx1Z2lufHBsdWdpbkZ1bmN0aW9ufFByb2Nlc3Nvcn0gcGx1Z2luIC0gUG9zdENTUyBwbHVnaW5cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9yIHtAbGluayBQcm9jZXNzb3J9XG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aXRoIHBsdWdpbnNcbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogY29uc3QgcHJvY2Vzc29yID0gcG9zdGNzcygpXG4gICAgICogICAudXNlKGF1dG9wcmVmaXhlcilcbiAgICAgKiAgIC51c2UocHJlY3NzKTtcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge1Byb2Nlc3Nlc30gY3VycmVudCBwcm9jZXNzb3IgdG8gbWFrZSBtZXRob2RzIGNoYWluXG4gICAgICovXG4gICAgdXNlKHBsdWdpbikge1xuICAgICAgICB0aGlzLnBsdWdpbnMgPSB0aGlzLnBsdWdpbnMuY29uY2F0KHRoaXMubm9ybWFsaXplKFtwbHVnaW5dKSk7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFBhcnNlcyBzb3VyY2UgQ1NTIGFuZCByZXR1cm5zIGEge0BsaW5rIExhenlSZXN1bHR9IFByb21pc2UgcHJveHkuXG4gICAgICogQmVjYXVzZSBzb21lIHBsdWdpbnMgY2FuIGJlIGFzeW5jaHJvbm91cyBpdCBkb2VzbuKAmXQgbWFrZVxuICAgICAqIGFueSB0cmFuc2Zvcm1hdGlvbnMuIFRyYW5zZm9ybWF0aW9ucyB3aWxsIGJlIGFwcGxpZWRcbiAgICAgKiBpbiB0aGUge0BsaW5rIExhenlSZXN1bHR9IG1ldGhvZHMuXG4gICAgICpcbiAgICAgKiBAcGFyYW0ge3N0cmluZ3x0b1N0cmluZ3xSZXN1bHR9IGNzcyAtIFN0cmluZyB3aXRoIGlucHV0IENTUyBvclxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW55IG9iamVjdCB3aXRoIGEgYHRvU3RyaW5nKClgXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2QsIGxpa2UgYSBCdWZmZXIuXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPcHRpb25hbGx5LCBzZW5kIGEge0BsaW5rIFJlc3VsdH1cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluc3RhbmNlIGFuZCB0aGUgcHJvY2Vzc29yIHdpbGxcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRha2UgdGhlIHtAbGluayBSb290fSBmcm9tIGl0LlxuICAgICAqIEBwYXJhbSB7cHJvY2Vzc09wdGlvbnN9IFtvcHRzXSAgICAgIC0gb3B0aW9uc1xuICAgICAqXG4gICAgICogQHJldHVybiB7TGF6eVJlc3VsdH0gUHJvbWlzZSBwcm94eVxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiBwcm9jZXNzb3IucHJvY2Vzcyhjc3MsIHsgZnJvbTogJ2EuY3NzJywgdG86ICdhLm91dC5jc3MnIH0pXG4gICAgICogICAudGhlbihyZXN1bHQgPT4ge1xuICAgICAqICAgICAgY29uc29sZS5sb2cocmVzdWx0LmNzcyk7XG4gICAgICogICB9KTtcbiAgICAgKi9cbiAgICBwcm9jZXNzKGNzcywgb3B0cyA9IHsgfSkge1xuICAgICAgICByZXR1cm4gbmV3IExhenlSZXN1bHQodGhpcywgY3NzLCBvcHRzKTtcbiAgICB9XG5cbiAgICBub3JtYWxpemUocGx1Z2lucykge1xuICAgICAgICBsZXQgbm9ybWFsaXplZCA9IFtdO1xuICAgICAgICBmb3IgKCBsZXQgaSBvZiBwbHVnaW5zICkge1xuICAgICAgICAgICAgaWYgKCBpLnBvc3Rjc3MgKSBpID0gaS5wb3N0Y3NzO1xuXG4gICAgICAgICAgICBpZiAoIHR5cGVvZiBpID09PSAnb2JqZWN0JyAmJiBBcnJheS5pc0FycmF5KGkucGx1Z2lucykgKSB7XG4gICAgICAgICAgICAgICAgbm9ybWFsaXplZCA9IG5vcm1hbGl6ZWQuY29uY2F0KGkucGx1Z2lucyk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlb2YgaSA9PT0gJ2Z1bmN0aW9uJyApIHtcbiAgICAgICAgICAgICAgICBub3JtYWxpemVkLnB1c2goaSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCB0eXBlb2YgaSA9PT0gJ29iamVjdCcgJiYgKGkucGFyc2UgfHwgaS5zdHJpbmdpZnkpICkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignUG9zdENTUyBzeW50YXhlcyBjYW5ub3QgYmUgdXNlZCBhcyBwbHVnaW5zLiAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ0luc3RlYWQsIHBsZWFzZSB1c2Ugb25lIG9mIHRoZSAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bnRheC9wYXJzZXIvc3RyaW5naWZpZXIgb3B0aW9ucyBhcyAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ291dGxpbmVkIGluIHlvdXIgUG9zdENTUyAnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3J1bm5lciBkb2N1bWVudGF0aW9uLicpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoaSArICcgaXMgbm90IGEgUG9zdENTUyBwbHVnaW4nKTtcbiAgICAgICAgICAgIH1cbiAgIC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dXNlIGl0IGlzIHVzZWQgaW4gc291cmNlIG1hcFxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZW5lcmF0aW9uIGFuZCBzeW50YXggZXJyb3IgbWVzc2FnZXMuXG4gKiBAcHJvcGVydHkge3N0cmluZ30gdG8gICAgICAgICAgICAgICAtIHRoZSBwYXRoIHdoZXJlIHlvdeKAmWxsIHB1dCB0aGUgb3V0cHV0XG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENTUyBmaWxlLiBZb3Ugc2hvdWxkIGFsd2F5cyBzZXQgYHRvYFxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byBnZW5lcmF0ZSBjb3JyZWN0IHNvdXJjZSBtYXBzLlxuICogQHByb3BlcnR5IHtwYXJzZXJ9IHBhcnNlciAgICAgICAgICAgLSBmdW5jdGlvbiB0byBnZW5lcmF0ZSBBU1QgYnkgc3RyaW5nXG4gKiBAcHJvcGVydHkge3N0cmluZ2lmaWVyfSBzdHJpbmdpZmllciAtIGNsYXNzIHRvIGdlbmVyYXRlIHN0cmluZyBieSBBU1RcbiAqIEBwcm9wZXJ0eSB7c3ludGF4fSBzeW50YXggICAgICAgICAgIC0gb2JqZWN0IHdpdGggYHBhcnNlYCBhbmQgYHN0cmluZ2lmeWBcbiAqIEBwcm9wZXJ0eSB7b2JqZWN0fSBtYXAgICAgICAgICAgICAgIC0gc291cmNlIG1hcCBvcHRpb25zXG4gKiBAcHJvcGVydHkge2Jvb2xlYW59IG1hcC5pbmxpbmUgICAgICAgICAgICAgICAgICAgIC0gZG9lcyBzb3VyY2UgbWFwIHNob3VsZFxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJlIGVtYmVkZGVkIGluIHRoZSBvdXRwdXRcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDU1MgYXMgYSBiYXNlNjQtZW5jb2RlZFxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbW1lbnRcbiAqIEBwcm9wZXJ0eSB7c3RyaW5nfG9iamVjdHxmYWxzZXxmdW5jdGlvbn0gbWFwLnByZXYgLSBzb3VyY2UgbWFwIGNvbnRlbnRcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tIGEgcHJldmlvdXNcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9jZXNzaW5nIHN0ZXBcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZm9yIGV4YW1wbGUsIFNhc3MpLlxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBvc3RDU1Mgd2lsbCB0cnkgdG8gZmluZFxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZXZpb3VzIG1hcFxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1dG9tYXRpY2FsbHksIHNvIHlvdVxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvdWxkIGRpc2FibGUgaXQgYnlcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgZmFsc2VgIHZhbHVlLlxuICogQHByb3BlcnR5IHtib29sZWFufSBtYXAuc291cmNlc0NvbnRlbnQgICAgICAgICAgICAtIGRvZXMgUG9zdENTUyBzaG91bGQgc2V0XG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIG9yaWdpbiBjb250ZW50IHRvIG1hcFxuICogQHByb3BlcnR5IHtzdHJpbmd8ZmFsc2V9IG1hcC5hbm5vdGF0aW9uICAgICAgICAgICAtIGRvZXMgUG9zdENTUyBzaG91bGQgc2V0XG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5ub3RhdGlvbiBjb21tZW50IHRvIG1hcFxuICogQHByb3BlcnR5IHtzdHJpbmd9IG1hcC5mcm9tICAgICAgICAgICAgICAgICAgICAgICAtIG92ZXJyaWRlIGBmcm9tYCBpbiBtYXDigJlzXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYHNvdXJjZXNgXG4gKi9cbiJdfQ==
  21484. /***/ }),
  21485. /* 158 */
  21486. /***/ (function(module, exports, __webpack_require__) {
  21487. "use strict";
  21488. exports.__esModule = true;
  21489. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  21490. var _warning = __webpack_require__(160);
  21491. var _warning2 = _interopRequireDefault(_warning);
  21492. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  21493. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21494. /**
  21495. * Provides the result of the PostCSS transformations.
  21496. *
  21497. * A Result instance is returned by {@link LazyResult#then}
  21498. * or {@link Root#toResult} methods.
  21499. *
  21500. * @example
  21501. * postcss([cssnext]).process(css).then(function (result) {
  21502. * console.log(result.css);
  21503. * });
  21504. *
  21505. * @example
  21506. * var result2 = postcss.parse(css).toResult();
  21507. */
  21508. var Result = function () {
  21509. /**
  21510. * @param {Processor} processor - processor used for this transformation.
  21511. * @param {Root} root - Root node after all transformations.
  21512. * @param {processOptions} opts - options from the {@link Processor#process}
  21513. * or {@link Root#toResult}
  21514. */
  21515. function Result(processor, root, opts) {
  21516. _classCallCheck(this, Result);
  21517. /**
  21518. * @member {Processor} - The Processor instance used
  21519. * for this transformation.
  21520. *
  21521. * @example
  21522. * for ( let plugin of result.processor.plugins) {
  21523. * if ( plugin.postcssPlugin === 'postcss-bad' ) {
  21524. * throw 'postcss-good is incompatible with postcss-bad';
  21525. * }
  21526. * });
  21527. */
  21528. this.processor = processor;
  21529. /**
  21530. * @member {Message[]} - Contains messages from plugins
  21531. * (e.g., warnings or custom messages).
  21532. * Each message should have type
  21533. * and plugin properties.
  21534. *
  21535. * @example
  21536. * postcss.plugin('postcss-min-browser', () => {
  21537. * return (root, result) => {
  21538. * var browsers = detectMinBrowsersByCanIUse(root);
  21539. * result.messages.push({
  21540. * type: 'min-browser',
  21541. * plugin: 'postcss-min-browser',
  21542. * browsers: browsers
  21543. * });
  21544. * };
  21545. * });
  21546. */
  21547. this.messages = [];
  21548. /**
  21549. * @member {Root} - Root node after all transformations.
  21550. *
  21551. * @example
  21552. * root.toResult().root == root;
  21553. */
  21554. this.root = root;
  21555. /**
  21556. * @member {processOptions} - Options from the {@link Processor#process}
  21557. * or {@link Root#toResult} call
  21558. * that produced this Result instance.
  21559. *
  21560. * @example
  21561. * root.toResult(opts).opts == opts;
  21562. */
  21563. this.opts = opts;
  21564. /**
  21565. * @member {string} - A CSS string representing of {@link Result#root}.
  21566. *
  21567. * @example
  21568. * postcss.parse('a{}').toResult().css //=> "a{}"
  21569. */
  21570. this.css = undefined;
  21571. /**
  21572. * @member {SourceMapGenerator} - An instance of `SourceMapGenerator`
  21573. * class from the `source-map` library,
  21574. * representing changes
  21575. * to the {@link Result#root} instance.
  21576. *
  21577. * @example
  21578. * result.map.toJSON() //=> { version: 3, file: 'a.css', … }
  21579. *
  21580. * @example
  21581. * if ( result.map ) {
  21582. * fs.writeFileSync(result.opts.to + '.map', result.map.toString());
  21583. * }
  21584. */
  21585. this.map = undefined;
  21586. }
  21587. /**
  21588. * Returns for @{link Result#css} content.
  21589. *
  21590. * @example
  21591. * result + '' === result.css
  21592. *
  21593. * @return {string} string representing of {@link Result#root}
  21594. */
  21595. Result.prototype.toString = function toString() {
  21596. return this.css;
  21597. };
  21598. /**
  21599. * Creates an instance of {@link Warning} and adds it
  21600. * to {@link Result#messages}.
  21601. *
  21602. * @param {string} text - warning message
  21603. * @param {Object} [opts] - warning options
  21604. * @param {Node} opts.node - CSS node that caused the warning
  21605. * @param {string} opts.word - word in CSS source that caused the warning
  21606. * @param {number} opts.index - index in CSS node string that caused
  21607. * the warning
  21608. * @param {string} opts.plugin - name of the plugin that created
  21609. * this warning. {@link Result#warn} fills
  21610. * this property automatically.
  21611. *
  21612. * @return {Warning} created warning
  21613. */
  21614. Result.prototype.warn = function warn(text) {
  21615. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  21616. if (!opts.plugin) {
  21617. if (this.lastPlugin && this.lastPlugin.postcssPlugin) {
  21618. opts.plugin = this.lastPlugin.postcssPlugin;
  21619. }
  21620. }
  21621. var warning = new _warning2.default(text, opts);
  21622. this.messages.push(warning);
  21623. return warning;
  21624. };
  21625. /**
  21626. * Returns warnings from plugins. Filters {@link Warning} instances
  21627. * from {@link Result#messages}.
  21628. *
  21629. * @example
  21630. * result.warnings().forEach(warn => {
  21631. * console.warn(warn.toString());
  21632. * });
  21633. *
  21634. * @return {Warning[]} warnings from plugins
  21635. */
  21636. Result.prototype.warnings = function warnings() {
  21637. return this.messages.filter(function (i) {
  21638. return i.type === 'warning';
  21639. });
  21640. };
  21641. /**
  21642. * An alias for the {@link Result#css} property.
  21643. * Use it with syntaxes that generate non-CSS output.
  21644. * @type {string}
  21645. *
  21646. * @example
  21647. * result.css === result.content;
  21648. */
  21649. _createClass(Result, [{
  21650. key: 'content',
  21651. get: function get() {
  21652. return this.css;
  21653. }
  21654. }]);
  21655. return Result;
  21656. }();
  21657. exports.default = Result;
  21658. /**
  21659. * @typedef {object} Message
  21660. * @property {string} type - message type
  21661. * @property {string} plugin - source PostCSS plugin name
  21662. */
  21663. module.exports = exports['default'];
  21664. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJlc3VsdC5lczYiXSwibmFtZXMiOlsiUmVzdWx0IiwicHJvY2Vzc29yIiwicm9vdCIsIm9wdHMiLCJtZXNzYWdlcyIsImNzcyIsInVuZGVmaW5lZCIsIm1hcCIsInRvU3RyaW5nIiwid2FybiIsInRleHQiLCJwbHVnaW4iLCJsYXN0UGx1Z2luIiwicG9zdGNzc1BsdWdpbiIsIndhcm5pbmciLCJwdXNoIiwid2FybmluZ3MiLCJmaWx0ZXIiLCJpIiwidHlwZSJdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUE7Ozs7Ozs7O0FBRUE7Ozs7Ozs7Ozs7Ozs7O0lBY01BLE07O0FBRUY7Ozs7OztBQU1BLGtCQUFZQyxTQUFaLEVBQXVCQyxJQUF2QixFQUE2QkMsSUFBN0IsRUFBbUM7QUFBQTs7QUFDL0I7Ozs7Ozs7Ozs7O0FBV0EsU0FBS0YsU0FBTCxHQUFpQkEsU0FBakI7QUFDQTs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBa0JBLFNBQUtHLFFBQUwsR0FBZ0IsRUFBaEI7QUFDQTs7Ozs7O0FBTUEsU0FBS0YsSUFBTCxHQUFZQSxJQUFaO0FBQ0E7Ozs7Ozs7O0FBUUEsU0FBS0MsSUFBTCxHQUFZQSxJQUFaO0FBQ0E7Ozs7OztBQU1BLFNBQUtFLEdBQUwsR0FBV0MsU0FBWDtBQUNBOzs7Ozs7Ozs7Ozs7OztBQWNBLFNBQUtDLEdBQUwsR0FBV0QsU0FBWDtBQUNIOztBQUVEOzs7Ozs7Ozs7O21CQVFBRSxRLHVCQUFXO0FBQ1AsV0FBTyxLQUFLSCxHQ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zc1BsdWdpbiA9PT0gJ3Bvc3Rjc3MtYmFkJyApIHtcbiAgICAgICAgICogICAgIHRocm93ICdwb3N0Y3NzLWdvb2QgaXMgaW5jb21wYXRpYmxlIHdpdGggcG9zdGNzcy1iYWQnO1xuICAgICAgICAgKiAgIH1cbiAgICAgICAgICogfSk7XG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnByb2Nlc3NvciA9IHByb2Nlc3NvcjtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge01lc3NhZ2VbXX0gLSBDb250YWlucyBtZXNzYWdlcyBmcm9tIHBsdWdpbnNcbiAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgIChlLmcuLCB3YXJuaW5ncyBvciBjdXN0b20gbWVzc2FnZXMpLlxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgRWFjaCBtZXNzYWdlIHNob3VsZCBoYXZlIHR5cGVcbiAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgIGFuZCBwbHVnaW4gcHJvcGVydGllcy5cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogcG9zdGNzcy5wbHVnaW4oJ3Bvc3Rjc3MtbWluLWJyb3dzZXInLCAoKSA9PiB7XG4gICAgICAgICAqICAgcmV0dXJuIChyb290LCByZXN1bHQpID0+IHtcbiAgICAgICAgICogICAgIHZhciBicm93c2VycyA9IGRldGVjdE1pbkJyb3dzZXJzQnlDYW5JVXNlKHJvb3QpO1xuICAgICAgICAgKiAgICAgcmVzdWx0Lm1lc3NhZ2VzLnB1c2goe1xuICAgICAgICAgKiAgICAgICB0eXBlOiAgICAnbWluLWJyb3dzZXInLFxuICAgICAgICAgKiAgICAgICBwbHVnaW46ICAncG9zdGNzcy1taW4tYnJvd3NlcicsXG4gICAgICAgICAqICAgICAgIGJyb3dzZXJzOiBicm93c2Vyc1xuICAgICAgICAgKiAgICAgfSk7XG4gICAgICAgICAqICAgfTtcbiAgICAgICAgICogfSk7XG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLm1lc3NhZ2VzID0gW107XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtSb290fSAtIFJvb3Qgbm9kZSBhZnRlciBhbGwgdHJhbnNmb3JtYXRpb25zLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgKiByb290LnRvUmVzdWx0KCkucm9vdCA9PSByb290O1xuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5yb290ID0gcm9vdDtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge3Byb2Nlc3NPcHRpb25zfSAtIE9wdGlvbnMgZnJvbSB0aGUge0BsaW5rIFByb2Nlc3NvciNwcm9jZXNzfVxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvciB7QGxpbmsgUm9vdCN0b1Jlc3VsdH0gY2FsbFxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGF0IHByb2R1Y2VkIHRoaXMgUmVzdWx0IGluc3RhbmNlLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgKiByb290LnRvUmVzdWx0KG9wdHMpLm9wdHMgPT0gb3B0cztcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMub3B0cyA9IG9wdHM7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtzdHJpbmd9IC0gQSBDU1Mgc3RyaW5nIHJlcHJlc2VudGluZyBvZiB7QGxpbmsgUmVzdWx0I3Jvb3R9LlxuICAgICAgICAgKlxuICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgKiBwb3N0Y3NzLnBhcnNlKCdhe30nKS50b1Jlc3VsdCgpLmNzcyAvLz0+IFwiYXt9XCJcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuY3NzID0gdW5kZWZpbmVkO1xuICAgICAgICAvKipcbiAgICAgICAgICogQG1lbWJlciB7U291cmNlTWFwR2VuZXJhdG9yfSAtIEFuIGluc3RhbmNlIG9mIGBTb3VyY2VNYXBHZW5lcmF0b3JgXG4gICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzcyBmcm9tIHRoZSBgc291cmNlLW1hcGAgbGlicmFyeSxcbiAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcHJlc2VudGluZyBjaGFuZ2VzXG4gICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byB0aGUge0BsaW5rIFJlc3VsdCNyb290fSBpbnN0YW5jZS5cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogcmVzdWx0Lm1hcC50b0pTT04oKSAvLz0+IHsgdmVyc2lvbjogMywgZmlsZTogJ2EuY3NzJywg4oCmIH1cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogaWYgKCByZXN1bHQubWFwICkge1xuICAgICAgICAgKiAgIGZzLndyaXRlRmlsZVN5bmMocmVzdWx0Lm9wdHMudG8gKyAnLm1hcCcsIHJlc3VsdC5tYXAudG9TdHJpbmcoKSk7XG4gICAgICAgICAqIH1cbiAgICAgICAgICovXG4gICAgICAgIHRoaXMubWFwID0gdW5kZWZpbmVkO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFJldHVybnMgZm9yIEB7bGluayBSZXN1bHQjY3NzfSBjb250ZW50LlxuICAgICAqXG4gICAgICogQGV4YW1wbGVcbiAgICAgKiByZXN1bHQgKyAnJyA9PT0gcmVzdWx0LmNzc1xuICAgICAqXG4gICAgICogQHJldHVybiB7c3RyaW5nfSBzdHJpbmcgcmVwcmVzZW50aW5nIG9mIHtAbGluayBSZXN1bHQjcm9vdH1cbiAgICAgKi9cbiAgICB0b1N0cmluZygpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuY3NzO1xuICAgIH1cblxuICAgIC8qKlxuICAgIC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y5sYXN0UGx1Z2luICYmIHRoaXMubGFzdFBsdWdpbi5wb3N0Y3NzUGx1Z2luICkge1xuICAgICAgICAgICAgICAgIG9wdHMucGx1Z2luID0gdGhpcy5sYXN0UGx1Z2luLnBvc3Rjc3NQbHVnaW47XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgd2FybmluZyA9IG5ldyBXYXJuaW5nKHRleHQsIG9wdHMpO1xuICAgICAgICB0aGlzLm1lc3NhZ2VzLnB1c2god2FybmluZyk7XG5cbiAgICAgICAgcmV0dXJuIHdhcm5pbmc7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogUmV0dXJucyB3YXJuaW5ncyBmcm9tIHBsdWdpbnMuIEZpbHRlcnMge0BsaW5rIFdhcm5pbmd9IGluc3RhbmNlc1xuICAgICAqIGZyb20ge0BsaW5rIFJlc3VsdCNtZXNzYWdlc30uXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHJlc3VsdC53YXJuaW5ncygpLmZvckVhY2god2FybiA9PiB7XG4gICAgICogICBjb25zb2xlLndhcm4od2Fybi50b1N0cmluZygpKTtcbiAgICAgKiB9KTtcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge1dhcm5pbmdbXX0gd2FybmluZ3MgZnJvbSBwbHVnaW5zXG4gICAgICovXG4gICAgd2FybmluZ3MoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1lc3NhZ2VzLmZpbHRlciggaSA9PiBpLnR5cGUgPT09ICd3YXJuaW5nJyApO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEFuIGFsaWFzIGZvciB0aGUge0BsaW5rIFJlc3VsdCNjc3N9IHByb3BlcnR5LlxuICAgICAqIFVzZSBpdCB3aXRoIHN5bnRheGVzIHRoYXQgZ2VuZXJhdGUgbm9uLUNTUyBvdXRwdXQuXG4gICAgICogQHR5cGUge3N0cmluZ31cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogcmVzdWx0LmNzcyA9PT0gcmVzdWx0LmNvbnRlbnQ7XG4gICAgICovXG4gICAgZ2V0IGNvbnRlbnQoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmNzcztcbiAgICB9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgUmVzdWx0O1xuXG4vKipcbiAqIEB0eXBlZGVmICB7b2JqZWN0fSBNZXNzYWdlXG4gKiBAcHJvcGVydHkge3N0cmluZ30gdHlwZSAgIC0gbWVzc2FnZSB0eXBlXG4gKiBAcHJvcGVydHkge3N0cmluZ30gcGx1Z2luIC0gc291cmNlIFBvc3RDU1MgcGx1Z2luIG5hbWVcbiAqL1xuIl19
  21665. /***/ }),
  21666. /* 159 */
  21667. /***/ (function(module, exports, __webpack_require__) {
  21668. "use strict";
  21669. exports.__esModule = true;
  21670. var _chalk = __webpack_require__(82);
  21671. var _chalk2 = _interopRequireDefault(_chalk);
  21672. var _tokenize = __webpack_require__(81);
  21673. var _tokenize2 = _interopRequireDefault(_tokenize);
  21674. var _input = __webpack_require__(26);
  21675. var _input2 = _interopRequireDefault(_input);
  21676. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  21677. var colors = new _chalk2.default.constructor({ enabled: true });
  21678. var HIGHLIGHT_THEME = {
  21679. 'brackets': colors.cyan,
  21680. 'at-word': colors.cyan,
  21681. 'call': colors.cyan,
  21682. 'comment': colors.gray,
  21683. 'string': colors.green,
  21684. 'class': colors.yellow,
  21685. 'hash': colors.magenta,
  21686. '(': colors.cyan,
  21687. ')': colors.cyan,
  21688. '{': colors.yellow,
  21689. '}': colors.yellow,
  21690. '[': colors.yellow,
  21691. ']': colors.yellow,
  21692. ':': colors.yellow,
  21693. ';': colors.yellow
  21694. };
  21695. function getTokenType(_ref, index, tokens) {
  21696. var type = _ref[0],
  21697. value = _ref[1];
  21698. if (type === 'word') {
  21699. if (value[0] === '.') {
  21700. return 'class';
  21701. }
  21702. if (value[0] === '#') {
  21703. return 'hash';
  21704. }
  21705. }
  21706. var nextToken = tokens[index + 1];
  21707. if (nextToken && (nextToken[0] === 'brackets' || nextToken[0] === '(')) {
  21708. return 'call';
  21709. }
  21710. return type;
  21711. }
  21712. function terminalHighlight(css) {
  21713. var tokens = (0, _tokenize2.default)(new _input2.default(css), { ignoreErrors: true });
  21714. return tokens.map(function (token, index) {
  21715. var color = HIGHLIGHT_THEME[getTokenType(token, index, tokens)];
  21716. if (color) {
  21717. return token[1].split(/\r?\n/).map(function (i) {
  21718. return color(i);
  21719. }).join('\n');
  21720. } else {
  21721. return token[1];
  21722. }
  21723. }).join('');
  21724. }
  21725. exports.default = terminalHighlight;
  21726. module.exports = exports['default'];
  21727. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlcm1pbmFsLWhpZ2hsaWdodC5lczYiXSwibmFtZXMiOlsiY29sb3JzIiwiY29uc3RydWN0b3IiLCJlbmFibGVkIiwiSElHSExJR0hUX1RIRU1FIiwiY3lhbiIsImdyYXkiLCJncmVlbiIsInllbGxvdyIsIm1hZ2VudGEiLCJnZXRUb2tlblR5cGUiLCJpbmRleCIsInRva2VucyIsInR5cGUiLCJ2YWx1ZSIsIm5leHRUb2tlbiIsInRlcm1pbmFsSGlnaGxpZ2h0IiwiY3NzIiwiaWdub3JlRXJyb3JzIiwibWFwIiwidG9rZW4iLCJjb2xvciIsInNwbGl0IiwiaSIsImpvaW4iXSwibWFwcGluZ3MiOiI7Ozs7QUFBQTs7OztBQUVBOzs7O0FBQ0E7Ozs7OztBQUVBLElBQUlBLFNBQVMsSUFBSSxnQkFBTUMsV0FBVixDQUFzQixFQUFFQyxTQUFTLElBQVgsRUFBdEIsQ0FBYjs7QUFFQSxJQUFNQyxrQkFBa0I7QUFDcEIsZ0JBQVlILE9BQU9JLElBREM7QUFFcEIsZUFBWUosT0FBT0ksSUFGQztBQUdwQixZQUFZSixPQUFPSSxJQUhDO0FBSXBCLGVBQVlKLE9BQU9LLElB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oJzogICAgICAgIGNvbG9ycy5jeWFuLFxuICAgICcpJzogICAgICAgIGNvbG9ycy5jeWFuLFxuICAgICd7JzogICAgICAgIGNvbG9ycy55ZWxsb3csXG4gICAgJ30nOiAgICAgICAgY29sb3JzLnllbGxvdyxcbiAgICAnWyc6ICAgICAgICBjb2xvcnMueWVsbG93LFxuICAgICddJzogICAgICAgIGNvbG9ycy55ZWxsb3csXG4gICAgJzonOiAgICAgICAgY29sb3JzLnllbGxvdyxcbiAgICAnOyc6ICAgICAgICBjb2xvcnMueWVsbG93XG59O1xuXG5mdW5jdGlvbiBnZXRUb2tlblR5cGUoW3R5cGUsIHZhbHVlXSwgaW5kZXgsIHRva2Vucykge1xuICAgIGlmICh0eXBlID09PSAnd29yZCcpIHtcbiAgICAgICAgaWYgKHZhbHVlWzBdID09PSAnLicpIHtcbiAgICAgICAgICAgIHJldHVybiAnY2xhc3MnO1xuICAgICAgICB9XG4gICAgICAgIGlmICh2YWx1ZVswXSA9PT0gJyMnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2hhc2gnO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgbGV0IG5leHRUb2tlbiA9IHRva2Vuc1tpbmRleCArIDFdO1xuICAgIGlmIChuZXh0VG9rZW4gJiYgKG5leHRUb2tlblswXSA9PT0gJ2JyYWNrZXRzJyB8fCBuZXh0VG9rZW5bMF0gPT09ICcoJykpIHtcbiAgICAgICAgcmV0dXJuICdjYWxsJztcbiAgICB9XG5cbiAgICByZXR1cm4gdHlwZTtcbn1cblxuZnVuY3Rpb24gdGVybWluYWxIaWdobGlnaHQoY3NzKSB7XG4gICAgbGV0IHRva2VucyA9IHRva2VuaXplKG5ldyBJbnB1dChjc3MpLCB7IGlnbm9yZUVycm9yczogdHJ1ZSB9KTtcbiAgICByZXR1cm4gdG9rZW5zLm1hcCgodG9rZW4sIGluZGV4KSA9PiB7XG4gICAgICAgIGxldCBjb2xvciA9IEhJR0hMSUdIVF9USEVNRVtnZXRUb2tlblR5cGUodG9rZW4sIGluZGV4LCB0b2tlbnMpXTtcbiAgICAgICAgaWYgKCBjb2xvciApIHtcbiAgICAgICAgICAgIHJldHVybiB0b2tlblsxXS5zcGxpdCgvXFxyP1xcbi8pXG4gICAgICAgICAgICAgIC5tYXAoIGkgPT4gY29sb3IoaSkgKVxuICAgICAgICAgICAgICAuam9pbignXFxuJyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXR1cm4gdG9rZW5bMV07XG4gICAgICAgIH1cbiAgICB9KS5qb2luKCcnKTtcbn1cblxuZXhwb3J0IGRlZmF1bHQgdGVybWluYWxIaWdobGlnaHQ7XG4iXX0=
  21728. /***/ }),
  21729. /* 160 */
  21730. /***/ (function(module, exports, __webpack_require__) {
  21731. "use strict";
  21732. exports.__esModule = true;
  21733. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21734. /**
  21735. * Represents a plugin’s warning. It can be created using {@link Node#warn}.
  21736. *
  21737. * @example
  21738. * if ( decl.important ) {
  21739. * decl.warn(result, 'Avoid !important', { word: '!important' });
  21740. * }
  21741. */
  21742. var Warning = function () {
  21743. /**
  21744. * @param {string} text - warning message
  21745. * @param {Object} [opts] - warning options
  21746. * @param {Node} opts.node - CSS node that caused the warning
  21747. * @param {string} opts.word - word in CSS source that caused the warning
  21748. * @param {number} opts.index - index in CSS node string that caused
  21749. * the warning
  21750. * @param {string} opts.plugin - name of the plugin that created
  21751. * this warning. {@link Result#warn} fills
  21752. * this property automatically.
  21753. */
  21754. function Warning(text) {
  21755. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  21756. _classCallCheck(this, Warning);
  21757. /**
  21758. * @member {string} - Type to filter warnings from
  21759. * {@link Result#messages}. Always equal
  21760. * to `"warning"`.
  21761. *
  21762. * @example
  21763. * const nonWarning = result.messages.filter(i => i.type !== 'warning')
  21764. */
  21765. this.type = 'warning';
  21766. /**
  21767. * @member {string} - The warning message.
  21768. *
  21769. * @example
  21770. * warning.text //=> 'Try to avoid !important'
  21771. */
  21772. this.text = text;
  21773. if (opts.node && opts.node.source) {
  21774. var pos = opts.node.positionBy(opts);
  21775. /**
  21776. * @member {number} - Line in the input file
  21777. * with this warning’s source
  21778. *
  21779. * @example
  21780. * warning.line //=> 5
  21781. */
  21782. this.line = pos.line;
  21783. /**
  21784. * @member {number} - Column in the input file
  21785. * with this warning’s source.
  21786. *
  21787. * @example
  21788. * warning.column //=> 6
  21789. */
  21790. this.column = pos.column;
  21791. }
  21792. for (var opt in opts) {
  21793. this[opt] = opts[opt];
  21794. }
  21795. }
  21796. /**
  21797. * Returns a warning position and message.
  21798. *
  21799. * @example
  21800. * warning.toString() //=> 'postcss-lint:a.css:10:14: Avoid !important'
  21801. *
  21802. * @return {string} warning position and message
  21803. */
  21804. Warning.prototype.toString = function toString() {
  21805. if (this.node) {
  21806. return this.node.error(this.text, {
  21807. plugin: this.plugin,
  21808. index: this.index,
  21809. word: this.word
  21810. }).message;
  21811. } else if (this.plugin) {
  21812. return this.plugin + ': ' + this.text;
  21813. } else {
  21814. return this.text;
  21815. }
  21816. };
  21817. /**
  21818. * @memberof Warning#
  21819. * @member {string} plugin - The name of the plugin that created
  21820. * it will fill this property automatically.
  21821. * this warning. When you call {@link Node#warn}
  21822. *
  21823. * @example
  21824. * warning.plugin //=> 'postcss-important'
  21825. */
  21826. /**
  21827. * @memberof Warning#
  21828. * @member {Node} node - Contains the CSS node that caused the warning.
  21829. *
  21830. * @example
  21831. * warning.node.toString() //=> 'color: white !important'
  21832. */
  21833. return Warning;
  21834. }();
  21835. exports.default = Warning;
  21836. module.exports = exports['default'];
  21837. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndhcm5pbmcuZXM2Il0sIm5hbWVzIjpbIldhcm5pbmciLCJ0ZXh0Iiwib3B0cyIsInR5cGUiLCJub2RlIiwic291cmNlIiwicG9zIiwicG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gICAgICAgICAgICAgICAgICAgICAgIHRoZSB3YXJuaW5nXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IG9wdHMucGx1Z2luIC0gbmFtZSBvZiB0aGUgcGx1Z2luIHRoYXQgY3JlYXRlZFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMgd2FybmluZy4ge0BsaW5rIFJlc3VsdCN3YXJufSBmaWxsc1xuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMgcHJvcGVydHkgYXV0b21hdGljYWxseS5cbiAgICAgKi9cbiAgICBjb25zdHJ1Y3Rvcih0ZXh0LCBvcHRzID0geyB9KSB7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtzdHJpbmd9IC0gVHlwZSB0byBmaWx0ZXIgd2FybmluZ3MgZnJvbVxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAge0BsaW5rIFJlc3VsdCNtZXNzYWdlc30uIEFsd2F5cyBlcXVhbFxuICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgdG8gYFwid2FybmluZ1wiYC5cbiAgICAgICAgICpcbiAgICAgICAgICogQGV4YW1wbGVcbiAgICAgICAgICogY29uc3Qgbm9uV2FybmluZyA9IHJlc3VsdC5tZXNzYWdlcy5maWx0ZXIoaSA9PiBpLnR5cGUgIT09ICd3YXJuaW5nJylcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMudHlwZSA9ICd3YXJuaW5nJztcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge3N0cmluZ30gLSBUaGUgd2FybmluZyBtZXNzYWdlLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgKiB3YXJuaW5nLnRleHQgLy89PiAnVHJ5IHRvIGF2b2lkICFpbXBvcnRhbnQnXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnRleHQgPSB0ZXh0O1xuXG4gICAgICAgIGlmICggb3B0cy5ub2RlICYmIG9wdHMubm9kZS5zb3VyY2UgKSB7XG4gICAgICAgICAgICBsZXQgcG9zICAgICA9IG9wdHMubm9kZS5wb3NpdGlvbkJ5KG9wdHMpO1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBAbWVtYmVyIHtudW1iZXJ9IC0gTGluZSBpbiB0aGUgaW5wdXQgZmlsZVxuICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgIHdpdGggdGhpcyB3YXJuaW5n4oCZcyBzb3VyY2VcbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgICAgICogd2FybmluZy5saW5lIC8vPT4gNVxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICB0aGlzLmxpbmUgICA9IHBvcy5saW5lO1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBAbWVtYmVyIHtudW1iZXJ9IC0gQ29sdW1uIGluIHRoZSBpbnB1dCBmaWxlXG4gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgd2l0aCB0aGlzIHdhcm5pbmfigJlzIHNvdXJjZS5cbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAZXhhbXBsZVxuICAgICAgICAgICAgICogd2FybmluZy5jb2x1bW4gLy89PiA2XG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIHRoaXMuY29sdW1uID0gcG9zLmNvbHVtbjtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAoIGxldCBvcHQgaW4gb3B0cyApIHRoaXNbb3B0XSA9IG9wdHNbb3B0XTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBSZXR1cm5zIGEgd2FybmluZyBwb3NpdGlvbiBhbmQgbWVzc2FnZS5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogd2FybmluZy50b1N0cmluZygpIC8vPT4gJ3Bvc3Rjc3MtbGludDphLmNzczoxMDoxNDogQXZvaWQgIWltcG9ydGFudCdcbiAgICAgKlxuICAgICAqIEByZXR1cm4ge3N0cmluZ30gd2FybmluZyBwb3NpdGlvbiBhbmQgbWVzc2FnZVxuICAgICAqL1xuICAgIHRvU3RyaW5nKCkge1xuICAgICAgICBpZiAoIHRoaXMubm9kZSApIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm5vZGUuZXJyb3IodGhpcy50ZXh0LCB7XG4gICAgICAgICAgICAgICAgcGx1Z2luOiB0aGlzLnBsdWdpbixcbiAgICAgICAgICAgICAgICBpbmRleDogIHRoaXMuaW5kZXgsXG4gICAgICAgICAgICAgICAgd29yZDogICB0aGlzLndvcmRcbiAgICAgICAgICAgIH0pLm1lc3NhZ2U7XG4gICAgICAgIH0gZWxzZSBpZiAoIHRoaXMucGx1Z2luICkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMucGx1Z2luICsgJzogJyArIHRoaXMudGV4dDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnRleHQ7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBAbWVtYmVyb2YgV2FybmluZyNcbiAgICAgKiBAbWVtYmVyIHtzdHJpbmd9IHBsdWdpbiAtIFRoZSBuYW1lIG9mIHRoZSBwbHVnaW4gdGhhdCBjcmVhdGVkXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICBpdCB3aWxsIGZpbGwgdGhpcyBwcm9wZXJ0eSBhdXRvbWF0aWNhbGx5LlxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcyB3YXJuaW5nLiBXaGVuIHlvdSBjYWxsIHtAbGluayBOb2RlI3dhcm59XG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIHdhcm5pbmcucGx1Z2luIC8vPT4gJ3Bvc3Rjc3MtaW1wb3J0YW50J1xuICAgICAqL1xuXG4gICAgLyoqXG4gICAgICogQG1lbWJlcm9mIFdhcm5pbmcjXG4gICAgICogQG1lbWJlciB7Tm9kZX0gbm9kZSAtIENvbnRhaW5zIHRoZSBDU1Mgbm9kZSB0aGF0IGNhdXNlZCB0aGUgd2FybmluZy5cbiAgICAgKlxuICAgICAqIEBleGFtcGxlXG4gICAgICogd2FybmluZy5ub2RlLnRvU3RyaW5nKCkgLy89PiAnY29sb3I6IHdoaXRlICFpbXBvcnRhbnQnXG4gICAgICovXG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgV2FybmluZztcbiJdfQ==
  21838. /***/ }),
  21839. /* 161 */
  21840. /***/ (function(module, exports, __webpack_require__) {
  21841. "use strict";
  21842. /* WEBPACK VAR INJECTION */(function(module) {
  21843. function assembleStyles () {
  21844. var styles = {
  21845. modifiers: {
  21846. reset: [0, 0],
  21847. bold: [1, 22], // 21 isn't widely supported and 22 does the same thing
  21848. dim: [2, 22],
  21849. italic: [3, 23],
  21850. underline: [4, 24],
  21851. inverse: [7, 27],
  21852. hidden: [8, 28],
  21853. strikethrough: [9, 29]
  21854. },
  21855. colors: {
  21856. black: [30, 39],
  21857. red: [31, 39],
  21858. green: [32, 39],
  21859. yellow: [33, 39],
  21860. blue: [34, 39],
  21861. magenta: [35, 39],
  21862. cyan: [36, 39],
  21863. white: [37, 39],
  21864. gray: [90, 39]
  21865. },
  21866. bgColors: {
  21867. bgBlack: [40, 49],
  21868. bgRed: [41, 49],
  21869. bgGreen: [42, 49],
  21870. bgYellow: [43, 49],
  21871. bgBlue: [44, 49],
  21872. bgMagenta: [45, 49],
  21873. bgCyan: [46, 49],
  21874. bgWhite: [47, 49]
  21875. }
  21876. };
  21877. // fix humans
  21878. styles.colors.grey = styles.colors.gray;
  21879. Object.keys(styles).forEach(function (groupName) {
  21880. var group = styles[groupName];
  21881. Object.keys(group).forEach(function (styleName) {
  21882. var style = group[styleName];
  21883. styles[styleName] = group[styleName] = {
  21884. open: '\u001b[' + style[0] + 'm',
  21885. close: '\u001b[' + style[1] + 'm'
  21886. };
  21887. });
  21888. Object.defineProperty(styles, groupName, {
  21889. value: group,
  21890. enumerable: false
  21891. });
  21892. });
  21893. return styles;
  21894. }
  21895. Object.defineProperty(module, 'exports', {
  21896. enumerable: true,
  21897. get: assembleStyles
  21898. });
  21899. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(174)(module)))
  21900. /***/ }),
  21901. /* 162 */
  21902. /***/ (function(module, exports, __webpack_require__) {
  21903. "use strict";
  21904. /* WEBPACK VAR INJECTION */(function(process) {
  21905. var argv = process.argv;
  21906. var terminator = argv.indexOf('--');
  21907. var hasFlag = function (flag) {
  21908. flag = '--' + flag;
  21909. var pos = argv.indexOf(flag);
  21910. return pos !== -1 && (terminator !== -1 ? pos < terminator : true);
  21911. };
  21912. module.exports = (function () {
  21913. if ('FORCE_COLOR' in process.env) {
  21914. return true;
  21915. }
  21916. if (hasFlag('no-color') ||
  21917. hasFlag('no-colors') ||
  21918. hasFlag('color=false')) {
  21919. return false;
  21920. }
  21921. if (hasFlag('color') ||
  21922. hasFlag('colors') ||
  21923. hasFlag('color=true') ||
  21924. hasFlag('color=always')) {
  21925. return true;
  21926. }
  21927. if (process.stdout && !process.stdout.isTTY) {
  21928. return false;
  21929. }
  21930. if (process.platform === 'win32') {
  21931. return true;
  21932. }
  21933. if ('COLORTERM' in process.env) {
  21934. return true;
  21935. }
  21936. if (process.env.TERM === 'dumb') {
  21937. return false;
  21938. }
  21939. if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
  21940. return true;
  21941. }
  21942. return false;
  21943. })();
  21944. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(14)))
  21945. /***/ }),
  21946. /* 163 */
  21947. /***/ (function(module, exports, __webpack_require__) {
  21948. "use strict";
  21949. var ansiRegex = __webpack_require__(32)();
  21950. module.exports = function (str) {
  21951. return typeof str === 'string' ? str.replace(ansiRegex, '') : str;
  21952. };
  21953. /***/ }),
  21954. /* 164 */
  21955. /***/ (function(module, exports) {
  21956. /* -*- Mode: js; js-indent-level: 2; -*- */
  21957. /*
  21958. * Copyright 2011 Mozilla Foundation and contributors
  21959. * Licensed under the New BSD license. See LICENSE or:
  21960. * http://opensource.org/licenses/BSD-3-Clause
  21961. */
  21962. var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
  21963. /**
  21964. * Encode an integer in the range of 0 to 63 to a single base 64 digit.
  21965. */
  21966. exports.encode = function (number) {
  21967. if (0 <= number && number < intToCharMap.length) {
  21968. return intToCharMap[number];
  21969. }
  21970. throw new TypeError("Must be between 0 and 63: " + number);
  21971. };
  21972. /**
  21973. * Decode a single base 64 character code digit to an integer. Returns -1 on
  21974. * failure.
  21975. */
  21976. exports.decode = function (charCode) {
  21977. var bigA = 65; // 'A'
  21978. var bigZ = 90; // 'Z'
  21979. var littleA = 97; // 'a'
  21980. var littleZ = 122; // 'z'
  21981. var zero = 48; // '0'
  21982. var nine = 57; // '9'
  21983. var plus = 43; // '+'
  21984. var slash = 47; // '/'
  21985. var littleOffset = 26;
  21986. var numberOffset = 52;
  21987. // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  21988. if (bigA <= charCode && charCode <= bigZ) {
  21989. return (charCode - bigA);
  21990. }
  21991. // 26 - 51: abcdefghijklmnopqrstuvwxyz
  21992. if (littleA <= charCode && charCode <= littleZ) {
  21993. return (charCode - littleA + littleOffset);
  21994. }
  21995. // 52 - 61: 0123456789
  21996. if (zero <= charCode && charCode <= nine) {
  21997. return (charCode - zero + numberOffset);
  21998. }
  21999. // 62: +
  22000. if (charCode == plus) {
  22001. return 62;
  22002. }
  22003. // 63: /
  22004. if (charCode == slash) {
  22005. return 63;
  22006. }
  22007. // Invalid base64 digit.
  22008. return -1;
  22009. };
  22010. /***/ }),
  22011. /* 165 */
  22012. /***/ (function(module, exports) {
  22013. /* -*- Mode: js; js-indent-level: 2; -*- */
  22014. /*
  22015. * Copyright 2011 Mozilla Foundation and contributors
  22016. * Licensed under the New BSD license. See LICENSE or:
  22017. * http://opensource.org/licenses/BSD-3-Clause
  22018. */
  22019. exports.GREATEST_LOWER_BOUND = 1;
  22020. exports.LEAST_UPPER_BOUND = 2;
  22021. /**
  22022. * Recursive implementation of binary search.
  22023. *
  22024. * @param aLow Indices here and lower do not contain the needle.
  22025. * @param aHigh Indices here and higher do not contain the needle.
  22026. * @param aNeedle The element being searched for.
  22027. * @param aHaystack The non-empty array being searched.
  22028. * @param aCompare Function which takes two elements and returns -1, 0, or 1.
  22029. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
  22030. * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
  22031. * closest element that is smaller than or greater than the one we are
  22032. * searching for, respectively, if the exact element cannot be found.
  22033. */
  22034. function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
  22035. // This function terminates when one of the following is true:
  22036. //
  22037. // 1. We find the exact element we are looking for.
  22038. //
  22039. // 2. We did not find the exact element, but we can return the index of
  22040. // the next-closest element.
  22041. //
  22042. // 3. We did not find the exact element, and there is no next-closest
  22043. // element than the one we are searching for, so we return -1.
  22044. var mid = Math.floor((aHigh - aLow) / 2) + aLow;
  22045. var cmp = aCompare(aNeedle, aHaystack[mid], true);
  22046. if (cmp === 0) {
  22047. // Found the element we are looking for.
  22048. return mid;
  22049. }
  22050. else if (cmp > 0) {
  22051. // Our needle is greater than aHaystack[mid].
  22052. if (aHigh - mid > 1) {
  22053. // The element is in the upper half.
  22054. return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
  22055. }
  22056. // The exact needle element was not found in this haystack. Determine if
  22057. // we are in termination case (3) or (2) and return the appropriate thing.
  22058. if (aBias == exports.LEAST_UPPER_BOUND) {
  22059. return aHigh < aHaystack.length ? aHigh : -1;
  22060. } else {
  22061. return mid;
  22062. }
  22063. }
  22064. else {
  22065. // Our needle is less than aHaystack[mid].
  22066. if (mid - aLow > 1) {
  22067. // The element is in the lower half.
  22068. return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
  22069. }
  22070. // we are in termination case (3) or (2) and return the appropriate thing.
  22071. if (aBias == exports.LEAST_UPPER_BOUND) {
  22072. return mid;
  22073. } else {
  22074. return aLow < 0 ? -1 : aLow;
  22075. }
  22076. }
  22077. }
  22078. /**
  22079. * This is an implementation of binary search which will always try and return
  22080. * the index of the closest element if there is no exact hit. This is because
  22081. * mappings between original and generated line/col pairs are single points,
  22082. * and there is an implicit region between each of them, so a miss just means
  22083. * that you aren't on the very start of a region.
  22084. *
  22085. * @param aNeedle The element you are looking for.
  22086. * @param aHaystack The array that is being searched.
  22087. * @param aCompare A function which takes the needle and an element in the
  22088. * array and returns -1, 0, or 1 depending on whether the needle is less
  22089. * than, equal to, or greater than the element, respectively.
  22090. * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
  22091. * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
  22092. * closest element that is smaller than or greater than the one we are
  22093. * searching for, respectively, if the exact element cannot be found.
  22094. * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
  22095. */
  22096. exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
  22097. if (aHaystack.length === 0) {
  22098. return -1;
  22099. }
  22100. var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
  22101. aCompare, aBias || exports.GREATEST_LOWER_BOUND);
  22102. if (index < 0) {
  22103. return -1;
  22104. }
  22105. // We have found either the exact element, or the next-closest element than
  22106. // the one we are searching for. However, there may be more than one such
  22107. // element. Make sure we always return the smallest of these.
  22108. while (index - 1 >= 0) {
  22109. if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
  22110. break;
  22111. }
  22112. --index;
  22113. }
  22114. return index;
  22115. };
  22116. /***/ }),
  22117. /* 166 */
  22118. /***/ (function(module, exports, __webpack_require__) {
  22119. /* -*- Mode: js; js-indent-level: 2; -*- */
  22120. /*
  22121. * Copyright 2014 Mozilla Foundation and contributors
  22122. * Licensed under the New BSD license. See LICENSE or:
  22123. * http://opensource.org/licenses/BSD-3-Clause
  22124. */
  22125. var util = __webpack_require__(11);
  22126. /**
  22127. * Determine whether mappingB is after mappingA with respect to generated
  22128. * position.
  22129. */
  22130. function generatedPositionAfter(mappingA, mappingB) {
  22131. // Optimized for most common case
  22132. var lineA = mappingA.generatedLine;
  22133. var lineB = mappingB.generatedLine;
  22134. var columnA = mappingA.generatedColumn;
  22135. var columnB = mappingB.generatedColumn;
  22136. return lineB > lineA || lineB == lineA && columnB >= columnA ||
  22137. util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
  22138. }
  22139. /**
  22140. * A data structure to provide a sorted view of accumulated mappings in a
  22141. * performance conscious manner. It trades a neglibable overhead in general
  22142. * case for a large speedup in case of mappings being added in order.
  22143. */
  22144. function MappingList() {
  22145. this._array = [];
  22146. this._sorted = true;
  22147. // Serves as infimum
  22148. this._last = {generatedLine: -1, generatedColumn: 0};
  22149. }
  22150. /**
  22151. * Iterate through internal items. This method takes the same arguments that
  22152. * `Array.prototype.forEach` takes.
  22153. *
  22154. * NOTE: The order of the mappings is NOT guaranteed.
  22155. */
  22156. MappingList.prototype.unsortedForEach =
  22157. function MappingList_forEach(aCallback, aThisArg) {
  22158. this._array.forEach(aCallback, aThisArg);
  22159. };
  22160. /**
  22161. * Add the given source mapping.
  22162. *
  22163. * @param Object aMapping
  22164. */
  22165. MappingList.prototype.add = function MappingList_add(aMapping) {
  22166. if (generatedPositionAfter(this._last, aMapping)) {
  22167. this._last = aMapping;
  22168. this._array.push(aMapping);
  22169. } else {
  22170. this._sorted = false;
  22171. this._array.push(aMapping);
  22172. }
  22173. };
  22174. /**
  22175. * Returns the flat, sorted array of mappings. The mappings are sorted by
  22176. * generated position.
  22177. *
  22178. * WARNING: This method returns internal data without copying, for
  22179. * performance. The return value must NOT be mutated, and should be treated as
  22180. * an immutable borrow. If you want to take ownership, you must make your own
  22181. * copy.
  22182. */
  22183. MappingList.prototype.toArray = function MappingList_toArray() {
  22184. if (!this._sorted) {
  22185. this._array.sort(util.compareByGeneratedPositionsInflated);
  22186. this._sorted = true;
  22187. }
  22188. return this._array;
  22189. };
  22190. exports.MappingList = MappingList;
  22191. /***/ }),
  22192. /* 167 */
  22193. /***/ (function(module, exports) {
  22194. /* -*- Mode: js; js-indent-level: 2; -*- */
  22195. /*
  22196. * Copyright 2011 Mozilla Foundation and contributors
  22197. * Licensed under the New BSD license. See LICENSE or:
  22198. * http://opensource.org/licenses/BSD-3-Clause
  22199. */
  22200. // It turns out that some (most?) JavaScript engines don't self-host
  22201. // `Array.prototype.sort`. This makes sense because C++ will likely remain
  22202. // faster than JS when doing raw CPU-intensive sorting. However, when using a
  22203. // custom comparator function, calling back and forth between the VM's C++ and
  22204. // JIT'd JS is rather slow *and* loses JIT type information, resulting in
  22205. // worse generated code for the comparator function than would be optimal. In
  22206. // fact, when sorting with a comparator, these costs outweigh the benefits of
  22207. // sorting in C++. By using our own JS-implemented Quick Sort (below), we get
  22208. // a ~3500ms mean speed-up in `bench/bench.html`.
  22209. /**
  22210. * Swap the elements indexed by `x` and `y` in the array `ary`.
  22211. *
  22212. * @param {Array} ary
  22213. * The array.
  22214. * @param {Number} x
  22215. * The index of the first item.
  22216. * @param {Number} y
  22217. * The index of the second item.
  22218. */
  22219. function swap(ary, x, y) {
  22220. var temp = ary[x];
  22221. ary[x] = ary[y];
  22222. ary[y] = temp;
  22223. }
  22224. /**
  22225. * Returns a random integer within the range `low .. high` inclusive.
  22226. *
  22227. * @param {Number} low
  22228. * The lower bound on the range.
  22229. * @param {Number} high
  22230. * The upper bound on the range.
  22231. */
  22232. function randomIntInRange(low, high) {
  22233. return Math.round(low + (Math.random() * (high - low)));
  22234. }
  22235. /**
  22236. * The Quick Sort algorithm.
  22237. *
  22238. * @param {Array} ary
  22239. * An array to sort.
  22240. * @param {function} comparator
  22241. * Function to use to compare two items.
  22242. * @param {Number} p
  22243. * Start index of the array
  22244. * @param {Number} r
  22245. * End index of the array
  22246. */
  22247. function doQuickSort(ary, comparator, p, r) {
  22248. // If our lower bound is less than our upper bound, we (1) partition the
  22249. // array into two pieces and (2) recurse on each half. If it is not, this is
  22250. // the empty array and our base case.
  22251. if (p < r) {
  22252. // (1) Partitioning.
  22253. //
  22254. // The partitioning chooses a pivot between `p` and `r` and moves all
  22255. // elements that are less than or equal to the pivot to the before it, and
  22256. // all the elements that are greater than it after it. The effect is that
  22257. // once partition is done, the pivot is in the exact place it will be when
  22258. // the array is put in sorted order, and it will not need to be moved
  22259. // again. This runs in O(n) time.
  22260. // Always choose a random pivot so that an input array which is reverse
  22261. // sorted does not cause O(n^2) running time.
  22262. var pivotIndex = randomIntInRange(p, r);
  22263. var i = p - 1;
  22264. swap(ary, pivotIndex, r);
  22265. var pivot = ary[r];
  22266. // Immediately after `j` is incremented in this loop, the following hold
  22267. // true:
  22268. //
  22269. // * Every element in `ary[p .. i]` is less than or equal to the pivot.
  22270. //
  22271. // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
  22272. for (var j = p; j < r; j++) {
  22273. if (comparator(ary[j], pivot) <= 0) {
  22274. i += 1;
  22275. swap(ary, i, j);
  22276. }
  22277. }
  22278. swap(ary, i + 1, j);
  22279. var q = i + 1;
  22280. // (2) Recurse on each half.
  22281. doQuickSort(ary, comparator, p, q - 1);
  22282. doQuickSort(ary, comparator, q + 1, r);
  22283. }
  22284. }
  22285. /**
  22286. * Sort the given array in-place with the given comparator function.
  22287. *
  22288. * @param {Array} ary
  22289. * An array to sort.
  22290. * @param {function} comparator
  22291. * Function to use to compare two items.
  22292. */
  22293. exports.quickSort = function (ary, comparator) {
  22294. doQuickSort(ary, comparator, 0, ary.length - 1);
  22295. };
  22296. /***/ }),
  22297. /* 168 */
  22298. /***/ (function(module, exports, __webpack_require__) {
  22299. /* -*- Mode: js; js-indent-level: 2; -*- */
  22300. /*
  22301. * Copyright 2011 Mozilla Foundation and contributors
  22302. * Licensed under the New BSD license. See LICENSE or:
  22303. * http://opensource.org/licenses/BSD-3-Clause
  22304. */
  22305. var util = __webpack_require__(11);
  22306. var binarySearch = __webpack_require__(165);
  22307. var ArraySet = __webpack_require__(83).ArraySet;
  22308. var base64VLQ = __webpack_require__(84);
  22309. var quickSort = __webpack_require__(167).quickSort;
  22310. function SourceMapConsumer(aSourceMap) {
  22311. var sourceMap = aSourceMap;
  22312. if (typeof aSourceMap === 'string') {
  22313. sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
  22314. }
  22315. return sourceMap.sections != null
  22316. ? new IndexedSourceMapConsumer(sourceMap)
  22317. : new BasicSourceMapConsumer(sourceMap);
  22318. }
  22319. SourceMapConsumer.fromSourceMap = function(aSourceMap) {
  22320. return BasicSourceMapConsumer.fromSourceMap(aSourceMap);
  22321. }
  22322. /**
  22323. * The version of the source mapping spec that we are consuming.
  22324. */
  22325. SourceMapConsumer.prototype._version = 3;
  22326. // `__generatedMappings` and `__originalMappings` are arrays that hold the
  22327. // parsed mapping coordinates from the source map's "mappings" attribute. They
  22328. // are lazily instantiated, accessed via the `_generatedMappings` and
  22329. // `_originalMappings` getters respectively, and we only parse the mappings
  22330. // and create these arrays once queried for a source location. We jump through
  22331. // these hoops because there can be many thousands of mappings, and parsing
  22332. // them is expensive, so we only want to do it if we must.
  22333. //
  22334. // Each object in the arrays is of the form:
  22335. //
  22336. // {
  22337. // generatedLine: The line number in the generated code,
  22338. // generatedColumn: The column number in the generated code,
  22339. // source: The path to the original source file that generated this
  22340. // chunk of code,
  22341. // originalLine: The line number in the original source that
  22342. // corresponds to this chunk of generated code,
  22343. // originalColumn: The column number in the original source that
  22344. // corresponds to this chunk of generated code,
  22345. // name: The name of the original symbol which generated this chunk of
  22346. // code.
  22347. // }
  22348. //
  22349. // All properties except for `generatedLine` and `generatedColumn` can be
  22350. // `null`.
  22351. //
  22352. // `_generatedMappings` is ordered by the generated positions.
  22353. //
  22354. // `_originalMappings` is ordered by the original positions.
  22355. SourceMapConsumer.prototype.__generatedMappings = null;
  22356. Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
  22357. get: function () {
  22358. if (!this.__generatedMappings) {
  22359. this._parseMappings(this._mappings, this.sourceRoot);
  22360. }
  22361. return this.__generatedMappings;
  22362. }
  22363. });
  22364. SourceMapConsumer.prototype.__originalMappings = null;
  22365. Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
  22366. get: function () {
  22367. if (!this.__originalMappings) {
  22368. this._parseMappings(this._mappings, this.sourceRoot);
  22369. }
  22370. return this.__originalMappings;
  22371. }
  22372. });
  22373. SourceMapConsumer.prototype._charIsMappingSeparator =
  22374. function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
  22375. var c = aStr.charAt(index);
  22376. return c === ";" || c === ",";
  22377. };
  22378. /**
  22379. * Parse the mappings in a string in to a data structure which we can easily
  22380. * query (the ordered arrays in the `this.__generatedMappings` and
  22381. * `this.__originalMappings` properties).
  22382. */
  22383. SourceMapConsumer.prototype._parseMappings =
  22384. function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  22385. throw new Error("Subclasses must implement _parseMappings");
  22386. };
  22387. SourceMapConsumer.GENERATED_ORDER = 1;
  22388. SourceMapConsumer.ORIGINAL_ORDER = 2;
  22389. SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
  22390. SourceMapConsumer.LEAST_UPPER_BOUND = 2;
  22391. /**
  22392. * Iterate over each mapping between an original source/line/column and a
  22393. * generated line/column in this source map.
  22394. *
  22395. * @param Function aCallback
  22396. * The function that is called with each mapping.
  22397. * @param Object aContext
  22398. * Optional. If specified, this object will be the value of `this` every
  22399. * time that `aCallback` is called.
  22400. * @param aOrder
  22401. * Either `SourceMapConsumer.GENERATED_ORDER` or
  22402. * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
  22403. * iterate over the mappings sorted by the generated file's line/column
  22404. * order or the original's source/line/column order, respectively. Defaults to
  22405. * `SourceMapConsumer.GENERATED_ORDER`.
  22406. */
  22407. SourceMapConsumer.prototype.eachMapping =
  22408. function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
  22409. var context = aContext || null;
  22410. var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
  22411. var mappings;
  22412. switch (order) {
  22413. case SourceMapConsumer.GENERATED_ORDER:
  22414. mappings = this._generatedMappings;
  22415. break;
  22416. case SourceMapConsumer.ORIGINAL_ORDER:
  22417. mappings = this._originalMappings;
  22418. break;
  22419. default:
  22420. throw new Error("Unknown order of iteration.");
  22421. }
  22422. var sourceRoot = this.sourceRoot;
  22423. mappings.map(function (mapping) {
  22424. var source = mapping.source === null ? null : this._sources.at(mapping.source);
  22425. if (source != null && sourceRoot != null) {
  22426. source = util.join(sourceRoot, source);
  22427. }
  22428. return {
  22429. source: source,
  22430. generatedLine: mapping.generatedLine,
  22431. generatedColumn: mapping.generatedColumn,
  22432. originalLine: mapping.originalLine,
  22433. originalColumn: mapping.originalColumn,
  22434. name: mapping.name === null ? null : this._names.at(mapping.name)
  22435. };
  22436. }, this).forEach(aCallback, context);
  22437. };
  22438. /**
  22439. * Returns all generated line and column information for the original source,
  22440. * line, and column provided. If no column is provided, returns all mappings
  22441. * corresponding to a either the line we are searching for or the next
  22442. * closest line that has any mappings. Otherwise, returns all mappings
  22443. * corresponding to the given line and either the column we are searching for
  22444. * or the next closest column that has any offsets.
  22445. *
  22446. * The only argument is an object with the following properties:
  22447. *
  22448. * - source: The filename of the original source.
  22449. * - line: The line number in the original source.
  22450. * - column: Optional. the column number in the original source.
  22451. *
  22452. * and an array of objects is returned, each with the following properties:
  22453. *
  22454. * - line: The line number in the generated source, or null.
  22455. * - column: The column number in the generated source, or null.
  22456. */
  22457. SourceMapConsumer.prototype.allGeneratedPositionsFor =
  22458. function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
  22459. var line = util.getArg(aArgs, 'line');
  22460. // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
  22461. // returns the index of the closest mapping less than the needle. By
  22462. // setting needle.originalColumn to 0, we thus find the last mapping for
  22463. // the given line, provided such a mapping exists.
  22464. var needle = {
  22465. source: util.getArg(aArgs, 'source'),
  22466. originalLine: line,
  22467. originalColumn: util.getArg(aArgs, 'column', 0)
  22468. };
  22469. if (this.sourceRoot != null) {
  22470. needle.source = util.relative(this.sourceRoot, needle.source);
  22471. }
  22472. if (!this._sources.has(needle.source)) {
  22473. return [];
  22474. }
  22475. needle.source = this._sources.indexOf(needle.source);
  22476. var mappings = [];
  22477. var index = this._findMapping(needle,
  22478. this._originalMappings,
  22479. "originalLine",
  22480. "originalColumn",
  22481. util.compareByOriginalPositions,
  22482. binarySearch.LEAST_UPPER_BOUND);
  22483. if (index >= 0) {
  22484. var mapping = this._originalMappings[index];
  22485. if (aArgs.column === undefined) {
  22486. var originalLine = mapping.originalLine;
  22487. // Iterate until either we run out of mappings, or we run into
  22488. // a mapping for a different line than the one we found. Since
  22489. // mappings are sorted, this is guaranteed to find all mappings for
  22490. // the line we found.
  22491. while (mapping && mapping.originalLine === originalLine) {
  22492. mappings.push({
  22493. line: util.getArg(mapping, 'generatedLine', null),
  22494. column: util.getArg(mapping, 'generatedColumn', null),
  22495. lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
  22496. });
  22497. mapping = this._originalMappings[++index];
  22498. }
  22499. } else {
  22500. var originalColumn = mapping.originalColumn;
  22501. // Iterate until either we run out of mappings, or we run into
  22502. // a mapping for a different line than the one we were searching for.
  22503. // Since mappings are sorted, this is guaranteed to find all mappings for
  22504. // the line we are searching for.
  22505. while (mapping &&
  22506. mapping.originalLine === line &&
  22507. mapping.originalColumn == originalColumn) {
  22508. mappings.push({
  22509. line: util.getArg(mapping, 'generatedLine', null),
  22510. column: util.getArg(mapping, 'generatedColumn', null),
  22511. lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
  22512. });
  22513. mapping = this._originalMappings[++index];
  22514. }
  22515. }
  22516. }
  22517. return mappings;
  22518. };
  22519. exports.SourceMapConsumer = SourceMapConsumer;
  22520. /**
  22521. * A BasicSourceMapConsumer instance represents a parsed source map which we can
  22522. * query for information about the original file positions by giving it a file
  22523. * position in the generated source.
  22524. *
  22525. * The only parameter is the raw source map (either as a JSON string, or
  22526. * already parsed to an object). According to the spec, source maps have the
  22527. * following attributes:
  22528. *
  22529. * - version: Which version of the source map spec this map is following.
  22530. * - sources: An array of URLs to the original source files.
  22531. * - names: An array of identifiers which can be referrenced by individual mappings.
  22532. * - sourceRoot: Optional. The URL root from which all sources are relative.
  22533. * - sourcesContent: Optional. An array of contents of the original source files.
  22534. * - mappings: A string of base64 VLQs which contain the actual mappings.
  22535. * - file: Optional. The generated file this source map is associated with.
  22536. *
  22537. * Here is an example source map, taken from the source map spec[0]:
  22538. *
  22539. * {
  22540. * version : 3,
  22541. * file: "out.js",
  22542. * sourceRoot : "",
  22543. * sources: ["foo.js", "bar.js"],
  22544. * names: ["src", "maps", "are", "fun"],
  22545. * mappings: "AA,AB;;ABCDE;"
  22546. * }
  22547. *
  22548. * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
  22549. */
  22550. function BasicSourceMapConsumer(aSourceMap) {
  22551. var sourceMap = aSourceMap;
  22552. if (typeof aSourceMap === 'string') {
  22553. sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
  22554. }
  22555. var version = util.getArg(sourceMap, 'version');
  22556. var sources = util.getArg(sourceMap, 'sources');
  22557. // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
  22558. // requires the array) to play nice here.
  22559. var names = util.getArg(sourceMap, 'names', []);
  22560. var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
  22561. var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
  22562. var mappings = util.getArg(sourceMap, 'mappings');
  22563. var file = util.getArg(sourceMap, 'file', null);
  22564. // Once again, Sass deviates from the spec and supplies the version as a
  22565. // string rather than a number, so we use loose equality checking here.
  22566. if (version != this._version) {
  22567. throw new Error('Unsupported version: ' + version);
  22568. }
  22569. sources = sources
  22570. .map(String)
  22571. // Some source maps produce relative source paths like "./foo.js" instead of
  22572. // "foo.js". Normalize these first so that future comparisons will succeed.
  22573. // See bugzil.la/1090768.
  22574. .map(util.normalize)
  22575. // Always ensure that absolute sources are internally stored relative to
  22576. // the source root, if the source root is absolute. Not doing this would
  22577. // be particularly problematic when the source root is a prefix of the
  22578. // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
  22579. .map(function (source) {
  22580. return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)
  22581. ? util.relative(sourceRoot, source)
  22582. : source;
  22583. });
  22584. // Pass `true` below to allow duplicate names and sources. While source maps
  22585. // are intended to be compressed and deduplicated, the TypeScript compiler
  22586. // sometimes generates source maps with duplicates in them. See Github issue
  22587. // #72 and bugzil.la/889492.
  22588. this._names = ArraySet.fromArray(names.map(String), true);
  22589. this._sources = ArraySet.fromArray(sources, true);
  22590. this.sourceRoot = sourceRoot;
  22591. this.sourcesContent = sourcesContent;
  22592. this._mappings = mappings;
  22593. this.file = file;
  22594. }
  22595. BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
  22596. BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
  22597. /**
  22598. * Create a BasicSourceMapConsumer from a SourceMapGenerator.
  22599. *
  22600. * @param SourceMapGenerator aSourceMap
  22601. * The source map that will be consumed.
  22602. * @returns BasicSourceMapConsumer
  22603. */
  22604. BasicSourceMapConsumer.fromSourceMap =
  22605. function SourceMapConsumer_fromSourceMap(aSourceMap) {
  22606. var smc = Object.create(BasicSourceMapConsumer.prototype);
  22607. var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
  22608. var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
  22609. smc.sourceRoot = aSourceMap._sourceRoot;
  22610. smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
  22611. smc.sourceRoot);
  22612. smc.file = aSourceMap._file;
  22613. // Because we are modifying the entries (by converting string sources and
  22614. // names to indices into the sources and names ArraySets), we have to make
  22615. // a copy of the entry or else bad things happen. Shared mutable state
  22616. // strikes again! See github issue #191.
  22617. var generatedMappings = aSourceMap._mappings.toArray().slice();
  22618. var destGeneratedMappings = smc.__generatedMappings = [];
  22619. var destOriginalMappings = smc.__originalMappings = [];
  22620. for (var i = 0, length = generatedMappings.length; i < length; i++) {
  22621. var srcMapping = generatedMappings[i];
  22622. var destMapping = new Mapping;
  22623. destMapping.generatedLine = srcMapping.generatedLine;
  22624. destMapping.generatedColumn = srcMapping.generatedColumn;
  22625. if (srcMapping.source) {
  22626. destMapping.source = sources.indexOf(srcMapping.source);
  22627. destMapping.originalLine = srcMapping.originalLine;
  22628. destMapping.originalColumn = srcMapping.originalColumn;
  22629. if (srcMapping.name) {
  22630. destMapping.name = names.indexOf(srcMapping.name);
  22631. }
  22632. destOriginalMappings.push(destMapping);
  22633. }
  22634. destGeneratedMappings.push(destMapping);
  22635. }
  22636. quickSort(smc.__originalMappings, util.compareByOriginalPositions);
  22637. return smc;
  22638. };
  22639. /**
  22640. * The version of the source mapping spec that we are consuming.
  22641. */
  22642. BasicSourceMapConsumer.prototype._version = 3;
  22643. /**
  22644. * The list of original sources.
  22645. */
  22646. Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
  22647. get: function () {
  22648. return this._sources.toArray().map(function (s) {
  22649. return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;
  22650. }, this);
  22651. }
  22652. });
  22653. /**
  22654. * Provide the JIT with a nice shape / hidden class.
  22655. */
  22656. function Mapping() {
  22657. this.generatedLine = 0;
  22658. this.generatedColumn = 0;
  22659. this.source = null;
  22660. this.originalLine = null;
  22661. this.originalColumn = null;
  22662. this.name = null;
  22663. }
  22664. /**
  22665. * Parse the mappings in a string in to a data structure which we can easily
  22666. * query (the ordered arrays in the `this.__generatedMappings` and
  22667. * `this.__originalMappings` properties).
  22668. */
  22669. BasicSourceMapConsumer.prototype._parseMappings =
  22670. function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  22671. var generatedLine = 1;
  22672. var previousGeneratedColumn = 0;
  22673. var previousOriginalLine = 0;
  22674. var previousOriginalColumn = 0;
  22675. var previousSource = 0;
  22676. var previousName = 0;
  22677. var length = aStr.length;
  22678. var index = 0;
  22679. var cachedSegments = {};
  22680. var temp = {};
  22681. var originalMappings = [];
  22682. var generatedMappings = [];
  22683. var mapping, str, segment, end, value;
  22684. while (index < length) {
  22685. if (aStr.charAt(index) === ';') {
  22686. generatedLine++;
  22687. index++;
  22688. previousGeneratedColumn = 0;
  22689. }
  22690. else if (aStr.charAt(index) === ',') {
  22691. index++;
  22692. }
  22693. else {
  22694. mapping = new Mapping();
  22695. mapping.generatedLine = generatedLine;
  22696. // Because each offset is encoded relative to the previous one,
  22697. // many segments often have the same encoding. We can exploit this
  22698. // fact by caching the parsed variable length fields of each segment,
  22699. // allowing us to avoid a second parse if we encounter the same
  22700. // segment again.
  22701. for (end = index; end < length; end++) {
  22702. if (this._charIsMappingSeparator(aStr, end)) {
  22703. break;
  22704. }
  22705. }
  22706. str = aStr.slice(index, end);
  22707. segment = cachedSegments[str];
  22708. if (segment) {
  22709. index += str.length;
  22710. } else {
  22711. segment = [];
  22712. while (index < end) {
  22713. base64VLQ.decode(aStr, index, temp);
  22714. value = temp.value;
  22715. index = temp.rest;
  22716. segment.push(value);
  22717. }
  22718. if (segment.length === 2) {
  22719. throw new Error('Found a source, but no line and column');
  22720. }
  22721. if (segment.length === 3) {
  22722. throw new Error('Found a source and line, but no column');
  22723. }
  22724. cachedSegments[str] = segment;
  22725. }
  22726. // Generated column.
  22727. mapping.generatedColumn = previousGeneratedColumn + segment[0];
  22728. previousGeneratedColumn = mapping.generatedColumn;
  22729. if (segment.length > 1) {
  22730. // Original source.
  22731. mapping.source = previousSource + segment[1];
  22732. previousSource += segment[1];
  22733. // Original line.
  22734. mapping.originalLine = previousOriginalLine + segment[2];
  22735. previousOriginalLine = mapping.originalLine;
  22736. // Lines are stored 0-based
  22737. mapping.originalLine += 1;
  22738. // Original column.
  22739. mapping.originalColumn = previousOriginalColumn + segment[3];
  22740. previousOriginalColumn = mapping.originalColumn;
  22741. if (segment.length > 4) {
  22742. // Original name.
  22743. mapping.name = previousName + segment[4];
  22744. previousName += segment[4];
  22745. }
  22746. }
  22747. generatedMappings.push(mapping);
  22748. if (typeof mapping.originalLine === 'number') {
  22749. originalMappings.push(mapping);
  22750. }
  22751. }
  22752. }
  22753. quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
  22754. this.__generatedMappings = generatedMappings;
  22755. quickSort(originalMappings, util.compareByOriginalPositions);
  22756. this.__originalMappings = originalMappings;
  22757. };
  22758. /**
  22759. * Find the mapping that best matches the hypothetical "needle" mapping that
  22760. * we are searching for in the given "haystack" of mappings.
  22761. */
  22762. BasicSourceMapConsumer.prototype._findMapping =
  22763. function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
  22764. aColumnName, aComparator, aBias) {
  22765. // To return the position we are searching for, we must first find the
  22766. // mapping for the given position and then return the opposite position it
  22767. // points to. Because the mappings are sorted, we can use binary search to
  22768. // find the best mapping.
  22769. if (aNeedle[aLineName] <= 0) {
  22770. throw new TypeError('Line must be greater than or equal to 1, got '
  22771. + aNeedle[aLineName]);
  22772. }
  22773. if (aNeedle[aColumnName] < 0) {
  22774. throw new TypeError('Column must be greater than or equal to 0, got '
  22775. + aNeedle[aColumnName]);
  22776. }
  22777. return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
  22778. };
  22779. /**
  22780. * Compute the last column for each generated mapping. The last column is
  22781. * inclusive.
  22782. */
  22783. BasicSourceMapConsumer.prototype.computeColumnSpans =
  22784. function SourceMapConsumer_computeColumnSpans() {
  22785. for (var index = 0; index < this._generatedMappings.length; ++index) {
  22786. var mapping = this._generatedMappings[index];
  22787. // Mappings do not contain a field for the last generated columnt. We
  22788. // can come up with an optimistic estimate, however, by assuming that
  22789. // mappings are contiguous (i.e. given two consecutive mappings, the
  22790. // first mapping ends where the second one starts).
  22791. if (index + 1 < this._generatedMappings.length) {
  22792. var nextMapping = this._generatedMappings[index + 1];
  22793. if (mapping.generatedLine === nextMapping.generatedLine) {
  22794. mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
  22795. continue;
  22796. }
  22797. }
  22798. // The last mapping for each line spans the entire line.
  22799. mapping.lastGeneratedColumn = Infinity;
  22800. }
  22801. };
  22802. /**
  22803. * Returns the original source, line, and column information for the generated
  22804. * source's line and column positions provided. The only argument is an object
  22805. * with the following properties:
  22806. *
  22807. * - line: The line number in the generated source.
  22808. * - column: The column number in the generated source.
  22809. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
  22810. * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
  22811. * closest element that is smaller than or greater than the one we are
  22812. * searching for, respectively, if the exact element cannot be found.
  22813. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
  22814. *
  22815. * and an object is returned with the following properties:
  22816. *
  22817. * - source: The original source file, or null.
  22818. * - line: The line number in the original source, or null.
  22819. * - column: The column number in the original source, or null.
  22820. * - name: The original identifier, or null.
  22821. */
  22822. BasicSourceMapConsumer.prototype.originalPositionFor =
  22823. function SourceMapConsumer_originalPositionFor(aArgs) {
  22824. var needle = {
  22825. generatedLine: util.getArg(aArgs, 'line'),
  22826. generatedColumn: util.getArg(aArgs, 'column')
  22827. };
  22828. var index = this._findMapping(
  22829. needle,
  22830. this._generatedMappings,
  22831. "generatedLine",
  22832. "generatedColumn",
  22833. util.compareByGeneratedPositionsDeflated,
  22834. util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
  22835. );
  22836. if (index >= 0) {
  22837. var mapping = this._generatedMappings[index];
  22838. if (mapping.generatedLine === needle.generatedLine) {
  22839. var source = util.getArg(mapping, 'source', null);
  22840. if (source !== null) {
  22841. source = this._sources.at(source);
  22842. if (this.sourceRoot != null) {
  22843. source = util.join(this.sourceRoot, source);
  22844. }
  22845. }
  22846. var name = util.getArg(mapping, 'name', null);
  22847. if (name !== null) {
  22848. name = this._names.at(name);
  22849. }
  22850. return {
  22851. source: source,
  22852. line: util.getArg(mapping, 'originalLine', null),
  22853. column: util.getArg(mapping, 'originalColumn', null),
  22854. name: name
  22855. };
  22856. }
  22857. }
  22858. return {
  22859. source: null,
  22860. line: null,
  22861. column: null,
  22862. name: null
  22863. };
  22864. };
  22865. /**
  22866. * Return true if we have the source content for every source in the source
  22867. * map, false otherwise.
  22868. */
  22869. BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
  22870. function BasicSourceMapConsumer_hasContentsOfAllSources() {
  22871. if (!this.sourcesContent) {
  22872. return false;
  22873. }
  22874. return this.sourcesContent.length >= this._sources.size() &&
  22875. !this.sourcesContent.some(function (sc) { return sc == null; });
  22876. };
  22877. /**
  22878. * Returns the original source content. The only argument is the url of the
  22879. * original source file. Returns null if no original source content is
  22880. * available.
  22881. */
  22882. BasicSourceMapConsumer.prototype.sourceContentFor =
  22883. function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
  22884. if (!this.sourcesContent) {
  22885. return null;
  22886. }
  22887. if (this.sourceRoot != null) {
  22888. aSource = util.relative(this.sourceRoot, aSource);
  22889. }
  22890. if (this._sources.has(aSource)) {
  22891. return this.sourcesContent[this._sources.indexOf(aSource)];
  22892. }
  22893. var url;
  22894. if (this.sourceRoot != null
  22895. && (url = util.urlParse(this.sourceRoot))) {
  22896. // XXX: file:// URIs and absolute paths lead to unexpected behavior for
  22897. // many users. We can help them out when they expect file:// URIs to
  22898. // behave like it would if they were running a local HTTP server. See
  22899. // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
  22900. var fileUriAbsPath = aSource.replace(/^file:\/\//, "");
  22901. if (url.scheme == "file"
  22902. && this._sources.has(fileUriAbsPath)) {
  22903. return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
  22904. }
  22905. if ((!url.path || url.path == "/")
  22906. && this._sources.has("/" + aSource)) {
  22907. return this.sourcesContent[this._sources.indexOf("/" + aSource)];
  22908. }
  22909. }
  22910. // This function is used recursively from
  22911. // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
  22912. // don't want to throw if we can't find the source - we just want to
  22913. // return null, so we provide a flag to exit gracefully.
  22914. if (nullOnMissing) {
  22915. return null;
  22916. }
  22917. else {
  22918. throw new Error('"' + aSource + '" is not in the SourceMap.');
  22919. }
  22920. };
  22921. /**
  22922. * Returns the generated line and column information for the original source,
  22923. * line, and column positions provided. The only argument is an object with
  22924. * the following properties:
  22925. *
  22926. * - source: The filename of the original source.
  22927. * - line: The line number in the original source.
  22928. * - column: The column number in the original source.
  22929. * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
  22930. * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
  22931. * closest element that is smaller than or greater than the one we are
  22932. * searching for, respectively, if the exact element cannot be found.
  22933. * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
  22934. *
  22935. * and an object is returned with the following properties:
  22936. *
  22937. * - line: The line number in the generated source, or null.
  22938. * - column: The column number in the generated source, or null.
  22939. */
  22940. BasicSourceMapConsumer.prototype.generatedPositionFor =
  22941. function SourceMapConsumer_generatedPositionFor(aArgs) {
  22942. var source = util.getArg(aArgs, 'source');
  22943. if (this.sourceRoot != null) {
  22944. source = util.relative(this.sourceRoot, source);
  22945. }
  22946. if (!this._sources.has(source)) {
  22947. return {
  22948. line: null,
  22949. column: null,
  22950. lastColumn: null
  22951. };
  22952. }
  22953. source = this._sources.indexOf(source);
  22954. var needle = {
  22955. source: source,
  22956. originalLine: util.getArg(aArgs, 'line'),
  22957. originalColumn: util.getArg(aArgs, 'column')
  22958. };
  22959. var index = this._findMapping(
  22960. needle,
  22961. this._originalMappings,
  22962. "originalLine",
  22963. "originalColumn",
  22964. util.compareByOriginalPositions,
  22965. util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
  22966. );
  22967. if (index >= 0) {
  22968. var mapping = this._originalMappings[index];
  22969. if (mapping.source === needle.source) {
  22970. return {
  22971. line: util.getArg(mapping, 'generatedLine', null),
  22972. column: util.getArg(mapping, 'generatedColumn', null),
  22973. lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
  22974. };
  22975. }
  22976. }
  22977. return {
  22978. line: null,
  22979. column: null,
  22980. lastColumn: null
  22981. };
  22982. };
  22983. exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
  22984. /**
  22985. * An IndexedSourceMapConsumer instance represents a parsed source map which
  22986. * we can query for information. It differs from BasicSourceMapConsumer in
  22987. * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
  22988. * input.
  22989. *
  22990. * The only parameter is a raw source map (either as a JSON string, or already
  22991. * parsed to an object). According to the spec for indexed source maps, they
  22992. * have the following attributes:
  22993. *
  22994. * - version: Which version of the source map spec this map is following.
  22995. * - file: Optional. The generated file this source map is associated with.
  22996. * - sections: A list of section definitions.
  22997. *
  22998. * Each value under the "sections" field has two fields:
  22999. * - offset: The offset into the original specified at which this section
  23000. * begins to apply, defined as an object with a "line" and "column"
  23001. * field.
  23002. * - map: A source map definition. This source map could also be indexed,
  23003. * but doesn't have to be.
  23004. *
  23005. * Instead of the "map" field, it's also possible to have a "url" field
  23006. * specifying a URL to retrieve a source map from, but that's currently
  23007. * unsupported.
  23008. *
  23009. * Here's an example source map, taken from the source map spec[0], but
  23010. * modified to omit a section which uses the "url" field.
  23011. *
  23012. * {
  23013. * version : 3,
  23014. * file: "app.js",
  23015. * sections: [{
  23016. * offset: {line:100, column:10},
  23017. * map: {
  23018. * version : 3,
  23019. * file: "section.js",
  23020. * sources: ["foo.js", "bar.js"],
  23021. * names: ["src", "maps", "are", "fun"],
  23022. * mappings: "AAAA,E;;ABCDE;"
  23023. * }
  23024. * }],
  23025. * }
  23026. *
  23027. * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
  23028. */
  23029. function IndexedSourceMapConsumer(aSourceMap) {
  23030. var sourceMap = aSourceMap;
  23031. if (typeof aSourceMap === 'string') {
  23032. sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
  23033. }
  23034. var version = util.getArg(sourceMap, 'version');
  23035. var sections = util.getArg(sourceMap, 'sections');
  23036. if (version != this._version) {
  23037. throw new Error('Unsupported version: ' + version);
  23038. }
  23039. this._sources = new ArraySet();
  23040. this._names = new ArraySet();
  23041. var lastOffset = {
  23042. line: -1,
  23043. column: 0
  23044. };
  23045. this._sections = sections.map(function (s) {
  23046. if (s.url) {
  23047. // The url field will require support for asynchronicity.
  23048. // See https://github.com/mozilla/source-map/issues/16
  23049. throw new Error('Support for url field in sections not implemented.');
  23050. }
  23051. var offset = util.getArg(s, 'offset');
  23052. var offsetLine = util.getArg(offset, 'line');
  23053. var offsetColumn = util.getArg(offset, 'column');
  23054. if (offsetLine < lastOffset.line ||
  23055. (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
  23056. throw new Error('Section offsets must be ordered and non-overlapping.');
  23057. }
  23058. lastOffset = offset;
  23059. return {
  23060. generatedOffset: {
  23061. // The offset fields are 0-based, but we use 1-based indices when
  23062. // encoding/decoding from VLQ.
  23063. generatedLine: offsetLine + 1,
  23064. generatedColumn: offsetColumn + 1
  23065. },
  23066. consumer: new SourceMapConsumer(util.getArg(s, 'map'))
  23067. }
  23068. });
  23069. }
  23070. IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
  23071. IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
  23072. /**
  23073. * The version of the source mapping spec that we are consuming.
  23074. */
  23075. IndexedSourceMapConsumer.prototype._version = 3;
  23076. /**
  23077. * The list of original sources.
  23078. */
  23079. Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
  23080. get: function () {
  23081. var sources = [];
  23082. for (var i = 0; i < this._sections.length; i++) {
  23083. for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
  23084. sources.push(this._sections[i].consumer.sources[j]);
  23085. }
  23086. }
  23087. return sources;
  23088. }
  23089. });
  23090. /**
  23091. * Returns the original source, line, and column information for the generated
  23092. * source's line and column positions provided. The only argument is an object
  23093. * with the following properties:
  23094. *
  23095. * - line: The line number in the generated source.
  23096. * - column: The column number in the generated source.
  23097. *
  23098. * and an object is returned with the following properties:
  23099. *
  23100. * - source: The original source file, or null.
  23101. * - line: The line number in the original source, or null.
  23102. * - column: The column number in the original source, or null.
  23103. * - name: The original identifier, or null.
  23104. */
  23105. IndexedSourceMapConsumer.prototype.originalPositionFor =
  23106. function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
  23107. var needle = {
  23108. generatedLine: util.getArg(aArgs, 'line'),
  23109. generatedColumn: util.getArg(aArgs, 'column')
  23110. };
  23111. // Find the section containing the generated position we're trying to map
  23112. // to an original position.
  23113. var sectionIndex = binarySearch.search(needle, this._sections,
  23114. function(needle, section) {
  23115. var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
  23116. if (cmp) {
  23117. return cmp;
  23118. }
  23119. return (needle.generatedColumn -
  23120. section.generatedOffset.generatedColumn);
  23121. });
  23122. var section = this._sections[sectionIndex];
  23123. if (!section) {
  23124. return {
  23125. source: null,
  23126. line: null,
  23127. column: null,
  23128. name: null
  23129. };
  23130. }
  23131. return section.consumer.originalPositionFor({
  23132. line: needle.generatedLine -
  23133. (section.generatedOffset.generatedLine - 1),
  23134. column: needle.generatedColumn -
  23135. (section.generatedOffset.generatedLine === needle.generatedLine
  23136. ? section.generatedOffset.generatedColumn - 1
  23137. : 0),
  23138. bias: aArgs.bias
  23139. });
  23140. };
  23141. /**
  23142. * Return true if we have the source content for every source in the source
  23143. * map, false otherwise.
  23144. */
  23145. IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
  23146. function IndexedSourceMapConsumer_hasContentsOfAllSources() {
  23147. return this._sections.every(function (s) {
  23148. return s.consumer.hasContentsOfAllSources();
  23149. });
  23150. };
  23151. /**
  23152. * Returns the original source content. The only argument is the url of the
  23153. * original source file. Returns null if no original source content is
  23154. * available.
  23155. */
  23156. IndexedSourceMapConsumer.prototype.sourceContentFor =
  23157. function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
  23158. for (var i = 0; i < this._sections.length; i++) {
  23159. var section = this._sections[i];
  23160. var content = section.consumer.sourceContentFor(aSource, true);
  23161. if (content) {
  23162. return content;
  23163. }
  23164. }
  23165. if (nullOnMissing) {
  23166. return null;
  23167. }
  23168. else {
  23169. throw new Error('"' + aSource + '" is not in the SourceMap.');
  23170. }
  23171. };
  23172. /**
  23173. * Returns the generated line and column information for the original source,
  23174. * line, and column positions provided. The only argument is an object with
  23175. * the following properties:
  23176. *
  23177. * - source: The filename of the original source.
  23178. * - line: The line number in the original source.
  23179. * - column: The column number in the original source.
  23180. *
  23181. * and an object is returned with the following properties:
  23182. *
  23183. * - line: The line number in the generated source, or null.
  23184. * - column: The column number in the generated source, or null.
  23185. */
  23186. IndexedSourceMapConsumer.prototype.generatedPositionFor =
  23187. function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
  23188. for (var i = 0; i < this._sections.length; i++) {
  23189. var section = this._sections[i];
  23190. // Only consider this section if the requested source is in the list of
  23191. // sources of the consumer.
  23192. if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {
  23193. continue;
  23194. }
  23195. var generatedPosition = section.consumer.generatedPositionFor(aArgs);
  23196. if (generatedPosition) {
  23197. var ret = {
  23198. line: generatedPosition.line +
  23199. (section.generatedOffset.generatedLine - 1),
  23200. column: generatedPosition.column +
  23201. (section.generatedOffset.generatedLine === generatedPosition.line
  23202. ? section.generatedOffset.generatedColumn - 1
  23203. : 0)
  23204. };
  23205. return ret;
  23206. }
  23207. }
  23208. return {
  23209. line: null,
  23210. column: null
  23211. };
  23212. };
  23213. /**
  23214. * Parse the mappings in a string in to a data structure which we can easily
  23215. * query (the ordered arrays in the `this.__generatedMappings` and
  23216. * `this.__originalMappings` properties).
  23217. */
  23218. IndexedSourceMapConsumer.prototype._parseMappings =
  23219. function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
  23220. this.__generatedMappings = [];
  23221. this.__originalMappings = [];
  23222. for (var i = 0; i < this._sections.length; i++) {
  23223. var section = this._sections[i];
  23224. var sectionMappings = section.consumer._generatedMappings;
  23225. for (var j = 0; j < sectionMappings.length; j++) {
  23226. var mapping = sectionMappings[j];
  23227. var source = section.consumer._sources.at(mapping.source);
  23228. if (section.consumer.sourceRoot !== null) {
  23229. source = util.join(section.consumer.sourceRoot, source);
  23230. }
  23231. this._sources.add(source);
  23232. source = this._sources.indexOf(source);
  23233. var name = section.consumer._names.at(mapping.name);
  23234. this._names.add(name);
  23235. name = this._names.indexOf(name);
  23236. // The mappings coming from the consumer for the section have
  23237. // generated positions relative to the start of the section, so we
  23238. // need to offset them to be relative to the start of the concatenated
  23239. // generated file.
  23240. var adjustedMapping = {
  23241. source: source,
  23242. generatedLine: mapping.generatedLine +
  23243. (section.generatedOffset.generatedLine - 1),
  23244. generatedColumn: mapping.generatedColumn +
  23245. (section.generatedOffset.generatedLine === mapping.generatedLine
  23246. ? section.generatedOffset.generatedColumn - 1
  23247. : 0),
  23248. originalLine: mapping.originalLine,
  23249. originalColumn: mapping.originalColumn,
  23250. name: name
  23251. };
  23252. this.__generatedMappings.push(adjustedMapping);
  23253. if (typeof adjustedMapping.originalLine === 'number') {
  23254. this.__originalMappings.push(adjustedMapping);
  23255. }
  23256. }
  23257. }
  23258. quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
  23259. quickSort(this.__originalMappings, util.compareByOriginalPositions);
  23260. };
  23261. exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
  23262. /***/ }),
  23263. /* 169 */
  23264. /***/ (function(module, exports, __webpack_require__) {
  23265. /* -*- Mode: js; js-indent-level: 2; -*- */
  23266. /*
  23267. * Copyright 2011 Mozilla Foundation and contributors
  23268. * Licensed under the New BSD license. See LICENSE or:
  23269. * http://opensource.org/licenses/BSD-3-Clause
  23270. */
  23271. var SourceMapGenerator = __webpack_require__(85).SourceMapGenerator;
  23272. var util = __webpack_require__(11);
  23273. // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
  23274. // operating systems these days (capturing the result).
  23275. var REGEX_NEWLINE = /(\r?\n)/;
  23276. // Newline character code for charCodeAt() comparisons
  23277. var NEWLINE_CODE = 10;
  23278. // Private symbol for identifying `SourceNode`s when multiple versions of
  23279. // the source-map library are loaded. This MUST NOT CHANGE across
  23280. // versions!
  23281. var isSourceNode = "$$$isSourceNode$$$";
  23282. /**
  23283. * SourceNodes provide a way to abstract over interpolating/concatenating
  23284. * snippets of generated JavaScript source code while maintaining the line and
  23285. * column information associated with the original source code.
  23286. *
  23287. * @param aLine The original line number.
  23288. * @param aColumn The original column number.
  23289. * @param aSource The original source's filename.
  23290. * @param aChunks Optional. An array of strings which are snippets of
  23291. * generated JS, or other SourceNodes.
  23292. * @param aName The original identifier.
  23293. */
  23294. function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
  23295. this.children = [];
  23296. this.sourceContents = {};
  23297. this.line = aLine == null ? null : aLine;
  23298. this.column = aColumn == null ? null : aColumn;
  23299. this.source = aSource == null ? null : aSource;
  23300. this.name = aName == null ? null : aName;
  23301. this[isSourceNode] = true;
  23302. if (aChunks != null) this.add(aChunks);
  23303. }
  23304. /**
  23305. * Creates a SourceNode from generated code and a SourceMapConsumer.
  23306. *
  23307. * @param aGeneratedCode The generated code
  23308. * @param aSourceMapConsumer The SourceMap for the generated code
  23309. * @param aRelativePath Optional. The path that relative sources in the
  23310. * SourceMapConsumer should be relative to.
  23311. */
  23312. SourceNode.fromStringWithSourceMap =
  23313. function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
  23314. // The SourceNode we want to fill with the generated code
  23315. // and the SourceMap
  23316. var node = new SourceNode();
  23317. // All even indices of this array are one line of the generated code,
  23318. // while all odd indices are the newlines between two adjacent lines
  23319. // (since `REGEX_NEWLINE` captures its match).
  23320. // Processed fragments are removed from this array, by calling `shiftNextLine`.
  23321. var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
  23322. var shiftNextLine = function() {
  23323. var lineContents = remainingLines.shift();
  23324. // The last line of a file might not have a newline.
  23325. var newLine = remainingLines.shift() || "";
  23326. return lineContents + newLine;
  23327. };
  23328. // We need to remember the position of "remainingLines"
  23329. var lastGeneratedLine = 1, lastGeneratedColumn = 0;
  23330. // The generate SourceNodes we need a code range.
  23331. // To extract it current and last mapping is used.
  23332. // Here we store the last mapping.
  23333. var lastMapping = null;
  23334. aSourceMapConsumer.eachMapping(function (mapping) {
  23335. if (lastMapping !== null) {
  23336. // We add the code from "lastMapping" to "mapping":
  23337. // First check if there is a new line in between.
  23338. if (lastGeneratedLine < mapping.generatedLine) {
  23339. // Associate first line with "lastMapping"
  23340. addMappingWithCode(lastMapping, shiftNextLine());
  23341. lastGeneratedLine++;
  23342. lastGeneratedColumn = 0;
  23343. // The remaining code is added without mapping
  23344. } else {
  23345. // There is no new line in between.
  23346. // Associate the code between "lastGeneratedColumn" and
  23347. // "mapping.generatedColumn" with "lastMapping"
  23348. var nextLine = remainingLines[0];
  23349. var code = nextLine.substr(0, mapping.generatedColumn -
  23350. lastGeneratedColumn);
  23351. remainingLines[0] = nextLine.substr(mapping.generatedColumn -
  23352. lastGeneratedColumn);
  23353. lastGeneratedColumn = mapping.generatedColumn;
  23354. addMappingWithCode(lastMapping, code);
  23355. // No more remaining code, continue
  23356. lastMapping = mapping;
  23357. return;
  23358. }
  23359. }
  23360. // We add the generated code until the first mapping
  23361. // to the SourceNode without any mapping.
  23362. // Each line is added as separate string.
  23363. while (lastGeneratedLine < mapping.generatedLine) {
  23364. node.add(shiftNextLine());
  23365. lastGeneratedLine++;
  23366. }
  23367. if (lastGeneratedColumn < mapping.generatedColumn) {
  23368. var nextLine = remainingLines[0];
  23369. node.add(nextLine.substr(0, mapping.generatedColumn));
  23370. remainingLines[0] = nextLine.substr(mapping.generatedColumn);
  23371. lastGeneratedColumn = mapping.generatedColumn;
  23372. }
  23373. lastMapping = mapping;
  23374. }, this);
  23375. // We have processed all mappings.
  23376. if (remainingLines.length > 0) {
  23377. if (lastMapping) {
  23378. // Associate the remaining code in the current line with "lastMapping"
  23379. addMappingWithCode(lastMapping, shiftNextLine());
  23380. }
  23381. // and add the remaining lines without any mapping
  23382. node.add(remainingLines.join(""));
  23383. }
  23384. // Copy sourcesContent into SourceNode
  23385. aSourceMapConsumer.sources.forEach(function (sourceFile) {
  23386. var content = aSourceMapConsumer.sourceContentFor(sourceFile);
  23387. if (content != null) {
  23388. if (aRelativePath != null) {
  23389. sourceFile = util.join(aRelativePath, sourceFile);
  23390. }
  23391. node.setSourceContent(sourceFile, content);
  23392. }
  23393. });
  23394. return node;
  23395. function addMappingWithCode(mapping, code) {
  23396. if (mapping === null || mapping.source === undefined) {
  23397. node.add(code);
  23398. } else {
  23399. var source = aRelativePath
  23400. ? util.join(aRelativePath, mapping.source)
  23401. : mapping.source;
  23402. node.add(new SourceNode(mapping.originalLine,
  23403. mapping.originalColumn,
  23404. source,
  23405. code,
  23406. mapping.name));
  23407. }
  23408. }
  23409. };
  23410. /**
  23411. * Add a chunk of generated JS to this source node.
  23412. *
  23413. * @param aChunk A string snippet of generated JS code, another instance of
  23414. * SourceNode, or an array where each member is one of those things.
  23415. */
  23416. SourceNode.prototype.add = function SourceNode_add(aChunk) {
  23417. if (Array.isArray(aChunk)) {
  23418. aChunk.forEach(function (chunk) {
  23419. this.add(chunk);
  23420. }, this);
  23421. }
  23422. else if (aChunk[isSourceNode] || typeof aChunk === "string") {
  23423. if (aChunk) {
  23424. this.children.push(aChunk);
  23425. }
  23426. }
  23427. else {
  23428. throw new TypeError(
  23429. "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
  23430. );
  23431. }
  23432. return this;
  23433. };
  23434. /**
  23435. * Add a chunk of generated JS to the beginning of this source node.
  23436. *
  23437. * @param aChunk A string snippet of generated JS code, another instance of
  23438. * SourceNode, or an array where each member is one of those things.
  23439. */
  23440. SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
  23441. if (Array.isArray(aChunk)) {
  23442. for (var i = aChunk.length-1; i >= 0; i--) {
  23443. this.prepend(aChunk[i]);
  23444. }
  23445. }
  23446. else if (aChunk[isSourceNode] || typeof aChunk === "string") {
  23447. this.children.unshift(aChunk);
  23448. }
  23449. else {
  23450. throw new TypeError(
  23451. "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
  23452. );
  23453. }
  23454. return this;
  23455. };
  23456. /**
  23457. * Walk over the tree of JS snippets in this node and its children. The
  23458. * walking function is called once for each snippet of JS and is passed that
  23459. * snippet and the its original associated source's line/column location.
  23460. *
  23461. * @param aFn The traversal function.
  23462. */
  23463. SourceNode.prototype.walk = function SourceNode_walk(aFn) {
  23464. var chunk;
  23465. for (var i = 0, len = this.children.length; i < len; i++) {
  23466. chunk = this.children[i];
  23467. if (chunk[isSourceNode]) {
  23468. chunk.walk(aFn);
  23469. }
  23470. else {
  23471. if (chunk !== '') {
  23472. aFn(chunk, { source: this.source,
  23473. line: this.line,
  23474. column: this.column,
  23475. name: this.name });
  23476. }
  23477. }
  23478. }
  23479. };
  23480. /**
  23481. * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
  23482. * each of `this.children`.
  23483. *
  23484. * @param aSep The separator.
  23485. */
  23486. SourceNode.prototype.join = function SourceNode_join(aSep) {
  23487. var newChildren;
  23488. var i;
  23489. var len = this.children.length;
  23490. if (len > 0) {
  23491. newChildren = [];
  23492. for (i = 0; i < len-1; i++) {
  23493. newChildren.push(this.children[i]);
  23494. newChildren.push(aSep);
  23495. }
  23496. newChildren.push(this.children[i]);
  23497. this.children = newChildren;
  23498. }
  23499. return this;
  23500. };
  23501. /**
  23502. * Call String.prototype.replace on the very right-most source snippet. Useful
  23503. * for trimming whitespace from the end of a source node, etc.
  23504. *
  23505. * @param aPattern The pattern to replace.
  23506. * @param aReplacement The thing to replace the pattern with.
  23507. */
  23508. SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
  23509. var lastChild = this.children[this.children.length - 1];
  23510. if (lastChild[isSourceNode]) {
  23511. lastChild.replaceRight(aPattern, aReplacement);
  23512. }
  23513. else if (typeof lastChild === 'string') {
  23514. this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
  23515. }
  23516. else {
  23517. this.children.push(''.replace(aPattern, aReplacement));
  23518. }
  23519. return this;
  23520. };
  23521. /**
  23522. * Set the source content for a source file. This will be added to the SourceMapGenerator
  23523. * in the sourcesContent field.
  23524. *
  23525. * @param aSourceFile The filename of the source file
  23526. * @param aSourceContent The content of the source file
  23527. */
  23528. SourceNode.prototype.setSourceContent =
  23529. function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
  23530. this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
  23531. };
  23532. /**
  23533. * Walk over the tree of SourceNodes. The walking function is called for each
  23534. * source file content and is passed the filename and source content.
  23535. *
  23536. * @param aFn The traversal function.
  23537. */
  23538. SourceNode.prototype.walkSourceContents =
  23539. function SourceNode_walkSourceContents(aFn) {
  23540. for (var i = 0, len = this.children.length; i < len; i++) {
  23541. if (this.children[i][isSourceNode]) {
  23542. this.children[i].walkSourceContents(aFn);
  23543. }
  23544. }
  23545. var sources = Object.keys(this.sourceContents);
  23546. for (var i = 0, len = sources.length; i < len; i++) {
  23547. aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
  23548. }
  23549. };
  23550. /**
  23551. * Return the string representation of this source node. Walks over the tree
  23552. * and concatenates all the various snippets together to one string.
  23553. */
  23554. SourceNode.prototype.toString = function SourceNode_toString() {
  23555. var str = "";
  23556. this.walk(function (chunk) {
  23557. str += chunk;
  23558. });
  23559. return str;
  23560. };
  23561. /**
  23562. * Returns the string representation of this source node along with a source
  23563. * map.
  23564. */
  23565. SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
  23566. var generated = {
  23567. code: "",
  23568. line: 1,
  23569. column: 0
  23570. };
  23571. var map = new SourceMapGenerator(aArgs);
  23572. var sourceMappingActive = false;
  23573. var lastOriginalSource = null;
  23574. var lastOriginalLine = null;
  23575. var lastOriginalColumn = null;
  23576. var lastOriginalName = null;
  23577. this.walk(function (chunk, original) {
  23578. generated.code += chunk;
  23579. if (original.source !== null
  23580. && original.line !== null
  23581. && original.column !== null) {
  23582. if(lastOriginalSource !== original.source
  23583. || lastOriginalLine !== original.line
  23584. || lastOriginalColumn !== original.column
  23585. || lastOriginalName !== original.name) {
  23586. map.addMapping({
  23587. source: original.source,
  23588. original: {
  23589. line: original.line,
  23590. column: original.column
  23591. },
  23592. generated: {
  23593. line: generated.line,
  23594. column: generated.column
  23595. },
  23596. name: original.name
  23597. });
  23598. }
  23599. lastOriginalSource = original.source;
  23600. lastOriginalLine = original.line;
  23601. lastOriginalColumn = original.column;
  23602. lastOriginalName = original.name;
  23603. sourceMappingActive = true;
  23604. } else if (sourceMappingActive) {
  23605. map.addMapping({
  23606. generated: {
  23607. line: generated.line,
  23608. column: generated.column
  23609. }
  23610. });
  23611. lastOriginalSource = null;
  23612. sourceMappingActive = false;
  23613. }
  23614. for (var idx = 0, length = chunk.length; idx < length; idx++) {
  23615. if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
  23616. generated.line++;
  23617. generated.column = 0;
  23618. // Mappings end at eol
  23619. if (idx + 1 === length) {
  23620. lastOriginalSource = null;
  23621. sourceMappingActive = false;
  23622. } else if (sourceMappingActive) {
  23623. map.addMapping({
  23624. source: original.source,
  23625. original: {
  23626. line: original.line,
  23627. column: original.column
  23628. },
  23629. generated: {
  23630. line: generated.line,
  23631. column: generated.column
  23632. },
  23633. name: original.name
  23634. });
  23635. }
  23636. } else {
  23637. generated.column++;
  23638. }
  23639. }
  23640. });
  23641. this.walkSourceContents(function (sourceFile, sourceContent) {
  23642. map.setSourceContent(sourceFile, sourceContent);
  23643. });
  23644. return { code: generated.code, map: map };
  23645. };
  23646. exports.SourceNode = SourceNode;
  23647. /***/ }),
  23648. /* 170 */
  23649. /***/ (function(module, exports, __webpack_require__) {
  23650. "use strict";
  23651. module.exports = false;
  23652. /***/ }),
  23653. /* 171 */
  23654. /***/ (function(module, exports) {
  23655. if (typeof Object.create === 'function') {
  23656. // implementation from standard node.js 'util' module
  23657. module.exports = function inherits(ctor, superCtor) {
  23658. ctor.super_ = superCtor
  23659. ctor.prototype = Object.create(superCtor.prototype, {
  23660. constructor: {
  23661. value: ctor,
  23662. enumerable: false,
  23663. writable: true,
  23664. configurable: true
  23665. }
  23666. });
  23667. };
  23668. } else {
  23669. // old school shim for old browsers
  23670. module.exports = function inherits(ctor, superCtor) {
  23671. ctor.super_ = superCtor
  23672. var TempCtor = function () {}
  23673. TempCtor.prototype = superCtor.prototype
  23674. ctor.prototype = new TempCtor()
  23675. ctor.prototype.constructor = ctor
  23676. }
  23677. }
  23678. /***/ }),
  23679. /* 172 */
  23680. /***/ (function(module, exports) {
  23681. module.exports = function isBuffer(arg) {
  23682. return arg && typeof arg === 'object'
  23683. && typeof arg.copy === 'function'
  23684. && typeof arg.fill === 'function'
  23685. && typeof arg.readUInt8 === 'function';
  23686. }
  23687. /***/ }),
  23688. /* 173 */
  23689. /***/ (function(module, exports, __webpack_require__) {
  23690. /* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
  23691. //
  23692. // Permission is hereby granted, free of charge, to any person obtaining a
  23693. // copy of this software and associated documentation files (the
  23694. // "Software"), to deal in the Software without restriction, including
  23695. // without limitation the rights to use, copy, modify, merge, publish,
  23696. // distribute, sublicense, and/or sell copies of the Software, and to permit
  23697. // persons to whom the Software is furnished to do so, subject to the
  23698. // following conditions:
  23699. //
  23700. // The above copyright notice and this permission notice shall be included
  23701. // in all copies or substantial portions of the Software.
  23702. //
  23703. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  23704. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  23705. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  23706. // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  23707. // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  23708. // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  23709. // USE OR OTHER DEALINGS IN THE SOFTWARE.
  23710. var formatRegExp = /%[sdj%]/g;
  23711. exports.format = function(f) {
  23712. if (!isString(f)) {
  23713. var objects = [];
  23714. for (var i = 0; i < arguments.length; i++) {
  23715. objects.push(inspect(arguments[i]));
  23716. }
  23717. return objects.join(' ');
  23718. }
  23719. var i = 1;
  23720. var args = arguments;
  23721. var len = args.length;
  23722. var str = String(f).replace(formatRegExp, function(x) {
  23723. if (x === '%%') return '%';
  23724. if (i >= len) return x;
  23725. switch (x) {
  23726. case '%s': return String(args[i++]);
  23727. case '%d': return Number(args[i++]);
  23728. case '%j':
  23729. try {
  23730. return JSON.stringify(args[i++]);
  23731. } catch (_) {
  23732. return '[Circular]';
  23733. }
  23734. default:
  23735. return x;
  23736. }
  23737. });
  23738. for (var x = args[i]; i < len; x = args[++i]) {
  23739. if (isNull(x) || !isObject(x)) {
  23740. str += ' ' + x;
  23741. } else {
  23742. str += ' ' + inspect(x);
  23743. }
  23744. }
  23745. return str;
  23746. };
  23747. // Mark that a method should not be used.
  23748. // Returns a modified function which warns once by default.
  23749. // If --no-deprecation is set, then it is a no-op.
  23750. exports.deprecate = function(fn, msg) {
  23751. // Allow for deprecating things in the process of starting up.
  23752. if (isUndefined(global.process)) {
  23753. return function() {
  23754. return exports.deprecate(fn, msg).apply(this, arguments);
  23755. };
  23756. }
  23757. if (process.noDeprecation === true) {
  23758. return fn;
  23759. }
  23760. var warned = false;
  23761. function deprecated() {
  23762. if (!warned) {
  23763. if (process.throwDeprecation) {
  23764. throw new Error(msg);
  23765. } else if (process.traceDeprecation) {
  23766. console.trace(msg);
  23767. } else {
  23768. console.error(msg);
  23769. }
  23770. warned = true;
  23771. }
  23772. return fn.apply(this, arguments);
  23773. }
  23774. return deprecated;
  23775. };
  23776. var debugs = {};
  23777. var debugEnviron;
  23778. exports.debuglog = function(set) {
  23779. if (isUndefined(debugEnviron))
  23780. debugEnviron = process.env.NODE_DEBUG || '';
  23781. set = set.toUpperCase();
  23782. if (!debugs[set]) {
  23783. if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
  23784. var pid = process.pid;
  23785. debugs[set] = function() {
  23786. var msg = exports.format.apply(exports, arguments);
  23787. console.error('%s %d: %s', set, pid, msg);
  23788. };
  23789. } else {
  23790. debugs[set] = function() {};
  23791. }
  23792. }
  23793. return debugs[set];
  23794. };
  23795. /**
  23796. * Echos the value of a value. Trys to print the value out
  23797. * in the best way possible given the different types.
  23798. *
  23799. * @param {Object} obj The object to print out.
  23800. * @param {Object} opts Optional options object that alters the output.
  23801. */
  23802. /* legacy: obj, showHidden, depth, colors*/
  23803. function inspect(obj, opts) {
  23804. // default options
  23805. var ctx = {
  23806. seen: [],
  23807. stylize: stylizeNoColor
  23808. };
  23809. // legacy...
  23810. if (arguments.length >= 3) ctx.depth = arguments[2];
  23811. if (arguments.length >= 4) ctx.colors = arguments[3];
  23812. if (isBoolean(opts)) {
  23813. // legacy...
  23814. ctx.showHidden = opts;
  23815. } else if (opts) {
  23816. // got an "options" object
  23817. exports._extend(ctx, opts);
  23818. }
  23819. // set default options
  23820. if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
  23821. if (isUndefined(ctx.depth)) ctx.depth = 2;
  23822. if (isUndefined(ctx.colors)) ctx.colors = false;
  23823. if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
  23824. if (ctx.colors) ctx.stylize = stylizeWithColor;
  23825. return formatValue(ctx, obj, ctx.depth);
  23826. }
  23827. exports.inspect = inspect;
  23828. // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
  23829. inspect.colors = {
  23830. 'bold' : [1, 22],
  23831. 'italic' : [3, 23],
  23832. 'underline' : [4, 24],
  23833. 'inverse' : [7, 27],
  23834. 'white' : [37, 39],
  23835. 'grey' : [90, 39],
  23836. 'black' : [30, 39],
  23837. 'blue' : [34, 39],
  23838. 'cyan' : [36, 39],
  23839. 'green' : [32, 39],
  23840. 'magenta' : [35, 39],
  23841. 'red' : [31, 39],
  23842. 'yellow' : [33, 39]
  23843. };
  23844. // Don't use 'blue' not visible on cmd.exe
  23845. inspect.styles = {
  23846. 'special': 'cyan',
  23847. 'number': 'yellow',
  23848. 'boolean': 'yellow',
  23849. 'undefined': 'grey',
  23850. 'null': 'bold',
  23851. 'string': 'green',
  23852. 'date': 'magenta',
  23853. // "name": intentionally not styling
  23854. 'regexp': 'red'
  23855. };
  23856. function stylizeWithColor(str, styleType) {
  23857. var style = inspect.styles[styleType];
  23858. if (style) {
  23859. return '\u001b[' + inspect.colors[style][0] + 'm' + str +
  23860. '\u001b[' + inspect.colors[style][1] + 'm';
  23861. } else {
  23862. return str;
  23863. }
  23864. }
  23865. function stylizeNoColor(str, styleType) {
  23866. return str;
  23867. }
  23868. function arrayToHash(array) {
  23869. var hash = {};
  23870. array.forEach(function(val, idx) {
  23871. hash[val] = true;
  23872. });
  23873. return hash;
  23874. }
  23875. function formatValue(ctx, value, recurseTimes) {
  23876. // Provide a hook for user-specified inspect functions.
  23877. // Check that value is an object with an inspect function on it
  23878. if (ctx.customInspect &&
  23879. value &&
  23880. isFunction(value.inspect) &&
  23881. // Filter out the util module, it's inspect function is special
  23882. value.inspect !== exports.inspect &&
  23883. // Also filter out any prototype objects using the circular check.
  23884. !(value.constructor && value.constructor.prototype === value)) {
  23885. var ret = value.inspect(recurseTimes, ctx);
  23886. if (!isString(ret)) {
  23887. ret = formatValue(ctx, ret, recurseTimes);
  23888. }
  23889. return ret;
  23890. }
  23891. // Primitive types cannot have properties
  23892. var primitive = formatPrimitive(ctx, value);
  23893. if (primitive) {
  23894. return primitive;
  23895. }
  23896. // Look up the keys of the object.
  23897. var keys = Object.keys(value);
  23898. var visibleKeys = arrayToHash(keys);
  23899. if (ctx.showHidden) {
  23900. keys = Object.getOwnPropertyNames(value);
  23901. }
  23902. // IE doesn't make error fields non-enumerable
  23903. // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
  23904. if (isError(value)
  23905. && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
  23906. return formatError(value);
  23907. }
  23908. // Some type of object without properties can be shortcutted.
  23909. if (keys.length === 0) {
  23910. if (isFunction(value)) {
  23911. var name = value.name ? ': ' + value.name : '';
  23912. return ctx.stylize('[Function' + name + ']', 'special');
  23913. }
  23914. if (isRegExp(value)) {
  23915. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  23916. }
  23917. if (isDate(value)) {
  23918. return ctx.stylize(Date.prototype.toString.call(value), 'date');
  23919. }
  23920. if (isError(value)) {
  23921. return formatError(value);
  23922. }
  23923. }
  23924. var base = '', array = false, braces = ['{', '}'];
  23925. // Make Array say that they are Array
  23926. if (isArray(value)) {
  23927. array = true;
  23928. braces = ['[', ']'];
  23929. }
  23930. // Make functions say that they are functions
  23931. if (isFunction(value)) {
  23932. var n = value.name ? ': ' + value.name : '';
  23933. base = ' [Function' + n + ']';
  23934. }
  23935. // Make RegExps say that they are RegExps
  23936. if (isRegExp(value)) {
  23937. base = ' ' + RegExp.prototype.toString.call(value);
  23938. }
  23939. // Make dates with properties first say the date
  23940. if (isDate(value)) {
  23941. base = ' ' + Date.prototype.toUTCString.call(value);
  23942. }
  23943. // Make error with message first say the error
  23944. if (isError(value)) {
  23945. base = ' ' + formatError(value);
  23946. }
  23947. if (keys.length === 0 && (!array || value.length == 0)) {
  23948. return braces[0] + base + braces[1];
  23949. }
  23950. if (recurseTimes < 0) {
  23951. if (isRegExp(value)) {
  23952. return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
  23953. } else {
  23954. return ctx.stylize('[Object]', 'special');
  23955. }
  23956. }
  23957. ctx.seen.push(value);
  23958. var output;
  23959. if (array) {
  23960. output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
  23961. } else {
  23962. output = keys.map(function(key) {
  23963. return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
  23964. });
  23965. }
  23966. ctx.seen.pop();
  23967. return reduceToSingleString(output, base, braces);
  23968. }
  23969. function formatPrimitive(ctx, value) {
  23970. if (isUndefined(value))
  23971. return ctx.stylize('undefined', 'undefined');
  23972. if (isString(value)) {
  23973. var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
  23974. .replace(/'/g, "\\'")
  23975. .replace(/\\"/g, '"') + '\'';
  23976. return ctx.stylize(simple, 'string');
  23977. }
  23978. if (isNumber(value))
  23979. return ctx.stylize('' + value, 'number');
  23980. if (isBoolean(value))
  23981. return ctx.stylize('' + value, 'boolean');
  23982. // For some reason typeof null is "object", so special case here.
  23983. if (isNull(value))
  23984. return ctx.stylize('null', 'null');
  23985. }
  23986. function formatError(value) {
  23987. return '[' + Error.prototype.toString.call(value) + ']';
  23988. }
  23989. function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
  23990. var output = [];
  23991. for (var i = 0, l = value.length; i < l; ++i) {
  23992. if (hasOwnProperty(value, String(i))) {
  23993. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
  23994. String(i), true));
  23995. } else {
  23996. output.push('');
  23997. }
  23998. }
  23999. keys.forEach(function(key) {
  24000. if (!key.match(/^\d+$/)) {
  24001. output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
  24002. key, true));
  24003. }
  24004. });
  24005. return output;
  24006. }
  24007. function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
  24008. var name, str, desc;
  24009. desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
  24010. if (desc.get) {
  24011. if (desc.set) {
  24012. str = ctx.stylize('[Getter/Setter]', 'special');
  24013. } else {
  24014. str = ctx.stylize('[Getter]', 'special');
  24015. }
  24016. } else {
  24017. if (desc.set) {
  24018. str = ctx.stylize('[Setter]', 'special');
  24019. }
  24020. }
  24021. if (!hasOwnProperty(visibleKeys, key)) {
  24022. name = '[' + key + ']';
  24023. }
  24024. if (!str) {
  24025. if (ctx.seen.indexOf(desc.value) < 0) {
  24026. if (isNull(recurseTimes)) {
  24027. str = formatValue(ctx, desc.value, null);
  24028. } else {
  24029. str = formatValue(ctx, desc.value, recurseTimes - 1);
  24030. }
  24031. if (str.indexOf('\n') > -1) {
  24032. if (array) {
  24033. str = str.split('\n').map(function(line) {
  24034. return ' ' + line;
  24035. }).join('\n').substr(2);
  24036. } else {
  24037. str = '\n' + str.split('\n').map(function(line) {
  24038. return ' ' + line;
  24039. }).join('\n');
  24040. }
  24041. }
  24042. } else {
  24043. str = ctx.stylize('[Circular]', 'special');
  24044. }
  24045. }
  24046. if (isUndefined(name)) {
  24047. if (array && key.match(/^\d+$/)) {
  24048. return str;
  24049. }
  24050. name = JSON.stringify('' + key);
  24051. if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
  24052. name = name.substr(1, name.length - 2);
  24053. name = ctx.stylize(name, 'name');
  24054. } else {
  24055. name = name.replace(/'/g, "\\'")
  24056. .replace(/\\"/g, '"')
  24057. .replace(/(^"|"$)/g, "'");
  24058. name = ctx.stylize(name, 'string');
  24059. }
  24060. }
  24061. return name + ': ' + str;
  24062. }
  24063. function reduceToSingleString(output, base, braces) {
  24064. var numLinesEst = 0;
  24065. var length = output.reduce(function(prev, cur) {
  24066. numLinesEst++;
  24067. if (cur.indexOf('\n') >= 0) numLinesEst++;
  24068. return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
  24069. }, 0);
  24070. if (length > 60) {
  24071. return braces[0] +
  24072. (base === '' ? '' : base + '\n ') +
  24073. ' ' +
  24074. output.join(',\n ') +
  24075. ' ' +
  24076. braces[1];
  24077. }
  24078. return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
  24079. }
  24080. // NOTE: These type checking functions intentionally don't use `instanceof`
  24081. // because it is fragile and can be easily faked with `Object.create()`.
  24082. function isArray(ar) {
  24083. return Array.isArray(ar);
  24084. }
  24085. exports.isArray = isArray;
  24086. function isBoolean(arg) {
  24087. return typeof arg === 'boolean';
  24088. }
  24089. exports.isBoolean = isBoolean;
  24090. function isNull(arg) {
  24091. return arg === null;
  24092. }
  24093. exports.isNull = isNull;
  24094. function isNullOrUndefined(arg) {
  24095. return arg == null;
  24096. }
  24097. exports.isNullOrUndefined = isNullOrUndefined;
  24098. function isNumber(arg) {
  24099. return typeof arg === 'number';
  24100. }
  24101. exports.isNumber = isNumber;
  24102. function isString(arg) {
  24103. return typeof arg === 'string';
  24104. }
  24105. exports.isString = isString;
  24106. function isSymbol(arg) {
  24107. return typeof arg === 'symbol';
  24108. }
  24109. exports.isSymbol = isSymbol;
  24110. function isUndefined(arg) {
  24111. return arg === void 0;
  24112. }
  24113. exports.isUndefined = isUndefined;
  24114. function isRegExp(re) {
  24115. return isObject(re) && objectToString(re) === '[object RegExp]';
  24116. }
  24117. exports.isRegExp = isRegExp;
  24118. function isObject(arg) {
  24119. return typeof arg === 'object' && arg !== null;
  24120. }
  24121. exports.isObject = isObject;
  24122. function isDate(d) {
  24123. return isObject(d) && objectToString(d) === '[object Date]';
  24124. }
  24125. exports.isDate = isDate;
  24126. function isError(e) {
  24127. return isObject(e) &&
  24128. (objectToString(e) === '[object Error]' || e instanceof Error);
  24129. }
  24130. exports.isError = isError;
  24131. function isFunction(arg) {
  24132. return typeof arg === 'function';
  24133. }
  24134. exports.isFunction = isFunction;
  24135. function isPrimitive(arg) {
  24136. return arg === null ||
  24137. typeof arg === 'boolean' ||
  24138. typeof arg === 'number' ||
  24139. typeof arg === 'string' ||
  24140. typeof arg === 'symbol' || // ES6 symbol
  24141. typeof arg === 'undefined';
  24142. }
  24143. exports.isPrimitive = isPrimitive;
  24144. exports.isBuffer = __webpack_require__(172);
  24145. function objectToString(o) {
  24146. return Object.prototype.toString.call(o);
  24147. }
  24148. function pad(n) {
  24149. return n < 10 ? '0' + n.toString(10) : n.toString(10);
  24150. }
  24151. var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
  24152. 'Oct', 'Nov', 'Dec'];
  24153. // 26 Feb 16:19:34
  24154. function timestamp() {
  24155. var d = new Date();
  24156. var time = [pad(d.getHours()),
  24157. pad(d.getMinutes()),
  24158. pad(d.getSeconds())].join(':');
  24159. return [d.getDate(), months[d.getMonth()], time].join(' ');
  24160. }
  24161. // log is just a thin wrapper to console.log that prepends a timestamp
  24162. exports.log = function() {
  24163. console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
  24164. };
  24165. /**
  24166. * Inherit the prototype methods from one constructor into another.
  24167. *
  24168. * The Function.prototype.inherits from lang.js rewritten as a standalone
  24169. * function (not on Function.prototype). NOTE: If this file is to be loaded
  24170. * during bootstrapping this function needs to be rewritten using some native
  24171. * functions as prototype setup using normal JavaScript does not work as
  24172. * expected during bootstrapping (see mirror.js in r114903).
  24173. *
  24174. * @param {function} ctor Constructor function which needs to inherit the
  24175. * prototype.
  24176. * @param {function} superCtor Constructor function to inherit prototype from.
  24177. */
  24178. exports.inherits = __webpack_require__(171);
  24179. exports._extend = function(origin, add) {
  24180. // Don't do anything if add isn't an object
  24181. if (!add || !isObject(add)) return origin;
  24182. var keys = Object.keys(add);
  24183. var i = keys.length;
  24184. while (i--) {
  24185. origin[keys[i]] = add[keys[i]];
  24186. }
  24187. return origin;
  24188. };
  24189. function hasOwnProperty(obj, prop) {
  24190. return Object.prototype.hasOwnProperty.call(obj, prop);
  24191. }
  24192. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(30), __webpack_require__(14)))
  24193. /***/ }),
  24194. /* 174 */
  24195. /***/ (function(module, exports) {
  24196. module.exports = function(module) {
  24197. if(!module.webpackPolyfill) {
  24198. module.deprecate = function() {};
  24199. module.paths = [];
  24200. // module.parent = undefined by default
  24201. if(!module.children) module.children = [];
  24202. Object.defineProperty(module, "loaded", {
  24203. enumerable: true,
  24204. get: function() {
  24205. return module.l;
  24206. }
  24207. });
  24208. Object.defineProperty(module, "id", {
  24209. enumerable: true,
  24210. get: function() {
  24211. return module.i;
  24212. }
  24213. });
  24214. module.webpackPolyfill = 1;
  24215. }
  24216. return module;
  24217. };
  24218. /***/ }),
  24219. /* 175 */
  24220. /***/ (function(module, exports, __webpack_require__) {
  24221. "use strict";
  24222. const createError = __webpack_require__(94);
  24223. const parseFrontMatter = __webpack_require__(96);
  24224. const lineColumnToIndex = __webpack_require__(97);
  24225. // utils
  24226. const utils = __webpack_require__(95);
  24227. const isSCSS = utils.isSCSS;
  24228. const isSCSSNestedPropertyNode = utils.isSCSSNestedPropertyNode;
  24229. function parseValueNodes(nodes) {
  24230. let parenGroup = {
  24231. open: null,
  24232. close: null,
  24233. groups: [],
  24234. type: "paren_group"
  24235. };
  24236. const parenGroupStack = [parenGroup];
  24237. const rootParenGroup = parenGroup;
  24238. let commaGroup = {
  24239. groups: [],
  24240. type: "comma_group"
  24241. };
  24242. const commaGroupStack = [commaGroup];
  24243. for (let i = 0; i < nodes.length; ++i) {
  24244. const node = nodes[i];
  24245. const isUnquotedDataURLCall =
  24246. node.type === "func" &&
  24247. node.value === "url" &&
  24248. node.group &&
  24249. node.group.groups &&
  24250. node.group.groups[0] &&
  24251. node.group.groups[0].groups &&
  24252. node.group.groups[0].groups.length > 2 &&
  24253. node.group.groups[0].groups[0].type === "word" &&
  24254. node.group.groups[0].groups[0].value === "data" &&
  24255. node.group.groups[0].groups[1].type === "colon" &&
  24256. node.group.groups[0].groups[1].value === ":";
  24257. if (isUnquotedDataURLCall) {
  24258. node.group.groups = [stringifyGroup(node)];
  24259. }
  24260. if (node.type === "paren" && node.value === "(") {
  24261. parenGroup = {
  24262. open: node,
  24263. close: null,
  24264. groups: [],
  24265. type: "paren_group"
  24266. };
  24267. parenGroupStack.push(parenGroup);
  24268. commaGroup = {
  24269. groups: [],
  24270. type: "comma_group"
  24271. };
  24272. commaGroupStack.push(commaGroup);
  24273. } else if (node.type === "paren" && node.value === ")") {
  24274. if (commaGroup.groups.length) {
  24275. parenGroup.groups.push(commaGroup);
  24276. }
  24277. parenGroup.close = node;
  24278. if (commaGroupStack.length === 1) {
  24279. throw new Error("Unbalanced parenthesis");
  24280. }
  24281. commaGroupStack.pop();
  24282. commaGroup = commaGroupStack[commaGroupStack.length - 1];
  24283. commaGroup.groups.push(parenGroup);
  24284. parenGroupStack.pop();
  24285. parenGroup = parenGroupStack[parenGroupStack.length - 1];
  24286. } else if (node.type === "comma") {
  24287. parenGroup.groups.push(commaGroup);
  24288. commaGroup = {
  24289. groups: [],
  24290. type: "comma_group"
  24291. };
  24292. commaGroupStack[commaGroupStack.length - 1] = commaGroup;
  24293. } else {
  24294. commaGroup.groups.push(node);
  24295. }
  24296. }
  24297. if (commaGroup.groups.length > 0) {
  24298. parenGroup.groups.push(commaGroup);
  24299. }
  24300. return rootParenGroup;
  24301. }
  24302. function stringifyGroup(node) {
  24303. if (node.group) {
  24304. return stringifyGroup(node.group);
  24305. }
  24306. if (node.groups) {
  24307. return node.groups.reduce((previousValue, currentValue, index) => {
  24308. return (
  24309. previousValue +
  24310. stringifyGroup(currentValue) +
  24311. (currentValue.type === "comma_group" && index !== node.groups.length - 1
  24312. ? ","
  24313. : "")
  24314. );
  24315. }, "");
  24316. }
  24317. const before = node.raws && node.raws.before ? node.raws.before : "";
  24318. const value = node.value ? node.value : "";
  24319. const unit = node.unit ? node.unit : "";
  24320. const after = node.raws && node.raws.after ? node.raws.after : "";
  24321. return before + value + unit + after;
  24322. }
  24323. function flattenGroups(node) {
  24324. if (
  24325. node.type === "paren_group" &&
  24326. !node.open &&
  24327. !node.close &&
  24328. node.groups.length === 1
  24329. ) {
  24330. return flattenGroups(node.groups[0]);
  24331. }
  24332. if (node.type === "comma_group" && node.groups.length === 1) {
  24333. return flattenGroups(node.groups[0]);
  24334. }
  24335. if (node.type === "paren_group" || node.type === "comma_group") {
  24336. return Object.assign({}, node, { groups: node.groups.map(flattenGroups) });
  24337. }
  24338. return node;
  24339. }
  24340. function addTypePrefix(node, prefix) {
  24341. if (node && typeof node === "object") {
  24342. delete node.parent;
  24343. for (const key in node) {
  24344. addTypePrefix(node[key], prefix);
  24345. if (key === "type" && typeof node[key] === "string") {
  24346. if (!node[key].startsWith(prefix)) {
  24347. node[key] = prefix + node[key];
  24348. }
  24349. }
  24350. }
  24351. }
  24352. return node;
  24353. }
  24354. function addMissingType(node) {
  24355. if (node && typeof node === "object") {
  24356. delete node.parent;
  24357. for (const key in node) {
  24358. addMissingType(node[key]);
  24359. }
  24360. if (!Array.isArray(node) && node.value && !node.type) {
  24361. node.type = "unknown";
  24362. }
  24363. }
  24364. return node;
  24365. }
  24366. function parseNestedValue(node) {
  24367. if (node && typeof node === "object") {
  24368. delete node.parent;
  24369. for (const key in node) {
  24370. parseNestedValue(node[key]);
  24371. if (key === "nodes") {
  24372. node.group = flattenGroups(parseValueNodes(node[key]));
  24373. delete node[key];
  24374. }
  24375. }
  24376. }
  24377. return node;
  24378. }
  24379. function parseValue(value) {
  24380. const valueParser = __webpack_require__(93);
  24381. let result = null;
  24382. try {
  24383. result = valueParser(value, { loose: true }).parse();
  24384. } catch (e) {
  24385. return {
  24386. type: "value-unknown",
  24387. value: value
  24388. };
  24389. }
  24390. const parsedResult = parseNestedValue(result);
  24391. return addTypePrefix(parsedResult, "value-");
  24392. }
  24393. function parseSelector(selector) {
  24394. // If there's a comment inside of a selector, the parser tries to parse
  24395. // the content of the comment as selectors which turns it into complete
  24396. // garbage. Better to print the whole selector as-is and not try to parse
  24397. // and reformat it.
  24398. if (selector.match(/\/\/|\/\*/)) {
  24399. return {
  24400. type: "selector-unknown",
  24401. value: selector.replace(/^ +/, "").replace(/ +$/, "")
  24402. };
  24403. }
  24404. const selectorParser = __webpack_require__(92);
  24405. let result = null;
  24406. try {
  24407. selectorParser(result_ => {
  24408. result = result_;
  24409. }).process(selector);
  24410. } catch (e) {
  24411. // Fail silently. It's better to print it as is than to try and parse it
  24412. // Note: A common failure is for SCSS nested properties. `background:
  24413. // none { color: red; }` is parsed as a NestedDeclaration by
  24414. // postcss-scss, while `background: { color: red; }` is parsed as a Rule
  24415. // with a selector ending with a colon. See:
  24416. // https://github.com/postcss/postcss-scss/issues/39
  24417. return {
  24418. type: "selector-unknown",
  24419. value: selector
  24420. };
  24421. }
  24422. return addTypePrefix(result, "selector-");
  24423. }
  24424. function parseMediaQuery(params) {
  24425. const mediaParser = __webpack_require__(90).default;
  24426. let result = null;
  24427. try {
  24428. result = mediaParser(params);
  24429. } catch (e) {
  24430. // Ignore bad media queries
  24431. return {
  24432. type: "selector-unknown",
  24433. value: params
  24434. };
  24435. }
  24436. return addTypePrefix(addMissingType(result), "media-");
  24437. }
  24438. const DEFAULT_SCSS_DIRECTIVE = /(\s*?)(!default).*$/;
  24439. const GLOBAL_SCSS_DIRECTIVE = /(\s*?)(!global).*$/;
  24440. function parseNestedCSS(node) {
  24441. if (node && typeof node === "object") {
  24442. delete node.parent;
  24443. for (const key in node) {
  24444. parseNestedCSS(node[key]);
  24445. }
  24446. if (!node.type) {
  24447. return node;
  24448. }
  24449. if (!node.raws) {
  24450. node.raws = {};
  24451. }
  24452. let selector = "";
  24453. if (typeof node.selector === "string") {
  24454. selector = node.raws.selector
  24455. ? node.raws.selector.scss
  24456. ? node.raws.selector.scss
  24457. : node.raws.selector.raw
  24458. : node.selector;
  24459. if (node.raws.between && node.raws.between.trim().length > 0) {
  24460. selector += node.raws.between;
  24461. }
  24462. node.raws.selector = selector;
  24463. }
  24464. let value = "";
  24465. if (typeof node.value === "string") {
  24466. value = node.raws.value
  24467. ? node.raws.value.scss
  24468. ? node.raws.value.scss
  24469. : node.raws.value.raw
  24470. : node.value;
  24471. value = value.trim();
  24472. node.raws.value = selector;
  24473. }
  24474. let params = "";
  24475. if (typeof node.params === "string") {
  24476. params = node.raws.params
  24477. ? node.raws.params.scss
  24478. ? node.raws.params.scss
  24479. : node.raws.params.raw
  24480. : node.params;
  24481. if (node.raws.afterName && node.raws.afterName.trim().length > 0) {
  24482. params = node.raws.afterName + params;
  24483. }
  24484. if (node.raws.between && node.raws.between.trim().length > 0) {
  24485. params = params + node.raws.between;
  24486. }
  24487. params = params.trim();
  24488. node.raws.params = params;
  24489. }
  24490. // Ignore LESS mixin declaration
  24491. if (selector.trim().length > 0) {
  24492. if (selector.startsWith("@") && selector.endsWith(":")) {
  24493. return node;
  24494. }
  24495. // Ignore LESS mixins
  24496. if (node.mixin) {
  24497. node.selector = parseValue(selector);
  24498. return node;
  24499. }
  24500. // Check on SCSS nested property
  24501. if (isSCSSNestedPropertyNode(node)) {
  24502. node.isSCSSNesterProperty = true;
  24503. }
  24504. node.selector = parseSelector(selector);
  24505. return node;
  24506. }
  24507. if (node.type !== "css-comment-yaml" && value.length > 0) {
  24508. const defaultSCSSDirectiveIndex = value.match(DEFAULT_SCSS_DIRECTIVE);
  24509. if (defaultSCSSDirectiveIndex) {
  24510. value = value.substring(0, defaultSCSSDirectiveIndex.index);
  24511. node.scssDefault = true;
  24512. if (defaultSCSSDirectiveIndex[0].trim() !== "!default") {
  24513. node.raws.scssDefault = defaultSCSSDirectiveIndex[0];
  24514. }
  24515. }
  24516. const globalSCSSDirectiveIndex = value.match(GLOBAL_SCSS_DIRECTIVE);
  24517. if (globalSCSSDirectiveIndex) {
  24518. value = value.substring(0, globalSCSSDirectiveIndex.index);
  24519. node.scssGlobal = true;
  24520. if (globalSCSSDirectiveIndex[0].trim() !== "!global") {
  24521. node.raws.scssGlobal = globalSCSSDirectiveIndex[0];
  24522. }
  24523. }
  24524. if (value.startsWith("progid:")) {
  24525. return {
  24526. type: "value-unknown",
  24527. value: value
  24528. };
  24529. }
  24530. node.value = parseValue(value);
  24531. }
  24532. if (node.type === "css-atrule" && params.length > 0) {
  24533. const name = node.name;
  24534. const lowercasedName = node.name.toLowerCase();
  24535. if (name === "warn" || name === "error") {
  24536. node.params = {
  24537. type: "media-unknown",
  24538. value: params
  24539. };
  24540. return node;
  24541. }
  24542. if (name === "extend" || name === "nest") {
  24543. node.selector = parseSelector(params);
  24544. delete node.params;
  24545. return node;
  24546. }
  24547. if (name === "at-root") {
  24548. if (/^\(\s*(without|with)\s*:[\s\S]+\)$/.test(params)) {
  24549. node.params = parseValue(params);
  24550. } else {
  24551. node.selector = parseSelector(params);
  24552. delete node.params;
  24553. }
  24554. return node;
  24555. }
  24556. if (lowercasedName === "import") {
  24557. node.params = parseValue(params);
  24558. return node;
  24559. }
  24560. if (
  24561. [
  24562. "namespace",
  24563. "supports",
  24564. "if",
  24565. "else",
  24566. "for",
  24567. "each",
  24568. "while",
  24569. "debug",
  24570. "mixin",
  24571. "include",
  24572. "function",
  24573. "return",
  24574. "define-mixin",
  24575. "add-mixin"
  24576. ].indexOf(name) !== -1
  24577. ) {
  24578. // Remove unnecessary spaces in SCSS variable arguments
  24579. params = params.replace(/(\$\S+?)\s+?\.\.\./, "$1...");
  24580. // Remove unnecessary spaces before SCSS control, mixin and function directives
  24581. params = params.replace(/^(?!if)(\S+)\s+\(/, "$1(");
  24582. node.value = parseValue(params);
  24583. delete node.params;
  24584. return node;
  24585. }
  24586. if (name === "custom-selector") {
  24587. const customSelector = params.match(/:--\S+?\s+/)[0].trim();
  24588. node.customSelector = customSelector;
  24589. node.selector = parseSelector(params.substring(customSelector.length));
  24590. delete node.params;
  24591. return node;
  24592. }
  24593. if (["media", "custom-media"].indexOf(lowercasedName) !== -1) {
  24594. if (params.includes("#{")) {
  24595. // Workaround for media at rule with scss interpolation
  24596. return {
  24597. type: "media-unknown",
  24598. value: params
  24599. };
  24600. }
  24601. node.params = parseMediaQuery(params);
  24602. return node;
  24603. }
  24604. node.params = params;
  24605. return node;
  24606. }
  24607. }
  24608. return node;
  24609. }
  24610. function parseWithParser(parser, text) {
  24611. const parsed = parseFrontMatter(text);
  24612. const frontMatter = parsed.frontMatter;
  24613. text = parsed.content;
  24614. let result;
  24615. try {
  24616. result = parser.parse(text);
  24617. } catch (e) {
  24618. if (typeof e.line !== "number") {
  24619. throw e;
  24620. }
  24621. throw createError("(postcss) " + e.name + " " + e.reason, { start: e });
  24622. }
  24623. result = parseNestedCSS(addTypePrefix(result, "css-"));
  24624. if (frontMatter) {
  24625. result.nodes.unshift({
  24626. type: "front-matter",
  24627. value: frontMatter
  24628. });
  24629. }
  24630. return result;
  24631. }
  24632. function requireParser(isSCSSParser) {
  24633. if (isSCSSParser) {
  24634. return __webpack_require__(91);
  24635. }
  24636. // TODO: Remove this hack when this issue is fixed:
  24637. // https://github.com/shellscape/postcss-less/issues/88
  24638. const LessParser = __webpack_require__(31);
  24639. LessParser.prototype.atrule = function() {
  24640. return Object.getPrototypeOf(LessParser.prototype).atrule.apply(
  24641. this,
  24642. arguments
  24643. );
  24644. };
  24645. return __webpack_require__(89);
  24646. }
  24647. function parse(text, parsers, opts) {
  24648. const hasExplicitParserChoice =
  24649. opts.parser === "less" || opts.parser === "scss";
  24650. const isSCSSParser = isSCSS(opts.parser, text);
  24651. try {
  24652. return parseWithParser(requireParser(isSCSSParser), text);
  24653. } catch (originalError) {
  24654. if (hasExplicitParserChoice) {
  24655. throw originalError;
  24656. }
  24657. try {
  24658. return parseWithParser(requireParser(!isSCSSParser), text);
  24659. } catch (_secondError) {
  24660. throw originalError;
  24661. }
  24662. }
  24663. }
  24664. const parser = {
  24665. parse,
  24666. astFormat: "postcss",
  24667. locStart(node) {
  24668. if (node.source) {
  24669. return lineColumnToIndex(node.source.start, node.source.input.css) - 1;
  24670. }
  24671. return null;
  24672. },
  24673. locEnd(node) {
  24674. const endNode = node.nodes && node.nodes[node.nodes.length - 1];
  24675. if (endNode && node.source && !node.source.end) {
  24676. node = endNode;
  24677. }
  24678. if (node.source) {
  24679. return lineColumnToIndex(node.source.end, node.source.input.css);
  24680. }
  24681. return null;
  24682. }
  24683. };
  24684. // Export as a plugin so we can reuse the same bundle for UMD loading
  24685. module.exports = {
  24686. parsers: {
  24687. css: parser,
  24688. less: parser,
  24689. scss: parser
  24690. }
  24691. };
  24692. /***/ }),
  24693. /* 176 */
  24694. /***/ (function(module, exports) {
  24695. /* (ignored) */
  24696. /***/ }),
  24697. /* 177 */
  24698. /***/ (function(module, exports) {
  24699. /* (ignored) */
  24700. /***/ }),
  24701. /* 178 */
  24702. /***/ (function(module, exports) {
  24703. /* (ignored) */
  24704. /***/ })
  24705. /******/ ]);
  24706. });