| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312118313118314118315118316118317118318118319118320118321118322118323118324118325118326118327118328118329118330118331118332118333118334118335118336118337118338118339118340118341118342118343118344118345118346118347118348118349118350118351118352118353118354118355118356118357118358118359118360118361118362118363118364118365118366118367118368118369118370118371118372118373118374118375118376118377118378118379118380118381118382118383118384118385118386118387118388118389118390118391118392118393118394118395118396118397118398118399118400118401118402118403118404118405118406118407118408118409118410118411118412118413118414118415118416118417118418118419118420118421118422118423118424118425118426118427118428118429118430118431118432118433118434118435118436118437118438118439118440118441118442118443118444118445118446118447118448118449118450118451118452118453118454118455118456118457118458118459118460118461118462118463118464118465118466118467118468118469118470118471118472118473118474118475118476118477118478118479118480118481118482118483118484118485118486118487118488118489118490118491118492118493118494118495118496118497118498118499118500118501118502118503118504118505118506118507118508118509118510118511118512118513118514118515118516118517118518118519118520118521118522118523118524118525118526118527118528118529118530118531118532118533118534118535118536118537118538118539118540118541118542118543118544118545118546118547118548118549118550118551118552118553118554118555118556118557118558118559118560118561118562118563118564118565118566118567118568118569118570118571118572118573118574118575118576118577118578118579118580118581118582118583118584118585118586118587118588118589118590118591118592118593118594118595118596118597118598118599118600118601118602118603118604118605118606118607118608118609118610118611118612118613118614118615118616118617118618118619118620118621118622118623118624118625118626118627118628118629118630118631118632118633118634118635118636118637118638118639118640118641118642118643118644118645118646118647118648118649118650118651118652118653118654118655118656118657118658118659118660118661118662118663118664118665118666118667118668118669118670118671118672118673118674118675118676118677118678118679118680118681118682118683118684118685118686118687118688118689118690118691118692118693118694118695118696118697118698118699118700118701118702118703118704118705118706118707118708118709118710118711118712118713118714118715118716118717118718118719118720118721118722118723118724118725118726118727118728118729118730118731118732118733118734118735118736118737118738118739118740118741118742118743118744118745118746118747118748118749118750118751118752118753118754118755118756118757118758118759118760118761118762118763118764118765118766118767118768118769118770118771118772118773118774118775118776118777118778118779118780118781118782118783118784118785118786118787118788118789118790118791118792118793118794118795118796118797118798118799118800118801118802118803118804118805118806118807118808118809118810118811118812118813118814118815118816118817118818118819118820118821118822118823118824118825118826118827118828118829118830118831118832118833118834118835118836118837118838118839118840118841118842118843118844118845118846118847118848118849118850118851118852118853118854118855118856118857118858118859118860118861118862118863118864118865118866118867118868118869118870118871118872118873118874118875118876118877118878118879118880118881118882118883118884118885118886118887118888118889118890118891118892118893118894118895118896118897118898118899118900118901118902118903118904118905118906118907118908118909118910118911118912118913118914118915118916118917118918118919118920118921118922118923118924118925118926118927118928118929118930118931118932118933118934118935118936118937118938118939118940118941118942118943118944118945118946118947118948118949118950118951118952118953118954118955118956118957118958118959118960118961118962118963118964118965118966118967118968118969118970118971118972118973118974118975118976118977118978118979118980118981118982118983118984118985118986118987118988118989118990118991118992118993118994118995118996118997118998118999119000119001119002119003119004119005119006119007119008119009119010119011119012119013119014119015119016119017119018119019119020119021119022119023119024119025119026119027119028119029119030119031119032119033119034119035119036119037119038119039119040119041119042119043119044119045119046119047119048119049119050119051119052119053119054119055119056119057119058119059119060119061119062119063119064119065119066119067119068119069119070119071119072119073119074119075119076119077119078119079119080119081119082119083119084119085119086119087119088119089119090119091119092119093119094119095119096119097119098119099119100119101119102119103119104119105119106119107119108119109119110119111119112119113119114119115119116119117119118119119119120119121119122119123119124119125119126119127119128119129119130119131119132119133119134119135119136119137119138119139119140119141119142119143119144119145119146119147119148119149119150119151119152119153119154119155119156119157119158119159119160119161119162119163119164119165119166119167119168119169119170119171119172119173119174119175119176119177119178119179119180119181119182119183119184119185119186119187119188119189119190119191119192119193119194119195119196119197119198119199119200119201119202119203119204119205119206119207119208119209119210119211119212119213119214119215119216119217119218119219119220119221119222119223119224119225119226119227119228119229119230119231119232119233119234119235119236119237119238119239119240119241119242119243119244119245119246119247119248119249119250119251119252119253119254119255119256119257119258119259119260119261119262119263119264119265119266119267119268119269119270119271119272119273119274119275119276119277119278119279119280119281119282119283119284119285119286119287119288119289119290119291119292119293119294119295119296119297119298119299119300119301119302119303119304119305119306119307119308119309119310119311119312119313119314119315119316119317119318119319119320119321119322119323119324119325119326119327119328119329119330119331119332119333119334119335119336119337119338119339119340119341119342119343119344119345119346119347119348119349119350119351119352119353119354119355119356119357119358119359119360119361119362119363119364119365119366119367119368119369119370119371119372119373119374119375119376119377119378119379119380119381119382119383119384119385119386119387119388119389119390119391119392119393119394119395119396119397119398119399119400119401119402119403119404119405119406119407119408119409119410119411119412119413119414119415119416119417119418119419119420119421119422119423119424119425119426119427119428119429119430119431119432119433119434119435119436119437119438119439119440119441119442119443119444119445119446119447119448119449119450119451119452119453119454119455119456119457119458119459119460119461119462119463119464119465119466119467119468119469119470119471119472119473119474119475119476119477119478119479119480119481119482119483119484119485119486119487119488119489119490119491119492119493119494119495119496119497119498119499119500119501119502119503119504119505119506119507119508119509119510119511119512119513119514119515119516119517119518119519119520119521119522119523119524119525119526119527119528119529119530119531119532119533119534119535119536119537119538119539119540119541119542119543119544119545119546119547119548119549119550119551119552119553119554119555119556119557119558119559119560119561119562119563119564119565119566119567119568119569119570119571119572119573119574119575119576119577119578119579119580119581119582119583119584119585119586119587119588119589119590119591119592119593119594119595119596119597119598119599119600119601119602119603119604119605119606119607119608119609119610119611119612119613119614119615119616119617119618119619119620119621119622119623119624119625119626119627119628119629119630119631119632119633119634119635119636119637119638119639119640119641119642119643119644119645119646119647119648119649119650119651119652119653119654119655119656119657119658119659119660119661119662119663119664119665119666119667119668119669119670119671119672119673119674119675119676119677119678119679119680119681119682119683119684119685119686119687119688119689119690119691119692119693119694119695119696119697119698119699119700119701119702119703119704119705119706119707119708119709119710119711119712119713119714119715119716119717119718119719119720119721119722119723119724119725119726119727119728119729119730119731119732119733119734119735119736119737119738119739119740119741119742119743119744119745119746119747119748119749119750119751119752119753119754119755119756119757119758119759119760119761119762119763119764119765119766119767119768119769119770119771119772119773119774119775119776119777119778119779119780119781119782119783119784119785119786119787119788119789119790119791119792119793119794119795119796119797119798119799119800119801119802119803119804119805119806119807119808119809119810119811119812119813119814119815119816119817119818119819119820119821119822119823119824119825119826119827119828119829119830119831119832119833119834119835119836119837119838119839119840119841119842119843119844119845119846119847119848119849119850119851119852119853119854119855119856119857119858119859119860119861119862119863119864119865119866119867119868119869119870119871119872119873119874119875119876119877119878119879119880119881119882119883119884119885119886119887119888119889119890119891119892119893119894119895119896119897119898119899119900119901119902119903119904119905119906119907119908119909119910119911119912119913119914119915119916119917119918119919119920119921119922119923119924119925119926119927119928119929119930119931119932119933119934119935119936119937119938119939119940119941119942119943119944119945119946119947119948119949119950119951119952119953119954119955119956119957119958119959119960119961119962119963119964119965119966119967119968119969119970119971119972119973119974119975119976119977119978119979119980119981119982119983119984119985119986119987119988119989119990119991119992119993119994119995119996119997119998119999120000120001120002120003120004120005120006120007120008120009120010120011120012120013120014120015120016120017120018120019120020120021120022120023120024120025120026120027120028120029120030120031120032120033120034120035120036120037120038120039120040120041120042120043120044120045120046120047120048120049120050120051120052120053120054120055120056120057120058120059120060120061120062120063120064120065120066120067120068120069120070120071120072120073120074120075120076120077120078120079120080120081120082120083120084120085120086120087120088120089120090120091120092120093120094120095120096120097120098120099120100120101120102120103120104120105120106120107120108120109120110120111120112120113120114120115120116120117120118120119120120120121120122120123120124120125120126120127120128120129120130120131120132120133120134120135120136120137120138120139120140120141120142120143120144120145120146120147120148120149120150120151120152120153120154120155120156120157120158120159120160120161120162120163120164120165120166120167120168120169120170120171120172120173120174120175120176120177120178120179120180120181120182120183120184120185120186120187120188120189120190120191120192120193120194120195120196120197120198120199120200120201120202120203120204120205120206120207120208120209120210120211120212120213120214120215120216120217120218120219120220120221120222120223120224120225120226120227120228120229120230120231120232120233120234120235120236120237120238120239120240120241120242120243120244120245120246120247120248120249120250120251120252120253120254120255120256120257120258120259120260120261120262120263120264120265120266120267120268120269120270120271120272120273120274120275120276120277120278120279120280120281120282120283120284120285120286120287120288120289120290120291120292120293120294120295120296120297120298120299120300120301120302120303120304120305120306120307120308120309120310120311120312120313120314120315120316120317120318120319120320120321120322120323120324120325120326120327120328120329120330120331120332120333120334120335120336120337120338120339120340120341120342120343120344120345120346120347120348120349120350120351120352120353120354120355120356120357120358120359120360120361120362120363120364120365120366120367120368120369120370120371120372120373120374120375120376120377120378120379120380120381120382120383120384120385120386120387120388120389120390120391120392120393120394120395120396120397120398120399120400120401120402120403120404120405120406120407120408120409120410120411120412120413120414120415120416120417120418120419120420120421120422120423120424120425120426120427120428120429120430120431120432120433120434120435120436120437120438120439120440120441120442120443120444120445120446120447120448120449120450120451120452120453120454120455120456120457120458120459120460120461120462120463120464120465120466120467120468120469120470120471120472120473120474120475120476120477120478120479120480120481120482120483120484120485120486120487120488120489120490120491120492120493120494120495120496120497120498120499120500120501120502120503120504120505120506120507120508120509120510120511120512120513120514120515120516120517120518120519120520120521120522120523120524120525120526120527120528120529120530120531120532120533120534120535120536120537120538120539120540120541120542120543120544120545120546120547120548120549120550120551120552120553120554120555120556120557120558120559120560120561120562120563120564120565120566120567120568120569120570120571120572120573120574120575120576120577120578120579120580120581120582120583120584120585120586120587120588120589120590120591120592120593120594120595120596120597120598120599120600120601120602120603120604120605120606120607120608120609120610120611120612120613120614120615120616120617120618120619120620120621120622120623120624120625120626120627120628120629120630120631120632120633120634120635120636120637120638120639120640120641120642120643120644120645120646120647120648120649120650120651120652120653120654120655120656120657120658120659120660120661120662120663120664120665120666120667120668120669120670120671120672120673120674120675120676120677120678120679120680120681120682120683120684120685120686120687120688120689120690120691120692120693120694120695120696120697120698120699120700120701120702120703120704120705120706120707120708120709120710120711120712120713120714120715120716120717120718120719120720120721120722120723120724120725120726120727120728120729120730120731120732120733120734120735120736120737120738120739120740120741120742120743120744120745120746120747120748120749120750120751120752120753120754120755120756120757120758120759120760120761120762120763120764120765120766120767120768120769120770120771120772120773120774120775120776120777120778120779120780120781120782120783120784120785120786120787120788120789120790120791120792120793120794120795120796120797120798120799120800120801120802120803120804120805120806120807120808120809120810120811120812120813120814120815120816120817120818120819120820120821120822120823120824120825120826120827120828120829120830120831120832120833120834120835120836120837120838120839120840120841120842120843120844120845120846120847120848120849120850120851120852120853120854120855120856120857120858120859120860120861120862120863120864120865120866120867120868120869120870120871120872120873120874120875120876120877120878120879120880120881120882120883120884120885120886120887120888120889120890120891120892120893120894120895120896120897120898120899120900120901120902120903120904120905120906120907120908120909120910120911120912120913120914120915120916120917120918120919120920120921120922120923120924120925120926120927120928120929120930120931120932120933120934120935120936120937120938120939120940120941120942120943120944120945120946120947120948120949120950120951120952120953120954120955120956120957120958120959120960120961120962120963120964120965120966120967120968120969120970120971120972120973120974120975120976120977120978120979120980120981120982120983120984120985120986120987120988120989120990120991120992120993120994120995120996120997120998120999121000121001121002121003121004121005121006121007121008121009121010121011121012121013121014121015121016121017121018121019121020121021121022121023121024121025121026121027121028121029121030121031121032121033121034121035121036121037121038121039121040121041121042121043121044121045121046121047121048121049121050121051121052121053121054121055121056121057121058121059121060121061121062121063121064121065121066121067121068121069121070121071121072121073121074121075121076121077121078121079121080121081121082121083121084121085121086121087121088121089121090121091121092121093121094121095121096121097121098121099121100121101121102121103121104121105121106121107121108121109121110121111121112121113121114121115121116121117121118121119121120121121121122121123121124121125121126121127121128121129121130121131121132121133121134121135121136121137121138121139121140121141121142121143121144121145121146121147121148121149121150121151121152121153121154121155121156121157121158121159121160121161121162121163121164121165121166121167121168121169121170121171121172121173121174121175121176121177121178121179121180121181121182121183121184121185121186121187121188121189121190121191121192121193121194121195121196121197121198121199121200121201121202121203121204121205121206121207121208121209121210121211121212121213121214121215121216121217121218121219121220121221121222121223121224121225121226121227121228121229121230121231121232121233121234121235121236121237121238121239121240121241121242121243121244121245121246121247121248121249121250121251121252121253121254121255121256121257121258121259121260121261121262121263121264121265121266121267121268121269121270121271121272121273121274121275121276121277121278121279121280121281121282121283121284121285121286121287121288121289121290121291121292121293121294121295121296121297121298121299121300121301121302121303121304121305121306121307121308121309121310121311121312121313121314121315121316121317121318121319121320121321121322121323121324121325121326121327121328121329121330121331121332121333121334121335121336121337121338121339121340121341121342121343121344121345121346121347121348121349121350121351121352121353121354121355121356121357121358121359121360121361121362121363121364121365121366121367121368121369121370121371121372121373121374121375121376121377121378121379121380121381121382121383121384121385121386121387121388121389121390121391121392121393121394121395121396121397121398121399121400121401121402121403121404121405121406121407121408121409121410121411121412121413121414121415121416121417121418121419121420121421121422121423121424121425121426121427121428121429121430121431121432121433121434121435121436121437121438121439121440121441121442121443121444121445121446121447121448121449121450121451121452121453121454121455121456121457121458121459121460121461121462121463121464121465121466121467121468121469121470121471121472121473121474121475121476121477121478121479121480121481121482121483121484121485121486121487121488121489121490121491121492121493121494121495121496121497121498121499121500121501121502121503121504121505121506121507121508121509121510121511121512121513121514121515121516121517121518121519121520121521121522121523121524121525121526121527121528121529121530121531121532121533121534121535121536121537121538121539121540121541121542121543121544121545121546121547121548121549121550121551121552121553121554121555121556121557121558121559121560121561121562121563121564121565121566121567121568121569121570121571121572121573121574121575121576121577121578121579121580121581121582121583121584121585121586121587121588121589121590121591121592121593121594121595121596121597121598121599121600121601121602121603121604121605121606121607121608121609121610121611121612121613121614121615121616121617121618121619121620121621121622121623121624121625121626121627121628121629121630121631121632121633121634121635121636121637121638121639121640121641121642121643121644121645121646121647121648121649121650121651121652121653121654121655121656121657121658121659121660121661121662121663121664121665121666121667121668121669121670121671121672121673121674121675121676121677121678121679121680121681121682121683121684121685121686121687121688121689121690121691121692121693121694121695121696121697121698121699121700121701121702121703121704121705121706121707121708121709121710121711121712121713121714121715121716121717121718121719121720121721121722121723121724121725121726121727121728121729121730121731121732121733121734121735121736121737121738121739121740121741121742121743121744121745121746121747121748121749121750121751121752121753121754121755121756121757121758121759121760121761121762121763121764121765121766121767121768121769121770121771121772121773121774121775121776121777121778121779121780121781121782121783121784121785121786121787121788121789121790121791121792121793121794121795121796121797121798121799121800121801121802121803121804121805121806121807121808121809121810121811121812121813121814121815121816121817121818121819121820121821121822121823121824121825121826121827121828121829121830121831121832121833121834121835121836121837121838121839121840121841121842121843121844121845121846121847121848121849121850121851121852121853121854121855121856121857121858121859121860121861121862121863121864121865121866121867121868121869121870121871121872121873121874121875121876121877121878121879121880121881121882121883121884121885121886121887121888121889121890121891121892121893121894121895121896121897121898121899121900121901121902121903121904121905121906121907121908121909121910121911121912121913121914121915121916121917121918121919121920121921121922121923121924121925121926121927121928121929121930121931121932121933121934121935121936121937121938121939121940121941121942121943121944121945121946121947121948121949121950121951121952121953121954121955121956121957121958121959121960121961121962121963121964121965121966121967121968121969121970121971121972121973121974121975121976121977121978121979121980121981121982121983121984121985121986121987121988121989121990121991121992121993121994121995121996121997121998121999122000122001122002122003122004122005122006122007122008122009122010122011122012122013122014122015122016122017122018122019122020122021122022122023122024122025122026122027122028122029122030122031122032122033122034122035122036122037122038122039122040122041122042122043122044122045122046122047122048122049122050122051122052122053122054122055122056122057122058122059122060122061122062122063122064122065122066122067122068122069122070122071122072122073122074122075122076122077122078122079122080122081122082122083122084122085122086122087122088122089122090122091122092122093122094122095122096122097122098122099122100122101122102122103122104122105122106122107122108122109122110122111122112122113122114122115122116122117122118122119122120122121122122122123122124122125122126122127122128122129122130122131122132122133122134122135122136122137122138122139122140122141122142122143122144122145122146122147122148122149122150122151122152122153122154122155122156122157122158122159122160122161122162122163122164122165122166122167122168122169122170122171122172122173122174122175122176122177122178122179122180122181122182122183122184122185122186122187122188122189122190122191122192122193122194122195122196122197122198122199122200122201122202122203122204122205122206122207122208122209122210122211122212122213122214122215122216122217122218122219122220122221122222122223122224122225122226122227122228122229122230122231122232122233122234122235122236122237122238122239122240122241122242122243122244122245122246122247122248122249122250122251122252122253122254122255122256122257122258122259122260122261122262122263122264122265122266122267122268122269122270122271122272122273122274122275122276122277122278122279122280122281122282122283122284122285122286122287122288122289122290122291122292122293122294122295122296122297122298122299122300122301122302122303122304122305122306122307122308122309122310122311122312122313122314122315122316122317122318122319122320122321122322122323122324122325122326122327122328122329122330122331122332122333122334122335122336122337122338122339122340122341122342122343122344122345122346122347122348122349122350122351122352122353122354122355122356122357122358122359122360122361122362122363122364122365122366122367122368122369122370122371122372122373122374122375122376122377122378122379122380122381122382122383122384122385122386122387122388122389122390122391122392122393122394122395122396122397122398122399122400122401122402122403122404122405122406122407122408122409122410122411122412122413122414122415122416122417122418122419122420122421122422122423122424122425122426122427122428122429122430122431122432122433122434122435122436122437122438122439122440122441122442122443122444122445122446122447122448122449122450122451122452122453122454122455122456122457122458122459122460122461122462122463122464122465122466122467122468122469122470122471122472122473122474122475122476122477122478122479122480122481122482122483122484122485122486122487122488122489122490122491122492122493122494122495122496122497122498122499122500122501122502122503122504122505122506122507122508122509122510122511122512122513122514122515122516122517122518122519122520122521122522122523122524122525122526122527122528122529122530122531122532122533122534122535122536122537122538122539122540122541122542122543122544122545122546122547122548122549122550122551122552122553122554122555122556122557122558122559122560122561122562122563122564122565122566122567122568122569122570122571122572122573122574122575122576122577122578122579122580122581122582122583122584122585122586122587122588122589122590122591122592122593122594122595122596122597122598122599122600122601122602122603122604122605122606122607122608122609122610122611122612122613122614122615122616122617122618122619122620122621122622122623122624122625122626122627122628122629122630122631122632122633122634122635122636122637122638122639122640122641122642122643122644122645122646122647122648122649122650122651122652122653122654122655122656122657122658122659122660122661122662122663122664122665122666122667122668122669122670122671122672122673122674122675122676122677122678122679122680122681122682122683122684122685122686122687122688122689122690122691122692122693122694122695122696122697122698122699122700122701122702122703122704122705122706122707122708122709122710122711122712122713122714122715122716122717122718122719122720122721122722122723122724122725122726122727122728122729122730122731122732122733122734122735122736122737122738122739122740122741122742122743122744122745122746122747122748122749122750122751122752122753122754122755122756122757122758122759122760122761122762122763122764122765122766122767122768122769122770122771122772122773122774122775122776122777122778122779122780122781122782122783122784122785122786122787122788122789122790122791122792122793122794122795122796122797122798122799122800122801122802122803122804122805122806122807122808122809122810122811122812122813122814122815122816122817122818122819122820122821122822122823122824122825122826122827122828122829122830122831122832122833122834122835122836122837122838122839122840122841122842122843122844122845122846122847122848122849122850122851122852122853122854122855122856122857122858122859122860122861122862122863122864122865122866122867122868122869122870122871122872122873122874122875122876122877122878122879122880122881122882122883122884122885122886122887122888122889122890122891122892122893122894122895122896122897122898122899122900122901122902122903122904122905122906122907122908122909122910122911122912122913122914122915122916122917122918122919122920122921122922122923122924122925122926122927122928122929122930122931122932122933122934122935122936122937122938122939122940122941122942122943122944122945122946122947122948122949122950122951122952122953122954122955122956122957122958122959122960122961122962122963122964122965122966122967122968122969122970122971122972122973122974122975122976122977122978122979122980122981122982122983122984122985122986122987122988122989122990122991122992122993122994122995122996122997122998122999123000123001123002123003123004123005123006123007123008123009123010123011123012123013123014123015123016123017123018123019123020123021123022123023123024123025123026123027123028123029123030123031123032123033123034123035123036123037123038123039123040123041123042123043123044123045123046123047123048123049123050123051123052123053123054123055123056123057123058123059123060123061123062123063123064123065123066123067123068123069123070123071123072123073123074123075123076123077123078123079123080123081123082123083123084123085123086123087123088123089123090123091123092123093123094123095123096123097123098123099123100123101123102123103123104123105123106123107123108123109123110123111123112123113123114123115123116123117123118123119123120123121123122123123123124123125123126123127123128123129123130123131123132123133123134123135123136123137123138123139123140123141123142123143123144123145123146123147123148123149123150123151123152123153123154123155123156123157123158123159123160123161123162123163123164123165123166123167123168123169123170123171123172123173123174123175123176123177123178123179123180123181123182123183123184123185123186123187123188123189123190123191123192123193123194123195123196123197123198123199123200123201123202123203123204123205123206123207123208123209123210123211123212123213123214123215123216123217123218123219123220123221123222123223123224123225123226123227123228123229123230123231123232123233123234123235123236123237123238123239123240123241123242123243123244123245123246123247123248123249123250123251123252123253123254123255123256123257123258123259123260123261123262123263123264123265123266123267123268123269123270123271123272123273123274123275123276123277123278123279123280123281123282123283123284123285123286123287123288123289123290123291123292123293123294123295123296123297123298123299123300123301123302123303123304123305123306123307123308123309123310123311123312123313123314123315123316123317123318123319123320123321123322123323123324123325123326123327123328123329123330123331123332123333123334123335123336123337123338123339123340123341123342123343123344123345123346123347123348123349123350123351123352123353123354123355123356123357123358123359123360123361123362123363123364123365123366123367123368123369123370123371123372123373123374123375123376123377123378123379123380123381123382123383123384123385123386123387123388123389123390123391123392123393123394123395123396123397123398123399123400123401123402123403123404123405123406123407123408123409123410123411123412123413123414123415123416123417123418123419123420123421123422123423123424123425123426123427123428123429123430123431123432123433123434123435123436123437123438123439123440123441123442123443123444123445123446123447123448123449123450123451123452123453123454123455123456123457123458123459123460123461123462123463123464123465123466123467123468123469123470123471123472123473123474123475123476123477123478123479123480123481123482123483123484123485123486123487123488123489123490123491123492123493123494123495123496123497123498123499123500123501123502123503123504123505123506123507123508123509123510123511123512123513123514123515123516123517123518123519123520123521123522123523123524123525123526123527123528123529123530123531123532123533123534123535123536123537123538123539123540123541123542123543123544123545123546123547123548123549123550123551123552123553123554123555123556123557123558123559123560123561123562123563123564123565123566123567123568123569123570123571123572123573123574123575123576123577123578123579123580123581123582123583123584123585123586123587123588123589123590123591123592123593123594123595123596123597123598123599123600123601123602123603123604123605123606123607123608123609123610123611123612123613123614123615123616123617123618123619123620123621123622123623123624123625123626123627123628123629123630123631123632123633123634123635123636123637123638123639123640123641123642123643123644123645123646123647123648123649123650123651123652123653123654123655123656123657123658123659123660123661123662123663123664123665123666123667123668123669123670123671123672123673123674123675123676123677123678123679123680123681123682123683123684123685123686123687 |
- /******/ (function(modules) { // webpackBootstrap
- /******/ // The module cache
- /******/ var installedModules = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/
- /******/ // Check if module is in cache
- /******/ if(installedModules[moduleId]) {
- /******/ return installedModules[moduleId].exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = installedModules[moduleId] = {
- /******/ i: moduleId,
- /******/ l: false,
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Flag the module as loaded
- /******/ module.l = true;
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /******/
- /******/ // expose the modules object (__webpack_modules__)
- /******/ __webpack_require__.m = modules;
- /******/
- /******/ // expose the module cache
- /******/ __webpack_require__.c = installedModules;
- /******/
- /******/ // define getter function for harmony exports
- /******/ __webpack_require__.d = function(exports, name, getter) {
- /******/ if(!__webpack_require__.o(exports, name)) {
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
- /******/ }
- /******/ };
- /******/
- /******/ // define __esModule on exports
- /******/ __webpack_require__.r = function(exports) {
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
- /******/ }
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
- /******/ };
- /******/
- /******/ // create a fake namespace object
- /******/ // mode & 1: value is a module id, require it
- /******/ // mode & 2: merge all properties of value into the ns
- /******/ // mode & 4: return value when already ns object
- /******/ // mode & 8|1: behave like require
- /******/ __webpack_require__.t = function(value, mode) {
- /******/ if(mode & 1) value = __webpack_require__(value);
- /******/ if(mode & 8) return value;
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
- /******/ var ns = Object.create(null);
- /******/ __webpack_require__.r(ns);
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
- /******/ return ns;
- /******/ };
- /******/
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function getDefault() { return module['default']; } :
- /******/ function getModuleExports() { return module; };
- /******/ __webpack_require__.d(getter, 'a', getter);
- /******/ return getter;
- /******/ };
- /******/
- /******/ // Object.prototype.hasOwnProperty.call
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
- /******/
- /******/ // __webpack_public_path__
- /******/ __webpack_require__.p = "/";
- /******/
- /******/
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = 0);
- /******/ })
- /************************************************************************/
- /******/ ({
-
- /***/ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
- \**********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- function _assertThisInitialized(self) {
- if (self === void 0) {
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- }
-
- return self;
- }
-
- module.exports = _assertThisInitialized;
-
- /***/ }),
-
- /***/ "./node_modules/@babel/runtime/helpers/defineProperty.js":
- /*!***************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
- \***************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
-
- return obj;
- }
-
- module.exports = _defineProperty;
-
- /***/ }),
-
- /***/ "./node_modules/@babel/runtime/helpers/esm/extends.js":
- /*!************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/extends.js ***!
- \************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _extends; });
- function _extends() {
- _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
-
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
-
- return target;
- };
-
- return _extends.apply(this, arguments);
- }
-
- /***/ }),
-
- /***/ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js":
- /*!******************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _inheritsLoose; });
- function _inheritsLoose(subClass, superClass) {
- subClass.prototype = Object.create(superClass.prototype);
- subClass.prototype.constructor = subClass;
- subClass.__proto__ = superClass;
- }
-
- /***/ }),
-
- /***/ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js":
- /*!*********************************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js ***!
- \*********************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _objectWithoutPropertiesLoose; });
- function _objectWithoutPropertiesLoose(source, excluded) {
- if (source == null) return {};
- var target = {};
- var sourceKeys = Object.keys(source);
- var key, i;
-
- for (i = 0; i < sourceKeys.length; i++) {
- key = sourceKeys[i];
- if (excluded.indexOf(key) >= 0) continue;
- target[key] = source[key];
- }
-
- return target;
- }
-
- /***/ }),
-
- /***/ "./node_modules/@babel/runtime/helpers/extends.js":
- /*!********************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/extends.js ***!
- \********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- function _extends() {
- module.exports = _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
-
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
-
- return target;
- };
-
- return _extends.apply(this, arguments);
- }
-
- module.exports = _extends;
-
- /***/ }),
-
- /***/ "./node_modules/@babel/runtime/helpers/inheritsLoose.js":
- /*!**************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/inheritsLoose.js ***!
- \**************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- function _inheritsLoose(subClass, superClass) {
- subClass.prototype = Object.create(superClass.prototype);
- subClass.prototype.constructor = subClass;
- subClass.__proto__ = superClass;
- }
-
- module.exports = _inheritsLoose;
-
- /***/ }),
-
- /***/ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
- \**********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : {
- "default": obj
- };
- }
-
- module.exports = _interopRequireDefault;
-
- /***/ }),
-
- /***/ "./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js":
- /*!*****************************************************************************!*\
- !*** ./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js ***!
- \*****************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- function _objectWithoutPropertiesLoose(source, excluded) {
- if (source == null) return {};
- var target = {};
- var sourceKeys = Object.keys(source);
- var key, i;
-
- for (i = 0; i < sourceKeys.length; i++) {
- key = sourceKeys[i];
- if (excluded.indexOf(key) >= 0) continue;
- target[key] = source[key];
- }
-
- return target;
- }
-
- module.exports = _objectWithoutPropertiesLoose;
-
- /***/ }),
-
- /***/ "./node_modules/@emotion/cache/dist/cache.browser.esm.js":
- /*!***************************************************************!*\
- !*** ./node_modules/@emotion/cache/dist/cache.browser.esm.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _emotion_sheet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/sheet */ "./node_modules/@emotion/sheet/dist/sheet.browser.esm.js");
- /* harmony import */ var _emotion_stylis__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @emotion/stylis */ "./node_modules/@emotion/stylis/dist/stylis.browser.esm.js");
- /* harmony import */ var _emotion_weak_memoize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @emotion/weak-memoize */ "./node_modules/@emotion/weak-memoize/dist/weak-memoize.browser.esm.js");
-
-
-
-
- // https://github.com/thysultan/stylis.js/tree/master/plugins/rule-sheet
- // inlined to avoid umd wrapper and peerDep warnings/installing stylis
- // since we use stylis after closure compiler
- var delimiter = '/*|*/';
- var needle = delimiter + '}';
-
- function toSheet(block) {
- if (block) {
- Sheet.current.insert(block + '}');
- }
- }
-
- var Sheet = {
- current: null
- };
- var ruleSheet = function ruleSheet(context, content, selectors, parents, line, column, length, ns, depth, at) {
- switch (context) {
- // property
- case 1:
- {
- switch (content.charCodeAt(0)) {
- case 64:
- {
- // @import
- Sheet.current.insert(content + ';');
- return '';
- }
- // charcode for l
-
- case 108:
- {
- // charcode for b
- // this ignores label
- if (content.charCodeAt(2) === 98) {
- return '';
- }
- }
- }
-
- break;
- }
- // selector
-
- case 2:
- {
- if (ns === 0) return content + delimiter;
- break;
- }
- // at-rule
-
- case 3:
- {
- switch (ns) {
- // @font-face, @page
- case 102:
- case 112:
- {
- Sheet.current.insert(selectors[0] + content);
- return '';
- }
-
- default:
- {
- return content + (at === 0 ? delimiter : '');
- }
- }
- }
-
- case -2:
- {
- content.split(needle).forEach(toSheet);
- }
- }
- };
-
- var createCache = function createCache(options) {
- if (options === undefined) options = {};
- var key = options.key || 'css';
- var stylisOptions;
-
- if (options.prefix !== undefined) {
- stylisOptions = {
- prefix: options.prefix
- };
- }
-
- var stylis = new _emotion_stylis__WEBPACK_IMPORTED_MODULE_1__["default"](stylisOptions);
-
- if (true) {
- // $FlowFixMe
- if (/[^a-z-]/.test(key)) {
- throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed");
- }
- }
-
- var inserted = {}; // $FlowFixMe
-
- var container;
-
- {
- container = options.container || document.head;
- var nodes = document.querySelectorAll("style[data-emotion-" + key + "]");
- Array.prototype.forEach.call(nodes, function (node) {
- var attrib = node.getAttribute("data-emotion-" + key); // $FlowFixMe
-
- attrib.split(' ').forEach(function (id) {
- inserted[id] = true;
- });
-
- if (node.parentNode !== container) {
- container.appendChild(node);
- }
- });
- }
-
- var _insert;
-
- {
- stylis.use(options.stylisPlugins)(ruleSheet);
-
- _insert = function insert(selector, serialized, sheet, shouldCache) {
- var name = serialized.name;
- Sheet.current = sheet;
-
- if ( true && serialized.map !== undefined) {
- var map = serialized.map;
- Sheet.current = {
- insert: function insert(rule) {
- sheet.insert(rule + map);
- }
- };
- }
-
- stylis(selector, serialized.styles);
-
- if (shouldCache) {
- cache.inserted[name] = true;
- }
- };
- }
-
- if (true) {
- // https://esbench.com/bench/5bf7371a4cd7e6009ef61d0a
- var commentStart = /\/\*/g;
- var commentEnd = /\*\//g;
- stylis.use(function (context, content) {
- switch (context) {
- case -1:
- {
- while (commentStart.test(content)) {
- commentEnd.lastIndex = commentStart.lastIndex;
-
- if (commentEnd.test(content)) {
- commentStart.lastIndex = commentEnd.lastIndex;
- continue;
- }
-
- throw new Error('Your styles have an unterminated comment ("/*" without corresponding "*/").');
- }
-
- commentStart.lastIndex = 0;
- break;
- }
- }
- });
- stylis.use(function (context, content, selectors) {
- switch (context) {
- case -1:
- {
- var flag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
- var unsafePseudoClasses = content.match(/(:first|:nth|:nth-last)-child/g);
-
- if (unsafePseudoClasses && cache.compat !== true) {
- unsafePseudoClasses.forEach(function (unsafePseudoClass) {
- var ignoreRegExp = new RegExp(unsafePseudoClass + ".*\\/\\* " + flag + " \\*\\/");
- var ignore = ignoreRegExp.test(content);
-
- if (unsafePseudoClass && !ignore) {
- console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
- }
- });
- }
-
- break;
- }
- }
- });
- }
-
- var cache = {
- key: key,
- sheet: new _emotion_sheet__WEBPACK_IMPORTED_MODULE_0__["StyleSheet"]({
- key: key,
- container: container,
- nonce: options.nonce,
- speedy: options.speedy
- }),
- nonce: options.nonce,
- inserted: inserted,
- registered: {},
- insert: _insert
- };
- return cache;
- };
-
- /* harmony default export */ __webpack_exports__["default"] = (createCache);
-
-
- /***/ }),
-
- /***/ "./node_modules/@emotion/core/dist/core.browser.esm.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@emotion/core/dist/core.browser.esm.js ***!
- \*************************************************************/
- /*! exports provided: css, CacheProvider, ClassNames, Global, ThemeContext, jsx, keyframes, withEmotionCache */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CacheProvider", function() { return CacheProvider; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ClassNames", function() { return ClassNames; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Global", function() { return Global; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ThemeContext", function() { return ThemeContext; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "jsx", function() { return jsx; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keyframes", function() { return keyframes; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withEmotionCache", function() { return withEmotionCache; });
- /* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/inheritsLoose */ "./node_modules/@babel/runtime/helpers/inheritsLoose.js");
- /* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _emotion_cache__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @emotion/cache */ "./node_modules/@emotion/cache/dist/cache.browser.esm.js");
- /* harmony import */ var _emotion_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @emotion/utils */ "./node_modules/@emotion/utils/dist/utils.browser.esm.js");
- /* harmony import */ var _emotion_serialize__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @emotion/serialize */ "./node_modules/@emotion/serialize/dist/serialize.browser.esm.js");
- /* harmony import */ var _emotion_sheet__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @emotion/sheet */ "./node_modules/@emotion/sheet/dist/sheet.browser.esm.js");
- /* harmony import */ var _emotion_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @emotion/css */ "./node_modules/@emotion/css/dist/css.browser.esm.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "css", function() { return _emotion_css__WEBPACK_IMPORTED_MODULE_6__["default"]; });
-
-
-
-
-
-
-
-
-
-
- var EmotionCacheContext = Object(react__WEBPACK_IMPORTED_MODULE_1__["createContext"])( // we're doing this to avoid preconstruct's dead code elimination in this one case
- // because this module is primarily intended for the browser and node
- // but it's also required in react native and similar environments sometimes
- // and we could have a special build just for that
- // but this is much easier and the native packages
- // might use a different theme context in the future anyway
- typeof HTMLElement !== 'undefined' ? Object(_emotion_cache__WEBPACK_IMPORTED_MODULE_2__["default"])() : null);
- var ThemeContext = Object(react__WEBPACK_IMPORTED_MODULE_1__["createContext"])({});
- var CacheProvider = EmotionCacheContext.Provider;
-
- var withEmotionCache = function withEmotionCache(func) {
- var render = function render(props, ref) {
- return Object(react__WEBPACK_IMPORTED_MODULE_1__["createElement"])(EmotionCacheContext.Consumer, null, function (cache) {
- return func(props, cache, ref);
- });
- }; // $FlowFixMe
-
-
- return Object(react__WEBPACK_IMPORTED_MODULE_1__["forwardRef"])(render);
- };
-
- // thus we only need to replace what is a valid character for JS, but not for CSS
-
- var sanitizeIdentifier = function sanitizeIdentifier(identifier) {
- return identifier.replace(/\$/g, '-');
- };
-
- var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
- var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';
- var hasOwnProperty = Object.prototype.hasOwnProperty;
-
- var render = function render(cache, props, theme, ref) {
- var cssProp = theme === null ? props.css : props.css(theme); // so that using `css` from `emotion` and passing the result to the css prop works
- // not passing the registered cache to serializeStyles because it would
- // make certain babel optimisations not possible
-
- if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {
- cssProp = cache.registered[cssProp];
- }
-
- var type = props[typePropName];
- var registeredStyles = [cssProp];
- var className = '';
-
- if (typeof props.className === 'string') {
- className = Object(_emotion_utils__WEBPACK_IMPORTED_MODULE_3__["getRegisteredStyles"])(cache.registered, registeredStyles, props.className);
- } else if (props.className != null) {
- className = props.className + " ";
- }
-
- var serialized = Object(_emotion_serialize__WEBPACK_IMPORTED_MODULE_4__["serializeStyles"])(registeredStyles);
-
- if ( true && serialized.name.indexOf('-') === -1) {
- var labelFromStack = props[labelPropName];
-
- if (labelFromStack) {
- serialized = Object(_emotion_serialize__WEBPACK_IMPORTED_MODULE_4__["serializeStyles"])([serialized, 'label:' + labelFromStack + ';']);
- }
- }
-
- var rules = Object(_emotion_utils__WEBPACK_IMPORTED_MODULE_3__["insertStyles"])(cache, serialized, typeof type === 'string');
- className += cache.key + "-" + serialized.name;
- var newProps = {};
-
- for (var key in props) {
- if (hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ( false || key !== labelPropName)) {
- newProps[key] = props[key];
- }
- }
-
- newProps.ref = ref;
- newProps.className = className;
- var ele = Object(react__WEBPACK_IMPORTED_MODULE_1__["createElement"])(type, newProps);
-
- return ele;
- };
-
- var Emotion =
- /* #__PURE__ */
- withEmotionCache(function (props, cache, ref) {
- // use Context.read for the theme when it's stable
- if (typeof props.css === 'function') {
- return Object(react__WEBPACK_IMPORTED_MODULE_1__["createElement"])(ThemeContext.Consumer, null, function (theme) {
- return render(cache, props, theme, ref);
- });
- }
-
- return render(cache, props, null, ref);
- });
-
- if (true) {
- Emotion.displayName = 'EmotionCssPropInternal';
- } // $FlowFixMe
-
-
- var jsx = function jsx(type, props) {
- var args = arguments;
-
- if (props == null || !hasOwnProperty.call(props, 'css')) {
- // $FlowFixMe
- return react__WEBPACK_IMPORTED_MODULE_1__["createElement"].apply(undefined, args);
- }
-
- if ( true && typeof props.css === 'string' && // check if there is a css declaration
- props.css.indexOf(':') !== -1) {
- throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/css' like this: css`" + props.css + "`");
- }
-
- var argsLength = args.length;
- var createElementArgArray = new Array(argsLength);
- createElementArgArray[0] = Emotion;
- var newProps = {};
-
- for (var key in props) {
- if (hasOwnProperty.call(props, key)) {
- newProps[key] = props[key];
- }
- }
-
- newProps[typePropName] = type;
-
- if (true) {
- var error = new Error();
-
- if (error.stack) {
- // chrome
- var match = error.stack.match(/at (?:Object\.|)jsx.*\n\s+at ([A-Z][A-Za-z$]+) /);
-
- if (!match) {
- // safari and firefox
- match = error.stack.match(/^.*\n([A-Z][A-Za-z$]+)@/);
- }
-
- if (match) {
- newProps[labelPropName] = sanitizeIdentifier(match[1]);
- }
- }
- }
-
- createElementArgArray[1] = newProps;
-
- for (var i = 2; i < argsLength; i++) {
- createElementArgArray[i] = args[i];
- } // $FlowFixMe
-
-
- return react__WEBPACK_IMPORTED_MODULE_1__["createElement"].apply(null, createElementArgArray);
- };
-
- var warnedAboutCssPropForGlobal = false;
- var Global =
- /* #__PURE__ */
- withEmotionCache(function (props, cache) {
- if ( true && !warnedAboutCssPropForGlobal && ( // check for className as well since the user is
- // probably using the custom createElement which
- // means it will be turned into a className prop
- // $FlowFixMe I don't really want to add it to the type since it shouldn't be used
- props.className || props.css)) {
- console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?");
- warnedAboutCssPropForGlobal = true;
- }
-
- var styles = props.styles;
-
- if (typeof styles === 'function') {
- return Object(react__WEBPACK_IMPORTED_MODULE_1__["createElement"])(ThemeContext.Consumer, null, function (theme) {
- var serialized = Object(_emotion_serialize__WEBPACK_IMPORTED_MODULE_4__["serializeStyles"])([styles(theme)]);
- return Object(react__WEBPACK_IMPORTED_MODULE_1__["createElement"])(InnerGlobal, {
- serialized: serialized,
- cache: cache
- });
- });
- }
-
- var serialized = Object(_emotion_serialize__WEBPACK_IMPORTED_MODULE_4__["serializeStyles"])([styles]);
- return Object(react__WEBPACK_IMPORTED_MODULE_1__["createElement"])(InnerGlobal, {
- serialized: serialized,
- cache: cache
- });
- });
-
- // maintain place over rerenders.
- // initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
- // initial client-side render from SSR, use place of hydrating tag
- var InnerGlobal =
- /*#__PURE__*/
- function (_React$Component) {
- _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_0___default()(InnerGlobal, _React$Component);
-
- function InnerGlobal(props, context, updater) {
- return _React$Component.call(this, props, context, updater) || this;
- }
-
- var _proto = InnerGlobal.prototype;
-
- _proto.componentDidMount = function componentDidMount() {
- this.sheet = new _emotion_sheet__WEBPACK_IMPORTED_MODULE_5__["StyleSheet"]({
- key: this.props.cache.key + "-global",
- nonce: this.props.cache.sheet.nonce,
- container: this.props.cache.sheet.container
- }); // $FlowFixMe
-
- var node = document.querySelector("style[data-emotion-" + this.props.cache.key + "=\"" + this.props.serialized.name + "\"]");
-
- if (node !== null) {
- this.sheet.tags.push(node);
- }
-
- if (this.props.cache.sheet.tags.length) {
- this.sheet.before = this.props.cache.sheet.tags[0];
- }
-
- this.insertStyles();
- };
-
- _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
- if (prevProps.serialized.name !== this.props.serialized.name) {
- this.insertStyles();
- }
- };
-
- _proto.insertStyles = function insertStyles$1() {
- if (this.props.serialized.next !== undefined) {
- // insert keyframes
- Object(_emotion_utils__WEBPACK_IMPORTED_MODULE_3__["insertStyles"])(this.props.cache, this.props.serialized.next, true);
- }
-
- if (this.sheet.tags.length) {
- // if this doesn't exist then it will be null so the style element will be appended
- var element = this.sheet.tags[this.sheet.tags.length - 1].nextElementSibling;
- this.sheet.before = element;
- this.sheet.flush();
- }
-
- this.props.cache.insert("", this.props.serialized, this.sheet, false);
- };
-
- _proto.componentWillUnmount = function componentWillUnmount() {
- this.sheet.flush();
- };
-
- _proto.render = function render() {
-
- return null;
- };
-
- return InnerGlobal;
- }(react__WEBPACK_IMPORTED_MODULE_1__["Component"]);
-
- var keyframes = function keyframes() {
- var insertable = _emotion_css__WEBPACK_IMPORTED_MODULE_6__["default"].apply(void 0, arguments);
- var name = "animation-" + insertable.name; // $FlowFixMe
-
- return {
- name: name,
- styles: "@keyframes " + name + "{" + insertable.styles + "}",
- anim: 1,
- toString: function toString() {
- return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
- }
- };
- };
-
- var classnames = function classnames(args) {
- var len = args.length;
- var i = 0;
- var cls = '';
-
- for (; i < len; i++) {
- var arg = args[i];
- if (arg == null) continue;
- var toAdd = void 0;
-
- switch (typeof arg) {
- case 'boolean':
- break;
-
- case 'object':
- {
- if (Array.isArray(arg)) {
- toAdd = classnames(arg);
- } else {
- toAdd = '';
-
- for (var k in arg) {
- if (arg[k] && k) {
- toAdd && (toAdd += ' ');
- toAdd += k;
- }
- }
- }
-
- break;
- }
-
- default:
- {
- toAdd = arg;
- }
- }
-
- if (toAdd) {
- cls && (cls += ' ');
- cls += toAdd;
- }
- }
-
- return cls;
- };
-
- function merge(registered, css, className) {
- var registeredStyles = [];
- var rawClassName = Object(_emotion_utils__WEBPACK_IMPORTED_MODULE_3__["getRegisteredStyles"])(registered, registeredStyles, className);
-
- if (registeredStyles.length < 2) {
- return className;
- }
-
- return rawClassName + css(registeredStyles);
- }
-
- var ClassNames = withEmotionCache(function (props, context) {
- return Object(react__WEBPACK_IMPORTED_MODULE_1__["createElement"])(ThemeContext.Consumer, null, function (theme) {
- var hasRendered = false;
-
- var css = function css() {
- if (hasRendered && "development" !== 'production') {
- throw new Error('css can only be used during render');
- }
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- var serialized = Object(_emotion_serialize__WEBPACK_IMPORTED_MODULE_4__["serializeStyles"])(args, context.registered);
-
- {
- Object(_emotion_utils__WEBPACK_IMPORTED_MODULE_3__["insertStyles"])(context, serialized, false);
- }
-
- return context.key + "-" + serialized.name;
- };
-
- var cx = function cx() {
- if (hasRendered && "development" !== 'production') {
- throw new Error('cx can only be used during render');
- }
-
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
-
- return merge(context.registered, css, classnames(args));
- };
-
- var content = {
- css: css,
- cx: cx,
- theme: theme
- };
- var ele = props.children(content);
- hasRendered = true;
-
- return ele;
- });
- });
-
-
-
-
- /***/ }),
-
- /***/ "./node_modules/@emotion/css/dist/css.browser.esm.js":
- /*!***********************************************************!*\
- !*** ./node_modules/@emotion/css/dist/css.browser.esm.js ***!
- \***********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _emotion_serialize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/serialize */ "./node_modules/@emotion/serialize/dist/serialize.browser.esm.js");
-
-
- function css() {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- return Object(_emotion_serialize__WEBPACK_IMPORTED_MODULE_0__["serializeStyles"])(args);
- }
-
- /* harmony default export */ __webpack_exports__["default"] = (css);
-
-
- /***/ }),
-
- /***/ "./node_modules/@emotion/hash/dist/hash.browser.esm.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@emotion/hash/dist/hash.browser.esm.js ***!
- \*************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* eslint-disable */
- // murmurhash2 via https://github.com/garycourt/murmurhash-js/blob/master/murmurhash2_gc.js
- function murmurhash2_32_gc(str) {
- var l = str.length,
- h = l ^ l,
- i = 0,
- k;
-
- while (l >= 4) {
- k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
- k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);
- k ^= k >>> 24;
- k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);
- h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16) ^ k;
- l -= 4;
- ++i;
- }
-
- switch (l) {
- case 3:
- h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
-
- case 2:
- h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
-
- case 1:
- h ^= str.charCodeAt(i) & 0xff;
- h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);
- }
-
- h ^= h >>> 13;
- h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);
- h ^= h >>> 15;
- return (h >>> 0).toString(36);
- }
-
- /* harmony default export */ __webpack_exports__["default"] = (murmurhash2_32_gc);
-
-
- /***/ }),
-
- /***/ "./node_modules/@emotion/memoize/dist/memoize.browser.esm.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/@emotion/memoize/dist/memoize.browser.esm.js ***!
- \*******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- function memoize(fn) {
- var cache = {};
- return function (arg) {
- if (cache[arg] === undefined) cache[arg] = fn(arg);
- return cache[arg];
- };
- }
-
- /* harmony default export */ __webpack_exports__["default"] = (memoize);
-
-
- /***/ }),
-
- /***/ "./node_modules/@emotion/serialize/dist/serialize.browser.esm.js":
- /*!***********************************************************************!*\
- !*** ./node_modules/@emotion/serialize/dist/serialize.browser.esm.js ***!
- \***********************************************************************/
- /*! exports provided: serializeStyles */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "serializeStyles", function() { return serializeStyles; });
- /* harmony import */ var _emotion_hash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @emotion/hash */ "./node_modules/@emotion/hash/dist/hash.browser.esm.js");
- /* harmony import */ var _emotion_unitless__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @emotion/unitless */ "./node_modules/@emotion/unitless/dist/unitless.browser.esm.js");
- /* harmony import */ var _emotion_memoize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @emotion/memoize */ "./node_modules/@emotion/memoize/dist/memoize.browser.esm.js");
-
-
-
-
- var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
- var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
- var hyphenateRegex = /[A-Z]|^ms/g;
- var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
-
- var isCustomProperty = function isCustomProperty(property) {
- return property.charCodeAt(1) === 45;
- };
-
- var isProcessableValue = function isProcessableValue(value) {
- return value != null && typeof value !== 'boolean';
- };
-
- var processStyleName = Object(_emotion_memoize__WEBPACK_IMPORTED_MODULE_2__["default"])(function (styleName) {
- return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
- });
-
- var processStyleValue = function processStyleValue(key, value) {
- switch (key) {
- case 'animation':
- case 'animationName':
- {
- if (typeof value === 'string') {
- return value.replace(animationRegex, function (match, p1, p2) {
- cursor = {
- name: p1,
- styles: p2,
- next: cursor
- };
- return p1;
- });
- }
- }
- }
-
- if (_emotion_unitless__WEBPACK_IMPORTED_MODULE_1__["default"][key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
- return value + 'px';
- }
-
- return value;
- };
-
- if (true) {
- var contentValuePattern = /(attr|calc|counters?|url)\(/;
- var contentValues = ['normal', 'none', 'counter', 'open-quote', 'close-quote', 'no-open-quote', 'no-close-quote', 'initial', 'inherit', 'unset'];
- var oldProcessStyleValue = processStyleValue;
- var msPattern = /^-ms-/;
- var hyphenPattern = /-(.)/g;
- var hyphenatedCache = {};
-
- processStyleValue = function processStyleValue(key, value) {
- if (key === 'content') {
- if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) {
- console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
- }
- }
-
- var processed = oldProcessStyleValue(key, value);
-
- if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {
- hyphenatedCache[key] = true;
- console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {
- return _char.toUpperCase();
- }) + "?");
- }
-
- return processed;
- };
- }
-
- var shouldWarnAboutInterpolatingClassNameFromCss = true;
-
- function handleInterpolation(mergedProps, registered, interpolation, couldBeSelectorInterpolation) {
- if (interpolation == null) {
- return '';
- }
-
- if (interpolation.__emotion_styles !== undefined) {
- if ( true && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {
- throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.');
- }
-
- return interpolation;
- }
-
- switch (typeof interpolation) {
- case 'boolean':
- {
- return '';
- }
-
- case 'object':
- {
- if (interpolation.anim === 1) {
- cursor = {
- name: interpolation.name,
- styles: interpolation.styles,
- next: cursor
- };
- return interpolation.name;
- }
-
- if (interpolation.styles !== undefined) {
- var next = interpolation.next;
-
- if (next !== undefined) {
- // not the most efficient thing ever but this is a pretty rare case
- // and there will be very few iterations of this generally
- while (next !== undefined) {
- cursor = {
- name: next.name,
- styles: next.styles,
- next: cursor
- };
- next = next.next;
- }
- }
-
- var styles = interpolation.styles + ";";
-
- if ( true && interpolation.map !== undefined) {
- styles += interpolation.map;
- }
-
- return styles;
- }
-
- return createStringFromObject(mergedProps, registered, interpolation);
- }
-
- case 'function':
- {
- if (mergedProps !== undefined) {
- var previousCursor = cursor;
- var result = interpolation(mergedProps);
- cursor = previousCursor;
- return handleInterpolation(mergedProps, registered, result, couldBeSelectorInterpolation);
- } else if (true) {
- console.error('Functions that are interpolated in css calls will be stringified.\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\n' + 'It can be called directly with props or interpolated in a styled call like this\n' + "let SomeComponent = styled('div')`${dynamicStyle}`");
- }
-
- break;
- }
-
- case 'string':
- if (true) {
- var matched = [];
- var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {
- var fakeVarName = "animation" + matched.length;
- matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, '') + "`");
- return "${" + fakeVarName + "}";
- });
-
- if (matched.length) {
- console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\n' + 'Instead of doing this:\n\n' + [].concat(matched, ["`" + replaced + "`"]).join('\n') + '\n\nYou should wrap it with `css` like this:\n\n' + ("css`" + replaced + "`"));
- }
- }
-
- break;
- } // finalize string values (regular strings and functions interpolated into css calls)
-
-
- if (registered == null) {
- return interpolation;
- }
-
- var cached = registered[interpolation];
-
- if ( true && couldBeSelectorInterpolation && shouldWarnAboutInterpolatingClassNameFromCss && cached !== undefined) {
- console.error('Interpolating a className from css`` is not recommended and will cause problems with composition.\n' + 'Interpolating a className from css`` will be completely unsupported in a future major version of Emotion');
- shouldWarnAboutInterpolatingClassNameFromCss = false;
- }
-
- return cached !== undefined && !couldBeSelectorInterpolation ? cached : interpolation;
- }
-
- function createStringFromObject(mergedProps, registered, obj) {
- var string = '';
-
- if (Array.isArray(obj)) {
- for (var i = 0; i < obj.length; i++) {
- string += handleInterpolation(mergedProps, registered, obj[i], false);
- }
- } else {
- for (var _key in obj) {
- var value = obj[_key];
-
- if (typeof value !== 'object') {
- if (registered != null && registered[value] !== undefined) {
- string += _key + "{" + registered[value] + "}";
- } else if (isProcessableValue(value)) {
- string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
- }
- } else {
- if (_key === 'NO_COMPONENT_SELECTOR' && "development" !== 'production') {
- throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.');
- }
-
- if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
- for (var _i = 0; _i < value.length; _i++) {
- if (isProcessableValue(value[_i])) {
- string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
- }
- }
- } else {
- var interpolated = handleInterpolation(mergedProps, registered, value, false);
-
- switch (_key) {
- case 'animation':
- case 'animationName':
- {
- string += processStyleName(_key) + ":" + interpolated + ";";
- break;
- }
-
- default:
- {
- if ( true && _key === 'undefined') {
- console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
- }
-
- string += _key + "{" + interpolated + "}";
- }
- }
- }
- }
- }
- }
-
- return string;
- }
-
- var labelPattern = /label:\s*([^\s;\n{]+)\s*;/g;
- var sourceMapPattern;
-
- if (true) {
- sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//;
- } // this is the cursor for keyframes
- // keyframes are stored on the SerializedStyles object as a linked list
-
-
- var cursor;
- var serializeStyles = function serializeStyles(args, registered, mergedProps) {
- if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
- return args[0];
- }
-
- var stringMode = true;
- var styles = '';
- cursor = undefined;
- var strings = args[0];
-
- if (strings == null || strings.raw === undefined) {
- stringMode = false;
- styles += handleInterpolation(mergedProps, registered, strings, false);
- } else {
- if ( true && strings[0] === undefined) {
- console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
- }
-
- styles += strings[0];
- } // we start at 1 since we've already handled the first arg
-
-
- for (var i = 1; i < args.length; i++) {
- styles += handleInterpolation(mergedProps, registered, args[i], styles.charCodeAt(styles.length - 1) === 46);
-
- if (stringMode) {
- if ( true && strings[i] === undefined) {
- console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
- }
-
- styles += strings[i];
- }
- }
-
- var sourceMap;
-
- if (true) {
- styles = styles.replace(sourceMapPattern, function (match) {
- sourceMap = match;
- return '';
- });
- } // using a global regex with .exec is stateful so lastIndex has to be reset each time
-
-
- labelPattern.lastIndex = 0;
- var identifierName = '';
- var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
-
- while ((match = labelPattern.exec(styles)) !== null) {
- identifierName += '-' + // $FlowFixMe we know it's not null
- match[1];
- }
-
- var name = Object(_emotion_hash__WEBPACK_IMPORTED_MODULE_0__["default"])(styles) + identifierName;
-
- if (true) {
- // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)
- return {
- name: name,
- styles: styles,
- map: sourceMap,
- next: cursor,
- toString: function toString() {
- return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
- }
- };
- }
-
- return {
- name: name,
- styles: styles,
- next: cursor
- };
- };
-
-
-
-
- /***/ }),
-
- /***/ "./node_modules/@emotion/sheet/dist/sheet.browser.esm.js":
- /*!***************************************************************!*\
- !*** ./node_modules/@emotion/sheet/dist/sheet.browser.esm.js ***!
- \***************************************************************/
- /*! exports provided: StyleSheet */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StyleSheet", function() { return StyleSheet; });
- /*
-
- Based off glamor's StyleSheet, thanks Sunil ❤️
-
- high performance StyleSheet for css-in-js systems
-
- - uses multiple style tags behind the scenes for millions of rules
- - uses `insertRule` for appending in production for *much* faster performance
-
- // usage
-
- import { StyleSheet } from '@emotion/sheet'
-
- let styleSheet = new StyleSheet({ key: '', container: document.head })
-
- styleSheet.insert('#box { border: 1px solid red; }')
- - appends a css rule into the stylesheet
-
- styleSheet.flush()
- - empties the stylesheet of all its contents
-
- */
- // $FlowFixMe
- function sheetForTag(tag) {
- if (tag.sheet) {
- // $FlowFixMe
- return tag.sheet;
- } // this weirdness brought to you by firefox
-
- /* istanbul ignore next */
-
-
- for (var i = 0; i < document.styleSheets.length; i++) {
- if (document.styleSheets[i].ownerNode === tag) {
- // $FlowFixMe
- return document.styleSheets[i];
- }
- }
- }
-
- function createStyleElement(options) {
- var tag = document.createElement('style');
- tag.setAttribute('data-emotion', options.key);
-
- if (options.nonce !== undefined) {
- tag.setAttribute('nonce', options.nonce);
- }
-
- tag.appendChild(document.createTextNode(''));
- return tag;
- }
-
- var StyleSheet =
- /*#__PURE__*/
- function () {
- function StyleSheet(options) {
- this.isSpeedy = options.speedy === undefined ? "development" === 'production' : options.speedy;
- this.tags = [];
- this.ctr = 0;
- this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
-
- this.key = options.key;
- this.container = options.container;
- this.before = null;
- }
-
- var _proto = StyleSheet.prototype;
-
- _proto.insert = function insert(rule) {
- // the max length is how many rules we have per style tag, it's 65000 in speedy mode
- // it's 1 in dev because we insert source maps that map a single rule to a location
- // and you can only have one source map per style tag
- if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
- var _tag = createStyleElement(this);
-
- var before;
-
- if (this.tags.length === 0) {
- before = this.before;
- } else {
- before = this.tags[this.tags.length - 1].nextSibling;
- }
-
- this.container.insertBefore(_tag, before);
- this.tags.push(_tag);
- }
-
- var tag = this.tags[this.tags.length - 1];
-
- if (this.isSpeedy) {
- var sheet = sheetForTag(tag);
-
- try {
- // this is a really hot path
- // we check the second character first because having "i"
- // as the second character will happen less often than
- // having "@" as the first character
- var isImportRule = rule.charCodeAt(1) === 105 && rule.charCodeAt(0) === 64; // this is the ultrafast version, works across browsers
- // the big drawback is that the css won't be editable in devtools
-
- sheet.insertRule(rule, // we need to insert @import rules before anything else
- // otherwise there will be an error
- // technically this means that the @import rules will
- // _usually_(not always since there could be multiple style tags)
- // be the first ones in prod and generally later in dev
- // this shouldn't really matter in the real world though
- // @import is generally only used for font faces from google fonts and etc.
- // so while this could be technically correct then it would be slower and larger
- // for a tiny bit of correctness that won't matter in the real world
- isImportRule ? 0 : sheet.cssRules.length);
- } catch (e) {
- if (true) {
- console.warn("There was a problem inserting the following rule: \"" + rule + "\"", e);
- }
- }
- } else {
- tag.appendChild(document.createTextNode(rule));
- }
-
- this.ctr++;
- };
-
- _proto.flush = function flush() {
- // $FlowFixMe
- this.tags.forEach(function (tag) {
- return tag.parentNode.removeChild(tag);
- });
- this.tags = [];
- this.ctr = 0;
- };
-
- return StyleSheet;
- }();
-
-
-
-
- /***/ }),
-
- /***/ "./node_modules/@emotion/stylis/dist/stylis.browser.esm.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/@emotion/stylis/dist/stylis.browser.esm.js ***!
- \*****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- function stylis_min (W) {
- function M(d, c, e, h, a) {
- for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = '', p = '', F = '', G = '', C; l < B;) {
- g = e.charCodeAt(l);
- l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++);
-
- if (0 === b + n + v + m) {
- if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) {
- switch (g) {
- case 32:
- case 9:
- case 59:
- case 13:
- case 10:
- break;
-
- default:
- f += e.charAt(l);
- }
-
- g = 59;
- }
-
- switch (g) {
- case 123:
- f = f.trim();
- q = f.charCodeAt(0);
- k = 1;
-
- for (t = ++l; l < B;) {
- switch (g = e.charCodeAt(l)) {
- case 123:
- k++;
- break;
-
- case 125:
- k--;
- break;
-
- case 47:
- switch (g = e.charCodeAt(l + 1)) {
- case 42:
- case 47:
- a: {
- for (u = l + 1; u < J; ++u) {
- switch (e.charCodeAt(u)) {
- case 47:
- if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) {
- l = u + 1;
- break a;
- }
-
- break;
-
- case 10:
- if (47 === g) {
- l = u + 1;
- break a;
- }
-
- }
- }
-
- l = u;
- }
-
- }
-
- break;
-
- case 91:
- g++;
-
- case 40:
- g++;
-
- case 34:
- case 39:
- for (; l++ < J && e.charCodeAt(l) !== g;) {
- }
-
- }
-
- if (0 === k) break;
- l++;
- }
-
- k = e.substring(t, l);
- 0 === q && (q = (f = f.replace(ca, '').trim()).charCodeAt(0));
-
- switch (q) {
- case 64:
- 0 < r && (f = f.replace(N, ''));
- g = f.charCodeAt(1);
-
- switch (g) {
- case 100:
- case 109:
- case 115:
- case 45:
- r = c;
- break;
-
- default:
- r = O;
- }
-
- k = M(c, r, k, g, a + 1);
- t = k.length;
- 0 < A && (r = X(O, f, I), C = H(3, k, r, c, D, z, t, g, a, h), f = r.join(''), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, k = ''));
- if (0 < t) switch (g) {
- case 115:
- f = f.replace(da, ea);
-
- case 100:
- case 109:
- case 45:
- k = f + '{' + k + '}';
- break;
-
- case 107:
- f = f.replace(fa, '$1 $2');
- k = f + '{' + k + '}';
- k = 1 === w || 2 === w && L('@' + k, 3) ? '@-webkit-' + k + '@' + k : '@' + k;
- break;
-
- default:
- k = f + k, 112 === h && (k = (p += k, ''));
- } else k = '';
- break;
-
- default:
- k = M(c, X(c, f, I), k, h, a + 1);
- }
-
- F += k;
- k = I = r = u = q = 0;
- f = '';
- g = e.charCodeAt(++l);
- break;
-
- case 125:
- case 59:
- f = (0 < r ? f.replace(N, '') : f).trim();
- if (1 < (t = f.length)) switch (0 === u && (q = f.charCodeAt(0), 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(' ', ':')).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = '\x00\x00'), q = f.charCodeAt(0), g = f.charCodeAt(1), q) {
- case 0:
- break;
-
- case 64:
- if (105 === g || 99 === g) {
- G += f + e.charAt(l);
- break;
- }
-
- default:
- 58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2)));
- }
- I = r = u = q = 0;
- f = '';
- g = e.charCodeAt(++l);
- }
- }
-
- switch (g) {
- case 13:
- case 10:
- 47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\x00');
- 0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h);
- z = 1;
- D++;
- break;
-
- case 59:
- case 125:
- if (0 === b + n + v + m) {
- z++;
- break;
- }
-
- default:
- z++;
- y = e.charAt(l);
-
- switch (g) {
- case 9:
- case 32:
- if (0 === n + m + b) switch (x) {
- case 44:
- case 58:
- case 9:
- case 32:
- y = '';
- break;
-
- default:
- 32 !== g && (y = ' ');
- }
- break;
-
- case 0:
- y = '\\0';
- break;
-
- case 12:
- y = '\\f';
- break;
-
- case 11:
- y = '\\v';
- break;
-
- case 38:
- 0 === n + b + m && (r = I = 1, y = '\f' + y);
- break;
-
- case 108:
- if (0 === n + b + m + E && 0 < u) switch (l - u) {
- case 2:
- 112 === x && 58 === e.charCodeAt(l - 3) && (E = x);
-
- case 8:
- 111 === K && (E = K);
- }
- break;
-
- case 58:
- 0 === n + b + m && (u = l);
- break;
-
- case 44:
- 0 === b + v + n + m && (r = 1, y += '\r');
- break;
-
- case 34:
- case 39:
- 0 === b && (n = n === g ? 0 : 0 === n ? g : n);
- break;
-
- case 91:
- 0 === n + b + v && m++;
- break;
-
- case 93:
- 0 === n + b + v && m--;
- break;
-
- case 41:
- 0 === n + b + m && v--;
- break;
-
- case 40:
- if (0 === n + b + m) {
- if (0 === q) switch (2 * x + 3 * K) {
- case 533:
- break;
-
- default:
- q = 1;
- }
- v++;
- }
-
- break;
-
- case 64:
- 0 === b + v + n + m + u + k && (k = 1);
- break;
-
- case 42:
- case 47:
- if (!(0 < n + m + v)) switch (b) {
- case 0:
- switch (2 * g + 3 * e.charCodeAt(l + 1)) {
- case 235:
- b = 47;
- break;
-
- case 220:
- t = l, b = 42;
- }
-
- break;
-
- case 42:
- 47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0);
- }
- }
-
- 0 === b && (f += y);
- }
-
- K = x;
- x = g;
- l++;
- }
-
- t = p.length;
-
- if (0 < t) {
- r = c;
- if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F;
- p = r.join(',') + '{' + p + '}';
-
- if (0 !== w * E) {
- 2 !== w || L(p, 2) || (E = 0);
-
- switch (E) {
- case 111:
- p = p.replace(ha, ':-moz-$1') + p;
- break;
-
- case 112:
- p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p;
- }
-
- E = 0;
- }
- }
-
- return G + p + F;
- }
-
- function X(d, c, e) {
- var h = c.trim().split(ia);
- c = h;
- var a = h.length,
- m = d.length;
-
- switch (m) {
- case 0:
- case 1:
- var b = 0;
-
- for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) {
- c[b] = Z(d, c[b], e).trim();
- }
-
- break;
-
- default:
- var v = b = 0;
-
- for (c = []; b < a; ++b) {
- for (var n = 0; n < m; ++n) {
- c[v++] = Z(d[n] + ' ', h[b], e).trim();
- }
- }
-
- }
-
- return c;
- }
-
- function Z(d, c, e) {
- var h = c.charCodeAt(0);
- 33 > h && (h = (c = c.trim()).charCodeAt(0));
-
- switch (h) {
- case 38:
- return c.replace(F, '$1' + d.trim());
-
- case 58:
- return d.trim() + c.replace(F, '$1' + d.trim());
-
- default:
- if (0 < 1 * e && 0 < c.indexOf('\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim());
- }
-
- return d + c;
- }
-
- function P(d, c, e, h) {
- var a = d + ';',
- m = 2 * c + 3 * e + 4 * h;
-
- if (944 === m) {
- d = a.indexOf(':', 9) + 1;
- var b = a.substring(d, a.length - 1).trim();
- b = a.substring(0, d).trim() + b + ';';
- return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b;
- }
-
- if (0 === w || 2 === w && !L(a, 1)) return a;
-
- switch (m) {
- case 1015:
- return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a;
-
- case 951:
- return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a;
-
- case 963:
- return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a;
-
- case 1009:
- if (100 !== a.charCodeAt(4)) break;
-
- case 969:
- case 942:
- return '-webkit-' + a + a;
-
- case 978:
- return '-webkit-' + a + '-moz-' + a + a;
-
- case 1019:
- case 983:
- return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a;
-
- case 883:
- if (45 === a.charCodeAt(8)) return '-webkit-' + a + a;
- if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a;
- break;
-
- case 932:
- if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {
- case 103:
- return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a;
-
- case 115:
- return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a;
-
- case 98:
- return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a;
- }
- return '-webkit-' + a + '-ms-' + a + a;
-
- case 964:
- return '-webkit-' + a + '-ms-flex-' + a + a;
-
- case 1023:
- if (99 !== a.charCodeAt(8)) break;
- b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify');
- return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a;
-
- case 1005:
- return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a;
-
- case 1e3:
- b = a.substring(13).trim();
- c = b.indexOf('-') + 1;
-
- switch (b.charCodeAt(0) + b.charCodeAt(c)) {
- case 226:
- b = a.replace(G, 'tb');
- break;
-
- case 232:
- b = a.replace(G, 'tb-rl');
- break;
-
- case 220:
- b = a.replace(G, 'lr');
- break;
-
- default:
- return a;
- }
-
- return '-webkit-' + a + '-ms-' + b + a;
-
- case 1017:
- if (-1 === a.indexOf('sticky', 9)) break;
-
- case 975:
- c = (a = d).length - 10;
- b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim();
-
- switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) {
- case 203:
- if (111 > b.charCodeAt(8)) break;
-
- case 115:
- a = a.replace(b, '-webkit-' + b) + ';' + a;
- break;
-
- case 207:
- case 102:
- a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a;
- }
-
- return a + ';';
-
- case 938:
- if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {
- case 105:
- return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a;
-
- case 115:
- return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a;
-
- default:
- return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a;
- }
- break;
-
- case 973:
- case 989:
- if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;
-
- case 931:
- case 953:
- if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(':') + 1)).charCodeAt(0) ? P(d.replace('stretch', 'fill-available'), c, e, h).replace(':fill-available', ':stretch') : a.replace(b, '-webkit-' + b) + a.replace(b, '-moz-' + b.replace('fill-', '')) + a;
- break;
-
- case 962:
- if (a = '-webkit-' + a + (102 === a.charCodeAt(5) ? '-ms-' + a : '') + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf('transform', 10)) return a.substring(0, a.indexOf(';', 27) + 1).replace(ma, '$1-webkit-$2') + a;
- }
-
- return a;
- }
-
- function L(d, c) {
- var e = d.indexOf(1 === c ? ':' : '{'),
- h = d.substring(0, 3 !== c ? e : 10);
- e = d.substring(e + 1, d.length - 1);
- return R(2 !== c ? h : h.replace(na, '$1'), e, c);
- }
-
- function ea(d, c) {
- var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));
- return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')';
- }
-
- function H(d, c, e, h, a, m, b, v, n, q) {
- for (var g = 0, x = c, w; g < A; ++g) {
- switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) {
- case void 0:
- case !1:
- case !0:
- case null:
- break;
-
- default:
- x = w;
- }
- }
-
- if (x !== c) return x;
- }
-
- function T(d) {
- switch (d) {
- case void 0:
- case null:
- A = S.length = 0;
- break;
-
- default:
- if ('function' === typeof d) S[A++] = d;else if ('object' === typeof d) for (var c = 0, e = d.length; c < e; ++c) {
- T(d[c]);
- } else Y = !!d | 0;
- }
-
- return T;
- }
-
- function U(d) {
- d = d.prefix;
- void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0);
- return U;
- }
-
- function B(d, c) {
- var e = d;
- 33 > e.charCodeAt(0) && (e = e.trim());
- V = e;
- e = [V];
-
- if (0 < A) {
- var h = H(-1, c, e, e, D, z, 0, 0, 0, 0);
- void 0 !== h && 'string' === typeof h && (c = h);
- }
-
- var a = M(O, e, c, 0, 0);
- 0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h));
- V = '';
- E = 0;
- z = D = 1;
- return a;
- }
-
- var ca = /^\0+/g,
- N = /[\0\r\f]/g,
- aa = /: */g,
- ka = /zoo|gra/,
- ma = /([,: ])(transform)/g,
- ia = /,\r+?/g,
- F = /([\t\r\n ])*\f?&/g,
- fa = /@(k\w+)\s*(\S*)\s*/,
- Q = /::(place)/g,
- ha = /:(read-only)/g,
- G = /[svh]\w+-[tblr]{2}/,
- da = /\(\s*(.*)\s*\)/g,
- oa = /([\s\S]*?);/g,
- ba = /-self|flex-/g,
- na = /[^]*?(:[rp][el]a[\w-]+)[^]*/,
- la = /stretch|:\s*\w+\-(?:conte|avail)/,
- ja = /([^-])(image-set\()/,
- z = 1,
- D = 1,
- E = 0,
- w = 1,
- O = [],
- S = [],
- A = 0,
- R = null,
- Y = 0,
- V = '';
- B.use = T;
- B.set = U;
- void 0 !== W && U(W);
- return B;
- }
-
- /* harmony default export */ __webpack_exports__["default"] = (stylis_min);
-
-
- /***/ }),
-
- /***/ "./node_modules/@emotion/unitless/dist/unitless.browser.esm.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/@emotion/unitless/dist/unitless.browser.esm.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var unitlessKeys = {
- animationIterationCount: 1,
- borderImageOutset: 1,
- borderImageSlice: 1,
- borderImageWidth: 1,
- boxFlex: 1,
- boxFlexGroup: 1,
- boxOrdinalGroup: 1,
- columnCount: 1,
- columns: 1,
- flex: 1,
- flexGrow: 1,
- flexPositive: 1,
- flexShrink: 1,
- flexNegative: 1,
- flexOrder: 1,
- gridRow: 1,
- gridRowEnd: 1,
- gridRowSpan: 1,
- gridRowStart: 1,
- gridColumn: 1,
- gridColumnEnd: 1,
- gridColumnSpan: 1,
- gridColumnStart: 1,
- msGridRow: 1,
- msGridRowSpan: 1,
- msGridColumn: 1,
- msGridColumnSpan: 1,
- fontWeight: 1,
- lineHeight: 1,
- opacity: 1,
- order: 1,
- orphans: 1,
- tabSize: 1,
- widows: 1,
- zIndex: 1,
- zoom: 1,
- WebkitLineClamp: 1,
- // SVG-related properties
- fillOpacity: 1,
- floodOpacity: 1,
- stopOpacity: 1,
- strokeDasharray: 1,
- strokeDashoffset: 1,
- strokeMiterlimit: 1,
- strokeOpacity: 1,
- strokeWidth: 1
- };
-
- /* harmony default export */ __webpack_exports__["default"] = (unitlessKeys);
-
-
- /***/ }),
-
- /***/ "./node_modules/@emotion/utils/dist/utils.browser.esm.js":
- /*!***************************************************************!*\
- !*** ./node_modules/@emotion/utils/dist/utils.browser.esm.js ***!
- \***************************************************************/
- /*! exports provided: getRegisteredStyles, insertStyles */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRegisteredStyles", function() { return getRegisteredStyles; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertStyles", function() { return insertStyles; });
- var isBrowser = "object" !== 'undefined';
- function getRegisteredStyles(registered, registeredStyles, classNames) {
- var rawClassName = '';
- classNames.split(' ').forEach(function (className) {
- if (registered[className] !== undefined) {
- registeredStyles.push(registered[className]);
- } else {
- rawClassName += className + " ";
- }
- });
- return rawClassName;
- }
- var insertStyles = function insertStyles(cache, serialized, isStringTag) {
- var className = cache.key + "-" + serialized.name;
-
- if ( // we only need to add the styles to the registered cache if the
- // class name could be used further down
- // the tree but if it's a string tag, we know it won't
- // so we don't have to add it to registered cache.
- // this improves memory usage since we can avoid storing the whole style string
- (isStringTag === false || // we need to always store it if we're in compat mode and
- // in node since emotion-server relies on whether a style is in
- // the registered cache to know whether a style is global or not
- // also, note that this check will be dead code eliminated in the browser
- isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
- cache.registered[className] = serialized.styles;
- }
-
- if (cache.inserted[serialized.name] === undefined) {
- var current = serialized;
-
- do {
- var maybeStyles = cache.insert("." + className, current, cache.sheet, true);
-
- current = current.next;
- } while (current !== undefined);
- }
- };
-
-
-
-
- /***/ }),
-
- /***/ "./node_modules/@emotion/weak-memoize/dist/weak-memoize.browser.esm.js":
- /*!*****************************************************************************!*\
- !*** ./node_modules/@emotion/weak-memoize/dist/weak-memoize.browser.esm.js ***!
- \*****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- var weakMemoize = function weakMemoize(func) {
- // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
- var cache = new WeakMap();
- return function (arg) {
- if (cache.has(arg)) {
- // $FlowFixMe
- return cache.get(arg);
- }
-
- var ret = func(arg);
- cache.set(arg, ret);
- return ret;
- };
- };
-
- /* harmony default export */ __webpack_exports__["default"] = (weakMemoize);
-
-
- /***/ }),
-
- /***/ "./node_modules/@restart/context/forwardRef.js":
- /*!*****************************************************!*\
- !*** ./node_modules/@restart/context/forwardRef.js ***!
- \*****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = forwardRef;
-
- var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function forwardRef(renderFn, _temp) {
- var _ref = _temp === void 0 ? {} : _temp,
- propTypes = _ref.propTypes,
- defaultProps = _ref.defaultProps,
- _ref$allowFallback = _ref.allowFallback,
- allowFallback = _ref$allowFallback === void 0 ? false : _ref$allowFallback,
- _ref$displayName = _ref.displayName,
- displayName = _ref$displayName === void 0 ? renderFn.name || renderFn.displayName : _ref$displayName;
-
- var render = function render(props, ref) {
- return renderFn(props, ref);
- };
-
- return Object.assign(_react.default.forwardRef || !allowFallback ? _react.default.forwardRef(render) : function (props) {
- return render(props, null);
- }, {
- displayName: displayName,
- propTypes: propTypes,
- defaultProps: defaultProps
- });
- }
-
- /***/ }),
-
- /***/ "./node_modules/@restart/hooks/esm/useCommittedRef.js":
- /*!************************************************************!*\
- !*** ./node_modules/@restart/hooks/esm/useCommittedRef.js ***!
- \************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-
- /**
- * Creates a `Ref` whose value is updated in an effect, ensuring the most recent
- * value is the one rendered with. Generally only required for Concurrent mode usage
- * where previous work in `render()` may be discarded befor being used.
- *
- * This is safe to access in an event handler.
- *
- * @param value The `Ref` value
- */
-
- function useCommittedRef(value) {
- var ref = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(value);
- Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
- ref.current = value;
- }, [value]);
- return ref;
- }
-
- /* harmony default export */ __webpack_exports__["default"] = (useCommittedRef);
-
- /***/ }),
-
- /***/ "./node_modules/@restart/hooks/esm/useEventCallback.js":
- /*!*************************************************************!*\
- !*** ./node_modules/@restart/hooks/esm/useEventCallback.js ***!
- \*************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return useEventCallback; });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _useCommittedRef__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useCommittedRef */ "./node_modules/@restart/hooks/esm/useCommittedRef.js");
-
-
- function useEventCallback(fn) {
- var ref = Object(_useCommittedRef__WEBPACK_IMPORTED_MODULE_1__["default"])(fn);
- return Object(react__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(function () {
- return ref.current && ref.current.apply(ref, arguments);
- }, [ref]);
- }
-
- /***/ }),
-
- /***/ "./node_modules/@restart/hooks/esm/useForceUpdate.js":
- /*!***********************************************************!*\
- !*** ./node_modules/@restart/hooks/esm/useForceUpdate.js ***!
- \***********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return useForceUpdate; });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-
- /**
- * Returns a function that triggers a component update. the hook equivalent to
- * `this.forceUpdate()` in a class component. In most cases using a state value directly
- * is preferable but may be required in some advanced usages of refs for interop or
- * when direct DOM manipulation is required.
- *
- * ```ts
- * const forceUpdate = useForceUpdate();
- *
- * const updateOnClick = useCallback(() => {
- * forceUpdate()
- * }, [forceUpdate])
- *
- * return <button type="button" onClick={updateOnClick}>Hi there</button>
- * ```
- */
-
- function useForceUpdate() {
- // The toggling state value is designed to defeat React optimizations for skipping
- var _useReducer = Object(react__WEBPACK_IMPORTED_MODULE_0__["useReducer"])(function (state) {
- return !state;
- }, false),
- dispatch = _useReducer[1];
-
- return dispatch;
- }
-
- /***/ }),
-
- /***/ "./node_modules/@restart/hooks/esm/useMergedRefs.js":
- /*!**********************************************************!*\
- !*** ./node_modules/@restart/hooks/esm/useMergedRefs.js ***!
- \**********************************************************/
- /*! exports provided: mergeRefs, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeRefs", function() { return mergeRefs; });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-
-
- var toFnRef = function toFnRef(ref) {
- return !ref || typeof ref === 'function' ? ref : function (value) {
- ref.current = value;
- };
- };
-
- function mergeRefs(refA, refB) {
- var a = toFnRef(refA);
- var b = toFnRef(refB);
- return function (value) {
- if (a) a(value);
- if (b) b(value);
- };
- }
- /**
- * Create and returns a single callback ref composed from two other Refs.
- *
- * ```tsx
- * const Button = React.forwardRef((props, ref) => {
- * const [element, attachRef] = useCallbackRef<HTMLButtonElement>();
- * const mergedRef = useMergedRefs(ref, attachRef);
- *
- * return <button ref={mergedRef} {...props}/>
- * })
- * ```
- *
- * @param refA A Callback or mutable Ref
- * @param refB A Callback or mutable Ref
- */
-
- function useMergedRefs(refA, refB) {
- return Object(react__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(function () {
- return mergeRefs(refA, refB);
- }, [refA, refB]);
- }
-
- /* harmony default export */ __webpack_exports__["default"] = (useMergedRefs);
-
- /***/ }),
-
- /***/ "./node_modules/@restart/hooks/esm/useMounted.js":
- /*!*******************************************************!*\
- !*** ./node_modules/@restart/hooks/esm/useMounted.js ***!
- \*******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return useMounted; });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-
- /**
- * Track whether a component is current mounted. Generally less preferable than
- * properlly canceling effects so they don't run after a component is unmounted,
- * but helpful in cases where that isn't feasible, such as a `Promise` resolution.
- *
- * @returns a function that returns the current isMounted state of the component
- *
- * ```ts
- * const [data, setData] = useState(null)
- * const isMounted = useMounted()
- *
- * useEffect(() => {
- * fetchdata().then((newData) => {
- * if (isMounted()) {
- * setData(newData);
- * }
- * })
- * })
- * ```
- */
-
- function useMounted() {
- var mounted = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(true);
- var isMounted = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(function () {
- return mounted.current;
- });
- Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
- return function () {
- mounted.current = false;
- };
- }, []);
- return isMounted.current;
- }
-
- /***/ }),
-
- /***/ "./node_modules/@restart/hooks/esm/useTimeout.js":
- /*!*******************************************************!*\
- !*** ./node_modules/@restart/hooks/esm/useTimeout.js ***!
- \*******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return useTimeout; });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _useWillUnmount__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useWillUnmount */ "./node_modules/@restart/hooks/esm/useWillUnmount.js");
- /* harmony import */ var _useMounted__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./useMounted */ "./node_modules/@restart/hooks/esm/useMounted.js");
-
-
-
- /**
- * Returns a controller object for setting a timeout that is properly cleaned up
- * once the component unmounts. New timeouts cancel and replace existing ones.
- */
-
- function useTimeout() {
- var isMounted = Object(_useMounted__WEBPACK_IMPORTED_MODULE_2__["default"])();
- var handle = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])();
-
- var clear = function clear() {
- return clearTimeout(handle.current);
- };
-
- Object(_useWillUnmount__WEBPACK_IMPORTED_MODULE_1__["default"])(clear);
- return {
- set: function set(fn, ms) {
- if (!isMounted()) return;
- clear();
- handle.current = setTimeout(fn, ms);
- },
- clear: clear
- };
- }
-
- /***/ }),
-
- /***/ "./node_modules/@restart/hooks/esm/useUpdatedRef.js":
- /*!**********************************************************!*\
- !*** ./node_modules/@restart/hooks/esm/useUpdatedRef.js ***!
- \**********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return useUpdatedRef; });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-
- /**
- * Returns a ref that is immediately updated with the new value
- *
- * @param value The Ref value
- */
-
- function useUpdatedRef(value) {
- var valueRef = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(value);
- valueRef.current = value;
- return valueRef;
- }
-
- /***/ }),
-
- /***/ "./node_modules/@restart/hooks/esm/useWillUnmount.js":
- /*!***********************************************************!*\
- !*** ./node_modules/@restart/hooks/esm/useWillUnmount.js ***!
- \***********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return useWillUnmount; });
- /* harmony import */ var _useUpdatedRef__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./useUpdatedRef */ "./node_modules/@restart/hooks/esm/useUpdatedRef.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
-
-
- /**
- * Attach a callback that fires when a component unmounts
- *
- * @param fn Handler to run when the component unmounts
- */
-
- function useWillUnmount(fn) {
- var onUnmount = Object(_useUpdatedRef__WEBPACK_IMPORTED_MODULE_0__["default"])(fn);
- Object(react__WEBPACK_IMPORTED_MODULE_1__["useEffect"])(function () {
- return function () {
- return onUnmount.current();
- };
- }, []);
- }
-
- /***/ }),
-
- /***/ "./node_modules/axios/index.js":
- /*!*************************************!*\
- !*** ./node_modules/axios/index.js ***!
- \*************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- module.exports = __webpack_require__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js");
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/adapters/xhr.js":
- /*!************************************************!*\
- !*** ./node_modules/axios/lib/adapters/xhr.js ***!
- \************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
- var settle = __webpack_require__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js");
- var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js");
- var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js");
- var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js");
- var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js");
-
- module.exports = function xhrAdapter(config) {
- return new Promise(function dispatchXhrRequest(resolve, reject) {
- var requestData = config.data;
- var requestHeaders = config.headers;
-
- if (utils.isFormData(requestData)) {
- delete requestHeaders['Content-Type']; // Let the browser set it
- }
-
- var request = new XMLHttpRequest();
-
- // HTTP basic authentication
- if (config.auth) {
- var username = config.auth.username || '';
- var password = config.auth.password || '';
- requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
- }
-
- request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);
-
- // Set the request timeout in MS
- request.timeout = config.timeout;
-
- // Listen for ready state
- request.onreadystatechange = function handleLoad() {
- if (!request || request.readyState !== 4) {
- return;
- }
-
- // The request errored out and we didn't get a response, this will be
- // handled by onerror instead
- // With one exception: request that using file: protocol, most browsers
- // will return status as 0 even though it's a successful request
- if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
- return;
- }
-
- // Prepare the response
- var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
- var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
- var response = {
- data: responseData,
- status: request.status,
- statusText: request.statusText,
- headers: responseHeaders,
- config: config,
- request: request
- };
-
- settle(resolve, reject, response);
-
- // Clean up request
- request = null;
- };
-
- // Handle low level network errors
- request.onerror = function handleError() {
- // Real errors are hidden from us by the browser
- // onerror should only fire if it's a network error
- reject(createError('Network Error', config, null, request));
-
- // Clean up request
- request = null;
- };
-
- // Handle timeout
- request.ontimeout = function handleTimeout() {
- reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',
- request));
-
- // Clean up request
- request = null;
- };
-
- // Add xsrf header
- // This is only done if running in a standard browser environment.
- // Specifically not if we're in a web worker, or react-native.
- if (utils.isStandardBrowserEnv()) {
- var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js");
-
- // Add xsrf header
- var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?
- cookies.read(config.xsrfCookieName) :
- undefined;
-
- if (xsrfValue) {
- requestHeaders[config.xsrfHeaderName] = xsrfValue;
- }
- }
-
- // Add headers to the request
- if ('setRequestHeader' in request) {
- utils.forEach(requestHeaders, function setRequestHeader(val, key) {
- if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
- // Remove Content-Type if data is undefined
- delete requestHeaders[key];
- } else {
- // Otherwise add header to the request
- request.setRequestHeader(key, val);
- }
- });
- }
-
- // Add withCredentials to request if needed
- if (config.withCredentials) {
- request.withCredentials = true;
- }
-
- // Add responseType to request if needed
- if (config.responseType) {
- try {
- request.responseType = config.responseType;
- } catch (e) {
- // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
- // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
- if (config.responseType !== 'json') {
- throw e;
- }
- }
- }
-
- // Handle progress if needed
- if (typeof config.onDownloadProgress === 'function') {
- request.addEventListener('progress', config.onDownloadProgress);
- }
-
- // Not all browsers support upload events
- if (typeof config.onUploadProgress === 'function' && request.upload) {
- request.upload.addEventListener('progress', config.onUploadProgress);
- }
-
- if (config.cancelToken) {
- // Handle cancellation
- config.cancelToken.promise.then(function onCanceled(cancel) {
- if (!request) {
- return;
- }
-
- request.abort();
- reject(cancel);
- // Clean up request
- request = null;
- });
- }
-
- if (requestData === undefined) {
- requestData = null;
- }
-
- // Send the request
- request.send(requestData);
- });
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/axios.js":
- /*!*****************************************!*\
- !*** ./node_modules/axios/lib/axios.js ***!
- \*****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js");
- var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
- var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js");
- var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js");
-
- /**
- * Create an instance of Axios
- *
- * @param {Object} defaultConfig The default config for the instance
- * @return {Axios} A new instance of Axios
- */
- function createInstance(defaultConfig) {
- var context = new Axios(defaultConfig);
- var instance = bind(Axios.prototype.request, context);
-
- // Copy axios.prototype to instance
- utils.extend(instance, Axios.prototype, context);
-
- // Copy context to instance
- utils.extend(instance, context);
-
- return instance;
- }
-
- // Create the default instance to be exported
- var axios = createInstance(defaults);
-
- // Expose Axios class to allow class inheritance
- axios.Axios = Axios;
-
- // Factory for creating new instances
- axios.create = function create(instanceConfig) {
- return createInstance(utils.merge(defaults, instanceConfig));
- };
-
- // Expose Cancel & CancelToken
- axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
- axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js");
- axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
-
- // Expose all/spread
- axios.all = function all(promises) {
- return Promise.all(promises);
- };
- axios.spread = __webpack_require__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js");
-
- module.exports = axios;
-
- // Allow use of default import syntax in TypeScript
- module.exports.default = axios;
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/cancel/Cancel.js":
- /*!*************************************************!*\
- !*** ./node_modules/axios/lib/cancel/Cancel.js ***!
- \*************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- /**
- * A `Cancel` is an object that is thrown when an operation is canceled.
- *
- * @class
- * @param {string=} message The message.
- */
- function Cancel(message) {
- this.message = message;
- }
-
- Cancel.prototype.toString = function toString() {
- return 'Cancel' + (this.message ? ': ' + this.message : '');
- };
-
- Cancel.prototype.__CANCEL__ = true;
-
- module.exports = Cancel;
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/cancel/CancelToken.js":
- /*!******************************************************!*\
- !*** ./node_modules/axios/lib/cancel/CancelToken.js ***!
- \******************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var Cancel = __webpack_require__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
-
- /**
- * A `CancelToken` is an object that can be used to request cancellation of an operation.
- *
- * @class
- * @param {Function} executor The executor function.
- */
- function CancelToken(executor) {
- if (typeof executor !== 'function') {
- throw new TypeError('executor must be a function.');
- }
-
- var resolvePromise;
- this.promise = new Promise(function promiseExecutor(resolve) {
- resolvePromise = resolve;
- });
-
- var token = this;
- executor(function cancel(message) {
- if (token.reason) {
- // Cancellation has already been requested
- return;
- }
-
- token.reason = new Cancel(message);
- resolvePromise(token.reason);
- });
- }
-
- /**
- * Throws a `Cancel` if cancellation has been requested.
- */
- CancelToken.prototype.throwIfRequested = function throwIfRequested() {
- if (this.reason) {
- throw this.reason;
- }
- };
-
- /**
- * Returns an object that contains a new `CancelToken` and a function that, when called,
- * cancels the `CancelToken`.
- */
- CancelToken.source = function source() {
- var cancel;
- var token = new CancelToken(function executor(c) {
- cancel = c;
- });
- return {
- token: token,
- cancel: cancel
- };
- };
-
- module.exports = CancelToken;
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/cancel/isCancel.js":
- /*!***************************************************!*\
- !*** ./node_modules/axios/lib/cancel/isCancel.js ***!
- \***************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- module.exports = function isCancel(value) {
- return !!(value && value.__CANCEL__);
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/core/Axios.js":
- /*!**********************************************!*\
- !*** ./node_modules/axios/lib/core/Axios.js ***!
- \**********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var defaults = __webpack_require__(/*! ./../defaults */ "./node_modules/axios/lib/defaults.js");
- var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
- var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js");
- var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js");
-
- /**
- * Create a new instance of Axios
- *
- * @param {Object} instanceConfig The default config for the instance
- */
- function Axios(instanceConfig) {
- this.defaults = instanceConfig;
- this.interceptors = {
- request: new InterceptorManager(),
- response: new InterceptorManager()
- };
- }
-
- /**
- * Dispatch a request
- *
- * @param {Object} config The config specific for this request (merged with this.defaults)
- */
- Axios.prototype.request = function request(config) {
- /*eslint no-param-reassign:0*/
- // Allow for axios('example/url'[, config]) a la fetch API
- if (typeof config === 'string') {
- config = utils.merge({
- url: arguments[0]
- }, arguments[1]);
- }
-
- config = utils.merge(defaults, {method: 'get'}, this.defaults, config);
- config.method = config.method.toLowerCase();
-
- // Hook up interceptors middleware
- var chain = [dispatchRequest, undefined];
- var promise = Promise.resolve(config);
-
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
- chain.unshift(interceptor.fulfilled, interceptor.rejected);
- });
-
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
- chain.push(interceptor.fulfilled, interceptor.rejected);
- });
-
- while (chain.length) {
- promise = promise.then(chain.shift(), chain.shift());
- }
-
- return promise;
- };
-
- // Provide aliases for supported request methods
- utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
- /*eslint func-names:0*/
- Axios.prototype[method] = function(url, config) {
- return this.request(utils.merge(config || {}, {
- method: method,
- url: url
- }));
- };
- });
-
- utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
- /*eslint func-names:0*/
- Axios.prototype[method] = function(url, data, config) {
- return this.request(utils.merge(config || {}, {
- method: method,
- url: url,
- data: data
- }));
- };
- });
-
- module.exports = Axios;
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/core/InterceptorManager.js":
- /*!***********************************************************!*\
- !*** ./node_modules/axios/lib/core/InterceptorManager.js ***!
- \***********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
-
- function InterceptorManager() {
- this.handlers = [];
- }
-
- /**
- * Add a new interceptor to the stack
- *
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
- * @param {Function} rejected The function to handle `reject` for a `Promise`
- *
- * @return {Number} An ID used to remove interceptor later
- */
- InterceptorManager.prototype.use = function use(fulfilled, rejected) {
- this.handlers.push({
- fulfilled: fulfilled,
- rejected: rejected
- });
- return this.handlers.length - 1;
- };
-
- /**
- * Remove an interceptor from the stack
- *
- * @param {Number} id The ID that was returned by `use`
- */
- InterceptorManager.prototype.eject = function eject(id) {
- if (this.handlers[id]) {
- this.handlers[id] = null;
- }
- };
-
- /**
- * Iterate over all the registered interceptors
- *
- * This method is particularly useful for skipping over any
- * interceptors that may have become `null` calling `eject`.
- *
- * @param {Function} fn The function to call for each interceptor
- */
- InterceptorManager.prototype.forEach = function forEach(fn) {
- utils.forEach(this.handlers, function forEachHandler(h) {
- if (h !== null) {
- fn(h);
- }
- });
- };
-
- module.exports = InterceptorManager;
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/core/createError.js":
- /*!****************************************************!*\
- !*** ./node_modules/axios/lib/core/createError.js ***!
- \****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var enhanceError = __webpack_require__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js");
-
- /**
- * Create an Error with the specified message, config, error code, request and response.
- *
- * @param {string} message The error message.
- * @param {Object} config The config.
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
- * @param {Object} [request] The request.
- * @param {Object} [response] The response.
- * @returns {Error} The created error.
- */
- module.exports = function createError(message, config, code, request, response) {
- var error = new Error(message);
- return enhanceError(error, config, code, request, response);
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/core/dispatchRequest.js":
- /*!********************************************************!*\
- !*** ./node_modules/axios/lib/core/dispatchRequest.js ***!
- \********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
- var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js");
- var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
- var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js");
- var isAbsoluteURL = __webpack_require__(/*! ./../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js");
- var combineURLs = __webpack_require__(/*! ./../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js");
-
- /**
- * Throws a `Cancel` if cancellation has been requested.
- */
- function throwIfCancellationRequested(config) {
- if (config.cancelToken) {
- config.cancelToken.throwIfRequested();
- }
- }
-
- /**
- * Dispatch a request to the server using the configured adapter.
- *
- * @param {object} config The config that is to be used for the request
- * @returns {Promise} The Promise to be fulfilled
- */
- module.exports = function dispatchRequest(config) {
- throwIfCancellationRequested(config);
-
- // Support baseURL config
- if (config.baseURL && !isAbsoluteURL(config.url)) {
- config.url = combineURLs(config.baseURL, config.url);
- }
-
- // Ensure headers exist
- config.headers = config.headers || {};
-
- // Transform request data
- config.data = transformData(
- config.data,
- config.headers,
- config.transformRequest
- );
-
- // Flatten headers
- config.headers = utils.merge(
- config.headers.common || {},
- config.headers[config.method] || {},
- config.headers || {}
- );
-
- utils.forEach(
- ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
- function cleanHeaderConfig(method) {
- delete config.headers[method];
- }
- );
-
- var adapter = config.adapter || defaults.adapter;
-
- return adapter(config).then(function onAdapterResolution(response) {
- throwIfCancellationRequested(config);
-
- // Transform response data
- response.data = transformData(
- response.data,
- response.headers,
- config.transformResponse
- );
-
- return response;
- }, function onAdapterRejection(reason) {
- if (!isCancel(reason)) {
- throwIfCancellationRequested(config);
-
- // Transform response data
- if (reason && reason.response) {
- reason.response.data = transformData(
- reason.response.data,
- reason.response.headers,
- config.transformResponse
- );
- }
- }
-
- return Promise.reject(reason);
- });
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/core/enhanceError.js":
- /*!*****************************************************!*\
- !*** ./node_modules/axios/lib/core/enhanceError.js ***!
- \*****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- /**
- * Update an Error with the specified config, error code, and response.
- *
- * @param {Error} error The error to update.
- * @param {Object} config The config.
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
- * @param {Object} [request] The request.
- * @param {Object} [response] The response.
- * @returns {Error} The error.
- */
- module.exports = function enhanceError(error, config, code, request, response) {
- error.config = config;
- if (code) {
- error.code = code;
- }
- error.request = request;
- error.response = response;
- return error;
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/core/settle.js":
- /*!***********************************************!*\
- !*** ./node_modules/axios/lib/core/settle.js ***!
- \***********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var createError = __webpack_require__(/*! ./createError */ "./node_modules/axios/lib/core/createError.js");
-
- /**
- * Resolve or reject a Promise based on response status.
- *
- * @param {Function} resolve A function that resolves the promise.
- * @param {Function} reject A function that rejects the promise.
- * @param {object} response The response.
- */
- module.exports = function settle(resolve, reject, response) {
- var validateStatus = response.config.validateStatus;
- // Note: status is not exposed by XDomainRequest
- if (!response.status || !validateStatus || validateStatus(response.status)) {
- resolve(response);
- } else {
- reject(createError(
- 'Request failed with status code ' + response.status,
- response.config,
- null,
- response.request,
- response
- ));
- }
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/core/transformData.js":
- /*!******************************************************!*\
- !*** ./node_modules/axios/lib/core/transformData.js ***!
- \******************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
-
- /**
- * Transform the data for a request or a response
- *
- * @param {Object|String} data The data to be transformed
- * @param {Array} headers The headers for the request or response
- * @param {Array|Function} fns A single function or Array of functions
- * @returns {*} The resulting transformed data
- */
- module.exports = function transformData(data, headers, fns) {
- /*eslint no-param-reassign:0*/
- utils.forEach(fns, function transform(fn) {
- data = fn(data, headers);
- });
-
- return data;
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/defaults.js":
- /*!********************************************!*\
- !*** ./node_modules/axios/lib/defaults.js ***!
- \********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
- /* WEBPACK VAR INJECTION */(function(process) {
-
- var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js");
- var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js");
-
- var DEFAULT_CONTENT_TYPE = {
- 'Content-Type': 'application/x-www-form-urlencoded'
- };
-
- function setContentTypeIfUnset(headers, value) {
- if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
- headers['Content-Type'] = value;
- }
- }
-
- function getDefaultAdapter() {
- var adapter;
- if (typeof XMLHttpRequest !== 'undefined') {
- // For browsers use XHR adapter
- adapter = __webpack_require__(/*! ./adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js");
- } else if (typeof process !== 'undefined') {
- // For node use HTTP adapter
- adapter = __webpack_require__(/*! ./adapters/http */ "./node_modules/axios/lib/adapters/xhr.js");
- }
- return adapter;
- }
-
- var defaults = {
- adapter: getDefaultAdapter(),
-
- transformRequest: [function transformRequest(data, headers) {
- normalizeHeaderName(headers, 'Content-Type');
- if (utils.isFormData(data) ||
- utils.isArrayBuffer(data) ||
- utils.isBuffer(data) ||
- utils.isStream(data) ||
- utils.isFile(data) ||
- utils.isBlob(data)
- ) {
- return data;
- }
- if (utils.isArrayBufferView(data)) {
- return data.buffer;
- }
- if (utils.isURLSearchParams(data)) {
- setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
- return data.toString();
- }
- if (utils.isObject(data)) {
- setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
- return JSON.stringify(data);
- }
- return data;
- }],
-
- transformResponse: [function transformResponse(data) {
- /*eslint no-param-reassign:0*/
- if (typeof data === 'string') {
- try {
- data = JSON.parse(data);
- } catch (e) { /* Ignore */ }
- }
- return data;
- }],
-
- /**
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
- * timeout is not created.
- */
- timeout: 0,
-
- xsrfCookieName: 'XSRF-TOKEN',
- xsrfHeaderName: 'X-XSRF-TOKEN',
-
- maxContentLength: -1,
-
- validateStatus: function validateStatus(status) {
- return status >= 200 && status < 300;
- }
- };
-
- defaults.headers = {
- common: {
- 'Accept': 'application/json, text/plain, */*'
- }
- };
-
- utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
- defaults.headers[method] = {};
- });
-
- utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
- defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
- });
-
- module.exports = defaults;
-
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js")))
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/helpers/bind.js":
- /*!************************************************!*\
- !*** ./node_modules/axios/lib/helpers/bind.js ***!
- \************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- module.exports = function bind(fn, thisArg) {
- return function wrap() {
- var args = new Array(arguments.length);
- for (var i = 0; i < args.length; i++) {
- args[i] = arguments[i];
- }
- return fn.apply(thisArg, args);
- };
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/helpers/buildURL.js":
- /*!****************************************************!*\
- !*** ./node_modules/axios/lib/helpers/buildURL.js ***!
- \****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
-
- function encode(val) {
- return encodeURIComponent(val).
- replace(/%40/gi, '@').
- replace(/%3A/gi, ':').
- replace(/%24/g, '$').
- replace(/%2C/gi, ',').
- replace(/%20/g, '+').
- replace(/%5B/gi, '[').
- replace(/%5D/gi, ']');
- }
-
- /**
- * Build a URL by appending params to the end
- *
- * @param {string} url The base of the url (e.g., http://www.google.com)
- * @param {object} [params] The params to be appended
- * @returns {string} The formatted url
- */
- module.exports = function buildURL(url, params, paramsSerializer) {
- /*eslint no-param-reassign:0*/
- if (!params) {
- return url;
- }
-
- var serializedParams;
- if (paramsSerializer) {
- serializedParams = paramsSerializer(params);
- } else if (utils.isURLSearchParams(params)) {
- serializedParams = params.toString();
- } else {
- var parts = [];
-
- utils.forEach(params, function serialize(val, key) {
- if (val === null || typeof val === 'undefined') {
- return;
- }
-
- if (utils.isArray(val)) {
- key = key + '[]';
- } else {
- val = [val];
- }
-
- utils.forEach(val, function parseValue(v) {
- if (utils.isDate(v)) {
- v = v.toISOString();
- } else if (utils.isObject(v)) {
- v = JSON.stringify(v);
- }
- parts.push(encode(key) + '=' + encode(v));
- });
- });
-
- serializedParams = parts.join('&');
- }
-
- if (serializedParams) {
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
- }
-
- return url;
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/helpers/combineURLs.js":
- /*!*******************************************************!*\
- !*** ./node_modules/axios/lib/helpers/combineURLs.js ***!
- \*******************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- /**
- * Creates a new URL by combining the specified URLs
- *
- * @param {string} baseURL The base URL
- * @param {string} relativeURL The relative URL
- * @returns {string} The combined URL
- */
- module.exports = function combineURLs(baseURL, relativeURL) {
- return relativeURL
- ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
- : baseURL;
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/helpers/cookies.js":
- /*!***************************************************!*\
- !*** ./node_modules/axios/lib/helpers/cookies.js ***!
- \***************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
-
- module.exports = (
- utils.isStandardBrowserEnv() ?
-
- // Standard browser envs support document.cookie
- (function standardBrowserEnv() {
- return {
- write: function write(name, value, expires, path, domain, secure) {
- var cookie = [];
- cookie.push(name + '=' + encodeURIComponent(value));
-
- if (utils.isNumber(expires)) {
- cookie.push('expires=' + new Date(expires).toGMTString());
- }
-
- if (utils.isString(path)) {
- cookie.push('path=' + path);
- }
-
- if (utils.isString(domain)) {
- cookie.push('domain=' + domain);
- }
-
- if (secure === true) {
- cookie.push('secure');
- }
-
- document.cookie = cookie.join('; ');
- },
-
- read: function read(name) {
- var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
- return (match ? decodeURIComponent(match[3]) : null);
- },
-
- remove: function remove(name) {
- this.write(name, '', Date.now() - 86400000);
- }
- };
- })() :
-
- // Non standard browser env (web workers, react-native) lack needed support.
- (function nonStandardBrowserEnv() {
- return {
- write: function write() {},
- read: function read() { return null; },
- remove: function remove() {}
- };
- })()
- );
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js":
- /*!*********************************************************!*\
- !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***!
- \*********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- /**
- * Determines whether the specified URL is absolute
- *
- * @param {string} url The URL to test
- * @returns {boolean} True if the specified URL is absolute, otherwise false
- */
- module.exports = function isAbsoluteURL(url) {
- // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
- // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
- // by any combination of letters, digits, plus, period, or hyphen.
- return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js":
- /*!***********************************************************!*\
- !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***!
- \***********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
-
- module.exports = (
- utils.isStandardBrowserEnv() ?
-
- // Standard browser envs have full support of the APIs needed to test
- // whether the request URL is of the same origin as current location.
- (function standardBrowserEnv() {
- var msie = /(msie|trident)/i.test(navigator.userAgent);
- var urlParsingNode = document.createElement('a');
- var originURL;
-
- /**
- * Parse a URL to discover it's components
- *
- * @param {String} url The URL to be parsed
- * @returns {Object}
- */
- function resolveURL(url) {
- var href = url;
-
- if (msie) {
- // IE needs attribute set twice to normalize properties
- urlParsingNode.setAttribute('href', href);
- href = urlParsingNode.href;
- }
-
- urlParsingNode.setAttribute('href', href);
-
- // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
- return {
- href: urlParsingNode.href,
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
- host: urlParsingNode.host,
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
- hostname: urlParsingNode.hostname,
- port: urlParsingNode.port,
- pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
- urlParsingNode.pathname :
- '/' + urlParsingNode.pathname
- };
- }
-
- originURL = resolveURL(window.location.href);
-
- /**
- * Determine if a URL shares the same origin as the current location
- *
- * @param {String} requestURL The URL to test
- * @returns {boolean} True if URL shares the same origin, otherwise false
- */
- return function isURLSameOrigin(requestURL) {
- var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
- return (parsed.protocol === originURL.protocol &&
- parsed.host === originURL.host);
- };
- })() :
-
- // Non standard browser envs (web workers, react-native) lack needed support.
- (function nonStandardBrowserEnv() {
- return function isURLSameOrigin() {
- return true;
- };
- })()
- );
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js":
- /*!***************************************************************!*\
- !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***!
- \***************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
-
- module.exports = function normalizeHeaderName(headers, normalizedName) {
- utils.forEach(headers, function processHeader(value, name) {
- if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
- headers[normalizedName] = value;
- delete headers[name];
- }
- });
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/helpers/parseHeaders.js":
- /*!********************************************************!*\
- !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***!
- \********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
-
- // Headers whose duplicates are ignored by node
- // c.f. https://nodejs.org/api/http.html#http_message_headers
- var ignoreDuplicateOf = [
- 'age', 'authorization', 'content-length', 'content-type', 'etag',
- 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
- 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
- 'referer', 'retry-after', 'user-agent'
- ];
-
- /**
- * Parse headers into an object
- *
- * ```
- * Date: Wed, 27 Aug 2014 08:58:49 GMT
- * Content-Type: application/json
- * Connection: keep-alive
- * Transfer-Encoding: chunked
- * ```
- *
- * @param {String} headers Headers needing to be parsed
- * @returns {Object} Headers parsed into an object
- */
- module.exports = function parseHeaders(headers) {
- var parsed = {};
- var key;
- var val;
- var i;
-
- if (!headers) { return parsed; }
-
- utils.forEach(headers.split('\n'), function parser(line) {
- i = line.indexOf(':');
- key = utils.trim(line.substr(0, i)).toLowerCase();
- val = utils.trim(line.substr(i + 1));
-
- if (key) {
- if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
- return;
- }
- if (key === 'set-cookie') {
- parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
- } else {
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
- }
- }
- });
-
- return parsed;
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/helpers/spread.js":
- /*!**************************************************!*\
- !*** ./node_modules/axios/lib/helpers/spread.js ***!
- \**************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- /**
- * Syntactic sugar for invoking a function and expanding an array for arguments.
- *
- * Common use case would be to use `Function.prototype.apply`.
- *
- * ```js
- * function f(x, y, z) {}
- * var args = [1, 2, 3];
- * f.apply(null, args);
- * ```
- *
- * With `spread` this example can be re-written.
- *
- * ```js
- * spread(function(x, y, z) {})([1, 2, 3]);
- * ```
- *
- * @param {Function} callback
- * @returns {Function}
- */
- module.exports = function spread(callback) {
- return function wrap(arr) {
- return callback.apply(null, arr);
- };
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/axios/lib/utils.js":
- /*!*****************************************!*\
- !*** ./node_modules/axios/lib/utils.js ***!
- \*****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
- var isBuffer = __webpack_require__(/*! is-buffer */ "./node_modules/is-buffer/index.js");
-
- /*global toString:true*/
-
- // utils is a library of generic helper functions non-specific to axios
-
- var toString = Object.prototype.toString;
-
- /**
- * Determine if a value is an Array
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is an Array, otherwise false
- */
- function isArray(val) {
- return toString.call(val) === '[object Array]';
- }
-
- /**
- * Determine if a value is an ArrayBuffer
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is an ArrayBuffer, otherwise false
- */
- function isArrayBuffer(val) {
- return toString.call(val) === '[object ArrayBuffer]';
- }
-
- /**
- * Determine if a value is a FormData
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is an FormData, otherwise false
- */
- function isFormData(val) {
- return (typeof FormData !== 'undefined') && (val instanceof FormData);
- }
-
- /**
- * Determine if a value is a view on an ArrayBuffer
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
- */
- function isArrayBufferView(val) {
- var result;
- if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
- result = ArrayBuffer.isView(val);
- } else {
- result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
- }
- return result;
- }
-
- /**
- * Determine if a value is a String
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a String, otherwise false
- */
- function isString(val) {
- return typeof val === 'string';
- }
-
- /**
- * Determine if a value is a Number
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a Number, otherwise false
- */
- function isNumber(val) {
- return typeof val === 'number';
- }
-
- /**
- * Determine if a value is undefined
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if the value is undefined, otherwise false
- */
- function isUndefined(val) {
- return typeof val === 'undefined';
- }
-
- /**
- * Determine if a value is an Object
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is an Object, otherwise false
- */
- function isObject(val) {
- return val !== null && typeof val === 'object';
- }
-
- /**
- * Determine if a value is a Date
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a Date, otherwise false
- */
- function isDate(val) {
- return toString.call(val) === '[object Date]';
- }
-
- /**
- * Determine if a value is a File
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a File, otherwise false
- */
- function isFile(val) {
- return toString.call(val) === '[object File]';
- }
-
- /**
- * Determine if a value is a Blob
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a Blob, otherwise false
- */
- function isBlob(val) {
- return toString.call(val) === '[object Blob]';
- }
-
- /**
- * Determine if a value is a Function
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a Function, otherwise false
- */
- function isFunction(val) {
- return toString.call(val) === '[object Function]';
- }
-
- /**
- * Determine if a value is a Stream
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a Stream, otherwise false
- */
- function isStream(val) {
- return isObject(val) && isFunction(val.pipe);
- }
-
- /**
- * Determine if a value is a URLSearchParams object
- *
- * @param {Object} val The value to test
- * @returns {boolean} True if value is a URLSearchParams object, otherwise false
- */
- function isURLSearchParams(val) {
- return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
- }
-
- /**
- * Trim excess whitespace off the beginning and end of a string
- *
- * @param {String} str The String to trim
- * @returns {String} The String freed of excess whitespace
- */
- function trim(str) {
- return str.replace(/^\s*/, '').replace(/\s*$/, '');
- }
-
- /**
- * Determine if we're running in a standard browser environment
- *
- * This allows axios to run in a web worker, and react-native.
- * Both environments support XMLHttpRequest, but not fully standard globals.
- *
- * web workers:
- * typeof window -> undefined
- * typeof document -> undefined
- *
- * react-native:
- * navigator.product -> 'ReactNative'
- */
- function isStandardBrowserEnv() {
- if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
- return false;
- }
- return (
- typeof window !== 'undefined' &&
- typeof document !== 'undefined'
- );
- }
-
- /**
- * Iterate over an Array or an Object invoking a function for each item.
- *
- * If `obj` is an Array callback will be called passing
- * the value, index, and complete array for each item.
- *
- * If 'obj' is an Object callback will be called passing
- * the value, key, and complete object for each property.
- *
- * @param {Object|Array} obj The object to iterate
- * @param {Function} fn The callback to invoke for each item
- */
- function forEach(obj, fn) {
- // Don't bother if no value provided
- if (obj === null || typeof obj === 'undefined') {
- return;
- }
-
- // Force an array if not already something iterable
- if (typeof obj !== 'object') {
- /*eslint no-param-reassign:0*/
- obj = [obj];
- }
-
- if (isArray(obj)) {
- // Iterate over array values
- for (var i = 0, l = obj.length; i < l; i++) {
- fn.call(null, obj[i], i, obj);
- }
- } else {
- // Iterate over object keys
- for (var key in obj) {
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
- fn.call(null, obj[key], key, obj);
- }
- }
- }
- }
-
- /**
- * Accepts varargs expecting each argument to be an object, then
- * immutably merges the properties of each object and returns result.
- *
- * When multiple objects contain the same key the later object in
- * the arguments list will take precedence.
- *
- * Example:
- *
- * ```js
- * var result = merge({foo: 123}, {foo: 456});
- * console.log(result.foo); // outputs 456
- * ```
- *
- * @param {Object} obj1 Object to merge
- * @returns {Object} Result of all merge properties
- */
- function merge(/* obj1, obj2, obj3, ... */) {
- var result = {};
- function assignValue(val, key) {
- if (typeof result[key] === 'object' && typeof val === 'object') {
- result[key] = merge(result[key], val);
- } else {
- result[key] = val;
- }
- }
-
- for (var i = 0, l = arguments.length; i < l; i++) {
- forEach(arguments[i], assignValue);
- }
- return result;
- }
-
- /**
- * Extends object a by mutably adding to it the properties of object b.
- *
- * @param {Object} a The object to be extended
- * @param {Object} b The object to copy properties from
- * @param {Object} thisArg The object to bind function to
- * @return {Object} The resulting value of object a
- */
- function extend(a, b, thisArg) {
- forEach(b, function assignValue(val, key) {
- if (thisArg && typeof val === 'function') {
- a[key] = bind(val, thisArg);
- } else {
- a[key] = val;
- }
- });
- return a;
- }
-
- module.exports = {
- isArray: isArray,
- isArrayBuffer: isArrayBuffer,
- isBuffer: isBuffer,
- isFormData: isFormData,
- isArrayBufferView: isArrayBufferView,
- isString: isString,
- isNumber: isNumber,
- isObject: isObject,
- isUndefined: isUndefined,
- isDate: isDate,
- isFile: isFile,
- isBlob: isBlob,
- isFunction: isFunction,
- isStream: isStream,
- isURLSearchParams: isURLSearchParams,
- isStandardBrowserEnv: isStandardBrowserEnv,
- forEach: forEach,
- merge: merge,
- extend: extend,
- trim: trim
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/base64-js/index.js":
- /*!*****************************************!*\
- !*** ./node_modules/base64-js/index.js ***!
- \*****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.byteLength = byteLength
- exports.toByteArray = toByteArray
- exports.fromByteArray = fromByteArray
-
- var lookup = []
- var revLookup = []
- var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
-
- var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
- for (var i = 0, len = code.length; i < len; ++i) {
- lookup[i] = code[i]
- revLookup[code.charCodeAt(i)] = i
- }
-
- // Support decoding URL-safe base64 strings, as Node.js does.
- // See: https://en.wikipedia.org/wiki/Base64#URL_applications
- revLookup['-'.charCodeAt(0)] = 62
- revLookup['_'.charCodeAt(0)] = 63
-
- function getLens (b64) {
- var len = b64.length
-
- if (len % 4 > 0) {
- throw new Error('Invalid string. Length must be a multiple of 4')
- }
-
- // Trim off extra bytes after placeholder bytes are found
- // See: https://github.com/beatgammit/base64-js/issues/42
- var validLen = b64.indexOf('=')
- if (validLen === -1) validLen = len
-
- var placeHoldersLen = validLen === len
- ? 0
- : 4 - (validLen % 4)
-
- return [validLen, placeHoldersLen]
- }
-
- // base64 is 4/3 + up to two characters of the original data
- function byteLength (b64) {
- var lens = getLens(b64)
- var validLen = lens[0]
- var placeHoldersLen = lens[1]
- return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
- }
-
- function _byteLength (b64, validLen, placeHoldersLen) {
- return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
- }
-
- function toByteArray (b64) {
- var tmp
- var lens = getLens(b64)
- var validLen = lens[0]
- var placeHoldersLen = lens[1]
-
- var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
-
- var curByte = 0
-
- // if there are placeholders, only get up to the last complete 4 chars
- var len = placeHoldersLen > 0
- ? validLen - 4
- : validLen
-
- var i
- for (i = 0; i < len; i += 4) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 18) |
- (revLookup[b64.charCodeAt(i + 1)] << 12) |
- (revLookup[b64.charCodeAt(i + 2)] << 6) |
- revLookup[b64.charCodeAt(i + 3)]
- arr[curByte++] = (tmp >> 16) & 0xFF
- arr[curByte++] = (tmp >> 8) & 0xFF
- arr[curByte++] = tmp & 0xFF
- }
-
- if (placeHoldersLen === 2) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 2) |
- (revLookup[b64.charCodeAt(i + 1)] >> 4)
- arr[curByte++] = tmp & 0xFF
- }
-
- if (placeHoldersLen === 1) {
- tmp =
- (revLookup[b64.charCodeAt(i)] << 10) |
- (revLookup[b64.charCodeAt(i + 1)] << 4) |
- (revLookup[b64.charCodeAt(i + 2)] >> 2)
- arr[curByte++] = (tmp >> 8) & 0xFF
- arr[curByte++] = tmp & 0xFF
- }
-
- return arr
- }
-
- function tripletToBase64 (num) {
- return lookup[num >> 18 & 0x3F] +
- lookup[num >> 12 & 0x3F] +
- lookup[num >> 6 & 0x3F] +
- lookup[num & 0x3F]
- }
-
- function encodeChunk (uint8, start, end) {
- var tmp
- var output = []
- for (var i = start; i < end; i += 3) {
- tmp =
- ((uint8[i] << 16) & 0xFF0000) +
- ((uint8[i + 1] << 8) & 0xFF00) +
- (uint8[i + 2] & 0xFF)
- output.push(tripletToBase64(tmp))
- }
- return output.join('')
- }
-
- function fromByteArray (uint8) {
- var tmp
- var len = uint8.length
- var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
- var parts = []
- var maxChunkLength = 16383 // must be multiple of 3
-
- // go through the array every three bytes, we'll deal with trailing stuff later
- for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
- parts.push(encodeChunk(
- uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
- ))
- }
-
- // pad the end with zeros, but make sure to not forget the extra bytes
- if (extraBytes === 1) {
- tmp = uint8[len - 1]
- parts.push(
- lookup[tmp >> 2] +
- lookup[(tmp << 4) & 0x3F] +
- '=='
- )
- } else if (extraBytes === 2) {
- tmp = (uint8[len - 2] << 8) + uint8[len - 1]
- parts.push(
- lookup[tmp >> 10] +
- lookup[(tmp >> 4) & 0x3F] +
- lookup[(tmp << 2) & 0x3F] +
- '='
- )
- }
-
- return parts.join('')
- }
-
-
- /***/ }),
-
- /***/ "./node_modules/bootstrap/dist/js/bootstrap.js":
- /*!*****************************************************!*\
- !*** ./node_modules/bootstrap/dist/js/bootstrap.js ***!
- \*****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- /*!
- * Bootstrap v4.3.1 (https://getbootstrap.com/)
- * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- */
- (function (global, factory) {
- true ? factory(exports, __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"), __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")) :
- undefined;
- }(this, function (exports, $, Popper) { 'use strict';
-
- $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
- Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;
-
- 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);
- }
- }
-
- function _createClass(Constructor, protoProps, staticProps) {
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
- if (staticProps) _defineProperties(Constructor, staticProps);
- return Constructor;
- }
-
- function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
-
- return obj;
- }
-
- function _objectSpread(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i] != null ? arguments[i] : {};
- var ownKeys = Object.keys(source);
-
- if (typeof Object.getOwnPropertySymbols === 'function') {
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
- }));
- }
-
- ownKeys.forEach(function (key) {
- _defineProperty(target, key, source[key]);
- });
- }
-
- return target;
- }
-
- function _inheritsLoose(subClass, superClass) {
- subClass.prototype = Object.create(superClass.prototype);
- subClass.prototype.constructor = subClass;
- subClass.__proto__ = superClass;
- }
-
- /**
- * --------------------------------------------------------------------------
- * Bootstrap (v4.3.1): util.js
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * --------------------------------------------------------------------------
- */
- /**
- * ------------------------------------------------------------------------
- * Private TransitionEnd Helpers
- * ------------------------------------------------------------------------
- */
-
- var TRANSITION_END = 'transitionend';
- var MAX_UID = 1000000;
- var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
-
- function toType(obj) {
- return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
- }
-
- function getSpecialTransitionEndEvent() {
- return {
- bindType: TRANSITION_END,
- delegateType: TRANSITION_END,
- handle: function handle(event) {
- if ($(event.target).is(this)) {
- return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
- }
-
- return undefined; // eslint-disable-line no-undefined
- }
- };
- }
-
- function transitionEndEmulator(duration) {
- var _this = this;
-
- var called = false;
- $(this).one(Util.TRANSITION_END, function () {
- called = true;
- });
- setTimeout(function () {
- if (!called) {
- Util.triggerTransitionEnd(_this);
- }
- }, duration);
- return this;
- }
-
- function setTransitionEndSupport() {
- $.fn.emulateTransitionEnd = transitionEndEmulator;
- $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
- }
- /**
- * --------------------------------------------------------------------------
- * Public Util Api
- * --------------------------------------------------------------------------
- */
-
-
- var Util = {
- TRANSITION_END: 'bsTransitionEnd',
- getUID: function getUID(prefix) {
- do {
- // eslint-disable-next-line no-bitwise
- prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
- } while (document.getElementById(prefix));
-
- return prefix;
- },
- getSelectorFromElement: function getSelectorFromElement(element) {
- var selector = element.getAttribute('data-target');
-
- if (!selector || selector === '#') {
- var hrefAttr = element.getAttribute('href');
- selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
- }
-
- try {
- return document.querySelector(selector) ? selector : null;
- } catch (err) {
- return null;
- }
- },
- getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
- if (!element) {
- return 0;
- } // Get transition-duration of the element
-
-
- var transitionDuration = $(element).css('transition-duration');
- var transitionDelay = $(element).css('transition-delay');
- var floatTransitionDuration = parseFloat(transitionDuration);
- var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
-
- if (!floatTransitionDuration && !floatTransitionDelay) {
- return 0;
- } // If multiple durations are defined, take the first
-
-
- transitionDuration = transitionDuration.split(',')[0];
- transitionDelay = transitionDelay.split(',')[0];
- return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
- },
- reflow: function reflow(element) {
- return element.offsetHeight;
- },
- triggerTransitionEnd: function triggerTransitionEnd(element) {
- $(element).trigger(TRANSITION_END);
- },
- // TODO: Remove in v5
- supportsTransitionEnd: function supportsTransitionEnd() {
- return Boolean(TRANSITION_END);
- },
- isElement: function isElement(obj) {
- return (obj[0] || obj).nodeType;
- },
- typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
- for (var property in configTypes) {
- if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
- var expectedTypes = configTypes[property];
- var value = config[property];
- var valueType = value && Util.isElement(value) ? 'element' : toType(value);
-
- if (!new RegExp(expectedTypes).test(valueType)) {
- throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
- }
- }
- }
- },
- findShadowRoot: function findShadowRoot(element) {
- if (!document.documentElement.attachShadow) {
- return null;
- } // Can find the shadow root otherwise it'll return the document
-
-
- if (typeof element.getRootNode === 'function') {
- var root = element.getRootNode();
- return root instanceof ShadowRoot ? root : null;
- }
-
- if (element instanceof ShadowRoot) {
- return element;
- } // when we don't find a shadow root
-
-
- if (!element.parentNode) {
- return null;
- }
-
- return Util.findShadowRoot(element.parentNode);
- }
- };
- setTransitionEndSupport();
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME = 'alert';
- var VERSION = '4.3.1';
- var DATA_KEY = 'bs.alert';
- var EVENT_KEY = "." + DATA_KEY;
- var DATA_API_KEY = '.data-api';
- var JQUERY_NO_CONFLICT = $.fn[NAME];
- var Selector = {
- DISMISS: '[data-dismiss="alert"]'
- };
- var Event = {
- CLOSE: "close" + EVENT_KEY,
- CLOSED: "closed" + EVENT_KEY,
- CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
- };
- var ClassName = {
- ALERT: 'alert',
- FADE: 'fade',
- SHOW: 'show'
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- };
-
- var Alert =
- /*#__PURE__*/
- function () {
- function Alert(element) {
- this._element = element;
- } // Getters
-
-
- var _proto = Alert.prototype;
-
- // Public
- _proto.close = function close(element) {
- var rootElement = this._element;
-
- if (element) {
- rootElement = this._getRootElement(element);
- }
-
- var customEvent = this._triggerCloseEvent(rootElement);
-
- if (customEvent.isDefaultPrevented()) {
- return;
- }
-
- this._removeElement(rootElement);
- };
-
- _proto.dispose = function dispose() {
- $.removeData(this._element, DATA_KEY);
- this._element = null;
- } // Private
- ;
-
- _proto._getRootElement = function _getRootElement(element) {
- var selector = Util.getSelectorFromElement(element);
- var parent = false;
-
- if (selector) {
- parent = document.querySelector(selector);
- }
-
- if (!parent) {
- parent = $(element).closest("." + ClassName.ALERT)[0];
- }
-
- return parent;
- };
-
- _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
- var closeEvent = $.Event(Event.CLOSE);
- $(element).trigger(closeEvent);
- return closeEvent;
- };
-
- _proto._removeElement = function _removeElement(element) {
- var _this = this;
-
- $(element).removeClass(ClassName.SHOW);
-
- if (!$(element).hasClass(ClassName.FADE)) {
- this._destroyElement(element);
-
- return;
- }
-
- var transitionDuration = Util.getTransitionDurationFromElement(element);
- $(element).one(Util.TRANSITION_END, function (event) {
- return _this._destroyElement(element, event);
- }).emulateTransitionEnd(transitionDuration);
- };
-
- _proto._destroyElement = function _destroyElement(element) {
- $(element).detach().trigger(Event.CLOSED).remove();
- } // Static
- ;
-
- Alert._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var $element = $(this);
- var data = $element.data(DATA_KEY);
-
- if (!data) {
- data = new Alert(this);
- $element.data(DATA_KEY, data);
- }
-
- if (config === 'close') {
- data[config](this);
- }
- });
- };
-
- Alert._handleDismiss = function _handleDismiss(alertInstance) {
- return function (event) {
- if (event) {
- event.preventDefault();
- }
-
- alertInstance.close(this);
- };
- };
-
- _createClass(Alert, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION;
- }
- }]);
-
- return Alert;
- }();
- /**
- * ------------------------------------------------------------------------
- * Data Api implementation
- * ------------------------------------------------------------------------
- */
-
-
- $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
- $.fn[NAME] = Alert._jQueryInterface;
- $.fn[NAME].Constructor = Alert;
-
- $.fn[NAME].noConflict = function () {
- $.fn[NAME] = JQUERY_NO_CONFLICT;
- return Alert._jQueryInterface;
- };
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$1 = 'button';
- var VERSION$1 = '4.3.1';
- var DATA_KEY$1 = 'bs.button';
- var EVENT_KEY$1 = "." + DATA_KEY$1;
- var DATA_API_KEY$1 = '.data-api';
- var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1];
- var ClassName$1 = {
- ACTIVE: 'active',
- BUTTON: 'btn',
- FOCUS: 'focus'
- };
- var Selector$1 = {
- DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
- DATA_TOGGLE: '[data-toggle="buttons"]',
- INPUT: 'input:not([type="hidden"])',
- ACTIVE: '.active',
- BUTTON: '.btn'
- };
- var Event$1 = {
- CLICK_DATA_API: "click" + EVENT_KEY$1 + DATA_API_KEY$1,
- FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1)
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- };
-
- var Button =
- /*#__PURE__*/
- function () {
- function Button(element) {
- this._element = element;
- } // Getters
-
-
- var _proto = Button.prototype;
-
- // Public
- _proto.toggle = function toggle() {
- var triggerChangeEvent = true;
- var addAriaPressed = true;
- var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLE)[0];
-
- if (rootElement) {
- var input = this._element.querySelector(Selector$1.INPUT);
-
- if (input) {
- if (input.type === 'radio') {
- if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) {
- triggerChangeEvent = false;
- } else {
- var activeElement = rootElement.querySelector(Selector$1.ACTIVE);
-
- if (activeElement) {
- $(activeElement).removeClass(ClassName$1.ACTIVE);
- }
- }
- }
-
- if (triggerChangeEvent) {
- if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
- return;
- }
-
- input.checked = !this._element.classList.contains(ClassName$1.ACTIVE);
- $(input).trigger('change');
- }
-
- input.focus();
- addAriaPressed = false;
- }
- }
-
- if (addAriaPressed) {
- this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE));
- }
-
- if (triggerChangeEvent) {
- $(this._element).toggleClass(ClassName$1.ACTIVE);
- }
- };
-
- _proto.dispose = function dispose() {
- $.removeData(this._element, DATA_KEY$1);
- this._element = null;
- } // Static
- ;
-
- Button._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var data = $(this).data(DATA_KEY$1);
-
- if (!data) {
- data = new Button(this);
- $(this).data(DATA_KEY$1, data);
- }
-
- if (config === 'toggle') {
- data[config]();
- }
- });
- };
-
- _createClass(Button, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION$1;
- }
- }]);
-
- return Button;
- }();
- /**
- * ------------------------------------------------------------------------
- * Data Api implementation
- * ------------------------------------------------------------------------
- */
-
-
- $(document).on(Event$1.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
- event.preventDefault();
- var button = event.target;
-
- if (!$(button).hasClass(ClassName$1.BUTTON)) {
- button = $(button).closest(Selector$1.BUTTON);
- }
-
- Button._jQueryInterface.call($(button), 'toggle');
- }).on(Event$1.FOCUS_BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
- var button = $(event.target).closest(Selector$1.BUTTON)[0];
- $(button).toggleClass(ClassName$1.FOCUS, /^focus(in)?$/.test(event.type));
- });
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
- $.fn[NAME$1] = Button._jQueryInterface;
- $.fn[NAME$1].Constructor = Button;
-
- $.fn[NAME$1].noConflict = function () {
- $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
- return Button._jQueryInterface;
- };
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$2 = 'carousel';
- var VERSION$2 = '4.3.1';
- var DATA_KEY$2 = 'bs.carousel';
- var EVENT_KEY$2 = "." + DATA_KEY$2;
- var DATA_API_KEY$2 = '.data-api';
- var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2];
- var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
-
- var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
-
- var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
-
- var SWIPE_THRESHOLD = 40;
- var Default = {
- interval: 5000,
- keyboard: true,
- slide: false,
- pause: 'hover',
- wrap: true,
- touch: true
- };
- var DefaultType = {
- interval: '(number|boolean)',
- keyboard: 'boolean',
- slide: '(boolean|string)',
- pause: '(string|boolean)',
- wrap: 'boolean',
- touch: 'boolean'
- };
- var Direction = {
- NEXT: 'next',
- PREV: 'prev',
- LEFT: 'left',
- RIGHT: 'right'
- };
- var Event$2 = {
- SLIDE: "slide" + EVENT_KEY$2,
- SLID: "slid" + EVENT_KEY$2,
- KEYDOWN: "keydown" + EVENT_KEY$2,
- MOUSEENTER: "mouseenter" + EVENT_KEY$2,
- MOUSELEAVE: "mouseleave" + EVENT_KEY$2,
- TOUCHSTART: "touchstart" + EVENT_KEY$2,
- TOUCHMOVE: "touchmove" + EVENT_KEY$2,
- TOUCHEND: "touchend" + EVENT_KEY$2,
- POINTERDOWN: "pointerdown" + EVENT_KEY$2,
- POINTERUP: "pointerup" + EVENT_KEY$2,
- DRAG_START: "dragstart" + EVENT_KEY$2,
- LOAD_DATA_API: "load" + EVENT_KEY$2 + DATA_API_KEY$2,
- CLICK_DATA_API: "click" + EVENT_KEY$2 + DATA_API_KEY$2
- };
- var ClassName$2 = {
- CAROUSEL: 'carousel',
- ACTIVE: 'active',
- SLIDE: 'slide',
- RIGHT: 'carousel-item-right',
- LEFT: 'carousel-item-left',
- NEXT: 'carousel-item-next',
- PREV: 'carousel-item-prev',
- ITEM: 'carousel-item',
- POINTER_EVENT: 'pointer-event'
- };
- var Selector$2 = {
- ACTIVE: '.active',
- ACTIVE_ITEM: '.active.carousel-item',
- ITEM: '.carousel-item',
- ITEM_IMG: '.carousel-item img',
- NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
- INDICATORS: '.carousel-indicators',
- DATA_SLIDE: '[data-slide], [data-slide-to]',
- DATA_RIDE: '[data-ride="carousel"]'
- };
- var PointerType = {
- TOUCH: 'touch',
- PEN: 'pen'
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- };
-
- var Carousel =
- /*#__PURE__*/
- function () {
- function Carousel(element, config) {
- this._items = null;
- this._interval = null;
- this._activeElement = null;
- this._isPaused = false;
- this._isSliding = false;
- this.touchTimeout = null;
- this.touchStartX = 0;
- this.touchDeltaX = 0;
- this._config = this._getConfig(config);
- this._element = element;
- this._indicatorsElement = this._element.querySelector(Selector$2.INDICATORS);
- this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
- this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);
-
- this._addEventListeners();
- } // Getters
-
-
- var _proto = Carousel.prototype;
-
- // Public
- _proto.next = function next() {
- if (!this._isSliding) {
- this._slide(Direction.NEXT);
- }
- };
-
- _proto.nextWhenVisible = function nextWhenVisible() {
- // Don't call next when the page isn't visible
- // or the carousel or its parent isn't visible
- if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
- this.next();
- }
- };
-
- _proto.prev = function prev() {
- if (!this._isSliding) {
- this._slide(Direction.PREV);
- }
- };
-
- _proto.pause = function pause(event) {
- if (!event) {
- this._isPaused = true;
- }
-
- if (this._element.querySelector(Selector$2.NEXT_PREV)) {
- Util.triggerTransitionEnd(this._element);
- this.cycle(true);
- }
-
- clearInterval(this._interval);
- this._interval = null;
- };
-
- _proto.cycle = function cycle(event) {
- if (!event) {
- this._isPaused = false;
- }
-
- if (this._interval) {
- clearInterval(this._interval);
- this._interval = null;
- }
-
- if (this._config.interval && !this._isPaused) {
- this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
- }
- };
-
- _proto.to = function to(index) {
- var _this = this;
-
- this._activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
-
- var activeIndex = this._getItemIndex(this._activeElement);
-
- if (index > this._items.length - 1 || index < 0) {
- return;
- }
-
- if (this._isSliding) {
- $(this._element).one(Event$2.SLID, function () {
- return _this.to(index);
- });
- return;
- }
-
- if (activeIndex === index) {
- this.pause();
- this.cycle();
- return;
- }
-
- var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
-
- this._slide(direction, this._items[index]);
- };
-
- _proto.dispose = function dispose() {
- $(this._element).off(EVENT_KEY$2);
- $.removeData(this._element, DATA_KEY$2);
- this._items = null;
- this._config = null;
- this._element = null;
- this._interval = null;
- this._isPaused = null;
- this._isSliding = null;
- this._activeElement = null;
- this._indicatorsElement = null;
- } // Private
- ;
-
- _proto._getConfig = function _getConfig(config) {
- config = _objectSpread({}, Default, config);
- Util.typeCheckConfig(NAME$2, config, DefaultType);
- return config;
- };
-
- _proto._handleSwipe = function _handleSwipe() {
- var absDeltax = Math.abs(this.touchDeltaX);
-
- if (absDeltax <= SWIPE_THRESHOLD) {
- return;
- }
-
- var direction = absDeltax / this.touchDeltaX; // swipe left
-
- if (direction > 0) {
- this.prev();
- } // swipe right
-
-
- if (direction < 0) {
- this.next();
- }
- };
-
- _proto._addEventListeners = function _addEventListeners() {
- var _this2 = this;
-
- if (this._config.keyboard) {
- $(this._element).on(Event$2.KEYDOWN, function (event) {
- return _this2._keydown(event);
- });
- }
-
- if (this._config.pause === 'hover') {
- $(this._element).on(Event$2.MOUSEENTER, function (event) {
- return _this2.pause(event);
- }).on(Event$2.MOUSELEAVE, function (event) {
- return _this2.cycle(event);
- });
- }
-
- if (this._config.touch) {
- this._addTouchEventListeners();
- }
- };
-
- _proto._addTouchEventListeners = function _addTouchEventListeners() {
- var _this3 = this;
-
- if (!this._touchSupported) {
- return;
- }
-
- var start = function start(event) {
- if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
- _this3.touchStartX = event.originalEvent.clientX;
- } else if (!_this3._pointerEvent) {
- _this3.touchStartX = event.originalEvent.touches[0].clientX;
- }
- };
-
- var move = function move(event) {
- // ensure swiping with one touch and not pinching
- if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
- _this3.touchDeltaX = 0;
- } else {
- _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;
- }
- };
-
- var end = function end(event) {
- if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
- _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
- }
-
- _this3._handleSwipe();
-
- if (_this3._config.pause === 'hover') {
- // If it's a touch-enabled device, mouseenter/leave are fired as
- // part of the mouse compatibility events on first tap - the carousel
- // would stop cycling until user tapped out of it;
- // here, we listen for touchend, explicitly pause the carousel
- // (as if it's the second time we tap on it, mouseenter compat event
- // is NOT fired) and after a timeout (to allow for mouse compatibility
- // events to fire) we explicitly restart cycling
- _this3.pause();
-
- if (_this3.touchTimeout) {
- clearTimeout(_this3.touchTimeout);
- }
-
- _this3.touchTimeout = setTimeout(function (event) {
- return _this3.cycle(event);
- }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
- }
- };
-
- $(this._element.querySelectorAll(Selector$2.ITEM_IMG)).on(Event$2.DRAG_START, function (e) {
- return e.preventDefault();
- });
-
- if (this._pointerEvent) {
- $(this._element).on(Event$2.POINTERDOWN, function (event) {
- return start(event);
- });
- $(this._element).on(Event$2.POINTERUP, function (event) {
- return end(event);
- });
-
- this._element.classList.add(ClassName$2.POINTER_EVENT);
- } else {
- $(this._element).on(Event$2.TOUCHSTART, function (event) {
- return start(event);
- });
- $(this._element).on(Event$2.TOUCHMOVE, function (event) {
- return move(event);
- });
- $(this._element).on(Event$2.TOUCHEND, function (event) {
- return end(event);
- });
- }
- };
-
- _proto._keydown = function _keydown(event) {
- if (/input|textarea/i.test(event.target.tagName)) {
- return;
- }
-
- switch (event.which) {
- case ARROW_LEFT_KEYCODE:
- event.preventDefault();
- this.prev();
- break;
-
- case ARROW_RIGHT_KEYCODE:
- event.preventDefault();
- this.next();
- break;
-
- default:
- }
- };
-
- _proto._getItemIndex = function _getItemIndex(element) {
- this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector$2.ITEM)) : [];
- return this._items.indexOf(element);
- };
-
- _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
- var isNextDirection = direction === Direction.NEXT;
- var isPrevDirection = direction === Direction.PREV;
-
- var activeIndex = this._getItemIndex(activeElement);
-
- var lastItemIndex = this._items.length - 1;
- var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
-
- if (isGoingToWrap && !this._config.wrap) {
- return activeElement;
- }
-
- var delta = direction === Direction.PREV ? -1 : 1;
- var itemIndex = (activeIndex + delta) % this._items.length;
- return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
- };
-
- _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
- var targetIndex = this._getItemIndex(relatedTarget);
-
- var fromIndex = this._getItemIndex(this._element.querySelector(Selector$2.ACTIVE_ITEM));
-
- var slideEvent = $.Event(Event$2.SLIDE, {
- relatedTarget: relatedTarget,
- direction: eventDirectionName,
- from: fromIndex,
- to: targetIndex
- });
- $(this._element).trigger(slideEvent);
- return slideEvent;
- };
-
- _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
- if (this._indicatorsElement) {
- var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector$2.ACTIVE));
- $(indicators).removeClass(ClassName$2.ACTIVE);
-
- var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
-
- if (nextIndicator) {
- $(nextIndicator).addClass(ClassName$2.ACTIVE);
- }
- }
- };
-
- _proto._slide = function _slide(direction, element) {
- var _this4 = this;
-
- var activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
-
- var activeElementIndex = this._getItemIndex(activeElement);
-
- var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
-
- var nextElementIndex = this._getItemIndex(nextElement);
-
- var isCycling = Boolean(this._interval);
- var directionalClassName;
- var orderClassName;
- var eventDirectionName;
-
- if (direction === Direction.NEXT) {
- directionalClassName = ClassName$2.LEFT;
- orderClassName = ClassName$2.NEXT;
- eventDirectionName = Direction.LEFT;
- } else {
- directionalClassName = ClassName$2.RIGHT;
- orderClassName = ClassName$2.PREV;
- eventDirectionName = Direction.RIGHT;
- }
-
- if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) {
- this._isSliding = false;
- return;
- }
-
- var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
-
- if (slideEvent.isDefaultPrevented()) {
- return;
- }
-
- if (!activeElement || !nextElement) {
- // Some weirdness is happening, so we bail
- return;
- }
-
- this._isSliding = true;
-
- if (isCycling) {
- this.pause();
- }
-
- this._setActiveIndicatorElement(nextElement);
-
- var slidEvent = $.Event(Event$2.SLID, {
- relatedTarget: nextElement,
- direction: eventDirectionName,
- from: activeElementIndex,
- to: nextElementIndex
- });
-
- if ($(this._element).hasClass(ClassName$2.SLIDE)) {
- $(nextElement).addClass(orderClassName);
- Util.reflow(nextElement);
- $(activeElement).addClass(directionalClassName);
- $(nextElement).addClass(directionalClassName);
- var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);
-
- if (nextElementInterval) {
- this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
- this._config.interval = nextElementInterval;
- } else {
- this._config.interval = this._config.defaultInterval || this._config.interval;
- }
-
- var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
- $(activeElement).one(Util.TRANSITION_END, function () {
- $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName$2.ACTIVE);
- $(activeElement).removeClass(ClassName$2.ACTIVE + " " + orderClassName + " " + directionalClassName);
- _this4._isSliding = false;
- setTimeout(function () {
- return $(_this4._element).trigger(slidEvent);
- }, 0);
- }).emulateTransitionEnd(transitionDuration);
- } else {
- $(activeElement).removeClass(ClassName$2.ACTIVE);
- $(nextElement).addClass(ClassName$2.ACTIVE);
- this._isSliding = false;
- $(this._element).trigger(slidEvent);
- }
-
- if (isCycling) {
- this.cycle();
- }
- } // Static
- ;
-
- Carousel._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var data = $(this).data(DATA_KEY$2);
-
- var _config = _objectSpread({}, Default, $(this).data());
-
- if (typeof config === 'object') {
- _config = _objectSpread({}, _config, config);
- }
-
- var action = typeof config === 'string' ? config : _config.slide;
-
- if (!data) {
- data = new Carousel(this, _config);
- $(this).data(DATA_KEY$2, data);
- }
-
- if (typeof config === 'number') {
- data.to(config);
- } else if (typeof action === 'string') {
- if (typeof data[action] === 'undefined') {
- throw new TypeError("No method named \"" + action + "\"");
- }
-
- data[action]();
- } else if (_config.interval && _config.ride) {
- data.pause();
- data.cycle();
- }
- });
- };
-
- Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
- var selector = Util.getSelectorFromElement(this);
-
- if (!selector) {
- return;
- }
-
- var target = $(selector)[0];
-
- if (!target || !$(target).hasClass(ClassName$2.CAROUSEL)) {
- return;
- }
-
- var config = _objectSpread({}, $(target).data(), $(this).data());
-
- var slideIndex = this.getAttribute('data-slide-to');
-
- if (slideIndex) {
- config.interval = false;
- }
-
- Carousel._jQueryInterface.call($(target), config);
-
- if (slideIndex) {
- $(target).data(DATA_KEY$2).to(slideIndex);
- }
-
- event.preventDefault();
- };
-
- _createClass(Carousel, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION$2;
- }
- }, {
- key: "Default",
- get: function get() {
- return Default;
- }
- }]);
-
- return Carousel;
- }();
- /**
- * ------------------------------------------------------------------------
- * Data Api implementation
- * ------------------------------------------------------------------------
- */
-
-
- $(document).on(Event$2.CLICK_DATA_API, Selector$2.DATA_SLIDE, Carousel._dataApiClickHandler);
- $(window).on(Event$2.LOAD_DATA_API, function () {
- var carousels = [].slice.call(document.querySelectorAll(Selector$2.DATA_RIDE));
-
- for (var i = 0, len = carousels.length; i < len; i++) {
- var $carousel = $(carousels[i]);
-
- Carousel._jQueryInterface.call($carousel, $carousel.data());
- }
- });
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
- $.fn[NAME$2] = Carousel._jQueryInterface;
- $.fn[NAME$2].Constructor = Carousel;
-
- $.fn[NAME$2].noConflict = function () {
- $.fn[NAME$2] = JQUERY_NO_CONFLICT$2;
- return Carousel._jQueryInterface;
- };
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$3 = 'collapse';
- var VERSION$3 = '4.3.1';
- var DATA_KEY$3 = 'bs.collapse';
- var EVENT_KEY$3 = "." + DATA_KEY$3;
- var DATA_API_KEY$3 = '.data-api';
- var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3];
- var Default$1 = {
- toggle: true,
- parent: ''
- };
- var DefaultType$1 = {
- toggle: 'boolean',
- parent: '(string|element)'
- };
- var Event$3 = {
- SHOW: "show" + EVENT_KEY$3,
- SHOWN: "shown" + EVENT_KEY$3,
- HIDE: "hide" + EVENT_KEY$3,
- HIDDEN: "hidden" + EVENT_KEY$3,
- CLICK_DATA_API: "click" + EVENT_KEY$3 + DATA_API_KEY$3
- };
- var ClassName$3 = {
- SHOW: 'show',
- COLLAPSE: 'collapse',
- COLLAPSING: 'collapsing',
- COLLAPSED: 'collapsed'
- };
- var Dimension = {
- WIDTH: 'width',
- HEIGHT: 'height'
- };
- var Selector$3 = {
- ACTIVES: '.show, .collapsing',
- DATA_TOGGLE: '[data-toggle="collapse"]'
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- };
-
- var Collapse =
- /*#__PURE__*/
- function () {
- function Collapse(element, config) {
- this._isTransitioning = false;
- this._element = element;
- this._config = this._getConfig(config);
- this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
- var toggleList = [].slice.call(document.querySelectorAll(Selector$3.DATA_TOGGLE));
-
- for (var i = 0, len = toggleList.length; i < len; i++) {
- var elem = toggleList[i];
- var selector = Util.getSelectorFromElement(elem);
- var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
- return foundElem === element;
- });
-
- if (selector !== null && filterElement.length > 0) {
- this._selector = selector;
-
- this._triggerArray.push(elem);
- }
- }
-
- this._parent = this._config.parent ? this._getParent() : null;
-
- if (!this._config.parent) {
- this._addAriaAndCollapsedClass(this._element, this._triggerArray);
- }
-
- if (this._config.toggle) {
- this.toggle();
- }
- } // Getters
-
-
- var _proto = Collapse.prototype;
-
- // Public
- _proto.toggle = function toggle() {
- if ($(this._element).hasClass(ClassName$3.SHOW)) {
- this.hide();
- } else {
- this.show();
- }
- };
-
- _proto.show = function show() {
- var _this = this;
-
- if (this._isTransitioning || $(this._element).hasClass(ClassName$3.SHOW)) {
- return;
- }
-
- var actives;
- var activesData;
-
- if (this._parent) {
- actives = [].slice.call(this._parent.querySelectorAll(Selector$3.ACTIVES)).filter(function (elem) {
- if (typeof _this._config.parent === 'string') {
- return elem.getAttribute('data-parent') === _this._config.parent;
- }
-
- return elem.classList.contains(ClassName$3.COLLAPSE);
- });
-
- if (actives.length === 0) {
- actives = null;
- }
- }
-
- if (actives) {
- activesData = $(actives).not(this._selector).data(DATA_KEY$3);
-
- if (activesData && activesData._isTransitioning) {
- return;
- }
- }
-
- var startEvent = $.Event(Event$3.SHOW);
- $(this._element).trigger(startEvent);
-
- if (startEvent.isDefaultPrevented()) {
- return;
- }
-
- if (actives) {
- Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');
-
- if (!activesData) {
- $(actives).data(DATA_KEY$3, null);
- }
- }
-
- var dimension = this._getDimension();
-
- $(this._element).removeClass(ClassName$3.COLLAPSE).addClass(ClassName$3.COLLAPSING);
- this._element.style[dimension] = 0;
-
- if (this._triggerArray.length) {
- $(this._triggerArray).removeClass(ClassName$3.COLLAPSED).attr('aria-expanded', true);
- }
-
- this.setTransitioning(true);
-
- var complete = function complete() {
- $(_this._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).addClass(ClassName$3.SHOW);
- _this._element.style[dimension] = '';
-
- _this.setTransitioning(false);
-
- $(_this._element).trigger(Event$3.SHOWN);
- };
-
- var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
- var scrollSize = "scroll" + capitalizedDimension;
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
- $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
- this._element.style[dimension] = this._element[scrollSize] + "px";
- };
-
- _proto.hide = function hide() {
- var _this2 = this;
-
- if (this._isTransitioning || !$(this._element).hasClass(ClassName$3.SHOW)) {
- return;
- }
-
- var startEvent = $.Event(Event$3.HIDE);
- $(this._element).trigger(startEvent);
-
- if (startEvent.isDefaultPrevented()) {
- return;
- }
-
- var dimension = this._getDimension();
-
- this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
- Util.reflow(this._element);
- $(this._element).addClass(ClassName$3.COLLAPSING).removeClass(ClassName$3.COLLAPSE).removeClass(ClassName$3.SHOW);
- var triggerArrayLength = this._triggerArray.length;
-
- if (triggerArrayLength > 0) {
- for (var i = 0; i < triggerArrayLength; i++) {
- var trigger = this._triggerArray[i];
- var selector = Util.getSelectorFromElement(trigger);
-
- if (selector !== null) {
- var $elem = $([].slice.call(document.querySelectorAll(selector)));
-
- if (!$elem.hasClass(ClassName$3.SHOW)) {
- $(trigger).addClass(ClassName$3.COLLAPSED).attr('aria-expanded', false);
- }
- }
- }
- }
-
- this.setTransitioning(true);
-
- var complete = function complete() {
- _this2.setTransitioning(false);
-
- $(_this2._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).trigger(Event$3.HIDDEN);
- };
-
- this._element.style[dimension] = '';
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
- $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
- };
-
- _proto.setTransitioning = function setTransitioning(isTransitioning) {
- this._isTransitioning = isTransitioning;
- };
-
- _proto.dispose = function dispose() {
- $.removeData(this._element, DATA_KEY$3);
- this._config = null;
- this._parent = null;
- this._element = null;
- this._triggerArray = null;
- this._isTransitioning = null;
- } // Private
- ;
-
- _proto._getConfig = function _getConfig(config) {
- config = _objectSpread({}, Default$1, config);
- config.toggle = Boolean(config.toggle); // Coerce string values
-
- Util.typeCheckConfig(NAME$3, config, DefaultType$1);
- return config;
- };
-
- _proto._getDimension = function _getDimension() {
- var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
- return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
- };
-
- _proto._getParent = function _getParent() {
- var _this3 = this;
-
- var parent;
-
- if (Util.isElement(this._config.parent)) {
- parent = this._config.parent; // It's a jQuery object
-
- if (typeof this._config.parent.jquery !== 'undefined') {
- parent = this._config.parent[0];
- }
- } else {
- parent = document.querySelector(this._config.parent);
- }
-
- var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
- var children = [].slice.call(parent.querySelectorAll(selector));
- $(children).each(function (i, element) {
- _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
- });
- return parent;
- };
-
- _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
- var isOpen = $(element).hasClass(ClassName$3.SHOW);
-
- if (triggerArray.length) {
- $(triggerArray).toggleClass(ClassName$3.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
- }
- } // Static
- ;
-
- Collapse._getTargetFromElement = function _getTargetFromElement(element) {
- var selector = Util.getSelectorFromElement(element);
- return selector ? document.querySelector(selector) : null;
- };
-
- Collapse._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var $this = $(this);
- var data = $this.data(DATA_KEY$3);
-
- var _config = _objectSpread({}, Default$1, $this.data(), typeof config === 'object' && config ? config : {});
-
- if (!data && _config.toggle && /show|hide/.test(config)) {
- _config.toggle = false;
- }
-
- if (!data) {
- data = new Collapse(this, _config);
- $this.data(DATA_KEY$3, data);
- }
-
- if (typeof config === 'string') {
- if (typeof data[config] === 'undefined') {
- throw new TypeError("No method named \"" + config + "\"");
- }
-
- data[config]();
- }
- });
- };
-
- _createClass(Collapse, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION$3;
- }
- }, {
- key: "Default",
- get: function get() {
- return Default$1;
- }
- }]);
-
- return Collapse;
- }();
- /**
- * ------------------------------------------------------------------------
- * Data Api implementation
- * ------------------------------------------------------------------------
- */
-
-
- $(document).on(Event$3.CLICK_DATA_API, Selector$3.DATA_TOGGLE, function (event) {
- // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
- if (event.currentTarget.tagName === 'A') {
- event.preventDefault();
- }
-
- var $trigger = $(this);
- var selector = Util.getSelectorFromElement(this);
- var selectors = [].slice.call(document.querySelectorAll(selector));
- $(selectors).each(function () {
- var $target = $(this);
- var data = $target.data(DATA_KEY$3);
- var config = data ? 'toggle' : $trigger.data();
-
- Collapse._jQueryInterface.call($target, config);
- });
- });
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
- $.fn[NAME$3] = Collapse._jQueryInterface;
- $.fn[NAME$3].Constructor = Collapse;
-
- $.fn[NAME$3].noConflict = function () {
- $.fn[NAME$3] = JQUERY_NO_CONFLICT$3;
- return Collapse._jQueryInterface;
- };
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$4 = 'dropdown';
- var VERSION$4 = '4.3.1';
- var DATA_KEY$4 = 'bs.dropdown';
- var EVENT_KEY$4 = "." + DATA_KEY$4;
- var DATA_API_KEY$4 = '.data-api';
- var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4];
- var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
-
- var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
-
- var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
-
- var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
-
- var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
-
- var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
-
- var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
- var Event$4 = {
- HIDE: "hide" + EVENT_KEY$4,
- HIDDEN: "hidden" + EVENT_KEY$4,
- SHOW: "show" + EVENT_KEY$4,
- SHOWN: "shown" + EVENT_KEY$4,
- CLICK: "click" + EVENT_KEY$4,
- CLICK_DATA_API: "click" + EVENT_KEY$4 + DATA_API_KEY$4,
- KEYDOWN_DATA_API: "keydown" + EVENT_KEY$4 + DATA_API_KEY$4,
- KEYUP_DATA_API: "keyup" + EVENT_KEY$4 + DATA_API_KEY$4
- };
- var ClassName$4 = {
- DISABLED: 'disabled',
- SHOW: 'show',
- DROPUP: 'dropup',
- DROPRIGHT: 'dropright',
- DROPLEFT: 'dropleft',
- MENURIGHT: 'dropdown-menu-right',
- MENULEFT: 'dropdown-menu-left',
- POSITION_STATIC: 'position-static'
- };
- var Selector$4 = {
- DATA_TOGGLE: '[data-toggle="dropdown"]',
- FORM_CHILD: '.dropdown form',
- MENU: '.dropdown-menu',
- NAVBAR_NAV: '.navbar-nav',
- VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
- };
- var AttachmentMap = {
- TOP: 'top-start',
- TOPEND: 'top-end',
- BOTTOM: 'bottom-start',
- BOTTOMEND: 'bottom-end',
- RIGHT: 'right-start',
- RIGHTEND: 'right-end',
- LEFT: 'left-start',
- LEFTEND: 'left-end'
- };
- var Default$2 = {
- offset: 0,
- flip: true,
- boundary: 'scrollParent',
- reference: 'toggle',
- display: 'dynamic'
- };
- var DefaultType$2 = {
- offset: '(number|string|function)',
- flip: 'boolean',
- boundary: '(string|element)',
- reference: '(string|element)',
- display: 'string'
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- };
-
- var Dropdown =
- /*#__PURE__*/
- function () {
- function Dropdown(element, config) {
- this._element = element;
- this._popper = null;
- this._config = this._getConfig(config);
- this._menu = this._getMenuElement();
- this._inNavbar = this._detectNavbar();
-
- this._addEventListeners();
- } // Getters
-
-
- var _proto = Dropdown.prototype;
-
- // Public
- _proto.toggle = function toggle() {
- if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED)) {
- return;
- }
-
- var parent = Dropdown._getParentFromElement(this._element);
-
- var isActive = $(this._menu).hasClass(ClassName$4.SHOW);
-
- Dropdown._clearMenus();
-
- if (isActive) {
- return;
- }
-
- var relatedTarget = {
- relatedTarget: this._element
- };
- var showEvent = $.Event(Event$4.SHOW, relatedTarget);
- $(parent).trigger(showEvent);
-
- if (showEvent.isDefaultPrevented()) {
- return;
- } // Disable totally Popper.js for Dropdown in Navbar
-
-
- if (!this._inNavbar) {
- /**
- * Check for Popper dependency
- * Popper - https://popper.js.org
- */
- if (typeof Popper === 'undefined') {
- throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)');
- }
-
- var referenceElement = this._element;
-
- if (this._config.reference === 'parent') {
- referenceElement = parent;
- } else if (Util.isElement(this._config.reference)) {
- referenceElement = this._config.reference; // Check if it's jQuery element
-
- if (typeof this._config.reference.jquery !== 'undefined') {
- referenceElement = this._config.reference[0];
- }
- } // If boundary is not `scrollParent`, then set position to `static`
- // to allow the menu to "escape" the scroll parent's boundaries
- // https://github.com/twbs/bootstrap/issues/24251
-
-
- if (this._config.boundary !== 'scrollParent') {
- $(parent).addClass(ClassName$4.POSITION_STATIC);
- }
-
- this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
- } // If this is a touch-enabled device we add extra
- // empty mouseover listeners to the body's immediate children;
- // only needed because of broken event delegation on iOS
- // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
-
-
- if ('ontouchstart' in document.documentElement && $(parent).closest(Selector$4.NAVBAR_NAV).length === 0) {
- $(document.body).children().on('mouseover', null, $.noop);
- }
-
- this._element.focus();
-
- this._element.setAttribute('aria-expanded', true);
-
- $(this._menu).toggleClass(ClassName$4.SHOW);
- $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget));
- };
-
- _proto.show = function show() {
- if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || $(this._menu).hasClass(ClassName$4.SHOW)) {
- return;
- }
-
- var relatedTarget = {
- relatedTarget: this._element
- };
- var showEvent = $.Event(Event$4.SHOW, relatedTarget);
-
- var parent = Dropdown._getParentFromElement(this._element);
-
- $(parent).trigger(showEvent);
-
- if (showEvent.isDefaultPrevented()) {
- return;
- }
-
- $(this._menu).toggleClass(ClassName$4.SHOW);
- $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget));
- };
-
- _proto.hide = function hide() {
- if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || !$(this._menu).hasClass(ClassName$4.SHOW)) {
- return;
- }
-
- var relatedTarget = {
- relatedTarget: this._element
- };
- var hideEvent = $.Event(Event$4.HIDE, relatedTarget);
-
- var parent = Dropdown._getParentFromElement(this._element);
-
- $(parent).trigger(hideEvent);
-
- if (hideEvent.isDefaultPrevented()) {
- return;
- }
-
- $(this._menu).toggleClass(ClassName$4.SHOW);
- $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));
- };
-
- _proto.dispose = function dispose() {
- $.removeData(this._element, DATA_KEY$4);
- $(this._element).off(EVENT_KEY$4);
- this._element = null;
- this._menu = null;
-
- if (this._popper !== null) {
- this._popper.destroy();
-
- this._popper = null;
- }
- };
-
- _proto.update = function update() {
- this._inNavbar = this._detectNavbar();
-
- if (this._popper !== null) {
- this._popper.scheduleUpdate();
- }
- } // Private
- ;
-
- _proto._addEventListeners = function _addEventListeners() {
- var _this = this;
-
- $(this._element).on(Event$4.CLICK, function (event) {
- event.preventDefault();
- event.stopPropagation();
-
- _this.toggle();
- });
- };
-
- _proto._getConfig = function _getConfig(config) {
- config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config);
- Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
- return config;
- };
-
- _proto._getMenuElement = function _getMenuElement() {
- if (!this._menu) {
- var parent = Dropdown._getParentFromElement(this._element);
-
- if (parent) {
- this._menu = parent.querySelector(Selector$4.MENU);
- }
- }
-
- return this._menu;
- };
-
- _proto._getPlacement = function _getPlacement() {
- var $parentDropdown = $(this._element.parentNode);
- var placement = AttachmentMap.BOTTOM; // Handle dropup
-
- if ($parentDropdown.hasClass(ClassName$4.DROPUP)) {
- placement = AttachmentMap.TOP;
-
- if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {
- placement = AttachmentMap.TOPEND;
- }
- } else if ($parentDropdown.hasClass(ClassName$4.DROPRIGHT)) {
- placement = AttachmentMap.RIGHT;
- } else if ($parentDropdown.hasClass(ClassName$4.DROPLEFT)) {
- placement = AttachmentMap.LEFT;
- } else if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {
- placement = AttachmentMap.BOTTOMEND;
- }
-
- return placement;
- };
-
- _proto._detectNavbar = function _detectNavbar() {
- return $(this._element).closest('.navbar').length > 0;
- };
-
- _proto._getOffset = function _getOffset() {
- var _this2 = this;
-
- var offset = {};
-
- if (typeof this._config.offset === 'function') {
- offset.fn = function (data) {
- data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});
- return data;
- };
- } else {
- offset.offset = this._config.offset;
- }
-
- return offset;
- };
-
- _proto._getPopperConfig = function _getPopperConfig() {
- var popperConfig = {
- placement: this._getPlacement(),
- modifiers: {
- offset: this._getOffset(),
- flip: {
- enabled: this._config.flip
- },
- preventOverflow: {
- boundariesElement: this._config.boundary
- }
- } // Disable Popper.js if we have a static display
-
- };
-
- if (this._config.display === 'static') {
- popperConfig.modifiers.applyStyle = {
- enabled: false
- };
- }
-
- return popperConfig;
- } // Static
- ;
-
- Dropdown._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var data = $(this).data(DATA_KEY$4);
-
- var _config = typeof config === 'object' ? config : null;
-
- if (!data) {
- data = new Dropdown(this, _config);
- $(this).data(DATA_KEY$4, data);
- }
-
- if (typeof config === 'string') {
- if (typeof data[config] === 'undefined') {
- throw new TypeError("No method named \"" + config + "\"");
- }
-
- data[config]();
- }
- });
- };
-
- Dropdown._clearMenus = function _clearMenus(event) {
- if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
- return;
- }
-
- var toggles = [].slice.call(document.querySelectorAll(Selector$4.DATA_TOGGLE));
-
- for (var i = 0, len = toggles.length; i < len; i++) {
- var parent = Dropdown._getParentFromElement(toggles[i]);
-
- var context = $(toggles[i]).data(DATA_KEY$4);
- var relatedTarget = {
- relatedTarget: toggles[i]
- };
-
- if (event && event.type === 'click') {
- relatedTarget.clickEvent = event;
- }
-
- if (!context) {
- continue;
- }
-
- var dropdownMenu = context._menu;
-
- if (!$(parent).hasClass(ClassName$4.SHOW)) {
- continue;
- }
-
- if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {
- continue;
- }
-
- var hideEvent = $.Event(Event$4.HIDE, relatedTarget);
- $(parent).trigger(hideEvent);
-
- if (hideEvent.isDefaultPrevented()) {
- continue;
- } // If this is a touch-enabled device we remove the extra
- // empty mouseover listeners we added for iOS support
-
-
- if ('ontouchstart' in document.documentElement) {
- $(document.body).children().off('mouseover', null, $.noop);
- }
-
- toggles[i].setAttribute('aria-expanded', 'false');
- $(dropdownMenu).removeClass(ClassName$4.SHOW);
- $(parent).removeClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));
- }
- };
-
- Dropdown._getParentFromElement = function _getParentFromElement(element) {
- var parent;
- var selector = Util.getSelectorFromElement(element);
-
- if (selector) {
- parent = document.querySelector(selector);
- }
-
- return parent || element.parentNode;
- } // eslint-disable-next-line complexity
- ;
-
- Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
- // If not input/textarea:
- // - And not a key in REGEXP_KEYDOWN => not a dropdown command
- // If input/textarea:
- // - If space key => not a dropdown command
- // - If key is other than escape
- // - If key is not up or down => not a dropdown command
- // - If trigger inside the menu => not a dropdown command
- if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector$4.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
- return;
- }
-
- event.preventDefault();
- event.stopPropagation();
-
- if (this.disabled || $(this).hasClass(ClassName$4.DISABLED)) {
- return;
- }
-
- var parent = Dropdown._getParentFromElement(this);
-
- var isActive = $(parent).hasClass(ClassName$4.SHOW);
-
- if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
- if (event.which === ESCAPE_KEYCODE) {
- var toggle = parent.querySelector(Selector$4.DATA_TOGGLE);
- $(toggle).trigger('focus');
- }
-
- $(this).trigger('click');
- return;
- }
-
- var items = [].slice.call(parent.querySelectorAll(Selector$4.VISIBLE_ITEMS));
-
- if (items.length === 0) {
- return;
- }
-
- var index = items.indexOf(event.target);
-
- if (event.which === ARROW_UP_KEYCODE && index > 0) {
- // Up
- index--;
- }
-
- if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
- // Down
- index++;
- }
-
- if (index < 0) {
- index = 0;
- }
-
- items[index].focus();
- };
-
- _createClass(Dropdown, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION$4;
- }
- }, {
- key: "Default",
- get: function get() {
- return Default$2;
- }
- }, {
- key: "DefaultType",
- get: function get() {
- return DefaultType$2;
- }
- }]);
-
- return Dropdown;
- }();
- /**
- * ------------------------------------------------------------------------
- * Data Api implementation
- * ------------------------------------------------------------------------
- */
-
-
- $(document).on(Event$4.KEYDOWN_DATA_API, Selector$4.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event$4.KEYDOWN_DATA_API, Selector$4.MENU, Dropdown._dataApiKeydownHandler).on(Event$4.CLICK_DATA_API + " " + Event$4.KEYUP_DATA_API, Dropdown._clearMenus).on(Event$4.CLICK_DATA_API, Selector$4.DATA_TOGGLE, function (event) {
- event.preventDefault();
- event.stopPropagation();
-
- Dropdown._jQueryInterface.call($(this), 'toggle');
- }).on(Event$4.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) {
- e.stopPropagation();
- });
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
- $.fn[NAME$4] = Dropdown._jQueryInterface;
- $.fn[NAME$4].Constructor = Dropdown;
-
- $.fn[NAME$4].noConflict = function () {
- $.fn[NAME$4] = JQUERY_NO_CONFLICT$4;
- return Dropdown._jQueryInterface;
- };
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$5 = 'modal';
- var VERSION$5 = '4.3.1';
- var DATA_KEY$5 = 'bs.modal';
- var EVENT_KEY$5 = "." + DATA_KEY$5;
- var DATA_API_KEY$5 = '.data-api';
- var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5];
- var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key
-
- var Default$3 = {
- backdrop: true,
- keyboard: true,
- focus: true,
- show: true
- };
- var DefaultType$3 = {
- backdrop: '(boolean|string)',
- keyboard: 'boolean',
- focus: 'boolean',
- show: 'boolean'
- };
- var Event$5 = {
- HIDE: "hide" + EVENT_KEY$5,
- HIDDEN: "hidden" + EVENT_KEY$5,
- SHOW: "show" + EVENT_KEY$5,
- SHOWN: "shown" + EVENT_KEY$5,
- FOCUSIN: "focusin" + EVENT_KEY$5,
- RESIZE: "resize" + EVENT_KEY$5,
- CLICK_DISMISS: "click.dismiss" + EVENT_KEY$5,
- KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY$5,
- MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY$5,
- MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY$5,
- CLICK_DATA_API: "click" + EVENT_KEY$5 + DATA_API_KEY$5
- };
- var ClassName$5 = {
- SCROLLABLE: 'modal-dialog-scrollable',
- SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
- BACKDROP: 'modal-backdrop',
- OPEN: 'modal-open',
- FADE: 'fade',
- SHOW: 'show'
- };
- var Selector$5 = {
- DIALOG: '.modal-dialog',
- MODAL_BODY: '.modal-body',
- DATA_TOGGLE: '[data-toggle="modal"]',
- DATA_DISMISS: '[data-dismiss="modal"]',
- FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
- STICKY_CONTENT: '.sticky-top'
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- };
-
- var Modal =
- /*#__PURE__*/
- function () {
- function Modal(element, config) {
- this._config = this._getConfig(config);
- this._element = element;
- this._dialog = element.querySelector(Selector$5.DIALOG);
- this._backdrop = null;
- this._isShown = false;
- this._isBodyOverflowing = false;
- this._ignoreBackdropClick = false;
- this._isTransitioning = false;
- this._scrollbarWidth = 0;
- } // Getters
-
-
- var _proto = Modal.prototype;
-
- // Public
- _proto.toggle = function toggle(relatedTarget) {
- return this._isShown ? this.hide() : this.show(relatedTarget);
- };
-
- _proto.show = function show(relatedTarget) {
- var _this = this;
-
- if (this._isShown || this._isTransitioning) {
- return;
- }
-
- if ($(this._element).hasClass(ClassName$5.FADE)) {
- this._isTransitioning = true;
- }
-
- var showEvent = $.Event(Event$5.SHOW, {
- relatedTarget: relatedTarget
- });
- $(this._element).trigger(showEvent);
-
- if (this._isShown || showEvent.isDefaultPrevented()) {
- return;
- }
-
- this._isShown = true;
-
- this._checkScrollbar();
-
- this._setScrollbar();
-
- this._adjustDialog();
-
- this._setEscapeEvent();
-
- this._setResizeEvent();
-
- $(this._element).on(Event$5.CLICK_DISMISS, Selector$5.DATA_DISMISS, function (event) {
- return _this.hide(event);
- });
- $(this._dialog).on(Event$5.MOUSEDOWN_DISMISS, function () {
- $(_this._element).one(Event$5.MOUSEUP_DISMISS, function (event) {
- if ($(event.target).is(_this._element)) {
- _this._ignoreBackdropClick = true;
- }
- });
- });
-
- this._showBackdrop(function () {
- return _this._showElement(relatedTarget);
- });
- };
-
- _proto.hide = function hide(event) {
- var _this2 = this;
-
- if (event) {
- event.preventDefault();
- }
-
- if (!this._isShown || this._isTransitioning) {
- return;
- }
-
- var hideEvent = $.Event(Event$5.HIDE);
- $(this._element).trigger(hideEvent);
-
- if (!this._isShown || hideEvent.isDefaultPrevented()) {
- return;
- }
-
- this._isShown = false;
- var transition = $(this._element).hasClass(ClassName$5.FADE);
-
- if (transition) {
- this._isTransitioning = true;
- }
-
- this._setEscapeEvent();
-
- this._setResizeEvent();
-
- $(document).off(Event$5.FOCUSIN);
- $(this._element).removeClass(ClassName$5.SHOW);
- $(this._element).off(Event$5.CLICK_DISMISS);
- $(this._dialog).off(Event$5.MOUSEDOWN_DISMISS);
-
- if (transition) {
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
- $(this._element).one(Util.TRANSITION_END, function (event) {
- return _this2._hideModal(event);
- }).emulateTransitionEnd(transitionDuration);
- } else {
- this._hideModal();
- }
- };
-
- _proto.dispose = function dispose() {
- [window, this._element, this._dialog].forEach(function (htmlElement) {
- return $(htmlElement).off(EVENT_KEY$5);
- });
- /**
- * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`
- * Do not move `document` in `htmlElements` array
- * It will remove `Event.CLICK_DATA_API` event that should remain
- */
-
- $(document).off(Event$5.FOCUSIN);
- $.removeData(this._element, DATA_KEY$5);
- this._config = null;
- this._element = null;
- this._dialog = null;
- this._backdrop = null;
- this._isShown = null;
- this._isBodyOverflowing = null;
- this._ignoreBackdropClick = null;
- this._isTransitioning = null;
- this._scrollbarWidth = null;
- };
-
- _proto.handleUpdate = function handleUpdate() {
- this._adjustDialog();
- } // Private
- ;
-
- _proto._getConfig = function _getConfig(config) {
- config = _objectSpread({}, Default$3, config);
- Util.typeCheckConfig(NAME$5, config, DefaultType$3);
- return config;
- };
-
- _proto._showElement = function _showElement(relatedTarget) {
- var _this3 = this;
-
- var transition = $(this._element).hasClass(ClassName$5.FADE);
-
- if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
- // Don't move modal's DOM position
- document.body.appendChild(this._element);
- }
-
- this._element.style.display = 'block';
-
- this._element.removeAttribute('aria-hidden');
-
- this._element.setAttribute('aria-modal', true);
-
- if ($(this._dialog).hasClass(ClassName$5.SCROLLABLE)) {
- this._dialog.querySelector(Selector$5.MODAL_BODY).scrollTop = 0;
- } else {
- this._element.scrollTop = 0;
- }
-
- if (transition) {
- Util.reflow(this._element);
- }
-
- $(this._element).addClass(ClassName$5.SHOW);
-
- if (this._config.focus) {
- this._enforceFocus();
- }
-
- var shownEvent = $.Event(Event$5.SHOWN, {
- relatedTarget: relatedTarget
- });
-
- var transitionComplete = function transitionComplete() {
- if (_this3._config.focus) {
- _this3._element.focus();
- }
-
- _this3._isTransitioning = false;
- $(_this3._element).trigger(shownEvent);
- };
-
- if (transition) {
- var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
- $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
- } else {
- transitionComplete();
- }
- };
-
- _proto._enforceFocus = function _enforceFocus() {
- var _this4 = this;
-
- $(document).off(Event$5.FOCUSIN) // Guard against infinite focus loop
- .on(Event$5.FOCUSIN, function (event) {
- if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) {
- _this4._element.focus();
- }
- });
- };
-
- _proto._setEscapeEvent = function _setEscapeEvent() {
- var _this5 = this;
-
- if (this._isShown && this._config.keyboard) {
- $(this._element).on(Event$5.KEYDOWN_DISMISS, function (event) {
- if (event.which === ESCAPE_KEYCODE$1) {
- event.preventDefault();
-
- _this5.hide();
- }
- });
- } else if (!this._isShown) {
- $(this._element).off(Event$5.KEYDOWN_DISMISS);
- }
- };
-
- _proto._setResizeEvent = function _setResizeEvent() {
- var _this6 = this;
-
- if (this._isShown) {
- $(window).on(Event$5.RESIZE, function (event) {
- return _this6.handleUpdate(event);
- });
- } else {
- $(window).off(Event$5.RESIZE);
- }
- };
-
- _proto._hideModal = function _hideModal() {
- var _this7 = this;
-
- this._element.style.display = 'none';
-
- this._element.setAttribute('aria-hidden', true);
-
- this._element.removeAttribute('aria-modal');
-
- this._isTransitioning = false;
-
- this._showBackdrop(function () {
- $(document.body).removeClass(ClassName$5.OPEN);
-
- _this7._resetAdjustments();
-
- _this7._resetScrollbar();
-
- $(_this7._element).trigger(Event$5.HIDDEN);
- });
- };
-
- _proto._removeBackdrop = function _removeBackdrop() {
- if (this._backdrop) {
- $(this._backdrop).remove();
- this._backdrop = null;
- }
- };
-
- _proto._showBackdrop = function _showBackdrop(callback) {
- var _this8 = this;
-
- var animate = $(this._element).hasClass(ClassName$5.FADE) ? ClassName$5.FADE : '';
-
- if (this._isShown && this._config.backdrop) {
- this._backdrop = document.createElement('div');
- this._backdrop.className = ClassName$5.BACKDROP;
-
- if (animate) {
- this._backdrop.classList.add(animate);
- }
-
- $(this._backdrop).appendTo(document.body);
- $(this._element).on(Event$5.CLICK_DISMISS, function (event) {
- if (_this8._ignoreBackdropClick) {
- _this8._ignoreBackdropClick = false;
- return;
- }
-
- if (event.target !== event.currentTarget) {
- return;
- }
-
- if (_this8._config.backdrop === 'static') {
- _this8._element.focus();
- } else {
- _this8.hide();
- }
- });
-
- if (animate) {
- Util.reflow(this._backdrop);
- }
-
- $(this._backdrop).addClass(ClassName$5.SHOW);
-
- if (!callback) {
- return;
- }
-
- if (!animate) {
- callback();
- return;
- }
-
- var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
- $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
- } else if (!this._isShown && this._backdrop) {
- $(this._backdrop).removeClass(ClassName$5.SHOW);
-
- var callbackRemove = function callbackRemove() {
- _this8._removeBackdrop();
-
- if (callback) {
- callback();
- }
- };
-
- if ($(this._element).hasClass(ClassName$5.FADE)) {
- var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
-
- $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
- } else {
- callbackRemove();
- }
- } else if (callback) {
- callback();
- }
- } // ----------------------------------------------------------------------
- // the following methods are used to handle overflowing modals
- // todo (fat): these should probably be refactored out of modal.js
- // ----------------------------------------------------------------------
- ;
-
- _proto._adjustDialog = function _adjustDialog() {
- var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
-
- if (!this._isBodyOverflowing && isModalOverflowing) {
- this._element.style.paddingLeft = this._scrollbarWidth + "px";
- }
-
- if (this._isBodyOverflowing && !isModalOverflowing) {
- this._element.style.paddingRight = this._scrollbarWidth + "px";
- }
- };
-
- _proto._resetAdjustments = function _resetAdjustments() {
- this._element.style.paddingLeft = '';
- this._element.style.paddingRight = '';
- };
-
- _proto._checkScrollbar = function _checkScrollbar() {
- var rect = document.body.getBoundingClientRect();
- this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
- this._scrollbarWidth = this._getScrollbarWidth();
- };
-
- _proto._setScrollbar = function _setScrollbar() {
- var _this9 = this;
-
- if (this._isBodyOverflowing) {
- // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
- // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
- var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));
- var stickyContent = [].slice.call(document.querySelectorAll(Selector$5.STICKY_CONTENT)); // Adjust fixed content padding
-
- $(fixedContent).each(function (index, element) {
- var actualPadding = element.style.paddingRight;
- var calculatedPadding = $(element).css('padding-right');
- $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px");
- }); // Adjust sticky content margin
-
- $(stickyContent).each(function (index, element) {
- var actualMargin = element.style.marginRight;
- var calculatedMargin = $(element).css('margin-right');
- $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px");
- }); // Adjust body padding
-
- var actualPadding = document.body.style.paddingRight;
- var calculatedPadding = $(document.body).css('padding-right');
- $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
- }
-
- $(document.body).addClass(ClassName$5.OPEN);
- };
-
- _proto._resetScrollbar = function _resetScrollbar() {
- // Restore fixed content padding
- var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));
- $(fixedContent).each(function (index, element) {
- var padding = $(element).data('padding-right');
- $(element).removeData('padding-right');
- element.style.paddingRight = padding ? padding : '';
- }); // Restore sticky content
-
- var elements = [].slice.call(document.querySelectorAll("" + Selector$5.STICKY_CONTENT));
- $(elements).each(function (index, element) {
- var margin = $(element).data('margin-right');
-
- if (typeof margin !== 'undefined') {
- $(element).css('margin-right', margin).removeData('margin-right');
- }
- }); // Restore body padding
-
- var padding = $(document.body).data('padding-right');
- $(document.body).removeData('padding-right');
- document.body.style.paddingRight = padding ? padding : '';
- };
-
- _proto._getScrollbarWidth = function _getScrollbarWidth() {
- // thx d.walsh
- var scrollDiv = document.createElement('div');
- scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER;
- document.body.appendChild(scrollDiv);
- var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
- document.body.removeChild(scrollDiv);
- return scrollbarWidth;
- } // Static
- ;
-
- Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
- return this.each(function () {
- var data = $(this).data(DATA_KEY$5);
-
- var _config = _objectSpread({}, Default$3, $(this).data(), typeof config === 'object' && config ? config : {});
-
- if (!data) {
- data = new Modal(this, _config);
- $(this).data(DATA_KEY$5, data);
- }
-
- if (typeof config === 'string') {
- if (typeof data[config] === 'undefined') {
- throw new TypeError("No method named \"" + config + "\"");
- }
-
- data[config](relatedTarget);
- } else if (_config.show) {
- data.show(relatedTarget);
- }
- });
- };
-
- _createClass(Modal, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION$5;
- }
- }, {
- key: "Default",
- get: function get() {
- return Default$3;
- }
- }]);
-
- return Modal;
- }();
- /**
- * ------------------------------------------------------------------------
- * Data Api implementation
- * ------------------------------------------------------------------------
- */
-
-
- $(document).on(Event$5.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) {
- var _this10 = this;
-
- var target;
- var selector = Util.getSelectorFromElement(this);
-
- if (selector) {
- target = document.querySelector(selector);
- }
-
- var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data());
-
- if (this.tagName === 'A' || this.tagName === 'AREA') {
- event.preventDefault();
- }
-
- var $target = $(target).one(Event$5.SHOW, function (showEvent) {
- if (showEvent.isDefaultPrevented()) {
- // Only register focus restorer if modal will actually get shown
- return;
- }
-
- $target.one(Event$5.HIDDEN, function () {
- if ($(_this10).is(':visible')) {
- _this10.focus();
- }
- });
- });
-
- Modal._jQueryInterface.call($(target), config, this);
- });
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
- $.fn[NAME$5] = Modal._jQueryInterface;
- $.fn[NAME$5].Constructor = Modal;
-
- $.fn[NAME$5].noConflict = function () {
- $.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
- return Modal._jQueryInterface;
- };
-
- /**
- * --------------------------------------------------------------------------
- * Bootstrap (v4.3.1): tools/sanitizer.js
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * --------------------------------------------------------------------------
- */
- var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
- var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
- var DefaultWhitelist = {
- // Global attributes allowed on any supplied element below.
- '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
- a: ['target', 'href', 'title', 'rel'],
- area: [],
- b: [],
- br: [],
- col: [],
- code: [],
- div: [],
- em: [],
- hr: [],
- h1: [],
- h2: [],
- h3: [],
- h4: [],
- h5: [],
- h6: [],
- i: [],
- img: ['src', 'alt', 'title', 'width', 'height'],
- li: [],
- ol: [],
- p: [],
- pre: [],
- s: [],
- small: [],
- span: [],
- sub: [],
- sup: [],
- strong: [],
- u: [],
- ul: []
- /**
- * A pattern that recognizes a commonly useful subset of URLs that are safe.
- *
- * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
- */
-
- };
- var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
- /**
- * A pattern that matches safe data URLs. Only matches image, video and audio types.
- *
- * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
- */
-
- var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
-
- function allowedAttribute(attr, allowedAttributeList) {
- var attrName = attr.nodeName.toLowerCase();
-
- if (allowedAttributeList.indexOf(attrName) !== -1) {
- if (uriAttrs.indexOf(attrName) !== -1) {
- return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
- }
-
- return true;
- }
-
- var regExp = allowedAttributeList.filter(function (attrRegex) {
- return attrRegex instanceof RegExp;
- }); // Check if a regular expression validates the attribute.
-
- for (var i = 0, l = regExp.length; i < l; i++) {
- if (attrName.match(regExp[i])) {
- return true;
- }
- }
-
- return false;
- }
-
- function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
- if (unsafeHtml.length === 0) {
- return unsafeHtml;
- }
-
- if (sanitizeFn && typeof sanitizeFn === 'function') {
- return sanitizeFn(unsafeHtml);
- }
-
- var domParser = new window.DOMParser();
- var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
- var whitelistKeys = Object.keys(whiteList);
- var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
-
- var _loop = function _loop(i, len) {
- var el = elements[i];
- var elName = el.nodeName.toLowerCase();
-
- if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
- el.parentNode.removeChild(el);
- return "continue";
- }
-
- var attributeList = [].slice.call(el.attributes);
- var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
- attributeList.forEach(function (attr) {
- if (!allowedAttribute(attr, whitelistedAttributes)) {
- el.removeAttribute(attr.nodeName);
- }
- });
- };
-
- for (var i = 0, len = elements.length; i < len; i++) {
- var _ret = _loop(i, len);
-
- if (_ret === "continue") continue;
- }
-
- return createdDocument.body.innerHTML;
- }
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$6 = 'tooltip';
- var VERSION$6 = '4.3.1';
- var DATA_KEY$6 = 'bs.tooltip';
- var EVENT_KEY$6 = "." + DATA_KEY$6;
- var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6];
- var CLASS_PREFIX = 'bs-tooltip';
- var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
- var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
- var DefaultType$4 = {
- animation: 'boolean',
- template: 'string',
- title: '(string|element|function)',
- trigger: 'string',
- delay: '(number|object)',
- html: 'boolean',
- selector: '(string|boolean)',
- placement: '(string|function)',
- offset: '(number|string|function)',
- container: '(string|element|boolean)',
- fallbackPlacement: '(string|array)',
- boundary: '(string|element)',
- sanitize: 'boolean',
- sanitizeFn: '(null|function)',
- whiteList: 'object'
- };
- var AttachmentMap$1 = {
- AUTO: 'auto',
- TOP: 'top',
- RIGHT: 'right',
- BOTTOM: 'bottom',
- LEFT: 'left'
- };
- var Default$4 = {
- animation: true,
- template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
- trigger: 'hover focus',
- title: '',
- delay: 0,
- html: false,
- selector: false,
- placement: 'top',
- offset: 0,
- container: false,
- fallbackPlacement: 'flip',
- boundary: 'scrollParent',
- sanitize: true,
- sanitizeFn: null,
- whiteList: DefaultWhitelist
- };
- var HoverState = {
- SHOW: 'show',
- OUT: 'out'
- };
- var Event$6 = {
- HIDE: "hide" + EVENT_KEY$6,
- HIDDEN: "hidden" + EVENT_KEY$6,
- SHOW: "show" + EVENT_KEY$6,
- SHOWN: "shown" + EVENT_KEY$6,
- INSERTED: "inserted" + EVENT_KEY$6,
- CLICK: "click" + EVENT_KEY$6,
- FOCUSIN: "focusin" + EVENT_KEY$6,
- FOCUSOUT: "focusout" + EVENT_KEY$6,
- MOUSEENTER: "mouseenter" + EVENT_KEY$6,
- MOUSELEAVE: "mouseleave" + EVENT_KEY$6
- };
- var ClassName$6 = {
- FADE: 'fade',
- SHOW: 'show'
- };
- var Selector$6 = {
- TOOLTIP: '.tooltip',
- TOOLTIP_INNER: '.tooltip-inner',
- ARROW: '.arrow'
- };
- var Trigger = {
- HOVER: 'hover',
- FOCUS: 'focus',
- CLICK: 'click',
- MANUAL: 'manual'
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- };
-
- var Tooltip =
- /*#__PURE__*/
- function () {
- function Tooltip(element, config) {
- /**
- * Check for Popper dependency
- * Popper - https://popper.js.org
- */
- if (typeof Popper === 'undefined') {
- throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
- } // private
-
-
- this._isEnabled = true;
- this._timeout = 0;
- this._hoverState = '';
- this._activeTrigger = {};
- this._popper = null; // Protected
-
- this.element = element;
- this.config = this._getConfig(config);
- this.tip = null;
-
- this._setListeners();
- } // Getters
-
-
- var _proto = Tooltip.prototype;
-
- // Public
- _proto.enable = function enable() {
- this._isEnabled = true;
- };
-
- _proto.disable = function disable() {
- this._isEnabled = false;
- };
-
- _proto.toggleEnabled = function toggleEnabled() {
- this._isEnabled = !this._isEnabled;
- };
-
- _proto.toggle = function toggle(event) {
- if (!this._isEnabled) {
- return;
- }
-
- if (event) {
- var dataKey = this.constructor.DATA_KEY;
- var context = $(event.currentTarget).data(dataKey);
-
- if (!context) {
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
- $(event.currentTarget).data(dataKey, context);
- }
-
- context._activeTrigger.click = !context._activeTrigger.click;
-
- if (context._isWithActiveTrigger()) {
- context._enter(null, context);
- } else {
- context._leave(null, context);
- }
- } else {
- if ($(this.getTipElement()).hasClass(ClassName$6.SHOW)) {
- this._leave(null, this);
-
- return;
- }
-
- this._enter(null, this);
- }
- };
-
- _proto.dispose = function dispose() {
- clearTimeout(this._timeout);
- $.removeData(this.element, this.constructor.DATA_KEY);
- $(this.element).off(this.constructor.EVENT_KEY);
- $(this.element).closest('.modal').off('hide.bs.modal');
-
- if (this.tip) {
- $(this.tip).remove();
- }
-
- this._isEnabled = null;
- this._timeout = null;
- this._hoverState = null;
- this._activeTrigger = null;
-
- if (this._popper !== null) {
- this._popper.destroy();
- }
-
- this._popper = null;
- this.element = null;
- this.config = null;
- this.tip = null;
- };
-
- _proto.show = function show() {
- var _this = this;
-
- if ($(this.element).css('display') === 'none') {
- throw new Error('Please use show on visible elements');
- }
-
- var showEvent = $.Event(this.constructor.Event.SHOW);
-
- if (this.isWithContent() && this._isEnabled) {
- $(this.element).trigger(showEvent);
- var shadowRoot = Util.findShadowRoot(this.element);
- var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
-
- if (showEvent.isDefaultPrevented() || !isInTheDom) {
- return;
- }
-
- var tip = this.getTipElement();
- var tipId = Util.getUID(this.constructor.NAME);
- tip.setAttribute('id', tipId);
- this.element.setAttribute('aria-describedby', tipId);
- this.setContent();
-
- if (this.config.animation) {
- $(tip).addClass(ClassName$6.FADE);
- }
-
- var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
-
- var attachment = this._getAttachment(placement);
-
- this.addAttachmentClass(attachment);
-
- var container = this._getContainer();
-
- $(tip).data(this.constructor.DATA_KEY, this);
-
- if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
- $(tip).appendTo(container);
- }
-
- $(this.element).trigger(this.constructor.Event.INSERTED);
- this._popper = new Popper(this.element, tip, {
- placement: attachment,
- modifiers: {
- offset: this._getOffset(),
- flip: {
- behavior: this.config.fallbackPlacement
- },
- arrow: {
- element: Selector$6.ARROW
- },
- preventOverflow: {
- boundariesElement: this.config.boundary
- }
- },
- onCreate: function onCreate(data) {
- if (data.originalPlacement !== data.placement) {
- _this._handlePopperPlacementChange(data);
- }
- },
- onUpdate: function onUpdate(data) {
- return _this._handlePopperPlacementChange(data);
- }
- });
- $(tip).addClass(ClassName$6.SHOW); // If this is a touch-enabled device we add extra
- // empty mouseover listeners to the body's immediate children;
- // only needed because of broken event delegation on iOS
- // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
-
- if ('ontouchstart' in document.documentElement) {
- $(document.body).children().on('mouseover', null, $.noop);
- }
-
- var complete = function complete() {
- if (_this.config.animation) {
- _this._fixTransition();
- }
-
- var prevHoverState = _this._hoverState;
- _this._hoverState = null;
- $(_this.element).trigger(_this.constructor.Event.SHOWN);
-
- if (prevHoverState === HoverState.OUT) {
- _this._leave(null, _this);
- }
- };
-
- if ($(this.tip).hasClass(ClassName$6.FADE)) {
- var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
- $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
- } else {
- complete();
- }
- }
- };
-
- _proto.hide = function hide(callback) {
- var _this2 = this;
-
- var tip = this.getTipElement();
- var hideEvent = $.Event(this.constructor.Event.HIDE);
-
- var complete = function complete() {
- if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
- tip.parentNode.removeChild(tip);
- }
-
- _this2._cleanTipClass();
-
- _this2.element.removeAttribute('aria-describedby');
-
- $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
-
- if (_this2._popper !== null) {
- _this2._popper.destroy();
- }
-
- if (callback) {
- callback();
- }
- };
-
- $(this.element).trigger(hideEvent);
-
- if (hideEvent.isDefaultPrevented()) {
- return;
- }
-
- $(tip).removeClass(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra
- // empty mouseover listeners we added for iOS support
-
- if ('ontouchstart' in document.documentElement) {
- $(document.body).children().off('mouseover', null, $.noop);
- }
-
- this._activeTrigger[Trigger.CLICK] = false;
- this._activeTrigger[Trigger.FOCUS] = false;
- this._activeTrigger[Trigger.HOVER] = false;
-
- if ($(this.tip).hasClass(ClassName$6.FADE)) {
- var transitionDuration = Util.getTransitionDurationFromElement(tip);
- $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
- } else {
- complete();
- }
-
- this._hoverState = '';
- };
-
- _proto.update = function update() {
- if (this._popper !== null) {
- this._popper.scheduleUpdate();
- }
- } // Protected
- ;
-
- _proto.isWithContent = function isWithContent() {
- return Boolean(this.getTitle());
- };
-
- _proto.addAttachmentClass = function addAttachmentClass(attachment) {
- $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
- };
-
- _proto.getTipElement = function getTipElement() {
- this.tip = this.tip || $(this.config.template)[0];
- return this.tip;
- };
-
- _proto.setContent = function setContent() {
- var tip = this.getTipElement();
- this.setElementContent($(tip.querySelectorAll(Selector$6.TOOLTIP_INNER)), this.getTitle());
- $(tip).removeClass(ClassName$6.FADE + " " + ClassName$6.SHOW);
- };
-
- _proto.setElementContent = function setElementContent($element, content) {
- if (typeof content === 'object' && (content.nodeType || content.jquery)) {
- // Content is a DOM node or a jQuery
- if (this.config.html) {
- if (!$(content).parent().is($element)) {
- $element.empty().append(content);
- }
- } else {
- $element.text($(content).text());
- }
-
- return;
- }
-
- if (this.config.html) {
- if (this.config.sanitize) {
- content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
- }
-
- $element.html(content);
- } else {
- $element.text(content);
- }
- };
-
- _proto.getTitle = function getTitle() {
- var title = this.element.getAttribute('data-original-title');
-
- if (!title) {
- title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
- }
-
- return title;
- } // Private
- ;
-
- _proto._getOffset = function _getOffset() {
- var _this3 = this;
-
- var offset = {};
-
- if (typeof this.config.offset === 'function') {
- offset.fn = function (data) {
- data.offsets = _objectSpread({}, data.offsets, _this3.config.offset(data.offsets, _this3.element) || {});
- return data;
- };
- } else {
- offset.offset = this.config.offset;
- }
-
- return offset;
- };
-
- _proto._getContainer = function _getContainer() {
- if (this.config.container === false) {
- return document.body;
- }
-
- if (Util.isElement(this.config.container)) {
- return $(this.config.container);
- }
-
- return $(document).find(this.config.container);
- };
-
- _proto._getAttachment = function _getAttachment(placement) {
- return AttachmentMap$1[placement.toUpperCase()];
- };
-
- _proto._setListeners = function _setListeners() {
- var _this4 = this;
-
- var triggers = this.config.trigger.split(' ');
- triggers.forEach(function (trigger) {
- if (trigger === 'click') {
- $(_this4.element).on(_this4.constructor.Event.CLICK, _this4.config.selector, function (event) {
- return _this4.toggle(event);
- });
- } else if (trigger !== Trigger.MANUAL) {
- var eventIn = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN;
- var eventOut = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT;
- $(_this4.element).on(eventIn, _this4.config.selector, function (event) {
- return _this4._enter(event);
- }).on(eventOut, _this4.config.selector, function (event) {
- return _this4._leave(event);
- });
- }
- });
- $(this.element).closest('.modal').on('hide.bs.modal', function () {
- if (_this4.element) {
- _this4.hide();
- }
- });
-
- if (this.config.selector) {
- this.config = _objectSpread({}, this.config, {
- trigger: 'manual',
- selector: ''
- });
- } else {
- this._fixTitle();
- }
- };
-
- _proto._fixTitle = function _fixTitle() {
- var titleType = typeof this.element.getAttribute('data-original-title');
-
- if (this.element.getAttribute('title') || titleType !== 'string') {
- this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
- this.element.setAttribute('title', '');
- }
- };
-
- _proto._enter = function _enter(event, context) {
- var dataKey = this.constructor.DATA_KEY;
- context = context || $(event.currentTarget).data(dataKey);
-
- if (!context) {
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
- $(event.currentTarget).data(dataKey, context);
- }
-
- if (event) {
- context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
- }
-
- if ($(context.getTipElement()).hasClass(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) {
- context._hoverState = HoverState.SHOW;
- return;
- }
-
- clearTimeout(context._timeout);
- context._hoverState = HoverState.SHOW;
-
- if (!context.config.delay || !context.config.delay.show) {
- context.show();
- return;
- }
-
- context._timeout = setTimeout(function () {
- if (context._hoverState === HoverState.SHOW) {
- context.show();
- }
- }, context.config.delay.show);
- };
-
- _proto._leave = function _leave(event, context) {
- var dataKey = this.constructor.DATA_KEY;
- context = context || $(event.currentTarget).data(dataKey);
-
- if (!context) {
- context = new this.constructor(event.currentTarget, this._getDelegateConfig());
- $(event.currentTarget).data(dataKey, context);
- }
-
- if (event) {
- context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
- }
-
- if (context._isWithActiveTrigger()) {
- return;
- }
-
- clearTimeout(context._timeout);
- context._hoverState = HoverState.OUT;
-
- if (!context.config.delay || !context.config.delay.hide) {
- context.hide();
- return;
- }
-
- context._timeout = setTimeout(function () {
- if (context._hoverState === HoverState.OUT) {
- context.hide();
- }
- }, context.config.delay.hide);
- };
-
- _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
- for (var trigger in this._activeTrigger) {
- if (this._activeTrigger[trigger]) {
- return true;
- }
- }
-
- return false;
- };
-
- _proto._getConfig = function _getConfig(config) {
- var dataAttributes = $(this.element).data();
- Object.keys(dataAttributes).forEach(function (dataAttr) {
- if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
- delete dataAttributes[dataAttr];
- }
- });
- config = _objectSpread({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});
-
- if (typeof config.delay === 'number') {
- config.delay = {
- show: config.delay,
- hide: config.delay
- };
- }
-
- if (typeof config.title === 'number') {
- config.title = config.title.toString();
- }
-
- if (typeof config.content === 'number') {
- config.content = config.content.toString();
- }
-
- Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);
-
- if (config.sanitize) {
- config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
- }
-
- return config;
- };
-
- _proto._getDelegateConfig = function _getDelegateConfig() {
- var config = {};
-
- if (this.config) {
- for (var key in this.config) {
- if (this.constructor.Default[key] !== this.config[key]) {
- config[key] = this.config[key];
- }
- }
- }
-
- return config;
- };
-
- _proto._cleanTipClass = function _cleanTipClass() {
- var $tip = $(this.getTipElement());
- var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
-
- if (tabClass !== null && tabClass.length) {
- $tip.removeClass(tabClass.join(''));
- }
- };
-
- _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
- var popperInstance = popperData.instance;
- this.tip = popperInstance.popper;
-
- this._cleanTipClass();
-
- this.addAttachmentClass(this._getAttachment(popperData.placement));
- };
-
- _proto._fixTransition = function _fixTransition() {
- var tip = this.getTipElement();
- var initConfigAnimation = this.config.animation;
-
- if (tip.getAttribute('x-placement') !== null) {
- return;
- }
-
- $(tip).removeClass(ClassName$6.FADE);
- this.config.animation = false;
- this.hide();
- this.show();
- this.config.animation = initConfigAnimation;
- } // Static
- ;
-
- Tooltip._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var data = $(this).data(DATA_KEY$6);
-
- var _config = typeof config === 'object' && config;
-
- if (!data && /dispose|hide/.test(config)) {
- return;
- }
-
- if (!data) {
- data = new Tooltip(this, _config);
- $(this).data(DATA_KEY$6, data);
- }
-
- if (typeof config === 'string') {
- if (typeof data[config] === 'undefined') {
- throw new TypeError("No method named \"" + config + "\"");
- }
-
- data[config]();
- }
- });
- };
-
- _createClass(Tooltip, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION$6;
- }
- }, {
- key: "Default",
- get: function get() {
- return Default$4;
- }
- }, {
- key: "NAME",
- get: function get() {
- return NAME$6;
- }
- }, {
- key: "DATA_KEY",
- get: function get() {
- return DATA_KEY$6;
- }
- }, {
- key: "Event",
- get: function get() {
- return Event$6;
- }
- }, {
- key: "EVENT_KEY",
- get: function get() {
- return EVENT_KEY$6;
- }
- }, {
- key: "DefaultType",
- get: function get() {
- return DefaultType$4;
- }
- }]);
-
- return Tooltip;
- }();
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
-
- $.fn[NAME$6] = Tooltip._jQueryInterface;
- $.fn[NAME$6].Constructor = Tooltip;
-
- $.fn[NAME$6].noConflict = function () {
- $.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
- return Tooltip._jQueryInterface;
- };
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$7 = 'popover';
- var VERSION$7 = '4.3.1';
- var DATA_KEY$7 = 'bs.popover';
- var EVENT_KEY$7 = "." + DATA_KEY$7;
- var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7];
- var CLASS_PREFIX$1 = 'bs-popover';
- var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
-
- var Default$5 = _objectSpread({}, Tooltip.Default, {
- placement: 'right',
- trigger: 'click',
- content: '',
- template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
- });
-
- var DefaultType$5 = _objectSpread({}, Tooltip.DefaultType, {
- content: '(string|element|function)'
- });
-
- var ClassName$7 = {
- FADE: 'fade',
- SHOW: 'show'
- };
- var Selector$7 = {
- TITLE: '.popover-header',
- CONTENT: '.popover-body'
- };
- var Event$7 = {
- HIDE: "hide" + EVENT_KEY$7,
- HIDDEN: "hidden" + EVENT_KEY$7,
- SHOW: "show" + EVENT_KEY$7,
- SHOWN: "shown" + EVENT_KEY$7,
- INSERTED: "inserted" + EVENT_KEY$7,
- CLICK: "click" + EVENT_KEY$7,
- FOCUSIN: "focusin" + EVENT_KEY$7,
- FOCUSOUT: "focusout" + EVENT_KEY$7,
- MOUSEENTER: "mouseenter" + EVENT_KEY$7,
- MOUSELEAVE: "mouseleave" + EVENT_KEY$7
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- };
-
- var Popover =
- /*#__PURE__*/
- function (_Tooltip) {
- _inheritsLoose(Popover, _Tooltip);
-
- function Popover() {
- return _Tooltip.apply(this, arguments) || this;
- }
-
- var _proto = Popover.prototype;
-
- // Overrides
- _proto.isWithContent = function isWithContent() {
- return this.getTitle() || this._getContent();
- };
-
- _proto.addAttachmentClass = function addAttachmentClass(attachment) {
- $(this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment);
- };
-
- _proto.getTipElement = function getTipElement() {
- this.tip = this.tip || $(this.config.template)[0];
- return this.tip;
- };
-
- _proto.setContent = function setContent() {
- var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events
-
- this.setElementContent($tip.find(Selector$7.TITLE), this.getTitle());
-
- var content = this._getContent();
-
- if (typeof content === 'function') {
- content = content.call(this.element);
- }
-
- this.setElementContent($tip.find(Selector$7.CONTENT), content);
- $tip.removeClass(ClassName$7.FADE + " " + ClassName$7.SHOW);
- } // Private
- ;
-
- _proto._getContent = function _getContent() {
- return this.element.getAttribute('data-content') || this.config.content;
- };
-
- _proto._cleanTipClass = function _cleanTipClass() {
- var $tip = $(this.getTipElement());
- var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1);
-
- if (tabClass !== null && tabClass.length > 0) {
- $tip.removeClass(tabClass.join(''));
- }
- } // Static
- ;
-
- Popover._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var data = $(this).data(DATA_KEY$7);
-
- var _config = typeof config === 'object' ? config : null;
-
- if (!data && /dispose|hide/.test(config)) {
- return;
- }
-
- if (!data) {
- data = new Popover(this, _config);
- $(this).data(DATA_KEY$7, data);
- }
-
- if (typeof config === 'string') {
- if (typeof data[config] === 'undefined') {
- throw new TypeError("No method named \"" + config + "\"");
- }
-
- data[config]();
- }
- });
- };
-
- _createClass(Popover, null, [{
- key: "VERSION",
- // Getters
- get: function get() {
- return VERSION$7;
- }
- }, {
- key: "Default",
- get: function get() {
- return Default$5;
- }
- }, {
- key: "NAME",
- get: function get() {
- return NAME$7;
- }
- }, {
- key: "DATA_KEY",
- get: function get() {
- return DATA_KEY$7;
- }
- }, {
- key: "Event",
- get: function get() {
- return Event$7;
- }
- }, {
- key: "EVENT_KEY",
- get: function get() {
- return EVENT_KEY$7;
- }
- }, {
- key: "DefaultType",
- get: function get() {
- return DefaultType$5;
- }
- }]);
-
- return Popover;
- }(Tooltip);
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
-
- $.fn[NAME$7] = Popover._jQueryInterface;
- $.fn[NAME$7].Constructor = Popover;
-
- $.fn[NAME$7].noConflict = function () {
- $.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
- return Popover._jQueryInterface;
- };
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$8 = 'scrollspy';
- var VERSION$8 = '4.3.1';
- var DATA_KEY$8 = 'bs.scrollspy';
- var EVENT_KEY$8 = "." + DATA_KEY$8;
- var DATA_API_KEY$6 = '.data-api';
- var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8];
- var Default$6 = {
- offset: 10,
- method: 'auto',
- target: ''
- };
- var DefaultType$6 = {
- offset: 'number',
- method: 'string',
- target: '(string|element)'
- };
- var Event$8 = {
- ACTIVATE: "activate" + EVENT_KEY$8,
- SCROLL: "scroll" + EVENT_KEY$8,
- LOAD_DATA_API: "load" + EVENT_KEY$8 + DATA_API_KEY$6
- };
- var ClassName$8 = {
- DROPDOWN_ITEM: 'dropdown-item',
- DROPDOWN_MENU: 'dropdown-menu',
- ACTIVE: 'active'
- };
- var Selector$8 = {
- DATA_SPY: '[data-spy="scroll"]',
- ACTIVE: '.active',
- NAV_LIST_GROUP: '.nav, .list-group',
- NAV_LINKS: '.nav-link',
- NAV_ITEMS: '.nav-item',
- LIST_ITEMS: '.list-group-item',
- DROPDOWN: '.dropdown',
- DROPDOWN_ITEMS: '.dropdown-item',
- DROPDOWN_TOGGLE: '.dropdown-toggle'
- };
- var OffsetMethod = {
- OFFSET: 'offset',
- POSITION: 'position'
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- };
-
- var ScrollSpy =
- /*#__PURE__*/
- function () {
- function ScrollSpy(element, config) {
- var _this = this;
-
- this._element = element;
- this._scrollElement = element.tagName === 'BODY' ? window : element;
- this._config = this._getConfig(config);
- this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " " + Selector$8.DROPDOWN_ITEMS);
- this._offsets = [];
- this._targets = [];
- this._activeTarget = null;
- this._scrollHeight = 0;
- $(this._scrollElement).on(Event$8.SCROLL, function (event) {
- return _this._process(event);
- });
- this.refresh();
-
- this._process();
- } // Getters
-
-
- var _proto = ScrollSpy.prototype;
-
- // Public
- _proto.refresh = function refresh() {
- var _this2 = this;
-
- var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
- var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
- var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
- this._offsets = [];
- this._targets = [];
- this._scrollHeight = this._getScrollHeight();
- var targets = [].slice.call(document.querySelectorAll(this._selector));
- targets.map(function (element) {
- var target;
- var targetSelector = Util.getSelectorFromElement(element);
-
- if (targetSelector) {
- target = document.querySelector(targetSelector);
- }
-
- if (target) {
- var targetBCR = target.getBoundingClientRect();
-
- if (targetBCR.width || targetBCR.height) {
- // TODO (fat): remove sketch reliance on jQuery position/offset
- return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
- }
- }
-
- return null;
- }).filter(function (item) {
- return item;
- }).sort(function (a, b) {
- return a[0] - b[0];
- }).forEach(function (item) {
- _this2._offsets.push(item[0]);
-
- _this2._targets.push(item[1]);
- });
- };
-
- _proto.dispose = function dispose() {
- $.removeData(this._element, DATA_KEY$8);
- $(this._scrollElement).off(EVENT_KEY$8);
- this._element = null;
- this._scrollElement = null;
- this._config = null;
- this._selector = null;
- this._offsets = null;
- this._targets = null;
- this._activeTarget = null;
- this._scrollHeight = null;
- } // Private
- ;
-
- _proto._getConfig = function _getConfig(config) {
- config = _objectSpread({}, Default$6, typeof config === 'object' && config ? config : {});
-
- if (typeof config.target !== 'string') {
- var id = $(config.target).attr('id');
-
- if (!id) {
- id = Util.getUID(NAME$8);
- $(config.target).attr('id', id);
- }
-
- config.target = "#" + id;
- }
-
- Util.typeCheckConfig(NAME$8, config, DefaultType$6);
- return config;
- };
-
- _proto._getScrollTop = function _getScrollTop() {
- return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
- };
-
- _proto._getScrollHeight = function _getScrollHeight() {
- return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
- };
-
- _proto._getOffsetHeight = function _getOffsetHeight() {
- return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
- };
-
- _proto._process = function _process() {
- var scrollTop = this._getScrollTop() + this._config.offset;
-
- var scrollHeight = this._getScrollHeight();
-
- var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
-
- if (this._scrollHeight !== scrollHeight) {
- this.refresh();
- }
-
- if (scrollTop >= maxScroll) {
- var target = this._targets[this._targets.length - 1];
-
- if (this._activeTarget !== target) {
- this._activate(target);
- }
-
- return;
- }
-
- if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
- this._activeTarget = null;
-
- this._clear();
-
- return;
- }
-
- var offsetLength = this._offsets.length;
-
- for (var i = offsetLength; i--;) {
- var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
-
- if (isActiveTarget) {
- this._activate(this._targets[i]);
- }
- }
- };
-
- _proto._activate = function _activate(target) {
- this._activeTarget = target;
-
- this._clear();
-
- var queries = this._selector.split(',').map(function (selector) {
- return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
- });
-
- var $link = $([].slice.call(document.querySelectorAll(queries.join(','))));
-
- if ($link.hasClass(ClassName$8.DROPDOWN_ITEM)) {
- $link.closest(Selector$8.DROPDOWN).find(Selector$8.DROPDOWN_TOGGLE).addClass(ClassName$8.ACTIVE);
- $link.addClass(ClassName$8.ACTIVE);
- } else {
- // Set triggered link as active
- $link.addClass(ClassName$8.ACTIVE); // Set triggered links parents as active
- // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
-
- $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_LINKS + ", " + Selector$8.LIST_ITEMS).addClass(ClassName$8.ACTIVE); // Handle special case when .nav-link is inside .nav-item
-
- $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_ITEMS).children(Selector$8.NAV_LINKS).addClass(ClassName$8.ACTIVE);
- }
-
- $(this._scrollElement).trigger(Event$8.ACTIVATE, {
- relatedTarget: target
- });
- };
-
- _proto._clear = function _clear() {
- [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {
- return node.classList.contains(ClassName$8.ACTIVE);
- }).forEach(function (node) {
- return node.classList.remove(ClassName$8.ACTIVE);
- });
- } // Static
- ;
-
- ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var data = $(this).data(DATA_KEY$8);
-
- var _config = typeof config === 'object' && config;
-
- if (!data) {
- data = new ScrollSpy(this, _config);
- $(this).data(DATA_KEY$8, data);
- }
-
- if (typeof config === 'string') {
- if (typeof data[config] === 'undefined') {
- throw new TypeError("No method named \"" + config + "\"");
- }
-
- data[config]();
- }
- });
- };
-
- _createClass(ScrollSpy, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION$8;
- }
- }, {
- key: "Default",
- get: function get() {
- return Default$6;
- }
- }]);
-
- return ScrollSpy;
- }();
- /**
- * ------------------------------------------------------------------------
- * Data Api implementation
- * ------------------------------------------------------------------------
- */
-
-
- $(window).on(Event$8.LOAD_DATA_API, function () {
- var scrollSpys = [].slice.call(document.querySelectorAll(Selector$8.DATA_SPY));
- var scrollSpysLength = scrollSpys.length;
-
- for (var i = scrollSpysLength; i--;) {
- var $spy = $(scrollSpys[i]);
-
- ScrollSpy._jQueryInterface.call($spy, $spy.data());
- }
- });
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
- $.fn[NAME$8] = ScrollSpy._jQueryInterface;
- $.fn[NAME$8].Constructor = ScrollSpy;
-
- $.fn[NAME$8].noConflict = function () {
- $.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
- return ScrollSpy._jQueryInterface;
- };
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$9 = 'tab';
- var VERSION$9 = '4.3.1';
- var DATA_KEY$9 = 'bs.tab';
- var EVENT_KEY$9 = "." + DATA_KEY$9;
- var DATA_API_KEY$7 = '.data-api';
- var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9];
- var Event$9 = {
- HIDE: "hide" + EVENT_KEY$9,
- HIDDEN: "hidden" + EVENT_KEY$9,
- SHOW: "show" + EVENT_KEY$9,
- SHOWN: "shown" + EVENT_KEY$9,
- CLICK_DATA_API: "click" + EVENT_KEY$9 + DATA_API_KEY$7
- };
- var ClassName$9 = {
- DROPDOWN_MENU: 'dropdown-menu',
- ACTIVE: 'active',
- DISABLED: 'disabled',
- FADE: 'fade',
- SHOW: 'show'
- };
- var Selector$9 = {
- DROPDOWN: '.dropdown',
- NAV_LIST_GROUP: '.nav, .list-group',
- ACTIVE: '.active',
- ACTIVE_UL: '> li > .active',
- DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
- DROPDOWN_TOGGLE: '.dropdown-toggle',
- DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- };
-
- var Tab =
- /*#__PURE__*/
- function () {
- function Tab(element) {
- this._element = element;
- } // Getters
-
-
- var _proto = Tab.prototype;
-
- // Public
- _proto.show = function show() {
- var _this = this;
-
- if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName$9.ACTIVE) || $(this._element).hasClass(ClassName$9.DISABLED)) {
- return;
- }
-
- var target;
- var previous;
- var listElement = $(this._element).closest(Selector$9.NAV_LIST_GROUP)[0];
- var selector = Util.getSelectorFromElement(this._element);
-
- if (listElement) {
- var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE;
- previous = $.makeArray($(listElement).find(itemSelector));
- previous = previous[previous.length - 1];
- }
-
- var hideEvent = $.Event(Event$9.HIDE, {
- relatedTarget: this._element
- });
- var showEvent = $.Event(Event$9.SHOW, {
- relatedTarget: previous
- });
-
- if (previous) {
- $(previous).trigger(hideEvent);
- }
-
- $(this._element).trigger(showEvent);
-
- if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
- return;
- }
-
- if (selector) {
- target = document.querySelector(selector);
- }
-
- this._activate(this._element, listElement);
-
- var complete = function complete() {
- var hiddenEvent = $.Event(Event$9.HIDDEN, {
- relatedTarget: _this._element
- });
- var shownEvent = $.Event(Event$9.SHOWN, {
- relatedTarget: previous
- });
- $(previous).trigger(hiddenEvent);
- $(_this._element).trigger(shownEvent);
- };
-
- if (target) {
- this._activate(target, target.parentNode, complete);
- } else {
- complete();
- }
- };
-
- _proto.dispose = function dispose() {
- $.removeData(this._element, DATA_KEY$9);
- this._element = null;
- } // Private
- ;
-
- _proto._activate = function _activate(element, container, callback) {
- var _this2 = this;
-
- var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(Selector$9.ACTIVE_UL) : $(container).children(Selector$9.ACTIVE);
- var active = activeElements[0];
- var isTransitioning = callback && active && $(active).hasClass(ClassName$9.FADE);
-
- var complete = function complete() {
- return _this2._transitionComplete(element, active, callback);
- };
-
- if (active && isTransitioning) {
- var transitionDuration = Util.getTransitionDurationFromElement(active);
- $(active).removeClass(ClassName$9.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
- } else {
- complete();
- }
- };
-
- _proto._transitionComplete = function _transitionComplete(element, active, callback) {
- if (active) {
- $(active).removeClass(ClassName$9.ACTIVE);
- var dropdownChild = $(active.parentNode).find(Selector$9.DROPDOWN_ACTIVE_CHILD)[0];
-
- if (dropdownChild) {
- $(dropdownChild).removeClass(ClassName$9.ACTIVE);
- }
-
- if (active.getAttribute('role') === 'tab') {
- active.setAttribute('aria-selected', false);
- }
- }
-
- $(element).addClass(ClassName$9.ACTIVE);
-
- if (element.getAttribute('role') === 'tab') {
- element.setAttribute('aria-selected', true);
- }
-
- Util.reflow(element);
-
- if (element.classList.contains(ClassName$9.FADE)) {
- element.classList.add(ClassName$9.SHOW);
- }
-
- if (element.parentNode && $(element.parentNode).hasClass(ClassName$9.DROPDOWN_MENU)) {
- var dropdownElement = $(element).closest(Selector$9.DROPDOWN)[0];
-
- if (dropdownElement) {
- var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector$9.DROPDOWN_TOGGLE));
- $(dropdownToggleList).addClass(ClassName$9.ACTIVE);
- }
-
- element.setAttribute('aria-expanded', true);
- }
-
- if (callback) {
- callback();
- }
- } // Static
- ;
-
- Tab._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var $this = $(this);
- var data = $this.data(DATA_KEY$9);
-
- if (!data) {
- data = new Tab(this);
- $this.data(DATA_KEY$9, data);
- }
-
- if (typeof config === 'string') {
- if (typeof data[config] === 'undefined') {
- throw new TypeError("No method named \"" + config + "\"");
- }
-
- data[config]();
- }
- });
- };
-
- _createClass(Tab, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION$9;
- }
- }]);
-
- return Tab;
- }();
- /**
- * ------------------------------------------------------------------------
- * Data Api implementation
- * ------------------------------------------------------------------------
- */
-
-
- $(document).on(Event$9.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) {
- event.preventDefault();
-
- Tab._jQueryInterface.call($(this), 'show');
- });
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
- $.fn[NAME$9] = Tab._jQueryInterface;
- $.fn[NAME$9].Constructor = Tab;
-
- $.fn[NAME$9].noConflict = function () {
- $.fn[NAME$9] = JQUERY_NO_CONFLICT$9;
- return Tab._jQueryInterface;
- };
-
- /**
- * ------------------------------------------------------------------------
- * Constants
- * ------------------------------------------------------------------------
- */
-
- var NAME$a = 'toast';
- var VERSION$a = '4.3.1';
- var DATA_KEY$a = 'bs.toast';
- var EVENT_KEY$a = "." + DATA_KEY$a;
- var JQUERY_NO_CONFLICT$a = $.fn[NAME$a];
- var Event$a = {
- CLICK_DISMISS: "click.dismiss" + EVENT_KEY$a,
- HIDE: "hide" + EVENT_KEY$a,
- HIDDEN: "hidden" + EVENT_KEY$a,
- SHOW: "show" + EVENT_KEY$a,
- SHOWN: "shown" + EVENT_KEY$a
- };
- var ClassName$a = {
- FADE: 'fade',
- HIDE: 'hide',
- SHOW: 'show',
- SHOWING: 'showing'
- };
- var DefaultType$7 = {
- animation: 'boolean',
- autohide: 'boolean',
- delay: 'number'
- };
- var Default$7 = {
- animation: true,
- autohide: true,
- delay: 500
- };
- var Selector$a = {
- DATA_DISMISS: '[data-dismiss="toast"]'
- /**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
- */
-
- };
-
- var Toast =
- /*#__PURE__*/
- function () {
- function Toast(element, config) {
- this._element = element;
- this._config = this._getConfig(config);
- this._timeout = null;
-
- this._setListeners();
- } // Getters
-
-
- var _proto = Toast.prototype;
-
- // Public
- _proto.show = function show() {
- var _this = this;
-
- $(this._element).trigger(Event$a.SHOW);
-
- if (this._config.animation) {
- this._element.classList.add(ClassName$a.FADE);
- }
-
- var complete = function complete() {
- _this._element.classList.remove(ClassName$a.SHOWING);
-
- _this._element.classList.add(ClassName$a.SHOW);
-
- $(_this._element).trigger(Event$a.SHOWN);
-
- if (_this._config.autohide) {
- _this.hide();
- }
- };
-
- this._element.classList.remove(ClassName$a.HIDE);
-
- this._element.classList.add(ClassName$a.SHOWING);
-
- if (this._config.animation) {
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
- $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
- } else {
- complete();
- }
- };
-
- _proto.hide = function hide(withoutTimeout) {
- var _this2 = this;
-
- if (!this._element.classList.contains(ClassName$a.SHOW)) {
- return;
- }
-
- $(this._element).trigger(Event$a.HIDE);
-
- if (withoutTimeout) {
- this._close();
- } else {
- this._timeout = setTimeout(function () {
- _this2._close();
- }, this._config.delay);
- }
- };
-
- _proto.dispose = function dispose() {
- clearTimeout(this._timeout);
- this._timeout = null;
-
- if (this._element.classList.contains(ClassName$a.SHOW)) {
- this._element.classList.remove(ClassName$a.SHOW);
- }
-
- $(this._element).off(Event$a.CLICK_DISMISS);
- $.removeData(this._element, DATA_KEY$a);
- this._element = null;
- this._config = null;
- } // Private
- ;
-
- _proto._getConfig = function _getConfig(config) {
- config = _objectSpread({}, Default$7, $(this._element).data(), typeof config === 'object' && config ? config : {});
- Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
- return config;
- };
-
- _proto._setListeners = function _setListeners() {
- var _this3 = this;
-
- $(this._element).on(Event$a.CLICK_DISMISS, Selector$a.DATA_DISMISS, function () {
- return _this3.hide(true);
- });
- };
-
- _proto._close = function _close() {
- var _this4 = this;
-
- var complete = function complete() {
- _this4._element.classList.add(ClassName$a.HIDE);
-
- $(_this4._element).trigger(Event$a.HIDDEN);
- };
-
- this._element.classList.remove(ClassName$a.SHOW);
-
- if (this._config.animation) {
- var transitionDuration = Util.getTransitionDurationFromElement(this._element);
- $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
- } else {
- complete();
- }
- } // Static
- ;
-
- Toast._jQueryInterface = function _jQueryInterface(config) {
- return this.each(function () {
- var $element = $(this);
- var data = $element.data(DATA_KEY$a);
-
- var _config = typeof config === 'object' && config;
-
- if (!data) {
- data = new Toast(this, _config);
- $element.data(DATA_KEY$a, data);
- }
-
- if (typeof config === 'string') {
- if (typeof data[config] === 'undefined') {
- throw new TypeError("No method named \"" + config + "\"");
- }
-
- data[config](this);
- }
- });
- };
-
- _createClass(Toast, null, [{
- key: "VERSION",
- get: function get() {
- return VERSION$a;
- }
- }, {
- key: "DefaultType",
- get: function get() {
- return DefaultType$7;
- }
- }, {
- key: "Default",
- get: function get() {
- return Default$7;
- }
- }]);
-
- return Toast;
- }();
- /**
- * ------------------------------------------------------------------------
- * jQuery
- * ------------------------------------------------------------------------
- */
-
-
- $.fn[NAME$a] = Toast._jQueryInterface;
- $.fn[NAME$a].Constructor = Toast;
-
- $.fn[NAME$a].noConflict = function () {
- $.fn[NAME$a] = JQUERY_NO_CONFLICT$a;
- return Toast._jQueryInterface;
- };
-
- /**
- * --------------------------------------------------------------------------
- * Bootstrap (v4.3.1): index.js
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- * --------------------------------------------------------------------------
- */
-
- (function () {
- if (typeof $ === 'undefined') {
- throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
- }
-
- var version = $.fn.jquery.split(' ')[0].split('.');
- var minMajor = 1;
- var ltMajor = 2;
- var minMinor = 9;
- var minPatch = 1;
- var maxMajor = 4;
-
- if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
- throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
- }
- })();
-
- exports.Util = Util;
- exports.Alert = Alert;
- exports.Button = Button;
- exports.Carousel = Carousel;
- exports.Collapse = Collapse;
- exports.Dropdown = Dropdown;
- exports.Modal = Modal;
- exports.Popover = Popover;
- exports.Scrollspy = ScrollSpy;
- exports.Tab = Tab;
- exports.Toast = Toast;
- exports.Tooltip = Tooltip;
-
- Object.defineProperty(exports, '__esModule', { value: true });
-
- }));
- //# sourceMappingURL=bootstrap.js.map
-
-
- /***/ }),
-
- /***/ "./node_modules/buffer/index.js":
- /*!**************************************!*\
- !*** ./node_modules/buffer/index.js ***!
- \**************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {/*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh <http://feross.org>
- * @license MIT
- */
- /* eslint-disable no-proto */
-
-
-
- var base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js")
- var ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js")
- var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js")
-
- exports.Buffer = Buffer
- exports.SlowBuffer = SlowBuffer
- exports.INSPECT_MAX_BYTES = 50
-
- /**
- * If `Buffer.TYPED_ARRAY_SUPPORT`:
- * === true Use Uint8Array implementation (fastest)
- * === false Use Object implementation (most compatible, even IE6)
- *
- * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
- * Opera 11.6+, iOS 4.2+.
- *
- * Due to various browser bugs, sometimes the Object implementation will be used even
- * when the browser supports typed arrays.
- *
- * Note:
- *
- * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
- * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
- *
- * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
- *
- * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
- * incorrect length in some situations.
-
- * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
- * get the Object implementation, which is slower but behaves correctly.
- */
- Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
- ? global.TYPED_ARRAY_SUPPORT
- : typedArraySupport()
-
- /*
- * Export kMaxLength after typed array support is determined.
- */
- exports.kMaxLength = kMaxLength()
-
- function typedArraySupport () {
- try {
- var arr = new Uint8Array(1)
- arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
- return arr.foo() === 42 && // typed array instances can be augmented
- typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
- arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
- } catch (e) {
- return false
- }
- }
-
- function kMaxLength () {
- return Buffer.TYPED_ARRAY_SUPPORT
- ? 0x7fffffff
- : 0x3fffffff
- }
-
- function createBuffer (that, length) {
- if (kMaxLength() < length) {
- throw new RangeError('Invalid typed array length')
- }
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- // Return an augmented `Uint8Array` instance, for best performance
- that = new Uint8Array(length)
- that.__proto__ = Buffer.prototype
- } else {
- // Fallback: Return an object instance of the Buffer class
- if (that === null) {
- that = new Buffer(length)
- }
- that.length = length
- }
-
- return that
- }
-
- /**
- * The Buffer constructor returns instances of `Uint8Array` that have their
- * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
- * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
- * and the `Uint8Array` methods. Square bracket notation works as expected -- it
- * returns a single octet.
- *
- * The `Uint8Array` prototype remains unmodified.
- */
-
- function Buffer (arg, encodingOrOffset, length) {
- if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
- return new Buffer(arg, encodingOrOffset, length)
- }
-
- // Common case.
- if (typeof arg === 'number') {
- if (typeof encodingOrOffset === 'string') {
- throw new Error(
- 'If encoding is specified then the first argument must be a string'
- )
- }
- return allocUnsafe(this, arg)
- }
- return from(this, arg, encodingOrOffset, length)
- }
-
- Buffer.poolSize = 8192 // not used by this implementation
-
- // TODO: Legacy, not needed anymore. Remove in next major version.
- Buffer._augment = function (arr) {
- arr.__proto__ = Buffer.prototype
- return arr
- }
-
- function from (that, value, encodingOrOffset, length) {
- if (typeof value === 'number') {
- throw new TypeError('"value" argument must not be a number')
- }
-
- if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
- return fromArrayBuffer(that, value, encodingOrOffset, length)
- }
-
- if (typeof value === 'string') {
- return fromString(that, value, encodingOrOffset)
- }
-
- return fromObject(that, value)
- }
-
- /**
- * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
- * if value is a number.
- * Buffer.from(str[, encoding])
- * Buffer.from(array)
- * Buffer.from(buffer)
- * Buffer.from(arrayBuffer[, byteOffset[, length]])
- **/
- Buffer.from = function (value, encodingOrOffset, length) {
- return from(null, value, encodingOrOffset, length)
- }
-
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- Buffer.prototype.__proto__ = Uint8Array.prototype
- Buffer.__proto__ = Uint8Array
- if (typeof Symbol !== 'undefined' && Symbol.species &&
- Buffer[Symbol.species] === Buffer) {
- // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
- Object.defineProperty(Buffer, Symbol.species, {
- value: null,
- configurable: true
- })
- }
- }
-
- function assertSize (size) {
- if (typeof size !== 'number') {
- throw new TypeError('"size" argument must be a number')
- } else if (size < 0) {
- throw new RangeError('"size" argument must not be negative')
- }
- }
-
- function alloc (that, size, fill, encoding) {
- assertSize(size)
- if (size <= 0) {
- return createBuffer(that, size)
- }
- if (fill !== undefined) {
- // Only pay attention to encoding if it's a string. This
- // prevents accidentally sending in a number that would
- // be interpretted as a start offset.
- return typeof encoding === 'string'
- ? createBuffer(that, size).fill(fill, encoding)
- : createBuffer(that, size).fill(fill)
- }
- return createBuffer(that, size)
- }
-
- /**
- * Creates a new filled Buffer instance.
- * alloc(size[, fill[, encoding]])
- **/
- Buffer.alloc = function (size, fill, encoding) {
- return alloc(null, size, fill, encoding)
- }
-
- function allocUnsafe (that, size) {
- assertSize(size)
- that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
- if (!Buffer.TYPED_ARRAY_SUPPORT) {
- for (var i = 0; i < size; ++i) {
- that[i] = 0
- }
- }
- return that
- }
-
- /**
- * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
- * */
- Buffer.allocUnsafe = function (size) {
- return allocUnsafe(null, size)
- }
- /**
- * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
- */
- Buffer.allocUnsafeSlow = function (size) {
- return allocUnsafe(null, size)
- }
-
- function fromString (that, string, encoding) {
- if (typeof encoding !== 'string' || encoding === '') {
- encoding = 'utf8'
- }
-
- if (!Buffer.isEncoding(encoding)) {
- throw new TypeError('"encoding" must be a valid string encoding')
- }
-
- var length = byteLength(string, encoding) | 0
- that = createBuffer(that, length)
-
- var actual = that.write(string, encoding)
-
- if (actual !== length) {
- // Writing a hex string, for example, that contains invalid characters will
- // cause everything after the first invalid character to be ignored. (e.g.
- // 'abxxcd' will be treated as 'ab')
- that = that.slice(0, actual)
- }
-
- return that
- }
-
- function fromArrayLike (that, array) {
- var length = array.length < 0 ? 0 : checked(array.length) | 0
- that = createBuffer(that, length)
- for (var i = 0; i < length; i += 1) {
- that[i] = array[i] & 255
- }
- return that
- }
-
- function fromArrayBuffer (that, array, byteOffset, length) {
- array.byteLength // this throws if `array` is not a valid ArrayBuffer
-
- if (byteOffset < 0 || array.byteLength < byteOffset) {
- throw new RangeError('\'offset\' is out of bounds')
- }
-
- if (array.byteLength < byteOffset + (length || 0)) {
- throw new RangeError('\'length\' is out of bounds')
- }
-
- if (byteOffset === undefined && length === undefined) {
- array = new Uint8Array(array)
- } else if (length === undefined) {
- array = new Uint8Array(array, byteOffset)
- } else {
- array = new Uint8Array(array, byteOffset, length)
- }
-
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- // Return an augmented `Uint8Array` instance, for best performance
- that = array
- that.__proto__ = Buffer.prototype
- } else {
- // Fallback: Return an object instance of the Buffer class
- that = fromArrayLike(that, array)
- }
- return that
- }
-
- function fromObject (that, obj) {
- if (Buffer.isBuffer(obj)) {
- var len = checked(obj.length) | 0
- that = createBuffer(that, len)
-
- if (that.length === 0) {
- return that
- }
-
- obj.copy(that, 0, 0, len)
- return that
- }
-
- if (obj) {
- if ((typeof ArrayBuffer !== 'undefined' &&
- obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
- if (typeof obj.length !== 'number' || isnan(obj.length)) {
- return createBuffer(that, 0)
- }
- return fromArrayLike(that, obj)
- }
-
- if (obj.type === 'Buffer' && isArray(obj.data)) {
- return fromArrayLike(that, obj.data)
- }
- }
-
- throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
- }
-
- function checked (length) {
- // Note: cannot use `length < kMaxLength()` here because that fails when
- // length is NaN (which is otherwise coerced to zero.)
- if (length >= kMaxLength()) {
- throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
- 'size: 0x' + kMaxLength().toString(16) + ' bytes')
- }
- return length | 0
- }
-
- function SlowBuffer (length) {
- if (+length != length) { // eslint-disable-line eqeqeq
- length = 0
- }
- return Buffer.alloc(+length)
- }
-
- Buffer.isBuffer = function isBuffer (b) {
- return !!(b != null && b._isBuffer)
- }
-
- Buffer.compare = function compare (a, b) {
- if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
- throw new TypeError('Arguments must be Buffers')
- }
-
- if (a === b) return 0
-
- var x = a.length
- var y = b.length
-
- for (var i = 0, len = Math.min(x, y); i < len; ++i) {
- if (a[i] !== b[i]) {
- x = a[i]
- y = b[i]
- break
- }
- }
-
- if (x < y) return -1
- if (y < x) return 1
- return 0
- }
-
- Buffer.isEncoding = function isEncoding (encoding) {
- switch (String(encoding).toLowerCase()) {
- case 'hex':
- case 'utf8':
- case 'utf-8':
- case 'ascii':
- case 'latin1':
- case 'binary':
- case 'base64':
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return true
- default:
- return false
- }
- }
-
- Buffer.concat = function concat (list, length) {
- if (!isArray(list)) {
- throw new TypeError('"list" argument must be an Array of Buffers')
- }
-
- if (list.length === 0) {
- return Buffer.alloc(0)
- }
-
- var i
- if (length === undefined) {
- length = 0
- for (i = 0; i < list.length; ++i) {
- length += list[i].length
- }
- }
-
- var buffer = Buffer.allocUnsafe(length)
- var pos = 0
- for (i = 0; i < list.length; ++i) {
- var buf = list[i]
- if (!Buffer.isBuffer(buf)) {
- throw new TypeError('"list" argument must be an Array of Buffers')
- }
- buf.copy(buffer, pos)
- pos += buf.length
- }
- return buffer
- }
-
- function byteLength (string, encoding) {
- if (Buffer.isBuffer(string)) {
- return string.length
- }
- if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
- (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
- return string.byteLength
- }
- if (typeof string !== 'string') {
- string = '' + string
- }
-
- var len = string.length
- if (len === 0) return 0
-
- // Use a for loop to avoid recursion
- var loweredCase = false
- for (;;) {
- switch (encoding) {
- case 'ascii':
- case 'latin1':
- case 'binary':
- return len
- case 'utf8':
- case 'utf-8':
- case undefined:
- return utf8ToBytes(string).length
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return len * 2
- case 'hex':
- return len >>> 1
- case 'base64':
- return base64ToBytes(string).length
- default:
- if (loweredCase) return utf8ToBytes(string).length // assume utf8
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
- }
- Buffer.byteLength = byteLength
-
- function slowToString (encoding, start, end) {
- var loweredCase = false
-
- // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
- // property of a typed array.
-
- // This behaves neither like String nor Uint8Array in that we set start/end
- // to their upper/lower bounds if the value passed is out of range.
- // undefined is handled specially as per ECMA-262 6th Edition,
- // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
- if (start === undefined || start < 0) {
- start = 0
- }
- // Return early if start > this.length. Done here to prevent potential uint32
- // coercion fail below.
- if (start > this.length) {
- return ''
- }
-
- if (end === undefined || end > this.length) {
- end = this.length
- }
-
- if (end <= 0) {
- return ''
- }
-
- // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
- end >>>= 0
- start >>>= 0
-
- if (end <= start) {
- return ''
- }
-
- if (!encoding) encoding = 'utf8'
-
- while (true) {
- switch (encoding) {
- case 'hex':
- return hexSlice(this, start, end)
-
- case 'utf8':
- case 'utf-8':
- return utf8Slice(this, start, end)
-
- case 'ascii':
- return asciiSlice(this, start, end)
-
- case 'latin1':
- case 'binary':
- return latin1Slice(this, start, end)
-
- case 'base64':
- return base64Slice(this, start, end)
-
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return utf16leSlice(this, start, end)
-
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = (encoding + '').toLowerCase()
- loweredCase = true
- }
- }
- }
-
- // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
- // Buffer instances.
- Buffer.prototype._isBuffer = true
-
- function swap (b, n, m) {
- var i = b[n]
- b[n] = b[m]
- b[m] = i
- }
-
- Buffer.prototype.swap16 = function swap16 () {
- var len = this.length
- if (len % 2 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 16-bits')
- }
- for (var i = 0; i < len; i += 2) {
- swap(this, i, i + 1)
- }
- return this
- }
-
- Buffer.prototype.swap32 = function swap32 () {
- var len = this.length
- if (len % 4 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 32-bits')
- }
- for (var i = 0; i < len; i += 4) {
- swap(this, i, i + 3)
- swap(this, i + 1, i + 2)
- }
- return this
- }
-
- Buffer.prototype.swap64 = function swap64 () {
- var len = this.length
- if (len % 8 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 64-bits')
- }
- for (var i = 0; i < len; i += 8) {
- swap(this, i, i + 7)
- swap(this, i + 1, i + 6)
- swap(this, i + 2, i + 5)
- swap(this, i + 3, i + 4)
- }
- return this
- }
-
- Buffer.prototype.toString = function toString () {
- var length = this.length | 0
- if (length === 0) return ''
- if (arguments.length === 0) return utf8Slice(this, 0, length)
- return slowToString.apply(this, arguments)
- }
-
- Buffer.prototype.equals = function equals (b) {
- if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
- if (this === b) return true
- return Buffer.compare(this, b) === 0
- }
-
- Buffer.prototype.inspect = function inspect () {
- var str = ''
- var max = exports.INSPECT_MAX_BYTES
- if (this.length > 0) {
- str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
- if (this.length > max) str += ' ... '
- }
- return '<Buffer ' + str + '>'
- }
-
- Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
- if (!Buffer.isBuffer(target)) {
- throw new TypeError('Argument must be a Buffer')
- }
-
- if (start === undefined) {
- start = 0
- }
- if (end === undefined) {
- end = target ? target.length : 0
- }
- if (thisStart === undefined) {
- thisStart = 0
- }
- if (thisEnd === undefined) {
- thisEnd = this.length
- }
-
- if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
- throw new RangeError('out of range index')
- }
-
- if (thisStart >= thisEnd && start >= end) {
- return 0
- }
- if (thisStart >= thisEnd) {
- return -1
- }
- if (start >= end) {
- return 1
- }
-
- start >>>= 0
- end >>>= 0
- thisStart >>>= 0
- thisEnd >>>= 0
-
- if (this === target) return 0
-
- var x = thisEnd - thisStart
- var y = end - start
- var len = Math.min(x, y)
-
- var thisCopy = this.slice(thisStart, thisEnd)
- var targetCopy = target.slice(start, end)
-
- for (var i = 0; i < len; ++i) {
- if (thisCopy[i] !== targetCopy[i]) {
- x = thisCopy[i]
- y = targetCopy[i]
- break
- }
- }
-
- if (x < y) return -1
- if (y < x) return 1
- return 0
- }
-
- // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
- // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
- //
- // Arguments:
- // - buffer - a Buffer to search
- // - val - a string, Buffer, or number
- // - byteOffset - an index into `buffer`; will be clamped to an int32
- // - encoding - an optional encoding, relevant is val is a string
- // - dir - true for indexOf, false for lastIndexOf
- function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
- // Empty buffer means no match
- if (buffer.length === 0) return -1
-
- // Normalize byteOffset
- if (typeof byteOffset === 'string') {
- encoding = byteOffset
- byteOffset = 0
- } else if (byteOffset > 0x7fffffff) {
- byteOffset = 0x7fffffff
- } else if (byteOffset < -0x80000000) {
- byteOffset = -0x80000000
- }
- byteOffset = +byteOffset // Coerce to Number.
- if (isNaN(byteOffset)) {
- // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
- byteOffset = dir ? 0 : (buffer.length - 1)
- }
-
- // Normalize byteOffset: negative offsets start from the end of the buffer
- if (byteOffset < 0) byteOffset = buffer.length + byteOffset
- if (byteOffset >= buffer.length) {
- if (dir) return -1
- else byteOffset = buffer.length - 1
- } else if (byteOffset < 0) {
- if (dir) byteOffset = 0
- else return -1
- }
-
- // Normalize val
- if (typeof val === 'string') {
- val = Buffer.from(val, encoding)
- }
-
- // Finally, search either indexOf (if dir is true) or lastIndexOf
- if (Buffer.isBuffer(val)) {
- // Special case: looking for empty string/buffer always fails
- if (val.length === 0) {
- return -1
- }
- return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
- } else if (typeof val === 'number') {
- val = val & 0xFF // Search for a byte value [0-255]
- if (Buffer.TYPED_ARRAY_SUPPORT &&
- typeof Uint8Array.prototype.indexOf === 'function') {
- if (dir) {
- return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
- } else {
- return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
- }
- }
- return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
- }
-
- throw new TypeError('val must be string, number or Buffer')
- }
-
- function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
- var indexSize = 1
- var arrLength = arr.length
- var valLength = val.length
-
- if (encoding !== undefined) {
- encoding = String(encoding).toLowerCase()
- if (encoding === 'ucs2' || encoding === 'ucs-2' ||
- encoding === 'utf16le' || encoding === 'utf-16le') {
- if (arr.length < 2 || val.length < 2) {
- return -1
- }
- indexSize = 2
- arrLength /= 2
- valLength /= 2
- byteOffset /= 2
- }
- }
-
- function read (buf, i) {
- if (indexSize === 1) {
- return buf[i]
- } else {
- return buf.readUInt16BE(i * indexSize)
- }
- }
-
- var i
- if (dir) {
- var foundIndex = -1
- for (i = byteOffset; i < arrLength; i++) {
- if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
- if (foundIndex === -1) foundIndex = i
- if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
- } else {
- if (foundIndex !== -1) i -= i - foundIndex
- foundIndex = -1
- }
- }
- } else {
- if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
- for (i = byteOffset; i >= 0; i--) {
- var found = true
- for (var j = 0; j < valLength; j++) {
- if (read(arr, i + j) !== read(val, j)) {
- found = false
- break
- }
- }
- if (found) return i
- }
- }
-
- return -1
- }
-
- Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
- return this.indexOf(val, byteOffset, encoding) !== -1
- }
-
- Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
- }
-
- Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
- }
-
- function hexWrite (buf, string, offset, length) {
- offset = Number(offset) || 0
- var remaining = buf.length - offset
- if (!length) {
- length = remaining
- } else {
- length = Number(length)
- if (length > remaining) {
- length = remaining
- }
- }
-
- // must be an even number of digits
- var strLen = string.length
- if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
-
- if (length > strLen / 2) {
- length = strLen / 2
- }
- for (var i = 0; i < length; ++i) {
- var parsed = parseInt(string.substr(i * 2, 2), 16)
- if (isNaN(parsed)) return i
- buf[offset + i] = parsed
- }
- return i
- }
-
- function utf8Write (buf, string, offset, length) {
- return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
- }
-
- function asciiWrite (buf, string, offset, length) {
- return blitBuffer(asciiToBytes(string), buf, offset, length)
- }
-
- function latin1Write (buf, string, offset, length) {
- return asciiWrite(buf, string, offset, length)
- }
-
- function base64Write (buf, string, offset, length) {
- return blitBuffer(base64ToBytes(string), buf, offset, length)
- }
-
- function ucs2Write (buf, string, offset, length) {
- return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
- }
-
- Buffer.prototype.write = function write (string, offset, length, encoding) {
- // Buffer#write(string)
- if (offset === undefined) {
- encoding = 'utf8'
- length = this.length
- offset = 0
- // Buffer#write(string, encoding)
- } else if (length === undefined && typeof offset === 'string') {
- encoding = offset
- length = this.length
- offset = 0
- // Buffer#write(string, offset[, length][, encoding])
- } else if (isFinite(offset)) {
- offset = offset | 0
- if (isFinite(length)) {
- length = length | 0
- if (encoding === undefined) encoding = 'utf8'
- } else {
- encoding = length
- length = undefined
- }
- // legacy write(string, encoding, offset, length) - remove in v0.13
- } else {
- throw new Error(
- 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
- )
- }
-
- var remaining = this.length - offset
- if (length === undefined || length > remaining) length = remaining
-
- if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
- throw new RangeError('Attempt to write outside buffer bounds')
- }
-
- if (!encoding) encoding = 'utf8'
-
- var loweredCase = false
- for (;;) {
- switch (encoding) {
- case 'hex':
- return hexWrite(this, string, offset, length)
-
- case 'utf8':
- case 'utf-8':
- return utf8Write(this, string, offset, length)
-
- case 'ascii':
- return asciiWrite(this, string, offset, length)
-
- case 'latin1':
- case 'binary':
- return latin1Write(this, string, offset, length)
-
- case 'base64':
- // Warning: maxLength not taken into account in base64Write
- return base64Write(this, string, offset, length)
-
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return ucs2Write(this, string, offset, length)
-
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
- }
-
- Buffer.prototype.toJSON = function toJSON () {
- return {
- type: 'Buffer',
- data: Array.prototype.slice.call(this._arr || this, 0)
- }
- }
-
- function base64Slice (buf, start, end) {
- if (start === 0 && end === buf.length) {
- return base64.fromByteArray(buf)
- } else {
- return base64.fromByteArray(buf.slice(start, end))
- }
- }
-
- function utf8Slice (buf, start, end) {
- end = Math.min(buf.length, end)
- var res = []
-
- var i = start
- while (i < end) {
- var firstByte = buf[i]
- var codePoint = null
- var bytesPerSequence = (firstByte > 0xEF) ? 4
- : (firstByte > 0xDF) ? 3
- : (firstByte > 0xBF) ? 2
- : 1
-
- if (i + bytesPerSequence <= end) {
- var secondByte, thirdByte, fourthByte, tempCodePoint
-
- switch (bytesPerSequence) {
- case 1:
- if (firstByte < 0x80) {
- codePoint = firstByte
- }
- break
- case 2:
- secondByte = buf[i + 1]
- if ((secondByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
- if (tempCodePoint > 0x7F) {
- codePoint = tempCodePoint
- }
- }
- break
- case 3:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
- if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
- codePoint = tempCodePoint
- }
- }
- break
- case 4:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- fourthByte = buf[i + 3]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
- if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
- codePoint = tempCodePoint
- }
- }
- }
- }
-
- if (codePoint === null) {
- // we did not generate a valid codePoint so insert a
- // replacement char (U+FFFD) and advance only 1 byte
- codePoint = 0xFFFD
- bytesPerSequence = 1
- } else if (codePoint > 0xFFFF) {
- // encode to utf16 (surrogate pair dance)
- codePoint -= 0x10000
- res.push(codePoint >>> 10 & 0x3FF | 0xD800)
- codePoint = 0xDC00 | codePoint & 0x3FF
- }
-
- res.push(codePoint)
- i += bytesPerSequence
- }
-
- return decodeCodePointsArray(res)
- }
-
- // Based on http://stackoverflow.com/a/22747272/680742, the browser with
- // the lowest limit is Chrome, with 0x10000 args.
- // We go 1 magnitude less, for safety
- var MAX_ARGUMENTS_LENGTH = 0x1000
-
- function decodeCodePointsArray (codePoints) {
- var len = codePoints.length
- if (len <= MAX_ARGUMENTS_LENGTH) {
- return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
- }
-
- // Decode in chunks to avoid "call stack size exceeded".
- var res = ''
- var i = 0
- while (i < len) {
- res += String.fromCharCode.apply(
- String,
- codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
- )
- }
- return res
- }
-
- function asciiSlice (buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
-
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i] & 0x7F)
- }
- return ret
- }
-
- function latin1Slice (buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
-
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i])
- }
- return ret
- }
-
- function hexSlice (buf, start, end) {
- var len = buf.length
-
- if (!start || start < 0) start = 0
- if (!end || end < 0 || end > len) end = len
-
- var out = ''
- for (var i = start; i < end; ++i) {
- out += toHex(buf[i])
- }
- return out
- }
-
- function utf16leSlice (buf, start, end) {
- var bytes = buf.slice(start, end)
- var res = ''
- for (var i = 0; i < bytes.length; i += 2) {
- res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
- }
- return res
- }
-
- Buffer.prototype.slice = function slice (start, end) {
- var len = this.length
- start = ~~start
- end = end === undefined ? len : ~~end
-
- if (start < 0) {
- start += len
- if (start < 0) start = 0
- } else if (start > len) {
- start = len
- }
-
- if (end < 0) {
- end += len
- if (end < 0) end = 0
- } else if (end > len) {
- end = len
- }
-
- if (end < start) end = start
-
- var newBuf
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- newBuf = this.subarray(start, end)
- newBuf.__proto__ = Buffer.prototype
- } else {
- var sliceLen = end - start
- newBuf = new Buffer(sliceLen, undefined)
- for (var i = 0; i < sliceLen; ++i) {
- newBuf[i] = this[i + start]
- }
- }
-
- return newBuf
- }
-
- /*
- * Need to make sure that buffer isn't trying to write out of bounds.
- */
- function checkOffset (offset, ext, length) {
- if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
- if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
- }
-
- Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
-
- return val
- }
-
- Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) {
- checkOffset(offset, byteLength, this.length)
- }
-
- var val = this[offset + --byteLength]
- var mul = 1
- while (byteLength > 0 && (mul *= 0x100)) {
- val += this[offset + --byteLength] * mul
- }
-
- return val
- }
-
- Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 1, this.length)
- return this[offset]
- }
-
- Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- return this[offset] | (this[offset + 1] << 8)
- }
-
- Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- return (this[offset] << 8) | this[offset + 1]
- }
-
- Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return ((this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16)) +
- (this[offset + 3] * 0x1000000)
- }
-
- Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset] * 0x1000000) +
- ((this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- this[offset + 3])
- }
-
- Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
- mul *= 0x80
-
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
-
- return val
- }
-
- Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var i = byteLength
- var mul = 1
- var val = this[offset + --i]
- while (i > 0 && (mul *= 0x100)) {
- val += this[offset + --i] * mul
- }
- mul *= 0x80
-
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
-
- return val
- }
-
- Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 1, this.length)
- if (!(this[offset] & 0x80)) return (this[offset])
- return ((0xff - this[offset] + 1) * -1)
- }
-
- Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset] | (this[offset + 1] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
- }
-
- Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset + 1] | (this[offset] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
- }
-
- Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16) |
- (this[offset + 3] << 24)
- }
-
- Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset] << 24) |
- (this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- (this[offset + 3])
- }
-
- Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, true, 23, 4)
- }
-
- Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, false, 23, 4)
- }
-
- Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, true, 52, 8)
- }
-
- Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, false, 52, 8)
- }
-
- function checkInt (buf, value, offset, ext, max, min) {
- if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
- if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
- if (offset + ext > buf.length) throw new RangeError('Index out of range')
- }
-
- Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength) - 1
- checkInt(this, value, offset, byteLength, maxBytes, 0)
- }
-
- var mul = 1
- var i = 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
-
- return offset + byteLength
- }
-
- Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength) - 1
- checkInt(this, value, offset, byteLength, maxBytes, 0)
- }
-
- var i = byteLength - 1
- var mul = 1
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
-
- return offset + byteLength
- }
-
- Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
- if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
- this[offset] = (value & 0xff)
- return offset + 1
- }
-
- function objectWriteUInt16 (buf, value, offset, littleEndian) {
- if (value < 0) value = 0xffff + value + 1
- for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
- buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
- (littleEndian ? i : 1 - i) * 8
- }
- }
-
- Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- } else {
- objectWriteUInt16(this, value, offset, true)
- }
- return offset + 2
- }
-
- Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- } else {
- objectWriteUInt16(this, value, offset, false)
- }
- return offset + 2
- }
-
- function objectWriteUInt32 (buf, value, offset, littleEndian) {
- if (value < 0) value = 0xffffffff + value + 1
- for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
- buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
- }
- }
-
- Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset + 3] = (value >>> 24)
- this[offset + 2] = (value >>> 16)
- this[offset + 1] = (value >>> 8)
- this[offset] = (value & 0xff)
- } else {
- objectWriteUInt32(this, value, offset, true)
- }
- return offset + 4
- }
-
- Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- } else {
- objectWriteUInt32(this, value, offset, false)
- }
- return offset + 4
- }
-
- Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) {
- var limit = Math.pow(2, 8 * byteLength - 1)
-
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
-
- var i = 0
- var mul = 1
- var sub = 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
- sub = 1
- }
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
-
- return offset + byteLength
- }
-
- Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) {
- var limit = Math.pow(2, 8 * byteLength - 1)
-
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
-
- var i = byteLength - 1
- var mul = 1
- var sub = 0
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
- sub = 1
- }
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
-
- return offset + byteLength
- }
-
- Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
- if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
- if (value < 0) value = 0xff + value + 1
- this[offset] = (value & 0xff)
- return offset + 1
- }
-
- Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- } else {
- objectWriteUInt16(this, value, offset, true)
- }
- return offset + 2
- }
-
- Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- } else {
- objectWriteUInt16(this, value, offset, false)
- }
- return offset + 2
- }
-
- Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- this[offset + 2] = (value >>> 16)
- this[offset + 3] = (value >>> 24)
- } else {
- objectWriteUInt32(this, value, offset, true)
- }
- return offset + 4
- }
-
- Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- if (value < 0) value = 0xffffffff + value + 1
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- } else {
- objectWriteUInt32(this, value, offset, false)
- }
- return offset + 4
- }
-
- function checkIEEE754 (buf, value, offset, ext, max, min) {
- if (offset + ext > buf.length) throw new RangeError('Index out of range')
- if (offset < 0) throw new RangeError('Index out of range')
- }
-
- function writeFloat (buf, value, offset, littleEndian, noAssert) {
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
- }
- ieee754.write(buf, value, offset, littleEndian, 23, 4)
- return offset + 4
- }
-
- Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
- return writeFloat(this, value, offset, true, noAssert)
- }
-
- Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
- return writeFloat(this, value, offset, false, noAssert)
- }
-
- function writeDouble (buf, value, offset, littleEndian, noAssert) {
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
- }
- ieee754.write(buf, value, offset, littleEndian, 52, 8)
- return offset + 8
- }
-
- Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
- return writeDouble(this, value, offset, true, noAssert)
- }
-
- Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
- return writeDouble(this, value, offset, false, noAssert)
- }
-
- // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
- Buffer.prototype.copy = function copy (target, targetStart, start, end) {
- if (!start) start = 0
- if (!end && end !== 0) end = this.length
- if (targetStart >= target.length) targetStart = target.length
- if (!targetStart) targetStart = 0
- if (end > 0 && end < start) end = start
-
- // Copy 0 bytes; we're done
- if (end === start) return 0
- if (target.length === 0 || this.length === 0) return 0
-
- // Fatal error conditions
- if (targetStart < 0) {
- throw new RangeError('targetStart out of bounds')
- }
- if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
- if (end < 0) throw new RangeError('sourceEnd out of bounds')
-
- // Are we oob?
- if (end > this.length) end = this.length
- if (target.length - targetStart < end - start) {
- end = target.length - targetStart + start
- }
-
- var len = end - start
- var i
-
- if (this === target && start < targetStart && targetStart < end) {
- // descending copy from end
- for (i = len - 1; i >= 0; --i) {
- target[i + targetStart] = this[i + start]
- }
- } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
- // ascending copy from start
- for (i = 0; i < len; ++i) {
- target[i + targetStart] = this[i + start]
- }
- } else {
- Uint8Array.prototype.set.call(
- target,
- this.subarray(start, start + len),
- targetStart
- )
- }
-
- return len
- }
-
- // Usage:
- // buffer.fill(number[, offset[, end]])
- // buffer.fill(buffer[, offset[, end]])
- // buffer.fill(string[, offset[, end]][, encoding])
- Buffer.prototype.fill = function fill (val, start, end, encoding) {
- // Handle string cases:
- if (typeof val === 'string') {
- if (typeof start === 'string') {
- encoding = start
- start = 0
- end = this.length
- } else if (typeof end === 'string') {
- encoding = end
- end = this.length
- }
- if (val.length === 1) {
- var code = val.charCodeAt(0)
- if (code < 256) {
- val = code
- }
- }
- if (encoding !== undefined && typeof encoding !== 'string') {
- throw new TypeError('encoding must be a string')
- }
- if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
- throw new TypeError('Unknown encoding: ' + encoding)
- }
- } else if (typeof val === 'number') {
- val = val & 255
- }
-
- // Invalid ranges are not set to a default, so can range check early.
- if (start < 0 || this.length < start || this.length < end) {
- throw new RangeError('Out of range index')
- }
-
- if (end <= start) {
- return this
- }
-
- start = start >>> 0
- end = end === undefined ? this.length : end >>> 0
-
- if (!val) val = 0
-
- var i
- if (typeof val === 'number') {
- for (i = start; i < end; ++i) {
- this[i] = val
- }
- } else {
- var bytes = Buffer.isBuffer(val)
- ? val
- : utf8ToBytes(new Buffer(val, encoding).toString())
- var len = bytes.length
- for (i = 0; i < end - start; ++i) {
- this[i + start] = bytes[i % len]
- }
- }
-
- return this
- }
-
- // HELPER FUNCTIONS
- // ================
-
- var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
-
- function base64clean (str) {
- // Node strips out invalid characters like \n and \t from the string, base64-js does not
- str = stringtrim(str).replace(INVALID_BASE64_RE, '')
- // Node converts strings with length < 2 to ''
- if (str.length < 2) return ''
- // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
- while (str.length % 4 !== 0) {
- str = str + '='
- }
- return str
- }
-
- function stringtrim (str) {
- if (str.trim) return str.trim()
- return str.replace(/^\s+|\s+$/g, '')
- }
-
- function toHex (n) {
- if (n < 16) return '0' + n.toString(16)
- return n.toString(16)
- }
-
- function utf8ToBytes (string, units) {
- units = units || Infinity
- var codePoint
- var length = string.length
- var leadSurrogate = null
- var bytes = []
-
- for (var i = 0; i < length; ++i) {
- codePoint = string.charCodeAt(i)
-
- // is surrogate component
- if (codePoint > 0xD7FF && codePoint < 0xE000) {
- // last char was a lead
- if (!leadSurrogate) {
- // no lead yet
- if (codePoint > 0xDBFF) {
- // unexpected trail
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- } else if (i + 1 === length) {
- // unpaired lead
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- }
-
- // valid lead
- leadSurrogate = codePoint
-
- continue
- }
-
- // 2 leads in a row
- if (codePoint < 0xDC00) {
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- leadSurrogate = codePoint
- continue
- }
-
- // valid surrogate pair
- codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
- } else if (leadSurrogate) {
- // valid bmp char, but last char was a lead
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- }
-
- leadSurrogate = null
-
- // encode utf8
- if (codePoint < 0x80) {
- if ((units -= 1) < 0) break
- bytes.push(codePoint)
- } else if (codePoint < 0x800) {
- if ((units -= 2) < 0) break
- bytes.push(
- codePoint >> 0x6 | 0xC0,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x10000) {
- if ((units -= 3) < 0) break
- bytes.push(
- codePoint >> 0xC | 0xE0,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x110000) {
- if ((units -= 4) < 0) break
- bytes.push(
- codePoint >> 0x12 | 0xF0,
- codePoint >> 0xC & 0x3F | 0x80,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else {
- throw new Error('Invalid code point')
- }
- }
-
- return bytes
- }
-
- function asciiToBytes (str) {
- var byteArray = []
- for (var i = 0; i < str.length; ++i) {
- // Node's code seems to be doing this and not & 0x7F..
- byteArray.push(str.charCodeAt(i) & 0xFF)
- }
- return byteArray
- }
-
- function utf16leToBytes (str, units) {
- var c, hi, lo
- var byteArray = []
- for (var i = 0; i < str.length; ++i) {
- if ((units -= 2) < 0) break
-
- c = str.charCodeAt(i)
- hi = c >> 8
- lo = c % 256
- byteArray.push(lo)
- byteArray.push(hi)
- }
-
- return byteArray
- }
-
- function base64ToBytes (str) {
- return base64.toByteArray(base64clean(str))
- }
-
- function blitBuffer (src, dst, offset, length) {
- for (var i = 0; i < length; ++i) {
- if ((i + offset >= dst.length) || (i >= src.length)) break
- dst[i + offset] = src[i]
- }
- return i
- }
-
- function isnan (val) {
- return val !== val // eslint-disable-line no-self-compare
- }
-
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
-
- /***/ }),
-
- /***/ "./node_modules/classnames/index.js":
- /*!******************************************!*\
- !*** ./node_modules/classnames/index.js ***!
- \******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
- Copyright (c) 2017 Jed Watson.
- Licensed under the MIT License (MIT), see
- http://jedwatson.github.io/classnames
- */
- /* global define */
-
- (function () {
- 'use strict';
-
- var hasOwn = {}.hasOwnProperty;
-
- function classNames () {
- var classes = [];
-
- for (var i = 0; i < arguments.length; i++) {
- var arg = arguments[i];
- if (!arg) continue;
-
- var argType = typeof arg;
-
- if (argType === 'string' || argType === 'number') {
- classes.push(arg);
- } else if (Array.isArray(arg) && arg.length) {
- var inner = classNames.apply(null, arg);
- if (inner) {
- classes.push(inner);
- }
- } else if (argType === 'object') {
- for (var key in arg) {
- if (hasOwn.call(arg, key) && arg[key]) {
- classes.push(key);
- }
- }
- }
- }
-
- return classes.join(' ');
- }
-
- if ( true && module.exports) {
- classNames.default = classNames;
- module.exports = classNames;
- } else if (true) {
- // register as 'classnames', consistent with npm package name
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
- return classNames;
- }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
- }());
-
-
- /***/ }),
-
- /***/ "./node_modules/create-react-context/lib/implementation.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/create-react-context/lib/implementation.js ***!
- \*****************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
-
- var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js");
-
- var _react2 = _interopRequireDefault(_react);
-
- var _propTypes = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
-
- var _propTypes2 = _interopRequireDefault(_propTypes);
-
- var _gud = __webpack_require__(/*! gud */ "./node_modules/gud/index.js");
-
- var _gud2 = _interopRequireDefault(_gud);
-
- var _warning = __webpack_require__(/*! warning */ "./node_modules/warning/warning.js");
-
- var _warning2 = _interopRequireDefault(_warning);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
- 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; }
-
- 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; }
-
- var MAX_SIGNED_31_BIT_INT = 1073741823;
-
- // Inlined Object.is polyfill.
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
- function objectIs(x, y) {
- if (x === y) {
- return x !== 0 || 1 / x === 1 / y;
- } else {
- return x !== x && y !== y;
- }
- }
-
- function createEventEmitter(value) {
- var handlers = [];
- return {
- on: function on(handler) {
- handlers.push(handler);
- },
- off: function off(handler) {
- handlers = handlers.filter(function (h) {
- return h !== handler;
- });
- },
- get: function get() {
- return value;
- },
- set: function set(newValue, changedBits) {
- value = newValue;
- handlers.forEach(function (handler) {
- return handler(value, changedBits);
- });
- }
- };
- }
-
- function onlyChild(children) {
- return Array.isArray(children) ? children[0] : children;
- }
-
- function createReactContext(defaultValue, calculateChangedBits) {
- var _Provider$childContex, _Consumer$contextType;
-
- var contextProp = '__create-react-context-' + (0, _gud2.default)() + '__';
-
- var Provider = function (_Component) {
- _inherits(Provider, _Component);
-
- function Provider() {
- var _temp, _this, _ret;
-
- _classCallCheck(this, Provider);
-
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.emitter = createEventEmitter(_this.props.value), _temp), _possibleConstructorReturn(_this, _ret);
- }
-
- Provider.prototype.getChildContext = function getChildContext() {
- var _ref;
-
- return _ref = {}, _ref[contextProp] = this.emitter, _ref;
- };
-
- Provider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
- if (this.props.value !== nextProps.value) {
- var oldValue = this.props.value;
- var newValue = nextProps.value;
- var changedBits = void 0;
-
- if (objectIs(oldValue, newValue)) {
- changedBits = 0; // No change
- } else {
- changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
- if (true) {
- (0, _warning2.default)((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits);
- }
-
- changedBits |= 0;
-
- if (changedBits !== 0) {
- this.emitter.set(nextProps.value, changedBits);
- }
- }
- }
- };
-
- Provider.prototype.render = function render() {
- return this.props.children;
- };
-
- return Provider;
- }(_react.Component);
-
- Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = _propTypes2.default.object.isRequired, _Provider$childContex);
-
- var Consumer = function (_Component2) {
- _inherits(Consumer, _Component2);
-
- function Consumer() {
- var _temp2, _this2, _ret2;
-
- _classCallCheck(this, Consumer);
-
- for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
-
- return _ret2 = (_temp2 = (_this2 = _possibleConstructorReturn(this, _Component2.call.apply(_Component2, [this].concat(args))), _this2), _this2.state = {
- value: _this2.getValue()
- }, _this2.onUpdate = function (newValue, changedBits) {
- var observedBits = _this2.observedBits | 0;
- if ((observedBits & changedBits) !== 0) {
- _this2.setState({ value: _this2.getValue() });
- }
- }, _temp2), _possibleConstructorReturn(_this2, _ret2);
- }
-
- Consumer.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
- var observedBits = nextProps.observedBits;
-
- this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
- : observedBits;
- };
-
- Consumer.prototype.componentDidMount = function componentDidMount() {
- if (this.context[contextProp]) {
- this.context[contextProp].on(this.onUpdate);
- }
- var observedBits = this.props.observedBits;
-
- this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
- : observedBits;
- };
-
- Consumer.prototype.componentWillUnmount = function componentWillUnmount() {
- if (this.context[contextProp]) {
- this.context[contextProp].off(this.onUpdate);
- }
- };
-
- Consumer.prototype.getValue = function getValue() {
- if (this.context[contextProp]) {
- return this.context[contextProp].get();
- } else {
- return defaultValue;
- }
- };
-
- Consumer.prototype.render = function render() {
- return onlyChild(this.props.children)(this.state.value);
- };
-
- return Consumer;
- }(_react.Component);
-
- Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = _propTypes2.default.object, _Consumer$contextType);
-
-
- return {
- Provider: Provider,
- Consumer: Consumer
- };
- }
-
- exports.default = createReactContext;
- module.exports = exports['default'];
-
- /***/ }),
-
- /***/ "./node_modules/create-react-context/lib/index.js":
- /*!********************************************************!*\
- !*** ./node_modules/create-react-context/lib/index.js ***!
- \********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
-
- var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js");
-
- var _react2 = _interopRequireDefault(_react);
-
- var _implementation = __webpack_require__(/*! ./implementation */ "./node_modules/create-react-context/lib/implementation.js");
-
- var _implementation2 = _interopRequireDefault(_implementation);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- exports.default = _react2.default.createContext || _implementation2.default;
- module.exports = exports['default'];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/activeElement.js":
- /*!***************************************************!*\
- !*** ./node_modules/dom-helpers/activeElement.js ***!
- \***************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
- exports.__esModule = true;
- exports.default = activeElement;
-
- var _ownerDocument = _interopRequireDefault(__webpack_require__(/*! ./ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js"));
-
- function activeElement(doc) {
- if (doc === void 0) {
- doc = (0, _ownerDocument.default)();
- }
-
- try {
- return doc.activeElement;
- } catch (e) {
- /* ie throws if no active element */
- }
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/class/addClass.js":
- /*!****************************************************!*\
- !*** ./node_modules/dom-helpers/class/addClass.js ***!
- \****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
- exports.__esModule = true;
- exports.default = addClass;
-
- var _hasClass = _interopRequireDefault(__webpack_require__(/*! ./hasClass */ "./node_modules/dom-helpers/class/hasClass.js"));
-
- function addClass(element, className) {
- if (element.classList) element.classList.add(className);else if (!(0, _hasClass.default)(element, className)) if (typeof element.className === 'string') element.className = element.className + ' ' + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + ' ' + className);
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/class/hasClass.js":
- /*!****************************************************!*\
- !*** ./node_modules/dom-helpers/class/hasClass.js ***!
- \****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = hasClass;
-
- function hasClass(element, className) {
- if (element.classList) return !!className && element.classList.contains(className);else return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1;
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/class/index.js":
- /*!*************************************************!*\
- !*** ./node_modules/dom-helpers/class/index.js ***!
- \*************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _addClass = _interopRequireDefault(__webpack_require__(/*! ./addClass */ "./node_modules/dom-helpers/class/addClass.js"));
-
- exports.addClass = _addClass.default;
-
- var _removeClass = _interopRequireDefault(__webpack_require__(/*! ./removeClass */ "./node_modules/dom-helpers/class/removeClass.js"));
-
- exports.removeClass = _removeClass.default;
-
- var _hasClass = _interopRequireDefault(__webpack_require__(/*! ./hasClass */ "./node_modules/dom-helpers/class/hasClass.js"));
-
- exports.hasClass = _hasClass.default;
- var _default = {
- addClass: _addClass.default,
- removeClass: _removeClass.default,
- hasClass: _hasClass.default
- };
- exports.default = _default;
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/class/removeClass.js":
- /*!*******************************************************!*\
- !*** ./node_modules/dom-helpers/class/removeClass.js ***!
- \*******************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- function replaceClassName(origClass, classToRemove) {
- return origClass.replace(new RegExp('(^|\\s)' + classToRemove + '(?:\\s|$)', 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, '');
- }
-
- module.exports = function removeClass(element, className) {
- if (element.classList) element.classList.remove(className);else if (typeof element.className === 'string') element.className = replaceClassName(element.className, className);else element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));
- };
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/events/filter.js":
- /*!***************************************************!*\
- !*** ./node_modules/dom-helpers/events/filter.js ***!
- \***************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
- exports.__esModule = true;
- exports.default = filterEvents;
-
- var _contains = _interopRequireDefault(__webpack_require__(/*! ../query/contains */ "./node_modules/dom-helpers/query/contains.js"));
-
- var _querySelectorAll = _interopRequireDefault(__webpack_require__(/*! ../query/querySelectorAll */ "./node_modules/dom-helpers/query/querySelectorAll.js"));
-
- function filterEvents(selector, handler) {
- return function filterHandler(e) {
- var top = e.currentTarget,
- target = e.target,
- matches = (0, _querySelectorAll.default)(top, selector);
- if (matches.some(function (match) {
- return (0, _contains.default)(match, target);
- })) handler.call(this, e);
- };
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/events/index.js":
- /*!**************************************************!*\
- !*** ./node_modules/dom-helpers/events/index.js ***!
- \**************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _on = _interopRequireDefault(__webpack_require__(/*! ./on */ "./node_modules/dom-helpers/events/on.js"));
-
- exports.on = _on.default;
-
- var _off = _interopRequireDefault(__webpack_require__(/*! ./off */ "./node_modules/dom-helpers/events/off.js"));
-
- exports.off = _off.default;
-
- var _filter = _interopRequireDefault(__webpack_require__(/*! ./filter */ "./node_modules/dom-helpers/events/filter.js"));
-
- exports.filter = _filter.default;
-
- var _listen = _interopRequireDefault(__webpack_require__(/*! ./listen */ "./node_modules/dom-helpers/events/listen.js"));
-
- exports.listen = _listen.default;
- var _default = {
- on: _on.default,
- off: _off.default,
- filter: _filter.default,
- listen: _listen.default
- };
- exports.default = _default;
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/events/listen.js":
- /*!***************************************************!*\
- !*** ./node_modules/dom-helpers/events/listen.js ***!
- \***************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _inDOM = _interopRequireDefault(__webpack_require__(/*! ../util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"));
-
- var _on = _interopRequireDefault(__webpack_require__(/*! ./on */ "./node_modules/dom-helpers/events/on.js"));
-
- var _off = _interopRequireDefault(__webpack_require__(/*! ./off */ "./node_modules/dom-helpers/events/off.js"));
-
- var listen = function listen() {};
-
- if (_inDOM.default) {
- listen = function listen(node, eventName, handler, capture) {
- (0, _on.default)(node, eventName, handler, capture);
- return function () {
- (0, _off.default)(node, eventName, handler, capture);
- };
- };
- }
-
- var _default = listen;
- exports.default = _default;
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/events/off.js":
- /*!************************************************!*\
- !*** ./node_modules/dom-helpers/events/off.js ***!
- \************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _inDOM = _interopRequireDefault(__webpack_require__(/*! ../util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"));
-
- var off = function off() {};
-
- if (_inDOM.default) {
- off = function () {
- if (document.addEventListener) return function (node, eventName, handler, capture) {
- return node.removeEventListener(eventName, handler, capture || false);
- };else if (document.attachEvent) return function (node, eventName, handler) {
- return node.detachEvent('on' + eventName, handler);
- };
- }();
- }
-
- var _default = off;
- exports.default = _default;
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/events/on.js":
- /*!***********************************************!*\
- !*** ./node_modules/dom-helpers/events/on.js ***!
- \***********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _inDOM = _interopRequireDefault(__webpack_require__(/*! ../util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"));
-
- var on = function on() {};
-
- if (_inDOM.default) {
- on = function () {
- if (document.addEventListener) return function (node, eventName, handler, capture) {
- return node.addEventListener(eventName, handler, capture || false);
- };else if (document.attachEvent) return function (node, eventName, handler) {
- return node.attachEvent('on' + eventName, function (e) {
- e = e || window.event;
- e.target = e.target || e.srcElement;
- e.currentTarget = node;
- handler.call(node, e);
- });
- };
- }();
- }
-
- var _default = on;
- exports.default = _default;
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/ownerDocument.js":
- /*!***************************************************!*\
- !*** ./node_modules/dom-helpers/ownerDocument.js ***!
- \***************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = ownerDocument;
-
- function ownerDocument(node) {
- return node && node.ownerDocument || document;
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/query/contains.js":
- /*!****************************************************!*\
- !*** ./node_modules/dom-helpers/query/contains.js ***!
- \****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _inDOM = _interopRequireDefault(__webpack_require__(/*! ../util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"));
-
- var _default = function () {
- // HTML DOM and SVG DOM may have different support levels,
- // so we need to check on context instead of a document root element.
- return _inDOM.default ? function (context, node) {
- if (context.contains) {
- return context.contains(node);
- } else if (context.compareDocumentPosition) {
- return context === node || !!(context.compareDocumentPosition(node) & 16);
- } else {
- return fallback(context, node);
- }
- } : fallback;
- }();
-
- exports.default = _default;
-
- function fallback(context, node) {
- if (node) do {
- if (node === context) return true;
- } while (node = node.parentNode);
- return false;
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/query/isWindow.js":
- /*!****************************************************!*\
- !*** ./node_modules/dom-helpers/query/isWindow.js ***!
- \****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = getWindow;
-
- function getWindow(node) {
- return node === node.window ? node : node.nodeType === 9 ? node.defaultView || node.parentWindow : false;
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/query/matches.js":
- /*!***************************************************!*\
- !*** ./node_modules/dom-helpers/query/matches.js ***!
- \***************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
- exports.__esModule = true;
- exports.default = matches;
-
- var _inDOM = _interopRequireDefault(__webpack_require__(/*! ../util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"));
-
- var _querySelectorAll = _interopRequireDefault(__webpack_require__(/*! ./querySelectorAll */ "./node_modules/dom-helpers/query/querySelectorAll.js"));
-
- var matchesCache;
-
- function matches(node, selector) {
- if (!matchesCache && _inDOM.default) {
- var body = document.body;
- var nativeMatch = body.matches || body.matchesSelector || body.webkitMatchesSelector || body.mozMatchesSelector || body.msMatchesSelector;
- matchesCache = nativeMatch ? function (node, selector) {
- return nativeMatch.call(node, selector);
- } : ie8MatchesSelector;
- }
-
- return matchesCache ? matchesCache(node, selector) : null;
- }
-
- function ie8MatchesSelector(node, selector) {
- var matches = (0, _querySelectorAll.default)(node.document || node.ownerDocument, selector),
- i = 0;
-
- while (matches[i] && matches[i] !== node) {
- i++;
- }
-
- return !!matches[i];
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/query/querySelectorAll.js":
- /*!************************************************************!*\
- !*** ./node_modules/dom-helpers/query/querySelectorAll.js ***!
- \************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = qsa;
- // Zepto.js
- // (c) 2010-2015 Thomas Fuchs
- // Zepto.js may be freely distributed under the MIT license.
- var simpleSelectorRE = /^[\w-]*$/;
- var toArray = Function.prototype.bind.call(Function.prototype.call, [].slice);
-
- function qsa(element, selector) {
- var maybeID = selector[0] === '#',
- maybeClass = selector[0] === '.',
- nameOnly = maybeID || maybeClass ? selector.slice(1) : selector,
- isSimple = simpleSelectorRE.test(nameOnly),
- found;
-
- if (isSimple) {
- if (maybeID) {
- element = element.getElementById ? element : document;
- return (found = element.getElementById(nameOnly)) ? [found] : [];
- }
-
- if (element.getElementsByClassName && maybeClass) return toArray(element.getElementsByClassName(nameOnly));
- return toArray(element.getElementsByTagName(selector));
- }
-
- return toArray(element.querySelectorAll(selector));
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/style/getComputedStyle.js":
- /*!************************************************************!*\
- !*** ./node_modules/dom-helpers/style/getComputedStyle.js ***!
- \************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
- exports.__esModule = true;
- exports.default = _getComputedStyle;
-
- var _camelizeStyle = _interopRequireDefault(__webpack_require__(/*! ../util/camelizeStyle */ "./node_modules/dom-helpers/util/camelizeStyle.js"));
-
- var rposition = /^(top|right|bottom|left)$/;
- var rnumnonpx = /^([+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/i;
-
- function _getComputedStyle(node) {
- if (!node) throw new TypeError('No Element passed to `getComputedStyle()`');
- var doc = node.ownerDocument;
- return 'defaultView' in doc ? doc.defaultView.opener ? node.ownerDocument.defaultView.getComputedStyle(node, null) : window.getComputedStyle(node, null) : {
- //ie 8 "magic" from: https://github.com/jquery/jquery/blob/1.11-stable/src/css/curCSS.js#L72
- getPropertyValue: function getPropertyValue(prop) {
- var style = node.style;
- prop = (0, _camelizeStyle.default)(prop);
- if (prop == 'float') prop = 'styleFloat';
- var current = node.currentStyle[prop] || null;
- if (current == null && style && style[prop]) current = style[prop];
-
- if (rnumnonpx.test(current) && !rposition.test(prop)) {
- // Remember the original values
- var left = style.left;
- var runStyle = node.runtimeStyle;
- var rsLeft = runStyle && runStyle.left; // Put in the new values to get a computed value out
-
- if (rsLeft) runStyle.left = node.currentStyle.left;
- style.left = prop === 'fontSize' ? '1em' : current;
- current = style.pixelLeft + 'px'; // Revert the changed values
-
- style.left = left;
- if (rsLeft) runStyle.left = rsLeft;
- }
-
- return current;
- }
- };
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/style/index.js":
- /*!*************************************************!*\
- !*** ./node_modules/dom-helpers/style/index.js ***!
- \*************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
- exports.__esModule = true;
- exports.default = style;
-
- var _camelizeStyle = _interopRequireDefault(__webpack_require__(/*! ../util/camelizeStyle */ "./node_modules/dom-helpers/util/camelizeStyle.js"));
-
- var _hyphenateStyle = _interopRequireDefault(__webpack_require__(/*! ../util/hyphenateStyle */ "./node_modules/dom-helpers/util/hyphenateStyle.js"));
-
- var _getComputedStyle2 = _interopRequireDefault(__webpack_require__(/*! ./getComputedStyle */ "./node_modules/dom-helpers/style/getComputedStyle.js"));
-
- var _removeStyle = _interopRequireDefault(__webpack_require__(/*! ./removeStyle */ "./node_modules/dom-helpers/style/removeStyle.js"));
-
- var _properties = __webpack_require__(/*! ../transition/properties */ "./node_modules/dom-helpers/transition/properties.js");
-
- var _isTransform = _interopRequireDefault(__webpack_require__(/*! ../transition/isTransform */ "./node_modules/dom-helpers/transition/isTransform.js"));
-
- function style(node, property, value) {
- var css = '';
- var transforms = '';
- var props = property;
-
- if (typeof property === 'string') {
- if (value === undefined) {
- return node.style[(0, _camelizeStyle.default)(property)] || (0, _getComputedStyle2.default)(node).getPropertyValue((0, _hyphenateStyle.default)(property));
- } else {
- (props = {})[property] = value;
- }
- }
-
- Object.keys(props).forEach(function (key) {
- var value = props[key];
-
- if (!value && value !== 0) {
- (0, _removeStyle.default)(node, (0, _hyphenateStyle.default)(key));
- } else if ((0, _isTransform.default)(key)) {
- transforms += key + "(" + value + ") ";
- } else {
- css += (0, _hyphenateStyle.default)(key) + ": " + value + ";";
- }
- });
-
- if (transforms) {
- css += _properties.transform + ": " + transforms + ";";
- }
-
- node.style.cssText += ';' + css;
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/style/removeStyle.js":
- /*!*******************************************************!*\
- !*** ./node_modules/dom-helpers/style/removeStyle.js ***!
- \*******************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = removeStyle;
-
- function removeStyle(node, key) {
- return 'removeProperty' in node.style ? node.style.removeProperty(key) : node.style.removeAttribute(key);
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/transition/end.js":
- /*!****************************************************!*\
- !*** ./node_modules/dom-helpers/transition/end.js ***!
- \****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _properties = _interopRequireDefault(__webpack_require__(/*! ./properties */ "./node_modules/dom-helpers/transition/properties.js"));
-
- var _style = _interopRequireDefault(__webpack_require__(/*! ../style */ "./node_modules/dom-helpers/style/index.js"));
-
- function onEnd(node, handler, duration) {
- var fakeEvent = {
- target: node,
- currentTarget: node
- },
- backup;
- if (!_properties.default.end) duration = 0;else if (duration == null) duration = parseDuration(node) || 0;
-
- if (_properties.default.end) {
- node.addEventListener(_properties.default.end, done, false);
- backup = setTimeout(function () {
- return done(fakeEvent);
- }, (duration || 100) * 1.5);
- } else setTimeout(done.bind(null, fakeEvent), 0);
-
- function done(event) {
- if (event.target !== event.currentTarget) return;
- clearTimeout(backup);
- event.target.removeEventListener(_properties.default.end, done);
- handler.call(this);
- }
- }
-
- onEnd._parseDuration = parseDuration;
- var _default = onEnd;
- exports.default = _default;
-
- function parseDuration(node) {
- var str = (0, _style.default)(node, _properties.default.duration),
- mult = str.indexOf('ms') === -1 ? 1000 : 1;
- return parseFloat(str) * mult;
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/transition/index.js":
- /*!******************************************************!*\
- !*** ./node_modules/dom-helpers/transition/index.js ***!
- \******************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _end = _interopRequireDefault(__webpack_require__(/*! ./end */ "./node_modules/dom-helpers/transition/end.js"));
-
- exports.end = _end.default;
-
- var _properties = _interopRequireDefault(__webpack_require__(/*! ./properties */ "./node_modules/dom-helpers/transition/properties.js"));
-
- exports.properties = _properties.default;
- var _default = {
- end: _end.default,
- properties: _properties.default
- };
- exports.default = _default;
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/transition/isTransform.js":
- /*!************************************************************!*\
- !*** ./node_modules/dom-helpers/transition/isTransform.js ***!
- \************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = isTransform;
- var supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;
-
- function isTransform(property) {
- return !!(property && supportedTransforms.test(property));
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/transition/properties.js":
- /*!***********************************************************!*\
- !*** ./node_modules/dom-helpers/transition/properties.js ***!
- \***********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
- exports.__esModule = true;
- exports.default = exports.animationEnd = exports.animationDelay = exports.animationTiming = exports.animationDuration = exports.animationName = exports.transitionEnd = exports.transitionDuration = exports.transitionDelay = exports.transitionTiming = exports.transitionProperty = exports.transform = void 0;
-
- var _inDOM = _interopRequireDefault(__webpack_require__(/*! ../util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"));
-
- var transform = 'transform';
- exports.transform = transform;
- var prefix, transitionEnd, animationEnd;
- exports.animationEnd = animationEnd;
- exports.transitionEnd = transitionEnd;
- var transitionProperty, transitionDuration, transitionTiming, transitionDelay;
- exports.transitionDelay = transitionDelay;
- exports.transitionTiming = transitionTiming;
- exports.transitionDuration = transitionDuration;
- exports.transitionProperty = transitionProperty;
- var animationName, animationDuration, animationTiming, animationDelay;
- exports.animationDelay = animationDelay;
- exports.animationTiming = animationTiming;
- exports.animationDuration = animationDuration;
- exports.animationName = animationName;
-
- if (_inDOM.default) {
- var _getTransitionPropert = getTransitionProperties();
-
- prefix = _getTransitionPropert.prefix;
- exports.transitionEnd = transitionEnd = _getTransitionPropert.transitionEnd;
- exports.animationEnd = animationEnd = _getTransitionPropert.animationEnd;
- exports.transform = transform = prefix + "-" + transform;
- exports.transitionProperty = transitionProperty = prefix + "-transition-property";
- exports.transitionDuration = transitionDuration = prefix + "-transition-duration";
- exports.transitionDelay = transitionDelay = prefix + "-transition-delay";
- exports.transitionTiming = transitionTiming = prefix + "-transition-timing-function";
- exports.animationName = animationName = prefix + "-animation-name";
- exports.animationDuration = animationDuration = prefix + "-animation-duration";
- exports.animationTiming = animationTiming = prefix + "-animation-delay";
- exports.animationDelay = animationDelay = prefix + "-animation-timing-function";
- }
-
- var _default = {
- transform: transform,
- end: transitionEnd,
- property: transitionProperty,
- timing: transitionTiming,
- delay: transitionDelay,
- duration: transitionDuration
- };
- exports.default = _default;
-
- function getTransitionProperties() {
- var style = document.createElement('div').style;
- var vendorMap = {
- O: function O(e) {
- return "o" + e.toLowerCase();
- },
- Moz: function Moz(e) {
- return e.toLowerCase();
- },
- Webkit: function Webkit(e) {
- return "webkit" + e;
- },
- ms: function ms(e) {
- return "MS" + e;
- }
- };
- var vendors = Object.keys(vendorMap);
- var transitionEnd, animationEnd;
- var prefix = '';
-
- for (var i = 0; i < vendors.length; i++) {
- var vendor = vendors[i];
-
- if (vendor + "TransitionProperty" in style) {
- prefix = "-" + vendor.toLowerCase();
- transitionEnd = vendorMap[vendor]('TransitionEnd');
- animationEnd = vendorMap[vendor]('AnimationEnd');
- break;
- }
- }
-
- if (!transitionEnd && 'transitionProperty' in style) transitionEnd = 'transitionend';
- if (!animationEnd && 'animationName' in style) animationEnd = 'animationend';
- style = null;
- return {
- animationEnd: animationEnd,
- transitionEnd: transitionEnd,
- prefix: prefix
- };
- }
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/util/camelize.js":
- /*!***************************************************!*\
- !*** ./node_modules/dom-helpers/util/camelize.js ***!
- \***************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = camelize;
- var rHyphen = /-(.)/g;
-
- function camelize(string) {
- return string.replace(rHyphen, function (_, chr) {
- return chr.toUpperCase();
- });
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/util/camelizeStyle.js":
- /*!********************************************************!*\
- !*** ./node_modules/dom-helpers/util/camelizeStyle.js ***!
- \********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
- exports.__esModule = true;
- exports.default = camelizeStyleName;
-
- var _camelize = _interopRequireDefault(__webpack_require__(/*! ./camelize */ "./node_modules/dom-helpers/util/camelize.js"));
-
- /**
- * Copyright 2014-2015, Facebook, Inc.
- * All rights reserved.
- * https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/camelizeStyleName.js
- */
- var msPattern = /^-ms-/;
-
- function camelizeStyleName(string) {
- return (0, _camelize.default)(string.replace(msPattern, 'ms-'));
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/util/hyphenate.js":
- /*!****************************************************!*\
- !*** ./node_modules/dom-helpers/util/hyphenate.js ***!
- \****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = hyphenate;
- var rUpper = /([A-Z])/g;
-
- function hyphenate(string) {
- return string.replace(rUpper, '-$1').toLowerCase();
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/util/hyphenateStyle.js":
- /*!*********************************************************!*\
- !*** ./node_modules/dom-helpers/util/hyphenateStyle.js ***!
- \*********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
- exports.__esModule = true;
- exports.default = hyphenateStyleName;
-
- var _hyphenate = _interopRequireDefault(__webpack_require__(/*! ./hyphenate */ "./node_modules/dom-helpers/util/hyphenate.js"));
-
- /**
- * Copyright 2013-2014, Facebook, Inc.
- * All rights reserved.
- * https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/hyphenateStyleName.js
- */
- var msPattern = /^ms-/;
-
- function hyphenateStyleName(string) {
- return (0, _hyphenate.default)(string).replace(msPattern, '-ms-');
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/util/inDOM.js":
- /*!************************************************!*\
- !*** ./node_modules/dom-helpers/util/inDOM.js ***!
- \************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _default = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
-
- exports.default = _default;
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/dom-helpers/util/scrollbarSize.js":
- /*!********************************************************!*\
- !*** ./node_modules/dom-helpers/util/scrollbarSize.js ***!
- \********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
-
- exports.__esModule = true;
- exports.default = scrollbarSize;
-
- var _inDOM = _interopRequireDefault(__webpack_require__(/*! ./inDOM */ "./node_modules/dom-helpers/util/inDOM.js"));
-
- var size;
-
- function scrollbarSize(recalc) {
- if (!size && size !== 0 || recalc) {
- if (_inDOM.default) {
- var scrollDiv = document.createElement('div');
- scrollDiv.style.position = 'absolute';
- scrollDiv.style.top = '-9999px';
- scrollDiv.style.width = '50px';
- scrollDiv.style.height = '50px';
- scrollDiv.style.overflow = 'scroll';
- document.body.appendChild(scrollDiv);
- size = scrollDiv.offsetWidth - scrollDiv.clientWidth;
- document.body.removeChild(scrollDiv);
- }
- }
-
- return size;
- }
-
- module.exports = exports["default"];
-
- /***/ }),
-
- /***/ "./node_modules/file-saver/dist/FileSaver.min.js":
- /*!*******************************************************!*\
- !*** ./node_modules/file-saver/dist/FileSaver.min.js ***!
- \*******************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(a,b){if(true)!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (b),
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));else {}})(this,function(){"use strict";function b(a,b){return"undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Deprecated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function c(b,c,d){var e=new XMLHttpRequest;e.open("GET",b),e.responseType="blob",e.onload=function(){a(e.response,c,d)},e.onerror=function(){console.error("could not download file")},e.send()}function d(a){var b=new XMLHttpRequest;b.open("HEAD",a,!1);try{b.send()}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"))}catch(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,a=f.saveAs||("object"!=typeof window||window!==f?function(){}:"download"in HTMLAnchorElement.prototype?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement("a");g=g||b.name||"download",j.download=g,j.rel="noopener","string"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target="_blank")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href)},4E4),setTimeout(function(){e(j)},0))}:"msSaveOrOpenBlob"in navigator?function(f,g,h){if(g=g||f.name||"download","string"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else{var i=document.createElement("a");i.href=f,i.target="_blank",setTimeout(function(){e(i)})}}:function(a,b,d,e){if(e=e||open("","_blank"),e&&(e.document.title=e.document.body.innerText="downloading..."),"string"==typeof a)return c(a,b,d);var g="application/octet-stream"===a.type,h=/constructor/i.test(f.HTMLElement)||f.safari,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||g&&h)&&"object"==typeof FileReader){var j=new FileReader;j.onloadend=function(){var a=j.result;a=i?a:a.replace(/^data:[^;]*;/,"data:attachment/file;"),e?e.location.href=a:location=a,e=null},j.readAsDataURL(a)}else{var k=f.URL||f.webkitURL,l=k.createObjectURL(a);e?e.location=l:location.href=l,e=null,setTimeout(function(){k.revokeObjectURL(l)},4E4)}});f.saveAs=a.saveAs=a, true&&(module.exports=a)});
-
- //# sourceMappingURL=FileSaver.min.js.map
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
-
- /***/ }),
-
- /***/ "./node_modules/gud/index.js":
- /*!***********************************!*\
- !*** ./node_modules/gud/index.js ***!
- \***********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {// @flow
-
-
- var key = '__global_unique_id__';
-
- module.exports = function() {
- return global[key] = (global[key] || 0) + 1;
- };
-
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
-
- /***/ }),
-
- /***/ "./node_modules/ieee754/index.js":
- /*!***************************************!*\
- !*** ./node_modules/ieee754/index.js ***!
- \***************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- exports.read = function (buffer, offset, isLE, mLen, nBytes) {
- var e, m
- var eLen = (nBytes * 8) - mLen - 1
- var eMax = (1 << eLen) - 1
- var eBias = eMax >> 1
- var nBits = -7
- var i = isLE ? (nBytes - 1) : 0
- var d = isLE ? -1 : 1
- var s = buffer[offset + i]
-
- i += d
-
- e = s & ((1 << (-nBits)) - 1)
- s >>= (-nBits)
- nBits += eLen
- for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
-
- m = e & ((1 << (-nBits)) - 1)
- e >>= (-nBits)
- nBits += mLen
- for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
-
- if (e === 0) {
- e = 1 - eBias
- } else if (e === eMax) {
- return m ? NaN : ((s ? -1 : 1) * Infinity)
- } else {
- m = m + Math.pow(2, mLen)
- e = e - eBias
- }
- return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
- }
-
- exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
- var e, m, c
- var eLen = (nBytes * 8) - mLen - 1
- var eMax = (1 << eLen) - 1
- var eBias = eMax >> 1
- var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
- var i = isLE ? 0 : (nBytes - 1)
- var d = isLE ? 1 : -1
- var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
-
- value = Math.abs(value)
-
- if (isNaN(value) || value === Infinity) {
- m = isNaN(value) ? 1 : 0
- e = eMax
- } else {
- e = Math.floor(Math.log(value) / Math.LN2)
- if (value * (c = Math.pow(2, -e)) < 1) {
- e--
- c *= 2
- }
- if (e + eBias >= 1) {
- value += rt / c
- } else {
- value += rt * Math.pow(2, 1 - eBias)
- }
- if (value * c >= 2) {
- e++
- c /= 2
- }
-
- if (e + eBias >= eMax) {
- m = 0
- e = eMax
- } else if (e + eBias >= 1) {
- m = ((value * c) - 1) * Math.pow(2, mLen)
- e = e + eBias
- } else {
- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
- e = 0
- }
- }
-
- for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
-
- e = (e << mLen) | m
- eLen += mLen
- for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
-
- buffer[offset + i - d] |= s * 128
- }
-
-
- /***/ }),
-
- /***/ "./node_modules/invariant/browser.js":
- /*!*******************************************!*\
- !*** ./node_modules/invariant/browser.js ***!
- \*******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
- /**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-
-
- /**
- * Use invariant() to assert state which your program assumes to be true.
- *
- * Provide sprintf-style format (only %s is supported) and arguments
- * to provide information about what broke and what you were
- * expecting.
- *
- * The invariant message will be stripped in production, but the invariant
- * will remain to ensure logic does not differ in production.
- */
-
- var invariant = function(condition, format, a, b, c, d, e, f) {
- if (true) {
- if (format === undefined) {
- throw new Error('invariant requires an error message argument');
- }
- }
-
- if (!condition) {
- var error;
- if (format === undefined) {
- error = new Error(
- 'Minified exception occurred; use the non-minified dev environment ' +
- 'for the full error message and additional helpful warnings.'
- );
- } else {
- var args = [a, b, c, d, e, f];
- var argIndex = 0;
- error = new Error(
- format.replace(/%s/g, function() { return args[argIndex++]; })
- );
- error.name = 'Invariant Violation';
- }
-
- error.framesToPop = 1; // we don't care about invariant's own frame
- throw error;
- }
- };
-
- module.exports = invariant;
-
-
- /***/ }),
-
- /***/ "./node_modules/is-buffer/index.js":
- /*!*****************************************!*\
- !*** ./node_modules/is-buffer/index.js ***!
- \*****************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- /*!
- * Determine if an object is a Buffer
- *
- * @author Feross Aboukhadijeh <https://feross.org>
- * @license MIT
- */
-
- module.exports = function isBuffer (obj) {
- return obj != null && obj.constructor != null &&
- typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
- }
-
-
- /***/ }),
-
- /***/ "./node_modules/isarray/index.js":
- /*!***************************************!*\
- !*** ./node_modules/isarray/index.js ***!
- \***************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- var toString = {}.toString;
-
- module.exports = Array.isArray || function (arr) {
- return toString.call(arr) == '[object Array]';
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/jquery/dist/jquery.js":
- /*!********************************************!*\
- !*** ./node_modules/jquery/dist/jquery.js ***!
- \********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
- * jQuery JavaScript Library v3.4.1
- * https://jquery.com/
- *
- * Includes Sizzle.js
- * https://sizzlejs.com/
- *
- * Copyright JS Foundation and other contributors
- * Released under the MIT license
- * https://jquery.org/license
- *
- * Date: 2019-05-01T21:04Z
- */
- ( function( global, factory ) {
-
- "use strict";
-
- if ( true && typeof module.exports === "object" ) {
-
- // For CommonJS and CommonJS-like environments where a proper `window`
- // is present, execute the factory and get jQuery.
- // For environments that do not have a `window` with a `document`
- // (such as Node.js), expose a factory as module.exports.
- // This accentuates the need for the creation of a real `window`.
- // e.g. var jQuery = require("jquery")(window);
- // See ticket #14549 for more info.
- module.exports = global.document ?
- factory( global, true ) :
- function( w ) {
- if ( !w.document ) {
- throw new Error( "jQuery requires a window with a document" );
- }
- return factory( w );
- };
- } else {
- factory( global );
- }
-
- // Pass this if window is not defined yet
- } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
-
- // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
- // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
- // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
- // enough that all such attempts are guarded in a try block.
- "use strict";
-
- var arr = [];
-
- var document = window.document;
-
- var getProto = Object.getPrototypeOf;
-
- var slice = arr.slice;
-
- var concat = arr.concat;
-
- var push = arr.push;
-
- var indexOf = arr.indexOf;
-
- var class2type = {};
-
- var toString = class2type.toString;
-
- var hasOwn = class2type.hasOwnProperty;
-
- var fnToString = hasOwn.toString;
-
- var ObjectFunctionString = fnToString.call( Object );
-
- var support = {};
-
- var isFunction = function isFunction( obj ) {
-
- // Support: Chrome <=57, Firefox <=52
- // In some browsers, typeof returns "function" for HTML <object> elements
- // (i.e., `typeof document.createElement( "object" ) === "function"`).
- // We don't want to classify *any* DOM node as a function.
- return typeof obj === "function" && typeof obj.nodeType !== "number";
- };
-
-
- var isWindow = function isWindow( obj ) {
- return obj != null && obj === obj.window;
- };
-
-
-
-
- var preservedScriptAttributes = {
- type: true,
- src: true,
- nonce: true,
- noModule: true
- };
-
- function DOMEval( code, node, doc ) {
- doc = doc || document;
-
- var i, val,
- script = doc.createElement( "script" );
-
- script.text = code;
- if ( node ) {
- for ( i in preservedScriptAttributes ) {
-
- // Support: Firefox 64+, Edge 18+
- // Some browsers don't support the "nonce" property on scripts.
- // On the other hand, just using `getAttribute` is not enough as
- // the `nonce` attribute is reset to an empty string whenever it
- // becomes browsing-context connected.
- // See https://github.com/whatwg/html/issues/2369
- // See https://html.spec.whatwg.org/#nonce-attributes
- // The `node.getAttribute` check was added for the sake of
- // `jQuery.globalEval` so that it can fake a nonce-containing node
- // via an object.
- val = node[ i ] || node.getAttribute && node.getAttribute( i );
- if ( val ) {
- script.setAttribute( i, val );
- }
- }
- }
- doc.head.appendChild( script ).parentNode.removeChild( script );
- }
-
-
- function toType( obj ) {
- if ( obj == null ) {
- return obj + "";
- }
-
- // Support: Android <=2.3 only (functionish RegExp)
- return typeof obj === "object" || typeof obj === "function" ?
- class2type[ toString.call( obj ) ] || "object" :
- typeof obj;
- }
- /* global Symbol */
- // Defining this global in .eslintrc.json would create a danger of using the global
- // unguarded in another place, it seems safer to define global only for this module
-
-
-
- var
- version = "3.4.1",
-
- // Define a local copy of jQuery
- jQuery = function( selector, context ) {
-
- // The jQuery object is actually just the init constructor 'enhanced'
- // Need init if jQuery is called (just allow error to be thrown if not included)
- return new jQuery.fn.init( selector, context );
- },
-
- // Support: Android <=4.0 only
- // Make sure we trim BOM and NBSP
- rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
-
- jQuery.fn = jQuery.prototype = {
-
- // The current version of jQuery being used
- jquery: version,
-
- constructor: jQuery,
-
- // The default length of a jQuery object is 0
- length: 0,
-
- toArray: function() {
- return slice.call( this );
- },
-
- // Get the Nth element in the matched element set OR
- // Get the whole matched element set as a clean array
- get: function( num ) {
-
- // Return all the elements in a clean array
- if ( num == null ) {
- return slice.call( this );
- }
-
- // Return just the one element from the set
- return num < 0 ? this[ num + this.length ] : this[ num ];
- },
-
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function( elems ) {
-
- // Build a new jQuery matched element set
- var ret = jQuery.merge( this.constructor(), elems );
-
- // Add the old object onto the stack (as a reference)
- ret.prevObject = this;
-
- // Return the newly-formed element set
- return ret;
- },
-
- // Execute a callback for every element in the matched set.
- each: function( callback ) {
- return jQuery.each( this, callback );
- },
-
- map: function( callback ) {
- return this.pushStack( jQuery.map( this, function( elem, i ) {
- return callback.call( elem, i, elem );
- } ) );
- },
-
- slice: function() {
- return this.pushStack( slice.apply( this, arguments ) );
- },
-
- first: function() {
- return this.eq( 0 );
- },
-
- last: function() {
- return this.eq( -1 );
- },
-
- eq: function( i ) {
- var len = this.length,
- j = +i + ( i < 0 ? len : 0 );
- return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
- },
-
- end: function() {
- return this.prevObject || this.constructor();
- },
-
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push: push,
- sort: arr.sort,
- splice: arr.splice
- };
-
- jQuery.extend = jQuery.fn.extend = function() {
- var options, name, src, copy, copyIsArray, clone,
- target = arguments[ 0 ] || {},
- i = 1,
- length = arguments.length,
- deep = false;
-
- // Handle a deep copy situation
- if ( typeof target === "boolean" ) {
- deep = target;
-
- // Skip the boolean and the target
- target = arguments[ i ] || {};
- i++;
- }
-
- // Handle case when target is a string or something (possible in deep copy)
- if ( typeof target !== "object" && !isFunction( target ) ) {
- target = {};
- }
-
- // Extend jQuery itself if only one argument is passed
- if ( i === length ) {
- target = this;
- i--;
- }
-
- for ( ; i < length; i++ ) {
-
- // Only deal with non-null/undefined values
- if ( ( options = arguments[ i ] ) != null ) {
-
- // Extend the base object
- for ( name in options ) {
- copy = options[ name ];
-
- // Prevent Object.prototype pollution
- // Prevent never-ending loop
- if ( name === "__proto__" || target === copy ) {
- continue;
- }
-
- // Recurse if we're merging plain objects or arrays
- if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
- ( copyIsArray = Array.isArray( copy ) ) ) ) {
- src = target[ name ];
-
- // Ensure proper type for the source value
- if ( copyIsArray && !Array.isArray( src ) ) {
- clone = [];
- } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
- clone = {};
- } else {
- clone = src;
- }
- copyIsArray = false;
-
- // Never move original objects, clone them
- target[ name ] = jQuery.extend( deep, clone, copy );
-
- // Don't bring in undefined values
- } else if ( copy !== undefined ) {
- target[ name ] = copy;
- }
- }
- }
- }
-
- // Return the modified object
- return target;
- };
-
- jQuery.extend( {
-
- // Unique for each copy of jQuery on the page
- expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
-
- // Assume jQuery is ready without the ready module
- isReady: true,
-
- error: function( msg ) {
- throw new Error( msg );
- },
-
- noop: function() {},
-
- isPlainObject: function( obj ) {
- var proto, Ctor;
-
- // Detect obvious negatives
- // Use toString instead of jQuery.type to catch host objects
- if ( !obj || toString.call( obj ) !== "[object Object]" ) {
- return false;
- }
-
- proto = getProto( obj );
-
- // Objects with no prototype (e.g., `Object.create( null )`) are plain
- if ( !proto ) {
- return true;
- }
-
- // Objects with prototype are plain iff they were constructed by a global Object function
- Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
- return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
- },
-
- isEmptyObject: function( obj ) {
- var name;
-
- for ( name in obj ) {
- return false;
- }
- return true;
- },
-
- // Evaluates a script in a global context
- globalEval: function( code, options ) {
- DOMEval( code, { nonce: options && options.nonce } );
- },
-
- each: function( obj, callback ) {
- var length, i = 0;
-
- if ( isArrayLike( obj ) ) {
- length = obj.length;
- for ( ; i < length; i++ ) {
- if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
- break;
- }
- }
- } else {
- for ( i in obj ) {
- if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
- break;
- }
- }
- }
-
- return obj;
- },
-
- // Support: Android <=4.0 only
- trim: function( text ) {
- return text == null ?
- "" :
- ( text + "" ).replace( rtrim, "" );
- },
-
- // results is for internal usage only
- makeArray: function( arr, results ) {
- var ret = results || [];
-
- if ( arr != null ) {
- if ( isArrayLike( Object( arr ) ) ) {
- jQuery.merge( ret,
- typeof arr === "string" ?
- [ arr ] : arr
- );
- } else {
- push.call( ret, arr );
- }
- }
-
- return ret;
- },
-
- inArray: function( elem, arr, i ) {
- return arr == null ? -1 : indexOf.call( arr, elem, i );
- },
-
- // Support: Android <=4.0 only, PhantomJS 1 only
- // push.apply(_, arraylike) throws on ancient WebKit
- merge: function( first, second ) {
- var len = +second.length,
- j = 0,
- i = first.length;
-
- for ( ; j < len; j++ ) {
- first[ i++ ] = second[ j ];
- }
-
- first.length = i;
-
- return first;
- },
-
- grep: function( elems, callback, invert ) {
- var callbackInverse,
- matches = [],
- i = 0,
- length = elems.length,
- callbackExpect = !invert;
-
- // Go through the array, only saving the items
- // that pass the validator function
- for ( ; i < length; i++ ) {
- callbackInverse = !callback( elems[ i ], i );
- if ( callbackInverse !== callbackExpect ) {
- matches.push( elems[ i ] );
- }
- }
-
- return matches;
- },
-
- // arg is for internal usage only
- map: function( elems, callback, arg ) {
- var length, value,
- i = 0,
- ret = [];
-
- // Go through the array, translating each of the items to their new values
- if ( isArrayLike( elems ) ) {
- length = elems.length;
- for ( ; i < length; i++ ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret.push( value );
- }
- }
-
- // Go through every key on the object,
- } else {
- for ( i in elems ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret.push( value );
- }
- }
- }
-
- // Flatten any nested arrays
- return concat.apply( [], ret );
- },
-
- // A global GUID counter for objects
- guid: 1,
-
- // jQuery.support is not used in Core but other projects attach their
- // properties to it so it needs to exist.
- support: support
- } );
-
- if ( typeof Symbol === "function" ) {
- jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
- }
-
- // Populate the class2type map
- jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
- function( i, name ) {
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
- } );
-
- function isArrayLike( obj ) {
-
- // Support: real iOS 8.2 only (not reproducible in simulator)
- // `in` check used to prevent JIT error (gh-2145)
- // hasOwn isn't used here due to false negatives
- // regarding Nodelist length in IE
- var length = !!obj && "length" in obj && obj.length,
- type = toType( obj );
-
- if ( isFunction( obj ) || isWindow( obj ) ) {
- return false;
- }
-
- return type === "array" || length === 0 ||
- typeof length === "number" && length > 0 && ( length - 1 ) in obj;
- }
- var Sizzle =
- /*!
- * Sizzle CSS Selector Engine v2.3.4
- * https://sizzlejs.com/
- *
- * Copyright JS Foundation and other contributors
- * Released under the MIT license
- * https://js.foundation/
- *
- * Date: 2019-04-08
- */
- (function( window ) {
-
- var i,
- support,
- Expr,
- getText,
- isXML,
- tokenize,
- compile,
- select,
- outermostContext,
- sortInput,
- hasDuplicate,
-
- // Local document vars
- setDocument,
- document,
- docElem,
- documentIsHTML,
- rbuggyQSA,
- rbuggyMatches,
- matches,
- contains,
-
- // Instance-specific data
- expando = "sizzle" + 1 * new Date(),
- preferredDoc = window.document,
- dirruns = 0,
- done = 0,
- classCache = createCache(),
- tokenCache = createCache(),
- compilerCache = createCache(),
- nonnativeSelectorCache = createCache(),
- sortOrder = function( a, b ) {
- if ( a === b ) {
- hasDuplicate = true;
- }
- return 0;
- },
-
- // Instance methods
- hasOwn = ({}).hasOwnProperty,
- arr = [],
- pop = arr.pop,
- push_native = arr.push,
- push = arr.push,
- slice = arr.slice,
- // Use a stripped-down indexOf as it's faster than native
- // https://jsperf.com/thor-indexof-vs-for/5
- indexOf = function( list, elem ) {
- var i = 0,
- len = list.length;
- for ( ; i < len; i++ ) {
- if ( list[i] === elem ) {
- return i;
- }
- }
- return -1;
- },
-
- booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
-
- // Regular expressions
-
- // http://www.w3.org/TR/css3-selectors/#whitespace
- whitespace = "[\\x20\\t\\r\\n\\f]",
-
- // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
- identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
-
- // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
- attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
- // Operator (capture 2)
- "*([*^$|!~]?=)" + whitespace +
- // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
- "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
- "*\\]",
-
- pseudos = ":(" + identifier + ")(?:\\((" +
- // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
- // 1. quoted (capture 3; capture 4 or capture 5)
- "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
- // 2. simple (capture 6)
- "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
- // 3. anything else (capture 2)
- ".*" +
- ")\\)|)",
-
- // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
- rwhitespace = new RegExp( whitespace + "+", "g" ),
- rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
-
- rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
- rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
- rdescend = new RegExp( whitespace + "|>" ),
-
- rpseudo = new RegExp( pseudos ),
- ridentifier = new RegExp( "^" + identifier + "$" ),
-
- matchExpr = {
- "ID": new RegExp( "^#(" + identifier + ")" ),
- "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
- "TAG": new RegExp( "^(" + identifier + "|[*])" ),
- "ATTR": new RegExp( "^" + attributes ),
- "PSEUDO": new RegExp( "^" + pseudos ),
- "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
- "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
- "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
- "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
- // For use in libraries implementing .is()
- // We use this for POS matching in `select`
- "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
- whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
- },
-
- rhtml = /HTML$/i,
- rinputs = /^(?:input|select|textarea|button)$/i,
- rheader = /^h\d$/i,
-
- rnative = /^[^{]+\{\s*\[native \w/,
-
- // Easily-parseable/retrievable ID or TAG or CLASS selectors
- rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
-
- rsibling = /[+~]/,
-
- // CSS escapes
- // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
- runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
- funescape = function( _, escaped, escapedWhitespace ) {
- var high = "0x" + escaped - 0x10000;
- // NaN means non-codepoint
- // Support: Firefox<24
- // Workaround erroneous numeric interpretation of +"0x"
- return high !== high || escapedWhitespace ?
- escaped :
- high < 0 ?
- // BMP codepoint
- String.fromCharCode( high + 0x10000 ) :
- // Supplemental Plane codepoint (surrogate pair)
- String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
- },
-
- // CSS string/identifier serialization
- // https://drafts.csswg.org/cssom/#common-serializing-idioms
- rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
- fcssescape = function( ch, asCodePoint ) {
- if ( asCodePoint ) {
-
- // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
- if ( ch === "\0" ) {
- return "\uFFFD";
- }
-
- // Control characters and (dependent upon position) numbers get escaped as code points
- return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
- }
-
- // Other potentially-special ASCII characters get backslash-escaped
- return "\\" + ch;
- },
-
- // Used for iframes
- // See setDocument()
- // Removing the function wrapper causes a "Permission Denied"
- // error in IE
- unloadHandler = function() {
- setDocument();
- },
-
- inDisabledFieldset = addCombinator(
- function( elem ) {
- return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
- },
- { dir: "parentNode", next: "legend" }
- );
-
- // Optimize for push.apply( _, NodeList )
- try {
- push.apply(
- (arr = slice.call( preferredDoc.childNodes )),
- preferredDoc.childNodes
- );
- // Support: Android<4.0
- // Detect silently failing push.apply
- arr[ preferredDoc.childNodes.length ].nodeType;
- } catch ( e ) {
- push = { apply: arr.length ?
-
- // Leverage slice if possible
- function( target, els ) {
- push_native.apply( target, slice.call(els) );
- } :
-
- // Support: IE<9
- // Otherwise append directly
- function( target, els ) {
- var j = target.length,
- i = 0;
- // Can't trust NodeList.length
- while ( (target[j++] = els[i++]) ) {}
- target.length = j - 1;
- }
- };
- }
-
- function Sizzle( selector, context, results, seed ) {
- var m, i, elem, nid, match, groups, newSelector,
- newContext = context && context.ownerDocument,
-
- // nodeType defaults to 9, since context defaults to document
- nodeType = context ? context.nodeType : 9;
-
- results = results || [];
-
- // Return early from calls with invalid selector or context
- if ( typeof selector !== "string" || !selector ||
- nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
-
- return results;
- }
-
- // Try to shortcut find operations (as opposed to filters) in HTML documents
- if ( !seed ) {
-
- if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
- setDocument( context );
- }
- context = context || document;
-
- if ( documentIsHTML ) {
-
- // If the selector is sufficiently simple, try using a "get*By*" DOM method
- // (excepting DocumentFragment context, where the methods don't exist)
- if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
-
- // ID selector
- if ( (m = match[1]) ) {
-
- // Document context
- if ( nodeType === 9 ) {
- if ( (elem = context.getElementById( m )) ) {
-
- // Support: IE, Opera, Webkit
- // TODO: identify versions
- // getElementById can match elements by name instead of ID
- if ( elem.id === m ) {
- results.push( elem );
- return results;
- }
- } else {
- return results;
- }
-
- // Element context
- } else {
-
- // Support: IE, Opera, Webkit
- // TODO: identify versions
- // getElementById can match elements by name instead of ID
- if ( newContext && (elem = newContext.getElementById( m )) &&
- contains( context, elem ) &&
- elem.id === m ) {
-
- results.push( elem );
- return results;
- }
- }
-
- // Type selector
- } else if ( match[2] ) {
- push.apply( results, context.getElementsByTagName( selector ) );
- return results;
-
- // Class selector
- } else if ( (m = match[3]) && support.getElementsByClassName &&
- context.getElementsByClassName ) {
-
- push.apply( results, context.getElementsByClassName( m ) );
- return results;
- }
- }
-
- // Take advantage of querySelectorAll
- if ( support.qsa &&
- !nonnativeSelectorCache[ selector + " " ] &&
- (!rbuggyQSA || !rbuggyQSA.test( selector )) &&
-
- // Support: IE 8 only
- // Exclude object elements
- (nodeType !== 1 || context.nodeName.toLowerCase() !== "object") ) {
-
- newSelector = selector;
- newContext = context;
-
- // qSA considers elements outside a scoping root when evaluating child or
- // descendant combinators, which is not what we want.
- // In such cases, we work around the behavior by prefixing every selector in the
- // list with an ID selector referencing the scope context.
- // Thanks to Andrew Dupont for this technique.
- if ( nodeType === 1 && rdescend.test( selector ) ) {
-
- // Capture the context ID, setting it first if necessary
- if ( (nid = context.getAttribute( "id" )) ) {
- nid = nid.replace( rcssescape, fcssescape );
- } else {
- context.setAttribute( "id", (nid = expando) );
- }
-
- // Prefix every selector in the list
- groups = tokenize( selector );
- i = groups.length;
- while ( i-- ) {
- groups[i] = "#" + nid + " " + toSelector( groups[i] );
- }
- newSelector = groups.join( "," );
-
- // Expand context for sibling selectors
- newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
- context;
- }
-
- try {
- push.apply( results,
- newContext.querySelectorAll( newSelector )
- );
- return results;
- } catch ( qsaError ) {
- nonnativeSelectorCache( selector, true );
- } finally {
- if ( nid === expando ) {
- context.removeAttribute( "id" );
- }
- }
- }
- }
- }
-
- // All others
- return select( selector.replace( rtrim, "$1" ), context, results, seed );
- }
-
- /**
- * Create key-value caches of limited size
- * @returns {function(string, object)} Returns the Object data after storing it on itself with
- * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
- * deleting the oldest entry
- */
- function createCache() {
- var keys = [];
-
- function cache( key, value ) {
- // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
- if ( keys.push( key + " " ) > Expr.cacheLength ) {
- // Only keep the most recent entries
- delete cache[ keys.shift() ];
- }
- return (cache[ key + " " ] = value);
- }
- return cache;
- }
-
- /**
- * Mark a function for special use by Sizzle
- * @param {Function} fn The function to mark
- */
- function markFunction( fn ) {
- fn[ expando ] = true;
- return fn;
- }
-
- /**
- * Support testing using an element
- * @param {Function} fn Passed the created element and returns a boolean result
- */
- function assert( fn ) {
- var el = document.createElement("fieldset");
-
- try {
- return !!fn( el );
- } catch (e) {
- return false;
- } finally {
- // Remove from its parent by default
- if ( el.parentNode ) {
- el.parentNode.removeChild( el );
- }
- // release memory in IE
- el = null;
- }
- }
-
- /**
- * Adds the same handler for all of the specified attrs
- * @param {String} attrs Pipe-separated list of attributes
- * @param {Function} handler The method that will be applied
- */
- function addHandle( attrs, handler ) {
- var arr = attrs.split("|"),
- i = arr.length;
-
- while ( i-- ) {
- Expr.attrHandle[ arr[i] ] = handler;
- }
- }
-
- /**
- * Checks document order of two siblings
- * @param {Element} a
- * @param {Element} b
- * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
- */
- function siblingCheck( a, b ) {
- var cur = b && a,
- diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
- a.sourceIndex - b.sourceIndex;
-
- // Use IE sourceIndex if available on both nodes
- if ( diff ) {
- return diff;
- }
-
- // Check if b follows a
- if ( cur ) {
- while ( (cur = cur.nextSibling) ) {
- if ( cur === b ) {
- return -1;
- }
- }
- }
-
- return a ? 1 : -1;
- }
-
- /**
- * Returns a function to use in pseudos for input types
- * @param {String} type
- */
- function createInputPseudo( type ) {
- return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === type;
- };
- }
-
- /**
- * Returns a function to use in pseudos for buttons
- * @param {String} type
- */
- function createButtonPseudo( type ) {
- return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return (name === "input" || name === "button") && elem.type === type;
- };
- }
-
- /**
- * Returns a function to use in pseudos for :enabled/:disabled
- * @param {Boolean} disabled true for :disabled; false for :enabled
- */
- function createDisabledPseudo( disabled ) {
-
- // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
- return function( elem ) {
-
- // Only certain elements can match :enabled or :disabled
- // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
- // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
- if ( "form" in elem ) {
-
- // Check for inherited disabledness on relevant non-disabled elements:
- // * listed form-associated elements in a disabled fieldset
- // https://html.spec.whatwg.org/multipage/forms.html#category-listed
- // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
- // * option elements in a disabled optgroup
- // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
- // All such elements have a "form" property.
- if ( elem.parentNode && elem.disabled === false ) {
-
- // Option elements defer to a parent optgroup if present
- if ( "label" in elem ) {
- if ( "label" in elem.parentNode ) {
- return elem.parentNode.disabled === disabled;
- } else {
- return elem.disabled === disabled;
- }
- }
-
- // Support: IE 6 - 11
- // Use the isDisabled shortcut property to check for disabled fieldset ancestors
- return elem.isDisabled === disabled ||
-
- // Where there is no isDisabled, check manually
- /* jshint -W018 */
- elem.isDisabled !== !disabled &&
- inDisabledFieldset( elem ) === disabled;
- }
-
- return elem.disabled === disabled;
-
- // Try to winnow out elements that can't be disabled before trusting the disabled property.
- // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
- // even exist on them, let alone have a boolean value.
- } else if ( "label" in elem ) {
- return elem.disabled === disabled;
- }
-
- // Remaining elements are neither :enabled nor :disabled
- return false;
- };
- }
-
- /**
- * Returns a function to use in pseudos for positionals
- * @param {Function} fn
- */
- function createPositionalPseudo( fn ) {
- return markFunction(function( argument ) {
- argument = +argument;
- return markFunction(function( seed, matches ) {
- var j,
- matchIndexes = fn( [], seed.length, argument ),
- i = matchIndexes.length;
-
- // Match elements found at the specified indexes
- while ( i-- ) {
- if ( seed[ (j = matchIndexes[i]) ] ) {
- seed[j] = !(matches[j] = seed[j]);
- }
- }
- });
- });
- }
-
- /**
- * Checks a node for validity as a Sizzle context
- * @param {Element|Object=} context
- * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
- */
- function testContext( context ) {
- return context && typeof context.getElementsByTagName !== "undefined" && context;
- }
-
- // Expose support vars for convenience
- support = Sizzle.support = {};
-
- /**
- * Detects XML nodes
- * @param {Element|Object} elem An element or a document
- * @returns {Boolean} True iff elem is a non-HTML XML node
- */
- isXML = Sizzle.isXML = function( elem ) {
- var namespace = elem.namespaceURI,
- docElem = (elem.ownerDocument || elem).documentElement;
-
- // Support: IE <=8
- // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
- // https://bugs.jquery.com/ticket/4833
- return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
- };
-
- /**
- * Sets document-related variables once based on the current document
- * @param {Element|Object} [doc] An element or document object to use to set the document
- * @returns {Object} Returns the current document
- */
- setDocument = Sizzle.setDocument = function( node ) {
- var hasCompare, subWindow,
- doc = node ? node.ownerDocument || node : preferredDoc;
-
- // Return early if doc is invalid or already selected
- if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
- return document;
- }
-
- // Update global variables
- document = doc;
- docElem = document.documentElement;
- documentIsHTML = !isXML( document );
-
- // Support: IE 9-11, Edge
- // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
- if ( preferredDoc !== document &&
- (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
-
- // Support: IE 11, Edge
- if ( subWindow.addEventListener ) {
- subWindow.addEventListener( "unload", unloadHandler, false );
-
- // Support: IE 9 - 10 only
- } else if ( subWindow.attachEvent ) {
- subWindow.attachEvent( "onunload", unloadHandler );
- }
- }
-
- /* Attributes
- ---------------------------------------------------------------------- */
-
- // Support: IE<8
- // Verify that getAttribute really returns attributes and not properties
- // (excepting IE8 booleans)
- support.attributes = assert(function( el ) {
- el.className = "i";
- return !el.getAttribute("className");
- });
-
- /* getElement(s)By*
- ---------------------------------------------------------------------- */
-
- // Check if getElementsByTagName("*") returns only elements
- support.getElementsByTagName = assert(function( el ) {
- el.appendChild( document.createComment("") );
- return !el.getElementsByTagName("*").length;
- });
-
- // Support: IE<9
- support.getElementsByClassName = rnative.test( document.getElementsByClassName );
-
- // Support: IE<10
- // Check if getElementById returns elements by name
- // The broken getElementById methods don't pick up programmatically-set names,
- // so use a roundabout getElementsByName test
- support.getById = assert(function( el ) {
- docElem.appendChild( el ).id = expando;
- return !document.getElementsByName || !document.getElementsByName( expando ).length;
- });
-
- // ID filter and find
- if ( support.getById ) {
- Expr.filter["ID"] = function( id ) {
- var attrId = id.replace( runescape, funescape );
- return function( elem ) {
- return elem.getAttribute("id") === attrId;
- };
- };
- Expr.find["ID"] = function( id, context ) {
- if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
- var elem = context.getElementById( id );
- return elem ? [ elem ] : [];
- }
- };
- } else {
- Expr.filter["ID"] = function( id ) {
- var attrId = id.replace( runescape, funescape );
- return function( elem ) {
- var node = typeof elem.getAttributeNode !== "undefined" &&
- elem.getAttributeNode("id");
- return node && node.value === attrId;
- };
- };
-
- // Support: IE 6 - 7 only
- // getElementById is not reliable as a find shortcut
- Expr.find["ID"] = function( id, context ) {
- if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
- var node, i, elems,
- elem = context.getElementById( id );
-
- if ( elem ) {
-
- // Verify the id attribute
- node = elem.getAttributeNode("id");
- if ( node && node.value === id ) {
- return [ elem ];
- }
-
- // Fall back on getElementsByName
- elems = context.getElementsByName( id );
- i = 0;
- while ( (elem = elems[i++]) ) {
- node = elem.getAttributeNode("id");
- if ( node && node.value === id ) {
- return [ elem ];
- }
- }
- }
-
- return [];
- }
- };
- }
-
- // Tag
- Expr.find["TAG"] = support.getElementsByTagName ?
- function( tag, context ) {
- if ( typeof context.getElementsByTagName !== "undefined" ) {
- return context.getElementsByTagName( tag );
-
- // DocumentFragment nodes don't have gEBTN
- } else if ( support.qsa ) {
- return context.querySelectorAll( tag );
- }
- } :
-
- function( tag, context ) {
- var elem,
- tmp = [],
- i = 0,
- // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
- results = context.getElementsByTagName( tag );
-
- // Filter out possible comments
- if ( tag === "*" ) {
- while ( (elem = results[i++]) ) {
- if ( elem.nodeType === 1 ) {
- tmp.push( elem );
- }
- }
-
- return tmp;
- }
- return results;
- };
-
- // Class
- Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
- if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
- return context.getElementsByClassName( className );
- }
- };
-
- /* QSA/matchesSelector
- ---------------------------------------------------------------------- */
-
- // QSA and matchesSelector support
-
- // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
- rbuggyMatches = [];
-
- // qSa(:focus) reports false when true (Chrome 21)
- // We allow this because of a bug in IE8/9 that throws an error
- // whenever `document.activeElement` is accessed on an iframe
- // So, we allow :focus to pass through QSA all the time to avoid the IE error
- // See https://bugs.jquery.com/ticket/13378
- rbuggyQSA = [];
-
- if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
- // Build QSA regex
- // Regex strategy adopted from Diego Perini
- assert(function( el ) {
- // Select is set to empty string on purpose
- // This is to test IE's treatment of not explicitly
- // setting a boolean content attribute,
- // since its presence should be enough
- // https://bugs.jquery.com/ticket/12359
- docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
- "<select id='" + expando + "-\r\\' msallowcapture=''>" +
- "<option selected=''></option></select>";
-
- // Support: IE8, Opera 11-12.16
- // Nothing should be selected when empty strings follow ^= or $= or *=
- // The test attribute must be unknown in Opera but "safe" for WinRT
- // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
- if ( el.querySelectorAll("[msallowcapture^='']").length ) {
- rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
- }
-
- // Support: IE8
- // Boolean attributes and "value" are not treated correctly
- if ( !el.querySelectorAll("[selected]").length ) {
- rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
- }
-
- // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
- if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
- rbuggyQSA.push("~=");
- }
-
- // Webkit/Opera - :checked should return selected option elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- // IE8 throws error here and will not see later tests
- if ( !el.querySelectorAll(":checked").length ) {
- rbuggyQSA.push(":checked");
- }
-
- // Support: Safari 8+, iOS 8+
- // https://bugs.webkit.org/show_bug.cgi?id=136851
- // In-page `selector#id sibling-combinator selector` fails
- if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
- rbuggyQSA.push(".#.+[+~]");
- }
- });
-
- assert(function( el ) {
- el.innerHTML = "<a href='' disabled='disabled'></a>" +
- "<select disabled='disabled'><option/></select>";
-
- // Support: Windows 8 Native Apps
- // The type and name attributes are restricted during .innerHTML assignment
- var input = document.createElement("input");
- input.setAttribute( "type", "hidden" );
- el.appendChild( input ).setAttribute( "name", "D" );
-
- // Support: IE8
- // Enforce case-sensitivity of name attribute
- if ( el.querySelectorAll("[name=d]").length ) {
- rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
- }
-
- // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
- // IE8 throws error here and will not see later tests
- if ( el.querySelectorAll(":enabled").length !== 2 ) {
- rbuggyQSA.push( ":enabled", ":disabled" );
- }
-
- // Support: IE9-11+
- // IE's :disabled selector does not pick up the children of disabled fieldsets
- docElem.appendChild( el ).disabled = true;
- if ( el.querySelectorAll(":disabled").length !== 2 ) {
- rbuggyQSA.push( ":enabled", ":disabled" );
- }
-
- // Opera 10-11 does not throw on post-comma invalid pseudos
- el.querySelectorAll("*,:x");
- rbuggyQSA.push(",.*:");
- });
- }
-
- if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
- docElem.webkitMatchesSelector ||
- docElem.mozMatchesSelector ||
- docElem.oMatchesSelector ||
- docElem.msMatchesSelector) )) ) {
-
- assert(function( el ) {
- // Check to see if it's possible to do matchesSelector
- // on a disconnected node (IE 9)
- support.disconnectedMatch = matches.call( el, "*" );
-
- // This should fail with an exception
- // Gecko does not error, returns false instead
- matches.call( el, "[s!='']:x" );
- rbuggyMatches.push( "!=", pseudos );
- });
- }
-
- rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
- rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
-
- /* Contains
- ---------------------------------------------------------------------- */
- hasCompare = rnative.test( docElem.compareDocumentPosition );
-
- // Element contains another
- // Purposefully self-exclusive
- // As in, an element does not contain itself
- contains = hasCompare || rnative.test( docElem.contains ) ?
- function( a, b ) {
- var adown = a.nodeType === 9 ? a.documentElement : a,
- bup = b && b.parentNode;
- return a === bup || !!( bup && bup.nodeType === 1 && (
- adown.contains ?
- adown.contains( bup ) :
- a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
- ));
- } :
- function( a, b ) {
- if ( b ) {
- while ( (b = b.parentNode) ) {
- if ( b === a ) {
- return true;
- }
- }
- }
- return false;
- };
-
- /* Sorting
- ---------------------------------------------------------------------- */
-
- // Document order sorting
- sortOrder = hasCompare ?
- function( a, b ) {
-
- // Flag for duplicate removal
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
- }
-
- // Sort on method existence if only one input has compareDocumentPosition
- var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
- if ( compare ) {
- return compare;
- }
-
- // Calculate position if both inputs belong to the same document
- compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
- a.compareDocumentPosition( b ) :
-
- // Otherwise we know they are disconnected
- 1;
-
- // Disconnected nodes
- if ( compare & 1 ||
- (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
-
- // Choose the first element that is related to our preferred document
- if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
- return -1;
- }
- if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
- return 1;
- }
-
- // Maintain original order
- return sortInput ?
- ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
- 0;
- }
-
- return compare & 4 ? -1 : 1;
- } :
- function( a, b ) {
- // Exit early if the nodes are identical
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
- }
-
- var cur,
- i = 0,
- aup = a.parentNode,
- bup = b.parentNode,
- ap = [ a ],
- bp = [ b ];
-
- // Parentless nodes are either documents or disconnected
- if ( !aup || !bup ) {
- return a === document ? -1 :
- b === document ? 1 :
- aup ? -1 :
- bup ? 1 :
- sortInput ?
- ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
- 0;
-
- // If the nodes are siblings, we can do a quick check
- } else if ( aup === bup ) {
- return siblingCheck( a, b );
- }
-
- // Otherwise we need full lists of their ancestors for comparison
- cur = a;
- while ( (cur = cur.parentNode) ) {
- ap.unshift( cur );
- }
- cur = b;
- while ( (cur = cur.parentNode) ) {
- bp.unshift( cur );
- }
-
- // Walk down the tree looking for a discrepancy
- while ( ap[i] === bp[i] ) {
- i++;
- }
-
- return i ?
- // Do a sibling check if the nodes have a common ancestor
- siblingCheck( ap[i], bp[i] ) :
-
- // Otherwise nodes in our document sort first
- ap[i] === preferredDoc ? -1 :
- bp[i] === preferredDoc ? 1 :
- 0;
- };
-
- return document;
- };
-
- Sizzle.matches = function( expr, elements ) {
- return Sizzle( expr, null, null, elements );
- };
-
- Sizzle.matchesSelector = function( elem, expr ) {
- // Set document vars if needed
- if ( ( elem.ownerDocument || elem ) !== document ) {
- setDocument( elem );
- }
-
- if ( support.matchesSelector && documentIsHTML &&
- !nonnativeSelectorCache[ expr + " " ] &&
- ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
- ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
-
- try {
- var ret = matches.call( elem, expr );
-
- // IE 9's matchesSelector returns false on disconnected nodes
- if ( ret || support.disconnectedMatch ||
- // As well, disconnected nodes are said to be in a document
- // fragment in IE 9
- elem.document && elem.document.nodeType !== 11 ) {
- return ret;
- }
- } catch (e) {
- nonnativeSelectorCache( expr, true );
- }
- }
-
- return Sizzle( expr, document, null, [ elem ] ).length > 0;
- };
-
- Sizzle.contains = function( context, elem ) {
- // Set document vars if needed
- if ( ( context.ownerDocument || context ) !== document ) {
- setDocument( context );
- }
- return contains( context, elem );
- };
-
- Sizzle.attr = function( elem, name ) {
- // Set document vars if needed
- if ( ( elem.ownerDocument || elem ) !== document ) {
- setDocument( elem );
- }
-
- var fn = Expr.attrHandle[ name.toLowerCase() ],
- // Don't get fooled by Object.prototype properties (jQuery #13807)
- val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
- fn( elem, name, !documentIsHTML ) :
- undefined;
-
- return val !== undefined ?
- val :
- support.attributes || !documentIsHTML ?
- elem.getAttribute( name ) :
- (val = elem.getAttributeNode(name)) && val.specified ?
- val.value :
- null;
- };
-
- Sizzle.escape = function( sel ) {
- return (sel + "").replace( rcssescape, fcssescape );
- };
-
- Sizzle.error = function( msg ) {
- throw new Error( "Syntax error, unrecognized expression: " + msg );
- };
-
- /**
- * Document sorting and removing duplicates
- * @param {ArrayLike} results
- */
- Sizzle.uniqueSort = function( results ) {
- var elem,
- duplicates = [],
- j = 0,
- i = 0;
-
- // Unless we *know* we can detect duplicates, assume their presence
- hasDuplicate = !support.detectDuplicates;
- sortInput = !support.sortStable && results.slice( 0 );
- results.sort( sortOrder );
-
- if ( hasDuplicate ) {
- while ( (elem = results[i++]) ) {
- if ( elem === results[ i ] ) {
- j = duplicates.push( i );
- }
- }
- while ( j-- ) {
- results.splice( duplicates[ j ], 1 );
- }
- }
-
- // Clear input after sorting to release objects
- // See https://github.com/jquery/sizzle/pull/225
- sortInput = null;
-
- return results;
- };
-
- /**
- * Utility function for retrieving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
- getText = Sizzle.getText = function( elem ) {
- var node,
- ret = "",
- i = 0,
- nodeType = elem.nodeType;
-
- if ( !nodeType ) {
- // If no nodeType, this is expected to be an array
- while ( (node = elem[i++]) ) {
- // Do not traverse comment nodes
- ret += getText( node );
- }
- } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
- // Use textContent for elements
- // innerText usage removed for consistency of new lines (jQuery #11153)
- if ( typeof elem.textContent === "string" ) {
- return elem.textContent;
- } else {
- // Traverse its children
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
- ret += getText( elem );
- }
- }
- } else if ( nodeType === 3 || nodeType === 4 ) {
- return elem.nodeValue;
- }
- // Do not include comment or processing instruction nodes
-
- return ret;
- };
-
- Expr = Sizzle.selectors = {
-
- // Can be adjusted by the user
- cacheLength: 50,
-
- createPseudo: markFunction,
-
- match: matchExpr,
-
- attrHandle: {},
-
- find: {},
-
- relative: {
- ">": { dir: "parentNode", first: true },
- " ": { dir: "parentNode" },
- "+": { dir: "previousSibling", first: true },
- "~": { dir: "previousSibling" }
- },
-
- preFilter: {
- "ATTR": function( match ) {
- match[1] = match[1].replace( runescape, funescape );
-
- // Move the given value to match[3] whether quoted or unquoted
- match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
-
- if ( match[2] === "~=" ) {
- match[3] = " " + match[3] + " ";
- }
-
- return match.slice( 0, 4 );
- },
-
- "CHILD": function( match ) {
- /* matches from matchExpr["CHILD"]
- 1 type (only|nth|...)
- 2 what (child|of-type)
- 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
- 4 xn-component of xn+y argument ([+-]?\d*n|)
- 5 sign of xn-component
- 6 x of xn-component
- 7 sign of y-component
- 8 y of y-component
- */
- match[1] = match[1].toLowerCase();
-
- if ( match[1].slice( 0, 3 ) === "nth" ) {
- // nth-* requires argument
- if ( !match[3] ) {
- Sizzle.error( match[0] );
- }
-
- // numeric x and y parameters for Expr.filter.CHILD
- // remember that false/true cast respectively to 0/1
- match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
- match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
-
- // other types prohibit arguments
- } else if ( match[3] ) {
- Sizzle.error( match[0] );
- }
-
- return match;
- },
-
- "PSEUDO": function( match ) {
- var excess,
- unquoted = !match[6] && match[2];
-
- if ( matchExpr["CHILD"].test( match[0] ) ) {
- return null;
- }
-
- // Accept quoted arguments as-is
- if ( match[3] ) {
- match[2] = match[4] || match[5] || "";
-
- // Strip excess characters from unquoted arguments
- } else if ( unquoted && rpseudo.test( unquoted ) &&
- // Get excess from tokenize (recursively)
- (excess = tokenize( unquoted, true )) &&
- // advance to the next closing parenthesis
- (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
-
- // excess is a negative index
- match[0] = match[0].slice( 0, excess );
- match[2] = unquoted.slice( 0, excess );
- }
-
- // Return only captures needed by the pseudo filter method (type and argument)
- return match.slice( 0, 3 );
- }
- },
-
- filter: {
-
- "TAG": function( nodeNameSelector ) {
- var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
- return nodeNameSelector === "*" ?
- function() { return true; } :
- function( elem ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
- };
- },
-
- "CLASS": function( className ) {
- var pattern = classCache[ className + " " ];
-
- return pattern ||
- (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
- classCache( className, function( elem ) {
- return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
- });
- },
-
- "ATTR": function( name, operator, check ) {
- return function( elem ) {
- var result = Sizzle.attr( elem, name );
-
- if ( result == null ) {
- return operator === "!=";
- }
- if ( !operator ) {
- return true;
- }
-
- result += "";
-
- return operator === "=" ? result === check :
- operator === "!=" ? result !== check :
- operator === "^=" ? check && result.indexOf( check ) === 0 :
- operator === "*=" ? check && result.indexOf( check ) > -1 :
- operator === "$=" ? check && result.slice( -check.length ) === check :
- operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
- operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
- false;
- };
- },
-
- "CHILD": function( type, what, argument, first, last ) {
- var simple = type.slice( 0, 3 ) !== "nth",
- forward = type.slice( -4 ) !== "last",
- ofType = what === "of-type";
-
- return first === 1 && last === 0 ?
-
- // Shortcut for :nth-*(n)
- function( elem ) {
- return !!elem.parentNode;
- } :
-
- function( elem, context, xml ) {
- var cache, uniqueCache, outerCache, node, nodeIndex, start,
- dir = simple !== forward ? "nextSibling" : "previousSibling",
- parent = elem.parentNode,
- name = ofType && elem.nodeName.toLowerCase(),
- useCache = !xml && !ofType,
- diff = false;
-
- if ( parent ) {
-
- // :(first|last|only)-(child|of-type)
- if ( simple ) {
- while ( dir ) {
- node = elem;
- while ( (node = node[ dir ]) ) {
- if ( ofType ?
- node.nodeName.toLowerCase() === name :
- node.nodeType === 1 ) {
-
- return false;
- }
- }
- // Reverse direction for :only-* (if we haven't yet done so)
- start = dir = type === "only" && !start && "nextSibling";
- }
- return true;
- }
-
- start = [ forward ? parent.firstChild : parent.lastChild ];
-
- // non-xml :nth-child(...) stores cache data on `parent`
- if ( forward && useCache ) {
-
- // Seek `elem` from a previously-cached index
-
- // ...in a gzip-friendly way
- node = parent;
- outerCache = node[ expando ] || (node[ expando ] = {});
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ node.uniqueID ] ||
- (outerCache[ node.uniqueID ] = {});
-
- cache = uniqueCache[ type ] || [];
- nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
- diff = nodeIndex && cache[ 2 ];
- node = nodeIndex && parent.childNodes[ nodeIndex ];
-
- while ( (node = ++nodeIndex && node && node[ dir ] ||
-
- // Fallback to seeking `elem` from the start
- (diff = nodeIndex = 0) || start.pop()) ) {
-
- // When found, cache indexes on `parent` and break
- if ( node.nodeType === 1 && ++diff && node === elem ) {
- uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
- break;
- }
- }
-
- } else {
- // Use previously-cached element index if available
- if ( useCache ) {
- // ...in a gzip-friendly way
- node = elem;
- outerCache = node[ expando ] || (node[ expando ] = {});
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ node.uniqueID ] ||
- (outerCache[ node.uniqueID ] = {});
-
- cache = uniqueCache[ type ] || [];
- nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
- diff = nodeIndex;
- }
-
- // xml :nth-child(...)
- // or :nth-last-child(...) or :nth(-last)?-of-type(...)
- if ( diff === false ) {
- // Use the same loop as above to seek `elem` from the start
- while ( (node = ++nodeIndex && node && node[ dir ] ||
- (diff = nodeIndex = 0) || start.pop()) ) {
-
- if ( ( ofType ?
- node.nodeName.toLowerCase() === name :
- node.nodeType === 1 ) &&
- ++diff ) {
-
- // Cache the index of each encountered element
- if ( useCache ) {
- outerCache = node[ expando ] || (node[ expando ] = {});
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ node.uniqueID ] ||
- (outerCache[ node.uniqueID ] = {});
-
- uniqueCache[ type ] = [ dirruns, diff ];
- }
-
- if ( node === elem ) {
- break;
- }
- }
- }
- }
- }
-
- // Incorporate the offset, then check against cycle size
- diff -= last;
- return diff === first || ( diff % first === 0 && diff / first >= 0 );
- }
- };
- },
-
- "PSEUDO": function( pseudo, argument ) {
- // pseudo-class names are case-insensitive
- // http://www.w3.org/TR/selectors/#pseudo-classes
- // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
- // Remember that setFilters inherits from pseudos
- var args,
- fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
- Sizzle.error( "unsupported pseudo: " + pseudo );
-
- // The user may use createPseudo to indicate that
- // arguments are needed to create the filter function
- // just as Sizzle does
- if ( fn[ expando ] ) {
- return fn( argument );
- }
-
- // But maintain support for old signatures
- if ( fn.length > 1 ) {
- args = [ pseudo, pseudo, "", argument ];
- return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
- markFunction(function( seed, matches ) {
- var idx,
- matched = fn( seed, argument ),
- i = matched.length;
- while ( i-- ) {
- idx = indexOf( seed, matched[i] );
- seed[ idx ] = !( matches[ idx ] = matched[i] );
- }
- }) :
- function( elem ) {
- return fn( elem, 0, args );
- };
- }
-
- return fn;
- }
- },
-
- pseudos: {
- // Potentially complex pseudos
- "not": markFunction(function( selector ) {
- // Trim the selector passed to compile
- // to avoid treating leading and trailing
- // spaces as combinators
- var input = [],
- results = [],
- matcher = compile( selector.replace( rtrim, "$1" ) );
-
- return matcher[ expando ] ?
- markFunction(function( seed, matches, context, xml ) {
- var elem,
- unmatched = matcher( seed, null, xml, [] ),
- i = seed.length;
-
- // Match elements unmatched by `matcher`
- while ( i-- ) {
- if ( (elem = unmatched[i]) ) {
- seed[i] = !(matches[i] = elem);
- }
- }
- }) :
- function( elem, context, xml ) {
- input[0] = elem;
- matcher( input, null, xml, results );
- // Don't keep the element (issue #299)
- input[0] = null;
- return !results.pop();
- };
- }),
-
- "has": markFunction(function( selector ) {
- return function( elem ) {
- return Sizzle( selector, elem ).length > 0;
- };
- }),
-
- "contains": markFunction(function( text ) {
- text = text.replace( runescape, funescape );
- return function( elem ) {
- return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
- };
- }),
-
- // "Whether an element is represented by a :lang() selector
- // is based solely on the element's language value
- // being equal to the identifier C,
- // or beginning with the identifier C immediately followed by "-".
- // The matching of C against the element's language value is performed case-insensitively.
- // The identifier C does not have to be a valid language name."
- // http://www.w3.org/TR/selectors/#lang-pseudo
- "lang": markFunction( function( lang ) {
- // lang value must be a valid identifier
- if ( !ridentifier.test(lang || "") ) {
- Sizzle.error( "unsupported lang: " + lang );
- }
- lang = lang.replace( runescape, funescape ).toLowerCase();
- return function( elem ) {
- var elemLang;
- do {
- if ( (elemLang = documentIsHTML ?
- elem.lang :
- elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
-
- elemLang = elemLang.toLowerCase();
- return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
- }
- } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
- return false;
- };
- }),
-
- // Miscellaneous
- "target": function( elem ) {
- var hash = window.location && window.location.hash;
- return hash && hash.slice( 1 ) === elem.id;
- },
-
- "root": function( elem ) {
- return elem === docElem;
- },
-
- "focus": function( elem ) {
- return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
- },
-
- // Boolean properties
- "enabled": createDisabledPseudo( false ),
- "disabled": createDisabledPseudo( true ),
-
- "checked": function( elem ) {
- // In CSS3, :checked should return both checked and selected elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- var nodeName = elem.nodeName.toLowerCase();
- return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
- },
-
- "selected": function( elem ) {
- // Accessing this property makes selected-by-default
- // options in Safari work properly
- if ( elem.parentNode ) {
- elem.parentNode.selectedIndex;
- }
-
- return elem.selected === true;
- },
-
- // Contents
- "empty": function( elem ) {
- // http://www.w3.org/TR/selectors/#empty-pseudo
- // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
- // but not by others (comment: 8; processing instruction: 7; etc.)
- // nodeType < 6 works because attributes (2) do not appear as children
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
- if ( elem.nodeType < 6 ) {
- return false;
- }
- }
- return true;
- },
-
- "parent": function( elem ) {
- return !Expr.pseudos["empty"]( elem );
- },
-
- // Element/input types
- "header": function( elem ) {
- return rheader.test( elem.nodeName );
- },
-
- "input": function( elem ) {
- return rinputs.test( elem.nodeName );
- },
-
- "button": function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === "button" || name === "button";
- },
-
- "text": function( elem ) {
- var attr;
- return elem.nodeName.toLowerCase() === "input" &&
- elem.type === "text" &&
-
- // Support: IE<8
- // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
- ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
- },
-
- // Position-in-collection
- "first": createPositionalPseudo(function() {
- return [ 0 ];
- }),
-
- "last": createPositionalPseudo(function( matchIndexes, length ) {
- return [ length - 1 ];
- }),
-
- "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
- return [ argument < 0 ? argument + length : argument ];
- }),
-
- "even": createPositionalPseudo(function( matchIndexes, length ) {
- var i = 0;
- for ( ; i < length; i += 2 ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "odd": createPositionalPseudo(function( matchIndexes, length ) {
- var i = 1;
- for ( ; i < length; i += 2 ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
- var i = argument < 0 ?
- argument + length :
- argument > length ?
- length :
- argument;
- for ( ; --i >= 0; ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
- var i = argument < 0 ? argument + length : argument;
- for ( ; ++i < length; ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- })
- }
- };
-
- Expr.pseudos["nth"] = Expr.pseudos["eq"];
-
- // Add button/input type pseudos
- for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
- Expr.pseudos[ i ] = createInputPseudo( i );
- }
- for ( i in { submit: true, reset: true } ) {
- Expr.pseudos[ i ] = createButtonPseudo( i );
- }
-
- // Easy API for creating new setFilters
- function setFilters() {}
- setFilters.prototype = Expr.filters = Expr.pseudos;
- Expr.setFilters = new setFilters();
-
- tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
- var matched, match, tokens, type,
- soFar, groups, preFilters,
- cached = tokenCache[ selector + " " ];
-
- if ( cached ) {
- return parseOnly ? 0 : cached.slice( 0 );
- }
-
- soFar = selector;
- groups = [];
- preFilters = Expr.preFilter;
-
- while ( soFar ) {
-
- // Comma and first run
- if ( !matched || (match = rcomma.exec( soFar )) ) {
- if ( match ) {
- // Don't consume trailing commas as valid
- soFar = soFar.slice( match[0].length ) || soFar;
- }
- groups.push( (tokens = []) );
- }
-
- matched = false;
-
- // Combinators
- if ( (match = rcombinators.exec( soFar )) ) {
- matched = match.shift();
- tokens.push({
- value: matched,
- // Cast descendant combinators to space
- type: match[0].replace( rtrim, " " )
- });
- soFar = soFar.slice( matched.length );
- }
-
- // Filters
- for ( type in Expr.filter ) {
- if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
- (match = preFilters[ type ]( match ))) ) {
- matched = match.shift();
- tokens.push({
- value: matched,
- type: type,
- matches: match
- });
- soFar = soFar.slice( matched.length );
- }
- }
-
- if ( !matched ) {
- break;
- }
- }
-
- // Return the length of the invalid excess
- // if we're just parsing
- // Otherwise, throw an error or return tokens
- return parseOnly ?
- soFar.length :
- soFar ?
- Sizzle.error( selector ) :
- // Cache the tokens
- tokenCache( selector, groups ).slice( 0 );
- };
-
- function toSelector( tokens ) {
- var i = 0,
- len = tokens.length,
- selector = "";
- for ( ; i < len; i++ ) {
- selector += tokens[i].value;
- }
- return selector;
- }
-
- function addCombinator( matcher, combinator, base ) {
- var dir = combinator.dir,
- skip = combinator.next,
- key = skip || dir,
- checkNonElements = base && key === "parentNode",
- doneName = done++;
-
- return combinator.first ?
- // Check against closest ancestor/preceding element
- function( elem, context, xml ) {
- while ( (elem = elem[ dir ]) ) {
- if ( elem.nodeType === 1 || checkNonElements ) {
- return matcher( elem, context, xml );
- }
- }
- return false;
- } :
-
- // Check against all ancestor/preceding elements
- function( elem, context, xml ) {
- var oldCache, uniqueCache, outerCache,
- newCache = [ dirruns, doneName ];
-
- // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
- if ( xml ) {
- while ( (elem = elem[ dir ]) ) {
- if ( elem.nodeType === 1 || checkNonElements ) {
- if ( matcher( elem, context, xml ) ) {
- return true;
- }
- }
- }
- } else {
- while ( (elem = elem[ dir ]) ) {
- if ( elem.nodeType === 1 || checkNonElements ) {
- outerCache = elem[ expando ] || (elem[ expando ] = {});
-
- // Support: IE <9 only
- // Defend against cloned attroperties (jQuery gh-1709)
- uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
-
- if ( skip && skip === elem.nodeName.toLowerCase() ) {
- elem = elem[ dir ] || elem;
- } else if ( (oldCache = uniqueCache[ key ]) &&
- oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
-
- // Assign to newCache so results back-propagate to previous elements
- return (newCache[ 2 ] = oldCache[ 2 ]);
- } else {
- // Reuse newcache so results back-propagate to previous elements
- uniqueCache[ key ] = newCache;
-
- // A match means we're done; a fail means we have to keep checking
- if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
- return true;
- }
- }
- }
- }
- }
- return false;
- };
- }
-
- function elementMatcher( matchers ) {
- return matchers.length > 1 ?
- function( elem, context, xml ) {
- var i = matchers.length;
- while ( i-- ) {
- if ( !matchers[i]( elem, context, xml ) ) {
- return false;
- }
- }
- return true;
- } :
- matchers[0];
- }
-
- function multipleContexts( selector, contexts, results ) {
- var i = 0,
- len = contexts.length;
- for ( ; i < len; i++ ) {
- Sizzle( selector, contexts[i], results );
- }
- return results;
- }
-
- function condense( unmatched, map, filter, context, xml ) {
- var elem,
- newUnmatched = [],
- i = 0,
- len = unmatched.length,
- mapped = map != null;
-
- for ( ; i < len; i++ ) {
- if ( (elem = unmatched[i]) ) {
- if ( !filter || filter( elem, context, xml ) ) {
- newUnmatched.push( elem );
- if ( mapped ) {
- map.push( i );
- }
- }
- }
- }
-
- return newUnmatched;
- }
-
- function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
- if ( postFilter && !postFilter[ expando ] ) {
- postFilter = setMatcher( postFilter );
- }
- if ( postFinder && !postFinder[ expando ] ) {
- postFinder = setMatcher( postFinder, postSelector );
- }
- return markFunction(function( seed, results, context, xml ) {
- var temp, i, elem,
- preMap = [],
- postMap = [],
- preexisting = results.length,
-
- // Get initial elements from seed or context
- elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
-
- // Prefilter to get matcher input, preserving a map for seed-results synchronization
- matcherIn = preFilter && ( seed || !selector ) ?
- condense( elems, preMap, preFilter, context, xml ) :
- elems,
-
- matcherOut = matcher ?
- // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
- postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
-
- // ...intermediate processing is necessary
- [] :
-
- // ...otherwise use results directly
- results :
- matcherIn;
-
- // Find primary matches
- if ( matcher ) {
- matcher( matcherIn, matcherOut, context, xml );
- }
-
- // Apply postFilter
- if ( postFilter ) {
- temp = condense( matcherOut, postMap );
- postFilter( temp, [], context, xml );
-
- // Un-match failing elements by moving them back to matcherIn
- i = temp.length;
- while ( i-- ) {
- if ( (elem = temp[i]) ) {
- matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
- }
- }
- }
-
- if ( seed ) {
- if ( postFinder || preFilter ) {
- if ( postFinder ) {
- // Get the final matcherOut by condensing this intermediate into postFinder contexts
- temp = [];
- i = matcherOut.length;
- while ( i-- ) {
- if ( (elem = matcherOut[i]) ) {
- // Restore matcherIn since elem is not yet a final match
- temp.push( (matcherIn[i] = elem) );
- }
- }
- postFinder( null, (matcherOut = []), temp, xml );
- }
-
- // Move matched elements from seed to results to keep them synchronized
- i = matcherOut.length;
- while ( i-- ) {
- if ( (elem = matcherOut[i]) &&
- (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
-
- seed[temp] = !(results[temp] = elem);
- }
- }
- }
-
- // Add elements to results, through postFinder if defined
- } else {
- matcherOut = condense(
- matcherOut === results ?
- matcherOut.splice( preexisting, matcherOut.length ) :
- matcherOut
- );
- if ( postFinder ) {
- postFinder( null, results, matcherOut, xml );
- } else {
- push.apply( results, matcherOut );
- }
- }
- });
- }
-
- function matcherFromTokens( tokens ) {
- var checkContext, matcher, j,
- len = tokens.length,
- leadingRelative = Expr.relative[ tokens[0].type ],
- implicitRelative = leadingRelative || Expr.relative[" "],
- i = leadingRelative ? 1 : 0,
-
- // The foundational matcher ensures that elements are reachable from top-level context(s)
- matchContext = addCombinator( function( elem ) {
- return elem === checkContext;
- }, implicitRelative, true ),
- matchAnyContext = addCombinator( function( elem ) {
- return indexOf( checkContext, elem ) > -1;
- }, implicitRelative, true ),
- matchers = [ function( elem, context, xml ) {
- var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
- (checkContext = context).nodeType ?
- matchContext( elem, context, xml ) :
- matchAnyContext( elem, context, xml ) );
- // Avoid hanging onto element (issue #299)
- checkContext = null;
- return ret;
- } ];
-
- for ( ; i < len; i++ ) {
- if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
- matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
- } else {
- matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
-
- // Return special upon seeing a positional matcher
- if ( matcher[ expando ] ) {
- // Find the next relative operator (if any) for proper handling
- j = ++i;
- for ( ; j < len; j++ ) {
- if ( Expr.relative[ tokens[j].type ] ) {
- break;
- }
- }
- return setMatcher(
- i > 1 && elementMatcher( matchers ),
- i > 1 && toSelector(
- // If the preceding token was a descendant combinator, insert an implicit any-element `*`
- tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
- ).replace( rtrim, "$1" ),
- matcher,
- i < j && matcherFromTokens( tokens.slice( i, j ) ),
- j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
- j < len && toSelector( tokens )
- );
- }
- matchers.push( matcher );
- }
- }
-
- return elementMatcher( matchers );
- }
-
- function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
- var bySet = setMatchers.length > 0,
- byElement = elementMatchers.length > 0,
- superMatcher = function( seed, context, xml, results, outermost ) {
- var elem, j, matcher,
- matchedCount = 0,
- i = "0",
- unmatched = seed && [],
- setMatched = [],
- contextBackup = outermostContext,
- // We must always have either seed elements or outermost context
- elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
- // Use integer dirruns iff this is the outermost matcher
- dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
- len = elems.length;
-
- if ( outermost ) {
- outermostContext = context === document || context || outermost;
- }
-
- // Add elements passing elementMatchers directly to results
- // Support: IE<9, Safari
- // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
- for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
- if ( byElement && elem ) {
- j = 0;
- if ( !context && elem.ownerDocument !== document ) {
- setDocument( elem );
- xml = !documentIsHTML;
- }
- while ( (matcher = elementMatchers[j++]) ) {
- if ( matcher( elem, context || document, xml) ) {
- results.push( elem );
- break;
- }
- }
- if ( outermost ) {
- dirruns = dirrunsUnique;
- }
- }
-
- // Track unmatched elements for set filters
- if ( bySet ) {
- // They will have gone through all possible matchers
- if ( (elem = !matcher && elem) ) {
- matchedCount--;
- }
-
- // Lengthen the array for every element, matched or not
- if ( seed ) {
- unmatched.push( elem );
- }
- }
- }
-
- // `i` is now the count of elements visited above, and adding it to `matchedCount`
- // makes the latter nonnegative.
- matchedCount += i;
-
- // Apply set filters to unmatched elements
- // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
- // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
- // no element matchers and no seed.
- // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
- // case, which will result in a "00" `matchedCount` that differs from `i` but is also
- // numerically zero.
- if ( bySet && i !== matchedCount ) {
- j = 0;
- while ( (matcher = setMatchers[j++]) ) {
- matcher( unmatched, setMatched, context, xml );
- }
-
- if ( seed ) {
- // Reintegrate element matches to eliminate the need for sorting
- if ( matchedCount > 0 ) {
- while ( i-- ) {
- if ( !(unmatched[i] || setMatched[i]) ) {
- setMatched[i] = pop.call( results );
- }
- }
- }
-
- // Discard index placeholder values to get only actual matches
- setMatched = condense( setMatched );
- }
-
- // Add matches to results
- push.apply( results, setMatched );
-
- // Seedless set matches succeeding multiple successful matchers stipulate sorting
- if ( outermost && !seed && setMatched.length > 0 &&
- ( matchedCount + setMatchers.length ) > 1 ) {
-
- Sizzle.uniqueSort( results );
- }
- }
-
- // Override manipulation of globals by nested matchers
- if ( outermost ) {
- dirruns = dirrunsUnique;
- outermostContext = contextBackup;
- }
-
- return unmatched;
- };
-
- return bySet ?
- markFunction( superMatcher ) :
- superMatcher;
- }
-
- compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
- var i,
- setMatchers = [],
- elementMatchers = [],
- cached = compilerCache[ selector + " " ];
-
- if ( !cached ) {
- // Generate a function of recursive functions that can be used to check each element
- if ( !match ) {
- match = tokenize( selector );
- }
- i = match.length;
- while ( i-- ) {
- cached = matcherFromTokens( match[i] );
- if ( cached[ expando ] ) {
- setMatchers.push( cached );
- } else {
- elementMatchers.push( cached );
- }
- }
-
- // Cache the compiled function
- cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
-
- // Save selector and tokenization
- cached.selector = selector;
- }
- return cached;
- };
-
- /**
- * A low-level selection function that works with Sizzle's compiled
- * selector functions
- * @param {String|Function} selector A selector or a pre-compiled
- * selector function built with Sizzle.compile
- * @param {Element} context
- * @param {Array} [results]
- * @param {Array} [seed] A set of elements to match against
- */
- select = Sizzle.select = function( selector, context, results, seed ) {
- var i, tokens, token, type, find,
- compiled = typeof selector === "function" && selector,
- match = !seed && tokenize( (selector = compiled.selector || selector) );
-
- results = results || [];
-
- // Try to minimize operations if there is only one selector in the list and no seed
- // (the latter of which guarantees us context)
- if ( match.length === 1 ) {
-
- // Reduce context if the leading compound selector is an ID
- tokens = match[0] = match[0].slice( 0 );
- if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
- context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
-
- context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
- if ( !context ) {
- return results;
-
- // Precompiled matchers will still verify ancestry, so step up a level
- } else if ( compiled ) {
- context = context.parentNode;
- }
-
- selector = selector.slice( tokens.shift().value.length );
- }
-
- // Fetch a seed set for right-to-left matching
- i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
- while ( i-- ) {
- token = tokens[i];
-
- // Abort if we hit a combinator
- if ( Expr.relative[ (type = token.type) ] ) {
- break;
- }
- if ( (find = Expr.find[ type ]) ) {
- // Search, expanding context for leading sibling combinators
- if ( (seed = find(
- token.matches[0].replace( runescape, funescape ),
- rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
- )) ) {
-
- // If seed is empty or no tokens remain, we can return early
- tokens.splice( i, 1 );
- selector = seed.length && toSelector( tokens );
- if ( !selector ) {
- push.apply( results, seed );
- return results;
- }
-
- break;
- }
- }
- }
- }
-
- // Compile and execute a filtering function if one is not provided
- // Provide `match` to avoid retokenization if we modified the selector above
- ( compiled || compile( selector, match ) )(
- seed,
- context,
- !documentIsHTML,
- results,
- !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
- );
- return results;
- };
-
- // One-time assignments
-
- // Sort stability
- support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
-
- // Support: Chrome 14-35+
- // Always assume duplicates if they aren't passed to the comparison function
- support.detectDuplicates = !!hasDuplicate;
-
- // Initialize against the default document
- setDocument();
-
- // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
- // Detached nodes confoundingly follow *each other*
- support.sortDetached = assert(function( el ) {
- // Should return 1, but returns 4 (following)
- return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
- });
-
- // Support: IE<8
- // Prevent attribute/property "interpolation"
- // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
- if ( !assert(function( el ) {
- el.innerHTML = "<a href='#'></a>";
- return el.firstChild.getAttribute("href") === "#" ;
- }) ) {
- addHandle( "type|href|height|width", function( elem, name, isXML ) {
- if ( !isXML ) {
- return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
- }
- });
- }
-
- // Support: IE<9
- // Use defaultValue in place of getAttribute("value")
- if ( !support.attributes || !assert(function( el ) {
- el.innerHTML = "<input/>";
- el.firstChild.setAttribute( "value", "" );
- return el.firstChild.getAttribute( "value" ) === "";
- }) ) {
- addHandle( "value", function( elem, name, isXML ) {
- if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
- return elem.defaultValue;
- }
- });
- }
-
- // Support: IE<9
- // Use getAttributeNode to fetch booleans when getAttribute lies
- if ( !assert(function( el ) {
- return el.getAttribute("disabled") == null;
- }) ) {
- addHandle( booleans, function( elem, name, isXML ) {
- var val;
- if ( !isXML ) {
- return elem[ name ] === true ? name.toLowerCase() :
- (val = elem.getAttributeNode( name )) && val.specified ?
- val.value :
- null;
- }
- });
- }
-
- return Sizzle;
-
- })( window );
-
-
-
- jQuery.find = Sizzle;
- jQuery.expr = Sizzle.selectors;
-
- // Deprecated
- jQuery.expr[ ":" ] = jQuery.expr.pseudos;
- jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
- jQuery.text = Sizzle.getText;
- jQuery.isXMLDoc = Sizzle.isXML;
- jQuery.contains = Sizzle.contains;
- jQuery.escapeSelector = Sizzle.escape;
-
-
-
-
- var dir = function( elem, dir, until ) {
- var matched = [],
- truncate = until !== undefined;
-
- while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
- if ( elem.nodeType === 1 ) {
- if ( truncate && jQuery( elem ).is( until ) ) {
- break;
- }
- matched.push( elem );
- }
- }
- return matched;
- };
-
-
- var siblings = function( n, elem ) {
- var matched = [];
-
- for ( ; n; n = n.nextSibling ) {
- if ( n.nodeType === 1 && n !== elem ) {
- matched.push( n );
- }
- }
-
- return matched;
- };
-
-
- var rneedsContext = jQuery.expr.match.needsContext;
-
-
-
- function nodeName( elem, name ) {
-
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
-
- };
- var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
-
-
-
- // Implement the identical functionality for filter and not
- function winnow( elements, qualifier, not ) {
- if ( isFunction( qualifier ) ) {
- return jQuery.grep( elements, function( elem, i ) {
- return !!qualifier.call( elem, i, elem ) !== not;
- } );
- }
-
- // Single element
- if ( qualifier.nodeType ) {
- return jQuery.grep( elements, function( elem ) {
- return ( elem === qualifier ) !== not;
- } );
- }
-
- // Arraylike of elements (jQuery, arguments, Array)
- if ( typeof qualifier !== "string" ) {
- return jQuery.grep( elements, function( elem ) {
- return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
- } );
- }
-
- // Filtered directly for both simple and complex selectors
- return jQuery.filter( qualifier, elements, not );
- }
-
- jQuery.filter = function( expr, elems, not ) {
- var elem = elems[ 0 ];
-
- if ( not ) {
- expr = ":not(" + expr + ")";
- }
-
- if ( elems.length === 1 && elem.nodeType === 1 ) {
- return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
- }
-
- return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
- return elem.nodeType === 1;
- } ) );
- };
-
- jQuery.fn.extend( {
- find: function( selector ) {
- var i, ret,
- len = this.length,
- self = this;
-
- if ( typeof selector !== "string" ) {
- return this.pushStack( jQuery( selector ).filter( function() {
- for ( i = 0; i < len; i++ ) {
- if ( jQuery.contains( self[ i ], this ) ) {
- return true;
- }
- }
- } ) );
- }
-
- ret = this.pushStack( [] );
-
- for ( i = 0; i < len; i++ ) {
- jQuery.find( selector, self[ i ], ret );
- }
-
- return len > 1 ? jQuery.uniqueSort( ret ) : ret;
- },
- filter: function( selector ) {
- return this.pushStack( winnow( this, selector || [], false ) );
- },
- not: function( selector ) {
- return this.pushStack( winnow( this, selector || [], true ) );
- },
- is: function( selector ) {
- return !!winnow(
- this,
-
- // If this is a positional/relative selector, check membership in the returned set
- // so $("p:first").is("p:last") won't return true for a doc with two "p".
- typeof selector === "string" && rneedsContext.test( selector ) ?
- jQuery( selector ) :
- selector || [],
- false
- ).length;
- }
- } );
-
-
- // Initialize a jQuery object
-
-
- // A central reference to the root jQuery(document)
- var rootjQuery,
-
- // A simple way to check for HTML strings
- // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
- // Strict HTML recognition (#11290: must start with <)
- // Shortcut simple #id case for speed
- rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
-
- init = jQuery.fn.init = function( selector, context, root ) {
- var match, elem;
-
- // HANDLE: $(""), $(null), $(undefined), $(false)
- if ( !selector ) {
- return this;
- }
-
- // Method init() accepts an alternate rootjQuery
- // so migrate can support jQuery.sub (gh-2101)
- root = root || rootjQuery;
-
- // Handle HTML strings
- if ( typeof selector === "string" ) {
- if ( selector[ 0 ] === "<" &&
- selector[ selector.length - 1 ] === ">" &&
- selector.length >= 3 ) {
-
- // Assume that strings that start and end with <> are HTML and skip the regex check
- match = [ null, selector, null ];
-
- } else {
- match = rquickExpr.exec( selector );
- }
-
- // Match html or make sure no context is specified for #id
- if ( match && ( match[ 1 ] || !context ) ) {
-
- // HANDLE: $(html) -> $(array)
- if ( match[ 1 ] ) {
- context = context instanceof jQuery ? context[ 0 ] : context;
-
- // Option to run scripts is true for back-compat
- // Intentionally let the error be thrown if parseHTML is not present
- jQuery.merge( this, jQuery.parseHTML(
- match[ 1 ],
- context && context.nodeType ? context.ownerDocument || context : document,
- true
- ) );
-
- // HANDLE: $(html, props)
- if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
- for ( match in context ) {
-
- // Properties of context are called as methods if possible
- if ( isFunction( this[ match ] ) ) {
- this[ match ]( context[ match ] );
-
- // ...and otherwise set as attributes
- } else {
- this.attr( match, context[ match ] );
- }
- }
- }
-
- return this;
-
- // HANDLE: $(#id)
- } else {
- elem = document.getElementById( match[ 2 ] );
-
- if ( elem ) {
-
- // Inject the element directly into the jQuery object
- this[ 0 ] = elem;
- this.length = 1;
- }
- return this;
- }
-
- // HANDLE: $(expr, $(...))
- } else if ( !context || context.jquery ) {
- return ( context || root ).find( selector );
-
- // HANDLE: $(expr, context)
- // (which is just equivalent to: $(context).find(expr)
- } else {
- return this.constructor( context ).find( selector );
- }
-
- // HANDLE: $(DOMElement)
- } else if ( selector.nodeType ) {
- this[ 0 ] = selector;
- this.length = 1;
- return this;
-
- // HANDLE: $(function)
- // Shortcut for document ready
- } else if ( isFunction( selector ) ) {
- return root.ready !== undefined ?
- root.ready( selector ) :
-
- // Execute immediately if ready is not present
- selector( jQuery );
- }
-
- return jQuery.makeArray( selector, this );
- };
-
- // Give the init function the jQuery prototype for later instantiation
- init.prototype = jQuery.fn;
-
- // Initialize central reference
- rootjQuery = jQuery( document );
-
-
- var rparentsprev = /^(?:parents|prev(?:Until|All))/,
-
- // Methods guaranteed to produce a unique set when starting from a unique set
- guaranteedUnique = {
- children: true,
- contents: true,
- next: true,
- prev: true
- };
-
- jQuery.fn.extend( {
- has: function( target ) {
- var targets = jQuery( target, this ),
- l = targets.length;
-
- return this.filter( function() {
- var i = 0;
- for ( ; i < l; i++ ) {
- if ( jQuery.contains( this, targets[ i ] ) ) {
- return true;
- }
- }
- } );
- },
-
- closest: function( selectors, context ) {
- var cur,
- i = 0,
- l = this.length,
- matched = [],
- targets = typeof selectors !== "string" && jQuery( selectors );
-
- // Positional selectors never match, since there's no _selection_ context
- if ( !rneedsContext.test( selectors ) ) {
- for ( ; i < l; i++ ) {
- for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
-
- // Always skip document fragments
- if ( cur.nodeType < 11 && ( targets ?
- targets.index( cur ) > -1 :
-
- // Don't pass non-elements to Sizzle
- cur.nodeType === 1 &&
- jQuery.find.matchesSelector( cur, selectors ) ) ) {
-
- matched.push( cur );
- break;
- }
- }
- }
- }
-
- return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
- },
-
- // Determine the position of an element within the set
- index: function( elem ) {
-
- // No argument, return index in parent
- if ( !elem ) {
- return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
- }
-
- // Index in selector
- if ( typeof elem === "string" ) {
- return indexOf.call( jQuery( elem ), this[ 0 ] );
- }
-
- // Locate the position of the desired element
- return indexOf.call( this,
-
- // If it receives a jQuery object, the first element is used
- elem.jquery ? elem[ 0 ] : elem
- );
- },
-
- add: function( selector, context ) {
- return this.pushStack(
- jQuery.uniqueSort(
- jQuery.merge( this.get(), jQuery( selector, context ) )
- )
- );
- },
-
- addBack: function( selector ) {
- return this.add( selector == null ?
- this.prevObject : this.prevObject.filter( selector )
- );
- }
- } );
-
- function sibling( cur, dir ) {
- while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
- return cur;
- }
-
- jQuery.each( {
- parent: function( elem ) {
- var parent = elem.parentNode;
- return parent && parent.nodeType !== 11 ? parent : null;
- },
- parents: function( elem ) {
- return dir( elem, "parentNode" );
- },
- parentsUntil: function( elem, i, until ) {
- return dir( elem, "parentNode", until );
- },
- next: function( elem ) {
- return sibling( elem, "nextSibling" );
- },
- prev: function( elem ) {
- return sibling( elem, "previousSibling" );
- },
- nextAll: function( elem ) {
- return dir( elem, "nextSibling" );
- },
- prevAll: function( elem ) {
- return dir( elem, "previousSibling" );
- },
- nextUntil: function( elem, i, until ) {
- return dir( elem, "nextSibling", until );
- },
- prevUntil: function( elem, i, until ) {
- return dir( elem, "previousSibling", until );
- },
- siblings: function( elem ) {
- return siblings( ( elem.parentNode || {} ).firstChild, elem );
- },
- children: function( elem ) {
- return siblings( elem.firstChild );
- },
- contents: function( elem ) {
- if ( typeof elem.contentDocument !== "undefined" ) {
- return elem.contentDocument;
- }
-
- // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
- // Treat the template element as a regular one in browsers that
- // don't support it.
- if ( nodeName( elem, "template" ) ) {
- elem = elem.content || elem;
- }
-
- return jQuery.merge( [], elem.childNodes );
- }
- }, function( name, fn ) {
- jQuery.fn[ name ] = function( until, selector ) {
- var matched = jQuery.map( this, fn, until );
-
- if ( name.slice( -5 ) !== "Until" ) {
- selector = until;
- }
-
- if ( selector && typeof selector === "string" ) {
- matched = jQuery.filter( selector, matched );
- }
-
- if ( this.length > 1 ) {
-
- // Remove duplicates
- if ( !guaranteedUnique[ name ] ) {
- jQuery.uniqueSort( matched );
- }
-
- // Reverse order for parents* and prev-derivatives
- if ( rparentsprev.test( name ) ) {
- matched.reverse();
- }
- }
-
- return this.pushStack( matched );
- };
- } );
- var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
-
-
-
- // Convert String-formatted options into Object-formatted ones
- function createOptions( options ) {
- var object = {};
- jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
- object[ flag ] = true;
- } );
- return object;
- }
-
- /*
- * Create a callback list using the following parameters:
- *
- * options: an optional list of space-separated options that will change how
- * the callback list behaves or a more traditional option object
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible options:
- *
- * once: will ensure the callback list can only be fired once (like a Deferred)
- *
- * memory: will keep track of previous values and will call any callback added
- * after the list has been fired right away with the latest "memorized"
- * values (like a Deferred)
- *
- * unique: will ensure a callback can only be added once (no duplicate in the list)
- *
- * stopOnFalse: interrupt callings when a callback returns false
- *
- */
- jQuery.Callbacks = function( options ) {
-
- // Convert options from String-formatted to Object-formatted if needed
- // (we check in cache first)
- options = typeof options === "string" ?
- createOptions( options ) :
- jQuery.extend( {}, options );
-
- var // Flag to know if list is currently firing
- firing,
-
- // Last fire value for non-forgettable lists
- memory,
-
- // Flag to know if list was already fired
- fired,
-
- // Flag to prevent firing
- locked,
-
- // Actual callback list
- list = [],
-
- // Queue of execution data for repeatable lists
- queue = [],
-
- // Index of currently firing callback (modified by add/remove as needed)
- firingIndex = -1,
-
- // Fire callbacks
- fire = function() {
-
- // Enforce single-firing
- locked = locked || options.once;
-
- // Execute callbacks for all pending executions,
- // respecting firingIndex overrides and runtime changes
- fired = firing = true;
- for ( ; queue.length; firingIndex = -1 ) {
- memory = queue.shift();
- while ( ++firingIndex < list.length ) {
-
- // Run callback and check for early termination
- if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
- options.stopOnFalse ) {
-
- // Jump to end and forget the data so .add doesn't re-fire
- firingIndex = list.length;
- memory = false;
- }
- }
- }
-
- // Forget the data if we're done with it
- if ( !options.memory ) {
- memory = false;
- }
-
- firing = false;
-
- // Clean up if we're done firing for good
- if ( locked ) {
-
- // Keep an empty list if we have data for future add calls
- if ( memory ) {
- list = [];
-
- // Otherwise, this object is spent
- } else {
- list = "";
- }
- }
- },
-
- // Actual Callbacks object
- self = {
-
- // Add a callback or a collection of callbacks to the list
- add: function() {
- if ( list ) {
-
- // If we have memory from a past run, we should fire after adding
- if ( memory && !firing ) {
- firingIndex = list.length - 1;
- queue.push( memory );
- }
-
- ( function add( args ) {
- jQuery.each( args, function( _, arg ) {
- if ( isFunction( arg ) ) {
- if ( !options.unique || !self.has( arg ) ) {
- list.push( arg );
- }
- } else if ( arg && arg.length && toType( arg ) !== "string" ) {
-
- // Inspect recursively
- add( arg );
- }
- } );
- } )( arguments );
-
- if ( memory && !firing ) {
- fire();
- }
- }
- return this;
- },
-
- // Remove a callback from the list
- remove: function() {
- jQuery.each( arguments, function( _, arg ) {
- var index;
- while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
- list.splice( index, 1 );
-
- // Handle firing indexes
- if ( index <= firingIndex ) {
- firingIndex--;
- }
- }
- } );
- return this;
- },
-
- // Check if a given callback is in the list.
- // If no argument is given, return whether or not list has callbacks attached.
- has: function( fn ) {
- return fn ?
- jQuery.inArray( fn, list ) > -1 :
- list.length > 0;
- },
-
- // Remove all callbacks from the list
- empty: function() {
- if ( list ) {
- list = [];
- }
- return this;
- },
-
- // Disable .fire and .add
- // Abort any current/pending executions
- // Clear all callbacks and values
- disable: function() {
- locked = queue = [];
- list = memory = "";
- return this;
- },
- disabled: function() {
- return !list;
- },
-
- // Disable .fire
- // Also disable .add unless we have memory (since it would have no effect)
- // Abort any pending executions
- lock: function() {
- locked = queue = [];
- if ( !memory && !firing ) {
- list = memory = "";
- }
- return this;
- },
- locked: function() {
- return !!locked;
- },
-
- // Call all callbacks with the given context and arguments
- fireWith: function( context, args ) {
- if ( !locked ) {
- args = args || [];
- args = [ context, args.slice ? args.slice() : args ];
- queue.push( args );
- if ( !firing ) {
- fire();
- }
- }
- return this;
- },
-
- // Call all the callbacks with the given arguments
- fire: function() {
- self.fireWith( this, arguments );
- return this;
- },
-
- // To know if the callbacks have already been called at least once
- fired: function() {
- return !!fired;
- }
- };
-
- return self;
- };
-
-
- function Identity( v ) {
- return v;
- }
- function Thrower( ex ) {
- throw ex;
- }
-
- function adoptValue( value, resolve, reject, noValue ) {
- var method;
-
- try {
-
- // Check for promise aspect first to privilege synchronous behavior
- if ( value && isFunction( ( method = value.promise ) ) ) {
- method.call( value ).done( resolve ).fail( reject );
-
- // Other thenables
- } else if ( value && isFunction( ( method = value.then ) ) ) {
- method.call( value, resolve, reject );
-
- // Other non-thenables
- } else {
-
- // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
- // * false: [ value ].slice( 0 ) => resolve( value )
- // * true: [ value ].slice( 1 ) => resolve()
- resolve.apply( undefined, [ value ].slice( noValue ) );
- }
-
- // For Promises/A+, convert exceptions into rejections
- // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
- // Deferred#then to conditionally suppress rejection.
- } catch ( value ) {
-
- // Support: Android 4.0 only
- // Strict mode functions invoked without .call/.apply get global-object context
- reject.apply( undefined, [ value ] );
- }
- }
-
- jQuery.extend( {
-
- Deferred: function( func ) {
- var tuples = [
-
- // action, add listener, callbacks,
- // ... .then handlers, argument index, [final state]
- [ "notify", "progress", jQuery.Callbacks( "memory" ),
- jQuery.Callbacks( "memory" ), 2 ],
- [ "resolve", "done", jQuery.Callbacks( "once memory" ),
- jQuery.Callbacks( "once memory" ), 0, "resolved" ],
- [ "reject", "fail", jQuery.Callbacks( "once memory" ),
- jQuery.Callbacks( "once memory" ), 1, "rejected" ]
- ],
- state = "pending",
- promise = {
- state: function() {
- return state;
- },
- always: function() {
- deferred.done( arguments ).fail( arguments );
- return this;
- },
- "catch": function( fn ) {
- return promise.then( null, fn );
- },
-
- // Keep pipe for back-compat
- pipe: function( /* fnDone, fnFail, fnProgress */ ) {
- var fns = arguments;
-
- return jQuery.Deferred( function( newDefer ) {
- jQuery.each( tuples, function( i, tuple ) {
-
- // Map tuples (progress, done, fail) to arguments (done, fail, progress)
- var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
-
- // deferred.progress(function() { bind to newDefer or newDefer.notify })
- // deferred.done(function() { bind to newDefer or newDefer.resolve })
- // deferred.fail(function() { bind to newDefer or newDefer.reject })
- deferred[ tuple[ 1 ] ]( function() {
- var returned = fn && fn.apply( this, arguments );
- if ( returned && isFunction( returned.promise ) ) {
- returned.promise()
- .progress( newDefer.notify )
- .done( newDefer.resolve )
- .fail( newDefer.reject );
- } else {
- newDefer[ tuple[ 0 ] + "With" ](
- this,
- fn ? [ returned ] : arguments
- );
- }
- } );
- } );
- fns = null;
- } ).promise();
- },
- then: function( onFulfilled, onRejected, onProgress ) {
- var maxDepth = 0;
- function resolve( depth, deferred, handler, special ) {
- return function() {
- var that = this,
- args = arguments,
- mightThrow = function() {
- var returned, then;
-
- // Support: Promises/A+ section 2.3.3.3.3
- // https://promisesaplus.com/#point-59
- // Ignore double-resolution attempts
- if ( depth < maxDepth ) {
- return;
- }
-
- returned = handler.apply( that, args );
-
- // Support: Promises/A+ section 2.3.1
- // https://promisesaplus.com/#point-48
- if ( returned === deferred.promise() ) {
- throw new TypeError( "Thenable self-resolution" );
- }
-
- // Support: Promises/A+ sections 2.3.3.1, 3.5
- // https://promisesaplus.com/#point-54
- // https://promisesaplus.com/#point-75
- // Retrieve `then` only once
- then = returned &&
-
- // Support: Promises/A+ section 2.3.4
- // https://promisesaplus.com/#point-64
- // Only check objects and functions for thenability
- ( typeof returned === "object" ||
- typeof returned === "function" ) &&
- returned.then;
-
- // Handle a returned thenable
- if ( isFunction( then ) ) {
-
- // Special processors (notify) just wait for resolution
- if ( special ) {
- then.call(
- returned,
- resolve( maxDepth, deferred, Identity, special ),
- resolve( maxDepth, deferred, Thrower, special )
- );
-
- // Normal processors (resolve) also hook into progress
- } else {
-
- // ...and disregard older resolution values
- maxDepth++;
-
- then.call(
- returned,
- resolve( maxDepth, deferred, Identity, special ),
- resolve( maxDepth, deferred, Thrower, special ),
- resolve( maxDepth, deferred, Identity,
- deferred.notifyWith )
- );
- }
-
- // Handle all other returned values
- } else {
-
- // Only substitute handlers pass on context
- // and multiple values (non-spec behavior)
- if ( handler !== Identity ) {
- that = undefined;
- args = [ returned ];
- }
-
- // Process the value(s)
- // Default process is resolve
- ( special || deferred.resolveWith )( that, args );
- }
- },
-
- // Only normal processors (resolve) catch and reject exceptions
- process = special ?
- mightThrow :
- function() {
- try {
- mightThrow();
- } catch ( e ) {
-
- if ( jQuery.Deferred.exceptionHook ) {
- jQuery.Deferred.exceptionHook( e,
- process.stackTrace );
- }
-
- // Support: Promises/A+ section 2.3.3.3.4.1
- // https://promisesaplus.com/#point-61
- // Ignore post-resolution exceptions
- if ( depth + 1 >= maxDepth ) {
-
- // Only substitute handlers pass on context
- // and multiple values (non-spec behavior)
- if ( handler !== Thrower ) {
- that = undefined;
- args = [ e ];
- }
-
- deferred.rejectWith( that, args );
- }
- }
- };
-
- // Support: Promises/A+ section 2.3.3.3.1
- // https://promisesaplus.com/#point-57
- // Re-resolve promises immediately to dodge false rejection from
- // subsequent errors
- if ( depth ) {
- process();
- } else {
-
- // Call an optional hook to record the stack, in case of exception
- // since it's otherwise lost when execution goes async
- if ( jQuery.Deferred.getStackHook ) {
- process.stackTrace = jQuery.Deferred.getStackHook();
- }
- window.setTimeout( process );
- }
- };
- }
-
- return jQuery.Deferred( function( newDefer ) {
-
- // progress_handlers.add( ... )
- tuples[ 0 ][ 3 ].add(
- resolve(
- 0,
- newDefer,
- isFunction( onProgress ) ?
- onProgress :
- Identity,
- newDefer.notifyWith
- )
- );
-
- // fulfilled_handlers.add( ... )
- tuples[ 1 ][ 3 ].add(
- resolve(
- 0,
- newDefer,
- isFunction( onFulfilled ) ?
- onFulfilled :
- Identity
- )
- );
-
- // rejected_handlers.add( ... )
- tuples[ 2 ][ 3 ].add(
- resolve(
- 0,
- newDefer,
- isFunction( onRejected ) ?
- onRejected :
- Thrower
- )
- );
- } ).promise();
- },
-
- // Get a promise for this deferred
- // If obj is provided, the promise aspect is added to the object
- promise: function( obj ) {
- return obj != null ? jQuery.extend( obj, promise ) : promise;
- }
- },
- deferred = {};
-
- // Add list-specific methods
- jQuery.each( tuples, function( i, tuple ) {
- var list = tuple[ 2 ],
- stateString = tuple[ 5 ];
-
- // promise.progress = list.add
- // promise.done = list.add
- // promise.fail = list.add
- promise[ tuple[ 1 ] ] = list.add;
-
- // Handle state
- if ( stateString ) {
- list.add(
- function() {
-
- // state = "resolved" (i.e., fulfilled)
- // state = "rejected"
- state = stateString;
- },
-
- // rejected_callbacks.disable
- // fulfilled_callbacks.disable
- tuples[ 3 - i ][ 2 ].disable,
-
- // rejected_handlers.disable
- // fulfilled_handlers.disable
- tuples[ 3 - i ][ 3 ].disable,
-
- // progress_callbacks.lock
- tuples[ 0 ][ 2 ].lock,
-
- // progress_handlers.lock
- tuples[ 0 ][ 3 ].lock
- );
- }
-
- // progress_handlers.fire
- // fulfilled_handlers.fire
- // rejected_handlers.fire
- list.add( tuple[ 3 ].fire );
-
- // deferred.notify = function() { deferred.notifyWith(...) }
- // deferred.resolve = function() { deferred.resolveWith(...) }
- // deferred.reject = function() { deferred.rejectWith(...) }
- deferred[ tuple[ 0 ] ] = function() {
- deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
- return this;
- };
-
- // deferred.notifyWith = list.fireWith
- // deferred.resolveWith = list.fireWith
- // deferred.rejectWith = list.fireWith
- deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
- } );
-
- // Make the deferred a promise
- promise.promise( deferred );
-
- // Call given func if any
- if ( func ) {
- func.call( deferred, deferred );
- }
-
- // All done!
- return deferred;
- },
-
- // Deferred helper
- when: function( singleValue ) {
- var
-
- // count of uncompleted subordinates
- remaining = arguments.length,
-
- // count of unprocessed arguments
- i = remaining,
-
- // subordinate fulfillment data
- resolveContexts = Array( i ),
- resolveValues = slice.call( arguments ),
-
- // the master Deferred
- master = jQuery.Deferred(),
-
- // subordinate callback factory
- updateFunc = function( i ) {
- return function( value ) {
- resolveContexts[ i ] = this;
- resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
- if ( !( --remaining ) ) {
- master.resolveWith( resolveContexts, resolveValues );
- }
- };
- };
-
- // Single- and empty arguments are adopted like Promise.resolve
- if ( remaining <= 1 ) {
- adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
- !remaining );
-
- // Use .then() to unwrap secondary thenables (cf. gh-3000)
- if ( master.state() === "pending" ||
- isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
-
- return master.then();
- }
- }
-
- // Multiple arguments are aggregated like Promise.all array elements
- while ( i-- ) {
- adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
- }
-
- return master.promise();
- }
- } );
-
-
- // These usually indicate a programmer mistake during development,
- // warn about them ASAP rather than swallowing them by default.
- var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
-
- jQuery.Deferred.exceptionHook = function( error, stack ) {
-
- // Support: IE 8 - 9 only
- // Console exists when dev tools are open, which can happen at any time
- if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
- window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
- }
- };
-
-
-
-
- jQuery.readyException = function( error ) {
- window.setTimeout( function() {
- throw error;
- } );
- };
-
-
-
-
- // The deferred used on DOM ready
- var readyList = jQuery.Deferred();
-
- jQuery.fn.ready = function( fn ) {
-
- readyList
- .then( fn )
-
- // Wrap jQuery.readyException in a function so that the lookup
- // happens at the time of error handling instead of callback
- // registration.
- .catch( function( error ) {
- jQuery.readyException( error );
- } );
-
- return this;
- };
-
- jQuery.extend( {
-
- // Is the DOM ready to be used? Set to true once it occurs.
- isReady: false,
-
- // A counter to track how many items to wait for before
- // the ready event fires. See #6781
- readyWait: 1,
-
- // Handle when the DOM is ready
- ready: function( wait ) {
-
- // Abort if there are pending holds or we're already ready
- if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
- return;
- }
-
- // Remember that the DOM is ready
- jQuery.isReady = true;
-
- // If a normal DOM Ready event fired, decrement, and wait if need be
- if ( wait !== true && --jQuery.readyWait > 0 ) {
- return;
- }
-
- // If there are functions bound, to execute
- readyList.resolveWith( document, [ jQuery ] );
- }
- } );
-
- jQuery.ready.then = readyList.then;
-
- // The ready event handler and self cleanup method
- function completed() {
- document.removeEventListener( "DOMContentLoaded", completed );
- window.removeEventListener( "load", completed );
- jQuery.ready();
- }
-
- // Catch cases where $(document).ready() is called
- // after the browser event has already occurred.
- // Support: IE <=9 - 10 only
- // Older IE sometimes signals "interactive" too soon
- if ( document.readyState === "complete" ||
- ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
-
- // Handle it asynchronously to allow scripts the opportunity to delay ready
- window.setTimeout( jQuery.ready );
-
- } else {
-
- // Use the handy event callback
- document.addEventListener( "DOMContentLoaded", completed );
-
- // A fallback to window.onload, that will always work
- window.addEventListener( "load", completed );
- }
-
-
-
-
- // Multifunctional method to get and set values of a collection
- // The value/s can optionally be executed if it's a function
- var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
- var i = 0,
- len = elems.length,
- bulk = key == null;
-
- // Sets many values
- if ( toType( key ) === "object" ) {
- chainable = true;
- for ( i in key ) {
- access( elems, fn, i, key[ i ], true, emptyGet, raw );
- }
-
- // Sets one value
- } else if ( value !== undefined ) {
- chainable = true;
-
- if ( !isFunction( value ) ) {
- raw = true;
- }
-
- if ( bulk ) {
-
- // Bulk operations run against the entire set
- if ( raw ) {
- fn.call( elems, value );
- fn = null;
-
- // ...except when executing function values
- } else {
- bulk = fn;
- fn = function( elem, key, value ) {
- return bulk.call( jQuery( elem ), value );
- };
- }
- }
-
- if ( fn ) {
- for ( ; i < len; i++ ) {
- fn(
- elems[ i ], key, raw ?
- value :
- value.call( elems[ i ], i, fn( elems[ i ], key ) )
- );
- }
- }
- }
-
- if ( chainable ) {
- return elems;
- }
-
- // Gets
- if ( bulk ) {
- return fn.call( elems );
- }
-
- return len ? fn( elems[ 0 ], key ) : emptyGet;
- };
-
-
- // Matches dashed string for camelizing
- var rmsPrefix = /^-ms-/,
- rdashAlpha = /-([a-z])/g;
-
- // Used by camelCase as callback to replace()
- function fcamelCase( all, letter ) {
- return letter.toUpperCase();
- }
-
- // Convert dashed to camelCase; used by the css and data modules
- // Support: IE <=9 - 11, Edge 12 - 15
- // Microsoft forgot to hump their vendor prefix (#9572)
- function camelCase( string ) {
- return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
- }
- var acceptData = function( owner ) {
-
- // Accepts only:
- // - Node
- // - Node.ELEMENT_NODE
- // - Node.DOCUMENT_NODE
- // - Object
- // - Any
- return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
- };
-
-
-
-
- function Data() {
- this.expando = jQuery.expando + Data.uid++;
- }
-
- Data.uid = 1;
-
- Data.prototype = {
-
- cache: function( owner ) {
-
- // Check if the owner object already has a cache
- var value = owner[ this.expando ];
-
- // If not, create one
- if ( !value ) {
- value = {};
-
- // We can accept data for non-element nodes in modern browsers,
- // but we should not, see #8335.
- // Always return an empty object.
- if ( acceptData( owner ) ) {
-
- // If it is a node unlikely to be stringify-ed or looped over
- // use plain assignment
- if ( owner.nodeType ) {
- owner[ this.expando ] = value;
-
- // Otherwise secure it in a non-enumerable property
- // configurable must be true to allow the property to be
- // deleted when data is removed
- } else {
- Object.defineProperty( owner, this.expando, {
- value: value,
- configurable: true
- } );
- }
- }
- }
-
- return value;
- },
- set: function( owner, data, value ) {
- var prop,
- cache = this.cache( owner );
-
- // Handle: [ owner, key, value ] args
- // Always use camelCase key (gh-2257)
- if ( typeof data === "string" ) {
- cache[ camelCase( data ) ] = value;
-
- // Handle: [ owner, { properties } ] args
- } else {
-
- // Copy the properties one-by-one to the cache object
- for ( prop in data ) {
- cache[ camelCase( prop ) ] = data[ prop ];
- }
- }
- return cache;
- },
- get: function( owner, key ) {
- return key === undefined ?
- this.cache( owner ) :
-
- // Always use camelCase key (gh-2257)
- owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
- },
- access: function( owner, key, value ) {
-
- // In cases where either:
- //
- // 1. No key was specified
- // 2. A string key was specified, but no value provided
- //
- // Take the "read" path and allow the get method to determine
- // which value to return, respectively either:
- //
- // 1. The entire cache object
- // 2. The data stored at the key
- //
- if ( key === undefined ||
- ( ( key && typeof key === "string" ) && value === undefined ) ) {
-
- return this.get( owner, key );
- }
-
- // When the key is not a string, or both a key and value
- // are specified, set or extend (existing objects) with either:
- //
- // 1. An object of properties
- // 2. A key and value
- //
- this.set( owner, key, value );
-
- // Since the "set" path can have two possible entry points
- // return the expected data based on which path was taken[*]
- return value !== undefined ? value : key;
- },
- remove: function( owner, key ) {
- var i,
- cache = owner[ this.expando ];
-
- if ( cache === undefined ) {
- return;
- }
-
- if ( key !== undefined ) {
-
- // Support array or space separated string of keys
- if ( Array.isArray( key ) ) {
-
- // If key is an array of keys...
- // We always set camelCase keys, so remove that.
- key = key.map( camelCase );
- } else {
- key = camelCase( key );
-
- // If a key with the spaces exists, use it.
- // Otherwise, create an array by matching non-whitespace
- key = key in cache ?
- [ key ] :
- ( key.match( rnothtmlwhite ) || [] );
- }
-
- i = key.length;
-
- while ( i-- ) {
- delete cache[ key[ i ] ];
- }
- }
-
- // Remove the expando if there's no more data
- if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
-
- // Support: Chrome <=35 - 45
- // Webkit & Blink performance suffers when deleting properties
- // from DOM nodes, so set to undefined instead
- // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
- if ( owner.nodeType ) {
- owner[ this.expando ] = undefined;
- } else {
- delete owner[ this.expando ];
- }
- }
- },
- hasData: function( owner ) {
- var cache = owner[ this.expando ];
- return cache !== undefined && !jQuery.isEmptyObject( cache );
- }
- };
- var dataPriv = new Data();
-
- var dataUser = new Data();
-
-
-
- // Implementation Summary
- //
- // 1. Enforce API surface and semantic compatibility with 1.9.x branch
- // 2. Improve the module's maintainability by reducing the storage
- // paths to a single mechanism.
- // 3. Use the same single mechanism to support "private" and "user" data.
- // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
- // 5. Avoid exposing implementation details on user objects (eg. expando properties)
- // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
-
- var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
- rmultiDash = /[A-Z]/g;
-
- function getData( data ) {
- if ( data === "true" ) {
- return true;
- }
-
- if ( data === "false" ) {
- return false;
- }
-
- if ( data === "null" ) {
- return null;
- }
-
- // Only convert to a number if it doesn't change the string
- if ( data === +data + "" ) {
- return +data;
- }
-
- if ( rbrace.test( data ) ) {
- return JSON.parse( data );
- }
-
- return data;
- }
-
- function dataAttr( elem, key, data ) {
- var name;
-
- // If nothing was found internally, try to fetch any
- // data from the HTML5 data-* attribute
- if ( data === undefined && elem.nodeType === 1 ) {
- name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
- data = elem.getAttribute( name );
-
- if ( typeof data === "string" ) {
- try {
- data = getData( data );
- } catch ( e ) {}
-
- // Make sure we set the data so it isn't changed later
- dataUser.set( elem, key, data );
- } else {
- data = undefined;
- }
- }
- return data;
- }
-
- jQuery.extend( {
- hasData: function( elem ) {
- return dataUser.hasData( elem ) || dataPriv.hasData( elem );
- },
-
- data: function( elem, name, data ) {
- return dataUser.access( elem, name, data );
- },
-
- removeData: function( elem, name ) {
- dataUser.remove( elem, name );
- },
-
- // TODO: Now that all calls to _data and _removeData have been replaced
- // with direct calls to dataPriv methods, these can be deprecated.
- _data: function( elem, name, data ) {
- return dataPriv.access( elem, name, data );
- },
-
- _removeData: function( elem, name ) {
- dataPriv.remove( elem, name );
- }
- } );
-
- jQuery.fn.extend( {
- data: function( key, value ) {
- var i, name, data,
- elem = this[ 0 ],
- attrs = elem && elem.attributes;
-
- // Gets all values
- if ( key === undefined ) {
- if ( this.length ) {
- data = dataUser.get( elem );
-
- if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
- i = attrs.length;
- while ( i-- ) {
-
- // Support: IE 11 only
- // The attrs elements can be null (#14894)
- if ( attrs[ i ] ) {
- name = attrs[ i ].name;
- if ( name.indexOf( "data-" ) === 0 ) {
- name = camelCase( name.slice( 5 ) );
- dataAttr( elem, name, data[ name ] );
- }
- }
- }
- dataPriv.set( elem, "hasDataAttrs", true );
- }
- }
-
- return data;
- }
-
- // Sets multiple values
- if ( typeof key === "object" ) {
- return this.each( function() {
- dataUser.set( this, key );
- } );
- }
-
- return access( this, function( value ) {
- var data;
-
- // The calling jQuery object (element matches) is not empty
- // (and therefore has an element appears at this[ 0 ]) and the
- // `value` parameter was not undefined. An empty jQuery object
- // will result in `undefined` for elem = this[ 0 ] which will
- // throw an exception if an attempt to read a data cache is made.
- if ( elem && value === undefined ) {
-
- // Attempt to get data from the cache
- // The key will always be camelCased in Data
- data = dataUser.get( elem, key );
- if ( data !== undefined ) {
- return data;
- }
-
- // Attempt to "discover" the data in
- // HTML5 custom data-* attrs
- data = dataAttr( elem, key );
- if ( data !== undefined ) {
- return data;
- }
-
- // We tried really hard, but the data doesn't exist.
- return;
- }
-
- // Set the data...
- this.each( function() {
-
- // We always store the camelCased key
- dataUser.set( this, key, value );
- } );
- }, null, value, arguments.length > 1, null, true );
- },
-
- removeData: function( key ) {
- return this.each( function() {
- dataUser.remove( this, key );
- } );
- }
- } );
-
-
- jQuery.extend( {
- queue: function( elem, type, data ) {
- var queue;
-
- if ( elem ) {
- type = ( type || "fx" ) + "queue";
- queue = dataPriv.get( elem, type );
-
- // Speed up dequeue by getting out quickly if this is just a lookup
- if ( data ) {
- if ( !queue || Array.isArray( data ) ) {
- queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
- } else {
- queue.push( data );
- }
- }
- return queue || [];
- }
- },
-
- dequeue: function( elem, type ) {
- type = type || "fx";
-
- var queue = jQuery.queue( elem, type ),
- startLength = queue.length,
- fn = queue.shift(),
- hooks = jQuery._queueHooks( elem, type ),
- next = function() {
- jQuery.dequeue( elem, type );
- };
-
- // If the fx queue is dequeued, always remove the progress sentinel
- if ( fn === "inprogress" ) {
- fn = queue.shift();
- startLength--;
- }
-
- if ( fn ) {
-
- // Add a progress sentinel to prevent the fx queue from being
- // automatically dequeued
- if ( type === "fx" ) {
- queue.unshift( "inprogress" );
- }
-
- // Clear up the last queue stop function
- delete hooks.stop;
- fn.call( elem, next, hooks );
- }
-
- if ( !startLength && hooks ) {
- hooks.empty.fire();
- }
- },
-
- // Not public - generate a queueHooks object, or return the current one
- _queueHooks: function( elem, type ) {
- var key = type + "queueHooks";
- return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
- empty: jQuery.Callbacks( "once memory" ).add( function() {
- dataPriv.remove( elem, [ type + "queue", key ] );
- } )
- } );
- }
- } );
-
- jQuery.fn.extend( {
- queue: function( type, data ) {
- var setter = 2;
-
- if ( typeof type !== "string" ) {
- data = type;
- type = "fx";
- setter--;
- }
-
- if ( arguments.length < setter ) {
- return jQuery.queue( this[ 0 ], type );
- }
-
- return data === undefined ?
- this :
- this.each( function() {
- var queue = jQuery.queue( this, type, data );
-
- // Ensure a hooks for this queue
- jQuery._queueHooks( this, type );
-
- if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
- jQuery.dequeue( this, type );
- }
- } );
- },
- dequeue: function( type ) {
- return this.each( function() {
- jQuery.dequeue( this, type );
- } );
- },
- clearQueue: function( type ) {
- return this.queue( type || "fx", [] );
- },
-
- // Get a promise resolved when queues of a certain type
- // are emptied (fx is the type by default)
- promise: function( type, obj ) {
- var tmp,
- count = 1,
- defer = jQuery.Deferred(),
- elements = this,
- i = this.length,
- resolve = function() {
- if ( !( --count ) ) {
- defer.resolveWith( elements, [ elements ] );
- }
- };
-
- if ( typeof type !== "string" ) {
- obj = type;
- type = undefined;
- }
- type = type || "fx";
-
- while ( i-- ) {
- tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
- if ( tmp && tmp.empty ) {
- count++;
- tmp.empty.add( resolve );
- }
- }
- resolve();
- return defer.promise( obj );
- }
- } );
- var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
-
- var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
-
-
- var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
-
- var documentElement = document.documentElement;
-
-
-
- var isAttached = function( elem ) {
- return jQuery.contains( elem.ownerDocument, elem );
- },
- composed = { composed: true };
-
- // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
- // Check attachment across shadow DOM boundaries when possible (gh-3504)
- // Support: iOS 10.0-10.2 only
- // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
- // leading to errors. We need to check for `getRootNode`.
- if ( documentElement.getRootNode ) {
- isAttached = function( elem ) {
- return jQuery.contains( elem.ownerDocument, elem ) ||
- elem.getRootNode( composed ) === elem.ownerDocument;
- };
- }
- var isHiddenWithinTree = function( elem, el ) {
-
- // isHiddenWithinTree might be called from jQuery#filter function;
- // in that case, element will be second argument
- elem = el || elem;
-
- // Inline style trumps all
- return elem.style.display === "none" ||
- elem.style.display === "" &&
-
- // Otherwise, check computed style
- // Support: Firefox <=43 - 45
- // Disconnected elements can have computed display: none, so first confirm that elem is
- // in the document.
- isAttached( elem ) &&
-
- jQuery.css( elem, "display" ) === "none";
- };
-
- var swap = function( elem, options, callback, args ) {
- var ret, name,
- old = {};
-
- // Remember the old values, and insert the new ones
- for ( name in options ) {
- old[ name ] = elem.style[ name ];
- elem.style[ name ] = options[ name ];
- }
-
- ret = callback.apply( elem, args || [] );
-
- // Revert the old values
- for ( name in options ) {
- elem.style[ name ] = old[ name ];
- }
-
- return ret;
- };
-
-
-
-
- function adjustCSS( elem, prop, valueParts, tween ) {
- var adjusted, scale,
- maxIterations = 20,
- currentValue = tween ?
- function() {
- return tween.cur();
- } :
- function() {
- return jQuery.css( elem, prop, "" );
- },
- initial = currentValue(),
- unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
-
- // Starting value computation is required for potential unit mismatches
- initialInUnit = elem.nodeType &&
- ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
- rcssNum.exec( jQuery.css( elem, prop ) );
-
- if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
-
- // Support: Firefox <=54
- // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
- initial = initial / 2;
-
- // Trust units reported by jQuery.css
- unit = unit || initialInUnit[ 3 ];
-
- // Iteratively approximate from a nonzero starting point
- initialInUnit = +initial || 1;
-
- while ( maxIterations-- ) {
-
- // Evaluate and update our best guess (doubling guesses that zero out).
- // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
- jQuery.style( elem, prop, initialInUnit + unit );
- if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
- maxIterations = 0;
- }
- initialInUnit = initialInUnit / scale;
-
- }
-
- initialInUnit = initialInUnit * 2;
- jQuery.style( elem, prop, initialInUnit + unit );
-
- // Make sure we update the tween properties later on
- valueParts = valueParts || [];
- }
-
- if ( valueParts ) {
- initialInUnit = +initialInUnit || +initial || 0;
-
- // Apply relative offset (+=/-=) if specified
- adjusted = valueParts[ 1 ] ?
- initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
- +valueParts[ 2 ];
- if ( tween ) {
- tween.unit = unit;
- tween.start = initialInUnit;
- tween.end = adjusted;
- }
- }
- return adjusted;
- }
-
-
- var defaultDisplayMap = {};
-
- function getDefaultDisplay( elem ) {
- var temp,
- doc = elem.ownerDocument,
- nodeName = elem.nodeName,
- display = defaultDisplayMap[ nodeName ];
-
- if ( display ) {
- return display;
- }
-
- temp = doc.body.appendChild( doc.createElement( nodeName ) );
- display = jQuery.css( temp, "display" );
-
- temp.parentNode.removeChild( temp );
-
- if ( display === "none" ) {
- display = "block";
- }
- defaultDisplayMap[ nodeName ] = display;
-
- return display;
- }
-
- function showHide( elements, show ) {
- var display, elem,
- values = [],
- index = 0,
- length = elements.length;
-
- // Determine new display value for elements that need to change
- for ( ; index < length; index++ ) {
- elem = elements[ index ];
- if ( !elem.style ) {
- continue;
- }
-
- display = elem.style.display;
- if ( show ) {
-
- // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
- // check is required in this first loop unless we have a nonempty display value (either
- // inline or about-to-be-restored)
- if ( display === "none" ) {
- values[ index ] = dataPriv.get( elem, "display" ) || null;
- if ( !values[ index ] ) {
- elem.style.display = "";
- }
- }
- if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
- values[ index ] = getDefaultDisplay( elem );
- }
- } else {
- if ( display !== "none" ) {
- values[ index ] = "none";
-
- // Remember what we're overwriting
- dataPriv.set( elem, "display", display );
- }
- }
- }
-
- // Set the display of the elements in a second loop to avoid constant reflow
- for ( index = 0; index < length; index++ ) {
- if ( values[ index ] != null ) {
- elements[ index ].style.display = values[ index ];
- }
- }
-
- return elements;
- }
-
- jQuery.fn.extend( {
- show: function() {
- return showHide( this, true );
- },
- hide: function() {
- return showHide( this );
- },
- toggle: function( state ) {
- if ( typeof state === "boolean" ) {
- return state ? this.show() : this.hide();
- }
-
- return this.each( function() {
- if ( isHiddenWithinTree( this ) ) {
- jQuery( this ).show();
- } else {
- jQuery( this ).hide();
- }
- } );
- }
- } );
- var rcheckableType = ( /^(?:checkbox|radio)$/i );
-
- var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
-
- var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
-
-
-
- // We have to close these tags to support XHTML (#13200)
- var wrapMap = {
-
- // Support: IE <=9 only
- option: [ 1, "<select multiple='multiple'>", "</select>" ],
-
- // XHTML parsers do not magically insert elements in the
- // same way that tag soup parsers do. So we cannot shorten
- // this by omitting <tbody> or other required elements.
- thead: [ 1, "<table>", "</table>" ],
- col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
- tr: [ 2, "<table><tbody>", "</tbody></table>" ],
- td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
-
- _default: [ 0, "", "" ]
- };
-
- // Support: IE <=9 only
- wrapMap.optgroup = wrapMap.option;
-
- wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
- wrapMap.th = wrapMap.td;
-
-
- function getAll( context, tag ) {
-
- // Support: IE <=9 - 11 only
- // Use typeof to avoid zero-argument method invocation on host objects (#15151)
- var ret;
-
- if ( typeof context.getElementsByTagName !== "undefined" ) {
- ret = context.getElementsByTagName( tag || "*" );
-
- } else if ( typeof context.querySelectorAll !== "undefined" ) {
- ret = context.querySelectorAll( tag || "*" );
-
- } else {
- ret = [];
- }
-
- if ( tag === undefined || tag && nodeName( context, tag ) ) {
- return jQuery.merge( [ context ], ret );
- }
-
- return ret;
- }
-
-
- // Mark scripts as having already been evaluated
- function setGlobalEval( elems, refElements ) {
- var i = 0,
- l = elems.length;
-
- for ( ; i < l; i++ ) {
- dataPriv.set(
- elems[ i ],
- "globalEval",
- !refElements || dataPriv.get( refElements[ i ], "globalEval" )
- );
- }
- }
-
-
- var rhtml = /<|&#?\w+;/;
-
- function buildFragment( elems, context, scripts, selection, ignored ) {
- var elem, tmp, tag, wrap, attached, j,
- fragment = context.createDocumentFragment(),
- nodes = [],
- i = 0,
- l = elems.length;
-
- for ( ; i < l; i++ ) {
- elem = elems[ i ];
-
- if ( elem || elem === 0 ) {
-
- // Add nodes directly
- if ( toType( elem ) === "object" ) {
-
- // Support: Android <=4.0 only, PhantomJS 1 only
- // push.apply(_, arraylike) throws on ancient WebKit
- jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
-
- // Convert non-html into a text node
- } else if ( !rhtml.test( elem ) ) {
- nodes.push( context.createTextNode( elem ) );
-
- // Convert html into DOM nodes
- } else {
- tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
-
- // Deserialize a standard representation
- tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
- wrap = wrapMap[ tag ] || wrapMap._default;
- tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
-
- // Descend through wrappers to the right content
- j = wrap[ 0 ];
- while ( j-- ) {
- tmp = tmp.lastChild;
- }
-
- // Support: Android <=4.0 only, PhantomJS 1 only
- // push.apply(_, arraylike) throws on ancient WebKit
- jQuery.merge( nodes, tmp.childNodes );
-
- // Remember the top-level container
- tmp = fragment.firstChild;
-
- // Ensure the created nodes are orphaned (#12392)
- tmp.textContent = "";
- }
- }
- }
-
- // Remove wrapper from fragment
- fragment.textContent = "";
-
- i = 0;
- while ( ( elem = nodes[ i++ ] ) ) {
-
- // Skip elements already in the context collection (trac-4087)
- if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
- if ( ignored ) {
- ignored.push( elem );
- }
- continue;
- }
-
- attached = isAttached( elem );
-
- // Append to fragment
- tmp = getAll( fragment.appendChild( elem ), "script" );
-
- // Preserve script evaluation history
- if ( attached ) {
- setGlobalEval( tmp );
- }
-
- // Capture executables
- if ( scripts ) {
- j = 0;
- while ( ( elem = tmp[ j++ ] ) ) {
- if ( rscriptType.test( elem.type || "" ) ) {
- scripts.push( elem );
- }
- }
- }
- }
-
- return fragment;
- }
-
-
- ( function() {
- var fragment = document.createDocumentFragment(),
- div = fragment.appendChild( document.createElement( "div" ) ),
- input = document.createElement( "input" );
-
- // Support: Android 4.0 - 4.3 only
- // Check state lost if the name is set (#11217)
- // Support: Windows Web Apps (WWA)
- // `name` and `type` must use .setAttribute for WWA (#14901)
- input.setAttribute( "type", "radio" );
- input.setAttribute( "checked", "checked" );
- input.setAttribute( "name", "t" );
-
- div.appendChild( input );
-
- // Support: Android <=4.1 only
- // Older WebKit doesn't clone checked state correctly in fragments
- support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
- // Support: IE <=11 only
- // Make sure textarea (and checkbox) defaultValue is properly cloned
- div.innerHTML = "<textarea>x</textarea>";
- support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
- } )();
-
-
- var
- rkeyEvent = /^key/,
- rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
- rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
-
- function returnTrue() {
- return true;
- }
-
- function returnFalse() {
- return false;
- }
-
- // Support: IE <=9 - 11+
- // focus() and blur() are asynchronous, except when they are no-op.
- // So expect focus to be synchronous when the element is already active,
- // and blur to be synchronous when the element is not already active.
- // (focus and blur are always synchronous in other supported browsers,
- // this just defines when we can count on it).
- function expectSync( elem, type ) {
- return ( elem === safeActiveElement() ) === ( type === "focus" );
- }
-
- // Support: IE <=9 only
- // Accessing document.activeElement can throw unexpectedly
- // https://bugs.jquery.com/ticket/13393
- function safeActiveElement() {
- try {
- return document.activeElement;
- } catch ( err ) { }
- }
-
- function on( elem, types, selector, data, fn, one ) {
- var origFn, type;
-
- // Types can be a map of types/handlers
- if ( typeof types === "object" ) {
-
- // ( types-Object, selector, data )
- if ( typeof selector !== "string" ) {
-
- // ( types-Object, data )
- data = data || selector;
- selector = undefined;
- }
- for ( type in types ) {
- on( elem, type, selector, data, types[ type ], one );
- }
- return elem;
- }
-
- if ( data == null && fn == null ) {
-
- // ( types, fn )
- fn = selector;
- data = selector = undefined;
- } else if ( fn == null ) {
- if ( typeof selector === "string" ) {
-
- // ( types, selector, fn )
- fn = data;
- data = undefined;
- } else {
-
- // ( types, data, fn )
- fn = data;
- data = selector;
- selector = undefined;
- }
- }
- if ( fn === false ) {
- fn = returnFalse;
- } else if ( !fn ) {
- return elem;
- }
-
- if ( one === 1 ) {
- origFn = fn;
- fn = function( event ) {
-
- // Can use an empty set, since event contains the info
- jQuery().off( event );
- return origFn.apply( this, arguments );
- };
-
- // Use same guid so caller can remove using origFn
- fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
- }
- return elem.each( function() {
- jQuery.event.add( this, types, fn, data, selector );
- } );
- }
-
- /*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
- jQuery.event = {
-
- global: {},
-
- add: function( elem, types, handler, data, selector ) {
-
- var handleObjIn, eventHandle, tmp,
- events, t, handleObj,
- special, handlers, type, namespaces, origType,
- elemData = dataPriv.get( elem );
-
- // Don't attach events to noData or text/comment nodes (but allow plain objects)
- if ( !elemData ) {
- return;
- }
-
- // Caller can pass in an object of custom data in lieu of the handler
- if ( handler.handler ) {
- handleObjIn = handler;
- handler = handleObjIn.handler;
- selector = handleObjIn.selector;
- }
-
- // Ensure that invalid selectors throw exceptions at attach time
- // Evaluate against documentElement in case elem is a non-element node (e.g., document)
- if ( selector ) {
- jQuery.find.matchesSelector( documentElement, selector );
- }
-
- // Make sure that the handler has a unique ID, used to find/remove it later
- if ( !handler.guid ) {
- handler.guid = jQuery.guid++;
- }
-
- // Init the element's event structure and main handler, if this is the first
- if ( !( events = elemData.events ) ) {
- events = elemData.events = {};
- }
- if ( !( eventHandle = elemData.handle ) ) {
- eventHandle = elemData.handle = function( e ) {
-
- // Discard the second event of a jQuery.event.trigger() and
- // when an event is called after a page has unloaded
- return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
- jQuery.event.dispatch.apply( elem, arguments ) : undefined;
- };
- }
-
- // Handle multiple events separated by a space
- types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
- t = types.length;
- while ( t-- ) {
- tmp = rtypenamespace.exec( types[ t ] ) || [];
- type = origType = tmp[ 1 ];
- namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
-
- // There *must* be a type, no attaching namespace-only handlers
- if ( !type ) {
- continue;
- }
-
- // If event changes its type, use the special event handlers for the changed type
- special = jQuery.event.special[ type ] || {};
-
- // If selector defined, determine special event api type, otherwise given type
- type = ( selector ? special.delegateType : special.bindType ) || type;
-
- // Update special based on newly reset type
- special = jQuery.event.special[ type ] || {};
-
- // handleObj is passed to all event handlers
- handleObj = jQuery.extend( {
- type: type,
- origType: origType,
- data: data,
- handler: handler,
- guid: handler.guid,
- selector: selector,
- needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
- namespace: namespaces.join( "." )
- }, handleObjIn );
-
- // Init the event handler queue if we're the first
- if ( !( handlers = events[ type ] ) ) {
- handlers = events[ type ] = [];
- handlers.delegateCount = 0;
-
- // Only use addEventListener if the special events handler returns false
- if ( !special.setup ||
- special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
-
- if ( elem.addEventListener ) {
- elem.addEventListener( type, eventHandle );
- }
- }
- }
-
- if ( special.add ) {
- special.add.call( elem, handleObj );
-
- if ( !handleObj.handler.guid ) {
- handleObj.handler.guid = handler.guid;
- }
- }
-
- // Add to the element's handler list, delegates in front
- if ( selector ) {
- handlers.splice( handlers.delegateCount++, 0, handleObj );
- } else {
- handlers.push( handleObj );
- }
-
- // Keep track of which events have ever been used, for event optimization
- jQuery.event.global[ type ] = true;
- }
-
- },
-
- // Detach an event or set of events from an element
- remove: function( elem, types, handler, selector, mappedTypes ) {
-
- var j, origCount, tmp,
- events, t, handleObj,
- special, handlers, type, namespaces, origType,
- elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
-
- if ( !elemData || !( events = elemData.events ) ) {
- return;
- }
-
- // Once for each type.namespace in types; type may be omitted
- types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
- t = types.length;
- while ( t-- ) {
- tmp = rtypenamespace.exec( types[ t ] ) || [];
- type = origType = tmp[ 1 ];
- namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
-
- // Unbind all events (on this namespace, if provided) for the element
- if ( !type ) {
- for ( type in events ) {
- jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
- }
- continue;
- }
-
- special = jQuery.event.special[ type ] || {};
- type = ( selector ? special.delegateType : special.bindType ) || type;
- handlers = events[ type ] || [];
- tmp = tmp[ 2 ] &&
- new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
-
- // Remove matching events
- origCount = j = handlers.length;
- while ( j-- ) {
- handleObj = handlers[ j ];
-
- if ( ( mappedTypes || origType === handleObj.origType ) &&
- ( !handler || handler.guid === handleObj.guid ) &&
- ( !tmp || tmp.test( handleObj.namespace ) ) &&
- ( !selector || selector === handleObj.selector ||
- selector === "**" && handleObj.selector ) ) {
- handlers.splice( j, 1 );
-
- if ( handleObj.selector ) {
- handlers.delegateCount--;
- }
- if ( special.remove ) {
- special.remove.call( elem, handleObj );
- }
- }
- }
-
- // Remove generic event handler if we removed something and no more handlers exist
- // (avoids potential for endless recursion during removal of special event handlers)
- if ( origCount && !handlers.length ) {
- if ( !special.teardown ||
- special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
-
- jQuery.removeEvent( elem, type, elemData.handle );
- }
-
- delete events[ type ];
- }
- }
-
- // Remove data and the expando if it's no longer used
- if ( jQuery.isEmptyObject( events ) ) {
- dataPriv.remove( elem, "handle events" );
- }
- },
-
- dispatch: function( nativeEvent ) {
-
- // Make a writable jQuery.Event from the native event object
- var event = jQuery.event.fix( nativeEvent );
-
- var i, j, ret, matched, handleObj, handlerQueue,
- args = new Array( arguments.length ),
- handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
- special = jQuery.event.special[ event.type ] || {};
-
- // Use the fix-ed jQuery.Event rather than the (read-only) native event
- args[ 0 ] = event;
-
- for ( i = 1; i < arguments.length; i++ ) {
- args[ i ] = arguments[ i ];
- }
-
- event.delegateTarget = this;
-
- // Call the preDispatch hook for the mapped type, and let it bail if desired
- if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
- return;
- }
-
- // Determine handlers
- handlerQueue = jQuery.event.handlers.call( this, event, handlers );
-
- // Run delegates first; they may want to stop propagation beneath us
- i = 0;
- while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
- event.currentTarget = matched.elem;
-
- j = 0;
- while ( ( handleObj = matched.handlers[ j++ ] ) &&
- !event.isImmediatePropagationStopped() ) {
-
- // If the event is namespaced, then each handler is only invoked if it is
- // specially universal or its namespaces are a superset of the event's.
- if ( !event.rnamespace || handleObj.namespace === false ||
- event.rnamespace.test( handleObj.namespace ) ) {
-
- event.handleObj = handleObj;
- event.data = handleObj.data;
-
- ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
- handleObj.handler ).apply( matched.elem, args );
-
- if ( ret !== undefined ) {
- if ( ( event.result = ret ) === false ) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
- }
- }
- }
-
- // Call the postDispatch hook for the mapped type
- if ( special.postDispatch ) {
- special.postDispatch.call( this, event );
- }
-
- return event.result;
- },
-
- handlers: function( event, handlers ) {
- var i, handleObj, sel, matchedHandlers, matchedSelectors,
- handlerQueue = [],
- delegateCount = handlers.delegateCount,
- cur = event.target;
-
- // Find delegate handlers
- if ( delegateCount &&
-
- // Support: IE <=9
- // Black-hole SVG <use> instance trees (trac-13180)
- cur.nodeType &&
-
- // Support: Firefox <=42
- // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
- // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
- // Support: IE 11 only
- // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
- !( event.type === "click" && event.button >= 1 ) ) {
-
- for ( ; cur !== this; cur = cur.parentNode || this ) {
-
- // Don't check non-elements (#13208)
- // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
- if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
- matchedHandlers = [];
- matchedSelectors = {};
- for ( i = 0; i < delegateCount; i++ ) {
- handleObj = handlers[ i ];
-
- // Don't conflict with Object.prototype properties (#13203)
- sel = handleObj.selector + " ";
-
- if ( matchedSelectors[ sel ] === undefined ) {
- matchedSelectors[ sel ] = handleObj.needsContext ?
- jQuery( sel, this ).index( cur ) > -1 :
- jQuery.find( sel, this, null, [ cur ] ).length;
- }
- if ( matchedSelectors[ sel ] ) {
- matchedHandlers.push( handleObj );
- }
- }
- if ( matchedHandlers.length ) {
- handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
- }
- }
- }
- }
-
- // Add the remaining (directly-bound) handlers
- cur = this;
- if ( delegateCount < handlers.length ) {
- handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
- }
-
- return handlerQueue;
- },
-
- addProp: function( name, hook ) {
- Object.defineProperty( jQuery.Event.prototype, name, {
- enumerable: true,
- configurable: true,
-
- get: isFunction( hook ) ?
- function() {
- if ( this.originalEvent ) {
- return hook( this.originalEvent );
- }
- } :
- function() {
- if ( this.originalEvent ) {
- return this.originalEvent[ name ];
- }
- },
-
- set: function( value ) {
- Object.defineProperty( this, name, {
- enumerable: true,
- configurable: true,
- writable: true,
- value: value
- } );
- }
- } );
- },
-
- fix: function( originalEvent ) {
- return originalEvent[ jQuery.expando ] ?
- originalEvent :
- new jQuery.Event( originalEvent );
- },
-
- special: {
- load: {
-
- // Prevent triggered image.load events from bubbling to window.load
- noBubble: true
- },
- click: {
-
- // Utilize native event to ensure correct state for checkable inputs
- setup: function( data ) {
-
- // For mutual compressibility with _default, replace `this` access with a local var.
- // `|| data` is dead code meant only to preserve the variable through minification.
- var el = this || data;
-
- // Claim the first handler
- if ( rcheckableType.test( el.type ) &&
- el.click && nodeName( el, "input" ) ) {
-
- // dataPriv.set( el, "click", ... )
- leverageNative( el, "click", returnTrue );
- }
-
- // Return false to allow normal processing in the caller
- return false;
- },
- trigger: function( data ) {
-
- // For mutual compressibility with _default, replace `this` access with a local var.
- // `|| data` is dead code meant only to preserve the variable through minification.
- var el = this || data;
-
- // Force setup before triggering a click
- if ( rcheckableType.test( el.type ) &&
- el.click && nodeName( el, "input" ) ) {
-
- leverageNative( el, "click" );
- }
-
- // Return non-false to allow normal event-path propagation
- return true;
- },
-
- // For cross-browser consistency, suppress native .click() on links
- // Also prevent it if we're currently inside a leveraged native-event stack
- _default: function( event ) {
- var target = event.target;
- return rcheckableType.test( target.type ) &&
- target.click && nodeName( target, "input" ) &&
- dataPriv.get( target, "click" ) ||
- nodeName( target, "a" );
- }
- },
-
- beforeunload: {
- postDispatch: function( event ) {
-
- // Support: Firefox 20+
- // Firefox doesn't alert if the returnValue field is not set.
- if ( event.result !== undefined && event.originalEvent ) {
- event.originalEvent.returnValue = event.result;
- }
- }
- }
- }
- };
-
- // Ensure the presence of an event listener that handles manually-triggered
- // synthetic events by interrupting progress until reinvoked in response to
- // *native* events that it fires directly, ensuring that state changes have
- // already occurred before other listeners are invoked.
- function leverageNative( el, type, expectSync ) {
-
- // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
- if ( !expectSync ) {
- if ( dataPriv.get( el, type ) === undefined ) {
- jQuery.event.add( el, type, returnTrue );
- }
- return;
- }
-
- // Register the controller as a special universal handler for all event namespaces
- dataPriv.set( el, type, false );
- jQuery.event.add( el, type, {
- namespace: false,
- handler: function( event ) {
- var notAsync, result,
- saved = dataPriv.get( this, type );
-
- if ( ( event.isTrigger & 1 ) && this[ type ] ) {
-
- // Interrupt processing of the outer synthetic .trigger()ed event
- // Saved data should be false in such cases, but might be a leftover capture object
- // from an async native handler (gh-4350)
- if ( !saved.length ) {
-
- // Store arguments for use when handling the inner native event
- // There will always be at least one argument (an event object), so this array
- // will not be confused with a leftover capture object.
- saved = slice.call( arguments );
- dataPriv.set( this, type, saved );
-
- // Trigger the native event and capture its result
- // Support: IE <=9 - 11+
- // focus() and blur() are asynchronous
- notAsync = expectSync( this, type );
- this[ type ]();
- result = dataPriv.get( this, type );
- if ( saved !== result || notAsync ) {
- dataPriv.set( this, type, false );
- } else {
- result = {};
- }
- if ( saved !== result ) {
-
- // Cancel the outer synthetic event
- event.stopImmediatePropagation();
- event.preventDefault();
- return result.value;
- }
-
- // If this is an inner synthetic event for an event with a bubbling surrogate
- // (focus or blur), assume that the surrogate already propagated from triggering the
- // native event and prevent that from happening again here.
- // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
- // bubbling surrogate propagates *after* the non-bubbling base), but that seems
- // less bad than duplication.
- } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
- event.stopPropagation();
- }
-
- // If this is a native event triggered above, everything is now in order
- // Fire an inner synthetic event with the original arguments
- } else if ( saved.length ) {
-
- // ...and capture the result
- dataPriv.set( this, type, {
- value: jQuery.event.trigger(
-
- // Support: IE <=9 - 11+
- // Extend with the prototype to reset the above stopImmediatePropagation()
- jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
- saved.slice( 1 ),
- this
- )
- } );
-
- // Abort handling of the native event
- event.stopImmediatePropagation();
- }
- }
- } );
- }
-
- jQuery.removeEvent = function( elem, type, handle ) {
-
- // This "if" is needed for plain objects
- if ( elem.removeEventListener ) {
- elem.removeEventListener( type, handle );
- }
- };
-
- jQuery.Event = function( src, props ) {
-
- // Allow instantiation without the 'new' keyword
- if ( !( this instanceof jQuery.Event ) ) {
- return new jQuery.Event( src, props );
- }
-
- // Event object
- if ( src && src.type ) {
- this.originalEvent = src;
- this.type = src.type;
-
- // Events bubbling up the document may have been marked as prevented
- // by a handler lower down the tree; reflect the correct value.
- this.isDefaultPrevented = src.defaultPrevented ||
- src.defaultPrevented === undefined &&
-
- // Support: Android <=2.3 only
- src.returnValue === false ?
- returnTrue :
- returnFalse;
-
- // Create target properties
- // Support: Safari <=6 - 7 only
- // Target should not be a text node (#504, #13143)
- this.target = ( src.target && src.target.nodeType === 3 ) ?
- src.target.parentNode :
- src.target;
-
- this.currentTarget = src.currentTarget;
- this.relatedTarget = src.relatedTarget;
-
- // Event type
- } else {
- this.type = src;
- }
-
- // Put explicitly provided properties onto the event object
- if ( props ) {
- jQuery.extend( this, props );
- }
-
- // Create a timestamp if incoming event doesn't have one
- this.timeStamp = src && src.timeStamp || Date.now();
-
- // Mark it as fixed
- this[ jQuery.expando ] = true;
- };
-
- // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
- // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
- jQuery.Event.prototype = {
- constructor: jQuery.Event,
- isDefaultPrevented: returnFalse,
- isPropagationStopped: returnFalse,
- isImmediatePropagationStopped: returnFalse,
- isSimulated: false,
-
- preventDefault: function() {
- var e = this.originalEvent;
-
- this.isDefaultPrevented = returnTrue;
-
- if ( e && !this.isSimulated ) {
- e.preventDefault();
- }
- },
- stopPropagation: function() {
- var e = this.originalEvent;
-
- this.isPropagationStopped = returnTrue;
-
- if ( e && !this.isSimulated ) {
- e.stopPropagation();
- }
- },
- stopImmediatePropagation: function() {
- var e = this.originalEvent;
-
- this.isImmediatePropagationStopped = returnTrue;
-
- if ( e && !this.isSimulated ) {
- e.stopImmediatePropagation();
- }
-
- this.stopPropagation();
- }
- };
-
- // Includes all common event props including KeyEvent and MouseEvent specific props
- jQuery.each( {
- altKey: true,
- bubbles: true,
- cancelable: true,
- changedTouches: true,
- ctrlKey: true,
- detail: true,
- eventPhase: true,
- metaKey: true,
- pageX: true,
- pageY: true,
- shiftKey: true,
- view: true,
- "char": true,
- code: true,
- charCode: true,
- key: true,
- keyCode: true,
- button: true,
- buttons: true,
- clientX: true,
- clientY: true,
- offsetX: true,
- offsetY: true,
- pointerId: true,
- pointerType: true,
- screenX: true,
- screenY: true,
- targetTouches: true,
- toElement: true,
- touches: true,
-
- which: function( event ) {
- var button = event.button;
-
- // Add which for key events
- if ( event.which == null && rkeyEvent.test( event.type ) ) {
- return event.charCode != null ? event.charCode : event.keyCode;
- }
-
- // Add which for click: 1 === left; 2 === middle; 3 === right
- if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
- if ( button & 1 ) {
- return 1;
- }
-
- if ( button & 2 ) {
- return 3;
- }
-
- if ( button & 4 ) {
- return 2;
- }
-
- return 0;
- }
-
- return event.which;
- }
- }, jQuery.event.addProp );
-
- jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
- jQuery.event.special[ type ] = {
-
- // Utilize native event if possible so blur/focus sequence is correct
- setup: function() {
-
- // Claim the first handler
- // dataPriv.set( this, "focus", ... )
- // dataPriv.set( this, "blur", ... )
- leverageNative( this, type, expectSync );
-
- // Return false to allow normal processing in the caller
- return false;
- },
- trigger: function() {
-
- // Force setup before trigger
- leverageNative( this, type );
-
- // Return non-false to allow normal event-path propagation
- return true;
- },
-
- delegateType: delegateType
- };
- } );
-
- // Create mouseenter/leave events using mouseover/out and event-time checks
- // so that event delegation works in jQuery.
- // Do the same for pointerenter/pointerleave and pointerover/pointerout
- //
- // Support: Safari 7 only
- // Safari sends mouseenter too often; see:
- // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
- // for the description of the bug (it existed in older Chrome versions as well).
- jQuery.each( {
- mouseenter: "mouseover",
- mouseleave: "mouseout",
- pointerenter: "pointerover",
- pointerleave: "pointerout"
- }, function( orig, fix ) {
- jQuery.event.special[ orig ] = {
- delegateType: fix,
- bindType: fix,
-
- handle: function( event ) {
- var ret,
- target = this,
- related = event.relatedTarget,
- handleObj = event.handleObj;
-
- // For mouseenter/leave call the handler if related is outside the target.
- // NB: No relatedTarget if the mouse left/entered the browser window
- if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
- event.type = handleObj.origType;
- ret = handleObj.handler.apply( this, arguments );
- event.type = fix;
- }
- return ret;
- }
- };
- } );
-
- jQuery.fn.extend( {
-
- on: function( types, selector, data, fn ) {
- return on( this, types, selector, data, fn );
- },
- one: function( types, selector, data, fn ) {
- return on( this, types, selector, data, fn, 1 );
- },
- off: function( types, selector, fn ) {
- var handleObj, type;
- if ( types && types.preventDefault && types.handleObj ) {
-
- // ( event ) dispatched jQuery.Event
- handleObj = types.handleObj;
- jQuery( types.delegateTarget ).off(
- handleObj.namespace ?
- handleObj.origType + "." + handleObj.namespace :
- handleObj.origType,
- handleObj.selector,
- handleObj.handler
- );
- return this;
- }
- if ( typeof types === "object" ) {
-
- // ( types-object [, selector] )
- for ( type in types ) {
- this.off( type, selector, types[ type ] );
- }
- return this;
- }
- if ( selector === false || typeof selector === "function" ) {
-
- // ( types [, fn] )
- fn = selector;
- selector = undefined;
- }
- if ( fn === false ) {
- fn = returnFalse;
- }
- return this.each( function() {
- jQuery.event.remove( this, types, fn, selector );
- } );
- }
- } );
-
-
- var
-
- /* eslint-disable max-len */
-
- // See https://github.com/eslint/eslint/issues/3229
- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
-
- /* eslint-enable */
-
- // Support: IE <=10 - 11, Edge 12 - 13 only
- // In IE/Edge using regex groups here causes severe slowdowns.
- // See https://connect.microsoft.com/IE/feedback/details/1736512/
- rnoInnerhtml = /<script|<style|<link/i,
-
- // checked="checked" or checked
- rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
- rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
-
- // Prefer a tbody over its parent table for containing new rows
- function manipulationTarget( elem, content ) {
- if ( nodeName( elem, "table" ) &&
- nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
-
- return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
- }
-
- return elem;
- }
-
- // Replace/restore the type attribute of script elements for safe DOM manipulation
- function disableScript( elem ) {
- elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
- return elem;
- }
- function restoreScript( elem ) {
- if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
- elem.type = elem.type.slice( 5 );
- } else {
- elem.removeAttribute( "type" );
- }
-
- return elem;
- }
-
- function cloneCopyEvent( src, dest ) {
- var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
-
- if ( dest.nodeType !== 1 ) {
- return;
- }
-
- // 1. Copy private data: events, handlers, etc.
- if ( dataPriv.hasData( src ) ) {
- pdataOld = dataPriv.access( src );
- pdataCur = dataPriv.set( dest, pdataOld );
- events = pdataOld.events;
-
- if ( events ) {
- delete pdataCur.handle;
- pdataCur.events = {};
-
- for ( type in events ) {
- for ( i = 0, l = events[ type ].length; i < l; i++ ) {
- jQuery.event.add( dest, type, events[ type ][ i ] );
- }
- }
- }
- }
-
- // 2. Copy user data
- if ( dataUser.hasData( src ) ) {
- udataOld = dataUser.access( src );
- udataCur = jQuery.extend( {}, udataOld );
-
- dataUser.set( dest, udataCur );
- }
- }
-
- // Fix IE bugs, see support tests
- function fixInput( src, dest ) {
- var nodeName = dest.nodeName.toLowerCase();
-
- // Fails to persist the checked state of a cloned checkbox or radio button.
- if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
- dest.checked = src.checked;
-
- // Fails to return the selected option to the default selected state when cloning options
- } else if ( nodeName === "input" || nodeName === "textarea" ) {
- dest.defaultValue = src.defaultValue;
- }
- }
-
- function domManip( collection, args, callback, ignored ) {
-
- // Flatten any nested arrays
- args = concat.apply( [], args );
-
- var fragment, first, scripts, hasScripts, node, doc,
- i = 0,
- l = collection.length,
- iNoClone = l - 1,
- value = args[ 0 ],
- valueIsFunction = isFunction( value );
-
- // We can't cloneNode fragments that contain checked, in WebKit
- if ( valueIsFunction ||
- ( l > 1 && typeof value === "string" &&
- !support.checkClone && rchecked.test( value ) ) ) {
- return collection.each( function( index ) {
- var self = collection.eq( index );
- if ( valueIsFunction ) {
- args[ 0 ] = value.call( this, index, self.html() );
- }
- domManip( self, args, callback, ignored );
- } );
- }
-
- if ( l ) {
- fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
- first = fragment.firstChild;
-
- if ( fragment.childNodes.length === 1 ) {
- fragment = first;
- }
-
- // Require either new content or an interest in ignored elements to invoke the callback
- if ( first || ignored ) {
- scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
- hasScripts = scripts.length;
-
- // Use the original fragment for the last item
- // instead of the first because it can end up
- // being emptied incorrectly in certain situations (#8070).
- for ( ; i < l; i++ ) {
- node = fragment;
-
- if ( i !== iNoClone ) {
- node = jQuery.clone( node, true, true );
-
- // Keep references to cloned scripts for later restoration
- if ( hasScripts ) {
-
- // Support: Android <=4.0 only, PhantomJS 1 only
- // push.apply(_, arraylike) throws on ancient WebKit
- jQuery.merge( scripts, getAll( node, "script" ) );
- }
- }
-
- callback.call( collection[ i ], node, i );
- }
-
- if ( hasScripts ) {
- doc = scripts[ scripts.length - 1 ].ownerDocument;
-
- // Reenable scripts
- jQuery.map( scripts, restoreScript );
-
- // Evaluate executable scripts on first document insertion
- for ( i = 0; i < hasScripts; i++ ) {
- node = scripts[ i ];
- if ( rscriptType.test( node.type || "" ) &&
- !dataPriv.access( node, "globalEval" ) &&
- jQuery.contains( doc, node ) ) {
-
- if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
-
- // Optional AJAX dependency, but won't run scripts if not present
- if ( jQuery._evalUrl && !node.noModule ) {
- jQuery._evalUrl( node.src, {
- nonce: node.nonce || node.getAttribute( "nonce" )
- } );
- }
- } else {
- DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
- }
- }
- }
- }
- }
- }
-
- return collection;
- }
-
- function remove( elem, selector, keepData ) {
- var node,
- nodes = selector ? jQuery.filter( selector, elem ) : elem,
- i = 0;
-
- for ( ; ( node = nodes[ i ] ) != null; i++ ) {
- if ( !keepData && node.nodeType === 1 ) {
- jQuery.cleanData( getAll( node ) );
- }
-
- if ( node.parentNode ) {
- if ( keepData && isAttached( node ) ) {
- setGlobalEval( getAll( node, "script" ) );
- }
- node.parentNode.removeChild( node );
- }
- }
-
- return elem;
- }
-
- jQuery.extend( {
- htmlPrefilter: function( html ) {
- return html.replace( rxhtmlTag, "<$1></$2>" );
- },
-
- clone: function( elem, dataAndEvents, deepDataAndEvents ) {
- var i, l, srcElements, destElements,
- clone = elem.cloneNode( true ),
- inPage = isAttached( elem );
-
- // Fix IE cloning issues
- if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
- !jQuery.isXMLDoc( elem ) ) {
-
- // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
- destElements = getAll( clone );
- srcElements = getAll( elem );
-
- for ( i = 0, l = srcElements.length; i < l; i++ ) {
- fixInput( srcElements[ i ], destElements[ i ] );
- }
- }
-
- // Copy the events from the original to the clone
- if ( dataAndEvents ) {
- if ( deepDataAndEvents ) {
- srcElements = srcElements || getAll( elem );
- destElements = destElements || getAll( clone );
-
- for ( i = 0, l = srcElements.length; i < l; i++ ) {
- cloneCopyEvent( srcElements[ i ], destElements[ i ] );
- }
- } else {
- cloneCopyEvent( elem, clone );
- }
- }
-
- // Preserve script evaluation history
- destElements = getAll( clone, "script" );
- if ( destElements.length > 0 ) {
- setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
- }
-
- // Return the cloned set
- return clone;
- },
-
- cleanData: function( elems ) {
- var data, elem, type,
- special = jQuery.event.special,
- i = 0;
-
- for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
- if ( acceptData( elem ) ) {
- if ( ( data = elem[ dataPriv.expando ] ) ) {
- if ( data.events ) {
- for ( type in data.events ) {
- if ( special[ type ] ) {
- jQuery.event.remove( elem, type );
-
- // This is a shortcut to avoid jQuery.event.remove's overhead
- } else {
- jQuery.removeEvent( elem, type, data.handle );
- }
- }
- }
-
- // Support: Chrome <=35 - 45+
- // Assign undefined instead of using delete, see Data#remove
- elem[ dataPriv.expando ] = undefined;
- }
- if ( elem[ dataUser.expando ] ) {
-
- // Support: Chrome <=35 - 45+
- // Assign undefined instead of using delete, see Data#remove
- elem[ dataUser.expando ] = undefined;
- }
- }
- }
- }
- } );
-
- jQuery.fn.extend( {
- detach: function( selector ) {
- return remove( this, selector, true );
- },
-
- remove: function( selector ) {
- return remove( this, selector );
- },
-
- text: function( value ) {
- return access( this, function( value ) {
- return value === undefined ?
- jQuery.text( this ) :
- this.empty().each( function() {
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
- this.textContent = value;
- }
- } );
- }, null, value, arguments.length );
- },
-
- append: function() {
- return domManip( this, arguments, function( elem ) {
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
- var target = manipulationTarget( this, elem );
- target.appendChild( elem );
- }
- } );
- },
-
- prepend: function() {
- return domManip( this, arguments, function( elem ) {
- if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
- var target = manipulationTarget( this, elem );
- target.insertBefore( elem, target.firstChild );
- }
- } );
- },
-
- before: function() {
- return domManip( this, arguments, function( elem ) {
- if ( this.parentNode ) {
- this.parentNode.insertBefore( elem, this );
- }
- } );
- },
-
- after: function() {
- return domManip( this, arguments, function( elem ) {
- if ( this.parentNode ) {
- this.parentNode.insertBefore( elem, this.nextSibling );
- }
- } );
- },
-
- empty: function() {
- var elem,
- i = 0;
-
- for ( ; ( elem = this[ i ] ) != null; i++ ) {
- if ( elem.nodeType === 1 ) {
-
- // Prevent memory leaks
- jQuery.cleanData( getAll( elem, false ) );
-
- // Remove any remaining nodes
- elem.textContent = "";
- }
- }
-
- return this;
- },
-
- clone: function( dataAndEvents, deepDataAndEvents ) {
- dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
- deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
-
- return this.map( function() {
- return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
- } );
- },
-
- html: function( value ) {
- return access( this, function( value ) {
- var elem = this[ 0 ] || {},
- i = 0,
- l = this.length;
-
- if ( value === undefined && elem.nodeType === 1 ) {
- return elem.innerHTML;
- }
-
- // See if we can take a shortcut and just use innerHTML
- if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
- !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
-
- value = jQuery.htmlPrefilter( value );
-
- try {
- for ( ; i < l; i++ ) {
- elem = this[ i ] || {};
-
- // Remove element nodes and prevent memory leaks
- if ( elem.nodeType === 1 ) {
- jQuery.cleanData( getAll( elem, false ) );
- elem.innerHTML = value;
- }
- }
-
- elem = 0;
-
- // If using innerHTML throws an exception, use the fallback method
- } catch ( e ) {}
- }
-
- if ( elem ) {
- this.empty().append( value );
- }
- }, null, value, arguments.length );
- },
-
- replaceWith: function() {
- var ignored = [];
-
- // Make the changes, replacing each non-ignored context element with the new content
- return domManip( this, arguments, function( elem ) {
- var parent = this.parentNode;
-
- if ( jQuery.inArray( this, ignored ) < 0 ) {
- jQuery.cleanData( getAll( this ) );
- if ( parent ) {
- parent.replaceChild( elem, this );
- }
- }
-
- // Force callback invocation
- }, ignored );
- }
- } );
-
- jQuery.each( {
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
- }, function( name, original ) {
- jQuery.fn[ name ] = function( selector ) {
- var elems,
- ret = [],
- insert = jQuery( selector ),
- last = insert.length - 1,
- i = 0;
-
- for ( ; i <= last; i++ ) {
- elems = i === last ? this : this.clone( true );
- jQuery( insert[ i ] )[ original ]( elems );
-
- // Support: Android <=4.0 only, PhantomJS 1 only
- // .get() because push.apply(_, arraylike) throws on ancient WebKit
- push.apply( ret, elems.get() );
- }
-
- return this.pushStack( ret );
- };
- } );
- var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
-
- var getStyles = function( elem ) {
-
- // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
- // IE throws on elements created in popups
- // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
- var view = elem.ownerDocument.defaultView;
-
- if ( !view || !view.opener ) {
- view = window;
- }
-
- return view.getComputedStyle( elem );
- };
-
- var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
-
-
-
- ( function() {
-
- // Executing both pixelPosition & boxSizingReliable tests require only one layout
- // so they're executed at the same time to save the second computation.
- function computeStyleTests() {
-
- // This is a singleton, we need to execute it only once
- if ( !div ) {
- return;
- }
-
- container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
- "margin-top:1px;padding:0;border:0";
- div.style.cssText =
- "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
- "margin:auto;border:1px;padding:1px;" +
- "width:60%;top:1%";
- documentElement.appendChild( container ).appendChild( div );
-
- var divStyle = window.getComputedStyle( div );
- pixelPositionVal = divStyle.top !== "1%";
-
- // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
- reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
-
- // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
- // Some styles come back with percentage values, even though they shouldn't
- div.style.right = "60%";
- pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
-
- // Support: IE 9 - 11 only
- // Detect misreporting of content dimensions for box-sizing:border-box elements
- boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
-
- // Support: IE 9 only
- // Detect overflow:scroll screwiness (gh-3699)
- // Support: Chrome <=64
- // Don't get tricked when zoom affects offsetWidth (gh-4029)
- div.style.position = "absolute";
- scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
-
- documentElement.removeChild( container );
-
- // Nullify the div so it wouldn't be stored in the memory and
- // it will also be a sign that checks already performed
- div = null;
- }
-
- function roundPixelMeasures( measure ) {
- return Math.round( parseFloat( measure ) );
- }
-
- var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
- reliableMarginLeftVal,
- container = document.createElement( "div" ),
- div = document.createElement( "div" );
-
- // Finish early in limited (non-browser) environments
- if ( !div.style ) {
- return;
- }
-
- // Support: IE <=9 - 11 only
- // Style of cloned element affects source element cloned (#8908)
- div.style.backgroundClip = "content-box";
- div.cloneNode( true ).style.backgroundClip = "";
- support.clearCloneStyle = div.style.backgroundClip === "content-box";
-
- jQuery.extend( support, {
- boxSizingReliable: function() {
- computeStyleTests();
- return boxSizingReliableVal;
- },
- pixelBoxStyles: function() {
- computeStyleTests();
- return pixelBoxStylesVal;
- },
- pixelPosition: function() {
- computeStyleTests();
- return pixelPositionVal;
- },
- reliableMarginLeft: function() {
- computeStyleTests();
- return reliableMarginLeftVal;
- },
- scrollboxSize: function() {
- computeStyleTests();
- return scrollboxSizeVal;
- }
- } );
- } )();
-
-
- function curCSS( elem, name, computed ) {
- var width, minWidth, maxWidth, ret,
-
- // Support: Firefox 51+
- // Retrieving style before computed somehow
- // fixes an issue with getting wrong values
- // on detached elements
- style = elem.style;
-
- computed = computed || getStyles( elem );
-
- // getPropertyValue is needed for:
- // .css('filter') (IE 9 only, #12537)
- // .css('--customProperty) (#3144)
- if ( computed ) {
- ret = computed.getPropertyValue( name ) || computed[ name ];
-
- if ( ret === "" && !isAttached( elem ) ) {
- ret = jQuery.style( elem, name );
- }
-
- // A tribute to the "awesome hack by Dean Edwards"
- // Android Browser returns percentage for some values,
- // but width seems to be reliably pixels.
- // This is against the CSSOM draft spec:
- // https://drafts.csswg.org/cssom/#resolved-values
- if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
-
- // Remember the original values
- width = style.width;
- minWidth = style.minWidth;
- maxWidth = style.maxWidth;
-
- // Put in the new values to get a computed value out
- style.minWidth = style.maxWidth = style.width = ret;
- ret = computed.width;
-
- // Revert the changed values
- style.width = width;
- style.minWidth = minWidth;
- style.maxWidth = maxWidth;
- }
- }
-
- return ret !== undefined ?
-
- // Support: IE <=9 - 11 only
- // IE returns zIndex value as an integer.
- ret + "" :
- ret;
- }
-
-
- function addGetHookIf( conditionFn, hookFn ) {
-
- // Define the hook, we'll check on the first run if it's really needed.
- return {
- get: function() {
- if ( conditionFn() ) {
-
- // Hook not needed (or it's not possible to use it due
- // to missing dependency), remove it.
- delete this.get;
- return;
- }
-
- // Hook needed; redefine it so that the support test is not executed again.
- return ( this.get = hookFn ).apply( this, arguments );
- }
- };
- }
-
-
- var cssPrefixes = [ "Webkit", "Moz", "ms" ],
- emptyStyle = document.createElement( "div" ).style,
- vendorProps = {};
-
- // Return a vendor-prefixed property or undefined
- function vendorPropName( name ) {
-
- // Check for vendor prefixed names
- var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
- i = cssPrefixes.length;
-
- while ( i-- ) {
- name = cssPrefixes[ i ] + capName;
- if ( name in emptyStyle ) {
- return name;
- }
- }
- }
-
- // Return a potentially-mapped jQuery.cssProps or vendor prefixed property
- function finalPropName( name ) {
- var final = jQuery.cssProps[ name ] || vendorProps[ name ];
-
- if ( final ) {
- return final;
- }
- if ( name in emptyStyle ) {
- return name;
- }
- return vendorProps[ name ] = vendorPropName( name ) || name;
- }
-
-
- var
-
- // Swappable if display is none or starts with table
- // except "table", "table-cell", or "table-caption"
- // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
- rdisplayswap = /^(none|table(?!-c[ea]).+)/,
- rcustomProp = /^--/,
- cssShow = { position: "absolute", visibility: "hidden", display: "block" },
- cssNormalTransform = {
- letterSpacing: "0",
- fontWeight: "400"
- };
-
- function setPositiveNumber( elem, value, subtract ) {
-
- // Any relative (+/-) values have already been
- // normalized at this point
- var matches = rcssNum.exec( value );
- return matches ?
-
- // Guard against undefined "subtract", e.g., when used as in cssHooks
- Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
- value;
- }
-
- function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
- var i = dimension === "width" ? 1 : 0,
- extra = 0,
- delta = 0;
-
- // Adjustment may not be necessary
- if ( box === ( isBorderBox ? "border" : "content" ) ) {
- return 0;
- }
-
- for ( ; i < 4; i += 2 ) {
-
- // Both box models exclude margin
- if ( box === "margin" ) {
- delta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
- }
-
- // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
- if ( !isBorderBox ) {
-
- // Add padding
- delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
-
- // For "border" or "margin", add border
- if ( box !== "padding" ) {
- delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
-
- // But still keep track of it otherwise
- } else {
- extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
- }
-
- // If we get here with a border-box (content + padding + border), we're seeking "content" or
- // "padding" or "margin"
- } else {
-
- // For "content", subtract padding
- if ( box === "content" ) {
- delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
- }
-
- // For "content" or "padding", subtract border
- if ( box !== "margin" ) {
- delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
- }
- }
- }
-
- // Account for positive content-box scroll gutter when requested by providing computedVal
- if ( !isBorderBox && computedVal >= 0 ) {
-
- // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
- // Assuming integer scroll gutter, subtract the rest and round down
- delta += Math.max( 0, Math.ceil(
- elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
- computedVal -
- delta -
- extra -
- 0.5
-
- // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
- // Use an explicit zero to avoid NaN (gh-3964)
- ) ) || 0;
- }
-
- return delta;
- }
-
- function getWidthOrHeight( elem, dimension, extra ) {
-
- // Start with computed style
- var styles = getStyles( elem ),
-
- // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
- // Fake content-box until we know it's needed to know the true value.
- boxSizingNeeded = !support.boxSizingReliable() || extra,
- isBorderBox = boxSizingNeeded &&
- jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
- valueIsBorderBox = isBorderBox,
-
- val = curCSS( elem, dimension, styles ),
- offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
-
- // Support: Firefox <=54
- // Return a confounding non-pixel value or feign ignorance, as appropriate.
- if ( rnumnonpx.test( val ) ) {
- if ( !extra ) {
- return val;
- }
- val = "auto";
- }
-
-
- // Fall back to offsetWidth/offsetHeight when value is "auto"
- // This happens for inline elements with no explicit setting (gh-3571)
- // Support: Android <=4.1 - 4.3 only
- // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
- // Support: IE 9-11 only
- // Also use offsetWidth/offsetHeight for when box sizing is unreliable
- // We use getClientRects() to check for hidden/disconnected.
- // In those cases, the computed value can be trusted to be border-box
- if ( ( !support.boxSizingReliable() && isBorderBox ||
- val === "auto" ||
- !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
- elem.getClientRects().length ) {
-
- isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
-
- // Where available, offsetWidth/offsetHeight approximate border box dimensions.
- // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
- // retrieved value as a content box dimension.
- valueIsBorderBox = offsetProp in elem;
- if ( valueIsBorderBox ) {
- val = elem[ offsetProp ];
- }
- }
-
- // Normalize "" and auto
- val = parseFloat( val ) || 0;
-
- // Adjust for the element's box model
- return ( val +
- boxModelAdjustment(
- elem,
- dimension,
- extra || ( isBorderBox ? "border" : "content" ),
- valueIsBorderBox,
- styles,
-
- // Provide the current computed size to request scroll gutter calculation (gh-3589)
- val
- )
- ) + "px";
- }
-
- jQuery.extend( {
-
- // Add in style property hooks for overriding the default
- // behavior of getting and setting a style property
- cssHooks: {
- opacity: {
- get: function( elem, computed ) {
- if ( computed ) {
-
- // We should always get a number back from opacity
- var ret = curCSS( elem, "opacity" );
- return ret === "" ? "1" : ret;
- }
- }
- }
- },
-
- // Don't automatically add "px" to these possibly-unitless properties
- cssNumber: {
- "animationIterationCount": true,
- "columnCount": true,
- "fillOpacity": true,
- "flexGrow": true,
- "flexShrink": true,
- "fontWeight": true,
- "gridArea": true,
- "gridColumn": true,
- "gridColumnEnd": true,
- "gridColumnStart": true,
- "gridRow": true,
- "gridRowEnd": true,
- "gridRowStart": true,
- "lineHeight": true,
- "opacity": true,
- "order": true,
- "orphans": true,
- "widows": true,
- "zIndex": true,
- "zoom": true
- },
-
- // Add in properties whose names you wish to fix before
- // setting or getting the value
- cssProps: {},
-
- // Get and set the style property on a DOM Node
- style: function( elem, name, value, extra ) {
-
- // Don't set styles on text and comment nodes
- if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
- return;
- }
-
- // Make sure that we're working with the right name
- var ret, type, hooks,
- origName = camelCase( name ),
- isCustomProp = rcustomProp.test( name ),
- style = elem.style;
-
- // Make sure that we're working with the right name. We don't
- // want to query the value if it is a CSS custom property
- // since they are user-defined.
- if ( !isCustomProp ) {
- name = finalPropName( origName );
- }
-
- // Gets hook for the prefixed version, then unprefixed version
- hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
- // Check if we're setting a value
- if ( value !== undefined ) {
- type = typeof value;
-
- // Convert "+=" or "-=" to relative numbers (#7345)
- if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
- value = adjustCSS( elem, name, ret );
-
- // Fixes bug #9237
- type = "number";
- }
-
- // Make sure that null and NaN values aren't set (#7116)
- if ( value == null || value !== value ) {
- return;
- }
-
- // If a number was passed in, add the unit (except for certain CSS properties)
- // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
- // "px" to a few hardcoded values.
- if ( type === "number" && !isCustomProp ) {
- value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
- }
-
- // background-* props affect original clone's values
- if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
- style[ name ] = "inherit";
- }
-
- // If a hook was provided, use that value, otherwise just set the specified value
- if ( !hooks || !( "set" in hooks ) ||
- ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
-
- if ( isCustomProp ) {
- style.setProperty( name, value );
- } else {
- style[ name ] = value;
- }
- }
-
- } else {
-
- // If a hook was provided get the non-computed value from there
- if ( hooks && "get" in hooks &&
- ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
-
- return ret;
- }
-
- // Otherwise just get the value from the style object
- return style[ name ];
- }
- },
-
- css: function( elem, name, extra, styles ) {
- var val, num, hooks,
- origName = camelCase( name ),
- isCustomProp = rcustomProp.test( name );
-
- // Make sure that we're working with the right name. We don't
- // want to modify the value if it is a CSS custom property
- // since they are user-defined.
- if ( !isCustomProp ) {
- name = finalPropName( origName );
- }
-
- // Try prefixed name followed by the unprefixed name
- hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
- // If a hook was provided get the computed value from there
- if ( hooks && "get" in hooks ) {
- val = hooks.get( elem, true, extra );
- }
-
- // Otherwise, if a way to get the computed value exists, use that
- if ( val === undefined ) {
- val = curCSS( elem, name, styles );
- }
-
- // Convert "normal" to computed value
- if ( val === "normal" && name in cssNormalTransform ) {
- val = cssNormalTransform[ name ];
- }
-
- // Make numeric if forced or a qualifier was provided and val looks numeric
- if ( extra === "" || extra ) {
- num = parseFloat( val );
- return extra === true || isFinite( num ) ? num || 0 : val;
- }
-
- return val;
- }
- } );
-
- jQuery.each( [ "height", "width" ], function( i, dimension ) {
- jQuery.cssHooks[ dimension ] = {
- get: function( elem, computed, extra ) {
- if ( computed ) {
-
- // Certain elements can have dimension info if we invisibly show them
- // but it must have a current display style that would benefit
- return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
-
- // Support: Safari 8+
- // Table columns in Safari have non-zero offsetWidth & zero
- // getBoundingClientRect().width unless display is changed.
- // Support: IE <=11 only
- // Running getBoundingClientRect on a disconnected node
- // in IE throws an error.
- ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
- swap( elem, cssShow, function() {
- return getWidthOrHeight( elem, dimension, extra );
- } ) :
- getWidthOrHeight( elem, dimension, extra );
- }
- },
-
- set: function( elem, value, extra ) {
- var matches,
- styles = getStyles( elem ),
-
- // Only read styles.position if the test has a chance to fail
- // to avoid forcing a reflow.
- scrollboxSizeBuggy = !support.scrollboxSize() &&
- styles.position === "absolute",
-
- // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
- boxSizingNeeded = scrollboxSizeBuggy || extra,
- isBorderBox = boxSizingNeeded &&
- jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
- subtract = extra ?
- boxModelAdjustment(
- elem,
- dimension,
- extra,
- isBorderBox,
- styles
- ) :
- 0;
-
- // Account for unreliable border-box dimensions by comparing offset* to computed and
- // faking a content-box to get border and padding (gh-3699)
- if ( isBorderBox && scrollboxSizeBuggy ) {
- subtract -= Math.ceil(
- elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
- parseFloat( styles[ dimension ] ) -
- boxModelAdjustment( elem, dimension, "border", false, styles ) -
- 0.5
- );
- }
-
- // Convert to pixels if value adjustment is needed
- if ( subtract && ( matches = rcssNum.exec( value ) ) &&
- ( matches[ 3 ] || "px" ) !== "px" ) {
-
- elem.style[ dimension ] = value;
- value = jQuery.css( elem, dimension );
- }
-
- return setPositiveNumber( elem, value, subtract );
- }
- };
- } );
-
- jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
- function( elem, computed ) {
- if ( computed ) {
- return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
- elem.getBoundingClientRect().left -
- swap( elem, { marginLeft: 0 }, function() {
- return elem.getBoundingClientRect().left;
- } )
- ) + "px";
- }
- }
- );
-
- // These hooks are used by animate to expand properties
- jQuery.each( {
- margin: "",
- padding: "",
- border: "Width"
- }, function( prefix, suffix ) {
- jQuery.cssHooks[ prefix + suffix ] = {
- expand: function( value ) {
- var i = 0,
- expanded = {},
-
- // Assumes a single number if not a string
- parts = typeof value === "string" ? value.split( " " ) : [ value ];
-
- for ( ; i < 4; i++ ) {
- expanded[ prefix + cssExpand[ i ] + suffix ] =
- parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
- }
-
- return expanded;
- }
- };
-
- if ( prefix !== "margin" ) {
- jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
- }
- } );
-
- jQuery.fn.extend( {
- css: function( name, value ) {
- return access( this, function( elem, name, value ) {
- var styles, len,
- map = {},
- i = 0;
-
- if ( Array.isArray( name ) ) {
- styles = getStyles( elem );
- len = name.length;
-
- for ( ; i < len; i++ ) {
- map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
- }
-
- return map;
- }
-
- return value !== undefined ?
- jQuery.style( elem, name, value ) :
- jQuery.css( elem, name );
- }, name, value, arguments.length > 1 );
- }
- } );
-
-
- function Tween( elem, options, prop, end, easing ) {
- return new Tween.prototype.init( elem, options, prop, end, easing );
- }
- jQuery.Tween = Tween;
-
- Tween.prototype = {
- constructor: Tween,
- init: function( elem, options, prop, end, easing, unit ) {
- this.elem = elem;
- this.prop = prop;
- this.easing = easing || jQuery.easing._default;
- this.options = options;
- this.start = this.now = this.cur();
- this.end = end;
- this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
- },
- cur: function() {
- var hooks = Tween.propHooks[ this.prop ];
-
- return hooks && hooks.get ?
- hooks.get( this ) :
- Tween.propHooks._default.get( this );
- },
- run: function( percent ) {
- var eased,
- hooks = Tween.propHooks[ this.prop ];
-
- if ( this.options.duration ) {
- this.pos = eased = jQuery.easing[ this.easing ](
- percent, this.options.duration * percent, 0, 1, this.options.duration
- );
- } else {
- this.pos = eased = percent;
- }
- this.now = ( this.end - this.start ) * eased + this.start;
-
- if ( this.options.step ) {
- this.options.step.call( this.elem, this.now, this );
- }
-
- if ( hooks && hooks.set ) {
- hooks.set( this );
- } else {
- Tween.propHooks._default.set( this );
- }
- return this;
- }
- };
-
- Tween.prototype.init.prototype = Tween.prototype;
-
- Tween.propHooks = {
- _default: {
- get: function( tween ) {
- var result;
-
- // Use a property on the element directly when it is not a DOM element,
- // or when there is no matching style property that exists.
- if ( tween.elem.nodeType !== 1 ||
- tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
- return tween.elem[ tween.prop ];
- }
-
- // Passing an empty string as a 3rd parameter to .css will automatically
- // attempt a parseFloat and fallback to a string if the parse fails.
- // Simple values such as "10px" are parsed to Float;
- // complex values such as "rotate(1rad)" are returned as-is.
- result = jQuery.css( tween.elem, tween.prop, "" );
-
- // Empty strings, null, undefined and "auto" are converted to 0.
- return !result || result === "auto" ? 0 : result;
- },
- set: function( tween ) {
-
- // Use step hook for back compat.
- // Use cssHook if its there.
- // Use .style if available and use plain properties where available.
- if ( jQuery.fx.step[ tween.prop ] ) {
- jQuery.fx.step[ tween.prop ]( tween );
- } else if ( tween.elem.nodeType === 1 && (
- jQuery.cssHooks[ tween.prop ] ||
- tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
- jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
- } else {
- tween.elem[ tween.prop ] = tween.now;
- }
- }
- }
- };
-
- // Support: IE <=9 only
- // Panic based approach to setting things on disconnected nodes
- Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
- set: function( tween ) {
- if ( tween.elem.nodeType && tween.elem.parentNode ) {
- tween.elem[ tween.prop ] = tween.now;
- }
- }
- };
-
- jQuery.easing = {
- linear: function( p ) {
- return p;
- },
- swing: function( p ) {
- return 0.5 - Math.cos( p * Math.PI ) / 2;
- },
- _default: "swing"
- };
-
- jQuery.fx = Tween.prototype.init;
-
- // Back compat <1.8 extension point
- jQuery.fx.step = {};
-
-
-
-
- var
- fxNow, inProgress,
- rfxtypes = /^(?:toggle|show|hide)$/,
- rrun = /queueHooks$/;
-
- function schedule() {
- if ( inProgress ) {
- if ( document.hidden === false && window.requestAnimationFrame ) {
- window.requestAnimationFrame( schedule );
- } else {
- window.setTimeout( schedule, jQuery.fx.interval );
- }
-
- jQuery.fx.tick();
- }
- }
-
- // Animations created synchronously will run synchronously
- function createFxNow() {
- window.setTimeout( function() {
- fxNow = undefined;
- } );
- return ( fxNow = Date.now() );
- }
-
- // Generate parameters to create a standard animation
- function genFx( type, includeWidth ) {
- var which,
- i = 0,
- attrs = { height: type };
-
- // If we include width, step value is 1 to do all cssExpand values,
- // otherwise step value is 2 to skip over Left and Right
- includeWidth = includeWidth ? 1 : 0;
- for ( ; i < 4; i += 2 - includeWidth ) {
- which = cssExpand[ i ];
- attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
- }
-
- if ( includeWidth ) {
- attrs.opacity = attrs.width = type;
- }
-
- return attrs;
- }
-
- function createTween( value, prop, animation ) {
- var tween,
- collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
- index = 0,
- length = collection.length;
- for ( ; index < length; index++ ) {
- if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
-
- // We're done with this property
- return tween;
- }
- }
- }
-
- function defaultPrefilter( elem, props, opts ) {
- var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
- isBox = "width" in props || "height" in props,
- anim = this,
- orig = {},
- style = elem.style,
- hidden = elem.nodeType && isHiddenWithinTree( elem ),
- dataShow = dataPriv.get( elem, "fxshow" );
-
- // Queue-skipping animations hijack the fx hooks
- if ( !opts.queue ) {
- hooks = jQuery._queueHooks( elem, "fx" );
- if ( hooks.unqueued == null ) {
- hooks.unqueued = 0;
- oldfire = hooks.empty.fire;
- hooks.empty.fire = function() {
- if ( !hooks.unqueued ) {
- oldfire();
- }
- };
- }
- hooks.unqueued++;
-
- anim.always( function() {
-
- // Ensure the complete handler is called before this completes
- anim.always( function() {
- hooks.unqueued--;
- if ( !jQuery.queue( elem, "fx" ).length ) {
- hooks.empty.fire();
- }
- } );
- } );
- }
-
- // Detect show/hide animations
- for ( prop in props ) {
- value = props[ prop ];
- if ( rfxtypes.test( value ) ) {
- delete props[ prop ];
- toggle = toggle || value === "toggle";
- if ( value === ( hidden ? "hide" : "show" ) ) {
-
- // Pretend to be hidden if this is a "show" and
- // there is still data from a stopped show/hide
- if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
- hidden = true;
-
- // Ignore all other no-op show/hide data
- } else {
- continue;
- }
- }
- orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
- }
- }
-
- // Bail out if this is a no-op like .hide().hide()
- propTween = !jQuery.isEmptyObject( props );
- if ( !propTween && jQuery.isEmptyObject( orig ) ) {
- return;
- }
-
- // Restrict "overflow" and "display" styles during box animations
- if ( isBox && elem.nodeType === 1 ) {
-
- // Support: IE <=9 - 11, Edge 12 - 15
- // Record all 3 overflow attributes because IE does not infer the shorthand
- // from identically-valued overflowX and overflowY and Edge just mirrors
- // the overflowX value there.
- opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
-
- // Identify a display type, preferring old show/hide data over the CSS cascade
- restoreDisplay = dataShow && dataShow.display;
- if ( restoreDisplay == null ) {
- restoreDisplay = dataPriv.get( elem, "display" );
- }
- display = jQuery.css( elem, "display" );
- if ( display === "none" ) {
- if ( restoreDisplay ) {
- display = restoreDisplay;
- } else {
-
- // Get nonempty value(s) by temporarily forcing visibility
- showHide( [ elem ], true );
- restoreDisplay = elem.style.display || restoreDisplay;
- display = jQuery.css( elem, "display" );
- showHide( [ elem ] );
- }
- }
-
- // Animate inline elements as inline-block
- if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
- if ( jQuery.css( elem, "float" ) === "none" ) {
-
- // Restore the original display value at the end of pure show/hide animations
- if ( !propTween ) {
- anim.done( function() {
- style.display = restoreDisplay;
- } );
- if ( restoreDisplay == null ) {
- display = style.display;
- restoreDisplay = display === "none" ? "" : display;
- }
- }
- style.display = "inline-block";
- }
- }
- }
-
- if ( opts.overflow ) {
- style.overflow = "hidden";
- anim.always( function() {
- style.overflow = opts.overflow[ 0 ];
- style.overflowX = opts.overflow[ 1 ];
- style.overflowY = opts.overflow[ 2 ];
- } );
- }
-
- // Implement show/hide animations
- propTween = false;
- for ( prop in orig ) {
-
- // General show/hide setup for this element animation
- if ( !propTween ) {
- if ( dataShow ) {
- if ( "hidden" in dataShow ) {
- hidden = dataShow.hidden;
- }
- } else {
- dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
- }
-
- // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
- if ( toggle ) {
- dataShow.hidden = !hidden;
- }
-
- // Show elements before animating them
- if ( hidden ) {
- showHide( [ elem ], true );
- }
-
- /* eslint-disable no-loop-func */
-
- anim.done( function() {
-
- /* eslint-enable no-loop-func */
-
- // The final step of a "hide" animation is actually hiding the element
- if ( !hidden ) {
- showHide( [ elem ] );
- }
- dataPriv.remove( elem, "fxshow" );
- for ( prop in orig ) {
- jQuery.style( elem, prop, orig[ prop ] );
- }
- } );
- }
-
- // Per-property setup
- propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
- if ( !( prop in dataShow ) ) {
- dataShow[ prop ] = propTween.start;
- if ( hidden ) {
- propTween.end = propTween.start;
- propTween.start = 0;
- }
- }
- }
- }
-
- function propFilter( props, specialEasing ) {
- var index, name, easing, value, hooks;
-
- // camelCase, specialEasing and expand cssHook pass
- for ( index in props ) {
- name = camelCase( index );
- easing = specialEasing[ name ];
- value = props[ index ];
- if ( Array.isArray( value ) ) {
- easing = value[ 1 ];
- value = props[ index ] = value[ 0 ];
- }
-
- if ( index !== name ) {
- props[ name ] = value;
- delete props[ index ];
- }
-
- hooks = jQuery.cssHooks[ name ];
- if ( hooks && "expand" in hooks ) {
- value = hooks.expand( value );
- delete props[ name ];
-
- // Not quite $.extend, this won't overwrite existing keys.
- // Reusing 'index' because we have the correct "name"
- for ( index in value ) {
- if ( !( index in props ) ) {
- props[ index ] = value[ index ];
- specialEasing[ index ] = easing;
- }
- }
- } else {
- specialEasing[ name ] = easing;
- }
- }
- }
-
- function Animation( elem, properties, options ) {
- var result,
- stopped,
- index = 0,
- length = Animation.prefilters.length,
- deferred = jQuery.Deferred().always( function() {
-
- // Don't match elem in the :animated selector
- delete tick.elem;
- } ),
- tick = function() {
- if ( stopped ) {
- return false;
- }
- var currentTime = fxNow || createFxNow(),
- remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
-
- // Support: Android 2.3 only
- // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
- temp = remaining / animation.duration || 0,
- percent = 1 - temp,
- index = 0,
- length = animation.tweens.length;
-
- for ( ; index < length; index++ ) {
- animation.tweens[ index ].run( percent );
- }
-
- deferred.notifyWith( elem, [ animation, percent, remaining ] );
-
- // If there's more to do, yield
- if ( percent < 1 && length ) {
- return remaining;
- }
-
- // If this was an empty animation, synthesize a final progress notification
- if ( !length ) {
- deferred.notifyWith( elem, [ animation, 1, 0 ] );
- }
-
- // Resolve the animation and report its conclusion
- deferred.resolveWith( elem, [ animation ] );
- return false;
- },
- animation = deferred.promise( {
- elem: elem,
- props: jQuery.extend( {}, properties ),
- opts: jQuery.extend( true, {
- specialEasing: {},
- easing: jQuery.easing._default
- }, options ),
- originalProperties: properties,
- originalOptions: options,
- startTime: fxNow || createFxNow(),
- duration: options.duration,
- tweens: [],
- createTween: function( prop, end ) {
- var tween = jQuery.Tween( elem, animation.opts, prop, end,
- animation.opts.specialEasing[ prop ] || animation.opts.easing );
- animation.tweens.push( tween );
- return tween;
- },
- stop: function( gotoEnd ) {
- var index = 0,
-
- // If we are going to the end, we want to run all the tweens
- // otherwise we skip this part
- length = gotoEnd ? animation.tweens.length : 0;
- if ( stopped ) {
- return this;
- }
- stopped = true;
- for ( ; index < length; index++ ) {
- animation.tweens[ index ].run( 1 );
- }
-
- // Resolve when we played the last frame; otherwise, reject
- if ( gotoEnd ) {
- deferred.notifyWith( elem, [ animation, 1, 0 ] );
- deferred.resolveWith( elem, [ animation, gotoEnd ] );
- } else {
- deferred.rejectWith( elem, [ animation, gotoEnd ] );
- }
- return this;
- }
- } ),
- props = animation.props;
-
- propFilter( props, animation.opts.specialEasing );
-
- for ( ; index < length; index++ ) {
- result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
- if ( result ) {
- if ( isFunction( result.stop ) ) {
- jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
- result.stop.bind( result );
- }
- return result;
- }
- }
-
- jQuery.map( props, createTween, animation );
-
- if ( isFunction( animation.opts.start ) ) {
- animation.opts.start.call( elem, animation );
- }
-
- // Attach callbacks from options
- animation
- .progress( animation.opts.progress )
- .done( animation.opts.done, animation.opts.complete )
- .fail( animation.opts.fail )
- .always( animation.opts.always );
-
- jQuery.fx.timer(
- jQuery.extend( tick, {
- elem: elem,
- anim: animation,
- queue: animation.opts.queue
- } )
- );
-
- return animation;
- }
-
- jQuery.Animation = jQuery.extend( Animation, {
-
- tweeners: {
- "*": [ function( prop, value ) {
- var tween = this.createTween( prop, value );
- adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
- return tween;
- } ]
- },
-
- tweener: function( props, callback ) {
- if ( isFunction( props ) ) {
- callback = props;
- props = [ "*" ];
- } else {
- props = props.match( rnothtmlwhite );
- }
-
- var prop,
- index = 0,
- length = props.length;
-
- for ( ; index < length; index++ ) {
- prop = props[ index ];
- Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
- Animation.tweeners[ prop ].unshift( callback );
- }
- },
-
- prefilters: [ defaultPrefilter ],
-
- prefilter: function( callback, prepend ) {
- if ( prepend ) {
- Animation.prefilters.unshift( callback );
- } else {
- Animation.prefilters.push( callback );
- }
- }
- } );
-
- jQuery.speed = function( speed, easing, fn ) {
- var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
- complete: fn || !fn && easing ||
- isFunction( speed ) && speed,
- duration: speed,
- easing: fn && easing || easing && !isFunction( easing ) && easing
- };
-
- // Go to the end state if fx are off
- if ( jQuery.fx.off ) {
- opt.duration = 0;
-
- } else {
- if ( typeof opt.duration !== "number" ) {
- if ( opt.duration in jQuery.fx.speeds ) {
- opt.duration = jQuery.fx.speeds[ opt.duration ];
-
- } else {
- opt.duration = jQuery.fx.speeds._default;
- }
- }
- }
-
- // Normalize opt.queue - true/undefined/null -> "fx"
- if ( opt.queue == null || opt.queue === true ) {
- opt.queue = "fx";
- }
-
- // Queueing
- opt.old = opt.complete;
-
- opt.complete = function() {
- if ( isFunction( opt.old ) ) {
- opt.old.call( this );
- }
-
- if ( opt.queue ) {
- jQuery.dequeue( this, opt.queue );
- }
- };
-
- return opt;
- };
-
- jQuery.fn.extend( {
- fadeTo: function( speed, to, easing, callback ) {
-
- // Show any hidden elements after setting opacity to 0
- return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
-
- // Animate to the value specified
- .end().animate( { opacity: to }, speed, easing, callback );
- },
- animate: function( prop, speed, easing, callback ) {
- var empty = jQuery.isEmptyObject( prop ),
- optall = jQuery.speed( speed, easing, callback ),
- doAnimation = function() {
-
- // Operate on a copy of prop so per-property easing won't be lost
- var anim = Animation( this, jQuery.extend( {}, prop ), optall );
-
- // Empty animations, or finishing resolves immediately
- if ( empty || dataPriv.get( this, "finish" ) ) {
- anim.stop( true );
- }
- };
- doAnimation.finish = doAnimation;
-
- return empty || optall.queue === false ?
- this.each( doAnimation ) :
- this.queue( optall.queue, doAnimation );
- },
- stop: function( type, clearQueue, gotoEnd ) {
- var stopQueue = function( hooks ) {
- var stop = hooks.stop;
- delete hooks.stop;
- stop( gotoEnd );
- };
-
- if ( typeof type !== "string" ) {
- gotoEnd = clearQueue;
- clearQueue = type;
- type = undefined;
- }
- if ( clearQueue && type !== false ) {
- this.queue( type || "fx", [] );
- }
-
- return this.each( function() {
- var dequeue = true,
- index = type != null && type + "queueHooks",
- timers = jQuery.timers,
- data = dataPriv.get( this );
-
- if ( index ) {
- if ( data[ index ] && data[ index ].stop ) {
- stopQueue( data[ index ] );
- }
- } else {
- for ( index in data ) {
- if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
- stopQueue( data[ index ] );
- }
- }
- }
-
- for ( index = timers.length; index--; ) {
- if ( timers[ index ].elem === this &&
- ( type == null || timers[ index ].queue === type ) ) {
-
- timers[ index ].anim.stop( gotoEnd );
- dequeue = false;
- timers.splice( index, 1 );
- }
- }
-
- // Start the next in the queue if the last step wasn't forced.
- // Timers currently will call their complete callbacks, which
- // will dequeue but only if they were gotoEnd.
- if ( dequeue || !gotoEnd ) {
- jQuery.dequeue( this, type );
- }
- } );
- },
- finish: function( type ) {
- if ( type !== false ) {
- type = type || "fx";
- }
- return this.each( function() {
- var index,
- data = dataPriv.get( this ),
- queue = data[ type + "queue" ],
- hooks = data[ type + "queueHooks" ],
- timers = jQuery.timers,
- length = queue ? queue.length : 0;
-
- // Enable finishing flag on private data
- data.finish = true;
-
- // Empty the queue first
- jQuery.queue( this, type, [] );
-
- if ( hooks && hooks.stop ) {
- hooks.stop.call( this, true );
- }
-
- // Look for any active animations, and finish them
- for ( index = timers.length; index--; ) {
- if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
- timers[ index ].anim.stop( true );
- timers.splice( index, 1 );
- }
- }
-
- // Look for any animations in the old queue and finish them
- for ( index = 0; index < length; index++ ) {
- if ( queue[ index ] && queue[ index ].finish ) {
- queue[ index ].finish.call( this );
- }
- }
-
- // Turn off finishing flag
- delete data.finish;
- } );
- }
- } );
-
- jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
- var cssFn = jQuery.fn[ name ];
- jQuery.fn[ name ] = function( speed, easing, callback ) {
- return speed == null || typeof speed === "boolean" ?
- cssFn.apply( this, arguments ) :
- this.animate( genFx( name, true ), speed, easing, callback );
- };
- } );
-
- // Generate shortcuts for custom animations
- jQuery.each( {
- slideDown: genFx( "show" ),
- slideUp: genFx( "hide" ),
- slideToggle: genFx( "toggle" ),
- fadeIn: { opacity: "show" },
- fadeOut: { opacity: "hide" },
- fadeToggle: { opacity: "toggle" }
- }, function( name, props ) {
- jQuery.fn[ name ] = function( speed, easing, callback ) {
- return this.animate( props, speed, easing, callback );
- };
- } );
-
- jQuery.timers = [];
- jQuery.fx.tick = function() {
- var timer,
- i = 0,
- timers = jQuery.timers;
-
- fxNow = Date.now();
-
- for ( ; i < timers.length; i++ ) {
- timer = timers[ i ];
-
- // Run the timer and safely remove it when done (allowing for external removal)
- if ( !timer() && timers[ i ] === timer ) {
- timers.splice( i--, 1 );
- }
- }
-
- if ( !timers.length ) {
- jQuery.fx.stop();
- }
- fxNow = undefined;
- };
-
- jQuery.fx.timer = function( timer ) {
- jQuery.timers.push( timer );
- jQuery.fx.start();
- };
-
- jQuery.fx.interval = 13;
- jQuery.fx.start = function() {
- if ( inProgress ) {
- return;
- }
-
- inProgress = true;
- schedule();
- };
-
- jQuery.fx.stop = function() {
- inProgress = null;
- };
-
- jQuery.fx.speeds = {
- slow: 600,
- fast: 200,
-
- // Default speed
- _default: 400
- };
-
-
- // Based off of the plugin by Clint Helfers, with permission.
- // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
- jQuery.fn.delay = function( time, type ) {
- time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
- type = type || "fx";
-
- return this.queue( type, function( next, hooks ) {
- var timeout = window.setTimeout( next, time );
- hooks.stop = function() {
- window.clearTimeout( timeout );
- };
- } );
- };
-
-
- ( function() {
- var input = document.createElement( "input" ),
- select = document.createElement( "select" ),
- opt = select.appendChild( document.createElement( "option" ) );
-
- input.type = "checkbox";
-
- // Support: Android <=4.3 only
- // Default value for a checkbox should be "on"
- support.checkOn = input.value !== "";
-
- // Support: IE <=11 only
- // Must access selectedIndex to make default options select
- support.optSelected = opt.selected;
-
- // Support: IE <=11 only
- // An input loses its value after becoming a radio
- input = document.createElement( "input" );
- input.value = "t";
- input.type = "radio";
- support.radioValue = input.value === "t";
- } )();
-
-
- var boolHook,
- attrHandle = jQuery.expr.attrHandle;
-
- jQuery.fn.extend( {
- attr: function( name, value ) {
- return access( this, jQuery.attr, name, value, arguments.length > 1 );
- },
-
- removeAttr: function( name ) {
- return this.each( function() {
- jQuery.removeAttr( this, name );
- } );
- }
- } );
-
- jQuery.extend( {
- attr: function( elem, name, value ) {
- var ret, hooks,
- nType = elem.nodeType;
-
- // Don't get/set attributes on text, comment and attribute nodes
- if ( nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- // Fallback to prop when attributes are not supported
- if ( typeof elem.getAttribute === "undefined" ) {
- return jQuery.prop( elem, name, value );
- }
-
- // Attribute hooks are determined by the lowercase version
- // Grab necessary hook if one is defined
- if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
- hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
- ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
- }
-
- if ( value !== undefined ) {
- if ( value === null ) {
- jQuery.removeAttr( elem, name );
- return;
- }
-
- if ( hooks && "set" in hooks &&
- ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
- return ret;
- }
-
- elem.setAttribute( name, value + "" );
- return value;
- }
-
- if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
- return ret;
- }
-
- ret = jQuery.find.attr( elem, name );
-
- // Non-existent attributes return null, we normalize to undefined
- return ret == null ? undefined : ret;
- },
-
- attrHooks: {
- type: {
- set: function( elem, value ) {
- if ( !support.radioValue && value === "radio" &&
- nodeName( elem, "input" ) ) {
- var val = elem.value;
- elem.setAttribute( "type", value );
- if ( val ) {
- elem.value = val;
- }
- return value;
- }
- }
- }
- },
-
- removeAttr: function( elem, value ) {
- var name,
- i = 0,
-
- // Attribute names can contain non-HTML whitespace characters
- // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
- attrNames = value && value.match( rnothtmlwhite );
-
- if ( attrNames && elem.nodeType === 1 ) {
- while ( ( name = attrNames[ i++ ] ) ) {
- elem.removeAttribute( name );
- }
- }
- }
- } );
-
- // Hooks for boolean attributes
- boolHook = {
- set: function( elem, value, name ) {
- if ( value === false ) {
-
- // Remove boolean attributes when set to false
- jQuery.removeAttr( elem, name );
- } else {
- elem.setAttribute( name, name );
- }
- return name;
- }
- };
-
- jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
- var getter = attrHandle[ name ] || jQuery.find.attr;
-
- attrHandle[ name ] = function( elem, name, isXML ) {
- var ret, handle,
- lowercaseName = name.toLowerCase();
-
- if ( !isXML ) {
-
- // Avoid an infinite loop by temporarily removing this function from the getter
- handle = attrHandle[ lowercaseName ];
- attrHandle[ lowercaseName ] = ret;
- ret = getter( elem, name, isXML ) != null ?
- lowercaseName :
- null;
- attrHandle[ lowercaseName ] = handle;
- }
- return ret;
- };
- } );
-
-
-
-
- var rfocusable = /^(?:input|select|textarea|button)$/i,
- rclickable = /^(?:a|area)$/i;
-
- jQuery.fn.extend( {
- prop: function( name, value ) {
- return access( this, jQuery.prop, name, value, arguments.length > 1 );
- },
-
- removeProp: function( name ) {
- return this.each( function() {
- delete this[ jQuery.propFix[ name ] || name ];
- } );
- }
- } );
-
- jQuery.extend( {
- prop: function( elem, name, value ) {
- var ret, hooks,
- nType = elem.nodeType;
-
- // Don't get/set properties on text, comment and attribute nodes
- if ( nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
-
- // Fix name and attach hooks
- name = jQuery.propFix[ name ] || name;
- hooks = jQuery.propHooks[ name ];
- }
-
- if ( value !== undefined ) {
- if ( hooks && "set" in hooks &&
- ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
- return ret;
- }
-
- return ( elem[ name ] = value );
- }
-
- if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
- return ret;
- }
-
- return elem[ name ];
- },
-
- propHooks: {
- tabIndex: {
- get: function( elem ) {
-
- // Support: IE <=9 - 11 only
- // elem.tabIndex doesn't always return the
- // correct value when it hasn't been explicitly set
- // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
- // Use proper attribute retrieval(#12072)
- var tabindex = jQuery.find.attr( elem, "tabindex" );
-
- if ( tabindex ) {
- return parseInt( tabindex, 10 );
- }
-
- if (
- rfocusable.test( elem.nodeName ) ||
- rclickable.test( elem.nodeName ) &&
- elem.href
- ) {
- return 0;
- }
-
- return -1;
- }
- }
- },
-
- propFix: {
- "for": "htmlFor",
- "class": "className"
- }
- } );
-
- // Support: IE <=11 only
- // Accessing the selectedIndex property
- // forces the browser to respect setting selected
- // on the option
- // The getter ensures a default option is selected
- // when in an optgroup
- // eslint rule "no-unused-expressions" is disabled for this code
- // since it considers such accessions noop
- if ( !support.optSelected ) {
- jQuery.propHooks.selected = {
- get: function( elem ) {
-
- /* eslint no-unused-expressions: "off" */
-
- var parent = elem.parentNode;
- if ( parent && parent.parentNode ) {
- parent.parentNode.selectedIndex;
- }
- return null;
- },
- set: function( elem ) {
-
- /* eslint no-unused-expressions: "off" */
-
- var parent = elem.parentNode;
- if ( parent ) {
- parent.selectedIndex;
-
- if ( parent.parentNode ) {
- parent.parentNode.selectedIndex;
- }
- }
- }
- };
- }
-
- jQuery.each( [
- "tabIndex",
- "readOnly",
- "maxLength",
- "cellSpacing",
- "cellPadding",
- "rowSpan",
- "colSpan",
- "useMap",
- "frameBorder",
- "contentEditable"
- ], function() {
- jQuery.propFix[ this.toLowerCase() ] = this;
- } );
-
-
-
-
- // Strip and collapse whitespace according to HTML spec
- // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
- function stripAndCollapse( value ) {
- var tokens = value.match( rnothtmlwhite ) || [];
- return tokens.join( " " );
- }
-
-
- function getClass( elem ) {
- return elem.getAttribute && elem.getAttribute( "class" ) || "";
- }
-
- function classesToArray( value ) {
- if ( Array.isArray( value ) ) {
- return value;
- }
- if ( typeof value === "string" ) {
- return value.match( rnothtmlwhite ) || [];
- }
- return [];
- }
-
- jQuery.fn.extend( {
- addClass: function( value ) {
- var classes, elem, cur, curValue, clazz, j, finalValue,
- i = 0;
-
- if ( isFunction( value ) ) {
- return this.each( function( j ) {
- jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
- } );
- }
-
- classes = classesToArray( value );
-
- if ( classes.length ) {
- while ( ( elem = this[ i++ ] ) ) {
- curValue = getClass( elem );
- cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
-
- if ( cur ) {
- j = 0;
- while ( ( clazz = classes[ j++ ] ) ) {
- if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
- cur += clazz + " ";
- }
- }
-
- // Only assign if different to avoid unneeded rendering.
- finalValue = stripAndCollapse( cur );
- if ( curValue !== finalValue ) {
- elem.setAttribute( "class", finalValue );
- }
- }
- }
- }
-
- return this;
- },
-
- removeClass: function( value ) {
- var classes, elem, cur, curValue, clazz, j, finalValue,
- i = 0;
-
- if ( isFunction( value ) ) {
- return this.each( function( j ) {
- jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
- } );
- }
-
- if ( !arguments.length ) {
- return this.attr( "class", "" );
- }
-
- classes = classesToArray( value );
-
- if ( classes.length ) {
- while ( ( elem = this[ i++ ] ) ) {
- curValue = getClass( elem );
-
- // This expression is here for better compressibility (see addClass)
- cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
-
- if ( cur ) {
- j = 0;
- while ( ( clazz = classes[ j++ ] ) ) {
-
- // Remove *all* instances
- while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
- cur = cur.replace( " " + clazz + " ", " " );
- }
- }
-
- // Only assign if different to avoid unneeded rendering.
- finalValue = stripAndCollapse( cur );
- if ( curValue !== finalValue ) {
- elem.setAttribute( "class", finalValue );
- }
- }
- }
- }
-
- return this;
- },
-
- toggleClass: function( value, stateVal ) {
- var type = typeof value,
- isValidValue = type === "string" || Array.isArray( value );
-
- if ( typeof stateVal === "boolean" && isValidValue ) {
- return stateVal ? this.addClass( value ) : this.removeClass( value );
- }
-
- if ( isFunction( value ) ) {
- return this.each( function( i ) {
- jQuery( this ).toggleClass(
- value.call( this, i, getClass( this ), stateVal ),
- stateVal
- );
- } );
- }
-
- return this.each( function() {
- var className, i, self, classNames;
-
- if ( isValidValue ) {
-
- // Toggle individual class names
- i = 0;
- self = jQuery( this );
- classNames = classesToArray( value );
-
- while ( ( className = classNames[ i++ ] ) ) {
-
- // Check each className given, space separated list
- if ( self.hasClass( className ) ) {
- self.removeClass( className );
- } else {
- self.addClass( className );
- }
- }
-
- // Toggle whole class name
- } else if ( value === undefined || type === "boolean" ) {
- className = getClass( this );
- if ( className ) {
-
- // Store className if set
- dataPriv.set( this, "__className__", className );
- }
-
- // If the element has a class name or if we're passed `false`,
- // then remove the whole classname (if there was one, the above saved it).
- // Otherwise bring back whatever was previously saved (if anything),
- // falling back to the empty string if nothing was stored.
- if ( this.setAttribute ) {
- this.setAttribute( "class",
- className || value === false ?
- "" :
- dataPriv.get( this, "__className__" ) || ""
- );
- }
- }
- } );
- },
-
- hasClass: function( selector ) {
- var className, elem,
- i = 0;
-
- className = " " + selector + " ";
- while ( ( elem = this[ i++ ] ) ) {
- if ( elem.nodeType === 1 &&
- ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
- return true;
- }
- }
-
- return false;
- }
- } );
-
-
-
-
- var rreturn = /\r/g;
-
- jQuery.fn.extend( {
- val: function( value ) {
- var hooks, ret, valueIsFunction,
- elem = this[ 0 ];
-
- if ( !arguments.length ) {
- if ( elem ) {
- hooks = jQuery.valHooks[ elem.type ] ||
- jQuery.valHooks[ elem.nodeName.toLowerCase() ];
-
- if ( hooks &&
- "get" in hooks &&
- ( ret = hooks.get( elem, "value" ) ) !== undefined
- ) {
- return ret;
- }
-
- ret = elem.value;
-
- // Handle most common string cases
- if ( typeof ret === "string" ) {
- return ret.replace( rreturn, "" );
- }
-
- // Handle cases where value is null/undef or number
- return ret == null ? "" : ret;
- }
-
- return;
- }
-
- valueIsFunction = isFunction( value );
-
- return this.each( function( i ) {
- var val;
-
- if ( this.nodeType !== 1 ) {
- return;
- }
-
- if ( valueIsFunction ) {
- val = value.call( this, i, jQuery( this ).val() );
- } else {
- val = value;
- }
-
- // Treat null/undefined as ""; convert numbers to string
- if ( val == null ) {
- val = "";
-
- } else if ( typeof val === "number" ) {
- val += "";
-
- } else if ( Array.isArray( val ) ) {
- val = jQuery.map( val, function( value ) {
- return value == null ? "" : value + "";
- } );
- }
-
- hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
-
- // If set returns undefined, fall back to normal setting
- if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
- this.value = val;
- }
- } );
- }
- } );
-
- jQuery.extend( {
- valHooks: {
- option: {
- get: function( elem ) {
-
- var val = jQuery.find.attr( elem, "value" );
- return val != null ?
- val :
-
- // Support: IE <=10 - 11 only
- // option.text throws exceptions (#14686, #14858)
- // Strip and collapse whitespace
- // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
- stripAndCollapse( jQuery.text( elem ) );
- }
- },
- select: {
- get: function( elem ) {
- var value, option, i,
- options = elem.options,
- index = elem.selectedIndex,
- one = elem.type === "select-one",
- values = one ? null : [],
- max = one ? index + 1 : options.length;
-
- if ( index < 0 ) {
- i = max;
-
- } else {
- i = one ? index : 0;
- }
-
- // Loop through all the selected options
- for ( ; i < max; i++ ) {
- option = options[ i ];
-
- // Support: IE <=9 only
- // IE8-9 doesn't update selected after form reset (#2551)
- if ( ( option.selected || i === index ) &&
-
- // Don't return options that are disabled or in a disabled optgroup
- !option.disabled &&
- ( !option.parentNode.disabled ||
- !nodeName( option.parentNode, "optgroup" ) ) ) {
-
- // Get the specific value for the option
- value = jQuery( option ).val();
-
- // We don't need an array for one selects
- if ( one ) {
- return value;
- }
-
- // Multi-Selects return an array
- values.push( value );
- }
- }
-
- return values;
- },
-
- set: function( elem, value ) {
- var optionSet, option,
- options = elem.options,
- values = jQuery.makeArray( value ),
- i = options.length;
-
- while ( i-- ) {
- option = options[ i ];
-
- /* eslint-disable no-cond-assign */
-
- if ( option.selected =
- jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
- ) {
- optionSet = true;
- }
-
- /* eslint-enable no-cond-assign */
- }
-
- // Force browsers to behave consistently when non-matching value is set
- if ( !optionSet ) {
- elem.selectedIndex = -1;
- }
- return values;
- }
- }
- }
- } );
-
- // Radios and checkboxes getter/setter
- jQuery.each( [ "radio", "checkbox" ], function() {
- jQuery.valHooks[ this ] = {
- set: function( elem, value ) {
- if ( Array.isArray( value ) ) {
- return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
- }
- }
- };
- if ( !support.checkOn ) {
- jQuery.valHooks[ this ].get = function( elem ) {
- return elem.getAttribute( "value" ) === null ? "on" : elem.value;
- };
- }
- } );
-
-
-
-
- // Return jQuery for attributes-only inclusion
-
-
- support.focusin = "onfocusin" in window;
-
-
- var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
- stopPropagationCallback = function( e ) {
- e.stopPropagation();
- };
-
- jQuery.extend( jQuery.event, {
-
- trigger: function( event, data, elem, onlyHandlers ) {
-
- var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
- eventPath = [ elem || document ],
- type = hasOwn.call( event, "type" ) ? event.type : event,
- namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
-
- cur = lastElement = tmp = elem = elem || document;
-
- // Don't do events on text and comment nodes
- if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
- return;
- }
-
- // focus/blur morphs to focusin/out; ensure we're not firing them right now
- if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
- return;
- }
-
- if ( type.indexOf( "." ) > -1 ) {
-
- // Namespaced trigger; create a regexp to match event type in handle()
- namespaces = type.split( "." );
- type = namespaces.shift();
- namespaces.sort();
- }
- ontype = type.indexOf( ":" ) < 0 && "on" + type;
-
- // Caller can pass in a jQuery.Event object, Object, or just an event type string
- event = event[ jQuery.expando ] ?
- event :
- new jQuery.Event( type, typeof event === "object" && event );
-
- // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
- event.isTrigger = onlyHandlers ? 2 : 3;
- event.namespace = namespaces.join( "." );
- event.rnamespace = event.namespace ?
- new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
- null;
-
- // Clean up the event in case it is being reused
- event.result = undefined;
- if ( !event.target ) {
- event.target = elem;
- }
-
- // Clone any incoming data and prepend the event, creating the handler arg list
- data = data == null ?
- [ event ] :
- jQuery.makeArray( data, [ event ] );
-
- // Allow special events to draw outside the lines
- special = jQuery.event.special[ type ] || {};
- if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
- return;
- }
-
- // Determine event propagation path in advance, per W3C events spec (#9951)
- // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
- if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
-
- bubbleType = special.delegateType || type;
- if ( !rfocusMorph.test( bubbleType + type ) ) {
- cur = cur.parentNode;
- }
- for ( ; cur; cur = cur.parentNode ) {
- eventPath.push( cur );
- tmp = cur;
- }
-
- // Only add window if we got to document (e.g., not plain obj or detached DOM)
- if ( tmp === ( elem.ownerDocument || document ) ) {
- eventPath.push( tmp.defaultView || tmp.parentWindow || window );
- }
- }
-
- // Fire handlers on the event path
- i = 0;
- while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
- lastElement = cur;
- event.type = i > 1 ?
- bubbleType :
- special.bindType || type;
-
- // jQuery handler
- handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
- dataPriv.get( cur, "handle" );
- if ( handle ) {
- handle.apply( cur, data );
- }
-
- // Native handler
- handle = ontype && cur[ ontype ];
- if ( handle && handle.apply && acceptData( cur ) ) {
- event.result = handle.apply( cur, data );
- if ( event.result === false ) {
- event.preventDefault();
- }
- }
- }
- event.type = type;
-
- // If nobody prevented the default action, do it now
- if ( !onlyHandlers && !event.isDefaultPrevented() ) {
-
- if ( ( !special._default ||
- special._default.apply( eventPath.pop(), data ) === false ) &&
- acceptData( elem ) ) {
-
- // Call a native DOM method on the target with the same name as the event.
- // Don't do default actions on window, that's where global variables be (#6170)
- if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
-
- // Don't re-trigger an onFOO event when we call its FOO() method
- tmp = elem[ ontype ];
-
- if ( tmp ) {
- elem[ ontype ] = null;
- }
-
- // Prevent re-triggering of the same event, since we already bubbled it above
- jQuery.event.triggered = type;
-
- if ( event.isPropagationStopped() ) {
- lastElement.addEventListener( type, stopPropagationCallback );
- }
-
- elem[ type ]();
-
- if ( event.isPropagationStopped() ) {
- lastElement.removeEventListener( type, stopPropagationCallback );
- }
-
- jQuery.event.triggered = undefined;
-
- if ( tmp ) {
- elem[ ontype ] = tmp;
- }
- }
- }
- }
-
- return event.result;
- },
-
- // Piggyback on a donor event to simulate a different one
- // Used only for `focus(in | out)` events
- simulate: function( type, elem, event ) {
- var e = jQuery.extend(
- new jQuery.Event(),
- event,
- {
- type: type,
- isSimulated: true
- }
- );
-
- jQuery.event.trigger( e, null, elem );
- }
-
- } );
-
- jQuery.fn.extend( {
-
- trigger: function( type, data ) {
- return this.each( function() {
- jQuery.event.trigger( type, data, this );
- } );
- },
- triggerHandler: function( type, data ) {
- var elem = this[ 0 ];
- if ( elem ) {
- return jQuery.event.trigger( type, data, elem, true );
- }
- }
- } );
-
-
- // Support: Firefox <=44
- // Firefox doesn't have focus(in | out) events
- // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
- //
- // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
- // focus(in | out) events fire after focus & blur events,
- // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
- // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
- if ( !support.focusin ) {
- jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
-
- // Attach a single capturing handler on the document while someone wants focusin/focusout
- var handler = function( event ) {
- jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
- };
-
- jQuery.event.special[ fix ] = {
- setup: function() {
- var doc = this.ownerDocument || this,
- attaches = dataPriv.access( doc, fix );
-
- if ( !attaches ) {
- doc.addEventListener( orig, handler, true );
- }
- dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
- },
- teardown: function() {
- var doc = this.ownerDocument || this,
- attaches = dataPriv.access( doc, fix ) - 1;
-
- if ( !attaches ) {
- doc.removeEventListener( orig, handler, true );
- dataPriv.remove( doc, fix );
-
- } else {
- dataPriv.access( doc, fix, attaches );
- }
- }
- };
- } );
- }
- var location = window.location;
-
- var nonce = Date.now();
-
- var rquery = ( /\?/ );
-
-
-
- // Cross-browser xml parsing
- jQuery.parseXML = function( data ) {
- var xml;
- if ( !data || typeof data !== "string" ) {
- return null;
- }
-
- // Support: IE 9 - 11 only
- // IE throws on parseFromString with invalid input.
- try {
- xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
- } catch ( e ) {
- xml = undefined;
- }
-
- if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
- jQuery.error( "Invalid XML: " + data );
- }
- return xml;
- };
-
-
- var
- rbracket = /\[\]$/,
- rCRLF = /\r?\n/g,
- rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
- rsubmittable = /^(?:input|select|textarea|keygen)/i;
-
- function buildParams( prefix, obj, traditional, add ) {
- var name;
-
- if ( Array.isArray( obj ) ) {
-
- // Serialize array item.
- jQuery.each( obj, function( i, v ) {
- if ( traditional || rbracket.test( prefix ) ) {
-
- // Treat each array item as a scalar.
- add( prefix, v );
-
- } else {
-
- // Item is non-scalar (array or object), encode its numeric index.
- buildParams(
- prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
- v,
- traditional,
- add
- );
- }
- } );
-
- } else if ( !traditional && toType( obj ) === "object" ) {
-
- // Serialize object item.
- for ( name in obj ) {
- buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
- }
-
- } else {
-
- // Serialize scalar item.
- add( prefix, obj );
- }
- }
-
- // Serialize an array of form elements or a set of
- // key/values into a query string
- jQuery.param = function( a, traditional ) {
- var prefix,
- s = [],
- add = function( key, valueOrFunction ) {
-
- // If value is a function, invoke it and use its return value
- var value = isFunction( valueOrFunction ) ?
- valueOrFunction() :
- valueOrFunction;
-
- s[ s.length ] = encodeURIComponent( key ) + "=" +
- encodeURIComponent( value == null ? "" : value );
- };
-
- if ( a == null ) {
- return "";
- }
-
- // If an array was passed in, assume that it is an array of form elements.
- if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
-
- // Serialize the form elements
- jQuery.each( a, function() {
- add( this.name, this.value );
- } );
-
- } else {
-
- // If traditional, encode the "old" way (the way 1.3.2 or older
- // did it), otherwise encode params recursively.
- for ( prefix in a ) {
- buildParams( prefix, a[ prefix ], traditional, add );
- }
- }
-
- // Return the resulting serialization
- return s.join( "&" );
- };
-
- jQuery.fn.extend( {
- serialize: function() {
- return jQuery.param( this.serializeArray() );
- },
- serializeArray: function() {
- return this.map( function() {
-
- // Can add propHook for "elements" to filter or add form elements
- var elements = jQuery.prop( this, "elements" );
- return elements ? jQuery.makeArray( elements ) : this;
- } )
- .filter( function() {
- var type = this.type;
-
- // Use .is( ":disabled" ) so that fieldset[disabled] works
- return this.name && !jQuery( this ).is( ":disabled" ) &&
- rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
- ( this.checked || !rcheckableType.test( type ) );
- } )
- .map( function( i, elem ) {
- var val = jQuery( this ).val();
-
- if ( val == null ) {
- return null;
- }
-
- if ( Array.isArray( val ) ) {
- return jQuery.map( val, function( val ) {
- return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- } );
- }
-
- return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- } ).get();
- }
- } );
-
-
- var
- r20 = /%20/g,
- rhash = /#.*$/,
- rantiCache = /([?&])_=[^&]*/,
- rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
-
- // #7653, #8125, #8152: local protocol detection
- rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
- rnoContent = /^(?:GET|HEAD)$/,
- rprotocol = /^\/\//,
-
- /* Prefilters
- * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
- * 2) These are called:
- * - BEFORE asking for a transport
- * - AFTER param serialization (s.data is a string if s.processData is true)
- * 3) key is the dataType
- * 4) the catchall symbol "*" can be used
- * 5) execution will start with transport dataType and THEN continue down to "*" if needed
- */
- prefilters = {},
-
- /* Transports bindings
- * 1) key is the dataType
- * 2) the catchall symbol "*" can be used
- * 3) selection will start with transport dataType and THEN go to "*" if needed
- */
- transports = {},
-
- // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
- allTypes = "*/".concat( "*" ),
-
- // Anchor tag for parsing the document origin
- originAnchor = document.createElement( "a" );
- originAnchor.href = location.href;
-
- // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
- function addToPrefiltersOrTransports( structure ) {
-
- // dataTypeExpression is optional and defaults to "*"
- return function( dataTypeExpression, func ) {
-
- if ( typeof dataTypeExpression !== "string" ) {
- func = dataTypeExpression;
- dataTypeExpression = "*";
- }
-
- var dataType,
- i = 0,
- dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
-
- if ( isFunction( func ) ) {
-
- // For each dataType in the dataTypeExpression
- while ( ( dataType = dataTypes[ i++ ] ) ) {
-
- // Prepend if requested
- if ( dataType[ 0 ] === "+" ) {
- dataType = dataType.slice( 1 ) || "*";
- ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
-
- // Otherwise append
- } else {
- ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
- }
- }
- }
- };
- }
-
- // Base inspection function for prefilters and transports
- function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
-
- var inspected = {},
- seekingTransport = ( structure === transports );
-
- function inspect( dataType ) {
- var selected;
- inspected[ dataType ] = true;
- jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
- var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
- if ( typeof dataTypeOrTransport === "string" &&
- !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
-
- options.dataTypes.unshift( dataTypeOrTransport );
- inspect( dataTypeOrTransport );
- return false;
- } else if ( seekingTransport ) {
- return !( selected = dataTypeOrTransport );
- }
- } );
- return selected;
- }
-
- return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
- }
-
- // A special extend for ajax options
- // that takes "flat" options (not to be deep extended)
- // Fixes #9887
- function ajaxExtend( target, src ) {
- var key, deep,
- flatOptions = jQuery.ajaxSettings.flatOptions || {};
-
- for ( key in src ) {
- if ( src[ key ] !== undefined ) {
- ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
- }
- }
- if ( deep ) {
- jQuery.extend( true, target, deep );
- }
-
- return target;
- }
-
- /* Handles responses to an ajax request:
- * - finds the right dataType (mediates between content-type and expected dataType)
- * - returns the corresponding response
- */
- function ajaxHandleResponses( s, jqXHR, responses ) {
-
- var ct, type, finalDataType, firstDataType,
- contents = s.contents,
- dataTypes = s.dataTypes;
-
- // Remove auto dataType and get content-type in the process
- while ( dataTypes[ 0 ] === "*" ) {
- dataTypes.shift();
- if ( ct === undefined ) {
- ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
- }
- }
-
- // Check if we're dealing with a known content-type
- if ( ct ) {
- for ( type in contents ) {
- if ( contents[ type ] && contents[ type ].test( ct ) ) {
- dataTypes.unshift( type );
- break;
- }
- }
- }
-
- // Check to see if we have a response for the expected dataType
- if ( dataTypes[ 0 ] in responses ) {
- finalDataType = dataTypes[ 0 ];
- } else {
-
- // Try convertible dataTypes
- for ( type in responses ) {
- if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
- finalDataType = type;
- break;
- }
- if ( !firstDataType ) {
- firstDataType = type;
- }
- }
-
- // Or just use first one
- finalDataType = finalDataType || firstDataType;
- }
-
- // If we found a dataType
- // We add the dataType to the list if needed
- // and return the corresponding response
- if ( finalDataType ) {
- if ( finalDataType !== dataTypes[ 0 ] ) {
- dataTypes.unshift( finalDataType );
- }
- return responses[ finalDataType ];
- }
- }
-
- /* Chain conversions given the request and the original response
- * Also sets the responseXXX fields on the jqXHR instance
- */
- function ajaxConvert( s, response, jqXHR, isSuccess ) {
- var conv2, current, conv, tmp, prev,
- converters = {},
-
- // Work with a copy of dataTypes in case we need to modify it for conversion
- dataTypes = s.dataTypes.slice();
-
- // Create converters map with lowercased keys
- if ( dataTypes[ 1 ] ) {
- for ( conv in s.converters ) {
- converters[ conv.toLowerCase() ] = s.converters[ conv ];
- }
- }
-
- current = dataTypes.shift();
-
- // Convert to each sequential dataType
- while ( current ) {
-
- if ( s.responseFields[ current ] ) {
- jqXHR[ s.responseFields[ current ] ] = response;
- }
-
- // Apply the dataFilter if provided
- if ( !prev && isSuccess && s.dataFilter ) {
- response = s.dataFilter( response, s.dataType );
- }
-
- prev = current;
- current = dataTypes.shift();
-
- if ( current ) {
-
- // There's only work to do if current dataType is non-auto
- if ( current === "*" ) {
-
- current = prev;
-
- // Convert response if prev dataType is non-auto and differs from current
- } else if ( prev !== "*" && prev !== current ) {
-
- // Seek a direct converter
- conv = converters[ prev + " " + current ] || converters[ "* " + current ];
-
- // If none found, seek a pair
- if ( !conv ) {
- for ( conv2 in converters ) {
-
- // If conv2 outputs current
- tmp = conv2.split( " " );
- if ( tmp[ 1 ] === current ) {
-
- // If prev can be converted to accepted input
- conv = converters[ prev + " " + tmp[ 0 ] ] ||
- converters[ "* " + tmp[ 0 ] ];
- if ( conv ) {
-
- // Condense equivalence converters
- if ( conv === true ) {
- conv = converters[ conv2 ];
-
- // Otherwise, insert the intermediate dataType
- } else if ( converters[ conv2 ] !== true ) {
- current = tmp[ 0 ];
- dataTypes.unshift( tmp[ 1 ] );
- }
- break;
- }
- }
- }
- }
-
- // Apply converter (if not an equivalence)
- if ( conv !== true ) {
-
- // Unless errors are allowed to bubble, catch and return them
- if ( conv && s.throws ) {
- response = conv( response );
- } else {
- try {
- response = conv( response );
- } catch ( e ) {
- return {
- state: "parsererror",
- error: conv ? e : "No conversion from " + prev + " to " + current
- };
- }
- }
- }
- }
- }
- }
-
- return { state: "success", data: response };
- }
-
- jQuery.extend( {
-
- // Counter for holding the number of active queries
- active: 0,
-
- // Last-Modified header cache for next request
- lastModified: {},
- etag: {},
-
- ajaxSettings: {
- url: location.href,
- type: "GET",
- isLocal: rlocalProtocol.test( location.protocol ),
- global: true,
- processData: true,
- async: true,
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
-
- /*
- timeout: 0,
- data: null,
- dataType: null,
- username: null,
- password: null,
- cache: null,
- throws: false,
- traditional: false,
- headers: {},
- */
-
- accepts: {
- "*": allTypes,
- text: "text/plain",
- html: "text/html",
- xml: "application/xml, text/xml",
- json: "application/json, text/javascript"
- },
-
- contents: {
- xml: /\bxml\b/,
- html: /\bhtml/,
- json: /\bjson\b/
- },
-
- responseFields: {
- xml: "responseXML",
- text: "responseText",
- json: "responseJSON"
- },
-
- // Data converters
- // Keys separate source (or catchall "*") and destination types with a single space
- converters: {
-
- // Convert anything to text
- "* text": String,
-
- // Text to html (true = no transformation)
- "text html": true,
-
- // Evaluate text as a json expression
- "text json": JSON.parse,
-
- // Parse text as xml
- "text xml": jQuery.parseXML
- },
-
- // For options that shouldn't be deep extended:
- // you can add your own custom options here if
- // and when you create one that shouldn't be
- // deep extended (see ajaxExtend)
- flatOptions: {
- url: true,
- context: true
- }
- },
-
- // Creates a full fledged settings object into target
- // with both ajaxSettings and settings fields.
- // If target is omitted, writes into ajaxSettings.
- ajaxSetup: function( target, settings ) {
- return settings ?
-
- // Building a settings object
- ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
-
- // Extending ajaxSettings
- ajaxExtend( jQuery.ajaxSettings, target );
- },
-
- ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
- ajaxTransport: addToPrefiltersOrTransports( transports ),
-
- // Main method
- ajax: function( url, options ) {
-
- // If url is an object, simulate pre-1.5 signature
- if ( typeof url === "object" ) {
- options = url;
- url = undefined;
- }
-
- // Force options to be an object
- options = options || {};
-
- var transport,
-
- // URL without anti-cache param
- cacheURL,
-
- // Response headers
- responseHeadersString,
- responseHeaders,
-
- // timeout handle
- timeoutTimer,
-
- // Url cleanup var
- urlAnchor,
-
- // Request state (becomes false upon send and true upon completion)
- completed,
-
- // To know if global events are to be dispatched
- fireGlobals,
-
- // Loop variable
- i,
-
- // uncached part of the url
- uncached,
-
- // Create the final options object
- s = jQuery.ajaxSetup( {}, options ),
-
- // Callbacks context
- callbackContext = s.context || s,
-
- // Context for global events is callbackContext if it is a DOM node or jQuery collection
- globalEventContext = s.context &&
- ( callbackContext.nodeType || callbackContext.jquery ) ?
- jQuery( callbackContext ) :
- jQuery.event,
-
- // Deferreds
- deferred = jQuery.Deferred(),
- completeDeferred = jQuery.Callbacks( "once memory" ),
-
- // Status-dependent callbacks
- statusCode = s.statusCode || {},
-
- // Headers (they are sent all at once)
- requestHeaders = {},
- requestHeadersNames = {},
-
- // Default abort message
- strAbort = "canceled",
-
- // Fake xhr
- jqXHR = {
- readyState: 0,
-
- // Builds headers hashtable if needed
- getResponseHeader: function( key ) {
- var match;
- if ( completed ) {
- if ( !responseHeaders ) {
- responseHeaders = {};
- while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
- responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
- ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
- .concat( match[ 2 ] );
- }
- }
- match = responseHeaders[ key.toLowerCase() + " " ];
- }
- return match == null ? null : match.join( ", " );
- },
-
- // Raw string
- getAllResponseHeaders: function() {
- return completed ? responseHeadersString : null;
- },
-
- // Caches the header
- setRequestHeader: function( name, value ) {
- if ( completed == null ) {
- name = requestHeadersNames[ name.toLowerCase() ] =
- requestHeadersNames[ name.toLowerCase() ] || name;
- requestHeaders[ name ] = value;
- }
- return this;
- },
-
- // Overrides response content-type header
- overrideMimeType: function( type ) {
- if ( completed == null ) {
- s.mimeType = type;
- }
- return this;
- },
-
- // Status-dependent callbacks
- statusCode: function( map ) {
- var code;
- if ( map ) {
- if ( completed ) {
-
- // Execute the appropriate callbacks
- jqXHR.always( map[ jqXHR.status ] );
- } else {
-
- // Lazy-add the new callbacks in a way that preserves old ones
- for ( code in map ) {
- statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
- }
- }
- }
- return this;
- },
-
- // Cancel the request
- abort: function( statusText ) {
- var finalText = statusText || strAbort;
- if ( transport ) {
- transport.abort( finalText );
- }
- done( 0, finalText );
- return this;
- }
- };
-
- // Attach deferreds
- deferred.promise( jqXHR );
-
- // Add protocol if not provided (prefilters might expect it)
- // Handle falsy url in the settings object (#10093: consistency with old signature)
- // We also use the url parameter if available
- s.url = ( ( url || s.url || location.href ) + "" )
- .replace( rprotocol, location.protocol + "//" );
-
- // Alias method option to type as per ticket #12004
- s.type = options.method || options.type || s.method || s.type;
-
- // Extract dataTypes list
- s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
-
- // A cross-domain request is in order when the origin doesn't match the current origin.
- if ( s.crossDomain == null ) {
- urlAnchor = document.createElement( "a" );
-
- // Support: IE <=8 - 11, Edge 12 - 15
- // IE throws exception on accessing the href property if url is malformed,
- // e.g. http://example.com:80x/
- try {
- urlAnchor.href = s.url;
-
- // Support: IE <=8 - 11 only
- // Anchor's host property isn't correctly set when s.url is relative
- urlAnchor.href = urlAnchor.href;
- s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
- urlAnchor.protocol + "//" + urlAnchor.host;
- } catch ( e ) {
-
- // If there is an error parsing the URL, assume it is crossDomain,
- // it can be rejected by the transport if it is invalid
- s.crossDomain = true;
- }
- }
-
- // Convert data if not already a string
- if ( s.data && s.processData && typeof s.data !== "string" ) {
- s.data = jQuery.param( s.data, s.traditional );
- }
-
- // Apply prefilters
- inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
-
- // If request was aborted inside a prefilter, stop there
- if ( completed ) {
- return jqXHR;
- }
-
- // We can fire global events as of now if asked to
- // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
- fireGlobals = jQuery.event && s.global;
-
- // Watch for a new set of requests
- if ( fireGlobals && jQuery.active++ === 0 ) {
- jQuery.event.trigger( "ajaxStart" );
- }
-
- // Uppercase the type
- s.type = s.type.toUpperCase();
-
- // Determine if request has content
- s.hasContent = !rnoContent.test( s.type );
-
- // Save the URL in case we're toying with the If-Modified-Since
- // and/or If-None-Match header later on
- // Remove hash to simplify url manipulation
- cacheURL = s.url.replace( rhash, "" );
-
- // More options handling for requests with no content
- if ( !s.hasContent ) {
-
- // Remember the hash so we can put it back
- uncached = s.url.slice( cacheURL.length );
-
- // If data is available and should be processed, append data to url
- if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
- cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
-
- // #9682: remove data so that it's not used in an eventual retry
- delete s.data;
- }
-
- // Add or update anti-cache param if needed
- if ( s.cache === false ) {
- cacheURL = cacheURL.replace( rantiCache, "$1" );
- uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
- }
-
- // Put hash and anti-cache on the URL that will be requested (gh-1732)
- s.url = cacheURL + uncached;
-
- // Change '%20' to '+' if this is encoded form body content (gh-2658)
- } else if ( s.data && s.processData &&
- ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
- s.data = s.data.replace( r20, "+" );
- }
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
- if ( jQuery.lastModified[ cacheURL ] ) {
- jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
- }
- if ( jQuery.etag[ cacheURL ] ) {
- jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
- }
- }
-
- // Set the correct header, if data is being sent
- if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
- jqXHR.setRequestHeader( "Content-Type", s.contentType );
- }
-
- // Set the Accepts header for the server, depending on the dataType
- jqXHR.setRequestHeader(
- "Accept",
- s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
- s.accepts[ s.dataTypes[ 0 ] ] +
- ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
- s.accepts[ "*" ]
- );
-
- // Check for headers option
- for ( i in s.headers ) {
- jqXHR.setRequestHeader( i, s.headers[ i ] );
- }
-
- // Allow custom headers/mimetypes and early abort
- if ( s.beforeSend &&
- ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
-
- // Abort if not done already and return
- return jqXHR.abort();
- }
-
- // Aborting is no longer a cancellation
- strAbort = "abort";
-
- // Install callbacks on deferreds
- completeDeferred.add( s.complete );
- jqXHR.done( s.success );
- jqXHR.fail( s.error );
-
- // Get transport
- transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
-
- // If no transport, we auto-abort
- if ( !transport ) {
- done( -1, "No Transport" );
- } else {
- jqXHR.readyState = 1;
-
- // Send global event
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
- }
-
- // If request was aborted inside ajaxSend, stop there
- if ( completed ) {
- return jqXHR;
- }
-
- // Timeout
- if ( s.async && s.timeout > 0 ) {
- timeoutTimer = window.setTimeout( function() {
- jqXHR.abort( "timeout" );
- }, s.timeout );
- }
-
- try {
- completed = false;
- transport.send( requestHeaders, done );
- } catch ( e ) {
-
- // Rethrow post-completion exceptions
- if ( completed ) {
- throw e;
- }
-
- // Propagate others as results
- done( -1, e );
- }
- }
-
- // Callback for when everything is done
- function done( status, nativeStatusText, responses, headers ) {
- var isSuccess, success, error, response, modified,
- statusText = nativeStatusText;
-
- // Ignore repeat invocations
- if ( completed ) {
- return;
- }
-
- completed = true;
-
- // Clear timeout if it exists
- if ( timeoutTimer ) {
- window.clearTimeout( timeoutTimer );
- }
-
- // Dereference transport for early garbage collection
- // (no matter how long the jqXHR object will be used)
- transport = undefined;
-
- // Cache response headers
- responseHeadersString = headers || "";
-
- // Set readyState
- jqXHR.readyState = status > 0 ? 4 : 0;
-
- // Determine if successful
- isSuccess = status >= 200 && status < 300 || status === 304;
-
- // Get response data
- if ( responses ) {
- response = ajaxHandleResponses( s, jqXHR, responses );
- }
-
- // Convert no matter what (that way responseXXX fields are always set)
- response = ajaxConvert( s, response, jqXHR, isSuccess );
-
- // If successful, handle type chaining
- if ( isSuccess ) {
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
- modified = jqXHR.getResponseHeader( "Last-Modified" );
- if ( modified ) {
- jQuery.lastModified[ cacheURL ] = modified;
- }
- modified = jqXHR.getResponseHeader( "etag" );
- if ( modified ) {
- jQuery.etag[ cacheURL ] = modified;
- }
- }
-
- // if no content
- if ( status === 204 || s.type === "HEAD" ) {
- statusText = "nocontent";
-
- // if not modified
- } else if ( status === 304 ) {
- statusText = "notmodified";
-
- // If we have data, let's convert it
- } else {
- statusText = response.state;
- success = response.data;
- error = response.error;
- isSuccess = !error;
- }
- } else {
-
- // Extract error from statusText and normalize for non-aborts
- error = statusText;
- if ( status || !statusText ) {
- statusText = "error";
- if ( status < 0 ) {
- status = 0;
- }
- }
- }
-
- // Set data for the fake xhr object
- jqXHR.status = status;
- jqXHR.statusText = ( nativeStatusText || statusText ) + "";
-
- // Success/Error
- if ( isSuccess ) {
- deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
- } else {
- deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
- }
-
- // Status-dependent callbacks
- jqXHR.statusCode( statusCode );
- statusCode = undefined;
-
- if ( fireGlobals ) {
- globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
- [ jqXHR, s, isSuccess ? success : error ] );
- }
-
- // Complete
- completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
-
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
-
- // Handle the global AJAX counter
- if ( !( --jQuery.active ) ) {
- jQuery.event.trigger( "ajaxStop" );
- }
- }
- }
-
- return jqXHR;
- },
-
- getJSON: function( url, data, callback ) {
- return jQuery.get( url, data, callback, "json" );
- },
-
- getScript: function( url, callback ) {
- return jQuery.get( url, undefined, callback, "script" );
- }
- } );
-
- jQuery.each( [ "get", "post" ], function( i, method ) {
- jQuery[ method ] = function( url, data, callback, type ) {
-
- // Shift arguments if data argument was omitted
- if ( isFunction( data ) ) {
- type = type || callback;
- callback = data;
- data = undefined;
- }
-
- // The url can be an options object (which then must have .url)
- return jQuery.ajax( jQuery.extend( {
- url: url,
- type: method,
- dataType: type,
- data: data,
- success: callback
- }, jQuery.isPlainObject( url ) && url ) );
- };
- } );
-
-
- jQuery._evalUrl = function( url, options ) {
- return jQuery.ajax( {
- url: url,
-
- // Make this explicit, since user can override this through ajaxSetup (#11264)
- type: "GET",
- dataType: "script",
- cache: true,
- async: false,
- global: false,
-
- // Only evaluate the response if it is successful (gh-4126)
- // dataFilter is not invoked for failure responses, so using it instead
- // of the default converter is kludgy but it works.
- converters: {
- "text script": function() {}
- },
- dataFilter: function( response ) {
- jQuery.globalEval( response, options );
- }
- } );
- };
-
-
- jQuery.fn.extend( {
- wrapAll: function( html ) {
- var wrap;
-
- if ( this[ 0 ] ) {
- if ( isFunction( html ) ) {
- html = html.call( this[ 0 ] );
- }
-
- // The elements to wrap the target around
- wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
-
- if ( this[ 0 ].parentNode ) {
- wrap.insertBefore( this[ 0 ] );
- }
-
- wrap.map( function() {
- var elem = this;
-
- while ( elem.firstElementChild ) {
- elem = elem.firstElementChild;
- }
-
- return elem;
- } ).append( this );
- }
-
- return this;
- },
-
- wrapInner: function( html ) {
- if ( isFunction( html ) ) {
- return this.each( function( i ) {
- jQuery( this ).wrapInner( html.call( this, i ) );
- } );
- }
-
- return this.each( function() {
- var self = jQuery( this ),
- contents = self.contents();
-
- if ( contents.length ) {
- contents.wrapAll( html );
-
- } else {
- self.append( html );
- }
- } );
- },
-
- wrap: function( html ) {
- var htmlIsFunction = isFunction( html );
-
- return this.each( function( i ) {
- jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
- } );
- },
-
- unwrap: function( selector ) {
- this.parent( selector ).not( "body" ).each( function() {
- jQuery( this ).replaceWith( this.childNodes );
- } );
- return this;
- }
- } );
-
-
- jQuery.expr.pseudos.hidden = function( elem ) {
- return !jQuery.expr.pseudos.visible( elem );
- };
- jQuery.expr.pseudos.visible = function( elem ) {
- return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
- };
-
-
-
-
- jQuery.ajaxSettings.xhr = function() {
- try {
- return new window.XMLHttpRequest();
- } catch ( e ) {}
- };
-
- var xhrSuccessStatus = {
-
- // File protocol always yields status code 0, assume 200
- 0: 200,
-
- // Support: IE <=9 only
- // #1450: sometimes IE returns 1223 when it should be 204
- 1223: 204
- },
- xhrSupported = jQuery.ajaxSettings.xhr();
-
- support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
- support.ajax = xhrSupported = !!xhrSupported;
-
- jQuery.ajaxTransport( function( options ) {
- var callback, errorCallback;
-
- // Cross domain only allowed if supported through XMLHttpRequest
- if ( support.cors || xhrSupported && !options.crossDomain ) {
- return {
- send: function( headers, complete ) {
- var i,
- xhr = options.xhr();
-
- xhr.open(
- options.type,
- options.url,
- options.async,
- options.username,
- options.password
- );
-
- // Apply custom fields if provided
- if ( options.xhrFields ) {
- for ( i in options.xhrFields ) {
- xhr[ i ] = options.xhrFields[ i ];
- }
- }
-
- // Override mime type if needed
- if ( options.mimeType && xhr.overrideMimeType ) {
- xhr.overrideMimeType( options.mimeType );
- }
-
- // X-Requested-With header
- // For cross-domain requests, seeing as conditions for a preflight are
- // akin to a jigsaw puzzle, we simply never set it to be sure.
- // (it can always be set on a per-request basis or even using ajaxSetup)
- // For same-domain requests, won't change header if already provided.
- if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
- headers[ "X-Requested-With" ] = "XMLHttpRequest";
- }
-
- // Set headers
- for ( i in headers ) {
- xhr.setRequestHeader( i, headers[ i ] );
- }
-
- // Callback
- callback = function( type ) {
- return function() {
- if ( callback ) {
- callback = errorCallback = xhr.onload =
- xhr.onerror = xhr.onabort = xhr.ontimeout =
- xhr.onreadystatechange = null;
-
- if ( type === "abort" ) {
- xhr.abort();
- } else if ( type === "error" ) {
-
- // Support: IE <=9 only
- // On a manual native abort, IE9 throws
- // errors on any property access that is not readyState
- if ( typeof xhr.status !== "number" ) {
- complete( 0, "error" );
- } else {
- complete(
-
- // File: protocol always yields status 0; see #8605, #14207
- xhr.status,
- xhr.statusText
- );
- }
- } else {
- complete(
- xhrSuccessStatus[ xhr.status ] || xhr.status,
- xhr.statusText,
-
- // Support: IE <=9 only
- // IE9 has no XHR2 but throws on binary (trac-11426)
- // For XHR2 non-text, let the caller handle it (gh-2498)
- ( xhr.responseType || "text" ) !== "text" ||
- typeof xhr.responseText !== "string" ?
- { binary: xhr.response } :
- { text: xhr.responseText },
- xhr.getAllResponseHeaders()
- );
- }
- }
- };
- };
-
- // Listen to events
- xhr.onload = callback();
- errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
-
- // Support: IE 9 only
- // Use onreadystatechange to replace onabort
- // to handle uncaught aborts
- if ( xhr.onabort !== undefined ) {
- xhr.onabort = errorCallback;
- } else {
- xhr.onreadystatechange = function() {
-
- // Check readyState before timeout as it changes
- if ( xhr.readyState === 4 ) {
-
- // Allow onerror to be called first,
- // but that will not handle a native abort
- // Also, save errorCallback to a variable
- // as xhr.onerror cannot be accessed
- window.setTimeout( function() {
- if ( callback ) {
- errorCallback();
- }
- } );
- }
- };
- }
-
- // Create the abort callback
- callback = callback( "abort" );
-
- try {
-
- // Do send the request (this may raise an exception)
- xhr.send( options.hasContent && options.data || null );
- } catch ( e ) {
-
- // #14683: Only rethrow if this hasn't been notified as an error yet
- if ( callback ) {
- throw e;
- }
- }
- },
-
- abort: function() {
- if ( callback ) {
- callback();
- }
- }
- };
- }
- } );
-
-
-
-
- // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
- jQuery.ajaxPrefilter( function( s ) {
- if ( s.crossDomain ) {
- s.contents.script = false;
- }
- } );
-
- // Install script dataType
- jQuery.ajaxSetup( {
- accepts: {
- script: "text/javascript, application/javascript, " +
- "application/ecmascript, application/x-ecmascript"
- },
- contents: {
- script: /\b(?:java|ecma)script\b/
- },
- converters: {
- "text script": function( text ) {
- jQuery.globalEval( text );
- return text;
- }
- }
- } );
-
- // Handle cache's special case and crossDomain
- jQuery.ajaxPrefilter( "script", function( s ) {
- if ( s.cache === undefined ) {
- s.cache = false;
- }
- if ( s.crossDomain ) {
- s.type = "GET";
- }
- } );
-
- // Bind script tag hack transport
- jQuery.ajaxTransport( "script", function( s ) {
-
- // This transport only deals with cross domain or forced-by-attrs requests
- if ( s.crossDomain || s.scriptAttrs ) {
- var script, callback;
- return {
- send: function( _, complete ) {
- script = jQuery( "<script>" )
- .attr( s.scriptAttrs || {} )
- .prop( { charset: s.scriptCharset, src: s.url } )
- .on( "load error", callback = function( evt ) {
- script.remove();
- callback = null;
- if ( evt ) {
- complete( evt.type === "error" ? 404 : 200, evt.type );
- }
- } );
-
- // Use native DOM manipulation to avoid our domManip AJAX trickery
- document.head.appendChild( script[ 0 ] );
- },
- abort: function() {
- if ( callback ) {
- callback();
- }
- }
- };
- }
- } );
-
-
-
-
- var oldCallbacks = [],
- rjsonp = /(=)\?(?=&|$)|\?\?/;
-
- // Default jsonp settings
- jQuery.ajaxSetup( {
- jsonp: "callback",
- jsonpCallback: function() {
- var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
- this[ callback ] = true;
- return callback;
- }
- } );
-
- // Detect, normalize options and install callbacks for jsonp requests
- jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
-
- var callbackName, overwritten, responseContainer,
- jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
- "url" :
- typeof s.data === "string" &&
- ( s.contentType || "" )
- .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
- rjsonp.test( s.data ) && "data"
- );
-
- // Handle iff the expected data type is "jsonp" or we have a parameter to set
- if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
-
- // Get callback name, remembering preexisting value associated with it
- callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
- s.jsonpCallback() :
- s.jsonpCallback;
-
- // Insert callback into url or form data
- if ( jsonProp ) {
- s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
- } else if ( s.jsonp !== false ) {
- s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
- }
-
- // Use data converter to retrieve json after script execution
- s.converters[ "script json" ] = function() {
- if ( !responseContainer ) {
- jQuery.error( callbackName + " was not called" );
- }
- return responseContainer[ 0 ];
- };
-
- // Force json dataType
- s.dataTypes[ 0 ] = "json";
-
- // Install callback
- overwritten = window[ callbackName ];
- window[ callbackName ] = function() {
- responseContainer = arguments;
- };
-
- // Clean-up function (fires after converters)
- jqXHR.always( function() {
-
- // If previous value didn't exist - remove it
- if ( overwritten === undefined ) {
- jQuery( window ).removeProp( callbackName );
-
- // Otherwise restore preexisting value
- } else {
- window[ callbackName ] = overwritten;
- }
-
- // Save back as free
- if ( s[ callbackName ] ) {
-
- // Make sure that re-using the options doesn't screw things around
- s.jsonpCallback = originalSettings.jsonpCallback;
-
- // Save the callback name for future use
- oldCallbacks.push( callbackName );
- }
-
- // Call if it was a function and we have a response
- if ( responseContainer && isFunction( overwritten ) ) {
- overwritten( responseContainer[ 0 ] );
- }
-
- responseContainer = overwritten = undefined;
- } );
-
- // Delegate to script
- return "script";
- }
- } );
-
-
-
-
- // Support: Safari 8 only
- // In Safari 8 documents created via document.implementation.createHTMLDocument
- // collapse sibling forms: the second one becomes a child of the first one.
- // Because of that, this security measure has to be disabled in Safari 8.
- // https://bugs.webkit.org/show_bug.cgi?id=137337
- support.createHTMLDocument = ( function() {
- var body = document.implementation.createHTMLDocument( "" ).body;
- body.innerHTML = "<form></form><form></form>";
- return body.childNodes.length === 2;
- } )();
-
-
- // Argument "data" should be string of html
- // context (optional): If specified, the fragment will be created in this context,
- // defaults to document
- // keepScripts (optional): If true, will include scripts passed in the html string
- jQuery.parseHTML = function( data, context, keepScripts ) {
- if ( typeof data !== "string" ) {
- return [];
- }
- if ( typeof context === "boolean" ) {
- keepScripts = context;
- context = false;
- }
-
- var base, parsed, scripts;
-
- if ( !context ) {
-
- // Stop scripts or inline event handlers from being executed immediately
- // by using document.implementation
- if ( support.createHTMLDocument ) {
- context = document.implementation.createHTMLDocument( "" );
-
- // Set the base href for the created document
- // so any parsed elements with URLs
- // are based on the document's URL (gh-2965)
- base = context.createElement( "base" );
- base.href = document.location.href;
- context.head.appendChild( base );
- } else {
- context = document;
- }
- }
-
- parsed = rsingleTag.exec( data );
- scripts = !keepScripts && [];
-
- // Single tag
- if ( parsed ) {
- return [ context.createElement( parsed[ 1 ] ) ];
- }
-
- parsed = buildFragment( [ data ], context, scripts );
-
- if ( scripts && scripts.length ) {
- jQuery( scripts ).remove();
- }
-
- return jQuery.merge( [], parsed.childNodes );
- };
-
-
- /**
- * Load a url into a page
- */
- jQuery.fn.load = function( url, params, callback ) {
- var selector, type, response,
- self = this,
- off = url.indexOf( " " );
-
- if ( off > -1 ) {
- selector = stripAndCollapse( url.slice( off ) );
- url = url.slice( 0, off );
- }
-
- // If it's a function
- if ( isFunction( params ) ) {
-
- // We assume that it's the callback
- callback = params;
- params = undefined;
-
- // Otherwise, build a param string
- } else if ( params && typeof params === "object" ) {
- type = "POST";
- }
-
- // If we have elements to modify, make the request
- if ( self.length > 0 ) {
- jQuery.ajax( {
- url: url,
-
- // If "type" variable is undefined, then "GET" method will be used.
- // Make value of this field explicit since
- // user can override it through ajaxSetup method
- type: type || "GET",
- dataType: "html",
- data: params
- } ).done( function( responseText ) {
-
- // Save response for use in complete callback
- response = arguments;
-
- self.html( selector ?
-
- // If a selector was specified, locate the right elements in a dummy div
- // Exclude scripts to avoid IE 'Permission Denied' errors
- jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
-
- // Otherwise use the full result
- responseText );
-
- // If the request succeeds, this function gets "data", "status", "jqXHR"
- // but they are ignored because response was set above.
- // If it fails, this function gets "jqXHR", "status", "error"
- } ).always( callback && function( jqXHR, status ) {
- self.each( function() {
- callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
- } );
- } );
- }
-
- return this;
- };
-
-
-
-
- // Attach a bunch of functions for handling common AJAX events
- jQuery.each( [
- "ajaxStart",
- "ajaxStop",
- "ajaxComplete",
- "ajaxError",
- "ajaxSuccess",
- "ajaxSend"
- ], function( i, type ) {
- jQuery.fn[ type ] = function( fn ) {
- return this.on( type, fn );
- };
- } );
-
-
-
-
- jQuery.expr.pseudos.animated = function( elem ) {
- return jQuery.grep( jQuery.timers, function( fn ) {
- return elem === fn.elem;
- } ).length;
- };
-
-
-
-
- jQuery.offset = {
- setOffset: function( elem, options, i ) {
- var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
- position = jQuery.css( elem, "position" ),
- curElem = jQuery( elem ),
- props = {};
-
- // Set position first, in-case top/left are set even on static elem
- if ( position === "static" ) {
- elem.style.position = "relative";
- }
-
- curOffset = curElem.offset();
- curCSSTop = jQuery.css( elem, "top" );
- curCSSLeft = jQuery.css( elem, "left" );
- calculatePosition = ( position === "absolute" || position === "fixed" ) &&
- ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
-
- // Need to be able to calculate position if either
- // top or left is auto and position is either absolute or fixed
- if ( calculatePosition ) {
- curPosition = curElem.position();
- curTop = curPosition.top;
- curLeft = curPosition.left;
-
- } else {
- curTop = parseFloat( curCSSTop ) || 0;
- curLeft = parseFloat( curCSSLeft ) || 0;
- }
-
- if ( isFunction( options ) ) {
-
- // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
- options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
- }
-
- if ( options.top != null ) {
- props.top = ( options.top - curOffset.top ) + curTop;
- }
- if ( options.left != null ) {
- props.left = ( options.left - curOffset.left ) + curLeft;
- }
-
- if ( "using" in options ) {
- options.using.call( elem, props );
-
- } else {
- curElem.css( props );
- }
- }
- };
-
- jQuery.fn.extend( {
-
- // offset() relates an element's border box to the document origin
- offset: function( options ) {
-
- // Preserve chaining for setter
- if ( arguments.length ) {
- return options === undefined ?
- this :
- this.each( function( i ) {
- jQuery.offset.setOffset( this, options, i );
- } );
- }
-
- var rect, win,
- elem = this[ 0 ];
-
- if ( !elem ) {
- return;
- }
-
- // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
- // Support: IE <=11 only
- // Running getBoundingClientRect on a
- // disconnected node in IE throws an error
- if ( !elem.getClientRects().length ) {
- return { top: 0, left: 0 };
- }
-
- // Get document-relative position by adding viewport scroll to viewport-relative gBCR
- rect = elem.getBoundingClientRect();
- win = elem.ownerDocument.defaultView;
- return {
- top: rect.top + win.pageYOffset,
- left: rect.left + win.pageXOffset
- };
- },
-
- // position() relates an element's margin box to its offset parent's padding box
- // This corresponds to the behavior of CSS absolute positioning
- position: function() {
- if ( !this[ 0 ] ) {
- return;
- }
-
- var offsetParent, offset, doc,
- elem = this[ 0 ],
- parentOffset = { top: 0, left: 0 };
-
- // position:fixed elements are offset from the viewport, which itself always has zero offset
- if ( jQuery.css( elem, "position" ) === "fixed" ) {
-
- // Assume position:fixed implies availability of getBoundingClientRect
- offset = elem.getBoundingClientRect();
-
- } else {
- offset = this.offset();
-
- // Account for the *real* offset parent, which can be the document or its root element
- // when a statically positioned element is identified
- doc = elem.ownerDocument;
- offsetParent = elem.offsetParent || doc.documentElement;
- while ( offsetParent &&
- ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
- jQuery.css( offsetParent, "position" ) === "static" ) {
-
- offsetParent = offsetParent.parentNode;
- }
- if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
-
- // Incorporate borders into its offset, since they are outside its content origin
- parentOffset = jQuery( offsetParent ).offset();
- parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
- parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
- }
- }
-
- // Subtract parent offsets and element margins
- return {
- top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
- left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
- };
- },
-
- // This method will return documentElement in the following cases:
- // 1) For the element inside the iframe without offsetParent, this method will return
- // documentElement of the parent window
- // 2) For the hidden or detached element
- // 3) For body or html element, i.e. in case of the html node - it will return itself
- //
- // but those exceptions were never presented as a real life use-cases
- // and might be considered as more preferable results.
- //
- // This logic, however, is not guaranteed and can change at any point in the future
- offsetParent: function() {
- return this.map( function() {
- var offsetParent = this.offsetParent;
-
- while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
- offsetParent = offsetParent.offsetParent;
- }
-
- return offsetParent || documentElement;
- } );
- }
- } );
-
- // Create scrollLeft and scrollTop methods
- jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
- var top = "pageYOffset" === prop;
-
- jQuery.fn[ method ] = function( val ) {
- return access( this, function( elem, method, val ) {
-
- // Coalesce documents and windows
- var win;
- if ( isWindow( elem ) ) {
- win = elem;
- } else if ( elem.nodeType === 9 ) {
- win = elem.defaultView;
- }
-
- if ( val === undefined ) {
- return win ? win[ prop ] : elem[ method ];
- }
-
- if ( win ) {
- win.scrollTo(
- !top ? val : win.pageXOffset,
- top ? val : win.pageYOffset
- );
-
- } else {
- elem[ method ] = val;
- }
- }, method, val, arguments.length );
- };
- } );
-
- // Support: Safari <=7 - 9.1, Chrome <=37 - 49
- // Add the top/left cssHooks using jQuery.fn.position
- // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
- // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
- // getComputedStyle returns percent when specified for top/left/bottom/right;
- // rather than make the css module depend on the offset module, just check for it here
- jQuery.each( [ "top", "left" ], function( i, prop ) {
- jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
- function( elem, computed ) {
- if ( computed ) {
- computed = curCSS( elem, prop );
-
- // If curCSS returns percentage, fallback to offset
- return rnumnonpx.test( computed ) ?
- jQuery( elem ).position()[ prop ] + "px" :
- computed;
- }
- }
- );
- } );
-
-
- // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
- jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
- jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
- function( defaultExtra, funcName ) {
-
- // Margin is only for outerHeight, outerWidth
- jQuery.fn[ funcName ] = function( margin, value ) {
- var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
- extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
-
- return access( this, function( elem, type, value ) {
- var doc;
-
- if ( isWindow( elem ) ) {
-
- // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
- return funcName.indexOf( "outer" ) === 0 ?
- elem[ "inner" + name ] :
- elem.document.documentElement[ "client" + name ];
- }
-
- // Get document width or height
- if ( elem.nodeType === 9 ) {
- doc = elem.documentElement;
-
- // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
- // whichever is greatest
- return Math.max(
- elem.body[ "scroll" + name ], doc[ "scroll" + name ],
- elem.body[ "offset" + name ], doc[ "offset" + name ],
- doc[ "client" + name ]
- );
- }
-
- return value === undefined ?
-
- // Get width or height on the element, requesting but not forcing parseFloat
- jQuery.css( elem, type, extra ) :
-
- // Set width or height on the element
- jQuery.style( elem, type, value, extra );
- }, type, chainable ? margin : undefined, chainable );
- };
- } );
- } );
-
-
- jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
- "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
- "change select submit keydown keypress keyup contextmenu" ).split( " " ),
- function( i, name ) {
-
- // Handle event binding
- jQuery.fn[ name ] = function( data, fn ) {
- return arguments.length > 0 ?
- this.on( name, null, data, fn ) :
- this.trigger( name );
- };
- } );
-
- jQuery.fn.extend( {
- hover: function( fnOver, fnOut ) {
- return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
- }
- } );
-
-
-
-
- jQuery.fn.extend( {
-
- bind: function( types, data, fn ) {
- return this.on( types, null, data, fn );
- },
- unbind: function( types, fn ) {
- return this.off( types, null, fn );
- },
-
- delegate: function( selector, types, data, fn ) {
- return this.on( types, selector, data, fn );
- },
- undelegate: function( selector, types, fn ) {
-
- // ( namespace ) or ( selector, types [, fn] )
- return arguments.length === 1 ?
- this.off( selector, "**" ) :
- this.off( types, selector || "**", fn );
- }
- } );
-
- // Bind a function to a context, optionally partially applying any
- // arguments.
- // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
- // However, it is not slated for removal any time soon
- jQuery.proxy = function( fn, context ) {
- var tmp, args, proxy;
-
- if ( typeof context === "string" ) {
- tmp = fn[ context ];
- context = fn;
- fn = tmp;
- }
-
- // Quick check to determine if target is callable, in the spec
- // this throws a TypeError, but we will just return undefined.
- if ( !isFunction( fn ) ) {
- return undefined;
- }
-
- // Simulated bind
- args = slice.call( arguments, 2 );
- proxy = function() {
- return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
- };
-
- // Set the guid of unique handler to the same of original handler, so it can be removed
- proxy.guid = fn.guid = fn.guid || jQuery.guid++;
-
- return proxy;
- };
-
- jQuery.holdReady = function( hold ) {
- if ( hold ) {
- jQuery.readyWait++;
- } else {
- jQuery.ready( true );
- }
- };
- jQuery.isArray = Array.isArray;
- jQuery.parseJSON = JSON.parse;
- jQuery.nodeName = nodeName;
- jQuery.isFunction = isFunction;
- jQuery.isWindow = isWindow;
- jQuery.camelCase = camelCase;
- jQuery.type = toType;
-
- jQuery.now = Date.now;
-
- jQuery.isNumeric = function( obj ) {
-
- // As of jQuery 3.0, isNumeric is limited to
- // strings and numbers (primitives or objects)
- // that can be coerced to finite numbers (gh-2662)
- var type = jQuery.type( obj );
- return ( type === "number" || type === "string" ) &&
-
- // parseFloat NaNs numeric-cast false positives ("")
- // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
- // subtraction forces infinities to NaN
- !isNaN( obj - parseFloat( obj ) );
- };
-
-
-
-
- // Register as a named AMD module, since jQuery can be concatenated with other
- // files that may use define, but not via a proper concatenation script that
- // understands anonymous AMD modules. A named AMD is safest and most robust
- // way to register. Lowercase jquery is used because AMD module names are
- // derived from file names, and jQuery is normally delivered in a lowercase
- // file name. Do this after creating the global so that if an AMD module wants
- // to call noConflict to hide this version of jQuery, it will work.
-
- // Note that for maximum portability, libraries that are not jQuery should
- // declare themselves as anonymous modules, and avoid setting a global if an
- // AMD loader is present. jQuery is a special case. For more information, see
- // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
-
- if ( true ) {
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {
- return jQuery;
- }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- }
-
-
-
-
- var
-
- // Map over jQuery in case of overwrite
- _jQuery = window.jQuery,
-
- // Map over the $ in case of overwrite
- _$ = window.$;
-
- jQuery.noConflict = function( deep ) {
- if ( window.$ === jQuery ) {
- window.$ = _$;
- }
-
- if ( deep && window.jQuery === jQuery ) {
- window.jQuery = _jQuery;
- }
-
- return jQuery;
- };
-
- // Expose jQuery and $ identifiers, even in AMD
- // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
- // and CommonJS for browser emulators (#13566)
- if ( !noGlobal ) {
- window.jQuery = window.$ = jQuery;
- }
-
-
-
-
- return jQuery;
- } );
-
-
- /***/ }),
-
- /***/ "./node_modules/lodash/lodash.js":
- /*!***************************************!*\
- !*** ./node_modules/lodash/lodash.js ***!
- \***************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/**
- * @license
- * Lodash <https://lodash.com/>
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
- ;(function() {
-
- /** Used as a safe reference for `undefined` in pre-ES5 environments. */
- var undefined;
-
- /** Used as the semantic version number. */
- var VERSION = '4.17.15';
-
- /** Used as the size to enable large array optimizations. */
- var LARGE_ARRAY_SIZE = 200;
-
- /** Error message constants. */
- var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
- FUNC_ERROR_TEXT = 'Expected a function';
-
- /** Used to stand-in for `undefined` hash values. */
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
-
- /** Used as the maximum memoize cache size. */
- var MAX_MEMOIZE_SIZE = 500;
-
- /** Used as the internal argument placeholder. */
- var PLACEHOLDER = '__lodash_placeholder__';
-
- /** Used to compose bitmasks for cloning. */
- var CLONE_DEEP_FLAG = 1,
- CLONE_FLAT_FLAG = 2,
- CLONE_SYMBOLS_FLAG = 4;
-
- /** Used to compose bitmasks for value comparisons. */
- var COMPARE_PARTIAL_FLAG = 1,
- COMPARE_UNORDERED_FLAG = 2;
-
- /** Used to compose bitmasks for function metadata. */
- var WRAP_BIND_FLAG = 1,
- WRAP_BIND_KEY_FLAG = 2,
- WRAP_CURRY_BOUND_FLAG = 4,
- WRAP_CURRY_FLAG = 8,
- WRAP_CURRY_RIGHT_FLAG = 16,
- WRAP_PARTIAL_FLAG = 32,
- WRAP_PARTIAL_RIGHT_FLAG = 64,
- WRAP_ARY_FLAG = 128,
- WRAP_REARG_FLAG = 256,
- WRAP_FLIP_FLAG = 512;
-
- /** Used as default options for `_.truncate`. */
- var DEFAULT_TRUNC_LENGTH = 30,
- DEFAULT_TRUNC_OMISSION = '...';
-
- /** Used to detect hot functions by number of calls within a span of milliseconds. */
- var HOT_COUNT = 800,
- HOT_SPAN = 16;
-
- /** Used to indicate the type of lazy iteratees. */
- var LAZY_FILTER_FLAG = 1,
- LAZY_MAP_FLAG = 2,
- LAZY_WHILE_FLAG = 3;
-
- /** Used as references for various `Number` constants. */
- var INFINITY = 1 / 0,
- MAX_SAFE_INTEGER = 9007199254740991,
- MAX_INTEGER = 1.7976931348623157e+308,
- NAN = 0 / 0;
-
- /** Used as references for the maximum length and index of an array. */
- var MAX_ARRAY_LENGTH = 4294967295,
- MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
- HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
-
- /** Used to associate wrap methods with their bit flags. */
- var wrapFlags = [
- ['ary', WRAP_ARY_FLAG],
- ['bind', WRAP_BIND_FLAG],
- ['bindKey', WRAP_BIND_KEY_FLAG],
- ['curry', WRAP_CURRY_FLAG],
- ['curryRight', WRAP_CURRY_RIGHT_FLAG],
- ['flip', WRAP_FLIP_FLAG],
- ['partial', WRAP_PARTIAL_FLAG],
- ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
- ['rearg', WRAP_REARG_FLAG]
- ];
-
- /** `Object#toString` result references. */
- var argsTag = '[object Arguments]',
- arrayTag = '[object Array]',
- asyncTag = '[object AsyncFunction]',
- boolTag = '[object Boolean]',
- dateTag = '[object Date]',
- domExcTag = '[object DOMException]',
- errorTag = '[object Error]',
- funcTag = '[object Function]',
- genTag = '[object GeneratorFunction]',
- mapTag = '[object Map]',
- numberTag = '[object Number]',
- nullTag = '[object Null]',
- objectTag = '[object Object]',
- promiseTag = '[object Promise]',
- proxyTag = '[object Proxy]',
- regexpTag = '[object RegExp]',
- setTag = '[object Set]',
- stringTag = '[object String]',
- symbolTag = '[object Symbol]',
- undefinedTag = '[object Undefined]',
- weakMapTag = '[object WeakMap]',
- weakSetTag = '[object WeakSet]';
-
- var arrayBufferTag = '[object ArrayBuffer]',
- dataViewTag = '[object DataView]',
- float32Tag = '[object Float32Array]',
- float64Tag = '[object Float64Array]',
- int8Tag = '[object Int8Array]',
- int16Tag = '[object Int16Array]',
- int32Tag = '[object Int32Array]',
- uint8Tag = '[object Uint8Array]',
- uint8ClampedTag = '[object Uint8ClampedArray]',
- uint16Tag = '[object Uint16Array]',
- uint32Tag = '[object Uint32Array]';
-
- /** Used to match empty string literals in compiled template source. */
- var reEmptyStringLeading = /\b__p \+= '';/g,
- reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
- reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
-
- /** Used to match HTML entities and HTML characters. */
- var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
- reUnescapedHtml = /[&<>"']/g,
- reHasEscapedHtml = RegExp(reEscapedHtml.source),
- reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
-
- /** Used to match template delimiters. */
- var reEscape = /<%-([\s\S]+?)%>/g,
- reEvaluate = /<%([\s\S]+?)%>/g,
- reInterpolate = /<%=([\s\S]+?)%>/g;
-
- /** Used to match property names within property paths. */
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
- reIsPlainProp = /^\w*$/,
- rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
-
- /**
- * Used to match `RegExp`
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
- */
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
- reHasRegExpChar = RegExp(reRegExpChar.source);
-
- /** Used to match leading and trailing whitespace. */
- var reTrim = /^\s+|\s+$/g,
- reTrimStart = /^\s+/,
- reTrimEnd = /\s+$/;
-
- /** Used to match wrap detail comments. */
- var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
- reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
- reSplitDetails = /,? & /;
-
- /** Used to match words composed of alphanumeric characters. */
- var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
-
- /** Used to match backslashes in property paths. */
- var reEscapeChar = /\\(\\)?/g;
-
- /**
- * Used to match
- * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
- */
- var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
-
- /** Used to match `RegExp` flags from their coerced string values. */
- var reFlags = /\w*$/;
-
- /** Used to detect bad signed hexadecimal string values. */
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
-
- /** Used to detect binary string values. */
- var reIsBinary = /^0b[01]+$/i;
-
- /** Used to detect host constructors (Safari). */
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
-
- /** Used to detect octal string values. */
- var reIsOctal = /^0o[0-7]+$/i;
-
- /** Used to detect unsigned integer values. */
- var reIsUint = /^(?:0|[1-9]\d*)$/;
-
- /** Used to match Latin Unicode letters (excluding mathematical operators). */
- var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
-
- /** Used to ensure capturing order of template delimiters. */
- var reNoMatch = /($^)/;
-
- /** Used to match unescaped characters in compiled string literals. */
- var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
-
- /** Used to compose unicode character classes. */
- var rsAstralRange = '\\ud800-\\udfff',
- rsComboMarksRange = '\\u0300-\\u036f',
- reComboHalfMarksRange = '\\ufe20-\\ufe2f',
- rsComboSymbolsRange = '\\u20d0-\\u20ff',
- rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
- rsDingbatRange = '\\u2700-\\u27bf',
- rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
- rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
- rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
- rsPunctuationRange = '\\u2000-\\u206f',
- rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
- rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
- rsVarRange = '\\ufe0e\\ufe0f',
- rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
-
- /** Used to compose unicode capture groups. */
- var rsApos = "['\u2019]",
- rsAstral = '[' + rsAstralRange + ']',
- rsBreak = '[' + rsBreakRange + ']',
- rsCombo = '[' + rsComboRange + ']',
- rsDigits = '\\d+',
- rsDingbat = '[' + rsDingbatRange + ']',
- rsLower = '[' + rsLowerRange + ']',
- rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
- rsFitz = '\\ud83c[\\udffb-\\udfff]',
- rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
- rsNonAstral = '[^' + rsAstralRange + ']',
- rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
- rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
- rsUpper = '[' + rsUpperRange + ']',
- rsZWJ = '\\u200d';
-
- /** Used to compose unicode regexes. */
- var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
- rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
- rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
- rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
- reOptMod = rsModifier + '?',
- rsOptVar = '[' + rsVarRange + ']?',
- rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
- rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
- rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
- rsSeq = rsOptVar + reOptMod + rsOptJoin,
- rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
- rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
-
- /** Used to match apostrophes. */
- var reApos = RegExp(rsApos, 'g');
-
- /**
- * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
- * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
- */
- var reComboMark = RegExp(rsCombo, 'g');
-
- /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
- var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
-
- /** Used to match complex or compound words. */
- var reUnicodeWord = RegExp([
- rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
- rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
- rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
- rsUpper + '+' + rsOptContrUpper,
- rsOrdUpper,
- rsOrdLower,
- rsDigits,
- rsEmoji
- ].join('|'), 'g');
-
- /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
- var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
-
- /** Used to detect strings that need a more robust regexp to match words. */
- var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
-
- /** Used to assign default `context` object properties. */
- var contextProps = [
- 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
- 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
- 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
- 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
- '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
- ];
-
- /** Used to make template sourceURLs easier to identify. */
- var templateCounter = -1;
-
- /** Used to identify `toStringTag` values of typed arrays. */
- var typedArrayTags = {};
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
- typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
- typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
- typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
- typedArrayTags[uint32Tag] = true;
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
- typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
- typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
- typedArrayTags[errorTag] = typedArrayTags[funcTag] =
- typedArrayTags[mapTag] = typedArrayTags[numberTag] =
- typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
- typedArrayTags[setTag] = typedArrayTags[stringTag] =
- typedArrayTags[weakMapTag] = false;
-
- /** Used to identify `toStringTag` values supported by `_.clone`. */
- var cloneableTags = {};
- cloneableTags[argsTag] = cloneableTags[arrayTag] =
- cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
- cloneableTags[boolTag] = cloneableTags[dateTag] =
- cloneableTags[float32Tag] = cloneableTags[float64Tag] =
- cloneableTags[int8Tag] = cloneableTags[int16Tag] =
- cloneableTags[int32Tag] = cloneableTags[mapTag] =
- cloneableTags[numberTag] = cloneableTags[objectTag] =
- cloneableTags[regexpTag] = cloneableTags[setTag] =
- cloneableTags[stringTag] = cloneableTags[symbolTag] =
- cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
- cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
- cloneableTags[errorTag] = cloneableTags[funcTag] =
- cloneableTags[weakMapTag] = false;
-
- /** Used to map Latin Unicode letters to basic Latin letters. */
- var deburredLetters = {
- // Latin-1 Supplement block.
- '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
- '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
- '\xc7': 'C', '\xe7': 'c',
- '\xd0': 'D', '\xf0': 'd',
- '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
- '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
- '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
- '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
- '\xd1': 'N', '\xf1': 'n',
- '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
- '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
- '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
- '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
- '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
- '\xc6': 'Ae', '\xe6': 'ae',
- '\xde': 'Th', '\xfe': 'th',
- '\xdf': 'ss',
- // Latin Extended-A block.
- '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
- '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
- '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
- '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
- '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
- '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
- '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
- '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
- '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
- '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
- '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
- '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
- '\u0134': 'J', '\u0135': 'j',
- '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
- '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
- '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
- '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
- '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
- '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
- '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
- '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
- '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
- '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
- '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
- '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
- '\u0163': 't', '\u0165': 't', '\u0167': 't',
- '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
- '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
- '\u0174': 'W', '\u0175': 'w',
- '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
- '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
- '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
- '\u0132': 'IJ', '\u0133': 'ij',
- '\u0152': 'Oe', '\u0153': 'oe',
- '\u0149': "'n", '\u017f': 's'
- };
-
- /** Used to map characters to HTML entities. */
- var htmlEscapes = {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- "'": '''
- };
-
- /** Used to map HTML entities to characters. */
- var htmlUnescapes = {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- ''': "'"
- };
-
- /** Used to escape characters for inclusion in compiled string literals. */
- var stringEscapes = {
- '\\': '\\',
- "'": "'",
- '\n': 'n',
- '\r': 'r',
- '\u2028': 'u2028',
- '\u2029': 'u2029'
- };
-
- /** Built-in method references without a dependency on `root`. */
- var freeParseFloat = parseFloat,
- freeParseInt = parseInt;
-
- /** Detect free variable `global` from Node.js. */
- var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
-
- /** Detect free variable `self`. */
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
-
- /** Used as a reference to the global object. */
- var root = freeGlobal || freeSelf || Function('return this')();
-
- /** Detect free variable `exports`. */
- var freeExports = true && exports && !exports.nodeType && exports;
-
- /** Detect free variable `module`. */
- var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
-
- /** Detect the popular CommonJS extension `module.exports`. */
- var moduleExports = freeModule && freeModule.exports === freeExports;
-
- /** Detect free variable `process` from Node.js. */
- var freeProcess = moduleExports && freeGlobal.process;
-
- /** Used to access faster Node.js helpers. */
- var nodeUtil = (function() {
- try {
- // Use `util.types` for Node.js 10+.
- var types = freeModule && freeModule.require && freeModule.require('util').types;
-
- if (types) {
- return types;
- }
-
- // Legacy `process.binding('util')` for Node.js < 10.
- return freeProcess && freeProcess.binding && freeProcess.binding('util');
- } catch (e) {}
- }());
-
- /* Node.js helper references. */
- var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
- nodeIsDate = nodeUtil && nodeUtil.isDate,
- nodeIsMap = nodeUtil && nodeUtil.isMap,
- nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
- nodeIsSet = nodeUtil && nodeUtil.isSet,
- nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * A faster alternative to `Function#apply`, this function invokes `func`
- * with the `this` binding of `thisArg` and the arguments of `args`.
- *
- * @private
- * @param {Function} func The function to invoke.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {Array} args The arguments to invoke `func` with.
- * @returns {*} Returns the result of `func`.
- */
- function apply(func, thisArg, args) {
- switch (args.length) {
- case 0: return func.call(thisArg);
- case 1: return func.call(thisArg, args[0]);
- case 2: return func.call(thisArg, args[0], args[1]);
- case 3: return func.call(thisArg, args[0], args[1], args[2]);
- }
- return func.apply(thisArg, args);
- }
-
- /**
- * A specialized version of `baseAggregator` for arrays.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} setter The function to set `accumulator` values.
- * @param {Function} iteratee The iteratee to transform keys.
- * @param {Object} accumulator The initial aggregated object.
- * @returns {Function} Returns `accumulator`.
- */
- function arrayAggregator(array, setter, iteratee, accumulator) {
- var index = -1,
- length = array == null ? 0 : array.length;
-
- while (++index < length) {
- var value = array[index];
- setter(accumulator, value, iteratee(value), array);
- }
- return accumulator;
- }
-
- /**
- * A specialized version of `_.forEach` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns `array`.
- */
- function arrayEach(array, iteratee) {
- var index = -1,
- length = array == null ? 0 : array.length;
-
- while (++index < length) {
- if (iteratee(array[index], index, array) === false) {
- break;
- }
- }
- return array;
- }
-
- /**
- * A specialized version of `_.forEachRight` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns `array`.
- */
- function arrayEachRight(array, iteratee) {
- var length = array == null ? 0 : array.length;
-
- while (length--) {
- if (iteratee(array[length], length, array) === false) {
- break;
- }
- }
- return array;
- }
-
- /**
- * A specialized version of `_.every` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`.
- */
- function arrayEvery(array, predicate) {
- var index = -1,
- length = array == null ? 0 : array.length;
-
- while (++index < length) {
- if (!predicate(array[index], index, array)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * A specialized version of `_.filter` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- */
- function arrayFilter(array, predicate) {
- var index = -1,
- length = array == null ? 0 : array.length,
- resIndex = 0,
- result = [];
-
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result[resIndex++] = value;
- }
- }
- return result;
- }
-
- /**
- * A specialized version of `_.includes` for arrays without support for
- * specifying an index to search from.
- *
- * @private
- * @param {Array} [array] The array to inspect.
- * @param {*} target The value to search for.
- * @returns {boolean} Returns `true` if `target` is found, else `false`.
- */
- function arrayIncludes(array, value) {
- var length = array == null ? 0 : array.length;
- return !!length && baseIndexOf(array, value, 0) > -1;
- }
-
- /**
- * This function is like `arrayIncludes` except that it accepts a comparator.
- *
- * @private
- * @param {Array} [array] The array to inspect.
- * @param {*} target The value to search for.
- * @param {Function} comparator The comparator invoked per element.
- * @returns {boolean} Returns `true` if `target` is found, else `false`.
- */
- function arrayIncludesWith(array, value, comparator) {
- var index = -1,
- length = array == null ? 0 : array.length;
-
- while (++index < length) {
- if (comparator(value, array[index])) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * A specialized version of `_.map` for arrays without support for iteratee
- * shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the new mapped array.
- */
- function arrayMap(array, iteratee) {
- var index = -1,
- length = array == null ? 0 : array.length,
- result = Array(length);
-
- while (++index < length) {
- result[index] = iteratee(array[index], index, array);
- }
- return result;
- }
-
- /**
- * Appends the elements of `values` to `array`.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {Array} values The values to append.
- * @returns {Array} Returns `array`.
- */
- function arrayPush(array, values) {
- var index = -1,
- length = values.length,
- offset = array.length;
-
- while (++index < length) {
- array[offset + index] = values[index];
- }
- return array;
- }
-
- /**
- * A specialized version of `_.reduce` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {boolean} [initAccum] Specify using the first element of `array` as
- * the initial value.
- * @returns {*} Returns the accumulated value.
- */
- function arrayReduce(array, iteratee, accumulator, initAccum) {
- var index = -1,
- length = array == null ? 0 : array.length;
-
- if (initAccum && length) {
- accumulator = array[++index];
- }
- while (++index < length) {
- accumulator = iteratee(accumulator, array[index], index, array);
- }
- return accumulator;
- }
-
- /**
- * A specialized version of `_.reduceRight` for arrays without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @param {boolean} [initAccum] Specify using the last element of `array` as
- * the initial value.
- * @returns {*} Returns the accumulated value.
- */
- function arrayReduceRight(array, iteratee, accumulator, initAccum) {
- var length = array == null ? 0 : array.length;
- if (initAccum && length) {
- accumulator = array[--length];
- }
- while (length--) {
- accumulator = iteratee(accumulator, array[length], length, array);
- }
- return accumulator;
- }
-
- /**
- * A specialized version of `_.some` for arrays without support for iteratee
- * shorthands.
- *
- * @private
- * @param {Array} [array] The array to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- */
- function arraySome(array, predicate) {
- var index = -1,
- length = array == null ? 0 : array.length;
-
- while (++index < length) {
- if (predicate(array[index], index, array)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Gets the size of an ASCII `string`.
- *
- * @private
- * @param {string} string The string inspect.
- * @returns {number} Returns the string size.
- */
- var asciiSize = baseProperty('length');
-
- /**
- * Converts an ASCII `string` to an array.
- *
- * @private
- * @param {string} string The string to convert.
- * @returns {Array} Returns the converted array.
- */
- function asciiToArray(string) {
- return string.split('');
- }
-
- /**
- * Splits an ASCII `string` into an array of its words.
- *
- * @private
- * @param {string} The string to inspect.
- * @returns {Array} Returns the words of `string`.
- */
- function asciiWords(string) {
- return string.match(reAsciiWord) || [];
- }
-
- /**
- * The base implementation of methods like `_.findKey` and `_.findLastKey`,
- * without support for iteratee shorthands, which iterates over `collection`
- * using `eachFunc`.
- *
- * @private
- * @param {Array|Object} collection The collection to inspect.
- * @param {Function} predicate The function invoked per iteration.
- * @param {Function} eachFunc The function to iterate over `collection`.
- * @returns {*} Returns the found element or its key, else `undefined`.
- */
- function baseFindKey(collection, predicate, eachFunc) {
- var result;
- eachFunc(collection, function(value, key, collection) {
- if (predicate(value, key, collection)) {
- result = key;
- return false;
- }
- });
- return result;
- }
-
- /**
- * The base implementation of `_.findIndex` and `_.findLastIndex` without
- * support for iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Function} predicate The function invoked per iteration.
- * @param {number} fromIndex The index to search from.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function baseFindIndex(array, predicate, fromIndex, fromRight) {
- var length = array.length,
- index = fromIndex + (fromRight ? 1 : -1);
-
- while ((fromRight ? index-- : ++index < length)) {
- if (predicate(array[index], index, array)) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} fromIndex The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function baseIndexOf(array, value, fromIndex) {
- return value === value
- ? strictIndexOf(array, value, fromIndex)
- : baseFindIndex(array, baseIsNaN, fromIndex);
- }
-
- /**
- * This function is like `baseIndexOf` except that it accepts a comparator.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} fromIndex The index to search from.
- * @param {Function} comparator The comparator invoked per element.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function baseIndexOfWith(array, value, fromIndex, comparator) {
- var index = fromIndex - 1,
- length = array.length;
-
- while (++index < length) {
- if (comparator(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * The base implementation of `_.isNaN` without support for number objects.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
- */
- function baseIsNaN(value) {
- return value !== value;
- }
-
- /**
- * The base implementation of `_.mean` and `_.meanBy` without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {number} Returns the mean.
- */
- function baseMean(array, iteratee) {
- var length = array == null ? 0 : array.length;
- return length ? (baseSum(array, iteratee) / length) : NAN;
- }
-
- /**
- * The base implementation of `_.property` without support for deep paths.
- *
- * @private
- * @param {string} key The key of the property to get.
- * @returns {Function} Returns the new accessor function.
- */
- function baseProperty(key) {
- return function(object) {
- return object == null ? undefined : object[key];
- };
- }
-
- /**
- * The base implementation of `_.propertyOf` without support for deep paths.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Function} Returns the new accessor function.
- */
- function basePropertyOf(object) {
- return function(key) {
- return object == null ? undefined : object[key];
- };
- }
-
- /**
- * The base implementation of `_.reduce` and `_.reduceRight`, without support
- * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {*} accumulator The initial value.
- * @param {boolean} initAccum Specify using the first or last element of
- * `collection` as the initial value.
- * @param {Function} eachFunc The function to iterate over `collection`.
- * @returns {*} Returns the accumulated value.
- */
- function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
- eachFunc(collection, function(value, index, collection) {
- accumulator = initAccum
- ? (initAccum = false, value)
- : iteratee(accumulator, value, index, collection);
- });
- return accumulator;
- }
-
- /**
- * The base implementation of `_.sortBy` which uses `comparer` to define the
- * sort order of `array` and replaces criteria objects with their corresponding
- * values.
- *
- * @private
- * @param {Array} array The array to sort.
- * @param {Function} comparer The function to define sort order.
- * @returns {Array} Returns `array`.
- */
- function baseSortBy(array, comparer) {
- var length = array.length;
-
- array.sort(comparer);
- while (length--) {
- array[length] = array[length].value;
- }
- return array;
- }
-
- /**
- * The base implementation of `_.sum` and `_.sumBy` without support for
- * iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {number} Returns the sum.
- */
- function baseSum(array, iteratee) {
- var result,
- index = -1,
- length = array.length;
-
- while (++index < length) {
- var current = iteratee(array[index]);
- if (current !== undefined) {
- result = result === undefined ? current : (result + current);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.times` without support for iteratee shorthands
- * or max array length checks.
- *
- * @private
- * @param {number} n The number of times to invoke `iteratee`.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the array of results.
- */
- function baseTimes(n, iteratee) {
- var index = -1,
- result = Array(n);
-
- while (++index < n) {
- result[index] = iteratee(index);
- }
- return result;
- }
-
- /**
- * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
- * of key-value pairs for `object` corresponding to the property names of `props`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} props The property names to get values for.
- * @returns {Object} Returns the key-value pairs.
- */
- function baseToPairs(object, props) {
- return arrayMap(props, function(key) {
- return [key, object[key]];
- });
- }
-
- /**
- * The base implementation of `_.unary` without support for storing metadata.
- *
- * @private
- * @param {Function} func The function to cap arguments for.
- * @returns {Function} Returns the new capped function.
- */
- function baseUnary(func) {
- return function(value) {
- return func(value);
- };
- }
-
- /**
- * The base implementation of `_.values` and `_.valuesIn` which creates an
- * array of `object` property values corresponding to the property names
- * of `props`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} props The property names to get values for.
- * @returns {Object} Returns the array of property values.
- */
- function baseValues(object, props) {
- return arrayMap(props, function(key) {
- return object[key];
- });
- }
-
- /**
- * Checks if a `cache` value for `key` exists.
- *
- * @private
- * @param {Object} cache The cache to query.
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function cacheHas(cache, key) {
- return cache.has(key);
- }
-
- /**
- * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
- * that is not found in the character symbols.
- *
- * @private
- * @param {Array} strSymbols The string symbols to inspect.
- * @param {Array} chrSymbols The character symbols to find.
- * @returns {number} Returns the index of the first unmatched string symbol.
- */
- function charsStartIndex(strSymbols, chrSymbols) {
- var index = -1,
- length = strSymbols.length;
-
- while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
- return index;
- }
-
- /**
- * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
- * that is not found in the character symbols.
- *
- * @private
- * @param {Array} strSymbols The string symbols to inspect.
- * @param {Array} chrSymbols The character symbols to find.
- * @returns {number} Returns the index of the last unmatched string symbol.
- */
- function charsEndIndex(strSymbols, chrSymbols) {
- var index = strSymbols.length;
-
- while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
- return index;
- }
-
- /**
- * Gets the number of `placeholder` occurrences in `array`.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} placeholder The placeholder to search for.
- * @returns {number} Returns the placeholder count.
- */
- function countHolders(array, placeholder) {
- var length = array.length,
- result = 0;
-
- while (length--) {
- if (array[length] === placeholder) {
- ++result;
- }
- }
- return result;
- }
-
- /**
- * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
- * letters to basic Latin letters.
- *
- * @private
- * @param {string} letter The matched letter to deburr.
- * @returns {string} Returns the deburred letter.
- */
- var deburrLetter = basePropertyOf(deburredLetters);
-
- /**
- * Used by `_.escape` to convert characters to HTML entities.
- *
- * @private
- * @param {string} chr The matched character to escape.
- * @returns {string} Returns the escaped character.
- */
- var escapeHtmlChar = basePropertyOf(htmlEscapes);
-
- /**
- * Used by `_.template` to escape characters for inclusion in compiled string literals.
- *
- * @private
- * @param {string} chr The matched character to escape.
- * @returns {string} Returns the escaped character.
- */
- function escapeStringChar(chr) {
- return '\\' + stringEscapes[chr];
- }
-
- /**
- * Gets the value at `key` of `object`.
- *
- * @private
- * @param {Object} [object] The object to query.
- * @param {string} key The key of the property to get.
- * @returns {*} Returns the property value.
- */
- function getValue(object, key) {
- return object == null ? undefined : object[key];
- }
-
- /**
- * Checks if `string` contains Unicode symbols.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {boolean} Returns `true` if a symbol is found, else `false`.
- */
- function hasUnicode(string) {
- return reHasUnicode.test(string);
- }
-
- /**
- * Checks if `string` contains a word composed of Unicode symbols.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {boolean} Returns `true` if a word is found, else `false`.
- */
- function hasUnicodeWord(string) {
- return reHasUnicodeWord.test(string);
- }
-
- /**
- * Converts `iterator` to an array.
- *
- * @private
- * @param {Object} iterator The iterator to convert.
- * @returns {Array} Returns the converted array.
- */
- function iteratorToArray(iterator) {
- var data,
- result = [];
-
- while (!(data = iterator.next()).done) {
- result.push(data.value);
- }
- return result;
- }
-
- /**
- * Converts `map` to its key-value pairs.
- *
- * @private
- * @param {Object} map The map to convert.
- * @returns {Array} Returns the key-value pairs.
- */
- function mapToArray(map) {
- var index = -1,
- result = Array(map.size);
-
- map.forEach(function(value, key) {
- result[++index] = [key, value];
- });
- return result;
- }
-
- /**
- * Creates a unary function that invokes `func` with its argument transformed.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {Function} transform The argument transform.
- * @returns {Function} Returns the new function.
- */
- function overArg(func, transform) {
- return function(arg) {
- return func(transform(arg));
- };
- }
-
- /**
- * Replaces all `placeholder` elements in `array` with an internal placeholder
- * and returns an array of their indexes.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {*} placeholder The placeholder to replace.
- * @returns {Array} Returns the new array of placeholder indexes.
- */
- function replaceHolders(array, placeholder) {
- var index = -1,
- length = array.length,
- resIndex = 0,
- result = [];
-
- while (++index < length) {
- var value = array[index];
- if (value === placeholder || value === PLACEHOLDER) {
- array[index] = PLACEHOLDER;
- result[resIndex++] = index;
- }
- }
- return result;
- }
-
- /**
- * Converts `set` to an array of its values.
- *
- * @private
- * @param {Object} set The set to convert.
- * @returns {Array} Returns the values.
- */
- function setToArray(set) {
- var index = -1,
- result = Array(set.size);
-
- set.forEach(function(value) {
- result[++index] = value;
- });
- return result;
- }
-
- /**
- * Converts `set` to its value-value pairs.
- *
- * @private
- * @param {Object} set The set to convert.
- * @returns {Array} Returns the value-value pairs.
- */
- function setToPairs(set) {
- var index = -1,
- result = Array(set.size);
-
- set.forEach(function(value) {
- result[++index] = [value, value];
- });
- return result;
- }
-
- /**
- * A specialized version of `_.indexOf` which performs strict equality
- * comparisons of values, i.e. `===`.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} fromIndex The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function strictIndexOf(array, value, fromIndex) {
- var index = fromIndex - 1,
- length = array.length;
-
- while (++index < length) {
- if (array[index] === value) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * A specialized version of `_.lastIndexOf` which performs strict equality
- * comparisons of values, i.e. `===`.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} fromIndex The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function strictLastIndexOf(array, value, fromIndex) {
- var index = fromIndex + 1;
- while (index--) {
- if (array[index] === value) {
- return index;
- }
- }
- return index;
- }
-
- /**
- * Gets the number of symbols in `string`.
- *
- * @private
- * @param {string} string The string to inspect.
- * @returns {number} Returns the string size.
- */
- function stringSize(string) {
- return hasUnicode(string)
- ? unicodeSize(string)
- : asciiSize(string);
- }
-
- /**
- * Converts `string` to an array.
- *
- * @private
- * @param {string} string The string to convert.
- * @returns {Array} Returns the converted array.
- */
- function stringToArray(string) {
- return hasUnicode(string)
- ? unicodeToArray(string)
- : asciiToArray(string);
- }
-
- /**
- * Used by `_.unescape` to convert HTML entities to characters.
- *
- * @private
- * @param {string} chr The matched character to unescape.
- * @returns {string} Returns the unescaped character.
- */
- var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
-
- /**
- * Gets the size of a Unicode `string`.
- *
- * @private
- * @param {string} string The string inspect.
- * @returns {number} Returns the string size.
- */
- function unicodeSize(string) {
- var result = reUnicode.lastIndex = 0;
- while (reUnicode.test(string)) {
- ++result;
- }
- return result;
- }
-
- /**
- * Converts a Unicode `string` to an array.
- *
- * @private
- * @param {string} string The string to convert.
- * @returns {Array} Returns the converted array.
- */
- function unicodeToArray(string) {
- return string.match(reUnicode) || [];
- }
-
- /**
- * Splits a Unicode `string` into an array of its words.
- *
- * @private
- * @param {string} The string to inspect.
- * @returns {Array} Returns the words of `string`.
- */
- function unicodeWords(string) {
- return string.match(reUnicodeWord) || [];
- }
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * Create a new pristine `lodash` function using the `context` object.
- *
- * @static
- * @memberOf _
- * @since 1.1.0
- * @category Util
- * @param {Object} [context=root] The context object.
- * @returns {Function} Returns a new `lodash` function.
- * @example
- *
- * _.mixin({ 'foo': _.constant('foo') });
- *
- * var lodash = _.runInContext();
- * lodash.mixin({ 'bar': lodash.constant('bar') });
- *
- * _.isFunction(_.foo);
- * // => true
- * _.isFunction(_.bar);
- * // => false
- *
- * lodash.isFunction(lodash.foo);
- * // => false
- * lodash.isFunction(lodash.bar);
- * // => true
- *
- * // Create a suped-up `defer` in Node.js.
- * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
- */
- var runInContext = (function runInContext(context) {
- context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
-
- /** Built-in constructor references. */
- var Array = context.Array,
- Date = context.Date,
- Error = context.Error,
- Function = context.Function,
- Math = context.Math,
- Object = context.Object,
- RegExp = context.RegExp,
- String = context.String,
- TypeError = context.TypeError;
-
- /** Used for built-in method references. */
- var arrayProto = Array.prototype,
- funcProto = Function.prototype,
- objectProto = Object.prototype;
-
- /** Used to detect overreaching core-js shims. */
- var coreJsData = context['__core-js_shared__'];
-
- /** Used to resolve the decompiled source of functions. */
- var funcToString = funcProto.toString;
-
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
-
- /** Used to generate unique IDs. */
- var idCounter = 0;
-
- /** Used to detect methods masquerading as native. */
- var maskSrcKey = (function() {
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
- return uid ? ('Symbol(src)_1.' + uid) : '';
- }());
-
- /**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
- var nativeObjectToString = objectProto.toString;
-
- /** Used to infer the `Object` constructor. */
- var objectCtorString = funcToString.call(Object);
-
- /** Used to restore the original `_` reference in `_.noConflict`. */
- var oldDash = root._;
-
- /** Used to detect if a method is native. */
- var reIsNative = RegExp('^' +
- funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
- );
-
- /** Built-in value references. */
- var Buffer = moduleExports ? context.Buffer : undefined,
- Symbol = context.Symbol,
- Uint8Array = context.Uint8Array,
- allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
- getPrototype = overArg(Object.getPrototypeOf, Object),
- objectCreate = Object.create,
- propertyIsEnumerable = objectProto.propertyIsEnumerable,
- splice = arrayProto.splice,
- spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
- symIterator = Symbol ? Symbol.iterator : undefined,
- symToStringTag = Symbol ? Symbol.toStringTag : undefined;
-
- var defineProperty = (function() {
- try {
- var func = getNative(Object, 'defineProperty');
- func({}, '', {});
- return func;
- } catch (e) {}
- }());
-
- /** Mocked built-ins. */
- var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
- ctxNow = Date && Date.now !== root.Date.now && Date.now,
- ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
-
- /* Built-in method references for those with the same name as other `lodash` methods. */
- var nativeCeil = Math.ceil,
- nativeFloor = Math.floor,
- nativeGetSymbols = Object.getOwnPropertySymbols,
- nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
- nativeIsFinite = context.isFinite,
- nativeJoin = arrayProto.join,
- nativeKeys = overArg(Object.keys, Object),
- nativeMax = Math.max,
- nativeMin = Math.min,
- nativeNow = Date.now,
- nativeParseInt = context.parseInt,
- nativeRandom = Math.random,
- nativeReverse = arrayProto.reverse;
-
- /* Built-in method references that are verified to be native. */
- var DataView = getNative(context, 'DataView'),
- Map = getNative(context, 'Map'),
- Promise = getNative(context, 'Promise'),
- Set = getNative(context, 'Set'),
- WeakMap = getNative(context, 'WeakMap'),
- nativeCreate = getNative(Object, 'create');
-
- /** Used to store function metadata. */
- var metaMap = WeakMap && new WeakMap;
-
- /** Used to lookup unminified function names. */
- var realNames = {};
-
- /** Used to detect maps, sets, and weakmaps. */
- var dataViewCtorString = toSource(DataView),
- mapCtorString = toSource(Map),
- promiseCtorString = toSource(Promise),
- setCtorString = toSource(Set),
- weakMapCtorString = toSource(WeakMap);
-
- /** Used to convert symbols to primitives and strings. */
- var symbolProto = Symbol ? Symbol.prototype : undefined,
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
- symbolToString = symbolProto ? symbolProto.toString : undefined;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a `lodash` object which wraps `value` to enable implicit method
- * chain sequences. Methods that operate on and return arrays, collections,
- * and functions can be chained together. Methods that retrieve a single value
- * or may return a primitive value will automatically end the chain sequence
- * and return the unwrapped value. Otherwise, the value must be unwrapped
- * with `_#value`.
- *
- * Explicit chain sequences, which must be unwrapped with `_#value`, may be
- * enabled using `_.chain`.
- *
- * The execution of chained methods is lazy, that is, it's deferred until
- * `_#value` is implicitly or explicitly called.
- *
- * Lazy evaluation allows several methods to support shortcut fusion.
- * Shortcut fusion is an optimization to merge iteratee calls; this avoids
- * the creation of intermediate arrays and can greatly reduce the number of
- * iteratee executions. Sections of a chain sequence qualify for shortcut
- * fusion if the section is applied to an array and iteratees accept only
- * one argument. The heuristic for whether a section qualifies for shortcut
- * fusion is subject to change.
- *
- * Chaining is supported in custom builds as long as the `_#value` method is
- * directly or indirectly included in the build.
- *
- * In addition to lodash methods, wrappers have `Array` and `String` methods.
- *
- * The wrapper `Array` methods are:
- * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
- *
- * The wrapper `String` methods are:
- * `replace` and `split`
- *
- * The wrapper methods that support shortcut fusion are:
- * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
- * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
- * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
- *
- * The chainable wrapper methods are:
- * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
- * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
- * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
- * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
- * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
- * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
- * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
- * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
- * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
- * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
- * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
- * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
- * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
- * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
- * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
- * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
- * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
- * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
- * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
- * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
- * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
- * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
- * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
- * `zipObject`, `zipObjectDeep`, and `zipWith`
- *
- * The wrapper methods that are **not** chainable by default are:
- * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
- * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
- * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
- * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
- * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
- * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
- * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
- * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
- * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
- * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
- * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
- * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
- * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
- * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
- * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
- * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
- * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
- * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
- * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
- * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
- * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
- * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
- * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
- * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
- * `upperFirst`, `value`, and `words`
- *
- * @name _
- * @constructor
- * @category Seq
- * @param {*} value The value to wrap in a `lodash` instance.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var wrapped = _([1, 2, 3]);
- *
- * // Returns an unwrapped value.
- * wrapped.reduce(_.add);
- * // => 6
- *
- * // Returns a wrapped value.
- * var squares = wrapped.map(square);
- *
- * _.isArray(squares);
- * // => false
- *
- * _.isArray(squares.value());
- * // => true
- */
- function lodash(value) {
- if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
- if (value instanceof LodashWrapper) {
- return value;
- }
- if (hasOwnProperty.call(value, '__wrapped__')) {
- return wrapperClone(value);
- }
- }
- return new LodashWrapper(value);
- }
-
- /**
- * The base implementation of `_.create` without support for assigning
- * properties to the created object.
- *
- * @private
- * @param {Object} proto The object to inherit from.
- * @returns {Object} Returns the new object.
- */
- var baseCreate = (function() {
- function object() {}
- return function(proto) {
- if (!isObject(proto)) {
- return {};
- }
- if (objectCreate) {
- return objectCreate(proto);
- }
- object.prototype = proto;
- var result = new object;
- object.prototype = undefined;
- return result;
- };
- }());
-
- /**
- * The function whose prototype chain sequence wrappers inherit from.
- *
- * @private
- */
- function baseLodash() {
- // No operation performed.
- }
-
- /**
- * The base constructor for creating `lodash` wrapper objects.
- *
- * @private
- * @param {*} value The value to wrap.
- * @param {boolean} [chainAll] Enable explicit method chain sequences.
- */
- function LodashWrapper(value, chainAll) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__chain__ = !!chainAll;
- this.__index__ = 0;
- this.__values__ = undefined;
- }
-
- /**
- * By default, the template delimiters used by lodash are like those in
- * embedded Ruby (ERB) as well as ES2015 template strings. Change the
- * following template settings to use alternative delimiters.
- *
- * @static
- * @memberOf _
- * @type {Object}
- */
- lodash.templateSettings = {
-
- /**
- * Used to detect `data` property values to be HTML-escaped.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- 'escape': reEscape,
-
- /**
- * Used to detect code to be evaluated.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- 'evaluate': reEvaluate,
-
- /**
- * Used to detect `data` property values to inject.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- 'interpolate': reInterpolate,
-
- /**
- * Used to reference the data object in the template text.
- *
- * @memberOf _.templateSettings
- * @type {string}
- */
- 'variable': '',
-
- /**
- * Used to import variables into the compiled template.
- *
- * @memberOf _.templateSettings
- * @type {Object}
- */
- 'imports': {
-
- /**
- * A reference to the `lodash` function.
- *
- * @memberOf _.templateSettings.imports
- * @type {Function}
- */
- '_': lodash
- }
- };
-
- // Ensure wrappers are instances of `baseLodash`.
- lodash.prototype = baseLodash.prototype;
- lodash.prototype.constructor = lodash;
-
- LodashWrapper.prototype = baseCreate(baseLodash.prototype);
- LodashWrapper.prototype.constructor = LodashWrapper;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
- *
- * @private
- * @constructor
- * @param {*} value The value to wrap.
- */
- function LazyWrapper(value) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__dir__ = 1;
- this.__filtered__ = false;
- this.__iteratees__ = [];
- this.__takeCount__ = MAX_ARRAY_LENGTH;
- this.__views__ = [];
- }
-
- /**
- * Creates a clone of the lazy wrapper object.
- *
- * @private
- * @name clone
- * @memberOf LazyWrapper
- * @returns {Object} Returns the cloned `LazyWrapper` object.
- */
- function lazyClone() {
- var result = new LazyWrapper(this.__wrapped__);
- result.__actions__ = copyArray(this.__actions__);
- result.__dir__ = this.__dir__;
- result.__filtered__ = this.__filtered__;
- result.__iteratees__ = copyArray(this.__iteratees__);
- result.__takeCount__ = this.__takeCount__;
- result.__views__ = copyArray(this.__views__);
- return result;
- }
-
- /**
- * Reverses the direction of lazy iteration.
- *
- * @private
- * @name reverse
- * @memberOf LazyWrapper
- * @returns {Object} Returns the new reversed `LazyWrapper` object.
- */
- function lazyReverse() {
- if (this.__filtered__) {
- var result = new LazyWrapper(this);
- result.__dir__ = -1;
- result.__filtered__ = true;
- } else {
- result = this.clone();
- result.__dir__ *= -1;
- }
- return result;
- }
-
- /**
- * Extracts the unwrapped value from its lazy wrapper.
- *
- * @private
- * @name value
- * @memberOf LazyWrapper
- * @returns {*} Returns the unwrapped value.
- */
- function lazyValue() {
- var array = this.__wrapped__.value(),
- dir = this.__dir__,
- isArr = isArray(array),
- isRight = dir < 0,
- arrLength = isArr ? array.length : 0,
- view = getView(0, arrLength, this.__views__),
- start = view.start,
- end = view.end,
- length = end - start,
- index = isRight ? end : (start - 1),
- iteratees = this.__iteratees__,
- iterLength = iteratees.length,
- resIndex = 0,
- takeCount = nativeMin(length, this.__takeCount__);
-
- if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
- return baseWrapperValue(array, this.__actions__);
- }
- var result = [];
-
- outer:
- while (length-- && resIndex < takeCount) {
- index += dir;
-
- var iterIndex = -1,
- value = array[index];
-
- while (++iterIndex < iterLength) {
- var data = iteratees[iterIndex],
- iteratee = data.iteratee,
- type = data.type,
- computed = iteratee(value);
-
- if (type == LAZY_MAP_FLAG) {
- value = computed;
- } else if (!computed) {
- if (type == LAZY_FILTER_FLAG) {
- continue outer;
- } else {
- break outer;
- }
- }
- }
- result[resIndex++] = value;
- }
- return result;
- }
-
- // Ensure `LazyWrapper` is an instance of `baseLodash`.
- LazyWrapper.prototype = baseCreate(baseLodash.prototype);
- LazyWrapper.prototype.constructor = LazyWrapper;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a hash object.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function Hash(entries) {
- var index = -1,
- length = entries == null ? 0 : entries.length;
-
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
-
- /**
- * Removes all key-value entries from the hash.
- *
- * @private
- * @name clear
- * @memberOf Hash
- */
- function hashClear() {
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
- this.size = 0;
- }
-
- /**
- * Removes `key` and its value from the hash.
- *
- * @private
- * @name delete
- * @memberOf Hash
- * @param {Object} hash The hash to modify.
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function hashDelete(key) {
- var result = this.has(key) && delete this.__data__[key];
- this.size -= result ? 1 : 0;
- return result;
- }
-
- /**
- * Gets the hash value for `key`.
- *
- * @private
- * @name get
- * @memberOf Hash
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function hashGet(key) {
- var data = this.__data__;
- if (nativeCreate) {
- var result = data[key];
- return result === HASH_UNDEFINED ? undefined : result;
- }
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
- }
-
- /**
- * Checks if a hash value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf Hash
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function hashHas(key) {
- var data = this.__data__;
- return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
- }
-
- /**
- * Sets the hash `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf Hash
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the hash instance.
- */
- function hashSet(key, value) {
- var data = this.__data__;
- this.size += this.has(key) ? 0 : 1;
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
- return this;
- }
-
- // Add methods to `Hash`.
- Hash.prototype.clear = hashClear;
- Hash.prototype['delete'] = hashDelete;
- Hash.prototype.get = hashGet;
- Hash.prototype.has = hashHas;
- Hash.prototype.set = hashSet;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates an list cache object.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function ListCache(entries) {
- var index = -1,
- length = entries == null ? 0 : entries.length;
-
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
-
- /**
- * Removes all key-value entries from the list cache.
- *
- * @private
- * @name clear
- * @memberOf ListCache
- */
- function listCacheClear() {
- this.__data__ = [];
- this.size = 0;
- }
-
- /**
- * Removes `key` and its value from the list cache.
- *
- * @private
- * @name delete
- * @memberOf ListCache
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function listCacheDelete(key) {
- var data = this.__data__,
- index = assocIndexOf(data, key);
-
- if (index < 0) {
- return false;
- }
- var lastIndex = data.length - 1;
- if (index == lastIndex) {
- data.pop();
- } else {
- splice.call(data, index, 1);
- }
- --this.size;
- return true;
- }
-
- /**
- * Gets the list cache value for `key`.
- *
- * @private
- * @name get
- * @memberOf ListCache
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function listCacheGet(key) {
- var data = this.__data__,
- index = assocIndexOf(data, key);
-
- return index < 0 ? undefined : data[index][1];
- }
-
- /**
- * Checks if a list cache value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf ListCache
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function listCacheHas(key) {
- return assocIndexOf(this.__data__, key) > -1;
- }
-
- /**
- * Sets the list cache `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf ListCache
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the list cache instance.
- */
- function listCacheSet(key, value) {
- var data = this.__data__,
- index = assocIndexOf(data, key);
-
- if (index < 0) {
- ++this.size;
- data.push([key, value]);
- } else {
- data[index][1] = value;
- }
- return this;
- }
-
- // Add methods to `ListCache`.
- ListCache.prototype.clear = listCacheClear;
- ListCache.prototype['delete'] = listCacheDelete;
- ListCache.prototype.get = listCacheGet;
- ListCache.prototype.has = listCacheHas;
- ListCache.prototype.set = listCacheSet;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a map cache object to store key-value pairs.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function MapCache(entries) {
- var index = -1,
- length = entries == null ? 0 : entries.length;
-
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
-
- /**
- * Removes all key-value entries from the map.
- *
- * @private
- * @name clear
- * @memberOf MapCache
- */
- function mapCacheClear() {
- this.size = 0;
- this.__data__ = {
- 'hash': new Hash,
- 'map': new (Map || ListCache),
- 'string': new Hash
- };
- }
-
- /**
- * Removes `key` and its value from the map.
- *
- * @private
- * @name delete
- * @memberOf MapCache
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function mapCacheDelete(key) {
- var result = getMapData(this, key)['delete'](key);
- this.size -= result ? 1 : 0;
- return result;
- }
-
- /**
- * Gets the map value for `key`.
- *
- * @private
- * @name get
- * @memberOf MapCache
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function mapCacheGet(key) {
- return getMapData(this, key).get(key);
- }
-
- /**
- * Checks if a map value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf MapCache
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function mapCacheHas(key) {
- return getMapData(this, key).has(key);
- }
-
- /**
- * Sets the map `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf MapCache
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the map cache instance.
- */
- function mapCacheSet(key, value) {
- var data = getMapData(this, key),
- size = data.size;
-
- data.set(key, value);
- this.size += data.size == size ? 0 : 1;
- return this;
- }
-
- // Add methods to `MapCache`.
- MapCache.prototype.clear = mapCacheClear;
- MapCache.prototype['delete'] = mapCacheDelete;
- MapCache.prototype.get = mapCacheGet;
- MapCache.prototype.has = mapCacheHas;
- MapCache.prototype.set = mapCacheSet;
-
- /*------------------------------------------------------------------------*/
-
- /**
- *
- * Creates an array cache object to store unique values.
- *
- * @private
- * @constructor
- * @param {Array} [values] The values to cache.
- */
- function SetCache(values) {
- var index = -1,
- length = values == null ? 0 : values.length;
-
- this.__data__ = new MapCache;
- while (++index < length) {
- this.add(values[index]);
- }
- }
-
- /**
- * Adds `value` to the array cache.
- *
- * @private
- * @name add
- * @memberOf SetCache
- * @alias push
- * @param {*} value The value to cache.
- * @returns {Object} Returns the cache instance.
- */
- function setCacheAdd(value) {
- this.__data__.set(value, HASH_UNDEFINED);
- return this;
- }
-
- /**
- * Checks if `value` is in the array cache.
- *
- * @private
- * @name has
- * @memberOf SetCache
- * @param {*} value The value to search for.
- * @returns {number} Returns `true` if `value` is found, else `false`.
- */
- function setCacheHas(value) {
- return this.__data__.has(value);
- }
-
- // Add methods to `SetCache`.
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
- SetCache.prototype.has = setCacheHas;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a stack cache object to store key-value pairs.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function Stack(entries) {
- var data = this.__data__ = new ListCache(entries);
- this.size = data.size;
- }
-
- /**
- * Removes all key-value entries from the stack.
- *
- * @private
- * @name clear
- * @memberOf Stack
- */
- function stackClear() {
- this.__data__ = new ListCache;
- this.size = 0;
- }
-
- /**
- * Removes `key` and its value from the stack.
- *
- * @private
- * @name delete
- * @memberOf Stack
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function stackDelete(key) {
- var data = this.__data__,
- result = data['delete'](key);
-
- this.size = data.size;
- return result;
- }
-
- /**
- * Gets the stack value for `key`.
- *
- * @private
- * @name get
- * @memberOf Stack
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function stackGet(key) {
- return this.__data__.get(key);
- }
-
- /**
- * Checks if a stack value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf Stack
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function stackHas(key) {
- return this.__data__.has(key);
- }
-
- /**
- * Sets the stack `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf Stack
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the stack cache instance.
- */
- function stackSet(key, value) {
- var data = this.__data__;
- if (data instanceof ListCache) {
- var pairs = data.__data__;
- if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
- pairs.push([key, value]);
- this.size = ++data.size;
- return this;
- }
- data = this.__data__ = new MapCache(pairs);
- }
- data.set(key, value);
- this.size = data.size;
- return this;
- }
-
- // Add methods to `Stack`.
- Stack.prototype.clear = stackClear;
- Stack.prototype['delete'] = stackDelete;
- Stack.prototype.get = stackGet;
- Stack.prototype.has = stackHas;
- Stack.prototype.set = stackSet;
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates an array of the enumerable property names of the array-like `value`.
- *
- * @private
- * @param {*} value The value to query.
- * @param {boolean} inherited Specify returning inherited property names.
- * @returns {Array} Returns the array of property names.
- */
- function arrayLikeKeys(value, inherited) {
- var isArr = isArray(value),
- isArg = !isArr && isArguments(value),
- isBuff = !isArr && !isArg && isBuffer(value),
- isType = !isArr && !isArg && !isBuff && isTypedArray(value),
- skipIndexes = isArr || isArg || isBuff || isType,
- result = skipIndexes ? baseTimes(value.length, String) : [],
- length = result.length;
-
- for (var key in value) {
- if ((inherited || hasOwnProperty.call(value, key)) &&
- !(skipIndexes && (
- // Safari 9 has enumerable `arguments.length` in strict mode.
- key == 'length' ||
- // Node.js 0.10 has enumerable non-index properties on buffers.
- (isBuff && (key == 'offset' || key == 'parent')) ||
- // PhantomJS 2 has enumerable non-index properties on typed arrays.
- (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
- // Skip index properties.
- isIndex(key, length)
- ))) {
- result.push(key);
- }
- }
- return result;
- }
-
- /**
- * A specialized version of `_.sample` for arrays.
- *
- * @private
- * @param {Array} array The array to sample.
- * @returns {*} Returns the random element.
- */
- function arraySample(array) {
- var length = array.length;
- return length ? array[baseRandom(0, length - 1)] : undefined;
- }
-
- /**
- * A specialized version of `_.sampleSize` for arrays.
- *
- * @private
- * @param {Array} array The array to sample.
- * @param {number} n The number of elements to sample.
- * @returns {Array} Returns the random elements.
- */
- function arraySampleSize(array, n) {
- return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
- }
-
- /**
- * A specialized version of `_.shuffle` for arrays.
- *
- * @private
- * @param {Array} array The array to shuffle.
- * @returns {Array} Returns the new shuffled array.
- */
- function arrayShuffle(array) {
- return shuffleSelf(copyArray(array));
- }
-
- /**
- * This function is like `assignValue` except that it doesn't assign
- * `undefined` values.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {string} key The key of the property to assign.
- * @param {*} value The value to assign.
- */
- function assignMergeValue(object, key, value) {
- if ((value !== undefined && !eq(object[key], value)) ||
- (value === undefined && !(key in object))) {
- baseAssignValue(object, key, value);
- }
- }
-
- /**
- * Assigns `value` to `key` of `object` if the existing value is not equivalent
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {string} key The key of the property to assign.
- * @param {*} value The value to assign.
- */
- function assignValue(object, key, value) {
- var objValue = object[key];
- if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
- (value === undefined && !(key in object))) {
- baseAssignValue(object, key, value);
- }
- }
-
- /**
- * Gets the index at which the `key` is found in `array` of key-value pairs.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} key The key to search for.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function assocIndexOf(array, key) {
- var length = array.length;
- while (length--) {
- if (eq(array[length][0], key)) {
- return length;
- }
- }
- return -1;
- }
-
- /**
- * Aggregates elements of `collection` on `accumulator` with keys transformed
- * by `iteratee` and values set by `setter`.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} setter The function to set `accumulator` values.
- * @param {Function} iteratee The iteratee to transform keys.
- * @param {Object} accumulator The initial aggregated object.
- * @returns {Function} Returns `accumulator`.
- */
- function baseAggregator(collection, setter, iteratee, accumulator) {
- baseEach(collection, function(value, key, collection) {
- setter(accumulator, value, iteratee(value), collection);
- });
- return accumulator;
- }
-
- /**
- * The base implementation of `_.assign` without support for multiple sources
- * or `customizer` functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @returns {Object} Returns `object`.
- */
- function baseAssign(object, source) {
- return object && copyObject(source, keys(source), object);
- }
-
- /**
- * The base implementation of `_.assignIn` without support for multiple sources
- * or `customizer` functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @returns {Object} Returns `object`.
- */
- function baseAssignIn(object, source) {
- return object && copyObject(source, keysIn(source), object);
- }
-
- /**
- * The base implementation of `assignValue` and `assignMergeValue` without
- * value checks.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {string} key The key of the property to assign.
- * @param {*} value The value to assign.
- */
- function baseAssignValue(object, key, value) {
- if (key == '__proto__' && defineProperty) {
- defineProperty(object, key, {
- 'configurable': true,
- 'enumerable': true,
- 'value': value,
- 'writable': true
- });
- } else {
- object[key] = value;
- }
- }
-
- /**
- * The base implementation of `_.at` without support for individual paths.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {string[]} paths The property paths to pick.
- * @returns {Array} Returns the picked elements.
- */
- function baseAt(object, paths) {
- var index = -1,
- length = paths.length,
- result = Array(length),
- skip = object == null;
-
- while (++index < length) {
- result[index] = skip ? undefined : get(object, paths[index]);
- }
- return result;
- }
-
- /**
- * The base implementation of `_.clamp` which doesn't coerce arguments.
- *
- * @private
- * @param {number} number The number to clamp.
- * @param {number} [lower] The lower bound.
- * @param {number} upper The upper bound.
- * @returns {number} Returns the clamped number.
- */
- function baseClamp(number, lower, upper) {
- if (number === number) {
- if (upper !== undefined) {
- number = number <= upper ? number : upper;
- }
- if (lower !== undefined) {
- number = number >= lower ? number : lower;
- }
- }
- return number;
- }
-
- /**
- * The base implementation of `_.clone` and `_.cloneDeep` which tracks
- * traversed objects.
- *
- * @private
- * @param {*} value The value to clone.
- * @param {boolean} bitmask The bitmask flags.
- * 1 - Deep clone
- * 2 - Flatten inherited properties
- * 4 - Clone symbols
- * @param {Function} [customizer] The function to customize cloning.
- * @param {string} [key] The key of `value`.
- * @param {Object} [object] The parent object of `value`.
- * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
- * @returns {*} Returns the cloned value.
- */
- function baseClone(value, bitmask, customizer, key, object, stack) {
- var result,
- isDeep = bitmask & CLONE_DEEP_FLAG,
- isFlat = bitmask & CLONE_FLAT_FLAG,
- isFull = bitmask & CLONE_SYMBOLS_FLAG;
-
- if (customizer) {
- result = object ? customizer(value, key, object, stack) : customizer(value);
- }
- if (result !== undefined) {
- return result;
- }
- if (!isObject(value)) {
- return value;
- }
- var isArr = isArray(value);
- if (isArr) {
- result = initCloneArray(value);
- if (!isDeep) {
- return copyArray(value, result);
- }
- } else {
- var tag = getTag(value),
- isFunc = tag == funcTag || tag == genTag;
-
- if (isBuffer(value)) {
- return cloneBuffer(value, isDeep);
- }
- if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
- result = (isFlat || isFunc) ? {} : initCloneObject(value);
- if (!isDeep) {
- return isFlat
- ? copySymbolsIn(value, baseAssignIn(result, value))
- : copySymbols(value, baseAssign(result, value));
- }
- } else {
- if (!cloneableTags[tag]) {
- return object ? value : {};
- }
- result = initCloneByTag(value, tag, isDeep);
- }
- }
- // Check for circular references and return its corresponding clone.
- stack || (stack = new Stack);
- var stacked = stack.get(value);
- if (stacked) {
- return stacked;
- }
- stack.set(value, result);
-
- if (isSet(value)) {
- value.forEach(function(subValue) {
- result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
- });
- } else if (isMap(value)) {
- value.forEach(function(subValue, key) {
- result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
- });
- }
-
- var keysFunc = isFull
- ? (isFlat ? getAllKeysIn : getAllKeys)
- : (isFlat ? keysIn : keys);
-
- var props = isArr ? undefined : keysFunc(value);
- arrayEach(props || value, function(subValue, key) {
- if (props) {
- key = subValue;
- subValue = value[key];
- }
- // Recursively populate clone (susceptible to call stack limits).
- assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
- });
- return result;
- }
-
- /**
- * The base implementation of `_.conforms` which doesn't clone `source`.
- *
- * @private
- * @param {Object} source The object of property predicates to conform to.
- * @returns {Function} Returns the new spec function.
- */
- function baseConforms(source) {
- var props = keys(source);
- return function(object) {
- return baseConformsTo(object, source, props);
- };
- }
-
- /**
- * The base implementation of `_.conformsTo` which accepts `props` to check.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property predicates to conform to.
- * @returns {boolean} Returns `true` if `object` conforms, else `false`.
- */
- function baseConformsTo(object, source, props) {
- var length = props.length;
- if (object == null) {
- return !length;
- }
- object = Object(object);
- while (length--) {
- var key = props[length],
- predicate = source[key],
- value = object[key];
-
- if ((value === undefined && !(key in object)) || !predicate(value)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * The base implementation of `_.delay` and `_.defer` which accepts `args`
- * to provide to `func`.
- *
- * @private
- * @param {Function} func The function to delay.
- * @param {number} wait The number of milliseconds to delay invocation.
- * @param {Array} args The arguments to provide to `func`.
- * @returns {number|Object} Returns the timer id or timeout object.
- */
- function baseDelay(func, wait, args) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return setTimeout(function() { func.apply(undefined, args); }, wait);
- }
-
- /**
- * The base implementation of methods like `_.difference` without support
- * for excluding multiple arrays or iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Array} values The values to exclude.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- */
- function baseDifference(array, values, iteratee, comparator) {
- var index = -1,
- includes = arrayIncludes,
- isCommon = true,
- length = array.length,
- result = [],
- valuesLength = values.length;
-
- if (!length) {
- return result;
- }
- if (iteratee) {
- values = arrayMap(values, baseUnary(iteratee));
- }
- if (comparator) {
- includes = arrayIncludesWith;
- isCommon = false;
- }
- else if (values.length >= LARGE_ARRAY_SIZE) {
- includes = cacheHas;
- isCommon = false;
- values = new SetCache(values);
- }
- outer:
- while (++index < length) {
- var value = array[index],
- computed = iteratee == null ? value : iteratee(value);
-
- value = (comparator || value !== 0) ? value : 0;
- if (isCommon && computed === computed) {
- var valuesIndex = valuesLength;
- while (valuesIndex--) {
- if (values[valuesIndex] === computed) {
- continue outer;
- }
- }
- result.push(value);
- }
- else if (!includes(values, computed, comparator)) {
- result.push(value);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.forEach` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array|Object} Returns `collection`.
- */
- var baseEach = createBaseEach(baseForOwn);
-
- /**
- * The base implementation of `_.forEachRight` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array|Object} Returns `collection`.
- */
- var baseEachRight = createBaseEach(baseForOwnRight, true);
-
- /**
- * The base implementation of `_.every` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`
- */
- function baseEvery(collection, predicate) {
- var result = true;
- baseEach(collection, function(value, index, collection) {
- result = !!predicate(value, index, collection);
- return result;
- });
- return result;
- }
-
- /**
- * The base implementation of methods like `_.max` and `_.min` which accepts a
- * `comparator` to determine the extremum value.
- *
- * @private
- * @param {Array} array The array to iterate over.
- * @param {Function} iteratee The iteratee invoked per iteration.
- * @param {Function} comparator The comparator used to compare values.
- * @returns {*} Returns the extremum value.
- */
- function baseExtremum(array, iteratee, comparator) {
- var index = -1,
- length = array.length;
-
- while (++index < length) {
- var value = array[index],
- current = iteratee(value);
-
- if (current != null && (computed === undefined
- ? (current === current && !isSymbol(current))
- : comparator(current, computed)
- )) {
- var computed = current,
- result = value;
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.fill` without an iteratee call guard.
- *
- * @private
- * @param {Array} array The array to fill.
- * @param {*} value The value to fill `array` with.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns `array`.
- */
- function baseFill(array, value, start, end) {
- var length = array.length;
-
- start = toInteger(start);
- if (start < 0) {
- start = -start > length ? 0 : (length + start);
- }
- end = (end === undefined || end > length) ? length : toInteger(end);
- if (end < 0) {
- end += length;
- }
- end = start > end ? 0 : toLength(end);
- while (start < end) {
- array[start++] = value;
- }
- return array;
- }
-
- /**
- * The base implementation of `_.filter` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- */
- function baseFilter(collection, predicate) {
- var result = [];
- baseEach(collection, function(value, index, collection) {
- if (predicate(value, index, collection)) {
- result.push(value);
- }
- });
- return result;
- }
-
- /**
- * The base implementation of `_.flatten` with support for restricting flattening.
- *
- * @private
- * @param {Array} array The array to flatten.
- * @param {number} depth The maximum recursion depth.
- * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
- * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
- * @param {Array} [result=[]] The initial result value.
- * @returns {Array} Returns the new flattened array.
- */
- function baseFlatten(array, depth, predicate, isStrict, result) {
- var index = -1,
- length = array.length;
-
- predicate || (predicate = isFlattenable);
- result || (result = []);
-
- while (++index < length) {
- var value = array[index];
- if (depth > 0 && predicate(value)) {
- if (depth > 1) {
- // Recursively flatten arrays (susceptible to call stack limits).
- baseFlatten(value, depth - 1, predicate, isStrict, result);
- } else {
- arrayPush(result, value);
- }
- } else if (!isStrict) {
- result[result.length] = value;
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `baseForOwn` which iterates over `object`
- * properties returned by `keysFunc` and invokes `iteratee` for each property.
- * Iteratee functions may exit iteration early by explicitly returning `false`.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @returns {Object} Returns `object`.
- */
- var baseFor = createBaseFor();
-
- /**
- * This function is like `baseFor` except that it iterates over properties
- * in the opposite order.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @returns {Object} Returns `object`.
- */
- var baseForRight = createBaseFor(true);
-
- /**
- * The base implementation of `_.forOwn` without support for iteratee shorthands.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Object} Returns `object`.
- */
- function baseForOwn(object, iteratee) {
- return object && baseFor(object, iteratee, keys);
- }
-
- /**
- * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Object} Returns `object`.
- */
- function baseForOwnRight(object, iteratee) {
- return object && baseForRight(object, iteratee, keys);
- }
-
- /**
- * The base implementation of `_.functions` which creates an array of
- * `object` function property names filtered from `props`.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @param {Array} props The property names to filter.
- * @returns {Array} Returns the function names.
- */
- function baseFunctions(object, props) {
- return arrayFilter(props, function(key) {
- return isFunction(object[key]);
- });
- }
-
- /**
- * The base implementation of `_.get` without support for default values.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the property to get.
- * @returns {*} Returns the resolved value.
- */
- function baseGet(object, path) {
- path = castPath(path, object);
-
- var index = 0,
- length = path.length;
-
- while (object != null && index < length) {
- object = object[toKey(path[index++])];
- }
- return (index && index == length) ? object : undefined;
- }
-
- /**
- * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
- * `keysFunc` and `symbolsFunc` to get the enumerable property names and
- * symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Function} keysFunc The function to get the keys of `object`.
- * @param {Function} symbolsFunc The function to get the symbols of `object`.
- * @returns {Array} Returns the array of property names and symbols.
- */
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
- var result = keysFunc(object);
- return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
- }
-
- /**
- * The base implementation of `getTag` without fallbacks for buggy environments.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
- */
- function baseGetTag(value) {
- if (value == null) {
- return value === undefined ? undefinedTag : nullTag;
- }
- return (symToStringTag && symToStringTag in Object(value))
- ? getRawTag(value)
- : objectToString(value);
- }
-
- /**
- * The base implementation of `_.gt` which doesn't coerce arguments.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is greater than `other`,
- * else `false`.
- */
- function baseGt(value, other) {
- return value > other;
- }
-
- /**
- * The base implementation of `_.has` without support for deep paths.
- *
- * @private
- * @param {Object} [object] The object to query.
- * @param {Array|string} key The key to check.
- * @returns {boolean} Returns `true` if `key` exists, else `false`.
- */
- function baseHas(object, key) {
- return object != null && hasOwnProperty.call(object, key);
- }
-
- /**
- * The base implementation of `_.hasIn` without support for deep paths.
- *
- * @private
- * @param {Object} [object] The object to query.
- * @param {Array|string} key The key to check.
- * @returns {boolean} Returns `true` if `key` exists, else `false`.
- */
- function baseHasIn(object, key) {
- return object != null && key in Object(object);
- }
-
- /**
- * The base implementation of `_.inRange` which doesn't coerce arguments.
- *
- * @private
- * @param {number} number The number to check.
- * @param {number} start The start of the range.
- * @param {number} end The end of the range.
- * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
- */
- function baseInRange(number, start, end) {
- return number >= nativeMin(start, end) && number < nativeMax(start, end);
- }
-
- /**
- * The base implementation of methods like `_.intersection`, without support
- * for iteratee shorthands, that accepts an array of arrays to inspect.
- *
- * @private
- * @param {Array} arrays The arrays to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of shared values.
- */
- function baseIntersection(arrays, iteratee, comparator) {
- var includes = comparator ? arrayIncludesWith : arrayIncludes,
- length = arrays[0].length,
- othLength = arrays.length,
- othIndex = othLength,
- caches = Array(othLength),
- maxLength = Infinity,
- result = [];
-
- while (othIndex--) {
- var array = arrays[othIndex];
- if (othIndex && iteratee) {
- array = arrayMap(array, baseUnary(iteratee));
- }
- maxLength = nativeMin(array.length, maxLength);
- caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
- ? new SetCache(othIndex && array)
- : undefined;
- }
- array = arrays[0];
-
- var index = -1,
- seen = caches[0];
-
- outer:
- while (++index < length && result.length < maxLength) {
- var value = array[index],
- computed = iteratee ? iteratee(value) : value;
-
- value = (comparator || value !== 0) ? value : 0;
- if (!(seen
- ? cacheHas(seen, computed)
- : includes(result, computed, comparator)
- )) {
- othIndex = othLength;
- while (--othIndex) {
- var cache = caches[othIndex];
- if (!(cache
- ? cacheHas(cache, computed)
- : includes(arrays[othIndex], computed, comparator))
- ) {
- continue outer;
- }
- }
- if (seen) {
- seen.push(computed);
- }
- result.push(value);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.invert` and `_.invertBy` which inverts
- * `object` with values transformed by `iteratee` and set by `setter`.
- *
- * @private
- * @param {Object} object The object to iterate over.
- * @param {Function} setter The function to set `accumulator` values.
- * @param {Function} iteratee The iteratee to transform values.
- * @param {Object} accumulator The initial inverted object.
- * @returns {Function} Returns `accumulator`.
- */
- function baseInverter(object, setter, iteratee, accumulator) {
- baseForOwn(object, function(value, key, object) {
- setter(accumulator, iteratee(value), key, object);
- });
- return accumulator;
- }
-
- /**
- * The base implementation of `_.invoke` without support for individual
- * method arguments.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the method to invoke.
- * @param {Array} args The arguments to invoke the method with.
- * @returns {*} Returns the result of the invoked method.
- */
- function baseInvoke(object, path, args) {
- path = castPath(path, object);
- object = parent(object, path);
- var func = object == null ? object : object[toKey(last(path))];
- return func == null ? undefined : apply(func, object, args);
- }
-
- /**
- * The base implementation of `_.isArguments`.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
- */
- function baseIsArguments(value) {
- return isObjectLike(value) && baseGetTag(value) == argsTag;
- }
-
- /**
- * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
- */
- function baseIsArrayBuffer(value) {
- return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
- }
-
- /**
- * The base implementation of `_.isDate` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
- */
- function baseIsDate(value) {
- return isObjectLike(value) && baseGetTag(value) == dateTag;
- }
-
- /**
- * The base implementation of `_.isEqual` which supports partial comparisons
- * and tracks traversed objects.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @param {boolean} bitmask The bitmask flags.
- * 1 - Unordered comparison
- * 2 - Partial comparison
- * @param {Function} [customizer] The function to customize comparisons.
- * @param {Object} [stack] Tracks traversed `value` and `other` objects.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- */
- function baseIsEqual(value, other, bitmask, customizer, stack) {
- if (value === other) {
- return true;
- }
- if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
- return value !== value && other !== other;
- }
- return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
- }
-
- /**
- * A specialized version of `baseIsEqual` for arrays and objects which performs
- * deep comparisons and tracks traversed objects enabling objects with circular
- * references to be compared.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
- * @param {Function} customizer The function to customize comparisons.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Object} [stack] Tracks traversed `object` and `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
- var objIsArr = isArray(object),
- othIsArr = isArray(other),
- objTag = objIsArr ? arrayTag : getTag(object),
- othTag = othIsArr ? arrayTag : getTag(other);
-
- objTag = objTag == argsTag ? objectTag : objTag;
- othTag = othTag == argsTag ? objectTag : othTag;
-
- var objIsObj = objTag == objectTag,
- othIsObj = othTag == objectTag,
- isSameTag = objTag == othTag;
-
- if (isSameTag && isBuffer(object)) {
- if (!isBuffer(other)) {
- return false;
- }
- objIsArr = true;
- objIsObj = false;
- }
- if (isSameTag && !objIsObj) {
- stack || (stack = new Stack);
- return (objIsArr || isTypedArray(object))
- ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
- : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
- }
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
- othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
-
- if (objIsWrapped || othIsWrapped) {
- var objUnwrapped = objIsWrapped ? object.value() : object,
- othUnwrapped = othIsWrapped ? other.value() : other;
-
- stack || (stack = new Stack);
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
- }
- }
- if (!isSameTag) {
- return false;
- }
- stack || (stack = new Stack);
- return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
- }
-
- /**
- * The base implementation of `_.isMap` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
- */
- function baseIsMap(value) {
- return isObjectLike(value) && getTag(value) == mapTag;
- }
-
- /**
- * The base implementation of `_.isMatch` without support for iteratee shorthands.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property values to match.
- * @param {Array} matchData The property names, values, and compare flags to match.
- * @param {Function} [customizer] The function to customize comparisons.
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
- */
- function baseIsMatch(object, source, matchData, customizer) {
- var index = matchData.length,
- length = index,
- noCustomizer = !customizer;
-
- if (object == null) {
- return !length;
- }
- object = Object(object);
- while (index--) {
- var data = matchData[index];
- if ((noCustomizer && data[2])
- ? data[1] !== object[data[0]]
- : !(data[0] in object)
- ) {
- return false;
- }
- }
- while (++index < length) {
- data = matchData[index];
- var key = data[0],
- objValue = object[key],
- srcValue = data[1];
-
- if (noCustomizer && data[2]) {
- if (objValue === undefined && !(key in object)) {
- return false;
- }
- } else {
- var stack = new Stack;
- if (customizer) {
- var result = customizer(objValue, srcValue, key, object, source, stack);
- }
- if (!(result === undefined
- ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
- : result
- )) {
- return false;
- }
- }
- }
- return true;
- }
-
- /**
- * The base implementation of `_.isNative` without bad shim checks.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function,
- * else `false`.
- */
- function baseIsNative(value) {
- if (!isObject(value) || isMasked(value)) {
- return false;
- }
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
- return pattern.test(toSource(value));
- }
-
- /**
- * The base implementation of `_.isRegExp` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
- */
- function baseIsRegExp(value) {
- return isObjectLike(value) && baseGetTag(value) == regexpTag;
- }
-
- /**
- * The base implementation of `_.isSet` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
- */
- function baseIsSet(value) {
- return isObjectLike(value) && getTag(value) == setTag;
- }
-
- /**
- * The base implementation of `_.isTypedArray` without Node.js optimizations.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
- */
- function baseIsTypedArray(value) {
- return isObjectLike(value) &&
- isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
- }
-
- /**
- * The base implementation of `_.iteratee`.
- *
- * @private
- * @param {*} [value=_.identity] The value to convert to an iteratee.
- * @returns {Function} Returns the iteratee.
- */
- function baseIteratee(value) {
- // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
- // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
- if (typeof value == 'function') {
- return value;
- }
- if (value == null) {
- return identity;
- }
- if (typeof value == 'object') {
- return isArray(value)
- ? baseMatchesProperty(value[0], value[1])
- : baseMatches(value);
- }
- return property(value);
- }
-
- /**
- * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
- function baseKeys(object) {
- if (!isPrototype(object)) {
- return nativeKeys(object);
- }
- var result = [];
- for (var key in Object(object)) {
- if (hasOwnProperty.call(object, key) && key != 'constructor') {
- result.push(key);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
- function baseKeysIn(object) {
- if (!isObject(object)) {
- return nativeKeysIn(object);
- }
- var isProto = isPrototype(object),
- result = [];
-
- for (var key in object) {
- if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
- result.push(key);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.lt` which doesn't coerce arguments.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is less than `other`,
- * else `false`.
- */
- function baseLt(value, other) {
- return value < other;
- }
-
- /**
- * The base implementation of `_.map` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} iteratee The function invoked per iteration.
- * @returns {Array} Returns the new mapped array.
- */
- function baseMap(collection, iteratee) {
- var index = -1,
- result = isArrayLike(collection) ? Array(collection.length) : [];
-
- baseEach(collection, function(value, key, collection) {
- result[++index] = iteratee(value, key, collection);
- });
- return result;
- }
-
- /**
- * The base implementation of `_.matches` which doesn't clone `source`.
- *
- * @private
- * @param {Object} source The object of property values to match.
- * @returns {Function} Returns the new spec function.
- */
- function baseMatches(source) {
- var matchData = getMatchData(source);
- if (matchData.length == 1 && matchData[0][2]) {
- return matchesStrictComparable(matchData[0][0], matchData[0][1]);
- }
- return function(object) {
- return object === source || baseIsMatch(object, source, matchData);
- };
- }
-
- /**
- * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
- *
- * @private
- * @param {string} path The path of the property to get.
- * @param {*} srcValue The value to match.
- * @returns {Function} Returns the new spec function.
- */
- function baseMatchesProperty(path, srcValue) {
- if (isKey(path) && isStrictComparable(srcValue)) {
- return matchesStrictComparable(toKey(path), srcValue);
- }
- return function(object) {
- var objValue = get(object, path);
- return (objValue === undefined && objValue === srcValue)
- ? hasIn(object, path)
- : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
- };
- }
-
- /**
- * The base implementation of `_.merge` without support for multiple sources.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @param {number} srcIndex The index of `source`.
- * @param {Function} [customizer] The function to customize merged values.
- * @param {Object} [stack] Tracks traversed source values and their merged
- * counterparts.
- */
- function baseMerge(object, source, srcIndex, customizer, stack) {
- if (object === source) {
- return;
- }
- baseFor(source, function(srcValue, key) {
- stack || (stack = new Stack);
- if (isObject(srcValue)) {
- baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
- }
- else {
- var newValue = customizer
- ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
- : undefined;
-
- if (newValue === undefined) {
- newValue = srcValue;
- }
- assignMergeValue(object, key, newValue);
- }
- }, keysIn);
- }
-
- /**
- * A specialized version of `baseMerge` for arrays and objects which performs
- * deep merges and tracks traversed objects enabling objects with circular
- * references to be merged.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @param {string} key The key of the value to merge.
- * @param {number} srcIndex The index of `source`.
- * @param {Function} mergeFunc The function to merge values.
- * @param {Function} [customizer] The function to customize assigned values.
- * @param {Object} [stack] Tracks traversed source values and their merged
- * counterparts.
- */
- function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
- var objValue = safeGet(object, key),
- srcValue = safeGet(source, key),
- stacked = stack.get(srcValue);
-
- if (stacked) {
- assignMergeValue(object, key, stacked);
- return;
- }
- var newValue = customizer
- ? customizer(objValue, srcValue, (key + ''), object, source, stack)
- : undefined;
-
- var isCommon = newValue === undefined;
-
- if (isCommon) {
- var isArr = isArray(srcValue),
- isBuff = !isArr && isBuffer(srcValue),
- isTyped = !isArr && !isBuff && isTypedArray(srcValue);
-
- newValue = srcValue;
- if (isArr || isBuff || isTyped) {
- if (isArray(objValue)) {
- newValue = objValue;
- }
- else if (isArrayLikeObject(objValue)) {
- newValue = copyArray(objValue);
- }
- else if (isBuff) {
- isCommon = false;
- newValue = cloneBuffer(srcValue, true);
- }
- else if (isTyped) {
- isCommon = false;
- newValue = cloneTypedArray(srcValue, true);
- }
- else {
- newValue = [];
- }
- }
- else if (isPlainObject(srcValue) || isArguments(srcValue)) {
- newValue = objValue;
- if (isArguments(objValue)) {
- newValue = toPlainObject(objValue);
- }
- else if (!isObject(objValue) || isFunction(objValue)) {
- newValue = initCloneObject(srcValue);
- }
- }
- else {
- isCommon = false;
- }
- }
- if (isCommon) {
- // Recursively merge objects and arrays (susceptible to call stack limits).
- stack.set(srcValue, newValue);
- mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
- stack['delete'](srcValue);
- }
- assignMergeValue(object, key, newValue);
- }
-
- /**
- * The base implementation of `_.nth` which doesn't coerce arguments.
- *
- * @private
- * @param {Array} array The array to query.
- * @param {number} n The index of the element to return.
- * @returns {*} Returns the nth element of `array`.
- */
- function baseNth(array, n) {
- var length = array.length;
- if (!length) {
- return;
- }
- n += n < 0 ? length : 0;
- return isIndex(n, length) ? array[n] : undefined;
- }
-
- /**
- * The base implementation of `_.orderBy` without param guards.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
- * @param {string[]} orders The sort orders of `iteratees`.
- * @returns {Array} Returns the new sorted array.
- */
- function baseOrderBy(collection, iteratees, orders) {
- var index = -1;
- iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
-
- var result = baseMap(collection, function(value, key, collection) {
- var criteria = arrayMap(iteratees, function(iteratee) {
- return iteratee(value);
- });
- return { 'criteria': criteria, 'index': ++index, 'value': value };
- });
-
- return baseSortBy(result, function(object, other) {
- return compareMultiple(object, other, orders);
- });
- }
-
- /**
- * The base implementation of `_.pick` without support for individual
- * property identifiers.
- *
- * @private
- * @param {Object} object The source object.
- * @param {string[]} paths The property paths to pick.
- * @returns {Object} Returns the new object.
- */
- function basePick(object, paths) {
- return basePickBy(object, paths, function(value, path) {
- return hasIn(object, path);
- });
- }
-
- /**
- * The base implementation of `_.pickBy` without support for iteratee shorthands.
- *
- * @private
- * @param {Object} object The source object.
- * @param {string[]} paths The property paths to pick.
- * @param {Function} predicate The function invoked per property.
- * @returns {Object} Returns the new object.
- */
- function basePickBy(object, paths, predicate) {
- var index = -1,
- length = paths.length,
- result = {};
-
- while (++index < length) {
- var path = paths[index],
- value = baseGet(object, path);
-
- if (predicate(value, path)) {
- baseSet(result, castPath(path, object), value);
- }
- }
- return result;
- }
-
- /**
- * A specialized version of `baseProperty` which supports deep paths.
- *
- * @private
- * @param {Array|string} path The path of the property to get.
- * @returns {Function} Returns the new accessor function.
- */
- function basePropertyDeep(path) {
- return function(object) {
- return baseGet(object, path);
- };
- }
-
- /**
- * The base implementation of `_.pullAllBy` without support for iteratee
- * shorthands.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {Array} values The values to remove.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns `array`.
- */
- function basePullAll(array, values, iteratee, comparator) {
- var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
- index = -1,
- length = values.length,
- seen = array;
-
- if (array === values) {
- values = copyArray(values);
- }
- if (iteratee) {
- seen = arrayMap(array, baseUnary(iteratee));
- }
- while (++index < length) {
- var fromIndex = 0,
- value = values[index],
- computed = iteratee ? iteratee(value) : value;
-
- while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
- if (seen !== array) {
- splice.call(seen, fromIndex, 1);
- }
- splice.call(array, fromIndex, 1);
- }
- }
- return array;
- }
-
- /**
- * The base implementation of `_.pullAt` without support for individual
- * indexes or capturing the removed elements.
- *
- * @private
- * @param {Array} array The array to modify.
- * @param {number[]} indexes The indexes of elements to remove.
- * @returns {Array} Returns `array`.
- */
- function basePullAt(array, indexes) {
- var length = array ? indexes.length : 0,
- lastIndex = length - 1;
-
- while (length--) {
- var index = indexes[length];
- if (length == lastIndex || index !== previous) {
- var previous = index;
- if (isIndex(index)) {
- splice.call(array, index, 1);
- } else {
- baseUnset(array, index);
- }
- }
- }
- return array;
- }
-
- /**
- * The base implementation of `_.random` without support for returning
- * floating-point numbers.
- *
- * @private
- * @param {number} lower The lower bound.
- * @param {number} upper The upper bound.
- * @returns {number} Returns the random number.
- */
- function baseRandom(lower, upper) {
- return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
- }
-
- /**
- * The base implementation of `_.range` and `_.rangeRight` which doesn't
- * coerce arguments.
- *
- * @private
- * @param {number} start The start of the range.
- * @param {number} end The end of the range.
- * @param {number} step The value to increment or decrement by.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Array} Returns the range of numbers.
- */
- function baseRange(start, end, step, fromRight) {
- var index = -1,
- length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
- result = Array(length);
-
- while (length--) {
- result[fromRight ? length : ++index] = start;
- start += step;
- }
- return result;
- }
-
- /**
- * The base implementation of `_.repeat` which doesn't coerce arguments.
- *
- * @private
- * @param {string} string The string to repeat.
- * @param {number} n The number of times to repeat the string.
- * @returns {string} Returns the repeated string.
- */
- function baseRepeat(string, n) {
- var result = '';
- if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
- return result;
- }
- // Leverage the exponentiation by squaring algorithm for a faster repeat.
- // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
- do {
- if (n % 2) {
- result += string;
- }
- n = nativeFloor(n / 2);
- if (n) {
- string += string;
- }
- } while (n);
-
- return result;
- }
-
- /**
- * The base implementation of `_.rest` which doesn't validate or coerce arguments.
- *
- * @private
- * @param {Function} func The function to apply a rest parameter to.
- * @param {number} [start=func.length-1] The start position of the rest parameter.
- * @returns {Function} Returns the new function.
- */
- function baseRest(func, start) {
- return setToString(overRest(func, start, identity), func + '');
- }
-
- /**
- * The base implementation of `_.sample`.
- *
- * @private
- * @param {Array|Object} collection The collection to sample.
- * @returns {*} Returns the random element.
- */
- function baseSample(collection) {
- return arraySample(values(collection));
- }
-
- /**
- * The base implementation of `_.sampleSize` without param guards.
- *
- * @private
- * @param {Array|Object} collection The collection to sample.
- * @param {number} n The number of elements to sample.
- * @returns {Array} Returns the random elements.
- */
- function baseSampleSize(collection, n) {
- var array = values(collection);
- return shuffleSelf(array, baseClamp(n, 0, array.length));
- }
-
- /**
- * The base implementation of `_.set`.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {*} value The value to set.
- * @param {Function} [customizer] The function to customize path creation.
- * @returns {Object} Returns `object`.
- */
- function baseSet(object, path, value, customizer) {
- if (!isObject(object)) {
- return object;
- }
- path = castPath(path, object);
-
- var index = -1,
- length = path.length,
- lastIndex = length - 1,
- nested = object;
-
- while (nested != null && ++index < length) {
- var key = toKey(path[index]),
- newValue = value;
-
- if (index != lastIndex) {
- var objValue = nested[key];
- newValue = customizer ? customizer(objValue, key, nested) : undefined;
- if (newValue === undefined) {
- newValue = isObject(objValue)
- ? objValue
- : (isIndex(path[index + 1]) ? [] : {});
- }
- }
- assignValue(nested, key, newValue);
- nested = nested[key];
- }
- return object;
- }
-
- /**
- * The base implementation of `setData` without support for hot loop shorting.
- *
- * @private
- * @param {Function} func The function to associate metadata with.
- * @param {*} data The metadata.
- * @returns {Function} Returns `func`.
- */
- var baseSetData = !metaMap ? identity : function(func, data) {
- metaMap.set(func, data);
- return func;
- };
-
- /**
- * The base implementation of `setToString` without support for hot loop shorting.
- *
- * @private
- * @param {Function} func The function to modify.
- * @param {Function} string The `toString` result.
- * @returns {Function} Returns `func`.
- */
- var baseSetToString = !defineProperty ? identity : function(func, string) {
- return defineProperty(func, 'toString', {
- 'configurable': true,
- 'enumerable': false,
- 'value': constant(string),
- 'writable': true
- });
- };
-
- /**
- * The base implementation of `_.shuffle`.
- *
- * @private
- * @param {Array|Object} collection The collection to shuffle.
- * @returns {Array} Returns the new shuffled array.
- */
- function baseShuffle(collection) {
- return shuffleSelf(values(collection));
- }
-
- /**
- * The base implementation of `_.slice` without an iteratee call guard.
- *
- * @private
- * @param {Array} array The array to slice.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns the slice of `array`.
- */
- function baseSlice(array, start, end) {
- var index = -1,
- length = array.length;
-
- if (start < 0) {
- start = -start > length ? 0 : (length + start);
- }
- end = end > length ? length : end;
- if (end < 0) {
- end += length;
- }
- length = start > end ? 0 : ((end - start) >>> 0);
- start >>>= 0;
-
- var result = Array(length);
- while (++index < length) {
- result[index] = array[index + start];
- }
- return result;
- }
-
- /**
- * The base implementation of `_.some` without support for iteratee shorthands.
- *
- * @private
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} predicate The function invoked per iteration.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- */
- function baseSome(collection, predicate) {
- var result;
-
- baseEach(collection, function(value, index, collection) {
- result = predicate(value, index, collection);
- return !result;
- });
- return !!result;
- }
-
- /**
- * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
- * performs a binary search of `array` to determine the index at which `value`
- * should be inserted into `array` in order to maintain its sort order.
- *
- * @private
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {boolean} [retHighest] Specify returning the highest qualified index.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- */
- function baseSortedIndex(array, value, retHighest) {
- var low = 0,
- high = array == null ? low : array.length;
-
- if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
- while (low < high) {
- var mid = (low + high) >>> 1,
- computed = array[mid];
-
- if (computed !== null && !isSymbol(computed) &&
- (retHighest ? (computed <= value) : (computed < value))) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return high;
- }
- return baseSortedIndexBy(array, value, identity, retHighest);
- }
-
- /**
- * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
- * which invokes `iteratee` for `value` and each element of `array` to compute
- * their sort ranking. The iteratee is invoked with one argument; (value).
- *
- * @private
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {Function} iteratee The iteratee invoked per element.
- * @param {boolean} [retHighest] Specify returning the highest qualified index.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- */
- function baseSortedIndexBy(array, value, iteratee, retHighest) {
- value = iteratee(value);
-
- var low = 0,
- high = array == null ? 0 : array.length,
- valIsNaN = value !== value,
- valIsNull = value === null,
- valIsSymbol = isSymbol(value),
- valIsUndefined = value === undefined;
-
- while (low < high) {
- var mid = nativeFloor((low + high) / 2),
- computed = iteratee(array[mid]),
- othIsDefined = computed !== undefined,
- othIsNull = computed === null,
- othIsReflexive = computed === computed,
- othIsSymbol = isSymbol(computed);
-
- if (valIsNaN) {
- var setLow = retHighest || othIsReflexive;
- } else if (valIsUndefined) {
- setLow = othIsReflexive && (retHighest || othIsDefined);
- } else if (valIsNull) {
- setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
- } else if (valIsSymbol) {
- setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
- } else if (othIsNull || othIsSymbol) {
- setLow = false;
- } else {
- setLow = retHighest ? (computed <= value) : (computed < value);
- }
- if (setLow) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return nativeMin(high, MAX_ARRAY_INDEX);
- }
-
- /**
- * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
- * support for iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- */
- function baseSortedUniq(array, iteratee) {
- var index = -1,
- length = array.length,
- resIndex = 0,
- result = [];
-
- while (++index < length) {
- var value = array[index],
- computed = iteratee ? iteratee(value) : value;
-
- if (!index || !eq(computed, seen)) {
- var seen = computed;
- result[resIndex++] = value === 0 ? 0 : value;
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.toNumber` which doesn't ensure correct
- * conversions of binary, hexadecimal, or octal string values.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {number} Returns the number.
- */
- function baseToNumber(value) {
- if (typeof value == 'number') {
- return value;
- }
- if (isSymbol(value)) {
- return NAN;
- }
- return +value;
- }
-
- /**
- * The base implementation of `_.toString` which doesn't convert nullish
- * values to empty strings.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {string} Returns the string.
- */
- function baseToString(value) {
- // Exit early for strings to avoid a performance hit in some environments.
- if (typeof value == 'string') {
- return value;
- }
- if (isArray(value)) {
- // Recursively convert values (susceptible to call stack limits).
- return arrayMap(value, baseToString) + '';
- }
- if (isSymbol(value)) {
- return symbolToString ? symbolToString.call(value) : '';
- }
- var result = (value + '');
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
- }
-
- /**
- * The base implementation of `_.uniqBy` without support for iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- */
- function baseUniq(array, iteratee, comparator) {
- var index = -1,
- includes = arrayIncludes,
- length = array.length,
- isCommon = true,
- result = [],
- seen = result;
-
- if (comparator) {
- isCommon = false;
- includes = arrayIncludesWith;
- }
- else if (length >= LARGE_ARRAY_SIZE) {
- var set = iteratee ? null : createSet(array);
- if (set) {
- return setToArray(set);
- }
- isCommon = false;
- includes = cacheHas;
- seen = new SetCache;
- }
- else {
- seen = iteratee ? [] : result;
- }
- outer:
- while (++index < length) {
- var value = array[index],
- computed = iteratee ? iteratee(value) : value;
-
- value = (comparator || value !== 0) ? value : 0;
- if (isCommon && computed === computed) {
- var seenIndex = seen.length;
- while (seenIndex--) {
- if (seen[seenIndex] === computed) {
- continue outer;
- }
- }
- if (iteratee) {
- seen.push(computed);
- }
- result.push(value);
- }
- else if (!includes(seen, computed, comparator)) {
- if (seen !== result) {
- seen.push(computed);
- }
- result.push(value);
- }
- }
- return result;
- }
-
- /**
- * The base implementation of `_.unset`.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {Array|string} path The property path to unset.
- * @returns {boolean} Returns `true` if the property is deleted, else `false`.
- */
- function baseUnset(object, path) {
- path = castPath(path, object);
- object = parent(object, path);
- return object == null || delete object[toKey(last(path))];
- }
-
- /**
- * The base implementation of `_.update`.
- *
- * @private
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to update.
- * @param {Function} updater The function to produce the updated value.
- * @param {Function} [customizer] The function to customize path creation.
- * @returns {Object} Returns `object`.
- */
- function baseUpdate(object, path, updater, customizer) {
- return baseSet(object, path, updater(baseGet(object, path)), customizer);
- }
-
- /**
- * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
- * without support for iteratee shorthands.
- *
- * @private
- * @param {Array} array The array to query.
- * @param {Function} predicate The function invoked per iteration.
- * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Array} Returns the slice of `array`.
- */
- function baseWhile(array, predicate, isDrop, fromRight) {
- var length = array.length,
- index = fromRight ? length : -1;
-
- while ((fromRight ? index-- : ++index < length) &&
- predicate(array[index], index, array)) {}
-
- return isDrop
- ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
- : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
- }
-
- /**
- * The base implementation of `wrapperValue` which returns the result of
- * performing a sequence of actions on the unwrapped `value`, where each
- * successive action is supplied the return value of the previous.
- *
- * @private
- * @param {*} value The unwrapped value.
- * @param {Array} actions Actions to perform to resolve the unwrapped value.
- * @returns {*} Returns the resolved value.
- */
- function baseWrapperValue(value, actions) {
- var result = value;
- if (result instanceof LazyWrapper) {
- result = result.value();
- }
- return arrayReduce(actions, function(result, action) {
- return action.func.apply(action.thisArg, arrayPush([result], action.args));
- }, result);
- }
-
- /**
- * The base implementation of methods like `_.xor`, without support for
- * iteratee shorthands, that accepts an array of arrays to inspect.
- *
- * @private
- * @param {Array} arrays The arrays to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of values.
- */
- function baseXor(arrays, iteratee, comparator) {
- var length = arrays.length;
- if (length < 2) {
- return length ? baseUniq(arrays[0]) : [];
- }
- var index = -1,
- result = Array(length);
-
- while (++index < length) {
- var array = arrays[index],
- othIndex = -1;
-
- while (++othIndex < length) {
- if (othIndex != index) {
- result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
- }
- }
- }
- return baseUniq(baseFlatten(result, 1), iteratee, comparator);
- }
-
- /**
- * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
- *
- * @private
- * @param {Array} props The property identifiers.
- * @param {Array} values The property values.
- * @param {Function} assignFunc The function to assign values.
- * @returns {Object} Returns the new object.
- */
- function baseZipObject(props, values, assignFunc) {
- var index = -1,
- length = props.length,
- valsLength = values.length,
- result = {};
-
- while (++index < length) {
- var value = index < valsLength ? values[index] : undefined;
- assignFunc(result, props[index], value);
- }
- return result;
- }
-
- /**
- * Casts `value` to an empty array if it's not an array like object.
- *
- * @private
- * @param {*} value The value to inspect.
- * @returns {Array|Object} Returns the cast array-like object.
- */
- function castArrayLikeObject(value) {
- return isArrayLikeObject(value) ? value : [];
- }
-
- /**
- * Casts `value` to `identity` if it's not a function.
- *
- * @private
- * @param {*} value The value to inspect.
- * @returns {Function} Returns cast function.
- */
- function castFunction(value) {
- return typeof value == 'function' ? value : identity;
- }
-
- /**
- * Casts `value` to a path array if it's not one.
- *
- * @private
- * @param {*} value The value to inspect.
- * @param {Object} [object] The object to query keys on.
- * @returns {Array} Returns the cast property path array.
- */
- function castPath(value, object) {
- if (isArray(value)) {
- return value;
- }
- return isKey(value, object) ? [value] : stringToPath(toString(value));
- }
-
- /**
- * A `baseRest` alias which can be replaced with `identity` by module
- * replacement plugins.
- *
- * @private
- * @type {Function}
- * @param {Function} func The function to apply a rest parameter to.
- * @returns {Function} Returns the new function.
- */
- var castRest = baseRest;
-
- /**
- * Casts `array` to a slice if it's needed.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {number} start The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns the cast slice.
- */
- function castSlice(array, start, end) {
- var length = array.length;
- end = end === undefined ? length : end;
- return (!start && end >= length) ? array : baseSlice(array, start, end);
- }
-
- /**
- * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
- *
- * @private
- * @param {number|Object} id The timer id or timeout object of the timer to clear.
- */
- var clearTimeout = ctxClearTimeout || function(id) {
- return root.clearTimeout(id);
- };
-
- /**
- * Creates a clone of `buffer`.
- *
- * @private
- * @param {Buffer} buffer The buffer to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Buffer} Returns the cloned buffer.
- */
- function cloneBuffer(buffer, isDeep) {
- if (isDeep) {
- return buffer.slice();
- }
- var length = buffer.length,
- result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
-
- buffer.copy(result);
- return result;
- }
-
- /**
- * Creates a clone of `arrayBuffer`.
- *
- * @private
- * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
- * @returns {ArrayBuffer} Returns the cloned array buffer.
- */
- function cloneArrayBuffer(arrayBuffer) {
- var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
- new Uint8Array(result).set(new Uint8Array(arrayBuffer));
- return result;
- }
-
- /**
- * Creates a clone of `dataView`.
- *
- * @private
- * @param {Object} dataView The data view to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned data view.
- */
- function cloneDataView(dataView, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
- }
-
- /**
- * Creates a clone of `regexp`.
- *
- * @private
- * @param {Object} regexp The regexp to clone.
- * @returns {Object} Returns the cloned regexp.
- */
- function cloneRegExp(regexp) {
- var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
- result.lastIndex = regexp.lastIndex;
- return result;
- }
-
- /**
- * Creates a clone of the `symbol` object.
- *
- * @private
- * @param {Object} symbol The symbol object to clone.
- * @returns {Object} Returns the cloned symbol object.
- */
- function cloneSymbol(symbol) {
- return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
- }
-
- /**
- * Creates a clone of `typedArray`.
- *
- * @private
- * @param {Object} typedArray The typed array to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the cloned typed array.
- */
- function cloneTypedArray(typedArray, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
- }
-
- /**
- * Compares values to sort them in ascending order.
- *
- * @private
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {number} Returns the sort order indicator for `value`.
- */
- function compareAscending(value, other) {
- if (value !== other) {
- var valIsDefined = value !== undefined,
- valIsNull = value === null,
- valIsReflexive = value === value,
- valIsSymbol = isSymbol(value);
-
- var othIsDefined = other !== undefined,
- othIsNull = other === null,
- othIsReflexive = other === other,
- othIsSymbol = isSymbol(other);
-
- if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
- (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
- (valIsNull && othIsDefined && othIsReflexive) ||
- (!valIsDefined && othIsReflexive) ||
- !valIsReflexive) {
- return 1;
- }
- if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
- (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
- (othIsNull && valIsDefined && valIsReflexive) ||
- (!othIsDefined && valIsReflexive) ||
- !othIsReflexive) {
- return -1;
- }
- }
- return 0;
- }
-
- /**
- * Used by `_.orderBy` to compare multiple properties of a value to another
- * and stable sort them.
- *
- * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
- * specify an order of "desc" for descending or "asc" for ascending sort order
- * of corresponding values.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {boolean[]|string[]} orders The order to sort by for each property.
- * @returns {number} Returns the sort order indicator for `object`.
- */
- function compareMultiple(object, other, orders) {
- var index = -1,
- objCriteria = object.criteria,
- othCriteria = other.criteria,
- length = objCriteria.length,
- ordersLength = orders.length;
-
- while (++index < length) {
- var result = compareAscending(objCriteria[index], othCriteria[index]);
- if (result) {
- if (index >= ordersLength) {
- return result;
- }
- var order = orders[index];
- return result * (order == 'desc' ? -1 : 1);
- }
- }
- // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
- // that causes it, under certain circumstances, to provide the same value for
- // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
- // for more details.
- //
- // This also ensures a stable sort in V8 and other engines.
- // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
- return object.index - other.index;
- }
-
- /**
- * Creates an array that is the composition of partially applied arguments,
- * placeholders, and provided arguments into a single array of arguments.
- *
- * @private
- * @param {Array} args The provided arguments.
- * @param {Array} partials The arguments to prepend to those provided.
- * @param {Array} holders The `partials` placeholder indexes.
- * @params {boolean} [isCurried] Specify composing for a curried function.
- * @returns {Array} Returns the new array of composed arguments.
- */
- function composeArgs(args, partials, holders, isCurried) {
- var argsIndex = -1,
- argsLength = args.length,
- holdersLength = holders.length,
- leftIndex = -1,
- leftLength = partials.length,
- rangeLength = nativeMax(argsLength - holdersLength, 0),
- result = Array(leftLength + rangeLength),
- isUncurried = !isCurried;
-
- while (++leftIndex < leftLength) {
- result[leftIndex] = partials[leftIndex];
- }
- while (++argsIndex < holdersLength) {
- if (isUncurried || argsIndex < argsLength) {
- result[holders[argsIndex]] = args[argsIndex];
- }
- }
- while (rangeLength--) {
- result[leftIndex++] = args[argsIndex++];
- }
- return result;
- }
-
- /**
- * This function is like `composeArgs` except that the arguments composition
- * is tailored for `_.partialRight`.
- *
- * @private
- * @param {Array} args The provided arguments.
- * @param {Array} partials The arguments to append to those provided.
- * @param {Array} holders The `partials` placeholder indexes.
- * @params {boolean} [isCurried] Specify composing for a curried function.
- * @returns {Array} Returns the new array of composed arguments.
- */
- function composeArgsRight(args, partials, holders, isCurried) {
- var argsIndex = -1,
- argsLength = args.length,
- holdersIndex = -1,
- holdersLength = holders.length,
- rightIndex = -1,
- rightLength = partials.length,
- rangeLength = nativeMax(argsLength - holdersLength, 0),
- result = Array(rangeLength + rightLength),
- isUncurried = !isCurried;
-
- while (++argsIndex < rangeLength) {
- result[argsIndex] = args[argsIndex];
- }
- var offset = argsIndex;
- while (++rightIndex < rightLength) {
- result[offset + rightIndex] = partials[rightIndex];
- }
- while (++holdersIndex < holdersLength) {
- if (isUncurried || argsIndex < argsLength) {
- result[offset + holders[holdersIndex]] = args[argsIndex++];
- }
- }
- return result;
- }
-
- /**
- * Copies the values of `source` to `array`.
- *
- * @private
- * @param {Array} source The array to copy values from.
- * @param {Array} [array=[]] The array to copy values to.
- * @returns {Array} Returns `array`.
- */
- function copyArray(source, array) {
- var index = -1,
- length = source.length;
-
- array || (array = Array(length));
- while (++index < length) {
- array[index] = source[index];
- }
- return array;
- }
-
- /**
- * Copies properties of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy properties from.
- * @param {Array} props The property identifiers to copy.
- * @param {Object} [object={}] The object to copy properties to.
- * @param {Function} [customizer] The function to customize copied values.
- * @returns {Object} Returns `object`.
- */
- function copyObject(source, props, object, customizer) {
- var isNew = !object;
- object || (object = {});
-
- var index = -1,
- length = props.length;
-
- while (++index < length) {
- var key = props[index];
-
- var newValue = customizer
- ? customizer(object[key], source[key], key, object, source)
- : undefined;
-
- if (newValue === undefined) {
- newValue = source[key];
- }
- if (isNew) {
- baseAssignValue(object, key, newValue);
- } else {
- assignValue(object, key, newValue);
- }
- }
- return object;
- }
-
- /**
- * Copies own symbols of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy symbols from.
- * @param {Object} [object={}] The object to copy symbols to.
- * @returns {Object} Returns `object`.
- */
- function copySymbols(source, object) {
- return copyObject(source, getSymbols(source), object);
- }
-
- /**
- * Copies own and inherited symbols of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy symbols from.
- * @param {Object} [object={}] The object to copy symbols to.
- * @returns {Object} Returns `object`.
- */
- function copySymbolsIn(source, object) {
- return copyObject(source, getSymbolsIn(source), object);
- }
-
- /**
- * Creates a function like `_.groupBy`.
- *
- * @private
- * @param {Function} setter The function to set accumulator values.
- * @param {Function} [initializer] The accumulator object initializer.
- * @returns {Function} Returns the new aggregator function.
- */
- function createAggregator(setter, initializer) {
- return function(collection, iteratee) {
- var func = isArray(collection) ? arrayAggregator : baseAggregator,
- accumulator = initializer ? initializer() : {};
-
- return func(collection, setter, getIteratee(iteratee, 2), accumulator);
- };
- }
-
- /**
- * Creates a function like `_.assign`.
- *
- * @private
- * @param {Function} assigner The function to assign values.
- * @returns {Function} Returns the new assigner function.
- */
- function createAssigner(assigner) {
- return baseRest(function(object, sources) {
- var index = -1,
- length = sources.length,
- customizer = length > 1 ? sources[length - 1] : undefined,
- guard = length > 2 ? sources[2] : undefined;
-
- customizer = (assigner.length > 3 && typeof customizer == 'function')
- ? (length--, customizer)
- : undefined;
-
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- customizer = length < 3 ? undefined : customizer;
- length = 1;
- }
- object = Object(object);
- while (++index < length) {
- var source = sources[index];
- if (source) {
- assigner(object, source, index, customizer);
- }
- }
- return object;
- });
- }
-
- /**
- * Creates a `baseEach` or `baseEachRight` function.
- *
- * @private
- * @param {Function} eachFunc The function to iterate over a collection.
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new base function.
- */
- function createBaseEach(eachFunc, fromRight) {
- return function(collection, iteratee) {
- if (collection == null) {
- return collection;
- }
- if (!isArrayLike(collection)) {
- return eachFunc(collection, iteratee);
- }
- var length = collection.length,
- index = fromRight ? length : -1,
- iterable = Object(collection);
-
- while ((fromRight ? index-- : ++index < length)) {
- if (iteratee(iterable[index], index, iterable) === false) {
- break;
- }
- }
- return collection;
- };
- }
-
- /**
- * Creates a base function for methods like `_.forIn` and `_.forOwn`.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new base function.
- */
- function createBaseFor(fromRight) {
- return function(object, iteratee, keysFunc) {
- var index = -1,
- iterable = Object(object),
- props = keysFunc(object),
- length = props.length;
-
- while (length--) {
- var key = props[fromRight ? length : ++index];
- if (iteratee(iterable[key], key, iterable) === false) {
- break;
- }
- }
- return object;
- };
- }
-
- /**
- * Creates a function that wraps `func` to invoke it with the optional `this`
- * binding of `thisArg`.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createBind(func, bitmask, thisArg) {
- var isBind = bitmask & WRAP_BIND_FLAG,
- Ctor = createCtor(func);
-
- function wrapper() {
- var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
- return fn.apply(isBind ? thisArg : this, arguments);
- }
- return wrapper;
- }
-
- /**
- * Creates a function like `_.lowerFirst`.
- *
- * @private
- * @param {string} methodName The name of the `String` case method to use.
- * @returns {Function} Returns the new case function.
- */
- function createCaseFirst(methodName) {
- return function(string) {
- string = toString(string);
-
- var strSymbols = hasUnicode(string)
- ? stringToArray(string)
- : undefined;
-
- var chr = strSymbols
- ? strSymbols[0]
- : string.charAt(0);
-
- var trailing = strSymbols
- ? castSlice(strSymbols, 1).join('')
- : string.slice(1);
-
- return chr[methodName]() + trailing;
- };
- }
-
- /**
- * Creates a function like `_.camelCase`.
- *
- * @private
- * @param {Function} callback The function to combine each word.
- * @returns {Function} Returns the new compounder function.
- */
- function createCompounder(callback) {
- return function(string) {
- return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
- };
- }
-
- /**
- * Creates a function that produces an instance of `Ctor` regardless of
- * whether it was invoked as part of a `new` expression or by `call` or `apply`.
- *
- * @private
- * @param {Function} Ctor The constructor to wrap.
- * @returns {Function} Returns the new wrapped function.
- */
- function createCtor(Ctor) {
- return function() {
- // Use a `switch` statement to work with class constructors. See
- // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
- // for more details.
- var args = arguments;
- switch (args.length) {
- case 0: return new Ctor;
- case 1: return new Ctor(args[0]);
- case 2: return new Ctor(args[0], args[1]);
- case 3: return new Ctor(args[0], args[1], args[2]);
- case 4: return new Ctor(args[0], args[1], args[2], args[3]);
- case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
- case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
- case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
- }
- var thisBinding = baseCreate(Ctor.prototype),
- result = Ctor.apply(thisBinding, args);
-
- // Mimic the constructor's `return` behavior.
- // See https://es5.github.io/#x13.2.2 for more details.
- return isObject(result) ? result : thisBinding;
- };
- }
-
- /**
- * Creates a function that wraps `func` to enable currying.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {number} arity The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createCurry(func, bitmask, arity) {
- var Ctor = createCtor(func);
-
- function wrapper() {
- var length = arguments.length,
- args = Array(length),
- index = length,
- placeholder = getHolder(wrapper);
-
- while (index--) {
- args[index] = arguments[index];
- }
- var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
- ? []
- : replaceHolders(args, placeholder);
-
- length -= holders.length;
- if (length < arity) {
- return createRecurry(
- func, bitmask, createHybrid, wrapper.placeholder, undefined,
- args, holders, undefined, undefined, arity - length);
- }
- var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
- return apply(fn, this, args);
- }
- return wrapper;
- }
-
- /**
- * Creates a `_.find` or `_.findLast` function.
- *
- * @private
- * @param {Function} findIndexFunc The function to find the collection index.
- * @returns {Function} Returns the new find function.
- */
- function createFind(findIndexFunc) {
- return function(collection, predicate, fromIndex) {
- var iterable = Object(collection);
- if (!isArrayLike(collection)) {
- var iteratee = getIteratee(predicate, 3);
- collection = keys(collection);
- predicate = function(key) { return iteratee(iterable[key], key, iterable); };
- }
- var index = findIndexFunc(collection, predicate, fromIndex);
- return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
- };
- }
-
- /**
- * Creates a `_.flow` or `_.flowRight` function.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new flow function.
- */
- function createFlow(fromRight) {
- return flatRest(function(funcs) {
- var length = funcs.length,
- index = length,
- prereq = LodashWrapper.prototype.thru;
-
- if (fromRight) {
- funcs.reverse();
- }
- while (index--) {
- var func = funcs[index];
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
- var wrapper = new LodashWrapper([], true);
- }
- }
- index = wrapper ? index : length;
- while (++index < length) {
- func = funcs[index];
-
- var funcName = getFuncName(func),
- data = funcName == 'wrapper' ? getData(func) : undefined;
-
- if (data && isLaziable(data[0]) &&
- data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
- !data[4].length && data[9] == 1
- ) {
- wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
- } else {
- wrapper = (func.length == 1 && isLaziable(func))
- ? wrapper[funcName]()
- : wrapper.thru(func);
- }
- }
- return function() {
- var args = arguments,
- value = args[0];
-
- if (wrapper && args.length == 1 && isArray(value)) {
- return wrapper.plant(value).value();
- }
- var index = 0,
- result = length ? funcs[index].apply(this, args) : value;
-
- while (++index < length) {
- result = funcs[index].call(this, result);
- }
- return result;
- };
- });
- }
-
- /**
- * Creates a function that wraps `func` to invoke it with optional `this`
- * binding of `thisArg`, partial application, and currying.
- *
- * @private
- * @param {Function|string} func The function or method name to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {Array} [partials] The arguments to prepend to those provided to
- * the new function.
- * @param {Array} [holders] The `partials` placeholder indexes.
- * @param {Array} [partialsRight] The arguments to append to those provided
- * to the new function.
- * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
- * @param {Array} [argPos] The argument positions of the new function.
- * @param {number} [ary] The arity cap of `func`.
- * @param {number} [arity] The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
- var isAry = bitmask & WRAP_ARY_FLAG,
- isBind = bitmask & WRAP_BIND_FLAG,
- isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
- isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
- isFlip = bitmask & WRAP_FLIP_FLAG,
- Ctor = isBindKey ? undefined : createCtor(func);
-
- function wrapper() {
- var length = arguments.length,
- args = Array(length),
- index = length;
-
- while (index--) {
- args[index] = arguments[index];
- }
- if (isCurried) {
- var placeholder = getHolder(wrapper),
- holdersCount = countHolders(args, placeholder);
- }
- if (partials) {
- args = composeArgs(args, partials, holders, isCurried);
- }
- if (partialsRight) {
- args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
- }
- length -= holdersCount;
- if (isCurried && length < arity) {
- var newHolders = replaceHolders(args, placeholder);
- return createRecurry(
- func, bitmask, createHybrid, wrapper.placeholder, thisArg,
- args, newHolders, argPos, ary, arity - length
- );
- }
- var thisBinding = isBind ? thisArg : this,
- fn = isBindKey ? thisBinding[func] : func;
-
- length = args.length;
- if (argPos) {
- args = reorder(args, argPos);
- } else if (isFlip && length > 1) {
- args.reverse();
- }
- if (isAry && ary < length) {
- args.length = ary;
- }
- if (this && this !== root && this instanceof wrapper) {
- fn = Ctor || createCtor(fn);
- }
- return fn.apply(thisBinding, args);
- }
- return wrapper;
- }
-
- /**
- * Creates a function like `_.invertBy`.
- *
- * @private
- * @param {Function} setter The function to set accumulator values.
- * @param {Function} toIteratee The function to resolve iteratees.
- * @returns {Function} Returns the new inverter function.
- */
- function createInverter(setter, toIteratee) {
- return function(object, iteratee) {
- return baseInverter(object, setter, toIteratee(iteratee), {});
- };
- }
-
- /**
- * Creates a function that performs a mathematical operation on two values.
- *
- * @private
- * @param {Function} operator The function to perform the operation.
- * @param {number} [defaultValue] The value used for `undefined` arguments.
- * @returns {Function} Returns the new mathematical operation function.
- */
- function createMathOperation(operator, defaultValue) {
- return function(value, other) {
- var result;
- if (value === undefined && other === undefined) {
- return defaultValue;
- }
- if (value !== undefined) {
- result = value;
- }
- if (other !== undefined) {
- if (result === undefined) {
- return other;
- }
- if (typeof value == 'string' || typeof other == 'string') {
- value = baseToString(value);
- other = baseToString(other);
- } else {
- value = baseToNumber(value);
- other = baseToNumber(other);
- }
- result = operator(value, other);
- }
- return result;
- };
- }
-
- /**
- * Creates a function like `_.over`.
- *
- * @private
- * @param {Function} arrayFunc The function to iterate over iteratees.
- * @returns {Function} Returns the new over function.
- */
- function createOver(arrayFunc) {
- return flatRest(function(iteratees) {
- iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
- return baseRest(function(args) {
- var thisArg = this;
- return arrayFunc(iteratees, function(iteratee) {
- return apply(iteratee, thisArg, args);
- });
- });
- });
- }
-
- /**
- * Creates the padding for `string` based on `length`. The `chars` string
- * is truncated if the number of characters exceeds `length`.
- *
- * @private
- * @param {number} length The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padding for `string`.
- */
- function createPadding(length, chars) {
- chars = chars === undefined ? ' ' : baseToString(chars);
-
- var charsLength = chars.length;
- if (charsLength < 2) {
- return charsLength ? baseRepeat(chars, length) : chars;
- }
- var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
- return hasUnicode(chars)
- ? castSlice(stringToArray(result), 0, length).join('')
- : result.slice(0, length);
- }
-
- /**
- * Creates a function that wraps `func` to invoke it with the `this` binding
- * of `thisArg` and `partials` prepended to the arguments it receives.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {Array} partials The arguments to prepend to those provided to
- * the new function.
- * @returns {Function} Returns the new wrapped function.
- */
- function createPartial(func, bitmask, thisArg, partials) {
- var isBind = bitmask & WRAP_BIND_FLAG,
- Ctor = createCtor(func);
-
- function wrapper() {
- var argsIndex = -1,
- argsLength = arguments.length,
- leftIndex = -1,
- leftLength = partials.length,
- args = Array(leftLength + argsLength),
- fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
-
- while (++leftIndex < leftLength) {
- args[leftIndex] = partials[leftIndex];
- }
- while (argsLength--) {
- args[leftIndex++] = arguments[++argsIndex];
- }
- return apply(fn, isBind ? thisArg : this, args);
- }
- return wrapper;
- }
-
- /**
- * Creates a `_.range` or `_.rangeRight` function.
- *
- * @private
- * @param {boolean} [fromRight] Specify iterating from right to left.
- * @returns {Function} Returns the new range function.
- */
- function createRange(fromRight) {
- return function(start, end, step) {
- if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
- end = step = undefined;
- }
- // Ensure the sign of `-0` is preserved.
- start = toFinite(start);
- if (end === undefined) {
- end = start;
- start = 0;
- } else {
- end = toFinite(end);
- }
- step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
- return baseRange(start, end, step, fromRight);
- };
- }
-
- /**
- * Creates a function that performs a relational operation on two values.
- *
- * @private
- * @param {Function} operator The function to perform the operation.
- * @returns {Function} Returns the new relational operation function.
- */
- function createRelationalOperation(operator) {
- return function(value, other) {
- if (!(typeof value == 'string' && typeof other == 'string')) {
- value = toNumber(value);
- other = toNumber(other);
- }
- return operator(value, other);
- };
- }
-
- /**
- * Creates a function that wraps `func` to continue currying.
- *
- * @private
- * @param {Function} func The function to wrap.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @param {Function} wrapFunc The function to create the `func` wrapper.
- * @param {*} placeholder The placeholder value.
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {Array} [partials] The arguments to prepend to those provided to
- * the new function.
- * @param {Array} [holders] The `partials` placeholder indexes.
- * @param {Array} [argPos] The argument positions of the new function.
- * @param {number} [ary] The arity cap of `func`.
- * @param {number} [arity] The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
- var isCurry = bitmask & WRAP_CURRY_FLAG,
- newHolders = isCurry ? holders : undefined,
- newHoldersRight = isCurry ? undefined : holders,
- newPartials = isCurry ? partials : undefined,
- newPartialsRight = isCurry ? undefined : partials;
-
- bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
- bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
-
- if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
- bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
- }
- var newData = [
- func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
- newHoldersRight, argPos, ary, arity
- ];
-
- var result = wrapFunc.apply(undefined, newData);
- if (isLaziable(func)) {
- setData(result, newData);
- }
- result.placeholder = placeholder;
- return setWrapToString(result, func, bitmask);
- }
-
- /**
- * Creates a function like `_.round`.
- *
- * @private
- * @param {string} methodName The name of the `Math` method to use when rounding.
- * @returns {Function} Returns the new round function.
- */
- function createRound(methodName) {
- var func = Math[methodName];
- return function(number, precision) {
- number = toNumber(number);
- precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
- if (precision && nativeIsFinite(number)) {
- // Shift with exponential notation to avoid floating-point issues.
- // See [MDN](https://mdn.io/round#Examples) for more details.
- var pair = (toString(number) + 'e').split('e'),
- value = func(pair[0] + 'e' + (+pair[1] + precision));
-
- pair = (toString(value) + 'e').split('e');
- return +(pair[0] + 'e' + (+pair[1] - precision));
- }
- return func(number);
- };
- }
-
- /**
- * Creates a set object of `values`.
- *
- * @private
- * @param {Array} values The values to add to the set.
- * @returns {Object} Returns the new set.
- */
- var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
- return new Set(values);
- };
-
- /**
- * Creates a `_.toPairs` or `_.toPairsIn` function.
- *
- * @private
- * @param {Function} keysFunc The function to get the keys of a given object.
- * @returns {Function} Returns the new pairs function.
- */
- function createToPairs(keysFunc) {
- return function(object) {
- var tag = getTag(object);
- if (tag == mapTag) {
- return mapToArray(object);
- }
- if (tag == setTag) {
- return setToPairs(object);
- }
- return baseToPairs(object, keysFunc(object));
- };
- }
-
- /**
- * Creates a function that either curries or invokes `func` with optional
- * `this` binding and partially applied arguments.
- *
- * @private
- * @param {Function|string} func The function or method name to wrap.
- * @param {number} bitmask The bitmask flags.
- * 1 - `_.bind`
- * 2 - `_.bindKey`
- * 4 - `_.curry` or `_.curryRight` of a bound function
- * 8 - `_.curry`
- * 16 - `_.curryRight`
- * 32 - `_.partial`
- * 64 - `_.partialRight`
- * 128 - `_.rearg`
- * 256 - `_.ary`
- * 512 - `_.flip`
- * @param {*} [thisArg] The `this` binding of `func`.
- * @param {Array} [partials] The arguments to be partially applied.
- * @param {Array} [holders] The `partials` placeholder indexes.
- * @param {Array} [argPos] The argument positions of the new function.
- * @param {number} [ary] The arity cap of `func`.
- * @param {number} [arity] The arity of `func`.
- * @returns {Function} Returns the new wrapped function.
- */
- function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
- var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
- if (!isBindKey && typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- var length = partials ? partials.length : 0;
- if (!length) {
- bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
- partials = holders = undefined;
- }
- ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
- arity = arity === undefined ? arity : toInteger(arity);
- length -= holders ? holders.length : 0;
-
- if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
- var partialsRight = partials,
- holdersRight = holders;
-
- partials = holders = undefined;
- }
- var data = isBindKey ? undefined : getData(func);
-
- var newData = [
- func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
- argPos, ary, arity
- ];
-
- if (data) {
- mergeData(newData, data);
- }
- func = newData[0];
- bitmask = newData[1];
- thisArg = newData[2];
- partials = newData[3];
- holders = newData[4];
- arity = newData[9] = newData[9] === undefined
- ? (isBindKey ? 0 : func.length)
- : nativeMax(newData[9] - length, 0);
-
- if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
- bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
- }
- if (!bitmask || bitmask == WRAP_BIND_FLAG) {
- var result = createBind(func, bitmask, thisArg);
- } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
- result = createCurry(func, bitmask, arity);
- } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
- result = createPartial(func, bitmask, thisArg, partials);
- } else {
- result = createHybrid.apply(undefined, newData);
- }
- var setter = data ? baseSetData : setData;
- return setWrapToString(setter(result, newData), func, bitmask);
- }
-
- /**
- * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
- * of source objects to the destination object for all destination properties
- * that resolve to `undefined`.
- *
- * @private
- * @param {*} objValue The destination value.
- * @param {*} srcValue The source value.
- * @param {string} key The key of the property to assign.
- * @param {Object} object The parent object of `objValue`.
- * @returns {*} Returns the value to assign.
- */
- function customDefaultsAssignIn(objValue, srcValue, key, object) {
- if (objValue === undefined ||
- (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
- return srcValue;
- }
- return objValue;
- }
-
- /**
- * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
- * objects into destination objects that are passed thru.
- *
- * @private
- * @param {*} objValue The destination value.
- * @param {*} srcValue The source value.
- * @param {string} key The key of the property to merge.
- * @param {Object} object The parent object of `objValue`.
- * @param {Object} source The parent object of `srcValue`.
- * @param {Object} [stack] Tracks traversed source values and their merged
- * counterparts.
- * @returns {*} Returns the value to assign.
- */
- function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
- if (isObject(objValue) && isObject(srcValue)) {
- // Recursively merge objects and arrays (susceptible to call stack limits).
- stack.set(srcValue, objValue);
- baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
- stack['delete'](srcValue);
- }
- return objValue;
- }
-
- /**
- * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
- * objects.
- *
- * @private
- * @param {*} value The value to inspect.
- * @param {string} key The key of the property to inspect.
- * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
- */
- function customOmitClone(value) {
- return isPlainObject(value) ? undefined : value;
- }
-
- /**
- * A specialized version of `baseIsEqualDeep` for arrays with support for
- * partial deep comparisons.
- *
- * @private
- * @param {Array} array The array to compare.
- * @param {Array} other The other array to compare.
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
- * @param {Function} customizer The function to customize comparisons.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Object} stack Tracks traversed `array` and `other` objects.
- * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
- */
- function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
- arrLength = array.length,
- othLength = other.length;
-
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
- return false;
- }
- // Assume cyclic values are equal.
- var stacked = stack.get(array);
- if (stacked && stack.get(other)) {
- return stacked == other;
- }
- var index = -1,
- result = true,
- seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
-
- stack.set(array, other);
- stack.set(other, array);
-
- // Ignore non-index properties.
- while (++index < arrLength) {
- var arrValue = array[index],
- othValue = other[index];
-
- if (customizer) {
- var compared = isPartial
- ? customizer(othValue, arrValue, index, other, array, stack)
- : customizer(arrValue, othValue, index, array, other, stack);
- }
- if (compared !== undefined) {
- if (compared) {
- continue;
- }
- result = false;
- break;
- }
- // Recursively compare arrays (susceptible to call stack limits).
- if (seen) {
- if (!arraySome(other, function(othValue, othIndex) {
- if (!cacheHas(seen, othIndex) &&
- (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
- return seen.push(othIndex);
- }
- })) {
- result = false;
- break;
- }
- } else if (!(
- arrValue === othValue ||
- equalFunc(arrValue, othValue, bitmask, customizer, stack)
- )) {
- result = false;
- break;
- }
- }
- stack['delete'](array);
- stack['delete'](other);
- return result;
- }
-
- /**
- * A specialized version of `baseIsEqualDeep` for comparing objects of
- * the same `toStringTag`.
- *
- * **Note:** This function only supports comparing values with tags of
- * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {string} tag The `toStringTag` of the objects to compare.
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
- * @param {Function} customizer The function to customize comparisons.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Object} stack Tracks traversed `object` and `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
- switch (tag) {
- case dataViewTag:
- if ((object.byteLength != other.byteLength) ||
- (object.byteOffset != other.byteOffset)) {
- return false;
- }
- object = object.buffer;
- other = other.buffer;
-
- case arrayBufferTag:
- if ((object.byteLength != other.byteLength) ||
- !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
- return false;
- }
- return true;
-
- case boolTag:
- case dateTag:
- case numberTag:
- // Coerce booleans to `1` or `0` and dates to milliseconds.
- // Invalid dates are coerced to `NaN`.
- return eq(+object, +other);
-
- case errorTag:
- return object.name == other.name && object.message == other.message;
-
- case regexpTag:
- case stringTag:
- // Coerce regexes to strings and treat strings, primitives and objects,
- // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
- // for more details.
- return object == (other + '');
-
- case mapTag:
- var convert = mapToArray;
-
- case setTag:
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
- convert || (convert = setToArray);
-
- if (object.size != other.size && !isPartial) {
- return false;
- }
- // Assume cyclic values are equal.
- var stacked = stack.get(object);
- if (stacked) {
- return stacked == other;
- }
- bitmask |= COMPARE_UNORDERED_FLAG;
-
- // Recursively compare objects (susceptible to call stack limits).
- stack.set(object, other);
- var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
- stack['delete'](object);
- return result;
-
- case symbolTag:
- if (symbolValueOf) {
- return symbolValueOf.call(object) == symbolValueOf.call(other);
- }
- }
- return false;
- }
-
- /**
- * A specialized version of `baseIsEqualDeep` for objects with support for
- * partial deep comparisons.
- *
- * @private
- * @param {Object} object The object to compare.
- * @param {Object} other The other object to compare.
- * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
- * @param {Function} customizer The function to customize comparisons.
- * @param {Function} equalFunc The function to determine equivalents of values.
- * @param {Object} stack Tracks traversed `object` and `other` objects.
- * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
- */
- function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
- objProps = getAllKeys(object),
- objLength = objProps.length,
- othProps = getAllKeys(other),
- othLength = othProps.length;
-
- if (objLength != othLength && !isPartial) {
- return false;
- }
- var index = objLength;
- while (index--) {
- var key = objProps[index];
- if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
- return false;
- }
- }
- // Assume cyclic values are equal.
- var stacked = stack.get(object);
- if (stacked && stack.get(other)) {
- return stacked == other;
- }
- var result = true;
- stack.set(object, other);
- stack.set(other, object);
-
- var skipCtor = isPartial;
- while (++index < objLength) {
- key = objProps[index];
- var objValue = object[key],
- othValue = other[key];
-
- if (customizer) {
- var compared = isPartial
- ? customizer(othValue, objValue, key, other, object, stack)
- : customizer(objValue, othValue, key, object, other, stack);
- }
- // Recursively compare objects (susceptible to call stack limits).
- if (!(compared === undefined
- ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
- : compared
- )) {
- result = false;
- break;
- }
- skipCtor || (skipCtor = key == 'constructor');
- }
- if (result && !skipCtor) {
- var objCtor = object.constructor,
- othCtor = other.constructor;
-
- // Non `Object` object instances with different constructors are not equal.
- if (objCtor != othCtor &&
- ('constructor' in object && 'constructor' in other) &&
- !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
- typeof othCtor == 'function' && othCtor instanceof othCtor)) {
- result = false;
- }
- }
- stack['delete'](object);
- stack['delete'](other);
- return result;
- }
-
- /**
- * A specialized version of `baseRest` which flattens the rest array.
- *
- * @private
- * @param {Function} func The function to apply a rest parameter to.
- * @returns {Function} Returns the new function.
- */
- function flatRest(func) {
- return setToString(overRest(func, undefined, flatten), func + '');
- }
-
- /**
- * Creates an array of own enumerable property names and symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names and symbols.
- */
- function getAllKeys(object) {
- return baseGetAllKeys(object, keys, getSymbols);
- }
-
- /**
- * Creates an array of own and inherited enumerable property names and
- * symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names and symbols.
- */
- function getAllKeysIn(object) {
- return baseGetAllKeys(object, keysIn, getSymbolsIn);
- }
-
- /**
- * Gets metadata for `func`.
- *
- * @private
- * @param {Function} func The function to query.
- * @returns {*} Returns the metadata for `func`.
- */
- var getData = !metaMap ? noop : function(func) {
- return metaMap.get(func);
- };
-
- /**
- * Gets the name of `func`.
- *
- * @private
- * @param {Function} func The function to query.
- * @returns {string} Returns the function name.
- */
- function getFuncName(func) {
- var result = (func.name + ''),
- array = realNames[result],
- length = hasOwnProperty.call(realNames, result) ? array.length : 0;
-
- while (length--) {
- var data = array[length],
- otherFunc = data.func;
- if (otherFunc == null || otherFunc == func) {
- return data.name;
- }
- }
- return result;
- }
-
- /**
- * Gets the argument placeholder value for `func`.
- *
- * @private
- * @param {Function} func The function to inspect.
- * @returns {*} Returns the placeholder value.
- */
- function getHolder(func) {
- var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
- return object.placeholder;
- }
-
- /**
- * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
- * this function returns the custom method, otherwise it returns `baseIteratee`.
- * If arguments are provided, the chosen function is invoked with them and
- * its result is returned.
- *
- * @private
- * @param {*} [value] The value to convert to an iteratee.
- * @param {number} [arity] The arity of the created iteratee.
- * @returns {Function} Returns the chosen function or its result.
- */
- function getIteratee() {
- var result = lodash.iteratee || iteratee;
- result = result === iteratee ? baseIteratee : result;
- return arguments.length ? result(arguments[0], arguments[1]) : result;
- }
-
- /**
- * Gets the data for `map`.
- *
- * @private
- * @param {Object} map The map to query.
- * @param {string} key The reference key.
- * @returns {*} Returns the map data.
- */
- function getMapData(map, key) {
- var data = map.__data__;
- return isKeyable(key)
- ? data[typeof key == 'string' ? 'string' : 'hash']
- : data.map;
- }
-
- /**
- * Gets the property names, values, and compare flags of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the match data of `object`.
- */
- function getMatchData(object) {
- var result = keys(object),
- length = result.length;
-
- while (length--) {
- var key = result[length],
- value = object[key];
-
- result[length] = [key, value, isStrictComparable(value)];
- }
- return result;
- }
-
- /**
- * Gets the native function at `key` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {string} key The key of the method to get.
- * @returns {*} Returns the function if it's native, else `undefined`.
- */
- function getNative(object, key) {
- var value = getValue(object, key);
- return baseIsNative(value) ? value : undefined;
- }
-
- /**
- * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the raw `toStringTag`.
- */
- function getRawTag(value) {
- var isOwn = hasOwnProperty.call(value, symToStringTag),
- tag = value[symToStringTag];
-
- try {
- value[symToStringTag] = undefined;
- var unmasked = true;
- } catch (e) {}
-
- var result = nativeObjectToString.call(value);
- if (unmasked) {
- if (isOwn) {
- value[symToStringTag] = tag;
- } else {
- delete value[symToStringTag];
- }
- }
- return result;
- }
-
- /**
- * Creates an array of the own enumerable symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of symbols.
- */
- var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
- if (object == null) {
- return [];
- }
- object = Object(object);
- return arrayFilter(nativeGetSymbols(object), function(symbol) {
- return propertyIsEnumerable.call(object, symbol);
- });
- };
-
- /**
- * Creates an array of the own and inherited enumerable symbols of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of symbols.
- */
- var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
- var result = [];
- while (object) {
- arrayPush(result, getSymbols(object));
- object = getPrototype(object);
- }
- return result;
- };
-
- /**
- * Gets the `toStringTag` of `value`.
- *
- * @private
- * @param {*} value The value to query.
- * @returns {string} Returns the `toStringTag`.
- */
- var getTag = baseGetTag;
-
- // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
- if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
- (Map && getTag(new Map) != mapTag) ||
- (Promise && getTag(Promise.resolve()) != promiseTag) ||
- (Set && getTag(new Set) != setTag) ||
- (WeakMap && getTag(new WeakMap) != weakMapTag)) {
- getTag = function(value) {
- var result = baseGetTag(value),
- Ctor = result == objectTag ? value.constructor : undefined,
- ctorString = Ctor ? toSource(Ctor) : '';
-
- if (ctorString) {
- switch (ctorString) {
- case dataViewCtorString: return dataViewTag;
- case mapCtorString: return mapTag;
- case promiseCtorString: return promiseTag;
- case setCtorString: return setTag;
- case weakMapCtorString: return weakMapTag;
- }
- }
- return result;
- };
- }
-
- /**
- * Gets the view, applying any `transforms` to the `start` and `end` positions.
- *
- * @private
- * @param {number} start The start of the view.
- * @param {number} end The end of the view.
- * @param {Array} transforms The transformations to apply to the view.
- * @returns {Object} Returns an object containing the `start` and `end`
- * positions of the view.
- */
- function getView(start, end, transforms) {
- var index = -1,
- length = transforms.length;
-
- while (++index < length) {
- var data = transforms[index],
- size = data.size;
-
- switch (data.type) {
- case 'drop': start += size; break;
- case 'dropRight': end -= size; break;
- case 'take': end = nativeMin(end, start + size); break;
- case 'takeRight': start = nativeMax(start, end - size); break;
- }
- }
- return { 'start': start, 'end': end };
- }
-
- /**
- * Extracts wrapper details from the `source` body comment.
- *
- * @private
- * @param {string} source The source to inspect.
- * @returns {Array} Returns the wrapper details.
- */
- function getWrapDetails(source) {
- var match = source.match(reWrapDetails);
- return match ? match[1].split(reSplitDetails) : [];
- }
-
- /**
- * Checks if `path` exists on `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array|string} path The path to check.
- * @param {Function} hasFunc The function to check properties.
- * @returns {boolean} Returns `true` if `path` exists, else `false`.
- */
- function hasPath(object, path, hasFunc) {
- path = castPath(path, object);
-
- var index = -1,
- length = path.length,
- result = false;
-
- while (++index < length) {
- var key = toKey(path[index]);
- if (!(result = object != null && hasFunc(object, key))) {
- break;
- }
- object = object[key];
- }
- if (result || ++index != length) {
- return result;
- }
- length = object == null ? 0 : object.length;
- return !!length && isLength(length) && isIndex(key, length) &&
- (isArray(object) || isArguments(object));
- }
-
- /**
- * Initializes an array clone.
- *
- * @private
- * @param {Array} array The array to clone.
- * @returns {Array} Returns the initialized clone.
- */
- function initCloneArray(array) {
- var length = array.length,
- result = new array.constructor(length);
-
- // Add properties assigned by `RegExp#exec`.
- if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
- result.index = array.index;
- result.input = array.input;
- }
- return result;
- }
-
- /**
- * Initializes an object clone.
- *
- * @private
- * @param {Object} object The object to clone.
- * @returns {Object} Returns the initialized clone.
- */
- function initCloneObject(object) {
- return (typeof object.constructor == 'function' && !isPrototype(object))
- ? baseCreate(getPrototype(object))
- : {};
- }
-
- /**
- * Initializes an object clone based on its `toStringTag`.
- *
- * **Note:** This function only supports cloning values with tags of
- * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
- *
- * @private
- * @param {Object} object The object to clone.
- * @param {string} tag The `toStringTag` of the object to clone.
- * @param {boolean} [isDeep] Specify a deep clone.
- * @returns {Object} Returns the initialized clone.
- */
- function initCloneByTag(object, tag, isDeep) {
- var Ctor = object.constructor;
- switch (tag) {
- case arrayBufferTag:
- return cloneArrayBuffer(object);
-
- case boolTag:
- case dateTag:
- return new Ctor(+object);
-
- case dataViewTag:
- return cloneDataView(object, isDeep);
-
- case float32Tag: case float64Tag:
- case int8Tag: case int16Tag: case int32Tag:
- case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
- return cloneTypedArray(object, isDeep);
-
- case mapTag:
- return new Ctor;
-
- case numberTag:
- case stringTag:
- return new Ctor(object);
-
- case regexpTag:
- return cloneRegExp(object);
-
- case setTag:
- return new Ctor;
-
- case symbolTag:
- return cloneSymbol(object);
- }
- }
-
- /**
- * Inserts wrapper `details` in a comment at the top of the `source` body.
- *
- * @private
- * @param {string} source The source to modify.
- * @returns {Array} details The details to insert.
- * @returns {string} Returns the modified source.
- */
- function insertWrapDetails(source, details) {
- var length = details.length;
- if (!length) {
- return source;
- }
- var lastIndex = length - 1;
- details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
- details = details.join(length > 2 ? ', ' : ' ');
- return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
- }
-
- /**
- * Checks if `value` is a flattenable `arguments` object or array.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
- */
- function isFlattenable(value) {
- return isArray(value) || isArguments(value) ||
- !!(spreadableSymbol && value && value[spreadableSymbol]);
- }
-
- /**
- * Checks if `value` is a valid array-like index.
- *
- * @private
- * @param {*} value The value to check.
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
- */
- function isIndex(value, length) {
- var type = typeof value;
- length = length == null ? MAX_SAFE_INTEGER : length;
-
- return !!length &&
- (type == 'number' ||
- (type != 'symbol' && reIsUint.test(value))) &&
- (value > -1 && value % 1 == 0 && value < length);
- }
-
- /**
- * Checks if the given arguments are from an iteratee call.
- *
- * @private
- * @param {*} value The potential iteratee value argument.
- * @param {*} index The potential iteratee index or key argument.
- * @param {*} object The potential iteratee object argument.
- * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
- * else `false`.
- */
- function isIterateeCall(value, index, object) {
- if (!isObject(object)) {
- return false;
- }
- var type = typeof index;
- if (type == 'number'
- ? (isArrayLike(object) && isIndex(index, object.length))
- : (type == 'string' && index in object)
- ) {
- return eq(object[index], value);
- }
- return false;
- }
-
- /**
- * Checks if `value` is a property name and not a property path.
- *
- * @private
- * @param {*} value The value to check.
- * @param {Object} [object] The object to query keys on.
- * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
- */
- function isKey(value, object) {
- if (isArray(value)) {
- return false;
- }
- var type = typeof value;
- if (type == 'number' || type == 'symbol' || type == 'boolean' ||
- value == null || isSymbol(value)) {
- return true;
- }
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
- (object != null && value in Object(object));
- }
-
- /**
- * Checks if `value` is suitable for use as unique object key.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
- */
- function isKeyable(value) {
- var type = typeof value;
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
- ? (value !== '__proto__')
- : (value === null);
- }
-
- /**
- * Checks if `func` has a lazy counterpart.
- *
- * @private
- * @param {Function} func The function to check.
- * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
- * else `false`.
- */
- function isLaziable(func) {
- var funcName = getFuncName(func),
- other = lodash[funcName];
-
- if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
- return false;
- }
- if (func === other) {
- return true;
- }
- var data = getData(other);
- return !!data && func === data[0];
- }
-
- /**
- * Checks if `func` has its source masked.
- *
- * @private
- * @param {Function} func The function to check.
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
- */
- function isMasked(func) {
- return !!maskSrcKey && (maskSrcKey in func);
- }
-
- /**
- * Checks if `func` is capable of being masked.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
- */
- var isMaskable = coreJsData ? isFunction : stubFalse;
-
- /**
- * Checks if `value` is likely a prototype object.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
- */
- function isPrototype(value) {
- var Ctor = value && value.constructor,
- proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
-
- return value === proto;
- }
-
- /**
- * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` if suitable for strict
- * equality comparisons, else `false`.
- */
- function isStrictComparable(value) {
- return value === value && !isObject(value);
- }
-
- /**
- * A specialized version of `matchesProperty` for source values suitable
- * for strict equality comparisons, i.e. `===`.
- *
- * @private
- * @param {string} key The key of the property to get.
- * @param {*} srcValue The value to match.
- * @returns {Function} Returns the new spec function.
- */
- function matchesStrictComparable(key, srcValue) {
- return function(object) {
- if (object == null) {
- return false;
- }
- return object[key] === srcValue &&
- (srcValue !== undefined || (key in Object(object)));
- };
- }
-
- /**
- * A specialized version of `_.memoize` which clears the memoized function's
- * cache when it exceeds `MAX_MEMOIZE_SIZE`.
- *
- * @private
- * @param {Function} func The function to have its output memoized.
- * @returns {Function} Returns the new memoized function.
- */
- function memoizeCapped(func) {
- var result = memoize(func, function(key) {
- if (cache.size === MAX_MEMOIZE_SIZE) {
- cache.clear();
- }
- return key;
- });
-
- var cache = result.cache;
- return result;
- }
-
- /**
- * Merges the function metadata of `source` into `data`.
- *
- * Merging metadata reduces the number of wrappers used to invoke a function.
- * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
- * may be applied regardless of execution order. Methods like `_.ary` and
- * `_.rearg` modify function arguments, making the order in which they are
- * executed important, preventing the merging of metadata. However, we make
- * an exception for a safe combined case where curried functions have `_.ary`
- * and or `_.rearg` applied.
- *
- * @private
- * @param {Array} data The destination metadata.
- * @param {Array} source The source metadata.
- * @returns {Array} Returns `data`.
- */
- function mergeData(data, source) {
- var bitmask = data[1],
- srcBitmask = source[1],
- newBitmask = bitmask | srcBitmask,
- isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
-
- var isCombo =
- ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
- ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
- ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
-
- // Exit early if metadata can't be merged.
- if (!(isCommon || isCombo)) {
- return data;
- }
- // Use source `thisArg` if available.
- if (srcBitmask & WRAP_BIND_FLAG) {
- data[2] = source[2];
- // Set when currying a bound function.
- newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
- }
- // Compose partial arguments.
- var value = source[3];
- if (value) {
- var partials = data[3];
- data[3] = partials ? composeArgs(partials, value, source[4]) : value;
- data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
- }
- // Compose partial right arguments.
- value = source[5];
- if (value) {
- partials = data[5];
- data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
- data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
- }
- // Use source `argPos` if available.
- value = source[7];
- if (value) {
- data[7] = value;
- }
- // Use source `ary` if it's smaller.
- if (srcBitmask & WRAP_ARY_FLAG) {
- data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
- }
- // Use source `arity` if one is not provided.
- if (data[9] == null) {
- data[9] = source[9];
- }
- // Use source `func` and merge bitmasks.
- data[0] = source[0];
- data[1] = newBitmask;
-
- return data;
- }
-
- /**
- * This function is like
- * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
- * except that it includes inherited enumerable properties.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
- function nativeKeysIn(object) {
- var result = [];
- if (object != null) {
- for (var key in Object(object)) {
- result.push(key);
- }
- }
- return result;
- }
-
- /**
- * Converts `value` to a string using `Object.prototype.toString`.
- *
- * @private
- * @param {*} value The value to convert.
- * @returns {string} Returns the converted string.
- */
- function objectToString(value) {
- return nativeObjectToString.call(value);
- }
-
- /**
- * A specialized version of `baseRest` which transforms the rest array.
- *
- * @private
- * @param {Function} func The function to apply a rest parameter to.
- * @param {number} [start=func.length-1] The start position of the rest parameter.
- * @param {Function} transform The rest array transform.
- * @returns {Function} Returns the new function.
- */
- function overRest(func, start, transform) {
- start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
- return function() {
- var args = arguments,
- index = -1,
- length = nativeMax(args.length - start, 0),
- array = Array(length);
-
- while (++index < length) {
- array[index] = args[start + index];
- }
- index = -1;
- var otherArgs = Array(start + 1);
- while (++index < start) {
- otherArgs[index] = args[index];
- }
- otherArgs[start] = transform(array);
- return apply(func, this, otherArgs);
- };
- }
-
- /**
- * Gets the parent value at `path` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array} path The path to get the parent value of.
- * @returns {*} Returns the parent value.
- */
- function parent(object, path) {
- return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
- }
-
- /**
- * Reorder `array` according to the specified indexes where the element at
- * the first index is assigned as the first element, the element at
- * the second index is assigned as the second element, and so on.
- *
- * @private
- * @param {Array} array The array to reorder.
- * @param {Array} indexes The arranged array indexes.
- * @returns {Array} Returns `array`.
- */
- function reorder(array, indexes) {
- var arrLength = array.length,
- length = nativeMin(indexes.length, arrLength),
- oldArray = copyArray(array);
-
- while (length--) {
- var index = indexes[length];
- array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
- }
- return array;
- }
-
- /**
- * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
- *
- * @private
- * @param {Object} object The object to query.
- * @param {string} key The key of the property to get.
- * @returns {*} Returns the property value.
- */
- function safeGet(object, key) {
- if (key === 'constructor' && typeof object[key] === 'function') {
- return;
- }
-
- if (key == '__proto__') {
- return;
- }
-
- return object[key];
- }
-
- /**
- * Sets metadata for `func`.
- *
- * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
- * period of time, it will trip its breaker and transition to an identity
- * function to avoid garbage collection pauses in V8. See
- * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
- * for more details.
- *
- * @private
- * @param {Function} func The function to associate metadata with.
- * @param {*} data The metadata.
- * @returns {Function} Returns `func`.
- */
- var setData = shortOut(baseSetData);
-
- /**
- * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
- *
- * @private
- * @param {Function} func The function to delay.
- * @param {number} wait The number of milliseconds to delay invocation.
- * @returns {number|Object} Returns the timer id or timeout object.
- */
- var setTimeout = ctxSetTimeout || function(func, wait) {
- return root.setTimeout(func, wait);
- };
-
- /**
- * Sets the `toString` method of `func` to return `string`.
- *
- * @private
- * @param {Function} func The function to modify.
- * @param {Function} string The `toString` result.
- * @returns {Function} Returns `func`.
- */
- var setToString = shortOut(baseSetToString);
-
- /**
- * Sets the `toString` method of `wrapper` to mimic the source of `reference`
- * with wrapper details in a comment at the top of the source body.
- *
- * @private
- * @param {Function} wrapper The function to modify.
- * @param {Function} reference The reference function.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @returns {Function} Returns `wrapper`.
- */
- function setWrapToString(wrapper, reference, bitmask) {
- var source = (reference + '');
- return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
- }
-
- /**
- * Creates a function that'll short out and invoke `identity` instead
- * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
- * milliseconds.
- *
- * @private
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new shortable function.
- */
- function shortOut(func) {
- var count = 0,
- lastCalled = 0;
-
- return function() {
- var stamp = nativeNow(),
- remaining = HOT_SPAN - (stamp - lastCalled);
-
- lastCalled = stamp;
- if (remaining > 0) {
- if (++count >= HOT_COUNT) {
- return arguments[0];
- }
- } else {
- count = 0;
- }
- return func.apply(undefined, arguments);
- };
- }
-
- /**
- * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
- *
- * @private
- * @param {Array} array The array to shuffle.
- * @param {number} [size=array.length] The size of `array`.
- * @returns {Array} Returns `array`.
- */
- function shuffleSelf(array, size) {
- var index = -1,
- length = array.length,
- lastIndex = length - 1;
-
- size = size === undefined ? length : size;
- while (++index < size) {
- var rand = baseRandom(index, lastIndex),
- value = array[rand];
-
- array[rand] = array[index];
- array[index] = value;
- }
- array.length = size;
- return array;
- }
-
- /**
- * Converts `string` to a property path array.
- *
- * @private
- * @param {string} string The string to convert.
- * @returns {Array} Returns the property path array.
- */
- var stringToPath = memoizeCapped(function(string) {
- var result = [];
- if (string.charCodeAt(0) === 46 /* . */) {
- result.push('');
- }
- string.replace(rePropName, function(match, number, quote, subString) {
- result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
- });
- return result;
- });
-
- /**
- * Converts `value` to a string key if it's not a string or symbol.
- *
- * @private
- * @param {*} value The value to inspect.
- * @returns {string|symbol} Returns the key.
- */
- function toKey(value) {
- if (typeof value == 'string' || isSymbol(value)) {
- return value;
- }
- var result = (value + '');
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
- }
-
- /**
- * Converts `func` to its source code.
- *
- * @private
- * @param {Function} func The function to convert.
- * @returns {string} Returns the source code.
- */
- function toSource(func) {
- if (func != null) {
- try {
- return funcToString.call(func);
- } catch (e) {}
- try {
- return (func + '');
- } catch (e) {}
- }
- return '';
- }
-
- /**
- * Updates wrapper `details` based on `bitmask` flags.
- *
- * @private
- * @returns {Array} details The details to modify.
- * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
- * @returns {Array} Returns `details`.
- */
- function updateWrapDetails(details, bitmask) {
- arrayEach(wrapFlags, function(pair) {
- var value = '_.' + pair[0];
- if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
- details.push(value);
- }
- });
- return details.sort();
- }
-
- /**
- * Creates a clone of `wrapper`.
- *
- * @private
- * @param {Object} wrapper The wrapper to clone.
- * @returns {Object} Returns the cloned wrapper.
- */
- function wrapperClone(wrapper) {
- if (wrapper instanceof LazyWrapper) {
- return wrapper.clone();
- }
- var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
- result.__actions__ = copyArray(wrapper.__actions__);
- result.__index__ = wrapper.__index__;
- result.__values__ = wrapper.__values__;
- return result;
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates an array of elements split into groups the length of `size`.
- * If `array` can't be split evenly, the final chunk will be the remaining
- * elements.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to process.
- * @param {number} [size=1] The length of each chunk
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the new array of chunks.
- * @example
- *
- * _.chunk(['a', 'b', 'c', 'd'], 2);
- * // => [['a', 'b'], ['c', 'd']]
- *
- * _.chunk(['a', 'b', 'c', 'd'], 3);
- * // => [['a', 'b', 'c'], ['d']]
- */
- function chunk(array, size, guard) {
- if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
- size = 1;
- } else {
- size = nativeMax(toInteger(size), 0);
- }
- var length = array == null ? 0 : array.length;
- if (!length || size < 1) {
- return [];
- }
- var index = 0,
- resIndex = 0,
- result = Array(nativeCeil(length / size));
-
- while (index < length) {
- result[resIndex++] = baseSlice(array, index, (index += size));
- }
- return result;
- }
-
- /**
- * Creates an array with all falsey values removed. The values `false`, `null`,
- * `0`, `""`, `undefined`, and `NaN` are falsey.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to compact.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * _.compact([0, 1, false, 2, '', 3]);
- * // => [1, 2, 3]
- */
- function compact(array) {
- var index = -1,
- length = array == null ? 0 : array.length,
- resIndex = 0,
- result = [];
-
- while (++index < length) {
- var value = array[index];
- if (value) {
- result[resIndex++] = value;
- }
- }
- return result;
- }
-
- /**
- * Creates a new array concatenating `array` with any additional arrays
- * and/or values.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to concatenate.
- * @param {...*} [values] The values to concatenate.
- * @returns {Array} Returns the new concatenated array.
- * @example
- *
- * var array = [1];
- * var other = _.concat(array, 2, [3], [[4]]);
- *
- * console.log(other);
- * // => [1, 2, 3, [4]]
- *
- * console.log(array);
- * // => [1]
- */
- function concat() {
- var length = arguments.length;
- if (!length) {
- return [];
- }
- var args = Array(length - 1),
- array = arguments[0],
- index = length;
-
- while (index--) {
- args[index - 1] = arguments[index];
- }
- return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
- }
-
- /**
- * Creates an array of `array` values not included in the other given arrays
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons. The order and references of result values are
- * determined by the first array.
- *
- * **Note:** Unlike `_.pullAll`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {...Array} [values] The values to exclude.
- * @returns {Array} Returns the new array of filtered values.
- * @see _.without, _.xor
- * @example
- *
- * _.difference([2, 1], [2, 3]);
- * // => [1]
- */
- var difference = baseRest(function(array, values) {
- return isArrayLikeObject(array)
- ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
- : [];
- });
-
- /**
- * This method is like `_.difference` except that it accepts `iteratee` which
- * is invoked for each element of `array` and `values` to generate the criterion
- * by which they're compared. The order and references of result values are
- * determined by the first array. The iteratee is invoked with one argument:
- * (value).
- *
- * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {...Array} [values] The values to exclude.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
- * // => [1.2]
- *
- * // The `_.property` iteratee shorthand.
- * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
- * // => [{ 'x': 2 }]
- */
- var differenceBy = baseRest(function(array, values) {
- var iteratee = last(values);
- if (isArrayLikeObject(iteratee)) {
- iteratee = undefined;
- }
- return isArrayLikeObject(array)
- ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
- : [];
- });
-
- /**
- * This method is like `_.difference` except that it accepts `comparator`
- * which is invoked to compare elements of `array` to `values`. The order and
- * references of result values are determined by the first array. The comparator
- * is invoked with two arguments: (arrVal, othVal).
- *
- * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {...Array} [values] The values to exclude.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
- *
- * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
- * // => [{ 'x': 2, 'y': 1 }]
- */
- var differenceWith = baseRest(function(array, values) {
- var comparator = last(values);
- if (isArrayLikeObject(comparator)) {
- comparator = undefined;
- }
- return isArrayLikeObject(array)
- ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
- : [];
- });
-
- /**
- * Creates a slice of `array` with `n` elements dropped from the beginning.
- *
- * @static
- * @memberOf _
- * @since 0.5.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to drop.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.drop([1, 2, 3]);
- * // => [2, 3]
- *
- * _.drop([1, 2, 3], 2);
- * // => [3]
- *
- * _.drop([1, 2, 3], 5);
- * // => []
- *
- * _.drop([1, 2, 3], 0);
- * // => [1, 2, 3]
- */
- function drop(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = (guard || n === undefined) ? 1 : toInteger(n);
- return baseSlice(array, n < 0 ? 0 : n, length);
- }
-
- /**
- * Creates a slice of `array` with `n` elements dropped from the end.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to drop.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.dropRight([1, 2, 3]);
- * // => [1, 2]
- *
- * _.dropRight([1, 2, 3], 2);
- * // => [1]
- *
- * _.dropRight([1, 2, 3], 5);
- * // => []
- *
- * _.dropRight([1, 2, 3], 0);
- * // => [1, 2, 3]
- */
- function dropRight(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = (guard || n === undefined) ? 1 : toInteger(n);
- n = length - n;
- return baseSlice(array, 0, n < 0 ? 0 : n);
- }
-
- /**
- * Creates a slice of `array` excluding elements dropped from the end.
- * Elements are dropped until `predicate` returns falsey. The predicate is
- * invoked with three arguments: (value, index, array).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': false }
- * ];
- *
- * _.dropRightWhile(users, function(o) { return !o.active; });
- * // => objects for ['barney']
- *
- * // The `_.matches` iteratee shorthand.
- * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
- * // => objects for ['barney', 'fred']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.dropRightWhile(users, ['active', false]);
- * // => objects for ['barney']
- *
- * // The `_.property` iteratee shorthand.
- * _.dropRightWhile(users, 'active');
- * // => objects for ['barney', 'fred', 'pebbles']
- */
- function dropRightWhile(array, predicate) {
- return (array && array.length)
- ? baseWhile(array, getIteratee(predicate, 3), true, true)
- : [];
- }
-
- /**
- * Creates a slice of `array` excluding elements dropped from the beginning.
- * Elements are dropped until `predicate` returns falsey. The predicate is
- * invoked with three arguments: (value, index, array).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': true }
- * ];
- *
- * _.dropWhile(users, function(o) { return !o.active; });
- * // => objects for ['pebbles']
- *
- * // The `_.matches` iteratee shorthand.
- * _.dropWhile(users, { 'user': 'barney', 'active': false });
- * // => objects for ['fred', 'pebbles']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.dropWhile(users, ['active', false]);
- * // => objects for ['pebbles']
- *
- * // The `_.property` iteratee shorthand.
- * _.dropWhile(users, 'active');
- * // => objects for ['barney', 'fred', 'pebbles']
- */
- function dropWhile(array, predicate) {
- return (array && array.length)
- ? baseWhile(array, getIteratee(predicate, 3), true)
- : [];
- }
-
- /**
- * Fills elements of `array` with `value` from `start` up to, but not
- * including, `end`.
- *
- * **Note:** This method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 3.2.0
- * @category Array
- * @param {Array} array The array to fill.
- * @param {*} value The value to fill `array` with.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = [1, 2, 3];
- *
- * _.fill(array, 'a');
- * console.log(array);
- * // => ['a', 'a', 'a']
- *
- * _.fill(Array(3), 2);
- * // => [2, 2, 2]
- *
- * _.fill([4, 6, 8, 10], '*', 1, 3);
- * // => [4, '*', '*', 10]
- */
- function fill(array, value, start, end) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
- start = 0;
- end = length;
- }
- return baseFill(array, value, start, end);
- }
-
- /**
- * This method is like `_.find` except that it returns the index of the first
- * element `predicate` returns truthy for instead of the element itself.
- *
- * @static
- * @memberOf _
- * @since 1.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param {number} [fromIndex=0] The index to search from.
- * @returns {number} Returns the index of the found element, else `-1`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': true }
- * ];
- *
- * _.findIndex(users, function(o) { return o.user == 'barney'; });
- * // => 0
- *
- * // The `_.matches` iteratee shorthand.
- * _.findIndex(users, { 'user': 'fred', 'active': false });
- * // => 1
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.findIndex(users, ['active', false]);
- * // => 0
- *
- * // The `_.property` iteratee shorthand.
- * _.findIndex(users, 'active');
- * // => 2
- */
- function findIndex(array, predicate, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = fromIndex == null ? 0 : toInteger(fromIndex);
- if (index < 0) {
- index = nativeMax(length + index, 0);
- }
- return baseFindIndex(array, getIteratee(predicate, 3), index);
- }
-
- /**
- * This method is like `_.findIndex` except that it iterates over elements
- * of `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param {number} [fromIndex=array.length-1] The index to search from.
- * @returns {number} Returns the index of the found element, else `-1`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': false }
- * ];
- *
- * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
- * // => 2
- *
- * // The `_.matches` iteratee shorthand.
- * _.findLastIndex(users, { 'user': 'barney', 'active': true });
- * // => 0
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.findLastIndex(users, ['active', false]);
- * // => 2
- *
- * // The `_.property` iteratee shorthand.
- * _.findLastIndex(users, 'active');
- * // => 0
- */
- function findLastIndex(array, predicate, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = length - 1;
- if (fromIndex !== undefined) {
- index = toInteger(fromIndex);
- index = fromIndex < 0
- ? nativeMax(length + index, 0)
- : nativeMin(index, length - 1);
- }
- return baseFindIndex(array, getIteratee(predicate, 3), index, true);
- }
-
- /**
- * Flattens `array` a single level deep.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to flatten.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * _.flatten([1, [2, [3, [4]], 5]]);
- * // => [1, 2, [3, [4]], 5]
- */
- function flatten(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseFlatten(array, 1) : [];
- }
-
- /**
- * Recursively flattens `array`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to flatten.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * _.flattenDeep([1, [2, [3, [4]], 5]]);
- * // => [1, 2, 3, 4, 5]
- */
- function flattenDeep(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseFlatten(array, INFINITY) : [];
- }
-
- /**
- * Recursively flatten `array` up to `depth` times.
- *
- * @static
- * @memberOf _
- * @since 4.4.0
- * @category Array
- * @param {Array} array The array to flatten.
- * @param {number} [depth=1] The maximum recursion depth.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * var array = [1, [2, [3, [4]], 5]];
- *
- * _.flattenDepth(array, 1);
- * // => [1, 2, [3, [4]], 5]
- *
- * _.flattenDepth(array, 2);
- * // => [1, 2, 3, [4], 5]
- */
- function flattenDepth(array, depth) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- depth = depth === undefined ? 1 : toInteger(depth);
- return baseFlatten(array, depth);
- }
-
- /**
- * The inverse of `_.toPairs`; this method returns an object composed
- * from key-value `pairs`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} pairs The key-value pairs.
- * @returns {Object} Returns the new object.
- * @example
- *
- * _.fromPairs([['a', 1], ['b', 2]]);
- * // => { 'a': 1, 'b': 2 }
- */
- function fromPairs(pairs) {
- var index = -1,
- length = pairs == null ? 0 : pairs.length,
- result = {};
-
- while (++index < length) {
- var pair = pairs[index];
- result[pair[0]] = pair[1];
- }
- return result;
- }
-
- /**
- * Gets the first element of `array`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @alias first
- * @category Array
- * @param {Array} array The array to query.
- * @returns {*} Returns the first element of `array`.
- * @example
- *
- * _.head([1, 2, 3]);
- * // => 1
- *
- * _.head([]);
- * // => undefined
- */
- function head(array) {
- return (array && array.length) ? array[0] : undefined;
- }
-
- /**
- * Gets the index at which the first occurrence of `value` is found in `array`
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons. If `fromIndex` is negative, it's used as the
- * offset from the end of `array`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} [fromIndex=0] The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- * @example
- *
- * _.indexOf([1, 2, 1, 2], 2);
- * // => 1
- *
- * // Search from the `fromIndex`.
- * _.indexOf([1, 2, 1, 2], 2, 2);
- * // => 3
- */
- function indexOf(array, value, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = fromIndex == null ? 0 : toInteger(fromIndex);
- if (index < 0) {
- index = nativeMax(length + index, 0);
- }
- return baseIndexOf(array, value, index);
- }
-
- /**
- * Gets all but the last element of `array`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to query.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.initial([1, 2, 3]);
- * // => [1, 2]
- */
- function initial(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseSlice(array, 0, -1) : [];
- }
-
- /**
- * Creates an array of unique values that are included in all given arrays
- * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons. The order and references of result values are
- * determined by the first array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @returns {Array} Returns the new array of intersecting values.
- * @example
- *
- * _.intersection([2, 1], [2, 3]);
- * // => [2]
- */
- var intersection = baseRest(function(arrays) {
- var mapped = arrayMap(arrays, castArrayLikeObject);
- return (mapped.length && mapped[0] === arrays[0])
- ? baseIntersection(mapped)
- : [];
- });
-
- /**
- * This method is like `_.intersection` except that it accepts `iteratee`
- * which is invoked for each element of each `arrays` to generate the criterion
- * by which they're compared. The order and references of result values are
- * determined by the first array. The iteratee is invoked with one argument:
- * (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new array of intersecting values.
- * @example
- *
- * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
- * // => [2.1]
- *
- * // The `_.property` iteratee shorthand.
- * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 1 }]
- */
- var intersectionBy = baseRest(function(arrays) {
- var iteratee = last(arrays),
- mapped = arrayMap(arrays, castArrayLikeObject);
-
- if (iteratee === last(mapped)) {
- iteratee = undefined;
- } else {
- mapped.pop();
- }
- return (mapped.length && mapped[0] === arrays[0])
- ? baseIntersection(mapped, getIteratee(iteratee, 2))
- : [];
- });
-
- /**
- * This method is like `_.intersection` except that it accepts `comparator`
- * which is invoked to compare elements of `arrays`. The order and references
- * of result values are determined by the first array. The comparator is
- * invoked with two arguments: (arrVal, othVal).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of intersecting values.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
- * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
- *
- * _.intersectionWith(objects, others, _.isEqual);
- * // => [{ 'x': 1, 'y': 2 }]
- */
- var intersectionWith = baseRest(function(arrays) {
- var comparator = last(arrays),
- mapped = arrayMap(arrays, castArrayLikeObject);
-
- comparator = typeof comparator == 'function' ? comparator : undefined;
- if (comparator) {
- mapped.pop();
- }
- return (mapped.length && mapped[0] === arrays[0])
- ? baseIntersection(mapped, undefined, comparator)
- : [];
- });
-
- /**
- * Converts all elements in `array` into a string separated by `separator`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to convert.
- * @param {string} [separator=','] The element separator.
- * @returns {string} Returns the joined string.
- * @example
- *
- * _.join(['a', 'b', 'c'], '~');
- * // => 'a~b~c'
- */
- function join(array, separator) {
- return array == null ? '' : nativeJoin.call(array, separator);
- }
-
- /**
- * Gets the last element of `array`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to query.
- * @returns {*} Returns the last element of `array`.
- * @example
- *
- * _.last([1, 2, 3]);
- * // => 3
- */
- function last(array) {
- var length = array == null ? 0 : array.length;
- return length ? array[length - 1] : undefined;
- }
-
- /**
- * This method is like `_.indexOf` except that it iterates over elements of
- * `array` from right to left.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @param {number} [fromIndex=array.length-1] The index to search from.
- * @returns {number} Returns the index of the matched value, else `-1`.
- * @example
- *
- * _.lastIndexOf([1, 2, 1, 2], 2);
- * // => 3
- *
- * // Search from the `fromIndex`.
- * _.lastIndexOf([1, 2, 1, 2], 2, 2);
- * // => 1
- */
- function lastIndexOf(array, value, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = length;
- if (fromIndex !== undefined) {
- index = toInteger(fromIndex);
- index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
- }
- return value === value
- ? strictLastIndexOf(array, value, index)
- : baseFindIndex(array, baseIsNaN, index, true);
- }
-
- /**
- * Gets the element at index `n` of `array`. If `n` is negative, the nth
- * element from the end is returned.
- *
- * @static
- * @memberOf _
- * @since 4.11.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=0] The index of the element to return.
- * @returns {*} Returns the nth element of `array`.
- * @example
- *
- * var array = ['a', 'b', 'c', 'd'];
- *
- * _.nth(array, 1);
- * // => 'b'
- *
- * _.nth(array, -2);
- * // => 'c';
- */
- function nth(array, n) {
- return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
- }
-
- /**
- * Removes all given values from `array` using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
- * to remove elements from an array by predicate.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {...*} [values] The values to remove.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
- *
- * _.pull(array, 'a', 'c');
- * console.log(array);
- * // => ['b', 'b']
- */
- var pull = baseRest(pullAll);
-
- /**
- * This method is like `_.pull` except that it accepts an array of values to remove.
- *
- * **Note:** Unlike `_.difference`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {Array} values The values to remove.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
- *
- * _.pullAll(array, ['a', 'c']);
- * console.log(array);
- * // => ['b', 'b']
- */
- function pullAll(array, values) {
- return (array && array.length && values && values.length)
- ? basePullAll(array, values)
- : array;
- }
-
- /**
- * This method is like `_.pullAll` except that it accepts `iteratee` which is
- * invoked for each element of `array` and `values` to generate the criterion
- * by which they're compared. The iteratee is invoked with one argument: (value).
- *
- * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {Array} values The values to remove.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
- *
- * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
- * console.log(array);
- * // => [{ 'x': 2 }]
- */
- function pullAllBy(array, values, iteratee) {
- return (array && array.length && values && values.length)
- ? basePullAll(array, values, getIteratee(iteratee, 2))
- : array;
- }
-
- /**
- * This method is like `_.pullAll` except that it accepts `comparator` which
- * is invoked to compare elements of `array` to `values`. The comparator is
- * invoked with two arguments: (arrVal, othVal).
- *
- * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 4.6.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {Array} values The values to remove.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
- *
- * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
- * console.log(array);
- * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
- */
- function pullAllWith(array, values, comparator) {
- return (array && array.length && values && values.length)
- ? basePullAll(array, values, undefined, comparator)
- : array;
- }
-
- /**
- * Removes elements from `array` corresponding to `indexes` and returns an
- * array of removed elements.
- *
- * **Note:** Unlike `_.at`, this method mutates `array`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {...(number|number[])} [indexes] The indexes of elements to remove.
- * @returns {Array} Returns the new array of removed elements.
- * @example
- *
- * var array = ['a', 'b', 'c', 'd'];
- * var pulled = _.pullAt(array, [1, 3]);
- *
- * console.log(array);
- * // => ['a', 'c']
- *
- * console.log(pulled);
- * // => ['b', 'd']
- */
- var pullAt = flatRest(function(array, indexes) {
- var length = array == null ? 0 : array.length,
- result = baseAt(array, indexes);
-
- basePullAt(array, arrayMap(indexes, function(index) {
- return isIndex(index, length) ? +index : index;
- }).sort(compareAscending));
-
- return result;
- });
-
- /**
- * Removes all elements from `array` that `predicate` returns truthy for
- * and returns an array of the removed elements. The predicate is invoked
- * with three arguments: (value, index, array).
- *
- * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
- * to pull elements from an array by value.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new array of removed elements.
- * @example
- *
- * var array = [1, 2, 3, 4];
- * var evens = _.remove(array, function(n) {
- * return n % 2 == 0;
- * });
- *
- * console.log(array);
- * // => [1, 3]
- *
- * console.log(evens);
- * // => [2, 4]
- */
- function remove(array, predicate) {
- var result = [];
- if (!(array && array.length)) {
- return result;
- }
- var index = -1,
- indexes = [],
- length = array.length;
-
- predicate = getIteratee(predicate, 3);
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result.push(value);
- indexes.push(index);
- }
- }
- basePullAt(array, indexes);
- return result;
- }
-
- /**
- * Reverses `array` so that the first element becomes the last, the second
- * element becomes the second to last, and so on.
- *
- * **Note:** This method mutates `array` and is based on
- * [`Array#reverse`](https://mdn.io/Array/reverse).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to modify.
- * @returns {Array} Returns `array`.
- * @example
- *
- * var array = [1, 2, 3];
- *
- * _.reverse(array);
- * // => [3, 2, 1]
- *
- * console.log(array);
- * // => [3, 2, 1]
- */
- function reverse(array) {
- return array == null ? array : nativeReverse.call(array);
- }
-
- /**
- * Creates a slice of `array` from `start` up to, but not including, `end`.
- *
- * **Note:** This method is used instead of
- * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
- * returned.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to slice.
- * @param {number} [start=0] The start position.
- * @param {number} [end=array.length] The end position.
- * @returns {Array} Returns the slice of `array`.
- */
- function slice(array, start, end) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
- start = 0;
- end = length;
- }
- else {
- start = start == null ? 0 : toInteger(start);
- end = end === undefined ? length : toInteger(end);
- }
- return baseSlice(array, start, end);
- }
-
- /**
- * Uses a binary search to determine the lowest index at which `value`
- * should be inserted into `array` in order to maintain its sort order.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- * @example
- *
- * _.sortedIndex([30, 50], 40);
- * // => 1
- */
- function sortedIndex(array, value) {
- return baseSortedIndex(array, value);
- }
-
- /**
- * This method is like `_.sortedIndex` except that it accepts `iteratee`
- * which is invoked for `value` and each element of `array` to compute their
- * sort ranking. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- * @example
- *
- * var objects = [{ 'x': 4 }, { 'x': 5 }];
- *
- * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
- * // => 0
- *
- * // The `_.property` iteratee shorthand.
- * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
- * // => 0
- */
- function sortedIndexBy(array, value, iteratee) {
- return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
- }
-
- /**
- * This method is like `_.indexOf` except that it performs a binary
- * search on a sorted `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @returns {number} Returns the index of the matched value, else `-1`.
- * @example
- *
- * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
- * // => 1
- */
- function sortedIndexOf(array, value) {
- var length = array == null ? 0 : array.length;
- if (length) {
- var index = baseSortedIndex(array, value);
- if (index < length && eq(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * This method is like `_.sortedIndex` except that it returns the highest
- * index at which `value` should be inserted into `array` in order to
- * maintain its sort order.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- * @example
- *
- * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
- * // => 4
- */
- function sortedLastIndex(array, value) {
- return baseSortedIndex(array, value, true);
- }
-
- /**
- * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
- * which is invoked for `value` and each element of `array` to compute their
- * sort ranking. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The sorted array to inspect.
- * @param {*} value The value to evaluate.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {number} Returns the index at which `value` should be inserted
- * into `array`.
- * @example
- *
- * var objects = [{ 'x': 4 }, { 'x': 5 }];
- *
- * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
- * // => 1
- *
- * // The `_.property` iteratee shorthand.
- * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
- * // => 1
- */
- function sortedLastIndexBy(array, value, iteratee) {
- return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
- }
-
- /**
- * This method is like `_.lastIndexOf` except that it performs a binary
- * search on a sorted `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {*} value The value to search for.
- * @returns {number} Returns the index of the matched value, else `-1`.
- * @example
- *
- * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
- * // => 3
- */
- function sortedLastIndexOf(array, value) {
- var length = array == null ? 0 : array.length;
- if (length) {
- var index = baseSortedIndex(array, value, true) - 1;
- if (eq(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
-
- /**
- * This method is like `_.uniq` except that it's designed and optimized
- * for sorted arrays.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * _.sortedUniq([1, 1, 2]);
- * // => [1, 2]
- */
- function sortedUniq(array) {
- return (array && array.length)
- ? baseSortedUniq(array)
- : [];
- }
-
- /**
- * This method is like `_.uniqBy` except that it's designed and optimized
- * for sorted arrays.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee] The iteratee invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
- * // => [1.1, 2.3]
- */
- function sortedUniqBy(array, iteratee) {
- return (array && array.length)
- ? baseSortedUniq(array, getIteratee(iteratee, 2))
- : [];
- }
-
- /**
- * Gets all but the first element of `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.tail([1, 2, 3]);
- * // => [2, 3]
- */
- function tail(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseSlice(array, 1, length) : [];
- }
-
- /**
- * Creates a slice of `array` with `n` elements taken from the beginning.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to take.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.take([1, 2, 3]);
- * // => [1]
- *
- * _.take([1, 2, 3], 2);
- * // => [1, 2]
- *
- * _.take([1, 2, 3], 5);
- * // => [1, 2, 3]
- *
- * _.take([1, 2, 3], 0);
- * // => []
- */
- function take(array, n, guard) {
- if (!(array && array.length)) {
- return [];
- }
- n = (guard || n === undefined) ? 1 : toInteger(n);
- return baseSlice(array, 0, n < 0 ? 0 : n);
- }
-
- /**
- * Creates a slice of `array` with `n` elements taken from the end.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {number} [n=1] The number of elements to take.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * _.takeRight([1, 2, 3]);
- * // => [3]
- *
- * _.takeRight([1, 2, 3], 2);
- * // => [2, 3]
- *
- * _.takeRight([1, 2, 3], 5);
- * // => [1, 2, 3]
- *
- * _.takeRight([1, 2, 3], 0);
- * // => []
- */
- function takeRight(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = (guard || n === undefined) ? 1 : toInteger(n);
- n = length - n;
- return baseSlice(array, n < 0 ? 0 : n, length);
- }
-
- /**
- * Creates a slice of `array` with elements taken from the end. Elements are
- * taken until `predicate` returns falsey. The predicate is invoked with
- * three arguments: (value, index, array).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': false }
- * ];
- *
- * _.takeRightWhile(users, function(o) { return !o.active; });
- * // => objects for ['fred', 'pebbles']
- *
- * // The `_.matches` iteratee shorthand.
- * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
- * // => objects for ['pebbles']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.takeRightWhile(users, ['active', false]);
- * // => objects for ['fred', 'pebbles']
- *
- * // The `_.property` iteratee shorthand.
- * _.takeRightWhile(users, 'active');
- * // => []
- */
- function takeRightWhile(array, predicate) {
- return (array && array.length)
- ? baseWhile(array, getIteratee(predicate, 3), false, true)
- : [];
- }
-
- /**
- * Creates a slice of `array` with elements taken from the beginning. Elements
- * are taken until `predicate` returns falsey. The predicate is invoked with
- * three arguments: (value, index, array).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Array
- * @param {Array} array The array to query.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the slice of `array`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'active': false },
- * { 'user': 'fred', 'active': false },
- * { 'user': 'pebbles', 'active': true }
- * ];
- *
- * _.takeWhile(users, function(o) { return !o.active; });
- * // => objects for ['barney', 'fred']
- *
- * // The `_.matches` iteratee shorthand.
- * _.takeWhile(users, { 'user': 'barney', 'active': false });
- * // => objects for ['barney']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.takeWhile(users, ['active', false]);
- * // => objects for ['barney', 'fred']
- *
- * // The `_.property` iteratee shorthand.
- * _.takeWhile(users, 'active');
- * // => []
- */
- function takeWhile(array, predicate) {
- return (array && array.length)
- ? baseWhile(array, getIteratee(predicate, 3))
- : [];
- }
-
- /**
- * Creates an array of unique values, in order, from all given arrays using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @returns {Array} Returns the new array of combined values.
- * @example
- *
- * _.union([2], [1, 2]);
- * // => [2, 1]
- */
- var union = baseRest(function(arrays) {
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
- });
-
- /**
- * This method is like `_.union` except that it accepts `iteratee` which is
- * invoked for each element of each `arrays` to generate the criterion by
- * which uniqueness is computed. Result values are chosen from the first
- * array in which the value occurs. The iteratee is invoked with one argument:
- * (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new array of combined values.
- * @example
- *
- * _.unionBy([2.1], [1.2, 2.3], Math.floor);
- * // => [2.1, 1.2]
- *
- * // The `_.property` iteratee shorthand.
- * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 1 }, { 'x': 2 }]
- */
- var unionBy = baseRest(function(arrays) {
- var iteratee = last(arrays);
- if (isArrayLikeObject(iteratee)) {
- iteratee = undefined;
- }
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
- });
-
- /**
- * This method is like `_.union` except that it accepts `comparator` which
- * is invoked to compare elements of `arrays`. Result values are chosen from
- * the first array in which the value occurs. The comparator is invoked
- * with two arguments: (arrVal, othVal).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of combined values.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
- * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
- *
- * _.unionWith(objects, others, _.isEqual);
- * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
- */
- var unionWith = baseRest(function(arrays) {
- var comparator = last(arrays);
- comparator = typeof comparator == 'function' ? comparator : undefined;
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
- });
-
- /**
- * Creates a duplicate-free version of an array, using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons, in which only the first occurrence of each element
- * is kept. The order of result values is determined by the order they occur
- * in the array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * _.uniq([2, 1, 2]);
- * // => [2, 1]
- */
- function uniq(array) {
- return (array && array.length) ? baseUniq(array) : [];
- }
-
- /**
- * This method is like `_.uniq` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the criterion by which
- * uniqueness is computed. The order of result values is determined by the
- * order they occur in the array. The iteratee is invoked with one argument:
- * (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
- * // => [2.1, 1.2]
- *
- * // The `_.property` iteratee shorthand.
- * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 1 }, { 'x': 2 }]
- */
- function uniqBy(array, iteratee) {
- return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
- }
-
- /**
- * This method is like `_.uniq` except that it accepts `comparator` which
- * is invoked to compare elements of `array`. The order of result values is
- * determined by the order they occur in the array.The comparator is invoked
- * with two arguments: (arrVal, othVal).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new duplicate free array.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
- *
- * _.uniqWith(objects, _.isEqual);
- * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
- */
- function uniqWith(array, comparator) {
- comparator = typeof comparator == 'function' ? comparator : undefined;
- return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
- }
-
- /**
- * This method is like `_.zip` except that it accepts an array of grouped
- * elements and creates an array regrouping the elements to their pre-zip
- * configuration.
- *
- * @static
- * @memberOf _
- * @since 1.2.0
- * @category Array
- * @param {Array} array The array of grouped elements to process.
- * @returns {Array} Returns the new array of regrouped elements.
- * @example
- *
- * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
- * // => [['a', 1, true], ['b', 2, false]]
- *
- * _.unzip(zipped);
- * // => [['a', 'b'], [1, 2], [true, false]]
- */
- function unzip(array) {
- if (!(array && array.length)) {
- return [];
- }
- var length = 0;
- array = arrayFilter(array, function(group) {
- if (isArrayLikeObject(group)) {
- length = nativeMax(group.length, length);
- return true;
- }
- });
- return baseTimes(length, function(index) {
- return arrayMap(array, baseProperty(index));
- });
- }
-
- /**
- * This method is like `_.unzip` except that it accepts `iteratee` to specify
- * how regrouped values should be combined. The iteratee is invoked with the
- * elements of each group: (...group).
- *
- * @static
- * @memberOf _
- * @since 3.8.0
- * @category Array
- * @param {Array} array The array of grouped elements to process.
- * @param {Function} [iteratee=_.identity] The function to combine
- * regrouped values.
- * @returns {Array} Returns the new array of regrouped elements.
- * @example
- *
- * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
- * // => [[1, 10, 100], [2, 20, 200]]
- *
- * _.unzipWith(zipped, _.add);
- * // => [3, 30, 300]
- */
- function unzipWith(array, iteratee) {
- if (!(array && array.length)) {
- return [];
- }
- var result = unzip(array);
- if (iteratee == null) {
- return result;
- }
- return arrayMap(result, function(group) {
- return apply(iteratee, undefined, group);
- });
- }
-
- /**
- * Creates an array excluding all given values using
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * for equality comparisons.
- *
- * **Note:** Unlike `_.pull`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {Array} array The array to inspect.
- * @param {...*} [values] The values to exclude.
- * @returns {Array} Returns the new array of filtered values.
- * @see _.difference, _.xor
- * @example
- *
- * _.without([2, 1, 2, 3], 1, 2);
- * // => [3]
- */
- var without = baseRest(function(array, values) {
- return isArrayLikeObject(array)
- ? baseDifference(array, values)
- : [];
- });
-
- /**
- * Creates an array of unique values that is the
- * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
- * of the given arrays. The order of result values is determined by the order
- * they occur in the arrays.
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @returns {Array} Returns the new array of filtered values.
- * @see _.difference, _.without
- * @example
- *
- * _.xor([2, 1], [2, 3]);
- * // => [1, 3]
- */
- var xor = baseRest(function(arrays) {
- return baseXor(arrayFilter(arrays, isArrayLikeObject));
- });
-
- /**
- * This method is like `_.xor` except that it accepts `iteratee` which is
- * invoked for each element of each `arrays` to generate the criterion by
- * which by which they're compared. The order of result values is determined
- * by the order they occur in the arrays. The iteratee is invoked with one
- * argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
- * // => [1.2, 3.4]
- *
- * // The `_.property` iteratee shorthand.
- * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
- * // => [{ 'x': 2 }]
- */
- var xorBy = baseRest(function(arrays) {
- var iteratee = last(arrays);
- if (isArrayLikeObject(iteratee)) {
- iteratee = undefined;
- }
- return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
- });
-
- /**
- * This method is like `_.xor` except that it accepts `comparator` which is
- * invoked to compare elements of `arrays`. The order of result values is
- * determined by the order they occur in the arrays. The comparator is invoked
- * with two arguments: (arrVal, othVal).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Array
- * @param {...Array} [arrays] The arrays to inspect.
- * @param {Function} [comparator] The comparator invoked per element.
- * @returns {Array} Returns the new array of filtered values.
- * @example
- *
- * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
- * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
- *
- * _.xorWith(objects, others, _.isEqual);
- * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
- */
- var xorWith = baseRest(function(arrays) {
- var comparator = last(arrays);
- comparator = typeof comparator == 'function' ? comparator : undefined;
- return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
- });
-
- /**
- * Creates an array of grouped elements, the first of which contains the
- * first elements of the given arrays, the second of which contains the
- * second elements of the given arrays, and so on.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Array
- * @param {...Array} [arrays] The arrays to process.
- * @returns {Array} Returns the new array of grouped elements.
- * @example
- *
- * _.zip(['a', 'b'], [1, 2], [true, false]);
- * // => [['a', 1, true], ['b', 2, false]]
- */
- var zip = baseRest(unzip);
-
- /**
- * This method is like `_.fromPairs` except that it accepts two arrays,
- * one of property identifiers and one of corresponding values.
- *
- * @static
- * @memberOf _
- * @since 0.4.0
- * @category Array
- * @param {Array} [props=[]] The property identifiers.
- * @param {Array} [values=[]] The property values.
- * @returns {Object} Returns the new object.
- * @example
- *
- * _.zipObject(['a', 'b'], [1, 2]);
- * // => { 'a': 1, 'b': 2 }
- */
- function zipObject(props, values) {
- return baseZipObject(props || [], values || [], assignValue);
- }
-
- /**
- * This method is like `_.zipObject` except that it supports property paths.
- *
- * @static
- * @memberOf _
- * @since 4.1.0
- * @category Array
- * @param {Array} [props=[]] The property identifiers.
- * @param {Array} [values=[]] The property values.
- * @returns {Object} Returns the new object.
- * @example
- *
- * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
- * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
- */
- function zipObjectDeep(props, values) {
- return baseZipObject(props || [], values || [], baseSet);
- }
-
- /**
- * This method is like `_.zip` except that it accepts `iteratee` to specify
- * how grouped values should be combined. The iteratee is invoked with the
- * elements of each group: (...group).
- *
- * @static
- * @memberOf _
- * @since 3.8.0
- * @category Array
- * @param {...Array} [arrays] The arrays to process.
- * @param {Function} [iteratee=_.identity] The function to combine
- * grouped values.
- * @returns {Array} Returns the new array of grouped elements.
- * @example
- *
- * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
- * return a + b + c;
- * });
- * // => [111, 222]
- */
- var zipWith = baseRest(function(arrays) {
- var length = arrays.length,
- iteratee = length > 1 ? arrays[length - 1] : undefined;
-
- iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
- return unzipWith(arrays, iteratee);
- });
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates a `lodash` wrapper instance that wraps `value` with explicit method
- * chain sequences enabled. The result of such sequences must be unwrapped
- * with `_#value`.
- *
- * @static
- * @memberOf _
- * @since 1.3.0
- * @category Seq
- * @param {*} value The value to wrap.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 },
- * { 'user': 'pebbles', 'age': 1 }
- * ];
- *
- * var youngest = _
- * .chain(users)
- * .sortBy('age')
- * .map(function(o) {
- * return o.user + ' is ' + o.age;
- * })
- * .head()
- * .value();
- * // => 'pebbles is 1'
- */
- function chain(value) {
- var result = lodash(value);
- result.__chain__ = true;
- return result;
- }
-
- /**
- * This method invokes `interceptor` and returns `value`. The interceptor
- * is invoked with one argument; (value). The purpose of this method is to
- * "tap into" a method chain sequence in order to modify intermediate results.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Seq
- * @param {*} value The value to provide to `interceptor`.
- * @param {Function} interceptor The function to invoke.
- * @returns {*} Returns `value`.
- * @example
- *
- * _([1, 2, 3])
- * .tap(function(array) {
- * // Mutate input array.
- * array.pop();
- * })
- * .reverse()
- * .value();
- * // => [2, 1]
- */
- function tap(value, interceptor) {
- interceptor(value);
- return value;
- }
-
- /**
- * This method is like `_.tap` except that it returns the result of `interceptor`.
- * The purpose of this method is to "pass thru" values replacing intermediate
- * results in a method chain sequence.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Seq
- * @param {*} value The value to provide to `interceptor`.
- * @param {Function} interceptor The function to invoke.
- * @returns {*} Returns the result of `interceptor`.
- * @example
- *
- * _(' abc ')
- * .chain()
- * .trim()
- * .thru(function(value) {
- * return [value];
- * })
- * .value();
- * // => ['abc']
- */
- function thru(value, interceptor) {
- return interceptor(value);
- }
-
- /**
- * This method is the wrapper version of `_.at`.
- *
- * @name at
- * @memberOf _
- * @since 1.0.0
- * @category Seq
- * @param {...(string|string[])} [paths] The property paths to pick.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
- *
- * _(object).at(['a[0].b.c', 'a[1]']).value();
- * // => [3, 4]
- */
- var wrapperAt = flatRest(function(paths) {
- var length = paths.length,
- start = length ? paths[0] : 0,
- value = this.__wrapped__,
- interceptor = function(object) { return baseAt(object, paths); };
-
- if (length > 1 || this.__actions__.length ||
- !(value instanceof LazyWrapper) || !isIndex(start)) {
- return this.thru(interceptor);
- }
- value = value.slice(start, +start + (length ? 1 : 0));
- value.__actions__.push({
- 'func': thru,
- 'args': [interceptor],
- 'thisArg': undefined
- });
- return new LodashWrapper(value, this.__chain__).thru(function(array) {
- if (length && !array.length) {
- array.push(undefined);
- }
- return array;
- });
- });
-
- /**
- * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
- *
- * @name chain
- * @memberOf _
- * @since 0.1.0
- * @category Seq
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 }
- * ];
- *
- * // A sequence without explicit chaining.
- * _(users).head();
- * // => { 'user': 'barney', 'age': 36 }
- *
- * // A sequence with explicit chaining.
- * _(users)
- * .chain()
- * .head()
- * .pick('user')
- * .value();
- * // => { 'user': 'barney' }
- */
- function wrapperChain() {
- return chain(this);
- }
-
- /**
- * Executes the chain sequence and returns the wrapped result.
- *
- * @name commit
- * @memberOf _
- * @since 3.2.0
- * @category Seq
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var array = [1, 2];
- * var wrapped = _(array).push(3);
- *
- * console.log(array);
- * // => [1, 2]
- *
- * wrapped = wrapped.commit();
- * console.log(array);
- * // => [1, 2, 3]
- *
- * wrapped.last();
- * // => 3
- *
- * console.log(array);
- * // => [1, 2, 3]
- */
- function wrapperCommit() {
- return new LodashWrapper(this.value(), this.__chain__);
- }
-
- /**
- * Gets the next value on a wrapped object following the
- * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
- *
- * @name next
- * @memberOf _
- * @since 4.0.0
- * @category Seq
- * @returns {Object} Returns the next iterator value.
- * @example
- *
- * var wrapped = _([1, 2]);
- *
- * wrapped.next();
- * // => { 'done': false, 'value': 1 }
- *
- * wrapped.next();
- * // => { 'done': false, 'value': 2 }
- *
- * wrapped.next();
- * // => { 'done': true, 'value': undefined }
- */
- function wrapperNext() {
- if (this.__values__ === undefined) {
- this.__values__ = toArray(this.value());
- }
- var done = this.__index__ >= this.__values__.length,
- value = done ? undefined : this.__values__[this.__index__++];
-
- return { 'done': done, 'value': value };
- }
-
- /**
- * Enables the wrapper to be iterable.
- *
- * @name Symbol.iterator
- * @memberOf _
- * @since 4.0.0
- * @category Seq
- * @returns {Object} Returns the wrapper object.
- * @example
- *
- * var wrapped = _([1, 2]);
- *
- * wrapped[Symbol.iterator]() === wrapped;
- * // => true
- *
- * Array.from(wrapped);
- * // => [1, 2]
- */
- function wrapperToIterator() {
- return this;
- }
-
- /**
- * Creates a clone of the chain sequence planting `value` as the wrapped value.
- *
- * @name plant
- * @memberOf _
- * @since 3.2.0
- * @category Seq
- * @param {*} value The value to plant.
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var wrapped = _([1, 2]).map(square);
- * var other = wrapped.plant([3, 4]);
- *
- * other.value();
- * // => [9, 16]
- *
- * wrapped.value();
- * // => [1, 4]
- */
- function wrapperPlant(value) {
- var result,
- parent = this;
-
- while (parent instanceof baseLodash) {
- var clone = wrapperClone(parent);
- clone.__index__ = 0;
- clone.__values__ = undefined;
- if (result) {
- previous.__wrapped__ = clone;
- } else {
- result = clone;
- }
- var previous = clone;
- parent = parent.__wrapped__;
- }
- previous.__wrapped__ = value;
- return result;
- }
-
- /**
- * This method is the wrapper version of `_.reverse`.
- *
- * **Note:** This method mutates the wrapped array.
- *
- * @name reverse
- * @memberOf _
- * @since 0.1.0
- * @category Seq
- * @returns {Object} Returns the new `lodash` wrapper instance.
- * @example
- *
- * var array = [1, 2, 3];
- *
- * _(array).reverse().value()
- * // => [3, 2, 1]
- *
- * console.log(array);
- * // => [3, 2, 1]
- */
- function wrapperReverse() {
- var value = this.__wrapped__;
- if (value instanceof LazyWrapper) {
- var wrapped = value;
- if (this.__actions__.length) {
- wrapped = new LazyWrapper(this);
- }
- wrapped = wrapped.reverse();
- wrapped.__actions__.push({
- 'func': thru,
- 'args': [reverse],
- 'thisArg': undefined
- });
- return new LodashWrapper(wrapped, this.__chain__);
- }
- return this.thru(reverse);
- }
-
- /**
- * Executes the chain sequence to resolve the unwrapped value.
- *
- * @name value
- * @memberOf _
- * @since 0.1.0
- * @alias toJSON, valueOf
- * @category Seq
- * @returns {*} Returns the resolved unwrapped value.
- * @example
- *
- * _([1, 2, 3]).value();
- * // => [1, 2, 3]
- */
- function wrapperValue() {
- return baseWrapperValue(this.__wrapped__, this.__actions__);
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` thru `iteratee`. The corresponding value of
- * each key is the number of times the key was returned by `iteratee`. The
- * iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 0.5.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * _.countBy([6.1, 4.2, 6.3], Math.floor);
- * // => { '4': 1, '6': 2 }
- *
- * // The `_.property` iteratee shorthand.
- * _.countBy(['one', 'two', 'three'], 'length');
- * // => { '3': 2, '5': 1 }
- */
- var countBy = createAggregator(function(result, value, key) {
- if (hasOwnProperty.call(result, key)) {
- ++result[key];
- } else {
- baseAssignValue(result, key, 1);
- }
- });
-
- /**
- * Checks if `predicate` returns truthy for **all** elements of `collection`.
- * Iteration is stopped once `predicate` returns falsey. The predicate is
- * invoked with three arguments: (value, index|key, collection).
- *
- * **Note:** This method returns `true` for
- * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
- * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
- * elements of empty collections.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {boolean} Returns `true` if all elements pass the predicate check,
- * else `false`.
- * @example
- *
- * _.every([true, 1, null, 'yes'], Boolean);
- * // => false
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * // The `_.matches` iteratee shorthand.
- * _.every(users, { 'user': 'barney', 'active': false });
- * // => false
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.every(users, ['active', false]);
- * // => true
- *
- * // The `_.property` iteratee shorthand.
- * _.every(users, 'active');
- * // => false
- */
- function every(collection, predicate, guard) {
- var func = isArray(collection) ? arrayEvery : baseEvery;
- if (guard && isIterateeCall(collection, predicate, guard)) {
- predicate = undefined;
- }
- return func(collection, getIteratee(predicate, 3));
- }
-
- /**
- * Iterates over elements of `collection`, returning an array of all elements
- * `predicate` returns truthy for. The predicate is invoked with three
- * arguments: (value, index|key, collection).
- *
- * **Note:** Unlike `_.remove`, this method returns a new array.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- * @see _.reject
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * _.filter(users, function(o) { return !o.active; });
- * // => objects for ['fred']
- *
- * // The `_.matches` iteratee shorthand.
- * _.filter(users, { 'age': 36, 'active': true });
- * // => objects for ['barney']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.filter(users, ['active', false]);
- * // => objects for ['fred']
- *
- * // The `_.property` iteratee shorthand.
- * _.filter(users, 'active');
- * // => objects for ['barney']
- */
- function filter(collection, predicate) {
- var func = isArray(collection) ? arrayFilter : baseFilter;
- return func(collection, getIteratee(predicate, 3));
- }
-
- /**
- * Iterates over elements of `collection`, returning the first element
- * `predicate` returns truthy for. The predicate is invoked with three
- * arguments: (value, index|key, collection).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param {number} [fromIndex=0] The index to search from.
- * @returns {*} Returns the matched element, else `undefined`.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false },
- * { 'user': 'pebbles', 'age': 1, 'active': true }
- * ];
- *
- * _.find(users, function(o) { return o.age < 40; });
- * // => object for 'barney'
- *
- * // The `_.matches` iteratee shorthand.
- * _.find(users, { 'age': 1, 'active': true });
- * // => object for 'pebbles'
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.find(users, ['active', false]);
- * // => object for 'fred'
- *
- * // The `_.property` iteratee shorthand.
- * _.find(users, 'active');
- * // => object for 'barney'
- */
- var find = createFind(findIndex);
-
- /**
- * This method is like `_.find` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param {number} [fromIndex=collection.length-1] The index to search from.
- * @returns {*} Returns the matched element, else `undefined`.
- * @example
- *
- * _.findLast([1, 2, 3, 4], function(n) {
- * return n % 2 == 1;
- * });
- * // => 3
- */
- var findLast = createFind(findLastIndex);
-
- /**
- * Creates a flattened array of values by running each element in `collection`
- * thru `iteratee` and flattening the mapped results. The iteratee is invoked
- * with three arguments: (value, index|key, collection).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * function duplicate(n) {
- * return [n, n];
- * }
- *
- * _.flatMap([1, 2], duplicate);
- * // => [1, 1, 2, 2]
- */
- function flatMap(collection, iteratee) {
- return baseFlatten(map(collection, iteratee), 1);
- }
-
- /**
- * This method is like `_.flatMap` except that it recursively flattens the
- * mapped results.
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * function duplicate(n) {
- * return [[[n, n]]];
- * }
- *
- * _.flatMapDeep([1, 2], duplicate);
- * // => [1, 1, 2, 2]
- */
- function flatMapDeep(collection, iteratee) {
- return baseFlatten(map(collection, iteratee), INFINITY);
- }
-
- /**
- * This method is like `_.flatMap` except that it recursively flattens the
- * mapped results up to `depth` times.
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {number} [depth=1] The maximum recursion depth.
- * @returns {Array} Returns the new flattened array.
- * @example
- *
- * function duplicate(n) {
- * return [[[n, n]]];
- * }
- *
- * _.flatMapDepth([1, 2], duplicate, 2);
- * // => [[1, 1], [2, 2]]
- */
- function flatMapDepth(collection, iteratee, depth) {
- depth = depth === undefined ? 1 : toInteger(depth);
- return baseFlatten(map(collection, iteratee), depth);
- }
-
- /**
- * Iterates over elements of `collection` and invokes `iteratee` for each element.
- * The iteratee is invoked with three arguments: (value, index|key, collection).
- * Iteratee functions may exit iteration early by explicitly returning `false`.
- *
- * **Note:** As with other "Collections" methods, objects with a "length"
- * property are iterated like arrays. To avoid this behavior use `_.forIn`
- * or `_.forOwn` for object iteration.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @alias each
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array|Object} Returns `collection`.
- * @see _.forEachRight
- * @example
- *
- * _.forEach([1, 2], function(value) {
- * console.log(value);
- * });
- * // => Logs `1` then `2`.
- *
- * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'a' then 'b' (iteration order is not guaranteed).
- */
- function forEach(collection, iteratee) {
- var func = isArray(collection) ? arrayEach : baseEach;
- return func(collection, getIteratee(iteratee, 3));
- }
-
- /**
- * This method is like `_.forEach` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @alias eachRight
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array|Object} Returns `collection`.
- * @see _.forEach
- * @example
- *
- * _.forEachRight([1, 2], function(value) {
- * console.log(value);
- * });
- * // => Logs `2` then `1`.
- */
- function forEachRight(collection, iteratee) {
- var func = isArray(collection) ? arrayEachRight : baseEachRight;
- return func(collection, getIteratee(iteratee, 3));
- }
-
- /**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` thru `iteratee`. The order of grouped values
- * is determined by the order they occur in `collection`. The corresponding
- * value of each key is an array of elements responsible for generating the
- * key. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * _.groupBy([6.1, 4.2, 6.3], Math.floor);
- * // => { '4': [4.2], '6': [6.1, 6.3] }
- *
- * // The `_.property` iteratee shorthand.
- * _.groupBy(['one', 'two', 'three'], 'length');
- * // => { '3': ['one', 'two'], '5': ['three'] }
- */
- var groupBy = createAggregator(function(result, value, key) {
- if (hasOwnProperty.call(result, key)) {
- result[key].push(value);
- } else {
- baseAssignValue(result, key, [value]);
- }
- });
-
- /**
- * Checks if `value` is in `collection`. If `collection` is a string, it's
- * checked for a substring of `value`, otherwise
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * is used for equality comparisons. If `fromIndex` is negative, it's used as
- * the offset from the end of `collection`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object|string} collection The collection to inspect.
- * @param {*} value The value to search for.
- * @param {number} [fromIndex=0] The index to search from.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
- * @returns {boolean} Returns `true` if `value` is found, else `false`.
- * @example
- *
- * _.includes([1, 2, 3], 1);
- * // => true
- *
- * _.includes([1, 2, 3], 1, 2);
- * // => false
- *
- * _.includes({ 'a': 1, 'b': 2 }, 1);
- * // => true
- *
- * _.includes('abcd', 'bc');
- * // => true
- */
- function includes(collection, value, fromIndex, guard) {
- collection = isArrayLike(collection) ? collection : values(collection);
- fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
-
- var length = collection.length;
- if (fromIndex < 0) {
- fromIndex = nativeMax(length + fromIndex, 0);
- }
- return isString(collection)
- ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
- : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
- }
-
- /**
- * Invokes the method at `path` of each element in `collection`, returning
- * an array of the results of each invoked method. Any additional arguments
- * are provided to each invoked method. If `path` is a function, it's invoked
- * for, and `this` bound to, each element in `collection`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Array|Function|string} path The path of the method to invoke or
- * the function invoked per iteration.
- * @param {...*} [args] The arguments to invoke each method with.
- * @returns {Array} Returns the array of results.
- * @example
- *
- * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
- * // => [[1, 5, 7], [1, 2, 3]]
- *
- * _.invokeMap([123, 456], String.prototype.split, '');
- * // => [['1', '2', '3'], ['4', '5', '6']]
- */
- var invokeMap = baseRest(function(collection, path, args) {
- var index = -1,
- isFunc = typeof path == 'function',
- result = isArrayLike(collection) ? Array(collection.length) : [];
-
- baseEach(collection, function(value) {
- result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
- });
- return result;
- });
-
- /**
- * Creates an object composed of keys generated from the results of running
- * each element of `collection` thru `iteratee`. The corresponding value of
- * each key is the last element responsible for generating the key. The
- * iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
- * @returns {Object} Returns the composed aggregate object.
- * @example
- *
- * var array = [
- * { 'dir': 'left', 'code': 97 },
- * { 'dir': 'right', 'code': 100 }
- * ];
- *
- * _.keyBy(array, function(o) {
- * return String.fromCharCode(o.code);
- * });
- * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
- *
- * _.keyBy(array, 'dir');
- * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
- */
- var keyBy = createAggregator(function(result, value, key) {
- baseAssignValue(result, key, value);
- });
-
- /**
- * Creates an array of values by running each element in `collection` thru
- * `iteratee`. The iteratee is invoked with three arguments:
- * (value, index|key, collection).
- *
- * Many lodash methods are guarded to work as iteratees for methods like
- * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
- *
- * The guarded methods are:
- * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
- * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
- * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
- * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new mapped array.
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * _.map([4, 8], square);
- * // => [16, 64]
- *
- * _.map({ 'a': 4, 'b': 8 }, square);
- * // => [16, 64] (iteration order is not guaranteed)
- *
- * var users = [
- * { 'user': 'barney' },
- * { 'user': 'fred' }
- * ];
- *
- * // The `_.property` iteratee shorthand.
- * _.map(users, 'user');
- * // => ['barney', 'fred']
- */
- function map(collection, iteratee) {
- var func = isArray(collection) ? arrayMap : baseMap;
- return func(collection, getIteratee(iteratee, 3));
- }
-
- /**
- * This method is like `_.sortBy` except that it allows specifying the sort
- * orders of the iteratees to sort by. If `orders` is unspecified, all values
- * are sorted in ascending order. Otherwise, specify an order of "desc" for
- * descending or "asc" for ascending sort order of corresponding values.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
- * The iteratees to sort by.
- * @param {string[]} [orders] The sort orders of `iteratees`.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
- * @returns {Array} Returns the new sorted array.
- * @example
- *
- * var users = [
- * { 'user': 'fred', 'age': 48 },
- * { 'user': 'barney', 'age': 34 },
- * { 'user': 'fred', 'age': 40 },
- * { 'user': 'barney', 'age': 36 }
- * ];
- *
- * // Sort by `user` in ascending order and by `age` in descending order.
- * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
- * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
- */
- function orderBy(collection, iteratees, orders, guard) {
- if (collection == null) {
- return [];
- }
- if (!isArray(iteratees)) {
- iteratees = iteratees == null ? [] : [iteratees];
- }
- orders = guard ? undefined : orders;
- if (!isArray(orders)) {
- orders = orders == null ? [] : [orders];
- }
- return baseOrderBy(collection, iteratees, orders);
- }
-
- /**
- * Creates an array of elements split into two groups, the first of which
- * contains elements `predicate` returns truthy for, the second of which
- * contains elements `predicate` returns falsey for. The predicate is
- * invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the array of grouped elements.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false },
- * { 'user': 'fred', 'age': 40, 'active': true },
- * { 'user': 'pebbles', 'age': 1, 'active': false }
- * ];
- *
- * _.partition(users, function(o) { return o.active; });
- * // => objects for [['fred'], ['barney', 'pebbles']]
- *
- * // The `_.matches` iteratee shorthand.
- * _.partition(users, { 'age': 1, 'active': false });
- * // => objects for [['pebbles'], ['barney', 'fred']]
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.partition(users, ['active', false]);
- * // => objects for [['barney', 'pebbles'], ['fred']]
- *
- * // The `_.property` iteratee shorthand.
- * _.partition(users, 'active');
- * // => objects for [['fred'], ['barney', 'pebbles']]
- */
- var partition = createAggregator(function(result, value, key) {
- result[key ? 0 : 1].push(value);
- }, function() { return [[], []]; });
-
- /**
- * Reduces `collection` to a value which is the accumulated result of running
- * each element in `collection` thru `iteratee`, where each successive
- * invocation is supplied the return value of the previous. If `accumulator`
- * is not given, the first element of `collection` is used as the initial
- * value. The iteratee is invoked with four arguments:
- * (accumulator, value, index|key, collection).
- *
- * Many lodash methods are guarded to work as iteratees for methods like
- * `_.reduce`, `_.reduceRight`, and `_.transform`.
- *
- * The guarded methods are:
- * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
- * and `sortBy`
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @returns {*} Returns the accumulated value.
- * @see _.reduceRight
- * @example
- *
- * _.reduce([1, 2], function(sum, n) {
- * return sum + n;
- * }, 0);
- * // => 3
- *
- * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
- * (result[value] || (result[value] = [])).push(key);
- * return result;
- * }, {});
- * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
- */
- function reduce(collection, iteratee, accumulator) {
- var func = isArray(collection) ? arrayReduce : baseReduce,
- initAccum = arguments.length < 3;
-
- return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
- }
-
- /**
- * This method is like `_.reduce` except that it iterates over elements of
- * `collection` from right to left.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The initial value.
- * @returns {*} Returns the accumulated value.
- * @see _.reduce
- * @example
- *
- * var array = [[0, 1], [2, 3], [4, 5]];
- *
- * _.reduceRight(array, function(flattened, other) {
- * return flattened.concat(other);
- * }, []);
- * // => [4, 5, 2, 3, 0, 1]
- */
- function reduceRight(collection, iteratee, accumulator) {
- var func = isArray(collection) ? arrayReduceRight : baseReduce,
- initAccum = arguments.length < 3;
-
- return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
- }
-
- /**
- * The opposite of `_.filter`; this method returns the elements of `collection`
- * that `predicate` does **not** return truthy for.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the new filtered array.
- * @see _.filter
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': false },
- * { 'user': 'fred', 'age': 40, 'active': true }
- * ];
- *
- * _.reject(users, function(o) { return !o.active; });
- * // => objects for ['fred']
- *
- * // The `_.matches` iteratee shorthand.
- * _.reject(users, { 'age': 40, 'active': true });
- * // => objects for ['barney']
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.reject(users, ['active', false]);
- * // => objects for ['fred']
- *
- * // The `_.property` iteratee shorthand.
- * _.reject(users, 'active');
- * // => objects for ['barney']
- */
- function reject(collection, predicate) {
- var func = isArray(collection) ? arrayFilter : baseFilter;
- return func(collection, negate(getIteratee(predicate, 3)));
- }
-
- /**
- * Gets a random element from `collection`.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to sample.
- * @returns {*} Returns the random element.
- * @example
- *
- * _.sample([1, 2, 3, 4]);
- * // => 2
- */
- function sample(collection) {
- var func = isArray(collection) ? arraySample : baseSample;
- return func(collection);
- }
-
- /**
- * Gets `n` random elements at unique keys from `collection` up to the
- * size of `collection`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Collection
- * @param {Array|Object} collection The collection to sample.
- * @param {number} [n=1] The number of elements to sample.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the random elements.
- * @example
- *
- * _.sampleSize([1, 2, 3], 2);
- * // => [3, 1]
- *
- * _.sampleSize([1, 2, 3], 4);
- * // => [2, 3, 1]
- */
- function sampleSize(collection, n, guard) {
- if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
- n = 1;
- } else {
- n = toInteger(n);
- }
- var func = isArray(collection) ? arraySampleSize : baseSampleSize;
- return func(collection, n);
- }
-
- /**
- * Creates an array of shuffled values, using a version of the
- * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to shuffle.
- * @returns {Array} Returns the new shuffled array.
- * @example
- *
- * _.shuffle([1, 2, 3, 4]);
- * // => [4, 1, 3, 2]
- */
- function shuffle(collection) {
- var func = isArray(collection) ? arrayShuffle : baseShuffle;
- return func(collection);
- }
-
- /**
- * Gets the size of `collection` by returning its length for array-like
- * values or the number of own enumerable string keyed properties for objects.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object|string} collection The collection to inspect.
- * @returns {number} Returns the collection size.
- * @example
- *
- * _.size([1, 2, 3]);
- * // => 3
- *
- * _.size({ 'a': 1, 'b': 2 });
- * // => 2
- *
- * _.size('pebbles');
- * // => 7
- */
- function size(collection) {
- if (collection == null) {
- return 0;
- }
- if (isArrayLike(collection)) {
- return isString(collection) ? stringSize(collection) : collection.length;
- }
- var tag = getTag(collection);
- if (tag == mapTag || tag == setTag) {
- return collection.size;
- }
- return baseKeys(collection).length;
- }
-
- /**
- * Checks if `predicate` returns truthy for **any** element of `collection`.
- * Iteration is stopped once `predicate` returns truthy. The predicate is
- * invoked with three arguments: (value, index|key, collection).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {boolean} Returns `true` if any element passes the predicate check,
- * else `false`.
- * @example
- *
- * _.some([null, 0, 'yes', false], Boolean);
- * // => true
- *
- * var users = [
- * { 'user': 'barney', 'active': true },
- * { 'user': 'fred', 'active': false }
- * ];
- *
- * // The `_.matches` iteratee shorthand.
- * _.some(users, { 'user': 'barney', 'active': false });
- * // => false
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.some(users, ['active', false]);
- * // => true
- *
- * // The `_.property` iteratee shorthand.
- * _.some(users, 'active');
- * // => true
- */
- function some(collection, predicate, guard) {
- var func = isArray(collection) ? arraySome : baseSome;
- if (guard && isIterateeCall(collection, predicate, guard)) {
- predicate = undefined;
- }
- return func(collection, getIteratee(predicate, 3));
- }
-
- /**
- * Creates an array of elements, sorted in ascending order by the results of
- * running each element in a collection thru each iteratee. This method
- * performs a stable sort, that is, it preserves the original sort order of
- * equal elements. The iteratees are invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Collection
- * @param {Array|Object} collection The collection to iterate over.
- * @param {...(Function|Function[])} [iteratees=[_.identity]]
- * The iteratees to sort by.
- * @returns {Array} Returns the new sorted array.
- * @example
- *
- * var users = [
- * { 'user': 'fred', 'age': 48 },
- * { 'user': 'barney', 'age': 36 },
- * { 'user': 'fred', 'age': 40 },
- * { 'user': 'barney', 'age': 34 }
- * ];
- *
- * _.sortBy(users, [function(o) { return o.user; }]);
- * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
- *
- * _.sortBy(users, ['user', 'age']);
- * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
- */
- var sortBy = baseRest(function(collection, iteratees) {
- if (collection == null) {
- return [];
- }
- var length = iteratees.length;
- if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
- iteratees = [];
- } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
- iteratees = [iteratees[0]];
- }
- return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
- });
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Gets the timestamp of the number of milliseconds that have elapsed since
- * the Unix epoch (1 January 1970 00:00:00 UTC).
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Date
- * @returns {number} Returns the timestamp.
- * @example
- *
- * _.defer(function(stamp) {
- * console.log(_.now() - stamp);
- * }, _.now());
- * // => Logs the number of milliseconds it took for the deferred invocation.
- */
- var now = ctxNow || function() {
- return root.Date.now();
- };
-
- /*------------------------------------------------------------------------*/
-
- /**
- * The opposite of `_.before`; this method creates a function that invokes
- * `func` once it's called `n` or more times.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {number} n The number of calls before `func` is invoked.
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * var saves = ['profile', 'settings'];
- *
- * var done = _.after(saves.length, function() {
- * console.log('done saving!');
- * });
- *
- * _.forEach(saves, function(type) {
- * asyncSave({ 'type': type, 'complete': done });
- * });
- * // => Logs 'done saving!' after the two async saves have completed.
- */
- function after(n, func) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- n = toInteger(n);
- return function() {
- if (--n < 1) {
- return func.apply(this, arguments);
- }
- };
- }
-
- /**
- * Creates a function that invokes `func`, with up to `n` arguments,
- * ignoring any additional arguments.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {Function} func The function to cap arguments for.
- * @param {number} [n=func.length] The arity cap.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Function} Returns the new capped function.
- * @example
- *
- * _.map(['6', '8', '10'], _.ary(parseInt, 1));
- * // => [6, 8, 10]
- */
- function ary(func, n, guard) {
- n = guard ? undefined : n;
- n = (func && n == null) ? func.length : n;
- return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
- }
-
- /**
- * Creates a function that invokes `func`, with the `this` binding and arguments
- * of the created function, while it's called less than `n` times. Subsequent
- * calls to the created function return the result of the last `func` invocation.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {number} n The number of calls at which `func` is no longer invoked.
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * jQuery(element).on('click', _.before(5, addContactToList));
- * // => Allows adding up to 4 contacts to the list.
- */
- function before(n, func) {
- var result;
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- n = toInteger(n);
- return function() {
- if (--n > 0) {
- result = func.apply(this, arguments);
- }
- if (n <= 1) {
- func = undefined;
- }
- return result;
- };
- }
-
- /**
- * Creates a function that invokes `func` with the `this` binding of `thisArg`
- * and `partials` prepended to the arguments it receives.
- *
- * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
- * may be used as a placeholder for partially applied arguments.
- *
- * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
- * property of bound functions.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to bind.
- * @param {*} thisArg The `this` binding of `func`.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new bound function.
- * @example
- *
- * function greet(greeting, punctuation) {
- * return greeting + ' ' + this.user + punctuation;
- * }
- *
- * var object = { 'user': 'fred' };
- *
- * var bound = _.bind(greet, object, 'hi');
- * bound('!');
- * // => 'hi fred!'
- *
- * // Bound with placeholders.
- * var bound = _.bind(greet, object, _, '!');
- * bound('hi');
- * // => 'hi fred!'
- */
- var bind = baseRest(function(func, thisArg, partials) {
- var bitmask = WRAP_BIND_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, getHolder(bind));
- bitmask |= WRAP_PARTIAL_FLAG;
- }
- return createWrap(func, bitmask, thisArg, partials, holders);
- });
-
- /**
- * Creates a function that invokes the method at `object[key]` with `partials`
- * prepended to the arguments it receives.
- *
- * This method differs from `_.bind` by allowing bound functions to reference
- * methods that may be redefined or don't yet exist. See
- * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
- * for more details.
- *
- * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * @static
- * @memberOf _
- * @since 0.10.0
- * @category Function
- * @param {Object} object The object to invoke the method on.
- * @param {string} key The key of the method.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new bound function.
- * @example
- *
- * var object = {
- * 'user': 'fred',
- * 'greet': function(greeting, punctuation) {
- * return greeting + ' ' + this.user + punctuation;
- * }
- * };
- *
- * var bound = _.bindKey(object, 'greet', 'hi');
- * bound('!');
- * // => 'hi fred!'
- *
- * object.greet = function(greeting, punctuation) {
- * return greeting + 'ya ' + this.user + punctuation;
- * };
- *
- * bound('!');
- * // => 'hiya fred!'
- *
- * // Bound with placeholders.
- * var bound = _.bindKey(object, 'greet', _, '!');
- * bound('hi');
- * // => 'hiya fred!'
- */
- var bindKey = baseRest(function(object, key, partials) {
- var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, getHolder(bindKey));
- bitmask |= WRAP_PARTIAL_FLAG;
- }
- return createWrap(key, bitmask, object, partials, holders);
- });
-
- /**
- * Creates a function that accepts arguments of `func` and either invokes
- * `func` returning its result, if at least `arity` number of arguments have
- * been provided, or returns a function that accepts the remaining `func`
- * arguments, and so on. The arity of `func` may be specified if `func.length`
- * is not sufficient.
- *
- * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
- * may be used as a placeholder for provided arguments.
- *
- * **Note:** This method doesn't set the "length" property of curried functions.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Function
- * @param {Function} func The function to curry.
- * @param {number} [arity=func.length] The arity of `func`.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Function} Returns the new curried function.
- * @example
- *
- * var abc = function(a, b, c) {
- * return [a, b, c];
- * };
- *
- * var curried = _.curry(abc);
- *
- * curried(1)(2)(3);
- * // => [1, 2, 3]
- *
- * curried(1, 2)(3);
- * // => [1, 2, 3]
- *
- * curried(1, 2, 3);
- * // => [1, 2, 3]
- *
- * // Curried with placeholders.
- * curried(1)(_, 3)(2);
- * // => [1, 2, 3]
- */
- function curry(func, arity, guard) {
- arity = guard ? undefined : arity;
- var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
- result.placeholder = curry.placeholder;
- return result;
- }
-
- /**
- * This method is like `_.curry` except that arguments are applied to `func`
- * in the manner of `_.partialRight` instead of `_.partial`.
- *
- * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for provided arguments.
- *
- * **Note:** This method doesn't set the "length" property of curried functions.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {Function} func The function to curry.
- * @param {number} [arity=func.length] The arity of `func`.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Function} Returns the new curried function.
- * @example
- *
- * var abc = function(a, b, c) {
- * return [a, b, c];
- * };
- *
- * var curried = _.curryRight(abc);
- *
- * curried(3)(2)(1);
- * // => [1, 2, 3]
- *
- * curried(2, 3)(1);
- * // => [1, 2, 3]
- *
- * curried(1, 2, 3);
- * // => [1, 2, 3]
- *
- * // Curried with placeholders.
- * curried(3)(1, _)(2);
- * // => [1, 2, 3]
- */
- function curryRight(func, arity, guard) {
- arity = guard ? undefined : arity;
- var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
- result.placeholder = curryRight.placeholder;
- return result;
- }
-
- /**
- * Creates a debounced function that delays invoking `func` until after `wait`
- * milliseconds have elapsed since the last time the debounced function was
- * invoked. The debounced function comes with a `cancel` method to cancel
- * delayed `func` invocations and a `flush` method to immediately invoke them.
- * Provide `options` to indicate whether `func` should be invoked on the
- * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
- * with the last arguments provided to the debounced function. Subsequent
- * calls to the debounced function return the result of the last `func`
- * invocation.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
- * invoked on the trailing edge of the timeout only if the debounced function
- * is invoked more than once during the `wait` timeout.
- *
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
- *
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
- * for details over the differences between `_.debounce` and `_.throttle`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to debounce.
- * @param {number} [wait=0] The number of milliseconds to delay.
- * @param {Object} [options={}] The options object.
- * @param {boolean} [options.leading=false]
- * Specify invoking on the leading edge of the timeout.
- * @param {number} [options.maxWait]
- * The maximum time `func` is allowed to be delayed before it's invoked.
- * @param {boolean} [options.trailing=true]
- * Specify invoking on the trailing edge of the timeout.
- * @returns {Function} Returns the new debounced function.
- * @example
- *
- * // Avoid costly calculations while the window size is in flux.
- * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
- *
- * // Invoke `sendMail` when clicked, debouncing subsequent calls.
- * jQuery(element).on('click', _.debounce(sendMail, 300, {
- * 'leading': true,
- * 'trailing': false
- * }));
- *
- * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
- * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
- * var source = new EventSource('/stream');
- * jQuery(source).on('message', debounced);
- *
- * // Cancel the trailing debounced invocation.
- * jQuery(window).on('popstate', debounced.cancel);
- */
- function debounce(func, wait, options) {
- var lastArgs,
- lastThis,
- maxWait,
- result,
- timerId,
- lastCallTime,
- lastInvokeTime = 0,
- leading = false,
- maxing = false,
- trailing = true;
-
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- wait = toNumber(wait) || 0;
- if (isObject(options)) {
- leading = !!options.leading;
- maxing = 'maxWait' in options;
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
-
- function invokeFunc(time) {
- var args = lastArgs,
- thisArg = lastThis;
-
- lastArgs = lastThis = undefined;
- lastInvokeTime = time;
- result = func.apply(thisArg, args);
- return result;
- }
-
- function leadingEdge(time) {
- // Reset any `maxWait` timer.
- lastInvokeTime = time;
- // Start the timer for the trailing edge.
- timerId = setTimeout(timerExpired, wait);
- // Invoke the leading edge.
- return leading ? invokeFunc(time) : result;
- }
-
- function remainingWait(time) {
- var timeSinceLastCall = time - lastCallTime,
- timeSinceLastInvoke = time - lastInvokeTime,
- timeWaiting = wait - timeSinceLastCall;
-
- return maxing
- ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
- : timeWaiting;
- }
-
- function shouldInvoke(time) {
- var timeSinceLastCall = time - lastCallTime,
- timeSinceLastInvoke = time - lastInvokeTime;
-
- // Either this is the first call, activity has stopped and we're at the
- // trailing edge, the system time has gone backwards and we're treating
- // it as the trailing edge, or we've hit the `maxWait` limit.
- return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
- (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
- }
-
- function timerExpired() {
- var time = now();
- if (shouldInvoke(time)) {
- return trailingEdge(time);
- }
- // Restart the timer.
- timerId = setTimeout(timerExpired, remainingWait(time));
- }
-
- function trailingEdge(time) {
- timerId = undefined;
-
- // Only invoke if we have `lastArgs` which means `func` has been
- // debounced at least once.
- if (trailing && lastArgs) {
- return invokeFunc(time);
- }
- lastArgs = lastThis = undefined;
- return result;
- }
-
- function cancel() {
- if (timerId !== undefined) {
- clearTimeout(timerId);
- }
- lastInvokeTime = 0;
- lastArgs = lastCallTime = lastThis = timerId = undefined;
- }
-
- function flush() {
- return timerId === undefined ? result : trailingEdge(now());
- }
-
- function debounced() {
- var time = now(),
- isInvoking = shouldInvoke(time);
-
- lastArgs = arguments;
- lastThis = this;
- lastCallTime = time;
-
- if (isInvoking) {
- if (timerId === undefined) {
- return leadingEdge(lastCallTime);
- }
- if (maxing) {
- // Handle invocations in a tight loop.
- clearTimeout(timerId);
- timerId = setTimeout(timerExpired, wait);
- return invokeFunc(lastCallTime);
- }
- }
- if (timerId === undefined) {
- timerId = setTimeout(timerExpired, wait);
- }
- return result;
- }
- debounced.cancel = cancel;
- debounced.flush = flush;
- return debounced;
- }
-
- /**
- * Defers invoking the `func` until the current call stack has cleared. Any
- * additional arguments are provided to `func` when it's invoked.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to defer.
- * @param {...*} [args] The arguments to invoke `func` with.
- * @returns {number} Returns the timer id.
- * @example
- *
- * _.defer(function(text) {
- * console.log(text);
- * }, 'deferred');
- * // => Logs 'deferred' after one millisecond.
- */
- var defer = baseRest(function(func, args) {
- return baseDelay(func, 1, args);
- });
-
- /**
- * Invokes `func` after `wait` milliseconds. Any additional arguments are
- * provided to `func` when it's invoked.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to delay.
- * @param {number} wait The number of milliseconds to delay invocation.
- * @param {...*} [args] The arguments to invoke `func` with.
- * @returns {number} Returns the timer id.
- * @example
- *
- * _.delay(function(text) {
- * console.log(text);
- * }, 1000, 'later');
- * // => Logs 'later' after one second.
- */
- var delay = baseRest(function(func, wait, args) {
- return baseDelay(func, toNumber(wait) || 0, args);
- });
-
- /**
- * Creates a function that invokes `func` with arguments reversed.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Function
- * @param {Function} func The function to flip arguments for.
- * @returns {Function} Returns the new flipped function.
- * @example
- *
- * var flipped = _.flip(function() {
- * return _.toArray(arguments);
- * });
- *
- * flipped('a', 'b', 'c', 'd');
- * // => ['d', 'c', 'b', 'a']
- */
- function flip(func) {
- return createWrap(func, WRAP_FLIP_FLAG);
- }
-
- /**
- * Creates a function that memoizes the result of `func`. If `resolver` is
- * provided, it determines the cache key for storing the result based on the
- * arguments provided to the memoized function. By default, the first argument
- * provided to the memoized function is used as the map cache key. The `func`
- * is invoked with the `this` binding of the memoized function.
- *
- * **Note:** The cache is exposed as the `cache` property on the memoized
- * function. Its creation may be customized by replacing the `_.memoize.Cache`
- * constructor with one whose instances implement the
- * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
- * method interface of `clear`, `delete`, `get`, `has`, and `set`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to have its output memoized.
- * @param {Function} [resolver] The function to resolve the cache key.
- * @returns {Function} Returns the new memoized function.
- * @example
- *
- * var object = { 'a': 1, 'b': 2 };
- * var other = { 'c': 3, 'd': 4 };
- *
- * var values = _.memoize(_.values);
- * values(object);
- * // => [1, 2]
- *
- * values(other);
- * // => [3, 4]
- *
- * object.a = 2;
- * values(object);
- * // => [1, 2]
- *
- * // Modify the result cache.
- * values.cache.set(object, ['a', 'b']);
- * values(object);
- * // => ['a', 'b']
- *
- * // Replace `_.memoize.Cache`.
- * _.memoize.Cache = WeakMap;
- */
- function memoize(func, resolver) {
- if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- var memoized = function() {
- var args = arguments,
- key = resolver ? resolver.apply(this, args) : args[0],
- cache = memoized.cache;
-
- if (cache.has(key)) {
- return cache.get(key);
- }
- var result = func.apply(this, args);
- memoized.cache = cache.set(key, result) || cache;
- return result;
- };
- memoized.cache = new (memoize.Cache || MapCache);
- return memoized;
- }
-
- // Expose `MapCache`.
- memoize.Cache = MapCache;
-
- /**
- * Creates a function that negates the result of the predicate `func`. The
- * `func` predicate is invoked with the `this` binding and arguments of the
- * created function.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {Function} predicate The predicate to negate.
- * @returns {Function} Returns the new negated function.
- * @example
- *
- * function isEven(n) {
- * return n % 2 == 0;
- * }
- *
- * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
- * // => [1, 3, 5]
- */
- function negate(predicate) {
- if (typeof predicate != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return function() {
- var args = arguments;
- switch (args.length) {
- case 0: return !predicate.call(this);
- case 1: return !predicate.call(this, args[0]);
- case 2: return !predicate.call(this, args[0], args[1]);
- case 3: return !predicate.call(this, args[0], args[1], args[2]);
- }
- return !predicate.apply(this, args);
- };
- }
-
- /**
- * Creates a function that is restricted to invoking `func` once. Repeat calls
- * to the function return the value of the first invocation. The `func` is
- * invoked with the `this` binding and arguments of the created function.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to restrict.
- * @returns {Function} Returns the new restricted function.
- * @example
- *
- * var initialize = _.once(createApplication);
- * initialize();
- * initialize();
- * // => `createApplication` is invoked once
- */
- function once(func) {
- return before(2, func);
- }
-
- /**
- * Creates a function that invokes `func` with its arguments transformed.
- *
- * @static
- * @since 4.0.0
- * @memberOf _
- * @category Function
- * @param {Function} func The function to wrap.
- * @param {...(Function|Function[])} [transforms=[_.identity]]
- * The argument transforms.
- * @returns {Function} Returns the new function.
- * @example
- *
- * function doubled(n) {
- * return n * 2;
- * }
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var func = _.overArgs(function(x, y) {
- * return [x, y];
- * }, [square, doubled]);
- *
- * func(9, 3);
- * // => [81, 6]
- *
- * func(10, 5);
- * // => [100, 10]
- */
- var overArgs = castRest(function(func, transforms) {
- transforms = (transforms.length == 1 && isArray(transforms[0]))
- ? arrayMap(transforms[0], baseUnary(getIteratee()))
- : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
-
- var funcsLength = transforms.length;
- return baseRest(function(args) {
- var index = -1,
- length = nativeMin(args.length, funcsLength);
-
- while (++index < length) {
- args[index] = transforms[index].call(this, args[index]);
- }
- return apply(func, this, args);
- });
- });
-
- /**
- * Creates a function that invokes `func` with `partials` prepended to the
- * arguments it receives. This method is like `_.bind` except it does **not**
- * alter the `this` binding.
- *
- * The `_.partial.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * **Note:** This method doesn't set the "length" property of partially
- * applied functions.
- *
- * @static
- * @memberOf _
- * @since 0.2.0
- * @category Function
- * @param {Function} func The function to partially apply arguments to.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new partially applied function.
- * @example
- *
- * function greet(greeting, name) {
- * return greeting + ' ' + name;
- * }
- *
- * var sayHelloTo = _.partial(greet, 'hello');
- * sayHelloTo('fred');
- * // => 'hello fred'
- *
- * // Partially applied with placeholders.
- * var greetFred = _.partial(greet, _, 'fred');
- * greetFred('hi');
- * // => 'hi fred'
- */
- var partial = baseRest(function(func, partials) {
- var holders = replaceHolders(partials, getHolder(partial));
- return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
- });
-
- /**
- * This method is like `_.partial` except that partially applied arguments
- * are appended to the arguments it receives.
- *
- * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
- * builds, may be used as a placeholder for partially applied arguments.
- *
- * **Note:** This method doesn't set the "length" property of partially
- * applied functions.
- *
- * @static
- * @memberOf _
- * @since 1.0.0
- * @category Function
- * @param {Function} func The function to partially apply arguments to.
- * @param {...*} [partials] The arguments to be partially applied.
- * @returns {Function} Returns the new partially applied function.
- * @example
- *
- * function greet(greeting, name) {
- * return greeting + ' ' + name;
- * }
- *
- * var greetFred = _.partialRight(greet, 'fred');
- * greetFred('hi');
- * // => 'hi fred'
- *
- * // Partially applied with placeholders.
- * var sayHelloTo = _.partialRight(greet, 'hello', _);
- * sayHelloTo('fred');
- * // => 'hello fred'
- */
- var partialRight = baseRest(function(func, partials) {
- var holders = replaceHolders(partials, getHolder(partialRight));
- return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
- });
-
- /**
- * Creates a function that invokes `func` with arguments arranged according
- * to the specified `indexes` where the argument value at the first index is
- * provided as the first argument, the argument value at the second index is
- * provided as the second argument, and so on.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Function
- * @param {Function} func The function to rearrange arguments for.
- * @param {...(number|number[])} indexes The arranged argument indexes.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var rearged = _.rearg(function(a, b, c) {
- * return [a, b, c];
- * }, [2, 0, 1]);
- *
- * rearged('b', 'c', 'a')
- * // => ['a', 'b', 'c']
- */
- var rearg = flatRest(function(func, indexes) {
- return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
- });
-
- /**
- * Creates a function that invokes `func` with the `this` binding of the
- * created function and arguments from `start` and beyond provided as
- * an array.
- *
- * **Note:** This method is based on the
- * [rest parameter](https://mdn.io/rest_parameters).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Function
- * @param {Function} func The function to apply a rest parameter to.
- * @param {number} [start=func.length-1] The start position of the rest parameter.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var say = _.rest(function(what, names) {
- * return what + ' ' + _.initial(names).join(', ') +
- * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
- * });
- *
- * say('hello', 'fred', 'barney', 'pebbles');
- * // => 'hello fred, barney, & pebbles'
- */
- function rest(func, start) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- start = start === undefined ? start : toInteger(start);
- return baseRest(func, start);
- }
-
- /**
- * Creates a function that invokes `func` with the `this` binding of the
- * create function and an array of arguments much like
- * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
- *
- * **Note:** This method is based on the
- * [spread operator](https://mdn.io/spread_operator).
- *
- * @static
- * @memberOf _
- * @since 3.2.0
- * @category Function
- * @param {Function} func The function to spread arguments over.
- * @param {number} [start=0] The start position of the spread.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var say = _.spread(function(who, what) {
- * return who + ' says ' + what;
- * });
- *
- * say(['fred', 'hello']);
- * // => 'fred says hello'
- *
- * var numbers = Promise.all([
- * Promise.resolve(40),
- * Promise.resolve(36)
- * ]);
- *
- * numbers.then(_.spread(function(x, y) {
- * return x + y;
- * }));
- * // => a Promise of 76
- */
- function spread(func, start) {
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- start = start == null ? 0 : nativeMax(toInteger(start), 0);
- return baseRest(function(args) {
- var array = args[start],
- otherArgs = castSlice(args, 0, start);
-
- if (array) {
- arrayPush(otherArgs, array);
- }
- return apply(func, this, otherArgs);
- });
- }
-
- /**
- * Creates a throttled function that only invokes `func` at most once per
- * every `wait` milliseconds. The throttled function comes with a `cancel`
- * method to cancel delayed `func` invocations and a `flush` method to
- * immediately invoke them. Provide `options` to indicate whether `func`
- * should be invoked on the leading and/or trailing edge of the `wait`
- * timeout. The `func` is invoked with the last arguments provided to the
- * throttled function. Subsequent calls to the throttled function return the
- * result of the last `func` invocation.
- *
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
- * invoked on the trailing edge of the timeout only if the throttled function
- * is invoked more than once during the `wait` timeout.
- *
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
- *
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
- * for details over the differences between `_.throttle` and `_.debounce`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to throttle.
- * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
- * @param {Object} [options={}] The options object.
- * @param {boolean} [options.leading=true]
- * Specify invoking on the leading edge of the timeout.
- * @param {boolean} [options.trailing=true]
- * Specify invoking on the trailing edge of the timeout.
- * @returns {Function} Returns the new throttled function.
- * @example
- *
- * // Avoid excessively updating the position while scrolling.
- * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
- *
- * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
- * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
- * jQuery(element).on('click', throttled);
- *
- * // Cancel the trailing throttled invocation.
- * jQuery(window).on('popstate', throttled.cancel);
- */
- function throttle(func, wait, options) {
- var leading = true,
- trailing = true;
-
- if (typeof func != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- if (isObject(options)) {
- leading = 'leading' in options ? !!options.leading : leading;
- trailing = 'trailing' in options ? !!options.trailing : trailing;
- }
- return debounce(func, wait, {
- 'leading': leading,
- 'maxWait': wait,
- 'trailing': trailing
- });
- }
-
- /**
- * Creates a function that accepts up to one argument, ignoring any
- * additional arguments.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Function
- * @param {Function} func The function to cap arguments for.
- * @returns {Function} Returns the new capped function.
- * @example
- *
- * _.map(['6', '8', '10'], _.unary(parseInt));
- * // => [6, 8, 10]
- */
- function unary(func) {
- return ary(func, 1);
- }
-
- /**
- * Creates a function that provides `value` to `wrapper` as its first
- * argument. Any additional arguments provided to the function are appended
- * to those provided to the `wrapper`. The wrapper is invoked with the `this`
- * binding of the created function.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {*} value The value to wrap.
- * @param {Function} [wrapper=identity] The wrapper function.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var p = _.wrap(_.escape, function(func, text) {
- * return '<p>' + func(text) + '</p>';
- * });
- *
- * p('fred, barney, & pebbles');
- * // => '<p>fred, barney, & pebbles</p>'
- */
- function wrap(value, wrapper) {
- return partial(castFunction(wrapper), value);
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Casts `value` as an array if it's not one.
- *
- * @static
- * @memberOf _
- * @since 4.4.0
- * @category Lang
- * @param {*} value The value to inspect.
- * @returns {Array} Returns the cast array.
- * @example
- *
- * _.castArray(1);
- * // => [1]
- *
- * _.castArray({ 'a': 1 });
- * // => [{ 'a': 1 }]
- *
- * _.castArray('abc');
- * // => ['abc']
- *
- * _.castArray(null);
- * // => [null]
- *
- * _.castArray(undefined);
- * // => [undefined]
- *
- * _.castArray();
- * // => []
- *
- * var array = [1, 2, 3];
- * console.log(_.castArray(array) === array);
- * // => true
- */
- function castArray() {
- if (!arguments.length) {
- return [];
- }
- var value = arguments[0];
- return isArray(value) ? value : [value];
- }
-
- /**
- * Creates a shallow clone of `value`.
- *
- * **Note:** This method is loosely based on the
- * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
- * and supports cloning arrays, array buffers, booleans, date objects, maps,
- * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
- * arrays. The own enumerable properties of `arguments` objects are cloned
- * as plain objects. An empty object is returned for uncloneable values such
- * as error objects, functions, DOM nodes, and WeakMaps.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to clone.
- * @returns {*} Returns the cloned value.
- * @see _.cloneDeep
- * @example
- *
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
- *
- * var shallow = _.clone(objects);
- * console.log(shallow[0] === objects[0]);
- * // => true
- */
- function clone(value) {
- return baseClone(value, CLONE_SYMBOLS_FLAG);
- }
-
- /**
- * This method is like `_.clone` except that it accepts `customizer` which
- * is invoked to produce the cloned value. If `customizer` returns `undefined`,
- * cloning is handled by the method instead. The `customizer` is invoked with
- * up to four arguments; (value [, index|key, object, stack]).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to clone.
- * @param {Function} [customizer] The function to customize cloning.
- * @returns {*} Returns the cloned value.
- * @see _.cloneDeepWith
- * @example
- *
- * function customizer(value) {
- * if (_.isElement(value)) {
- * return value.cloneNode(false);
- * }
- * }
- *
- * var el = _.cloneWith(document.body, customizer);
- *
- * console.log(el === document.body);
- * // => false
- * console.log(el.nodeName);
- * // => 'BODY'
- * console.log(el.childNodes.length);
- * // => 0
- */
- function cloneWith(value, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
- }
-
- /**
- * This method is like `_.clone` except that it recursively clones `value`.
- *
- * @static
- * @memberOf _
- * @since 1.0.0
- * @category Lang
- * @param {*} value The value to recursively clone.
- * @returns {*} Returns the deep cloned value.
- * @see _.clone
- * @example
- *
- * var objects = [{ 'a': 1 }, { 'b': 2 }];
- *
- * var deep = _.cloneDeep(objects);
- * console.log(deep[0] === objects[0]);
- * // => false
- */
- function cloneDeep(value) {
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
- }
-
- /**
- * This method is like `_.cloneWith` except that it recursively clones `value`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to recursively clone.
- * @param {Function} [customizer] The function to customize cloning.
- * @returns {*} Returns the deep cloned value.
- * @see _.cloneWith
- * @example
- *
- * function customizer(value) {
- * if (_.isElement(value)) {
- * return value.cloneNode(true);
- * }
- * }
- *
- * var el = _.cloneDeepWith(document.body, customizer);
- *
- * console.log(el === document.body);
- * // => false
- * console.log(el.nodeName);
- * // => 'BODY'
- * console.log(el.childNodes.length);
- * // => 20
- */
- function cloneDeepWith(value, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
- }
-
- /**
- * Checks if `object` conforms to `source` by invoking the predicate
- * properties of `source` with the corresponding property values of `object`.
- *
- * **Note:** This method is equivalent to `_.conforms` when `source` is
- * partially applied.
- *
- * @static
- * @memberOf _
- * @since 4.14.0
- * @category Lang
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property predicates to conform to.
- * @returns {boolean} Returns `true` if `object` conforms, else `false`.
- * @example
- *
- * var object = { 'a': 1, 'b': 2 };
- *
- * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
- * // => true
- *
- * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
- * // => false
- */
- function conformsTo(object, source) {
- return source == null || baseConformsTo(object, source, keys(source));
- }
-
- /**
- * Performs a
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * comparison between two values to determine if they are equivalent.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * var object = { 'a': 1 };
- * var other = { 'a': 1 };
- *
- * _.eq(object, object);
- * // => true
- *
- * _.eq(object, other);
- * // => false
- *
- * _.eq('a', 'a');
- * // => true
- *
- * _.eq('a', Object('a'));
- * // => false
- *
- * _.eq(NaN, NaN);
- * // => true
- */
- function eq(value, other) {
- return value === other || (value !== value && other !== other);
- }
-
- /**
- * Checks if `value` is greater than `other`.
- *
- * @static
- * @memberOf _
- * @since 3.9.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is greater than `other`,
- * else `false`.
- * @see _.lt
- * @example
- *
- * _.gt(3, 1);
- * // => true
- *
- * _.gt(3, 3);
- * // => false
- *
- * _.gt(1, 3);
- * // => false
- */
- var gt = createRelationalOperation(baseGt);
-
- /**
- * Checks if `value` is greater than or equal to `other`.
- *
- * @static
- * @memberOf _
- * @since 3.9.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is greater than or equal to
- * `other`, else `false`.
- * @see _.lte
- * @example
- *
- * _.gte(3, 1);
- * // => true
- *
- * _.gte(3, 3);
- * // => true
- *
- * _.gte(1, 3);
- * // => false
- */
- var gte = createRelationalOperation(function(value, other) {
- return value >= other;
- });
-
- /**
- * Checks if `value` is likely an `arguments` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
- * else `false`.
- * @example
- *
- * _.isArguments(function() { return arguments; }());
- * // => true
- *
- * _.isArguments([1, 2, 3]);
- * // => false
- */
- var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
- return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
- !propertyIsEnumerable.call(value, 'callee');
- };
-
- /**
- * Checks if `value` is classified as an `Array` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
- * @example
- *
- * _.isArray([1, 2, 3]);
- * // => true
- *
- * _.isArray(document.body.children);
- * // => false
- *
- * _.isArray('abc');
- * // => false
- *
- * _.isArray(_.noop);
- * // => false
- */
- var isArray = Array.isArray;
-
- /**
- * Checks if `value` is classified as an `ArrayBuffer` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
- * @example
- *
- * _.isArrayBuffer(new ArrayBuffer(2));
- * // => true
- *
- * _.isArrayBuffer(new Array(2));
- * // => false
- */
- var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
-
- /**
- * Checks if `value` is array-like. A value is considered array-like if it's
- * not a function and has a `value.length` that's an integer greater than or
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
- * @example
- *
- * _.isArrayLike([1, 2, 3]);
- * // => true
- *
- * _.isArrayLike(document.body.children);
- * // => true
- *
- * _.isArrayLike('abc');
- * // => true
- *
- * _.isArrayLike(_.noop);
- * // => false
- */
- function isArrayLike(value) {
- return value != null && isLength(value.length) && !isFunction(value);
- }
-
- /**
- * This method is like `_.isArrayLike` except that it also checks if `value`
- * is an object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array-like object,
- * else `false`.
- * @example
- *
- * _.isArrayLikeObject([1, 2, 3]);
- * // => true
- *
- * _.isArrayLikeObject(document.body.children);
- * // => true
- *
- * _.isArrayLikeObject('abc');
- * // => false
- *
- * _.isArrayLikeObject(_.noop);
- * // => false
- */
- function isArrayLikeObject(value) {
- return isObjectLike(value) && isArrayLike(value);
- }
-
- /**
- * Checks if `value` is classified as a boolean primitive or object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
- * @example
- *
- * _.isBoolean(false);
- * // => true
- *
- * _.isBoolean(null);
- * // => false
- */
- function isBoolean(value) {
- return value === true || value === false ||
- (isObjectLike(value) && baseGetTag(value) == boolTag);
- }
-
- /**
- * Checks if `value` is a buffer.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
- * @example
- *
- * _.isBuffer(new Buffer(2));
- * // => true
- *
- * _.isBuffer(new Uint8Array(2));
- * // => false
- */
- var isBuffer = nativeIsBuffer || stubFalse;
-
- /**
- * Checks if `value` is classified as a `Date` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
- * @example
- *
- * _.isDate(new Date);
- * // => true
- *
- * _.isDate('Mon April 23 2012');
- * // => false
- */
- var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
-
- /**
- * Checks if `value` is likely a DOM element.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
- * @example
- *
- * _.isElement(document.body);
- * // => true
- *
- * _.isElement('<body>');
- * // => false
- */
- function isElement(value) {
- return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
- }
-
- /**
- * Checks if `value` is an empty object, collection, map, or set.
- *
- * Objects are considered empty if they have no own enumerable string keyed
- * properties.
- *
- * Array-like values such as `arguments` objects, arrays, buffers, strings, or
- * jQuery-like collections are considered empty if they have a `length` of `0`.
- * Similarly, maps and sets are considered empty if they have a `size` of `0`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is empty, else `false`.
- * @example
- *
- * _.isEmpty(null);
- * // => true
- *
- * _.isEmpty(true);
- * // => true
- *
- * _.isEmpty(1);
- * // => true
- *
- * _.isEmpty([1, 2, 3]);
- * // => false
- *
- * _.isEmpty({ 'a': 1 });
- * // => false
- */
- function isEmpty(value) {
- if (value == null) {
- return true;
- }
- if (isArrayLike(value) &&
- (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
- isBuffer(value) || isTypedArray(value) || isArguments(value))) {
- return !value.length;
- }
- var tag = getTag(value);
- if (tag == mapTag || tag == setTag) {
- return !value.size;
- }
- if (isPrototype(value)) {
- return !baseKeys(value).length;
- }
- for (var key in value) {
- if (hasOwnProperty.call(value, key)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Performs a deep comparison between two values to determine if they are
- * equivalent.
- *
- * **Note:** This method supports comparing arrays, array buffers, booleans,
- * date objects, error objects, maps, numbers, `Object` objects, regexes,
- * sets, strings, symbols, and typed arrays. `Object` objects are compared
- * by their own, not inherited, enumerable properties. Functions and DOM
- * nodes are compared by strict equality, i.e. `===`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * var object = { 'a': 1 };
- * var other = { 'a': 1 };
- *
- * _.isEqual(object, other);
- * // => true
- *
- * object === other;
- * // => false
- */
- function isEqual(value, other) {
- return baseIsEqual(value, other);
- }
-
- /**
- * This method is like `_.isEqual` except that it accepts `customizer` which
- * is invoked to compare values. If `customizer` returns `undefined`, comparisons
- * are handled by the method instead. The `customizer` is invoked with up to
- * six arguments: (objValue, othValue [, index|key, object, other, stack]).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @param {Function} [customizer] The function to customize comparisons.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * function isGreeting(value) {
- * return /^h(?:i|ello)$/.test(value);
- * }
- *
- * function customizer(objValue, othValue) {
- * if (isGreeting(objValue) && isGreeting(othValue)) {
- * return true;
- * }
- * }
- *
- * var array = ['hello', 'goodbye'];
- * var other = ['hi', 'goodbye'];
- *
- * _.isEqualWith(array, other, customizer);
- * // => true
- */
- function isEqualWith(value, other, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- var result = customizer ? customizer(value, other) : undefined;
- return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
- }
-
- /**
- * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
- * `SyntaxError`, `TypeError`, or `URIError` object.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
- * @example
- *
- * _.isError(new Error);
- * // => true
- *
- * _.isError(Error);
- * // => false
- */
- function isError(value) {
- if (!isObjectLike(value)) {
- return false;
- }
- var tag = baseGetTag(value);
- return tag == errorTag || tag == domExcTag ||
- (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
- }
-
- /**
- * Checks if `value` is a finite primitive number.
- *
- * **Note:** This method is based on
- * [`Number.isFinite`](https://mdn.io/Number/isFinite).
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
- * @example
- *
- * _.isFinite(3);
- * // => true
- *
- * _.isFinite(Number.MIN_VALUE);
- * // => true
- *
- * _.isFinite(Infinity);
- * // => false
- *
- * _.isFinite('3');
- * // => false
- */
- function isFinite(value) {
- return typeof value == 'number' && nativeIsFinite(value);
- }
-
- /**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
- function isFunction(value) {
- if (!isObject(value)) {
- return false;
- }
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in Safari 9 which returns 'object' for typed arrays and other constructors.
- var tag = baseGetTag(value);
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
- }
-
- /**
- * Checks if `value` is an integer.
- *
- * **Note:** This method is based on
- * [`Number.isInteger`](https://mdn.io/Number/isInteger).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
- * @example
- *
- * _.isInteger(3);
- * // => true
- *
- * _.isInteger(Number.MIN_VALUE);
- * // => false
- *
- * _.isInteger(Infinity);
- * // => false
- *
- * _.isInteger('3');
- * // => false
- */
- function isInteger(value) {
- return typeof value == 'number' && value == toInteger(value);
- }
-
- /**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This method is loosely based on
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- * @example
- *
- * _.isLength(3);
- * // => true
- *
- * _.isLength(Number.MIN_VALUE);
- * // => false
- *
- * _.isLength(Infinity);
- * // => false
- *
- * _.isLength('3');
- * // => false
- */
- function isLength(value) {
- return typeof value == 'number' &&
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
- }
-
- /**
- * Checks if `value` is the
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(_.noop);
- * // => true
- *
- * _.isObject(null);
- * // => false
- */
- function isObject(value) {
- var type = typeof value;
- return value != null && (type == 'object' || type == 'function');
- }
-
- /**
- * Checks if `value` is object-like. A value is object-like if it's not `null`
- * and has a `typeof` result of "object".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- * @example
- *
- * _.isObjectLike({});
- * // => true
- *
- * _.isObjectLike([1, 2, 3]);
- * // => true
- *
- * _.isObjectLike(_.noop);
- * // => false
- *
- * _.isObjectLike(null);
- * // => false
- */
- function isObjectLike(value) {
- return value != null && typeof value == 'object';
- }
-
- /**
- * Checks if `value` is classified as a `Map` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a map, else `false`.
- * @example
- *
- * _.isMap(new Map);
- * // => true
- *
- * _.isMap(new WeakMap);
- * // => false
- */
- var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
-
- /**
- * Performs a partial deep comparison between `object` and `source` to
- * determine if `object` contains equivalent property values.
- *
- * **Note:** This method is equivalent to `_.matches` when `source` is
- * partially applied.
- *
- * Partial comparisons will match empty array and empty object `source`
- * values against any array or object value, respectively. See `_.isEqual`
- * for a list of supported value comparisons.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property values to match.
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
- * @example
- *
- * var object = { 'a': 1, 'b': 2 };
- *
- * _.isMatch(object, { 'b': 2 });
- * // => true
- *
- * _.isMatch(object, { 'b': 1 });
- * // => false
- */
- function isMatch(object, source) {
- return object === source || baseIsMatch(object, source, getMatchData(source));
- }
-
- /**
- * This method is like `_.isMatch` except that it accepts `customizer` which
- * is invoked to compare values. If `customizer` returns `undefined`, comparisons
- * are handled by the method instead. The `customizer` is invoked with five
- * arguments: (objValue, srcValue, index|key, object, source).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {Object} object The object to inspect.
- * @param {Object} source The object of property values to match.
- * @param {Function} [customizer] The function to customize comparisons.
- * @returns {boolean} Returns `true` if `object` is a match, else `false`.
- * @example
- *
- * function isGreeting(value) {
- * return /^h(?:i|ello)$/.test(value);
- * }
- *
- * function customizer(objValue, srcValue) {
- * if (isGreeting(objValue) && isGreeting(srcValue)) {
- * return true;
- * }
- * }
- *
- * var object = { 'greeting': 'hello' };
- * var source = { 'greeting': 'hi' };
- *
- * _.isMatchWith(object, source, customizer);
- * // => true
- */
- function isMatchWith(object, source, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return baseIsMatch(object, source, getMatchData(source), customizer);
- }
-
- /**
- * Checks if `value` is `NaN`.
- *
- * **Note:** This method is based on
- * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
- * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
- * `undefined` and other non-number values.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
- * @example
- *
- * _.isNaN(NaN);
- * // => true
- *
- * _.isNaN(new Number(NaN));
- * // => true
- *
- * isNaN(undefined);
- * // => true
- *
- * _.isNaN(undefined);
- * // => false
- */
- function isNaN(value) {
- // An `NaN` primitive is the only value that is not equal to itself.
- // Perform the `toStringTag` check first to avoid errors with some
- // ActiveX objects in IE.
- return isNumber(value) && value != +value;
- }
-
- /**
- * Checks if `value` is a pristine native function.
- *
- * **Note:** This method can't reliably detect native functions in the presence
- * of the core-js package because core-js circumvents this kind of detection.
- * Despite multiple requests, the core-js maintainer has made it clear: any
- * attempt to fix the detection will be obstructed. As a result, we're left
- * with little choice but to throw an error. Unfortunately, this also affects
- * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
- * which rely on core-js.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function,
- * else `false`.
- * @example
- *
- * _.isNative(Array.prototype.push);
- * // => true
- *
- * _.isNative(_);
- * // => false
- */
- function isNative(value) {
- if (isMaskable(value)) {
- throw new Error(CORE_ERROR_TEXT);
- }
- return baseIsNative(value);
- }
-
- /**
- * Checks if `value` is `null`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
- * @example
- *
- * _.isNull(null);
- * // => true
- *
- * _.isNull(void 0);
- * // => false
- */
- function isNull(value) {
- return value === null;
- }
-
- /**
- * Checks if `value` is `null` or `undefined`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
- * @example
- *
- * _.isNil(null);
- * // => true
- *
- * _.isNil(void 0);
- * // => true
- *
- * _.isNil(NaN);
- * // => false
- */
- function isNil(value) {
- return value == null;
- }
-
- /**
- * Checks if `value` is classified as a `Number` primitive or object.
- *
- * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
- * classified as numbers, use the `_.isFinite` method.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a number, else `false`.
- * @example
- *
- * _.isNumber(3);
- * // => true
- *
- * _.isNumber(Number.MIN_VALUE);
- * // => true
- *
- * _.isNumber(Infinity);
- * // => true
- *
- * _.isNumber('3');
- * // => false
- */
- function isNumber(value) {
- return typeof value == 'number' ||
- (isObjectLike(value) && baseGetTag(value) == numberTag);
- }
-
- /**
- * Checks if `value` is a plain object, that is, an object created by the
- * `Object` constructor or one with a `[[Prototype]]` of `null`.
- *
- * @static
- * @memberOf _
- * @since 0.8.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * }
- *
- * _.isPlainObject(new Foo);
- * // => false
- *
- * _.isPlainObject([1, 2, 3]);
- * // => false
- *
- * _.isPlainObject({ 'x': 0, 'y': 0 });
- * // => true
- *
- * _.isPlainObject(Object.create(null));
- * // => true
- */
- function isPlainObject(value) {
- if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
- return false;
- }
- var proto = getPrototype(value);
- if (proto === null) {
- return true;
- }
- var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
- return typeof Ctor == 'function' && Ctor instanceof Ctor &&
- funcToString.call(Ctor) == objectCtorString;
- }
-
- /**
- * Checks if `value` is classified as a `RegExp` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
- * @example
- *
- * _.isRegExp(/abc/);
- * // => true
- *
- * _.isRegExp('/abc/');
- * // => false
- */
- var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
-
- /**
- * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
- * double precision number which isn't the result of a rounded unsafe integer.
- *
- * **Note:** This method is based on
- * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
- * @example
- *
- * _.isSafeInteger(3);
- * // => true
- *
- * _.isSafeInteger(Number.MIN_VALUE);
- * // => false
- *
- * _.isSafeInteger(Infinity);
- * // => false
- *
- * _.isSafeInteger('3');
- * // => false
- */
- function isSafeInteger(value) {
- return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
- }
-
- /**
- * Checks if `value` is classified as a `Set` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a set, else `false`.
- * @example
- *
- * _.isSet(new Set);
- * // => true
- *
- * _.isSet(new WeakSet);
- * // => false
- */
- var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
-
- /**
- * Checks if `value` is classified as a `String` primitive or object.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a string, else `false`.
- * @example
- *
- * _.isString('abc');
- * // => true
- *
- * _.isString(1);
- * // => false
- */
- function isString(value) {
- return typeof value == 'string' ||
- (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
- }
-
- /**
- * Checks if `value` is classified as a `Symbol` primitive or object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
- * @example
- *
- * _.isSymbol(Symbol.iterator);
- * // => true
- *
- * _.isSymbol('abc');
- * // => false
- */
- function isSymbol(value) {
- return typeof value == 'symbol' ||
- (isObjectLike(value) && baseGetTag(value) == symbolTag);
- }
-
- /**
- * Checks if `value` is classified as a typed array.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
- * @example
- *
- * _.isTypedArray(new Uint8Array);
- * // => true
- *
- * _.isTypedArray([]);
- * // => false
- */
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
-
- /**
- * Checks if `value` is `undefined`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
- * @example
- *
- * _.isUndefined(void 0);
- * // => true
- *
- * _.isUndefined(null);
- * // => false
- */
- function isUndefined(value) {
- return value === undefined;
- }
-
- /**
- * Checks if `value` is classified as a `WeakMap` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
- * @example
- *
- * _.isWeakMap(new WeakMap);
- * // => true
- *
- * _.isWeakMap(new Map);
- * // => false
- */
- function isWeakMap(value) {
- return isObjectLike(value) && getTag(value) == weakMapTag;
- }
-
- /**
- * Checks if `value` is classified as a `WeakSet` object.
- *
- * @static
- * @memberOf _
- * @since 4.3.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
- * @example
- *
- * _.isWeakSet(new WeakSet);
- * // => true
- *
- * _.isWeakSet(new Set);
- * // => false
- */
- function isWeakSet(value) {
- return isObjectLike(value) && baseGetTag(value) == weakSetTag;
- }
-
- /**
- * Checks if `value` is less than `other`.
- *
- * @static
- * @memberOf _
- * @since 3.9.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is less than `other`,
- * else `false`.
- * @see _.gt
- * @example
- *
- * _.lt(1, 3);
- * // => true
- *
- * _.lt(3, 3);
- * // => false
- *
- * _.lt(3, 1);
- * // => false
- */
- var lt = createRelationalOperation(baseLt);
-
- /**
- * Checks if `value` is less than or equal to `other`.
- *
- * @static
- * @memberOf _
- * @since 3.9.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if `value` is less than or equal to
- * `other`, else `false`.
- * @see _.gte
- * @example
- *
- * _.lte(1, 3);
- * // => true
- *
- * _.lte(3, 3);
- * // => true
- *
- * _.lte(3, 1);
- * // => false
- */
- var lte = createRelationalOperation(function(value, other) {
- return value <= other;
- });
-
- /**
- * Converts `value` to an array.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {Array} Returns the converted array.
- * @example
- *
- * _.toArray({ 'a': 1, 'b': 2 });
- * // => [1, 2]
- *
- * _.toArray('abc');
- * // => ['a', 'b', 'c']
- *
- * _.toArray(1);
- * // => []
- *
- * _.toArray(null);
- * // => []
- */
- function toArray(value) {
- if (!value) {
- return [];
- }
- if (isArrayLike(value)) {
- return isString(value) ? stringToArray(value) : copyArray(value);
- }
- if (symIterator && value[symIterator]) {
- return iteratorToArray(value[symIterator]());
- }
- var tag = getTag(value),
- func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
-
- return func(value);
- }
-
- /**
- * Converts `value` to a finite number.
- *
- * @static
- * @memberOf _
- * @since 4.12.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {number} Returns the converted number.
- * @example
- *
- * _.toFinite(3.2);
- * // => 3.2
- *
- * _.toFinite(Number.MIN_VALUE);
- * // => 5e-324
- *
- * _.toFinite(Infinity);
- * // => 1.7976931348623157e+308
- *
- * _.toFinite('3.2');
- * // => 3.2
- */
- function toFinite(value) {
- if (!value) {
- return value === 0 ? value : 0;
- }
- value = toNumber(value);
- if (value === INFINITY || value === -INFINITY) {
- var sign = (value < 0 ? -1 : 1);
- return sign * MAX_INTEGER;
- }
- return value === value ? value : 0;
- }
-
- /**
- * Converts `value` to an integer.
- *
- * **Note:** This method is loosely based on
- * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {number} Returns the converted integer.
- * @example
- *
- * _.toInteger(3.2);
- * // => 3
- *
- * _.toInteger(Number.MIN_VALUE);
- * // => 0
- *
- * _.toInteger(Infinity);
- * // => 1.7976931348623157e+308
- *
- * _.toInteger('3.2');
- * // => 3
- */
- function toInteger(value) {
- var result = toFinite(value),
- remainder = result % 1;
-
- return result === result ? (remainder ? result - remainder : result) : 0;
- }
-
- /**
- * Converts `value` to an integer suitable for use as the length of an
- * array-like object.
- *
- * **Note:** This method is based on
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {number} Returns the converted integer.
- * @example
- *
- * _.toLength(3.2);
- * // => 3
- *
- * _.toLength(Number.MIN_VALUE);
- * // => 0
- *
- * _.toLength(Infinity);
- * // => 4294967295
- *
- * _.toLength('3.2');
- * // => 3
- */
- function toLength(value) {
- return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
- }
-
- /**
- * Converts `value` to a number.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to process.
- * @returns {number} Returns the number.
- * @example
- *
- * _.toNumber(3.2);
- * // => 3.2
- *
- * _.toNumber(Number.MIN_VALUE);
- * // => 5e-324
- *
- * _.toNumber(Infinity);
- * // => Infinity
- *
- * _.toNumber('3.2');
- * // => 3.2
- */
- function toNumber(value) {
- if (typeof value == 'number') {
- return value;
- }
- if (isSymbol(value)) {
- return NAN;
- }
- if (isObject(value)) {
- var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
- value = isObject(other) ? (other + '') : other;
- }
- if (typeof value != 'string') {
- return value === 0 ? value : +value;
- }
- value = value.replace(reTrim, '');
- var isBinary = reIsBinary.test(value);
- return (isBinary || reIsOctal.test(value))
- ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
- : (reIsBadHex.test(value) ? NAN : +value);
- }
-
- /**
- * Converts `value` to a plain object flattening inherited enumerable string
- * keyed properties of `value` to own properties of the plain object.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {Object} Returns the converted plain object.
- * @example
- *
- * function Foo() {
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.assign({ 'a': 1 }, new Foo);
- * // => { 'a': 1, 'b': 2 }
- *
- * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
- * // => { 'a': 1, 'b': 2, 'c': 3 }
- */
- function toPlainObject(value) {
- return copyObject(value, keysIn(value));
- }
-
- /**
- * Converts `value` to a safe integer. A safe integer can be compared and
- * represented correctly.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {number} Returns the converted integer.
- * @example
- *
- * _.toSafeInteger(3.2);
- * // => 3
- *
- * _.toSafeInteger(Number.MIN_VALUE);
- * // => 0
- *
- * _.toSafeInteger(Infinity);
- * // => 9007199254740991
- *
- * _.toSafeInteger('3.2');
- * // => 3
- */
- function toSafeInteger(value) {
- return value
- ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
- : (value === 0 ? value : 0);
- }
-
- /**
- * Converts `value` to a string. An empty string is returned for `null`
- * and `undefined` values. The sign of `-0` is preserved.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to convert.
- * @returns {string} Returns the converted string.
- * @example
- *
- * _.toString(null);
- * // => ''
- *
- * _.toString(-0);
- * // => '-0'
- *
- * _.toString([1, 2, 3]);
- * // => '1,2,3'
- */
- function toString(value) {
- return value == null ? '' : baseToString(value);
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Assigns own enumerable string keyed properties of source objects to the
- * destination object. Source objects are applied from left to right.
- * Subsequent sources overwrite property assignments of previous sources.
- *
- * **Note:** This method mutates `object` and is loosely based on
- * [`Object.assign`](https://mdn.io/Object/assign).
- *
- * @static
- * @memberOf _
- * @since 0.10.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @see _.assignIn
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * }
- *
- * function Bar() {
- * this.c = 3;
- * }
- *
- * Foo.prototype.b = 2;
- * Bar.prototype.d = 4;
- *
- * _.assign({ 'a': 0 }, new Foo, new Bar);
- * // => { 'a': 1, 'c': 3 }
- */
- var assign = createAssigner(function(object, source) {
- if (isPrototype(source) || isArrayLike(source)) {
- copyObject(source, keys(source), object);
- return;
- }
- for (var key in source) {
- if (hasOwnProperty.call(source, key)) {
- assignValue(object, key, source[key]);
- }
- }
- });
-
- /**
- * This method is like `_.assign` except that it iterates over own and
- * inherited source properties.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @alias extend
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @see _.assign
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * }
- *
- * function Bar() {
- * this.c = 3;
- * }
- *
- * Foo.prototype.b = 2;
- * Bar.prototype.d = 4;
- *
- * _.assignIn({ 'a': 0 }, new Foo, new Bar);
- * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
- */
- var assignIn = createAssigner(function(object, source) {
- copyObject(source, keysIn(source), object);
- });
-
- /**
- * This method is like `_.assignIn` except that it accepts `customizer`
- * which is invoked to produce the assigned values. If `customizer` returns
- * `undefined`, assignment is handled by the method instead. The `customizer`
- * is invoked with five arguments: (objValue, srcValue, key, object, source).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @alias extendWith
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} sources The source objects.
- * @param {Function} [customizer] The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @see _.assignWith
- * @example
- *
- * function customizer(objValue, srcValue) {
- * return _.isUndefined(objValue) ? srcValue : objValue;
- * }
- *
- * var defaults = _.partialRight(_.assignInWith, customizer);
- *
- * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
- * // => { 'a': 1, 'b': 2 }
- */
- var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
- copyObject(source, keysIn(source), object, customizer);
- });
-
- /**
- * This method is like `_.assign` except that it accepts `customizer`
- * which is invoked to produce the assigned values. If `customizer` returns
- * `undefined`, assignment is handled by the method instead. The `customizer`
- * is invoked with five arguments: (objValue, srcValue, key, object, source).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} sources The source objects.
- * @param {Function} [customizer] The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @see _.assignInWith
- * @example
- *
- * function customizer(objValue, srcValue) {
- * return _.isUndefined(objValue) ? srcValue : objValue;
- * }
- *
- * var defaults = _.partialRight(_.assignWith, customizer);
- *
- * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
- * // => { 'a': 1, 'b': 2 }
- */
- var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
- copyObject(source, keys(source), object, customizer);
- });
-
- /**
- * Creates an array of values corresponding to `paths` of `object`.
- *
- * @static
- * @memberOf _
- * @since 1.0.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {...(string|string[])} [paths] The property paths to pick.
- * @returns {Array} Returns the picked values.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
- *
- * _.at(object, ['a[0].b.c', 'a[1]']);
- * // => [3, 4]
- */
- var at = flatRest(baseAt);
-
- /**
- * Creates an object that inherits from the `prototype` object. If a
- * `properties` object is given, its own enumerable string keyed properties
- * are assigned to the created object.
- *
- * @static
- * @memberOf _
- * @since 2.3.0
- * @category Object
- * @param {Object} prototype The object to inherit from.
- * @param {Object} [properties] The properties to assign to the object.
- * @returns {Object} Returns the new object.
- * @example
- *
- * function Shape() {
- * this.x = 0;
- * this.y = 0;
- * }
- *
- * function Circle() {
- * Shape.call(this);
- * }
- *
- * Circle.prototype = _.create(Shape.prototype, {
- * 'constructor': Circle
- * });
- *
- * var circle = new Circle;
- * circle instanceof Circle;
- * // => true
- *
- * circle instanceof Shape;
- * // => true
- */
- function create(prototype, properties) {
- var result = baseCreate(prototype);
- return properties == null ? result : baseAssign(result, properties);
- }
-
- /**
- * Assigns own and inherited enumerable string keyed properties of source
- * objects to the destination object for all destination properties that
- * resolve to `undefined`. Source objects are applied from left to right.
- * Once a property is set, additional values of the same property are ignored.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @see _.defaultsDeep
- * @example
- *
- * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
- * // => { 'a': 1, 'b': 2 }
- */
- var defaults = baseRest(function(object, sources) {
- object = Object(object);
-
- var index = -1;
- var length = sources.length;
- var guard = length > 2 ? sources[2] : undefined;
-
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- length = 1;
- }
-
- while (++index < length) {
- var source = sources[index];
- var props = keysIn(source);
- var propsIndex = -1;
- var propsLength = props.length;
-
- while (++propsIndex < propsLength) {
- var key = props[propsIndex];
- var value = object[key];
-
- if (value === undefined ||
- (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
- object[key] = source[key];
- }
- }
- }
-
- return object;
- });
-
- /**
- * This method is like `_.defaults` except that it recursively assigns
- * default properties.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 3.10.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @see _.defaults
- * @example
- *
- * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
- * // => { 'a': { 'b': 2, 'c': 3 } }
- */
- var defaultsDeep = baseRest(function(args) {
- args.push(undefined, customDefaultsMerge);
- return apply(mergeWith, undefined, args);
- });
-
- /**
- * This method is like `_.find` except that it returns the key of the first
- * element `predicate` returns truthy for instead of the element itself.
- *
- * @static
- * @memberOf _
- * @since 1.1.0
- * @category Object
- * @param {Object} object The object to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {string|undefined} Returns the key of the matched element,
- * else `undefined`.
- * @example
- *
- * var users = {
- * 'barney': { 'age': 36, 'active': true },
- * 'fred': { 'age': 40, 'active': false },
- * 'pebbles': { 'age': 1, 'active': true }
- * };
- *
- * _.findKey(users, function(o) { return o.age < 40; });
- * // => 'barney' (iteration order is not guaranteed)
- *
- * // The `_.matches` iteratee shorthand.
- * _.findKey(users, { 'age': 1, 'active': true });
- * // => 'pebbles'
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.findKey(users, ['active', false]);
- * // => 'fred'
- *
- * // The `_.property` iteratee shorthand.
- * _.findKey(users, 'active');
- * // => 'barney'
- */
- function findKey(object, predicate) {
- return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
- }
-
- /**
- * This method is like `_.findKey` except that it iterates over elements of
- * a collection in the opposite order.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Object
- * @param {Object} object The object to inspect.
- * @param {Function} [predicate=_.identity] The function invoked per iteration.
- * @returns {string|undefined} Returns the key of the matched element,
- * else `undefined`.
- * @example
- *
- * var users = {
- * 'barney': { 'age': 36, 'active': true },
- * 'fred': { 'age': 40, 'active': false },
- * 'pebbles': { 'age': 1, 'active': true }
- * };
- *
- * _.findLastKey(users, function(o) { return o.age < 40; });
- * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
- *
- * // The `_.matches` iteratee shorthand.
- * _.findLastKey(users, { 'age': 36, 'active': true });
- * // => 'barney'
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.findLastKey(users, ['active', false]);
- * // => 'fred'
- *
- * // The `_.property` iteratee shorthand.
- * _.findLastKey(users, 'active');
- * // => 'pebbles'
- */
- function findLastKey(object, predicate) {
- return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
- }
-
- /**
- * Iterates over own and inherited enumerable string keyed properties of an
- * object and invokes `iteratee` for each property. The iteratee is invoked
- * with three arguments: (value, key, object). Iteratee functions may exit
- * iteration early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @since 0.3.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns `object`.
- * @see _.forInRight
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forIn(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
- */
- function forIn(object, iteratee) {
- return object == null
- ? object
- : baseFor(object, getIteratee(iteratee, 3), keysIn);
- }
-
- /**
- * This method is like `_.forIn` except that it iterates over properties of
- * `object` in the opposite order.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns `object`.
- * @see _.forIn
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forInRight(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
- */
- function forInRight(object, iteratee) {
- return object == null
- ? object
- : baseForRight(object, getIteratee(iteratee, 3), keysIn);
- }
-
- /**
- * Iterates over own enumerable string keyed properties of an object and
- * invokes `iteratee` for each property. The iteratee is invoked with three
- * arguments: (value, key, object). Iteratee functions may exit iteration
- * early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @since 0.3.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns `object`.
- * @see _.forOwnRight
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forOwn(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'a' then 'b' (iteration order is not guaranteed).
- */
- function forOwn(object, iteratee) {
- return object && baseForOwn(object, getIteratee(iteratee, 3));
- }
-
- /**
- * This method is like `_.forOwn` except that it iterates over properties of
- * `object` in the opposite order.
- *
- * @static
- * @memberOf _
- * @since 2.0.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns `object`.
- * @see _.forOwn
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.forOwnRight(new Foo, function(value, key) {
- * console.log(key);
- * });
- * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
- */
- function forOwnRight(object, iteratee) {
- return object && baseForOwnRight(object, getIteratee(iteratee, 3));
- }
-
- /**
- * Creates an array of function property names from own enumerable properties
- * of `object`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to inspect.
- * @returns {Array} Returns the function names.
- * @see _.functionsIn
- * @example
- *
- * function Foo() {
- * this.a = _.constant('a');
- * this.b = _.constant('b');
- * }
- *
- * Foo.prototype.c = _.constant('c');
- *
- * _.functions(new Foo);
- * // => ['a', 'b']
- */
- function functions(object) {
- return object == null ? [] : baseFunctions(object, keys(object));
- }
-
- /**
- * Creates an array of function property names from own and inherited
- * enumerable properties of `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to inspect.
- * @returns {Array} Returns the function names.
- * @see _.functions
- * @example
- *
- * function Foo() {
- * this.a = _.constant('a');
- * this.b = _.constant('b');
- * }
- *
- * Foo.prototype.c = _.constant('c');
- *
- * _.functionsIn(new Foo);
- * // => ['a', 'b', 'c']
- */
- function functionsIn(object) {
- return object == null ? [] : baseFunctions(object, keysIn(object));
- }
-
- /**
- * Gets the value at `path` of `object`. If the resolved value is
- * `undefined`, the `defaultValue` is returned in its place.
- *
- * @static
- * @memberOf _
- * @since 3.7.0
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the property to get.
- * @param {*} [defaultValue] The value returned for `undefined` resolved values.
- * @returns {*} Returns the resolved value.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
- *
- * _.get(object, 'a[0].b.c');
- * // => 3
- *
- * _.get(object, ['a', '0', 'b', 'c']);
- * // => 3
- *
- * _.get(object, 'a.b.c', 'default');
- * // => 'default'
- */
- function get(object, path, defaultValue) {
- var result = object == null ? undefined : baseGet(object, path);
- return result === undefined ? defaultValue : result;
- }
-
- /**
- * Checks if `path` is a direct property of `object`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path to check.
- * @returns {boolean} Returns `true` if `path` exists, else `false`.
- * @example
- *
- * var object = { 'a': { 'b': 2 } };
- * var other = _.create({ 'a': _.create({ 'b': 2 }) });
- *
- * _.has(object, 'a');
- * // => true
- *
- * _.has(object, 'a.b');
- * // => true
- *
- * _.has(object, ['a', 'b']);
- * // => true
- *
- * _.has(other, 'a');
- * // => false
- */
- function has(object, path) {
- return object != null && hasPath(object, path, baseHas);
- }
-
- /**
- * Checks if `path` is a direct or inherited property of `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path to check.
- * @returns {boolean} Returns `true` if `path` exists, else `false`.
- * @example
- *
- * var object = _.create({ 'a': _.create({ 'b': 2 }) });
- *
- * _.hasIn(object, 'a');
- * // => true
- *
- * _.hasIn(object, 'a.b');
- * // => true
- *
- * _.hasIn(object, ['a', 'b']);
- * // => true
- *
- * _.hasIn(object, 'b');
- * // => false
- */
- function hasIn(object, path) {
- return object != null && hasPath(object, path, baseHasIn);
- }
-
- /**
- * Creates an object composed of the inverted keys and values of `object`.
- * If `object` contains duplicate values, subsequent values overwrite
- * property assignments of previous values.
- *
- * @static
- * @memberOf _
- * @since 0.7.0
- * @category Object
- * @param {Object} object The object to invert.
- * @returns {Object} Returns the new inverted object.
- * @example
- *
- * var object = { 'a': 1, 'b': 2, 'c': 1 };
- *
- * _.invert(object);
- * // => { '1': 'c', '2': 'b' }
- */
- var invert = createInverter(function(result, value, key) {
- if (value != null &&
- typeof value.toString != 'function') {
- value = nativeObjectToString.call(value);
- }
-
- result[value] = key;
- }, constant(identity));
-
- /**
- * This method is like `_.invert` except that the inverted object is generated
- * from the results of running each element of `object` thru `iteratee`. The
- * corresponding inverted value of each inverted key is an array of keys
- * responsible for generating the inverted value. The iteratee is invoked
- * with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.1.0
- * @category Object
- * @param {Object} object The object to invert.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {Object} Returns the new inverted object.
- * @example
- *
- * var object = { 'a': 1, 'b': 2, 'c': 1 };
- *
- * _.invertBy(object);
- * // => { '1': ['a', 'c'], '2': ['b'] }
- *
- * _.invertBy(object, function(value) {
- * return 'group' + value;
- * });
- * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
- */
- var invertBy = createInverter(function(result, value, key) {
- if (value != null &&
- typeof value.toString != 'function') {
- value = nativeObjectToString.call(value);
- }
-
- if (hasOwnProperty.call(result, value)) {
- result[value].push(key);
- } else {
- result[value] = [key];
- }
- }, getIteratee);
-
- /**
- * Invokes the method at `path` of `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the method to invoke.
- * @param {...*} [args] The arguments to invoke the method with.
- * @returns {*} Returns the result of the invoked method.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
- *
- * _.invoke(object, 'a[0].b.c.slice', 1, 3);
- * // => [2, 3]
- */
- var invoke = baseRest(baseInvoke);
-
- /**
- * Creates an array of the own enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects. See the
- * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
- * for more details.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keys(new Foo);
- * // => ['a', 'b'] (iteration order is not guaranteed)
- *
- * _.keys('hi');
- * // => ['0', '1']
- */
- function keys(object) {
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
- }
-
- /**
- * Creates an array of the own and inherited enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keysIn(new Foo);
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
- */
- function keysIn(object) {
- return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
- }
-
- /**
- * The opposite of `_.mapValues`; this method creates an object with the
- * same values as `object` and keys generated by running each own enumerable
- * string keyed property of `object` thru `iteratee`. The iteratee is invoked
- * with three arguments: (value, key, object).
- *
- * @static
- * @memberOf _
- * @since 3.8.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns the new mapped object.
- * @see _.mapValues
- * @example
- *
- * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
- * return key + value;
- * });
- * // => { 'a1': 1, 'b2': 2 }
- */
- function mapKeys(object, iteratee) {
- var result = {};
- iteratee = getIteratee(iteratee, 3);
-
- baseForOwn(object, function(value, key, object) {
- baseAssignValue(result, iteratee(value, key, object), value);
- });
- return result;
- }
-
- /**
- * Creates an object with the same keys as `object` and values generated
- * by running each own enumerable string keyed property of `object` thru
- * `iteratee`. The iteratee is invoked with three arguments:
- * (value, key, object).
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Object} Returns the new mapped object.
- * @see _.mapKeys
- * @example
- *
- * var users = {
- * 'fred': { 'user': 'fred', 'age': 40 },
- * 'pebbles': { 'user': 'pebbles', 'age': 1 }
- * };
- *
- * _.mapValues(users, function(o) { return o.age; });
- * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
- *
- * // The `_.property` iteratee shorthand.
- * _.mapValues(users, 'age');
- * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
- */
- function mapValues(object, iteratee) {
- var result = {};
- iteratee = getIteratee(iteratee, 3);
-
- baseForOwn(object, function(value, key, object) {
- baseAssignValue(result, key, iteratee(value, key, object));
- });
- return result;
- }
-
- /**
- * This method is like `_.assign` except that it recursively merges own and
- * inherited enumerable string keyed properties of source objects into the
- * destination object. Source properties that resolve to `undefined` are
- * skipped if a destination value exists. Array and plain object properties
- * are merged recursively. Other objects and value types are overridden by
- * assignment. Source objects are applied from left to right. Subsequent
- * sources overwrite property assignments of previous sources.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 0.5.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} [sources] The source objects.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = {
- * 'a': [{ 'b': 2 }, { 'd': 4 }]
- * };
- *
- * var other = {
- * 'a': [{ 'c': 3 }, { 'e': 5 }]
- * };
- *
- * _.merge(object, other);
- * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
- */
- var merge = createAssigner(function(object, source, srcIndex) {
- baseMerge(object, source, srcIndex);
- });
-
- /**
- * This method is like `_.merge` except that it accepts `customizer` which
- * is invoked to produce the merged values of the destination and source
- * properties. If `customizer` returns `undefined`, merging is handled by the
- * method instead. The `customizer` is invoked with six arguments:
- * (objValue, srcValue, key, object, source, stack).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The destination object.
- * @param {...Object} sources The source objects.
- * @param {Function} customizer The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @example
- *
- * function customizer(objValue, srcValue) {
- * if (_.isArray(objValue)) {
- * return objValue.concat(srcValue);
- * }
- * }
- *
- * var object = { 'a': [1], 'b': [2] };
- * var other = { 'a': [3], 'b': [4] };
- *
- * _.mergeWith(object, other, customizer);
- * // => { 'a': [1, 3], 'b': [2, 4] }
- */
- var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
- baseMerge(object, source, srcIndex, customizer);
- });
-
- /**
- * The opposite of `_.pick`; this method creates an object composed of the
- * own and inherited enumerable property paths of `object` that are not omitted.
- *
- * **Note:** This method is considerably slower than `_.pick`.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The source object.
- * @param {...(string|string[])} [paths] The property paths to omit.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
- *
- * _.omit(object, ['a', 'c']);
- * // => { 'b': '2' }
- */
- var omit = flatRest(function(object, paths) {
- var result = {};
- if (object == null) {
- return result;
- }
- var isDeep = false;
- paths = arrayMap(paths, function(path) {
- path = castPath(path, object);
- isDeep || (isDeep = path.length > 1);
- return path;
- });
- copyObject(object, getAllKeysIn(object), result);
- if (isDeep) {
- result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
- }
- var length = paths.length;
- while (length--) {
- baseUnset(result, paths[length]);
- }
- return result;
- });
-
- /**
- * The opposite of `_.pickBy`; this method creates an object composed of
- * the own and inherited enumerable string keyed properties of `object` that
- * `predicate` doesn't return truthy for. The predicate is invoked with two
- * arguments: (value, key).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The source object.
- * @param {Function} [predicate=_.identity] The function invoked per property.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
- *
- * _.omitBy(object, _.isNumber);
- * // => { 'b': '2' }
- */
- function omitBy(object, predicate) {
- return pickBy(object, negate(getIteratee(predicate)));
- }
-
- /**
- * Creates an object composed of the picked `object` properties.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The source object.
- * @param {...(string|string[])} [paths] The property paths to pick.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
- *
- * _.pick(object, ['a', 'c']);
- * // => { 'a': 1, 'c': 3 }
- */
- var pick = flatRest(function(object, paths) {
- return object == null ? {} : basePick(object, paths);
- });
-
- /**
- * Creates an object composed of the `object` properties `predicate` returns
- * truthy for. The predicate is invoked with two arguments: (value, key).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The source object.
- * @param {Function} [predicate=_.identity] The function invoked per property.
- * @returns {Object} Returns the new object.
- * @example
- *
- * var object = { 'a': 1, 'b': '2', 'c': 3 };
- *
- * _.pickBy(object, _.isNumber);
- * // => { 'a': 1, 'c': 3 }
- */
- function pickBy(object, predicate) {
- if (object == null) {
- return {};
- }
- var props = arrayMap(getAllKeysIn(object), function(prop) {
- return [prop];
- });
- predicate = getIteratee(predicate);
- return basePickBy(object, props, function(value, path) {
- return predicate(value, path[0]);
- });
- }
-
- /**
- * This method is like `_.get` except that if the resolved value is a
- * function it's invoked with the `this` binding of its parent object and
- * its result is returned.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the property to resolve.
- * @param {*} [defaultValue] The value returned for `undefined` resolved values.
- * @returns {*} Returns the resolved value.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
- *
- * _.result(object, 'a[0].b.c1');
- * // => 3
- *
- * _.result(object, 'a[0].b.c2');
- * // => 4
- *
- * _.result(object, 'a[0].b.c3', 'default');
- * // => 'default'
- *
- * _.result(object, 'a[0].b.c3', _.constant('default'));
- * // => 'default'
- */
- function result(object, path, defaultValue) {
- path = castPath(path, object);
-
- var index = -1,
- length = path.length;
-
- // Ensure the loop is entered when path is empty.
- if (!length) {
- length = 1;
- object = undefined;
- }
- while (++index < length) {
- var value = object == null ? undefined : object[toKey(path[index])];
- if (value === undefined) {
- index = length;
- value = defaultValue;
- }
- object = isFunction(value) ? value.call(object) : value;
- }
- return object;
- }
-
- /**
- * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
- * it's created. Arrays are created for missing index properties while objects
- * are created for all other missing properties. Use `_.setWith` to customize
- * `path` creation.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 3.7.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
- *
- * _.set(object, 'a[0].b.c', 4);
- * console.log(object.a[0].b.c);
- * // => 4
- *
- * _.set(object, ['x', '0', 'y', 'z'], 5);
- * console.log(object.x[0].y.z);
- * // => 5
- */
- function set(object, path, value) {
- return object == null ? object : baseSet(object, path, value);
- }
-
- /**
- * This method is like `_.set` except that it accepts `customizer` which is
- * invoked to produce the objects of `path`. If `customizer` returns `undefined`
- * path creation is handled by the method instead. The `customizer` is invoked
- * with three arguments: (nsValue, key, nsObject).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {*} value The value to set.
- * @param {Function} [customizer] The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = {};
- *
- * _.setWith(object, '[0][1]', 'a', Object);
- * // => { '0': { '1': 'a' } }
- */
- function setWith(object, path, value, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return object == null ? object : baseSet(object, path, value, customizer);
- }
-
- /**
- * Creates an array of own enumerable string keyed-value pairs for `object`
- * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
- * entries are returned.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @alias entries
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the key-value pairs.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.toPairs(new Foo);
- * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
- */
- var toPairs = createToPairs(keys);
-
- /**
- * Creates an array of own and inherited enumerable string keyed-value pairs
- * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
- * or set, its entries are returned.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @alias entriesIn
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the key-value pairs.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.toPairsIn(new Foo);
- * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
- */
- var toPairsIn = createToPairs(keysIn);
-
- /**
- * An alternative to `_.reduce`; this method transforms `object` to a new
- * `accumulator` object which is the result of running each of its own
- * enumerable string keyed properties thru `iteratee`, with each invocation
- * potentially mutating the `accumulator` object. If `accumulator` is not
- * provided, a new object with the same `[[Prototype]]` will be used. The
- * iteratee is invoked with four arguments: (accumulator, value, key, object).
- * Iteratee functions may exit iteration early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @since 1.3.0
- * @category Object
- * @param {Object} object The object to iterate over.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @param {*} [accumulator] The custom accumulator value.
- * @returns {*} Returns the accumulated value.
- * @example
- *
- * _.transform([2, 3, 4], function(result, n) {
- * result.push(n *= n);
- * return n % 2 == 0;
- * }, []);
- * // => [4, 9]
- *
- * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
- * (result[value] || (result[value] = [])).push(key);
- * }, {});
- * // => { '1': ['a', 'c'], '2': ['b'] }
- */
- function transform(object, iteratee, accumulator) {
- var isArr = isArray(object),
- isArrLike = isArr || isBuffer(object) || isTypedArray(object);
-
- iteratee = getIteratee(iteratee, 4);
- if (accumulator == null) {
- var Ctor = object && object.constructor;
- if (isArrLike) {
- accumulator = isArr ? new Ctor : [];
- }
- else if (isObject(object)) {
- accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
- }
- else {
- accumulator = {};
- }
- }
- (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
- return iteratee(accumulator, value, index, object);
- });
- return accumulator;
- }
-
- /**
- * Removes the property at `path` of `object`.
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to unset.
- * @returns {boolean} Returns `true` if the property is deleted, else `false`.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 7 } }] };
- * _.unset(object, 'a[0].b.c');
- * // => true
- *
- * console.log(object);
- * // => { 'a': [{ 'b': {} }] };
- *
- * _.unset(object, ['a', '0', 'b', 'c']);
- * // => true
- *
- * console.log(object);
- * // => { 'a': [{ 'b': {} }] };
- */
- function unset(object, path) {
- return object == null ? true : baseUnset(object, path);
- }
-
- /**
- * This method is like `_.set` except that accepts `updater` to produce the
- * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
- * is invoked with one argument: (value).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.6.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {Function} updater The function to produce the updated value.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
- *
- * _.update(object, 'a[0].b.c', function(n) { return n * n; });
- * console.log(object.a[0].b.c);
- * // => 9
- *
- * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
- * console.log(object.x[0].y.z);
- * // => 0
- */
- function update(object, path, updater) {
- return object == null ? object : baseUpdate(object, path, castFunction(updater));
- }
-
- /**
- * This method is like `_.update` except that it accepts `customizer` which is
- * invoked to produce the objects of `path`. If `customizer` returns `undefined`
- * path creation is handled by the method instead. The `customizer` is invoked
- * with three arguments: (nsValue, key, nsObject).
- *
- * **Note:** This method mutates `object`.
- *
- * @static
- * @memberOf _
- * @since 4.6.0
- * @category Object
- * @param {Object} object The object to modify.
- * @param {Array|string} path The path of the property to set.
- * @param {Function} updater The function to produce the updated value.
- * @param {Function} [customizer] The function to customize assigned values.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var object = {};
- *
- * _.updateWith(object, '[0][1]', _.constant('a'), Object);
- * // => { '0': { '1': 'a' } }
- */
- function updateWith(object, path, updater, customizer) {
- customizer = typeof customizer == 'function' ? customizer : undefined;
- return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
- }
-
- /**
- * Creates an array of the own enumerable string keyed property values of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property values.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.values(new Foo);
- * // => [1, 2] (iteration order is not guaranteed)
- *
- * _.values('hi');
- * // => ['h', 'i']
- */
- function values(object) {
- return object == null ? [] : baseValues(object, keys(object));
- }
-
- /**
- * Creates an array of the own and inherited enumerable string keyed property
- * values of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property values.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.valuesIn(new Foo);
- * // => [1, 2, 3] (iteration order is not guaranteed)
- */
- function valuesIn(object) {
- return object == null ? [] : baseValues(object, keysIn(object));
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Clamps `number` within the inclusive `lower` and `upper` bounds.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Number
- * @param {number} number The number to clamp.
- * @param {number} [lower] The lower bound.
- * @param {number} upper The upper bound.
- * @returns {number} Returns the clamped number.
- * @example
- *
- * _.clamp(-10, -5, 5);
- * // => -5
- *
- * _.clamp(10, -5, 5);
- * // => 5
- */
- function clamp(number, lower, upper) {
- if (upper === undefined) {
- upper = lower;
- lower = undefined;
- }
- if (upper !== undefined) {
- upper = toNumber(upper);
- upper = upper === upper ? upper : 0;
- }
- if (lower !== undefined) {
- lower = toNumber(lower);
- lower = lower === lower ? lower : 0;
- }
- return baseClamp(toNumber(number), lower, upper);
- }
-
- /**
- * Checks if `n` is between `start` and up to, but not including, `end`. If
- * `end` is not specified, it's set to `start` with `start` then set to `0`.
- * If `start` is greater than `end` the params are swapped to support
- * negative ranges.
- *
- * @static
- * @memberOf _
- * @since 3.3.0
- * @category Number
- * @param {number} number The number to check.
- * @param {number} [start=0] The start of the range.
- * @param {number} end The end of the range.
- * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
- * @see _.range, _.rangeRight
- * @example
- *
- * _.inRange(3, 2, 4);
- * // => true
- *
- * _.inRange(4, 8);
- * // => true
- *
- * _.inRange(4, 2);
- * // => false
- *
- * _.inRange(2, 2);
- * // => false
- *
- * _.inRange(1.2, 2);
- * // => true
- *
- * _.inRange(5.2, 4);
- * // => false
- *
- * _.inRange(-3, -2, -6);
- * // => true
- */
- function inRange(number, start, end) {
- start = toFinite(start);
- if (end === undefined) {
- end = start;
- start = 0;
- } else {
- end = toFinite(end);
- }
- number = toNumber(number);
- return baseInRange(number, start, end);
- }
-
- /**
- * Produces a random number between the inclusive `lower` and `upper` bounds.
- * If only one argument is provided a number between `0` and the given number
- * is returned. If `floating` is `true`, or either `lower` or `upper` are
- * floats, a floating-point number is returned instead of an integer.
- *
- * **Note:** JavaScript follows the IEEE-754 standard for resolving
- * floating-point values which can produce unexpected results.
- *
- * @static
- * @memberOf _
- * @since 0.7.0
- * @category Number
- * @param {number} [lower=0] The lower bound.
- * @param {number} [upper=1] The upper bound.
- * @param {boolean} [floating] Specify returning a floating-point number.
- * @returns {number} Returns the random number.
- * @example
- *
- * _.random(0, 5);
- * // => an integer between 0 and 5
- *
- * _.random(5);
- * // => also an integer between 0 and 5
- *
- * _.random(5, true);
- * // => a floating-point number between 0 and 5
- *
- * _.random(1.2, 5.2);
- * // => a floating-point number between 1.2 and 5.2
- */
- function random(lower, upper, floating) {
- if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
- upper = floating = undefined;
- }
- if (floating === undefined) {
- if (typeof upper == 'boolean') {
- floating = upper;
- upper = undefined;
- }
- else if (typeof lower == 'boolean') {
- floating = lower;
- lower = undefined;
- }
- }
- if (lower === undefined && upper === undefined) {
- lower = 0;
- upper = 1;
- }
- else {
- lower = toFinite(lower);
- if (upper === undefined) {
- upper = lower;
- lower = 0;
- } else {
- upper = toFinite(upper);
- }
- }
- if (lower > upper) {
- var temp = lower;
- lower = upper;
- upper = temp;
- }
- if (floating || lower % 1 || upper % 1) {
- var rand = nativeRandom();
- return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
- }
- return baseRandom(lower, upper);
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the camel cased string.
- * @example
- *
- * _.camelCase('Foo Bar');
- * // => 'fooBar'
- *
- * _.camelCase('--foo-bar--');
- * // => 'fooBar'
- *
- * _.camelCase('__FOO_BAR__');
- * // => 'fooBar'
- */
- var camelCase = createCompounder(function(result, word, index) {
- word = word.toLowerCase();
- return result + (index ? capitalize(word) : word);
- });
-
- /**
- * Converts the first character of `string` to upper case and the remaining
- * to lower case.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to capitalize.
- * @returns {string} Returns the capitalized string.
- * @example
- *
- * _.capitalize('FRED');
- * // => 'Fred'
- */
- function capitalize(string) {
- return upperFirst(toString(string).toLowerCase());
- }
-
- /**
- * Deburrs `string` by converting
- * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
- * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
- * letters to basic Latin letters and removing
- * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to deburr.
- * @returns {string} Returns the deburred string.
- * @example
- *
- * _.deburr('déjà vu');
- * // => 'deja vu'
- */
- function deburr(string) {
- string = toString(string);
- return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
- }
-
- /**
- * Checks if `string` ends with the given target string.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to inspect.
- * @param {string} [target] The string to search for.
- * @param {number} [position=string.length] The position to search up to.
- * @returns {boolean} Returns `true` if `string` ends with `target`,
- * else `false`.
- * @example
- *
- * _.endsWith('abc', 'c');
- * // => true
- *
- * _.endsWith('abc', 'b');
- * // => false
- *
- * _.endsWith('abc', 'b', 2);
- * // => true
- */
- function endsWith(string, target, position) {
- string = toString(string);
- target = baseToString(target);
-
- var length = string.length;
- position = position === undefined
- ? length
- : baseClamp(toInteger(position), 0, length);
-
- var end = position;
- position -= target.length;
- return position >= 0 && string.slice(position, end) == target;
- }
-
- /**
- * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
- * corresponding HTML entities.
- *
- * **Note:** No other characters are escaped. To escape additional
- * characters use a third-party library like [_he_](https://mths.be/he).
- *
- * Though the ">" character is escaped for symmetry, characters like
- * ">" and "/" don't need escaping in HTML and have no special meaning
- * unless they're part of a tag or unquoted attribute value. See
- * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
- * (under "semi-related fun fact") for more details.
- *
- * When working with HTML you should always
- * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
- * XSS vectors.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to escape.
- * @returns {string} Returns the escaped string.
- * @example
- *
- * _.escape('fred, barney, & pebbles');
- * // => 'fred, barney, & pebbles'
- */
- function escape(string) {
- string = toString(string);
- return (string && reHasUnescapedHtml.test(string))
- ? string.replace(reUnescapedHtml, escapeHtmlChar)
- : string;
- }
-
- /**
- * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
- * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to escape.
- * @returns {string} Returns the escaped string.
- * @example
- *
- * _.escapeRegExp('[lodash](https://lodash.com/)');
- * // => '\[lodash\]\(https://lodash\.com/\)'
- */
- function escapeRegExp(string) {
- string = toString(string);
- return (string && reHasRegExpChar.test(string))
- ? string.replace(reRegExpChar, '\\$&')
- : string;
- }
-
- /**
- * Converts `string` to
- * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the kebab cased string.
- * @example
- *
- * _.kebabCase('Foo Bar');
- * // => 'foo-bar'
- *
- * _.kebabCase('fooBar');
- * // => 'foo-bar'
- *
- * _.kebabCase('__FOO_BAR__');
- * // => 'foo-bar'
- */
- var kebabCase = createCompounder(function(result, word, index) {
- return result + (index ? '-' : '') + word.toLowerCase();
- });
-
- /**
- * Converts `string`, as space separated words, to lower case.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the lower cased string.
- * @example
- *
- * _.lowerCase('--Foo-Bar--');
- * // => 'foo bar'
- *
- * _.lowerCase('fooBar');
- * // => 'foo bar'
- *
- * _.lowerCase('__FOO_BAR__');
- * // => 'foo bar'
- */
- var lowerCase = createCompounder(function(result, word, index) {
- return result + (index ? ' ' : '') + word.toLowerCase();
- });
-
- /**
- * Converts the first character of `string` to lower case.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the converted string.
- * @example
- *
- * _.lowerFirst('Fred');
- * // => 'fred'
- *
- * _.lowerFirst('FRED');
- * // => 'fRED'
- */
- var lowerFirst = createCaseFirst('toLowerCase');
-
- /**
- * Pads `string` on the left and right sides if it's shorter than `length`.
- * Padding characters are truncated if they can't be evenly divided by `length`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to pad.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padded string.
- * @example
- *
- * _.pad('abc', 8);
- * // => ' abc '
- *
- * _.pad('abc', 8, '_-');
- * // => '_-abc_-_'
- *
- * _.pad('abc', 3);
- * // => 'abc'
- */
- function pad(string, length, chars) {
- string = toString(string);
- length = toInteger(length);
-
- var strLength = length ? stringSize(string) : 0;
- if (!length || strLength >= length) {
- return string;
- }
- var mid = (length - strLength) / 2;
- return (
- createPadding(nativeFloor(mid), chars) +
- string +
- createPadding(nativeCeil(mid), chars)
- );
- }
-
- /**
- * Pads `string` on the right side if it's shorter than `length`. Padding
- * characters are truncated if they exceed `length`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to pad.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padded string.
- * @example
- *
- * _.padEnd('abc', 6);
- * // => 'abc '
- *
- * _.padEnd('abc', 6, '_-');
- * // => 'abc_-_'
- *
- * _.padEnd('abc', 3);
- * // => 'abc'
- */
- function padEnd(string, length, chars) {
- string = toString(string);
- length = toInteger(length);
-
- var strLength = length ? stringSize(string) : 0;
- return (length && strLength < length)
- ? (string + createPadding(length - strLength, chars))
- : string;
- }
-
- /**
- * Pads `string` on the left side if it's shorter than `length`. Padding
- * characters are truncated if they exceed `length`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to pad.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the padded string.
- * @example
- *
- * _.padStart('abc', 6);
- * // => ' abc'
- *
- * _.padStart('abc', 6, '_-');
- * // => '_-_abc'
- *
- * _.padStart('abc', 3);
- * // => 'abc'
- */
- function padStart(string, length, chars) {
- string = toString(string);
- length = toInteger(length);
-
- var strLength = length ? stringSize(string) : 0;
- return (length && strLength < length)
- ? (createPadding(length - strLength, chars) + string)
- : string;
- }
-
- /**
- * Converts `string` to an integer of the specified radix. If `radix` is
- * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
- * hexadecimal, in which case a `radix` of `16` is used.
- *
- * **Note:** This method aligns with the
- * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
- *
- * @static
- * @memberOf _
- * @since 1.1.0
- * @category String
- * @param {string} string The string to convert.
- * @param {number} [radix=10] The radix to interpret `value` by.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {number} Returns the converted integer.
- * @example
- *
- * _.parseInt('08');
- * // => 8
- *
- * _.map(['6', '08', '10'], _.parseInt);
- * // => [6, 8, 10]
- */
- function parseInt(string, radix, guard) {
- if (guard || radix == null) {
- radix = 0;
- } else if (radix) {
- radix = +radix;
- }
- return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
- }
-
- /**
- * Repeats the given string `n` times.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to repeat.
- * @param {number} [n=1] The number of times to repeat the string.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {string} Returns the repeated string.
- * @example
- *
- * _.repeat('*', 3);
- * // => '***'
- *
- * _.repeat('abc', 2);
- * // => 'abcabc'
- *
- * _.repeat('abc', 0);
- * // => ''
- */
- function repeat(string, n, guard) {
- if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
- n = 1;
- } else {
- n = toInteger(n);
- }
- return baseRepeat(toString(string), n);
- }
-
- /**
- * Replaces matches for `pattern` in `string` with `replacement`.
- *
- * **Note:** This method is based on
- * [`String#replace`](https://mdn.io/String/replace).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to modify.
- * @param {RegExp|string} pattern The pattern to replace.
- * @param {Function|string} replacement The match replacement.
- * @returns {string} Returns the modified string.
- * @example
- *
- * _.replace('Hi Fred', 'Fred', 'Barney');
- * // => 'Hi Barney'
- */
- function replace() {
- var args = arguments,
- string = toString(args[0]);
-
- return args.length < 3 ? string : string.replace(args[1], args[2]);
- }
-
- /**
- * Converts `string` to
- * [snake case](https://en.wikipedia.org/wiki/Snake_case).
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the snake cased string.
- * @example
- *
- * _.snakeCase('Foo Bar');
- * // => 'foo_bar'
- *
- * _.snakeCase('fooBar');
- * // => 'foo_bar'
- *
- * _.snakeCase('--FOO-BAR--');
- * // => 'foo_bar'
- */
- var snakeCase = createCompounder(function(result, word, index) {
- return result + (index ? '_' : '') + word.toLowerCase();
- });
-
- /**
- * Splits `string` by `separator`.
- *
- * **Note:** This method is based on
- * [`String#split`](https://mdn.io/String/split).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to split.
- * @param {RegExp|string} separator The separator pattern to split by.
- * @param {number} [limit] The length to truncate results to.
- * @returns {Array} Returns the string segments.
- * @example
- *
- * _.split('a-b-c', '-', 2);
- * // => ['a', 'b']
- */
- function split(string, separator, limit) {
- if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
- separator = limit = undefined;
- }
- limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
- if (!limit) {
- return [];
- }
- string = toString(string);
- if (string && (
- typeof separator == 'string' ||
- (separator != null && !isRegExp(separator))
- )) {
- separator = baseToString(separator);
- if (!separator && hasUnicode(string)) {
- return castSlice(stringToArray(string), 0, limit);
- }
- }
- return string.split(separator, limit);
- }
-
- /**
- * Converts `string` to
- * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
- *
- * @static
- * @memberOf _
- * @since 3.1.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the start cased string.
- * @example
- *
- * _.startCase('--foo-bar--');
- * // => 'Foo Bar'
- *
- * _.startCase('fooBar');
- * // => 'Foo Bar'
- *
- * _.startCase('__FOO_BAR__');
- * // => 'FOO BAR'
- */
- var startCase = createCompounder(function(result, word, index) {
- return result + (index ? ' ' : '') + upperFirst(word);
- });
-
- /**
- * Checks if `string` starts with the given target string.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to inspect.
- * @param {string} [target] The string to search for.
- * @param {number} [position=0] The position to search from.
- * @returns {boolean} Returns `true` if `string` starts with `target`,
- * else `false`.
- * @example
- *
- * _.startsWith('abc', 'a');
- * // => true
- *
- * _.startsWith('abc', 'b');
- * // => false
- *
- * _.startsWith('abc', 'b', 1);
- * // => true
- */
- function startsWith(string, target, position) {
- string = toString(string);
- position = position == null
- ? 0
- : baseClamp(toInteger(position), 0, string.length);
-
- target = baseToString(target);
- return string.slice(position, position + target.length) == target;
- }
-
- /**
- * Creates a compiled template function that can interpolate data properties
- * in "interpolate" delimiters, HTML-escape interpolated data properties in
- * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
- * properties may be accessed as free variables in the template. If a setting
- * object is given, it takes precedence over `_.templateSettings` values.
- *
- * **Note:** In the development build `_.template` utilizes
- * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
- * for easier debugging.
- *
- * For more information on precompiling templates see
- * [lodash's custom builds documentation](https://lodash.com/custom-builds).
- *
- * For more information on Chrome extension sandboxes see
- * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category String
- * @param {string} [string=''] The template string.
- * @param {Object} [options={}] The options object.
- * @param {RegExp} [options.escape=_.templateSettings.escape]
- * The HTML "escape" delimiter.
- * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
- * The "evaluate" delimiter.
- * @param {Object} [options.imports=_.templateSettings.imports]
- * An object to import into the template as free variables.
- * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
- * The "interpolate" delimiter.
- * @param {string} [options.sourceURL='lodash.templateSources[n]']
- * The sourceURL of the compiled template.
- * @param {string} [options.variable='obj']
- * The data object variable name.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Function} Returns the compiled template function.
- * @example
- *
- * // Use the "interpolate" delimiter to create a compiled template.
- * var compiled = _.template('hello <%= user %>!');
- * compiled({ 'user': 'fred' });
- * // => 'hello fred!'
- *
- * // Use the HTML "escape" delimiter to escape data property values.
- * var compiled = _.template('<b><%- value %></b>');
- * compiled({ 'value': '<script>' });
- * // => '<b><script></b>'
- *
- * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
- * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
- * compiled({ 'users': ['fred', 'barney'] });
- * // => '<li>fred</li><li>barney</li>'
- *
- * // Use the internal `print` function in "evaluate" delimiters.
- * var compiled = _.template('<% print("hello " + user); %>!');
- * compiled({ 'user': 'barney' });
- * // => 'hello barney!'
- *
- * // Use the ES template literal delimiter as an "interpolate" delimiter.
- * // Disable support by replacing the "interpolate" delimiter.
- * var compiled = _.template('hello ${ user }!');
- * compiled({ 'user': 'pebbles' });
- * // => 'hello pebbles!'
- *
- * // Use backslashes to treat delimiters as plain text.
- * var compiled = _.template('<%= "\\<%- value %\\>" %>');
- * compiled({ 'value': 'ignored' });
- * // => '<%- value %>'
- *
- * // Use the `imports` option to import `jQuery` as `jq`.
- * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
- * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
- * compiled({ 'users': ['fred', 'barney'] });
- * // => '<li>fred</li><li>barney</li>'
- *
- * // Use the `sourceURL` option to specify a custom sourceURL for the template.
- * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
- * compiled(data);
- * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
- *
- * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
- * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
- * compiled.source;
- * // => function(data) {
- * // var __t, __p = '';
- * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
- * // return __p;
- * // }
- *
- * // Use custom template delimiters.
- * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
- * var compiled = _.template('hello {{ user }}!');
- * compiled({ 'user': 'mustache' });
- * // => 'hello mustache!'
- *
- * // Use the `source` property to inline compiled templates for meaningful
- * // line numbers in error messages and stack traces.
- * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
- * var JST = {\
- * "main": ' + _.template(mainText).source + '\
- * };\
- * ');
- */
- function template(string, options, guard) {
- // Based on John Resig's `tmpl` implementation
- // (http://ejohn.org/blog/javascript-micro-templating/)
- // and Laura Doktorova's doT.js (https://github.com/olado/doT).
- var settings = lodash.templateSettings;
-
- if (guard && isIterateeCall(string, options, guard)) {
- options = undefined;
- }
- string = toString(string);
- options = assignInWith({}, options, settings, customDefaultsAssignIn);
-
- var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
- importsKeys = keys(imports),
- importsValues = baseValues(imports, importsKeys);
-
- var isEscaping,
- isEvaluating,
- index = 0,
- interpolate = options.interpolate || reNoMatch,
- source = "__p += '";
-
- // Compile the regexp to match each delimiter.
- var reDelimiters = RegExp(
- (options.escape || reNoMatch).source + '|' +
- interpolate.source + '|' +
- (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
- (options.evaluate || reNoMatch).source + '|$'
- , 'g');
-
- // Use a sourceURL for easier debugging.
- // The sourceURL gets injected into the source that's eval-ed, so be careful
- // with lookup (in case of e.g. prototype pollution), and strip newlines if any.
- // A newline wouldn't be a valid sourceURL anyway, and it'd enable code injection.
- var sourceURL = '//# sourceURL=' +
- (hasOwnProperty.call(options, 'sourceURL')
- ? (options.sourceURL + '').replace(/[\r\n]/g, ' ')
- : ('lodash.templateSources[' + (++templateCounter) + ']')
- ) + '\n';
-
- string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
- interpolateValue || (interpolateValue = esTemplateValue);
-
- // Escape characters that can't be included in string literals.
- source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
-
- // Replace delimiters with snippets.
- if (escapeValue) {
- isEscaping = true;
- source += "' +\n__e(" + escapeValue + ") +\n'";
- }
- if (evaluateValue) {
- isEvaluating = true;
- source += "';\n" + evaluateValue + ";\n__p += '";
- }
- if (interpolateValue) {
- source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
- }
- index = offset + match.length;
-
- // The JS engine embedded in Adobe products needs `match` returned in
- // order to produce the correct `offset` value.
- return match;
- });
-
- source += "';\n";
-
- // If `variable` is not specified wrap a with-statement around the generated
- // code to add the data object to the top of the scope chain.
- // Like with sourceURL, we take care to not check the option's prototype,
- // as this configuration is a code injection vector.
- var variable = hasOwnProperty.call(options, 'variable') && options.variable;
- if (!variable) {
- source = 'with (obj) {\n' + source + '\n}\n';
- }
- // Cleanup code by stripping empty strings.
- source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
- .replace(reEmptyStringMiddle, '$1')
- .replace(reEmptyStringTrailing, '$1;');
-
- // Frame code as the function body.
- source = 'function(' + (variable || 'obj') + ') {\n' +
- (variable
- ? ''
- : 'obj || (obj = {});\n'
- ) +
- "var __t, __p = ''" +
- (isEscaping
- ? ', __e = _.escape'
- : ''
- ) +
- (isEvaluating
- ? ', __j = Array.prototype.join;\n' +
- "function print() { __p += __j.call(arguments, '') }\n"
- : ';\n'
- ) +
- source +
- 'return __p\n}';
-
- var result = attempt(function() {
- return Function(importsKeys, sourceURL + 'return ' + source)
- .apply(undefined, importsValues);
- });
-
- // Provide the compiled function's source by its `toString` method or
- // the `source` property as a convenience for inlining compiled templates.
- result.source = source;
- if (isError(result)) {
- throw result;
- }
- return result;
- }
-
- /**
- * Converts `string`, as a whole, to lower case just like
- * [String#toLowerCase](https://mdn.io/toLowerCase).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the lower cased string.
- * @example
- *
- * _.toLower('--Foo-Bar--');
- * // => '--foo-bar--'
- *
- * _.toLower('fooBar');
- * // => 'foobar'
- *
- * _.toLower('__FOO_BAR__');
- * // => '__foo_bar__'
- */
- function toLower(value) {
- return toString(value).toLowerCase();
- }
-
- /**
- * Converts `string`, as a whole, to upper case just like
- * [String#toUpperCase](https://mdn.io/toUpperCase).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the upper cased string.
- * @example
- *
- * _.toUpper('--foo-bar--');
- * // => '--FOO-BAR--'
- *
- * _.toUpper('fooBar');
- * // => 'FOOBAR'
- *
- * _.toUpper('__foo_bar__');
- * // => '__FOO_BAR__'
- */
- function toUpper(value) {
- return toString(value).toUpperCase();
- }
-
- /**
- * Removes leading and trailing whitespace or specified characters from `string`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to trim.
- * @param {string} [chars=whitespace] The characters to trim.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {string} Returns the trimmed string.
- * @example
- *
- * _.trim(' abc ');
- * // => 'abc'
- *
- * _.trim('-_-abc-_-', '_-');
- * // => 'abc'
- *
- * _.map([' foo ', ' bar '], _.trim);
- * // => ['foo', 'bar']
- */
- function trim(string, chars, guard) {
- string = toString(string);
- if (string && (guard || chars === undefined)) {
- return string.replace(reTrim, '');
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string),
- chrSymbols = stringToArray(chars),
- start = charsStartIndex(strSymbols, chrSymbols),
- end = charsEndIndex(strSymbols, chrSymbols) + 1;
-
- return castSlice(strSymbols, start, end).join('');
- }
-
- /**
- * Removes trailing whitespace or specified characters from `string`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to trim.
- * @param {string} [chars=whitespace] The characters to trim.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {string} Returns the trimmed string.
- * @example
- *
- * _.trimEnd(' abc ');
- * // => ' abc'
- *
- * _.trimEnd('-_-abc-_-', '_-');
- * // => '-_-abc'
- */
- function trimEnd(string, chars, guard) {
- string = toString(string);
- if (string && (guard || chars === undefined)) {
- return string.replace(reTrimEnd, '');
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string),
- end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
-
- return castSlice(strSymbols, 0, end).join('');
- }
-
- /**
- * Removes leading whitespace or specified characters from `string`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to trim.
- * @param {string} [chars=whitespace] The characters to trim.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {string} Returns the trimmed string.
- * @example
- *
- * _.trimStart(' abc ');
- * // => 'abc '
- *
- * _.trimStart('-_-abc-_-', '_-');
- * // => 'abc-_-'
- */
- function trimStart(string, chars, guard) {
- string = toString(string);
- if (string && (guard || chars === undefined)) {
- return string.replace(reTrimStart, '');
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string),
- start = charsStartIndex(strSymbols, stringToArray(chars));
-
- return castSlice(strSymbols, start).join('');
- }
-
- /**
- * Truncates `string` if it's longer than the given maximum string length.
- * The last characters of the truncated string are replaced with the omission
- * string which defaults to "...".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to truncate.
- * @param {Object} [options={}] The options object.
- * @param {number} [options.length=30] The maximum string length.
- * @param {string} [options.omission='...'] The string to indicate text is omitted.
- * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
- * @returns {string} Returns the truncated string.
- * @example
- *
- * _.truncate('hi-diddly-ho there, neighborino');
- * // => 'hi-diddly-ho there, neighbo...'
- *
- * _.truncate('hi-diddly-ho there, neighborino', {
- * 'length': 24,
- * 'separator': ' '
- * });
- * // => 'hi-diddly-ho there,...'
- *
- * _.truncate('hi-diddly-ho there, neighborino', {
- * 'length': 24,
- * 'separator': /,? +/
- * });
- * // => 'hi-diddly-ho there...'
- *
- * _.truncate('hi-diddly-ho there, neighborino', {
- * 'omission': ' [...]'
- * });
- * // => 'hi-diddly-ho there, neig [...]'
- */
- function truncate(string, options) {
- var length = DEFAULT_TRUNC_LENGTH,
- omission = DEFAULT_TRUNC_OMISSION;
-
- if (isObject(options)) {
- var separator = 'separator' in options ? options.separator : separator;
- length = 'length' in options ? toInteger(options.length) : length;
- omission = 'omission' in options ? baseToString(options.omission) : omission;
- }
- string = toString(string);
-
- var strLength = string.length;
- if (hasUnicode(string)) {
- var strSymbols = stringToArray(string);
- strLength = strSymbols.length;
- }
- if (length >= strLength) {
- return string;
- }
- var end = length - stringSize(omission);
- if (end < 1) {
- return omission;
- }
- var result = strSymbols
- ? castSlice(strSymbols, 0, end).join('')
- : string.slice(0, end);
-
- if (separator === undefined) {
- return result + omission;
- }
- if (strSymbols) {
- end += (result.length - end);
- }
- if (isRegExp(separator)) {
- if (string.slice(end).search(separator)) {
- var match,
- substring = result;
-
- if (!separator.global) {
- separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
- }
- separator.lastIndex = 0;
- while ((match = separator.exec(substring))) {
- var newEnd = match.index;
- }
- result = result.slice(0, newEnd === undefined ? end : newEnd);
- }
- } else if (string.indexOf(baseToString(separator), end) != end) {
- var index = result.lastIndexOf(separator);
- if (index > -1) {
- result = result.slice(0, index);
- }
- }
- return result + omission;
- }
-
- /**
- * The inverse of `_.escape`; this method converts the HTML entities
- * `&`, `<`, `>`, `"`, and `'` in `string` to
- * their corresponding characters.
- *
- * **Note:** No other HTML entities are unescaped. To unescape additional
- * HTML entities use a third-party library like [_he_](https://mths.be/he).
- *
- * @static
- * @memberOf _
- * @since 0.6.0
- * @category String
- * @param {string} [string=''] The string to unescape.
- * @returns {string} Returns the unescaped string.
- * @example
- *
- * _.unescape('fred, barney, & pebbles');
- * // => 'fred, barney, & pebbles'
- */
- function unescape(string) {
- string = toString(string);
- return (string && reHasEscapedHtml.test(string))
- ? string.replace(reEscapedHtml, unescapeHtmlChar)
- : string;
- }
-
- /**
- * Converts `string`, as space separated words, to upper case.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the upper cased string.
- * @example
- *
- * _.upperCase('--foo-bar');
- * // => 'FOO BAR'
- *
- * _.upperCase('fooBar');
- * // => 'FOO BAR'
- *
- * _.upperCase('__foo_bar__');
- * // => 'FOO BAR'
- */
- var upperCase = createCompounder(function(result, word, index) {
- return result + (index ? ' ' : '') + word.toUpperCase();
- });
-
- /**
- * Converts the first character of `string` to upper case.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category String
- * @param {string} [string=''] The string to convert.
- * @returns {string} Returns the converted string.
- * @example
- *
- * _.upperFirst('fred');
- * // => 'Fred'
- *
- * _.upperFirst('FRED');
- * // => 'FRED'
- */
- var upperFirst = createCaseFirst('toUpperCase');
-
- /**
- * Splits `string` into an array of its words.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category String
- * @param {string} [string=''] The string to inspect.
- * @param {RegExp|string} [pattern] The pattern to match words.
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
- * @returns {Array} Returns the words of `string`.
- * @example
- *
- * _.words('fred, barney, & pebbles');
- * // => ['fred', 'barney', 'pebbles']
- *
- * _.words('fred, barney, & pebbles', /[^, ]+/g);
- * // => ['fred', 'barney', '&', 'pebbles']
- */
- function words(string, pattern, guard) {
- string = toString(string);
- pattern = guard ? undefined : pattern;
-
- if (pattern === undefined) {
- return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
- }
- return string.match(pattern) || [];
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Attempts to invoke `func`, returning either the result or the caught error
- * object. Any additional arguments are provided to `func` when it's invoked.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Util
- * @param {Function} func The function to attempt.
- * @param {...*} [args] The arguments to invoke `func` with.
- * @returns {*} Returns the `func` result or error object.
- * @example
- *
- * // Avoid throwing errors for invalid selectors.
- * var elements = _.attempt(function(selector) {
- * return document.querySelectorAll(selector);
- * }, '>_>');
- *
- * if (_.isError(elements)) {
- * elements = [];
- * }
- */
- var attempt = baseRest(function(func, args) {
- try {
- return apply(func, undefined, args);
- } catch (e) {
- return isError(e) ? e : new Error(e);
- }
- });
-
- /**
- * Binds methods of an object to the object itself, overwriting the existing
- * method.
- *
- * **Note:** This method doesn't set the "length" property of bound functions.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {Object} object The object to bind and assign the bound methods to.
- * @param {...(string|string[])} methodNames The object method names to bind.
- * @returns {Object} Returns `object`.
- * @example
- *
- * var view = {
- * 'label': 'docs',
- * 'click': function() {
- * console.log('clicked ' + this.label);
- * }
- * };
- *
- * _.bindAll(view, ['click']);
- * jQuery(element).on('click', view.click);
- * // => Logs 'clicked docs' when clicked.
- */
- var bindAll = flatRest(function(object, methodNames) {
- arrayEach(methodNames, function(key) {
- key = toKey(key);
- baseAssignValue(object, key, bind(object[key], object));
- });
- return object;
- });
-
- /**
- * Creates a function that iterates over `pairs` and invokes the corresponding
- * function of the first predicate to return truthy. The predicate-function
- * pairs are invoked with the `this` binding and arguments of the created
- * function.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {Array} pairs The predicate-function pairs.
- * @returns {Function} Returns the new composite function.
- * @example
- *
- * var func = _.cond([
- * [_.matches({ 'a': 1 }), _.constant('matches A')],
- * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
- * [_.stubTrue, _.constant('no match')]
- * ]);
- *
- * func({ 'a': 1, 'b': 2 });
- * // => 'matches A'
- *
- * func({ 'a': 0, 'b': 1 });
- * // => 'matches B'
- *
- * func({ 'a': '1', 'b': '2' });
- * // => 'no match'
- */
- function cond(pairs) {
- var length = pairs == null ? 0 : pairs.length,
- toIteratee = getIteratee();
-
- pairs = !length ? [] : arrayMap(pairs, function(pair) {
- if (typeof pair[1] != 'function') {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- return [toIteratee(pair[0]), pair[1]];
- });
-
- return baseRest(function(args) {
- var index = -1;
- while (++index < length) {
- var pair = pairs[index];
- if (apply(pair[0], this, args)) {
- return apply(pair[1], this, args);
- }
- }
- });
- }
-
- /**
- * Creates a function that invokes the predicate properties of `source` with
- * the corresponding property values of a given object, returning `true` if
- * all predicates return truthy, else `false`.
- *
- * **Note:** The created function is equivalent to `_.conformsTo` with
- * `source` partially applied.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {Object} source The object of property predicates to conform to.
- * @returns {Function} Returns the new spec function.
- * @example
- *
- * var objects = [
- * { 'a': 2, 'b': 1 },
- * { 'a': 1, 'b': 2 }
- * ];
- *
- * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
- * // => [{ 'a': 1, 'b': 2 }]
- */
- function conforms(source) {
- return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
- }
-
- /**
- * Creates a function that returns `value`.
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Util
- * @param {*} value The value to return from the new function.
- * @returns {Function} Returns the new constant function.
- * @example
- *
- * var objects = _.times(2, _.constant({ 'a': 1 }));
- *
- * console.log(objects);
- * // => [{ 'a': 1 }, { 'a': 1 }]
- *
- * console.log(objects[0] === objects[1]);
- * // => true
- */
- function constant(value) {
- return function() {
- return value;
- };
- }
-
- /**
- * Checks `value` to determine whether a default value should be returned in
- * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
- * or `undefined`.
- *
- * @static
- * @memberOf _
- * @since 4.14.0
- * @category Util
- * @param {*} value The value to check.
- * @param {*} defaultValue The default value.
- * @returns {*} Returns the resolved value.
- * @example
- *
- * _.defaultTo(1, 10);
- * // => 1
- *
- * _.defaultTo(undefined, 10);
- * // => 10
- */
- function defaultTo(value, defaultValue) {
- return (value == null || value !== value) ? defaultValue : value;
- }
-
- /**
- * Creates a function that returns the result of invoking the given functions
- * with the `this` binding of the created function, where each successive
- * invocation is supplied the return value of the previous.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Util
- * @param {...(Function|Function[])} [funcs] The functions to invoke.
- * @returns {Function} Returns the new composite function.
- * @see _.flowRight
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var addSquare = _.flow([_.add, square]);
- * addSquare(1, 2);
- * // => 9
- */
- var flow = createFlow();
-
- /**
- * This method is like `_.flow` except that it creates a function that
- * invokes the given functions from right to left.
- *
- * @static
- * @since 3.0.0
- * @memberOf _
- * @category Util
- * @param {...(Function|Function[])} [funcs] The functions to invoke.
- * @returns {Function} Returns the new composite function.
- * @see _.flow
- * @example
- *
- * function square(n) {
- * return n * n;
- * }
- *
- * var addSquare = _.flowRight([square, _.add]);
- * addSquare(1, 2);
- * // => 9
- */
- var flowRight = createFlow(true);
-
- /**
- * This method returns the first argument it receives.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {*} value Any value.
- * @returns {*} Returns `value`.
- * @example
- *
- * var object = { 'a': 1 };
- *
- * console.log(_.identity(object) === object);
- * // => true
- */
- function identity(value) {
- return value;
- }
-
- /**
- * Creates a function that invokes `func` with the arguments of the created
- * function. If `func` is a property name, the created function returns the
- * property value for a given element. If `func` is an array or object, the
- * created function returns `true` for elements that contain the equivalent
- * source properties, otherwise it returns `false`.
- *
- * @static
- * @since 4.0.0
- * @memberOf _
- * @category Util
- * @param {*} [func=_.identity] The value to convert to a callback.
- * @returns {Function} Returns the callback.
- * @example
- *
- * var users = [
- * { 'user': 'barney', 'age': 36, 'active': true },
- * { 'user': 'fred', 'age': 40, 'active': false }
- * ];
- *
- * // The `_.matches` iteratee shorthand.
- * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
- * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
- *
- * // The `_.matchesProperty` iteratee shorthand.
- * _.filter(users, _.iteratee(['user', 'fred']));
- * // => [{ 'user': 'fred', 'age': 40 }]
- *
- * // The `_.property` iteratee shorthand.
- * _.map(users, _.iteratee('user'));
- * // => ['barney', 'fred']
- *
- * // Create custom iteratee shorthands.
- * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
- * return !_.isRegExp(func) ? iteratee(func) : function(string) {
- * return func.test(string);
- * };
- * });
- *
- * _.filter(['abc', 'def'], /ef/);
- * // => ['def']
- */
- function iteratee(func) {
- return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
- }
-
- /**
- * Creates a function that performs a partial deep comparison between a given
- * object and `source`, returning `true` if the given object has equivalent
- * property values, else `false`.
- *
- * **Note:** The created function is equivalent to `_.isMatch` with `source`
- * partially applied.
- *
- * Partial comparisons will match empty array and empty object `source`
- * values against any array or object value, respectively. See `_.isEqual`
- * for a list of supported value comparisons.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Util
- * @param {Object} source The object of property values to match.
- * @returns {Function} Returns the new spec function.
- * @example
- *
- * var objects = [
- * { 'a': 1, 'b': 2, 'c': 3 },
- * { 'a': 4, 'b': 5, 'c': 6 }
- * ];
- *
- * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
- * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
- */
- function matches(source) {
- return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
- }
-
- /**
- * Creates a function that performs a partial deep comparison between the
- * value at `path` of a given object to `srcValue`, returning `true` if the
- * object value is equivalent, else `false`.
- *
- * **Note:** Partial comparisons will match empty array and empty object
- * `srcValue` values against any array or object value, respectively. See
- * `_.isEqual` for a list of supported value comparisons.
- *
- * @static
- * @memberOf _
- * @since 3.2.0
- * @category Util
- * @param {Array|string} path The path of the property to get.
- * @param {*} srcValue The value to match.
- * @returns {Function} Returns the new spec function.
- * @example
- *
- * var objects = [
- * { 'a': 1, 'b': 2, 'c': 3 },
- * { 'a': 4, 'b': 5, 'c': 6 }
- * ];
- *
- * _.find(objects, _.matchesProperty('a', 4));
- * // => { 'a': 4, 'b': 5, 'c': 6 }
- */
- function matchesProperty(path, srcValue) {
- return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
- }
-
- /**
- * Creates a function that invokes the method at `path` of a given object.
- * Any additional arguments are provided to the invoked method.
- *
- * @static
- * @memberOf _
- * @since 3.7.0
- * @category Util
- * @param {Array|string} path The path of the method to invoke.
- * @param {...*} [args] The arguments to invoke the method with.
- * @returns {Function} Returns the new invoker function.
- * @example
- *
- * var objects = [
- * { 'a': { 'b': _.constant(2) } },
- * { 'a': { 'b': _.constant(1) } }
- * ];
- *
- * _.map(objects, _.method('a.b'));
- * // => [2, 1]
- *
- * _.map(objects, _.method(['a', 'b']));
- * // => [2, 1]
- */
- var method = baseRest(function(path, args) {
- return function(object) {
- return baseInvoke(object, path, args);
- };
- });
-
- /**
- * The opposite of `_.method`; this method creates a function that invokes
- * the method at a given path of `object`. Any additional arguments are
- * provided to the invoked method.
- *
- * @static
- * @memberOf _
- * @since 3.7.0
- * @category Util
- * @param {Object} object The object to query.
- * @param {...*} [args] The arguments to invoke the method with.
- * @returns {Function} Returns the new invoker function.
- * @example
- *
- * var array = _.times(3, _.constant),
- * object = { 'a': array, 'b': array, 'c': array };
- *
- * _.map(['a[2]', 'c[0]'], _.methodOf(object));
- * // => [2, 0]
- *
- * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
- * // => [2, 0]
- */
- var methodOf = baseRest(function(object, args) {
- return function(path) {
- return baseInvoke(object, path, args);
- };
- });
-
- /**
- * Adds all own enumerable string keyed function properties of a source
- * object to the destination object. If `object` is a function, then methods
- * are added to its prototype as well.
- *
- * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
- * avoid conflicts caused by modifying the original.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {Function|Object} [object=lodash] The destination object.
- * @param {Object} source The object of functions to add.
- * @param {Object} [options={}] The options object.
- * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
- * @returns {Function|Object} Returns `object`.
- * @example
- *
- * function vowels(string) {
- * return _.filter(string, function(v) {
- * return /[aeiou]/i.test(v);
- * });
- * }
- *
- * _.mixin({ 'vowels': vowels });
- * _.vowels('fred');
- * // => ['e']
- *
- * _('fred').vowels().value();
- * // => ['e']
- *
- * _.mixin({ 'vowels': vowels }, { 'chain': false });
- * _('fred').vowels();
- * // => ['e']
- */
- function mixin(object, source, options) {
- var props = keys(source),
- methodNames = baseFunctions(source, props);
-
- if (options == null &&
- !(isObject(source) && (methodNames.length || !props.length))) {
- options = source;
- source = object;
- object = this;
- methodNames = baseFunctions(source, keys(source));
- }
- var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
- isFunc = isFunction(object);
-
- arrayEach(methodNames, function(methodName) {
- var func = source[methodName];
- object[methodName] = func;
- if (isFunc) {
- object.prototype[methodName] = function() {
- var chainAll = this.__chain__;
- if (chain || chainAll) {
- var result = object(this.__wrapped__),
- actions = result.__actions__ = copyArray(this.__actions__);
-
- actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
- result.__chain__ = chainAll;
- return result;
- }
- return func.apply(object, arrayPush([this.value()], arguments));
- };
- }
- });
-
- return object;
- }
-
- /**
- * Reverts the `_` variable to its previous value and returns a reference to
- * the `lodash` function.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @returns {Function} Returns the `lodash` function.
- * @example
- *
- * var lodash = _.noConflict();
- */
- function noConflict() {
- if (root._ === this) {
- root._ = oldDash;
- }
- return this;
- }
-
- /**
- * This method returns `undefined`.
- *
- * @static
- * @memberOf _
- * @since 2.3.0
- * @category Util
- * @example
- *
- * _.times(2, _.noop);
- * // => [undefined, undefined]
- */
- function noop() {
- // No operation performed.
- }
-
- /**
- * Creates a function that gets the argument at index `n`. If `n` is negative,
- * the nth argument from the end is returned.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {number} [n=0] The index of the argument to return.
- * @returns {Function} Returns the new pass-thru function.
- * @example
- *
- * var func = _.nthArg(1);
- * func('a', 'b', 'c', 'd');
- * // => 'b'
- *
- * var func = _.nthArg(-2);
- * func('a', 'b', 'c', 'd');
- * // => 'c'
- */
- function nthArg(n) {
- n = toInteger(n);
- return baseRest(function(args) {
- return baseNth(args, n);
- });
- }
-
- /**
- * Creates a function that invokes `iteratees` with the arguments it receives
- * and returns their results.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {...(Function|Function[])} [iteratees=[_.identity]]
- * The iteratees to invoke.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var func = _.over([Math.max, Math.min]);
- *
- * func(1, 2, 3, 4);
- * // => [4, 1]
- */
- var over = createOver(arrayMap);
-
- /**
- * Creates a function that checks if **all** of the `predicates` return
- * truthy when invoked with the arguments it receives.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {...(Function|Function[])} [predicates=[_.identity]]
- * The predicates to check.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var func = _.overEvery([Boolean, isFinite]);
- *
- * func('1');
- * // => true
- *
- * func(null);
- * // => false
- *
- * func(NaN);
- * // => false
- */
- var overEvery = createOver(arrayEvery);
-
- /**
- * Creates a function that checks if **any** of the `predicates` return
- * truthy when invoked with the arguments it receives.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {...(Function|Function[])} [predicates=[_.identity]]
- * The predicates to check.
- * @returns {Function} Returns the new function.
- * @example
- *
- * var func = _.overSome([Boolean, isFinite]);
- *
- * func('1');
- * // => true
- *
- * func(null);
- * // => true
- *
- * func(NaN);
- * // => false
- */
- var overSome = createOver(arraySome);
-
- /**
- * Creates a function that returns the value at `path` of a given object.
- *
- * @static
- * @memberOf _
- * @since 2.4.0
- * @category Util
- * @param {Array|string} path The path of the property to get.
- * @returns {Function} Returns the new accessor function.
- * @example
- *
- * var objects = [
- * { 'a': { 'b': 2 } },
- * { 'a': { 'b': 1 } }
- * ];
- *
- * _.map(objects, _.property('a.b'));
- * // => [2, 1]
- *
- * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
- * // => [1, 2]
- */
- function property(path) {
- return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
- }
-
- /**
- * The opposite of `_.property`; this method creates a function that returns
- * the value at a given path of `object`.
- *
- * @static
- * @memberOf _
- * @since 3.0.0
- * @category Util
- * @param {Object} object The object to query.
- * @returns {Function} Returns the new accessor function.
- * @example
- *
- * var array = [0, 1, 2],
- * object = { 'a': array, 'b': array, 'c': array };
- *
- * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
- * // => [2, 0]
- *
- * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
- * // => [2, 0]
- */
- function propertyOf(object) {
- return function(path) {
- return object == null ? undefined : baseGet(object, path);
- };
- }
-
- /**
- * Creates an array of numbers (positive and/or negative) progressing from
- * `start` up to, but not including, `end`. A step of `-1` is used if a negative
- * `start` is specified without an `end` or `step`. If `end` is not specified,
- * it's set to `start` with `start` then set to `0`.
- *
- * **Note:** JavaScript follows the IEEE-754 standard for resolving
- * floating-point values which can produce unexpected results.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {number} [start=0] The start of the range.
- * @param {number} end The end of the range.
- * @param {number} [step=1] The value to increment or decrement by.
- * @returns {Array} Returns the range of numbers.
- * @see _.inRange, _.rangeRight
- * @example
- *
- * _.range(4);
- * // => [0, 1, 2, 3]
- *
- * _.range(-4);
- * // => [0, -1, -2, -3]
- *
- * _.range(1, 5);
- * // => [1, 2, 3, 4]
- *
- * _.range(0, 20, 5);
- * // => [0, 5, 10, 15]
- *
- * _.range(0, -4, -1);
- * // => [0, -1, -2, -3]
- *
- * _.range(1, 4, 0);
- * // => [1, 1, 1]
- *
- * _.range(0);
- * // => []
- */
- var range = createRange();
-
- /**
- * This method is like `_.range` except that it populates values in
- * descending order.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {number} [start=0] The start of the range.
- * @param {number} end The end of the range.
- * @param {number} [step=1] The value to increment or decrement by.
- * @returns {Array} Returns the range of numbers.
- * @see _.inRange, _.range
- * @example
- *
- * _.rangeRight(4);
- * // => [3, 2, 1, 0]
- *
- * _.rangeRight(-4);
- * // => [-3, -2, -1, 0]
- *
- * _.rangeRight(1, 5);
- * // => [4, 3, 2, 1]
- *
- * _.rangeRight(0, 20, 5);
- * // => [15, 10, 5, 0]
- *
- * _.rangeRight(0, -4, -1);
- * // => [-3, -2, -1, 0]
- *
- * _.rangeRight(1, 4, 0);
- * // => [1, 1, 1]
- *
- * _.rangeRight(0);
- * // => []
- */
- var rangeRight = createRange(true);
-
- /**
- * This method returns a new empty array.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {Array} Returns the new empty array.
- * @example
- *
- * var arrays = _.times(2, _.stubArray);
- *
- * console.log(arrays);
- * // => [[], []]
- *
- * console.log(arrays[0] === arrays[1]);
- * // => false
- */
- function stubArray() {
- return [];
- }
-
- /**
- * This method returns `false`.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {boolean} Returns `false`.
- * @example
- *
- * _.times(2, _.stubFalse);
- * // => [false, false]
- */
- function stubFalse() {
- return false;
- }
-
- /**
- * This method returns a new empty object.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {Object} Returns the new empty object.
- * @example
- *
- * var objects = _.times(2, _.stubObject);
- *
- * console.log(objects);
- * // => [{}, {}]
- *
- * console.log(objects[0] === objects[1]);
- * // => false
- */
- function stubObject() {
- return {};
- }
-
- /**
- * This method returns an empty string.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {string} Returns the empty string.
- * @example
- *
- * _.times(2, _.stubString);
- * // => ['', '']
- */
- function stubString() {
- return '';
- }
-
- /**
- * This method returns `true`.
- *
- * @static
- * @memberOf _
- * @since 4.13.0
- * @category Util
- * @returns {boolean} Returns `true`.
- * @example
- *
- * _.times(2, _.stubTrue);
- * // => [true, true]
- */
- function stubTrue() {
- return true;
- }
-
- /**
- * Invokes the iteratee `n` times, returning an array of the results of
- * each invocation. The iteratee is invoked with one argument; (index).
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {number} n The number of times to invoke `iteratee`.
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
- * @returns {Array} Returns the array of results.
- * @example
- *
- * _.times(3, String);
- * // => ['0', '1', '2']
- *
- * _.times(4, _.constant(0));
- * // => [0, 0, 0, 0]
- */
- function times(n, iteratee) {
- n = toInteger(n);
- if (n < 1 || n > MAX_SAFE_INTEGER) {
- return [];
- }
- var index = MAX_ARRAY_LENGTH,
- length = nativeMin(n, MAX_ARRAY_LENGTH);
-
- iteratee = getIteratee(iteratee);
- n -= MAX_ARRAY_LENGTH;
-
- var result = baseTimes(length, iteratee);
- while (++index < n) {
- iteratee(index);
- }
- return result;
- }
-
- /**
- * Converts `value` to a property path array.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Util
- * @param {*} value The value to convert.
- * @returns {Array} Returns the new property path array.
- * @example
- *
- * _.toPath('a.b.c');
- * // => ['a', 'b', 'c']
- *
- * _.toPath('a[0].b.c');
- * // => ['a', '0', 'b', 'c']
- */
- function toPath(value) {
- if (isArray(value)) {
- return arrayMap(value, toKey);
- }
- return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
- }
-
- /**
- * Generates a unique ID. If `prefix` is given, the ID is appended to it.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Util
- * @param {string} [prefix=''] The value to prefix the ID with.
- * @returns {string} Returns the unique ID.
- * @example
- *
- * _.uniqueId('contact_');
- * // => 'contact_104'
- *
- * _.uniqueId();
- * // => '105'
- */
- function uniqueId(prefix) {
- var id = ++idCounter;
- return toString(prefix) + id;
- }
-
- /*------------------------------------------------------------------------*/
-
- /**
- * Adds two numbers.
- *
- * @static
- * @memberOf _
- * @since 3.4.0
- * @category Math
- * @param {number} augend The first number in an addition.
- * @param {number} addend The second number in an addition.
- * @returns {number} Returns the total.
- * @example
- *
- * _.add(6, 4);
- * // => 10
- */
- var add = createMathOperation(function(augend, addend) {
- return augend + addend;
- }, 0);
-
- /**
- * Computes `number` rounded up to `precision`.
- *
- * @static
- * @memberOf _
- * @since 3.10.0
- * @category Math
- * @param {number} number The number to round up.
- * @param {number} [precision=0] The precision to round up to.
- * @returns {number} Returns the rounded up number.
- * @example
- *
- * _.ceil(4.006);
- * // => 5
- *
- * _.ceil(6.004, 2);
- * // => 6.01
- *
- * _.ceil(6040, -2);
- * // => 6100
- */
- var ceil = createRound('ceil');
-
- /**
- * Divide two numbers.
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Math
- * @param {number} dividend The first number in a division.
- * @param {number} divisor The second number in a division.
- * @returns {number} Returns the quotient.
- * @example
- *
- * _.divide(6, 4);
- * // => 1.5
- */
- var divide = createMathOperation(function(dividend, divisor) {
- return dividend / divisor;
- }, 1);
-
- /**
- * Computes `number` rounded down to `precision`.
- *
- * @static
- * @memberOf _
- * @since 3.10.0
- * @category Math
- * @param {number} number The number to round down.
- * @param {number} [precision=0] The precision to round down to.
- * @returns {number} Returns the rounded down number.
- * @example
- *
- * _.floor(4.006);
- * // => 4
- *
- * _.floor(0.046, 2);
- * // => 0.04
- *
- * _.floor(4060, -2);
- * // => 4000
- */
- var floor = createRound('floor');
-
- /**
- * Computes the maximum value of `array`. If `array` is empty or falsey,
- * `undefined` is returned.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Math
- * @param {Array} array The array to iterate over.
- * @returns {*} Returns the maximum value.
- * @example
- *
- * _.max([4, 2, 8, 6]);
- * // => 8
- *
- * _.max([]);
- * // => undefined
- */
- function max(array) {
- return (array && array.length)
- ? baseExtremum(array, identity, baseGt)
- : undefined;
- }
-
- /**
- * This method is like `_.max` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the criterion by which
- * the value is ranked. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {*} Returns the maximum value.
- * @example
- *
- * var objects = [{ 'n': 1 }, { 'n': 2 }];
- *
- * _.maxBy(objects, function(o) { return o.n; });
- * // => { 'n': 2 }
- *
- * // The `_.property` iteratee shorthand.
- * _.maxBy(objects, 'n');
- * // => { 'n': 2 }
- */
- function maxBy(array, iteratee) {
- return (array && array.length)
- ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
- : undefined;
- }
-
- /**
- * Computes the mean of the values in `array`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @returns {number} Returns the mean.
- * @example
- *
- * _.mean([4, 2, 8, 6]);
- * // => 5
- */
- function mean(array) {
- return baseMean(array, identity);
- }
-
- /**
- * This method is like `_.mean` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the value to be averaged.
- * The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {number} Returns the mean.
- * @example
- *
- * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
- *
- * _.meanBy(objects, function(o) { return o.n; });
- * // => 5
- *
- * // The `_.property` iteratee shorthand.
- * _.meanBy(objects, 'n');
- * // => 5
- */
- function meanBy(array, iteratee) {
- return baseMean(array, getIteratee(iteratee, 2));
- }
-
- /**
- * Computes the minimum value of `array`. If `array` is empty or falsey,
- * `undefined` is returned.
- *
- * @static
- * @since 0.1.0
- * @memberOf _
- * @category Math
- * @param {Array} array The array to iterate over.
- * @returns {*} Returns the minimum value.
- * @example
- *
- * _.min([4, 2, 8, 6]);
- * // => 2
- *
- * _.min([]);
- * // => undefined
- */
- function min(array) {
- return (array && array.length)
- ? baseExtremum(array, identity, baseLt)
- : undefined;
- }
-
- /**
- * This method is like `_.min` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the criterion by which
- * the value is ranked. The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {*} Returns the minimum value.
- * @example
- *
- * var objects = [{ 'n': 1 }, { 'n': 2 }];
- *
- * _.minBy(objects, function(o) { return o.n; });
- * // => { 'n': 1 }
- *
- * // The `_.property` iteratee shorthand.
- * _.minBy(objects, 'n');
- * // => { 'n': 1 }
- */
- function minBy(array, iteratee) {
- return (array && array.length)
- ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
- : undefined;
- }
-
- /**
- * Multiply two numbers.
- *
- * @static
- * @memberOf _
- * @since 4.7.0
- * @category Math
- * @param {number} multiplier The first number in a multiplication.
- * @param {number} multiplicand The second number in a multiplication.
- * @returns {number} Returns the product.
- * @example
- *
- * _.multiply(6, 4);
- * // => 24
- */
- var multiply = createMathOperation(function(multiplier, multiplicand) {
- return multiplier * multiplicand;
- }, 1);
-
- /**
- * Computes `number` rounded to `precision`.
- *
- * @static
- * @memberOf _
- * @since 3.10.0
- * @category Math
- * @param {number} number The number to round.
- * @param {number} [precision=0] The precision to round to.
- * @returns {number} Returns the rounded number.
- * @example
- *
- * _.round(4.006);
- * // => 4
- *
- * _.round(4.006, 2);
- * // => 4.01
- *
- * _.round(4060, -2);
- * // => 4100
- */
- var round = createRound('round');
-
- /**
- * Subtract two numbers.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {number} minuend The first number in a subtraction.
- * @param {number} subtrahend The second number in a subtraction.
- * @returns {number} Returns the difference.
- * @example
- *
- * _.subtract(6, 4);
- * // => 2
- */
- var subtract = createMathOperation(function(minuend, subtrahend) {
- return minuend - subtrahend;
- }, 0);
-
- /**
- * Computes the sum of the values in `array`.
- *
- * @static
- * @memberOf _
- * @since 3.4.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @returns {number} Returns the sum.
- * @example
- *
- * _.sum([4, 2, 8, 6]);
- * // => 20
- */
- function sum(array) {
- return (array && array.length)
- ? baseSum(array, identity)
- : 0;
- }
-
- /**
- * This method is like `_.sum` except that it accepts `iteratee` which is
- * invoked for each element in `array` to generate the value to be summed.
- * The iteratee is invoked with one argument: (value).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Math
- * @param {Array} array The array to iterate over.
- * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
- * @returns {number} Returns the sum.
- * @example
- *
- * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
- *
- * _.sumBy(objects, function(o) { return o.n; });
- * // => 20
- *
- * // The `_.property` iteratee shorthand.
- * _.sumBy(objects, 'n');
- * // => 20
- */
- function sumBy(array, iteratee) {
- return (array && array.length)
- ? baseSum(array, getIteratee(iteratee, 2))
- : 0;
- }
-
- /*------------------------------------------------------------------------*/
-
- // Add methods that return wrapped values in chain sequences.
- lodash.after = after;
- lodash.ary = ary;
- lodash.assign = assign;
- lodash.assignIn = assignIn;
- lodash.assignInWith = assignInWith;
- lodash.assignWith = assignWith;
- lodash.at = at;
- lodash.before = before;
- lodash.bind = bind;
- lodash.bindAll = bindAll;
- lodash.bindKey = bindKey;
- lodash.castArray = castArray;
- lodash.chain = chain;
- lodash.chunk = chunk;
- lodash.compact = compact;
- lodash.concat = concat;
- lodash.cond = cond;
- lodash.conforms = conforms;
- lodash.constant = constant;
- lodash.countBy = countBy;
- lodash.create = create;
- lodash.curry = curry;
- lodash.curryRight = curryRight;
- lodash.debounce = debounce;
- lodash.defaults = defaults;
- lodash.defaultsDeep = defaultsDeep;
- lodash.defer = defer;
- lodash.delay = delay;
- lodash.difference = difference;
- lodash.differenceBy = differenceBy;
- lodash.differenceWith = differenceWith;
- lodash.drop = drop;
- lodash.dropRight = dropRight;
- lodash.dropRightWhile = dropRightWhile;
- lodash.dropWhile = dropWhile;
- lodash.fill = fill;
- lodash.filter = filter;
- lodash.flatMap = flatMap;
- lodash.flatMapDeep = flatMapDeep;
- lodash.flatMapDepth = flatMapDepth;
- lodash.flatten = flatten;
- lodash.flattenDeep = flattenDeep;
- lodash.flattenDepth = flattenDepth;
- lodash.flip = flip;
- lodash.flow = flow;
- lodash.flowRight = flowRight;
- lodash.fromPairs = fromPairs;
- lodash.functions = functions;
- lodash.functionsIn = functionsIn;
- lodash.groupBy = groupBy;
- lodash.initial = initial;
- lodash.intersection = intersection;
- lodash.intersectionBy = intersectionBy;
- lodash.intersectionWith = intersectionWith;
- lodash.invert = invert;
- lodash.invertBy = invertBy;
- lodash.invokeMap = invokeMap;
- lodash.iteratee = iteratee;
- lodash.keyBy = keyBy;
- lodash.keys = keys;
- lodash.keysIn = keysIn;
- lodash.map = map;
- lodash.mapKeys = mapKeys;
- lodash.mapValues = mapValues;
- lodash.matches = matches;
- lodash.matchesProperty = matchesProperty;
- lodash.memoize = memoize;
- lodash.merge = merge;
- lodash.mergeWith = mergeWith;
- lodash.method = method;
- lodash.methodOf = methodOf;
- lodash.mixin = mixin;
- lodash.negate = negate;
- lodash.nthArg = nthArg;
- lodash.omit = omit;
- lodash.omitBy = omitBy;
- lodash.once = once;
- lodash.orderBy = orderBy;
- lodash.over = over;
- lodash.overArgs = overArgs;
- lodash.overEvery = overEvery;
- lodash.overSome = overSome;
- lodash.partial = partial;
- lodash.partialRight = partialRight;
- lodash.partition = partition;
- lodash.pick = pick;
- lodash.pickBy = pickBy;
- lodash.property = property;
- lodash.propertyOf = propertyOf;
- lodash.pull = pull;
- lodash.pullAll = pullAll;
- lodash.pullAllBy = pullAllBy;
- lodash.pullAllWith = pullAllWith;
- lodash.pullAt = pullAt;
- lodash.range = range;
- lodash.rangeRight = rangeRight;
- lodash.rearg = rearg;
- lodash.reject = reject;
- lodash.remove = remove;
- lodash.rest = rest;
- lodash.reverse = reverse;
- lodash.sampleSize = sampleSize;
- lodash.set = set;
- lodash.setWith = setWith;
- lodash.shuffle = shuffle;
- lodash.slice = slice;
- lodash.sortBy = sortBy;
- lodash.sortedUniq = sortedUniq;
- lodash.sortedUniqBy = sortedUniqBy;
- lodash.split = split;
- lodash.spread = spread;
- lodash.tail = tail;
- lodash.take = take;
- lodash.takeRight = takeRight;
- lodash.takeRightWhile = takeRightWhile;
- lodash.takeWhile = takeWhile;
- lodash.tap = tap;
- lodash.throttle = throttle;
- lodash.thru = thru;
- lodash.toArray = toArray;
- lodash.toPairs = toPairs;
- lodash.toPairsIn = toPairsIn;
- lodash.toPath = toPath;
- lodash.toPlainObject = toPlainObject;
- lodash.transform = transform;
- lodash.unary = unary;
- lodash.union = union;
- lodash.unionBy = unionBy;
- lodash.unionWith = unionWith;
- lodash.uniq = uniq;
- lodash.uniqBy = uniqBy;
- lodash.uniqWith = uniqWith;
- lodash.unset = unset;
- lodash.unzip = unzip;
- lodash.unzipWith = unzipWith;
- lodash.update = update;
- lodash.updateWith = updateWith;
- lodash.values = values;
- lodash.valuesIn = valuesIn;
- lodash.without = without;
- lodash.words = words;
- lodash.wrap = wrap;
- lodash.xor = xor;
- lodash.xorBy = xorBy;
- lodash.xorWith = xorWith;
- lodash.zip = zip;
- lodash.zipObject = zipObject;
- lodash.zipObjectDeep = zipObjectDeep;
- lodash.zipWith = zipWith;
-
- // Add aliases.
- lodash.entries = toPairs;
- lodash.entriesIn = toPairsIn;
- lodash.extend = assignIn;
- lodash.extendWith = assignInWith;
-
- // Add methods to `lodash.prototype`.
- mixin(lodash, lodash);
-
- /*------------------------------------------------------------------------*/
-
- // Add methods that return unwrapped values in chain sequences.
- lodash.add = add;
- lodash.attempt = attempt;
- lodash.camelCase = camelCase;
- lodash.capitalize = capitalize;
- lodash.ceil = ceil;
- lodash.clamp = clamp;
- lodash.clone = clone;
- lodash.cloneDeep = cloneDeep;
- lodash.cloneDeepWith = cloneDeepWith;
- lodash.cloneWith = cloneWith;
- lodash.conformsTo = conformsTo;
- lodash.deburr = deburr;
- lodash.defaultTo = defaultTo;
- lodash.divide = divide;
- lodash.endsWith = endsWith;
- lodash.eq = eq;
- lodash.escape = escape;
- lodash.escapeRegExp = escapeRegExp;
- lodash.every = every;
- lodash.find = find;
- lodash.findIndex = findIndex;
- lodash.findKey = findKey;
- lodash.findLast = findLast;
- lodash.findLastIndex = findLastIndex;
- lodash.findLastKey = findLastKey;
- lodash.floor = floor;
- lodash.forEach = forEach;
- lodash.forEachRight = forEachRight;
- lodash.forIn = forIn;
- lodash.forInRight = forInRight;
- lodash.forOwn = forOwn;
- lodash.forOwnRight = forOwnRight;
- lodash.get = get;
- lodash.gt = gt;
- lodash.gte = gte;
- lodash.has = has;
- lodash.hasIn = hasIn;
- lodash.head = head;
- lodash.identity = identity;
- lodash.includes = includes;
- lodash.indexOf = indexOf;
- lodash.inRange = inRange;
- lodash.invoke = invoke;
- lodash.isArguments = isArguments;
- lodash.isArray = isArray;
- lodash.isArrayBuffer = isArrayBuffer;
- lodash.isArrayLike = isArrayLike;
- lodash.isArrayLikeObject = isArrayLikeObject;
- lodash.isBoolean = isBoolean;
- lodash.isBuffer = isBuffer;
- lodash.isDate = isDate;
- lodash.isElement = isElement;
- lodash.isEmpty = isEmpty;
- lodash.isEqual = isEqual;
- lodash.isEqualWith = isEqualWith;
- lodash.isError = isError;
- lodash.isFinite = isFinite;
- lodash.isFunction = isFunction;
- lodash.isInteger = isInteger;
- lodash.isLength = isLength;
- lodash.isMap = isMap;
- lodash.isMatch = isMatch;
- lodash.isMatchWith = isMatchWith;
- lodash.isNaN = isNaN;
- lodash.isNative = isNative;
- lodash.isNil = isNil;
- lodash.isNull = isNull;
- lodash.isNumber = isNumber;
- lodash.isObject = isObject;
- lodash.isObjectLike = isObjectLike;
- lodash.isPlainObject = isPlainObject;
- lodash.isRegExp = isRegExp;
- lodash.isSafeInteger = isSafeInteger;
- lodash.isSet = isSet;
- lodash.isString = isString;
- lodash.isSymbol = isSymbol;
- lodash.isTypedArray = isTypedArray;
- lodash.isUndefined = isUndefined;
- lodash.isWeakMap = isWeakMap;
- lodash.isWeakSet = isWeakSet;
- lodash.join = join;
- lodash.kebabCase = kebabCase;
- lodash.last = last;
- lodash.lastIndexOf = lastIndexOf;
- lodash.lowerCase = lowerCase;
- lodash.lowerFirst = lowerFirst;
- lodash.lt = lt;
- lodash.lte = lte;
- lodash.max = max;
- lodash.maxBy = maxBy;
- lodash.mean = mean;
- lodash.meanBy = meanBy;
- lodash.min = min;
- lodash.minBy = minBy;
- lodash.stubArray = stubArray;
- lodash.stubFalse = stubFalse;
- lodash.stubObject = stubObject;
- lodash.stubString = stubString;
- lodash.stubTrue = stubTrue;
- lodash.multiply = multiply;
- lodash.nth = nth;
- lodash.noConflict = noConflict;
- lodash.noop = noop;
- lodash.now = now;
- lodash.pad = pad;
- lodash.padEnd = padEnd;
- lodash.padStart = padStart;
- lodash.parseInt = parseInt;
- lodash.random = random;
- lodash.reduce = reduce;
- lodash.reduceRight = reduceRight;
- lodash.repeat = repeat;
- lodash.replace = replace;
- lodash.result = result;
- lodash.round = round;
- lodash.runInContext = runInContext;
- lodash.sample = sample;
- lodash.size = size;
- lodash.snakeCase = snakeCase;
- lodash.some = some;
- lodash.sortedIndex = sortedIndex;
- lodash.sortedIndexBy = sortedIndexBy;
- lodash.sortedIndexOf = sortedIndexOf;
- lodash.sortedLastIndex = sortedLastIndex;
- lodash.sortedLastIndexBy = sortedLastIndexBy;
- lodash.sortedLastIndexOf = sortedLastIndexOf;
- lodash.startCase = startCase;
- lodash.startsWith = startsWith;
- lodash.subtract = subtract;
- lodash.sum = sum;
- lodash.sumBy = sumBy;
- lodash.template = template;
- lodash.times = times;
- lodash.toFinite = toFinite;
- lodash.toInteger = toInteger;
- lodash.toLength = toLength;
- lodash.toLower = toLower;
- lodash.toNumber = toNumber;
- lodash.toSafeInteger = toSafeInteger;
- lodash.toString = toString;
- lodash.toUpper = toUpper;
- lodash.trim = trim;
- lodash.trimEnd = trimEnd;
- lodash.trimStart = trimStart;
- lodash.truncate = truncate;
- lodash.unescape = unescape;
- lodash.uniqueId = uniqueId;
- lodash.upperCase = upperCase;
- lodash.upperFirst = upperFirst;
-
- // Add aliases.
- lodash.each = forEach;
- lodash.eachRight = forEachRight;
- lodash.first = head;
-
- mixin(lodash, (function() {
- var source = {};
- baseForOwn(lodash, function(func, methodName) {
- if (!hasOwnProperty.call(lodash.prototype, methodName)) {
- source[methodName] = func;
- }
- });
- return source;
- }()), { 'chain': false });
-
- /*------------------------------------------------------------------------*/
-
- /**
- * The semantic version number.
- *
- * @static
- * @memberOf _
- * @type {string}
- */
- lodash.VERSION = VERSION;
-
- // Assign default placeholders.
- arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
- lodash[methodName].placeholder = lodash;
- });
-
- // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
- arrayEach(['drop', 'take'], function(methodName, index) {
- LazyWrapper.prototype[methodName] = function(n) {
- n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
-
- var result = (this.__filtered__ && !index)
- ? new LazyWrapper(this)
- : this.clone();
-
- if (result.__filtered__) {
- result.__takeCount__ = nativeMin(n, result.__takeCount__);
- } else {
- result.__views__.push({
- 'size': nativeMin(n, MAX_ARRAY_LENGTH),
- 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
- });
- }
- return result;
- };
-
- LazyWrapper.prototype[methodName + 'Right'] = function(n) {
- return this.reverse()[methodName](n).reverse();
- };
- });
-
- // Add `LazyWrapper` methods that accept an `iteratee` value.
- arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
- var type = index + 1,
- isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
-
- LazyWrapper.prototype[methodName] = function(iteratee) {
- var result = this.clone();
- result.__iteratees__.push({
- 'iteratee': getIteratee(iteratee, 3),
- 'type': type
- });
- result.__filtered__ = result.__filtered__ || isFilter;
- return result;
- };
- });
-
- // Add `LazyWrapper` methods for `_.head` and `_.last`.
- arrayEach(['head', 'last'], function(methodName, index) {
- var takeName = 'take' + (index ? 'Right' : '');
-
- LazyWrapper.prototype[methodName] = function() {
- return this[takeName](1).value()[0];
- };
- });
-
- // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
- arrayEach(['initial', 'tail'], function(methodName, index) {
- var dropName = 'drop' + (index ? '' : 'Right');
-
- LazyWrapper.prototype[methodName] = function() {
- return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
- };
- });
-
- LazyWrapper.prototype.compact = function() {
- return this.filter(identity);
- };
-
- LazyWrapper.prototype.find = function(predicate) {
- return this.filter(predicate).head();
- };
-
- LazyWrapper.prototype.findLast = function(predicate) {
- return this.reverse().find(predicate);
- };
-
- LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
- if (typeof path == 'function') {
- return new LazyWrapper(this);
- }
- return this.map(function(value) {
- return baseInvoke(value, path, args);
- });
- });
-
- LazyWrapper.prototype.reject = function(predicate) {
- return this.filter(negate(getIteratee(predicate)));
- };
-
- LazyWrapper.prototype.slice = function(start, end) {
- start = toInteger(start);
-
- var result = this;
- if (result.__filtered__ && (start > 0 || end < 0)) {
- return new LazyWrapper(result);
- }
- if (start < 0) {
- result = result.takeRight(-start);
- } else if (start) {
- result = result.drop(start);
- }
- if (end !== undefined) {
- end = toInteger(end);
- result = end < 0 ? result.dropRight(-end) : result.take(end - start);
- }
- return result;
- };
-
- LazyWrapper.prototype.takeRightWhile = function(predicate) {
- return this.reverse().takeWhile(predicate).reverse();
- };
-
- LazyWrapper.prototype.toArray = function() {
- return this.take(MAX_ARRAY_LENGTH);
- };
-
- // Add `LazyWrapper` methods to `lodash.prototype`.
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
- var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
- isTaker = /^(?:head|last)$/.test(methodName),
- lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
- retUnwrapped = isTaker || /^find/.test(methodName);
-
- if (!lodashFunc) {
- return;
- }
- lodash.prototype[methodName] = function() {
- var value = this.__wrapped__,
- args = isTaker ? [1] : arguments,
- isLazy = value instanceof LazyWrapper,
- iteratee = args[0],
- useLazy = isLazy || isArray(value);
-
- var interceptor = function(value) {
- var result = lodashFunc.apply(lodash, arrayPush([value], args));
- return (isTaker && chainAll) ? result[0] : result;
- };
-
- if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
- // Avoid lazy use if the iteratee has a "length" value other than `1`.
- isLazy = useLazy = false;
- }
- var chainAll = this.__chain__,
- isHybrid = !!this.__actions__.length,
- isUnwrapped = retUnwrapped && !chainAll,
- onlyLazy = isLazy && !isHybrid;
-
- if (!retUnwrapped && useLazy) {
- value = onlyLazy ? value : new LazyWrapper(this);
- var result = func.apply(value, args);
- result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
- return new LodashWrapper(result, chainAll);
- }
- if (isUnwrapped && onlyLazy) {
- return func.apply(this, args);
- }
- result = this.thru(interceptor);
- return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
- };
- });
-
- // Add `Array` methods to `lodash.prototype`.
- arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
- var func = arrayProto[methodName],
- chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
- retUnwrapped = /^(?:pop|shift)$/.test(methodName);
-
- lodash.prototype[methodName] = function() {
- var args = arguments;
- if (retUnwrapped && !this.__chain__) {
- var value = this.value();
- return func.apply(isArray(value) ? value : [], args);
- }
- return this[chainName](function(value) {
- return func.apply(isArray(value) ? value : [], args);
- });
- };
- });
-
- // Map minified method names to their real names.
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
- var lodashFunc = lodash[methodName];
- if (lodashFunc) {
- var key = lodashFunc.name + '';
- if (!hasOwnProperty.call(realNames, key)) {
- realNames[key] = [];
- }
- realNames[key].push({ 'name': methodName, 'func': lodashFunc });
- }
- });
-
- realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
- 'name': 'wrapper',
- 'func': undefined
- }];
-
- // Add methods to `LazyWrapper`.
- LazyWrapper.prototype.clone = lazyClone;
- LazyWrapper.prototype.reverse = lazyReverse;
- LazyWrapper.prototype.value = lazyValue;
-
- // Add chain sequence methods to the `lodash` wrapper.
- lodash.prototype.at = wrapperAt;
- lodash.prototype.chain = wrapperChain;
- lodash.prototype.commit = wrapperCommit;
- lodash.prototype.next = wrapperNext;
- lodash.prototype.plant = wrapperPlant;
- lodash.prototype.reverse = wrapperReverse;
- lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
-
- // Add lazy aliases.
- lodash.prototype.first = lodash.prototype.head;
-
- if (symIterator) {
- lodash.prototype[symIterator] = wrapperToIterator;
- }
- return lodash;
- });
-
- /*--------------------------------------------------------------------------*/
-
- // Export lodash.
- var _ = runInContext();
-
- // Some AMD build optimizers, like r.js, check for condition patterns like:
- if (true) {
- // Expose Lodash on the global object to prevent errors when Lodash is
- // loaded by a script tag in the presence of an AMD loader.
- // See http://requirejs.org/docs/errors.html#mismatch for more details.
- // Use `_.noConflict` to remove Lodash from the global object.
- root._ = _;
-
- // Define as an anonymous module so, through path mapping, it can be
- // referenced as the "underscore" module.
- !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
- return _;
- }).call(exports, __webpack_require__, exports, module),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- }
- // Check for `exports` after `define` in case a build optimizer adds it.
- else {}
- }.call(this));
-
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
-
- /***/ }),
-
- /***/ "./node_modules/object-assign/index.js":
- /*!*********************************************!*\
- !*** ./node_modules/object-assign/index.js ***!
- \*********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
- /*
- object-assign
- (c) Sindre Sorhus
- @license MIT
- */
-
-
- /* eslint-disable no-unused-vars */
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
-
- function toObject(val) {
- if (val === null || val === undefined) {
- throw new TypeError('Object.assign cannot be called with null or undefined');
- }
-
- return Object(val);
- }
-
- function shouldUseNative() {
- try {
- if (!Object.assign) {
- return false;
- }
-
- // Detect buggy property enumeration order in older V8 versions.
-
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
- test1[5] = 'de';
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
- return false;
- }
-
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
- var test2 = {};
- for (var i = 0; i < 10; i++) {
- test2['_' + String.fromCharCode(i)] = i;
- }
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
- return test2[n];
- });
- if (order2.join('') !== '0123456789') {
- return false;
- }
-
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
- var test3 = {};
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
- test3[letter] = letter;
- });
- if (Object.keys(Object.assign({}, test3)).join('') !==
- 'abcdefghijklmnopqrst') {
- return false;
- }
-
- return true;
- } catch (err) {
- // We don't expect any of the above to throw, but better to be safe.
- return false;
- }
- }
-
- module.exports = shouldUseNative() ? Object.assign : function (target, source) {
- var from;
- var to = toObject(target);
- var symbols;
-
- for (var s = 1; s < arguments.length; s++) {
- from = Object(arguments[s]);
-
- for (var key in from) {
- if (hasOwnProperty.call(from, key)) {
- to[key] = from[key];
- }
- }
-
- if (getOwnPropertySymbols) {
- symbols = getOwnPropertySymbols(from);
- for (var i = 0; i < symbols.length; i++) {
- if (propIsEnumerable.call(from, symbols[i])) {
- to[symbols[i]] = from[symbols[i]];
- }
- }
- }
- }
-
- return to;
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/popper.js/dist/esm/popper.js":
- /*!***************************************************!*\
- !*** ./node_modules/popper.js/dist/esm/popper.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* WEBPACK VAR INJECTION */(function(global) {/**!
- * @fileOverview Kickass library to create and place poppers near their reference elements.
- * @version 1.16.0
- * @license
- * Copyright (c) 2016 Federico Zivolo and contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
- var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';
-
- var timeoutDuration = function () {
- var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
- for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
- if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
- return 1;
- }
- }
- return 0;
- }();
-
- function microtaskDebounce(fn) {
- var called = false;
- return function () {
- if (called) {
- return;
- }
- called = true;
- window.Promise.resolve().then(function () {
- called = false;
- fn();
- });
- };
- }
-
- function taskDebounce(fn) {
- var scheduled = false;
- return function () {
- if (!scheduled) {
- scheduled = true;
- setTimeout(function () {
- scheduled = false;
- fn();
- }, timeoutDuration);
- }
- };
- }
-
- var supportsMicroTasks = isBrowser && window.Promise;
-
- /**
- * Create a debounced version of a method, that's asynchronously deferred
- * but called in the minimum time possible.
- *
- * @method
- * @memberof Popper.Utils
- * @argument {Function} fn
- * @returns {Function}
- */
- var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
-
- /**
- * Check if the given variable is a function
- * @method
- * @memberof Popper.Utils
- * @argument {Any} functionToCheck - variable to check
- * @returns {Boolean} answer to: is a function?
- */
- function isFunction(functionToCheck) {
- var getType = {};
- return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
- }
-
- /**
- * Get CSS computed property of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Eement} element
- * @argument {String} property
- */
- function getStyleComputedProperty(element, property) {
- if (element.nodeType !== 1) {
- return [];
- }
- // NOTE: 1 DOM access here
- var window = element.ownerDocument.defaultView;
- var css = window.getComputedStyle(element, null);
- return property ? css[property] : css;
- }
-
- /**
- * Returns the parentNode or the host of the element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} parent
- */
- function getParentNode(element) {
- if (element.nodeName === 'HTML') {
- return element;
- }
- return element.parentNode || element.host;
- }
-
- /**
- * Returns the scrolling parent of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} scroll parent
- */
- function getScrollParent(element) {
- // Return body, `getScroll` will take care to get the correct `scrollTop` from it
- if (!element) {
- return document.body;
- }
-
- switch (element.nodeName) {
- case 'HTML':
- case 'BODY':
- return element.ownerDocument.body;
- case '#document':
- return element.body;
- }
-
- // Firefox want us to check `-x` and `-y` variations as well
-
- var _getStyleComputedProp = getStyleComputedProperty(element),
- overflow = _getStyleComputedProp.overflow,
- overflowX = _getStyleComputedProp.overflowX,
- overflowY = _getStyleComputedProp.overflowY;
-
- if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
- return element;
- }
-
- return getScrollParent(getParentNode(element));
- }
-
- /**
- * Returns the reference node of the reference object, or the reference object itself.
- * @method
- * @memberof Popper.Utils
- * @param {Element|Object} reference - the reference element (the popper will be relative to this)
- * @returns {Element} parent
- */
- function getReferenceNode(reference) {
- return reference && reference.referenceNode ? reference.referenceNode : reference;
- }
-
- var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
- var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
-
- /**
- * Determines if the browser is Internet Explorer
- * @method
- * @memberof Popper.Utils
- * @param {Number} version to check
- * @returns {Boolean} isIE
- */
- function isIE(version) {
- if (version === 11) {
- return isIE11;
- }
- if (version === 10) {
- return isIE10;
- }
- return isIE11 || isIE10;
- }
-
- /**
- * Returns the offset parent of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} offset parent
- */
- function getOffsetParent(element) {
- if (!element) {
- return document.documentElement;
- }
-
- var noOffsetParent = isIE(10) ? document.body : null;
-
- // NOTE: 1 DOM access here
- var offsetParent = element.offsetParent || null;
- // Skip hidden elements which don't have an offsetParent
- while (offsetParent === noOffsetParent && element.nextElementSibling) {
- offsetParent = (element = element.nextElementSibling).offsetParent;
- }
-
- var nodeName = offsetParent && offsetParent.nodeName;
-
- if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
- return element ? element.ownerDocument.documentElement : document.documentElement;
- }
-
- // .offsetParent will return the closest TH, TD or TABLE in case
- // no offsetParent is present, I hate this job...
- if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
- return getOffsetParent(offsetParent);
- }
-
- return offsetParent;
- }
-
- function isOffsetContainer(element) {
- var nodeName = element.nodeName;
-
- if (nodeName === 'BODY') {
- return false;
- }
- return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
- }
-
- /**
- * Finds the root node (document, shadowDOM root) of the given element
- * @method
- * @memberof Popper.Utils
- * @argument {Element} node
- * @returns {Element} root node
- */
- function getRoot(node) {
- if (node.parentNode !== null) {
- return getRoot(node.parentNode);
- }
-
- return node;
- }
-
- /**
- * Finds the offset parent common to the two provided nodes
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element1
- * @argument {Element} element2
- * @returns {Element} common offset parent
- */
- function findCommonOffsetParent(element1, element2) {
- // This check is needed to avoid errors in case one of the elements isn't defined for any reason
- if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
- return document.documentElement;
- }
-
- // Here we make sure to give as "start" the element that comes first in the DOM
- var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
- var start = order ? element1 : element2;
- var end = order ? element2 : element1;
-
- // Get common ancestor container
- var range = document.createRange();
- range.setStart(start, 0);
- range.setEnd(end, 0);
- var commonAncestorContainer = range.commonAncestorContainer;
-
- // Both nodes are inside #document
-
- if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
- if (isOffsetContainer(commonAncestorContainer)) {
- return commonAncestorContainer;
- }
-
- return getOffsetParent(commonAncestorContainer);
- }
-
- // one of the nodes is inside shadowDOM, find which one
- var element1root = getRoot(element1);
- if (element1root.host) {
- return findCommonOffsetParent(element1root.host, element2);
- } else {
- return findCommonOffsetParent(element1, getRoot(element2).host);
- }
- }
-
- /**
- * Gets the scroll value of the given element in the given side (top and left)
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @argument {String} side `top` or `left`
- * @returns {number} amount of scrolled pixels
- */
- function getScroll(element) {
- var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
-
- var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
- var nodeName = element.nodeName;
-
- if (nodeName === 'BODY' || nodeName === 'HTML') {
- var html = element.ownerDocument.documentElement;
- var scrollingElement = element.ownerDocument.scrollingElement || html;
- return scrollingElement[upperSide];
- }
-
- return element[upperSide];
- }
-
- /*
- * Sum or subtract the element scroll values (left and top) from a given rect object
- * @method
- * @memberof Popper.Utils
- * @param {Object} rect - Rect object you want to change
- * @param {HTMLElement} element - The element from the function reads the scroll values
- * @param {Boolean} subtract - set to true if you want to subtract the scroll values
- * @return {Object} rect - The modifier rect object
- */
- function includeScroll(rect, element) {
- var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
-
- var scrollTop = getScroll(element, 'top');
- var scrollLeft = getScroll(element, 'left');
- var modifier = subtract ? -1 : 1;
- rect.top += scrollTop * modifier;
- rect.bottom += scrollTop * modifier;
- rect.left += scrollLeft * modifier;
- rect.right += scrollLeft * modifier;
- return rect;
- }
-
- /*
- * Helper to detect borders of a given element
- * @method
- * @memberof Popper.Utils
- * @param {CSSStyleDeclaration} styles
- * Result of `getStyleComputedProperty` on the given element
- * @param {String} axis - `x` or `y`
- * @return {number} borders - The borders size of the given axis
- */
-
- function getBordersSize(styles, axis) {
- var sideA = axis === 'x' ? 'Left' : 'Top';
- var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
-
- return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
- }
-
- function getSize(axis, body, html, computedStyle) {
- return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
- }
-
- function getWindowSizes(document) {
- var body = document.body;
- var html = document.documentElement;
- var computedStyle = isIE(10) && getComputedStyle(html);
-
- return {
- height: getSize('Height', body, html, computedStyle),
- width: getSize('Width', body, html, computedStyle)
- };
- }
-
- var classCallCheck = function (instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- };
-
- 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;
- };
- }();
-
-
-
-
-
- var defineProperty = function (obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
-
- return obj;
- };
-
- var _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
-
- for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }
-
- return target;
- };
-
- /**
- * Given element offsets, generate an output similar to getBoundingClientRect
- * @method
- * @memberof Popper.Utils
- * @argument {Object} offsets
- * @returns {Object} ClientRect like output
- */
- function getClientRect(offsets) {
- return _extends({}, offsets, {
- right: offsets.left + offsets.width,
- bottom: offsets.top + offsets.height
- });
- }
-
- /**
- * Get bounding client rect of given element
- * @method
- * @memberof Popper.Utils
- * @param {HTMLElement} element
- * @return {Object} client rect
- */
- function getBoundingClientRect(element) {
- var rect = {};
-
- // IE10 10 FIX: Please, don't ask, the element isn't
- // considered in DOM in some circumstances...
- // This isn't reproducible in IE10 compatibility mode of IE11
- try {
- if (isIE(10)) {
- rect = element.getBoundingClientRect();
- var scrollTop = getScroll(element, 'top');
- var scrollLeft = getScroll(element, 'left');
- rect.top += scrollTop;
- rect.left += scrollLeft;
- rect.bottom += scrollTop;
- rect.right += scrollLeft;
- } else {
- rect = element.getBoundingClientRect();
- }
- } catch (e) {}
-
- var result = {
- left: rect.left,
- top: rect.top,
- width: rect.right - rect.left,
- height: rect.bottom - rect.top
- };
-
- // subtract scrollbar size from sizes
- var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
- var width = sizes.width || element.clientWidth || result.width;
- var height = sizes.height || element.clientHeight || result.height;
-
- var horizScrollbar = element.offsetWidth - width;
- var vertScrollbar = element.offsetHeight - height;
-
- // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
- // we make this check conditional for performance reasons
- if (horizScrollbar || vertScrollbar) {
- var styles = getStyleComputedProperty(element);
- horizScrollbar -= getBordersSize(styles, 'x');
- vertScrollbar -= getBordersSize(styles, 'y');
-
- result.width -= horizScrollbar;
- result.height -= vertScrollbar;
- }
-
- return getClientRect(result);
- }
-
- function getOffsetRectRelativeToArbitraryNode(children, parent) {
- var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
-
- var isIE10 = isIE(10);
- var isHTML = parent.nodeName === 'HTML';
- var childrenRect = getBoundingClientRect(children);
- var parentRect = getBoundingClientRect(parent);
- var scrollParent = getScrollParent(children);
-
- var styles = getStyleComputedProperty(parent);
- var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
- var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
-
- // In cases where the parent is fixed, we must ignore negative scroll in offset calc
- if (fixedPosition && isHTML) {
- parentRect.top = Math.max(parentRect.top, 0);
- parentRect.left = Math.max(parentRect.left, 0);
- }
- var offsets = getClientRect({
- top: childrenRect.top - parentRect.top - borderTopWidth,
- left: childrenRect.left - parentRect.left - borderLeftWidth,
- width: childrenRect.width,
- height: childrenRect.height
- });
- offsets.marginTop = 0;
- offsets.marginLeft = 0;
-
- // Subtract margins of documentElement in case it's being used as parent
- // we do this only on HTML because it's the only element that behaves
- // differently when margins are applied to it. The margins are included in
- // the box of the documentElement, in the other cases not.
- if (!isIE10 && isHTML) {
- var marginTop = parseFloat(styles.marginTop, 10);
- var marginLeft = parseFloat(styles.marginLeft, 10);
-
- offsets.top -= borderTopWidth - marginTop;
- offsets.bottom -= borderTopWidth - marginTop;
- offsets.left -= borderLeftWidth - marginLeft;
- offsets.right -= borderLeftWidth - marginLeft;
-
- // Attach marginTop and marginLeft because in some circumstances we may need them
- offsets.marginTop = marginTop;
- offsets.marginLeft = marginLeft;
- }
-
- if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
- offsets = includeScroll(offsets, parent);
- }
-
- return offsets;
- }
-
- function getViewportOffsetRectRelativeToArtbitraryNode(element) {
- var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
-
- var html = element.ownerDocument.documentElement;
- var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
- var width = Math.max(html.clientWidth, window.innerWidth || 0);
- var height = Math.max(html.clientHeight, window.innerHeight || 0);
-
- var scrollTop = !excludeScroll ? getScroll(html) : 0;
- var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
-
- var offset = {
- top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
- left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
- width: width,
- height: height
- };
-
- return getClientRect(offset);
- }
-
- /**
- * Check if the given element is fixed or is inside a fixed parent
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @argument {Element} customContainer
- * @returns {Boolean} answer to "isFixed?"
- */
- function isFixed(element) {
- var nodeName = element.nodeName;
- if (nodeName === 'BODY' || nodeName === 'HTML') {
- return false;
- }
- if (getStyleComputedProperty(element, 'position') === 'fixed') {
- return true;
- }
- var parentNode = getParentNode(element);
- if (!parentNode) {
- return false;
- }
- return isFixed(parentNode);
- }
-
- /**
- * Finds the first parent of an element that has a transformed property defined
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Element} first transformed parent or documentElement
- */
-
- function getFixedPositionOffsetParent(element) {
- // This check is needed to avoid errors in case one of the elements isn't defined for any reason
- if (!element || !element.parentElement || isIE()) {
- return document.documentElement;
- }
- var el = element.parentElement;
- while (el && getStyleComputedProperty(el, 'transform') === 'none') {
- el = el.parentElement;
- }
- return el || document.documentElement;
- }
-
- /**
- * Computed the boundaries limits and return them
- * @method
- * @memberof Popper.Utils
- * @param {HTMLElement} popper
- * @param {HTMLElement} reference
- * @param {number} padding
- * @param {HTMLElement} boundariesElement - Element used to define the boundaries
- * @param {Boolean} fixedPosition - Is in fixed position mode
- * @returns {Object} Coordinates of the boundaries
- */
- function getBoundaries(popper, reference, padding, boundariesElement) {
- var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
-
- // NOTE: 1 DOM access here
-
- var boundaries = { top: 0, left: 0 };
- var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
-
- // Handle viewport case
- if (boundariesElement === 'viewport') {
- boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
- } else {
- // Handle other cases based on DOM element used as boundaries
- var boundariesNode = void 0;
- if (boundariesElement === 'scrollParent') {
- boundariesNode = getScrollParent(getParentNode(reference));
- if (boundariesNode.nodeName === 'BODY') {
- boundariesNode = popper.ownerDocument.documentElement;
- }
- } else if (boundariesElement === 'window') {
- boundariesNode = popper.ownerDocument.documentElement;
- } else {
- boundariesNode = boundariesElement;
- }
-
- var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
-
- // In case of HTML, we need a different computation
- if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
- var _getWindowSizes = getWindowSizes(popper.ownerDocument),
- height = _getWindowSizes.height,
- width = _getWindowSizes.width;
-
- boundaries.top += offsets.top - offsets.marginTop;
- boundaries.bottom = height + offsets.top;
- boundaries.left += offsets.left - offsets.marginLeft;
- boundaries.right = width + offsets.left;
- } else {
- // for all the other DOM elements, this one is good
- boundaries = offsets;
- }
- }
-
- // Add paddings
- padding = padding || 0;
- var isPaddingNumber = typeof padding === 'number';
- boundaries.left += isPaddingNumber ? padding : padding.left || 0;
- boundaries.top += isPaddingNumber ? padding : padding.top || 0;
- boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
- boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
-
- return boundaries;
- }
-
- function getArea(_ref) {
- var width = _ref.width,
- height = _ref.height;
-
- return width * height;
- }
-
- /**
- * Utility used to transform the `auto` placement to the placement with more
- * available space.
- * @method
- * @memberof Popper.Utils
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
- var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
-
- if (placement.indexOf('auto') === -1) {
- return placement;
- }
-
- var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
-
- var rects = {
- top: {
- width: boundaries.width,
- height: refRect.top - boundaries.top
- },
- right: {
- width: boundaries.right - refRect.right,
- height: boundaries.height
- },
- bottom: {
- width: boundaries.width,
- height: boundaries.bottom - refRect.bottom
- },
- left: {
- width: refRect.left - boundaries.left,
- height: boundaries.height
- }
- };
-
- var sortedAreas = Object.keys(rects).map(function (key) {
- return _extends({
- key: key
- }, rects[key], {
- area: getArea(rects[key])
- });
- }).sort(function (a, b) {
- return b.area - a.area;
- });
-
- var filteredAreas = sortedAreas.filter(function (_ref2) {
- var width = _ref2.width,
- height = _ref2.height;
- return width >= popper.clientWidth && height >= popper.clientHeight;
- });
-
- var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
-
- var variation = placement.split('-')[1];
-
- return computedPlacement + (variation ? '-' + variation : '');
- }
-
- /**
- * Get offsets to the reference element
- * @method
- * @memberof Popper.Utils
- * @param {Object} state
- * @param {Element} popper - the popper element
- * @param {Element} reference - the reference element (the popper will be relative to this)
- * @param {Element} fixedPosition - is in fixed position mode
- * @returns {Object} An object containing the offsets which will be applied to the popper
- */
- function getReferenceOffsets(state, popper, reference) {
- var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
-
- var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
- return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
- }
-
- /**
- * Get the outer sizes of the given element (offset size + margins)
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element
- * @returns {Object} object containing width and height properties
- */
- function getOuterSizes(element) {
- var window = element.ownerDocument.defaultView;
- var styles = window.getComputedStyle(element);
- var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
- var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
- var result = {
- width: element.offsetWidth + y,
- height: element.offsetHeight + x
- };
- return result;
- }
-
- /**
- * Get the opposite placement of the given one
- * @method
- * @memberof Popper.Utils
- * @argument {String} placement
- * @returns {String} flipped placement
- */
- function getOppositePlacement(placement) {
- var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
- return placement.replace(/left|right|bottom|top/g, function (matched) {
- return hash[matched];
- });
- }
-
- /**
- * Get offsets to the popper
- * @method
- * @memberof Popper.Utils
- * @param {Object} position - CSS position the Popper will get applied
- * @param {HTMLElement} popper - the popper element
- * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
- * @param {String} placement - one of the valid placement options
- * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
- */
- function getPopperOffsets(popper, referenceOffsets, placement) {
- placement = placement.split('-')[0];
-
- // Get popper node sizes
- var popperRect = getOuterSizes(popper);
-
- // Add position, width and height to our offsets object
- var popperOffsets = {
- width: popperRect.width,
- height: popperRect.height
- };
-
- // depending by the popper placement we have to compute its offsets slightly differently
- var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
- var mainSide = isHoriz ? 'top' : 'left';
- var secondarySide = isHoriz ? 'left' : 'top';
- var measurement = isHoriz ? 'height' : 'width';
- var secondaryMeasurement = !isHoriz ? 'height' : 'width';
-
- popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
- if (placement === secondarySide) {
- popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
- } else {
- popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
- }
-
- return popperOffsets;
- }
-
- /**
- * Mimics the `find` method of Array
- * @method
- * @memberof Popper.Utils
- * @argument {Array} arr
- * @argument prop
- * @argument value
- * @returns index or -1
- */
- function find(arr, check) {
- // use native find if supported
- if (Array.prototype.find) {
- return arr.find(check);
- }
-
- // use `filter` to obtain the same behavior of `find`
- return arr.filter(check)[0];
- }
-
- /**
- * Return the index of the matching object
- * @method
- * @memberof Popper.Utils
- * @argument {Array} arr
- * @argument prop
- * @argument value
- * @returns index or -1
- */
- function findIndex(arr, prop, value) {
- // use native findIndex if supported
- if (Array.prototype.findIndex) {
- return arr.findIndex(function (cur) {
- return cur[prop] === value;
- });
- }
-
- // use `find` + `indexOf` if `findIndex` isn't supported
- var match = find(arr, function (obj) {
- return obj[prop] === value;
- });
- return arr.indexOf(match);
- }
-
- /**
- * Loop trough the list of modifiers and run them in order,
- * each of them will then edit the data object.
- * @method
- * @memberof Popper.Utils
- * @param {dataObject} data
- * @param {Array} modifiers
- * @param {String} ends - Optional modifier name used as stopper
- * @returns {dataObject}
- */
- function runModifiers(modifiers, data, ends) {
- var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
-
- modifiersToRun.forEach(function (modifier) {
- if (modifier['function']) {
- // eslint-disable-line dot-notation
- console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
- }
- var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
- if (modifier.enabled && isFunction(fn)) {
- // Add properties to offsets to make them a complete clientRect object
- // we do this before each modifier to make sure the previous one doesn't
- // mess with these values
- data.offsets.popper = getClientRect(data.offsets.popper);
- data.offsets.reference = getClientRect(data.offsets.reference);
-
- data = fn(data, modifier);
- }
- });
-
- return data;
- }
-
- /**
- * Updates the position of the popper, computing the new offsets and applying
- * the new style.<br />
- * Prefer `scheduleUpdate` over `update` because of performance reasons.
- * @method
- * @memberof Popper
- */
- function update() {
- // if popper is destroyed, don't perform any further update
- if (this.state.isDestroyed) {
- return;
- }
-
- var data = {
- instance: this,
- styles: {},
- arrowStyles: {},
- attributes: {},
- flipped: false,
- offsets: {}
- };
-
- // compute reference element offsets
- data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
-
- // compute auto placement, store placement inside the data object,
- // modifiers will be able to edit `placement` if needed
- // and refer to originalPlacement to know the original value
- data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
-
- // store the computed placement inside `originalPlacement`
- data.originalPlacement = data.placement;
-
- data.positionFixed = this.options.positionFixed;
-
- // compute the popper offsets
- data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
-
- data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
-
- // run the modifiers
- data = runModifiers(this.modifiers, data);
-
- // the first `update` will call `onCreate` callback
- // the other ones will call `onUpdate` callback
- if (!this.state.isCreated) {
- this.state.isCreated = true;
- this.options.onCreate(data);
- } else {
- this.options.onUpdate(data);
- }
- }
-
- /**
- * Helper used to know if the given modifier is enabled.
- * @method
- * @memberof Popper.Utils
- * @returns {Boolean}
- */
- function isModifierEnabled(modifiers, modifierName) {
- return modifiers.some(function (_ref) {
- var name = _ref.name,
- enabled = _ref.enabled;
- return enabled && name === modifierName;
- });
- }
-
- /**
- * Get the prefixed supported property name
- * @method
- * @memberof Popper.Utils
- * @argument {String} property (camelCase)
- * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
- */
- function getSupportedPropertyName(property) {
- var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
- var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
-
- for (var i = 0; i < prefixes.length; i++) {
- var prefix = prefixes[i];
- var toCheck = prefix ? '' + prefix + upperProp : property;
- if (typeof document.body.style[toCheck] !== 'undefined') {
- return toCheck;
- }
- }
- return null;
- }
-
- /**
- * Destroys the popper.
- * @method
- * @memberof Popper
- */
- function destroy() {
- this.state.isDestroyed = true;
-
- // touch DOM only if `applyStyle` modifier is enabled
- if (isModifierEnabled(this.modifiers, 'applyStyle')) {
- this.popper.removeAttribute('x-placement');
- this.popper.style.position = '';
- this.popper.style.top = '';
- this.popper.style.left = '';
- this.popper.style.right = '';
- this.popper.style.bottom = '';
- this.popper.style.willChange = '';
- this.popper.style[getSupportedPropertyName('transform')] = '';
- }
-
- this.disableEventListeners();
-
- // remove the popper if user explicitly asked for the deletion on destroy
- // do not use `remove` because IE11 doesn't support it
- if (this.options.removeOnDestroy) {
- this.popper.parentNode.removeChild(this.popper);
- }
- return this;
- }
-
- /**
- * Get the window associated with the element
- * @argument {Element} element
- * @returns {Window}
- */
- function getWindow(element) {
- var ownerDocument = element.ownerDocument;
- return ownerDocument ? ownerDocument.defaultView : window;
- }
-
- function attachToScrollParents(scrollParent, event, callback, scrollParents) {
- var isBody = scrollParent.nodeName === 'BODY';
- var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
- target.addEventListener(event, callback, { passive: true });
-
- if (!isBody) {
- attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
- }
- scrollParents.push(target);
- }
-
- /**
- * Setup needed event listeners used to update the popper position
- * @method
- * @memberof Popper.Utils
- * @private
- */
- function setupEventListeners(reference, options, state, updateBound) {
- // Resize event listener on window
- state.updateBound = updateBound;
- getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
-
- // Scroll event listener on scroll parents
- var scrollElement = getScrollParent(reference);
- attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
- state.scrollElement = scrollElement;
- state.eventsEnabled = true;
-
- return state;
- }
-
- /**
- * It will add resize/scroll events and start recalculating
- * position of the popper element when they are triggered.
- * @method
- * @memberof Popper
- */
- function enableEventListeners() {
- if (!this.state.eventsEnabled) {
- this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
- }
- }
-
- /**
- * Remove event listeners used to update the popper position
- * @method
- * @memberof Popper.Utils
- * @private
- */
- function removeEventListeners(reference, state) {
- // Remove resize event listener on window
- getWindow(reference).removeEventListener('resize', state.updateBound);
-
- // Remove scroll event listener on scroll parents
- state.scrollParents.forEach(function (target) {
- target.removeEventListener('scroll', state.updateBound);
- });
-
- // Reset state
- state.updateBound = null;
- state.scrollParents = [];
- state.scrollElement = null;
- state.eventsEnabled = false;
- return state;
- }
-
- /**
- * It will remove resize/scroll events and won't recalculate popper position
- * when they are triggered. It also won't trigger `onUpdate` callback anymore,
- * unless you call `update` method manually.
- * @method
- * @memberof Popper
- */
- function disableEventListeners() {
- if (this.state.eventsEnabled) {
- cancelAnimationFrame(this.scheduleUpdate);
- this.state = removeEventListeners(this.reference, this.state);
- }
- }
-
- /**
- * Tells if a given input is a number
- * @method
- * @memberof Popper.Utils
- * @param {*} input to check
- * @return {Boolean}
- */
- function isNumeric(n) {
- return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
- }
-
- /**
- * Set the style to the given popper
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element - Element to apply the style to
- * @argument {Object} styles
- * Object with a list of properties and values which will be applied to the element
- */
- function setStyles(element, styles) {
- Object.keys(styles).forEach(function (prop) {
- var unit = '';
- // add unit if the value is numeric and is one of the following
- if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
- unit = 'px';
- }
- element.style[prop] = styles[prop] + unit;
- });
- }
-
- /**
- * Set the attributes to the given popper
- * @method
- * @memberof Popper.Utils
- * @argument {Element} element - Element to apply the attributes to
- * @argument {Object} styles
- * Object with a list of properties and values which will be applied to the element
- */
- function setAttributes(element, attributes) {
- Object.keys(attributes).forEach(function (prop) {
- var value = attributes[prop];
- if (value !== false) {
- element.setAttribute(prop, attributes[prop]);
- } else {
- element.removeAttribute(prop);
- }
- });
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} data.styles - List of style properties - values to apply to popper element
- * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The same data object
- */
- function applyStyle(data) {
- // any property present in `data.styles` will be applied to the popper,
- // in this way we can make the 3rd party modifiers add custom styles to it
- // Be aware, modifiers could override the properties defined in the previous
- // lines of this modifier!
- setStyles(data.instance.popper, data.styles);
-
- // any property present in `data.attributes` will be applied to the popper,
- // they will be set as HTML attributes of the element
- setAttributes(data.instance.popper, data.attributes);
-
- // if arrowElement is defined and arrowStyles has some properties
- if (data.arrowElement && Object.keys(data.arrowStyles).length) {
- setStyles(data.arrowElement, data.arrowStyles);
- }
-
- return data;
- }
-
- /**
- * Set the x-placement attribute before everything else because it could be used
- * to add margins to the popper margins needs to be calculated to get the
- * correct popper offsets.
- * @method
- * @memberof Popper.modifiers
- * @param {HTMLElement} reference - The reference element used to position the popper
- * @param {HTMLElement} popper - The HTML element used as popper
- * @param {Object} options - Popper.js options
- */
- function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
- // compute reference element offsets
- var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
-
- // compute auto placement, store placement inside the data object,
- // modifiers will be able to edit `placement` if needed
- // and refer to originalPlacement to know the original value
- var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
-
- popper.setAttribute('x-placement', placement);
-
- // Apply `position` to popper before anything else because
- // without the position applied we can't guarantee correct computations
- setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
-
- return options;
- }
-
- /**
- * @function
- * @memberof Popper.Utils
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Boolean} shouldRound - If the offsets should be rounded at all
- * @returns {Object} The popper's position offsets rounded
- *
- * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
- * good as it can be within reason.
- * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
- *
- * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
- * as well on High DPI screens).
- *
- * Firefox prefers no rounding for positioning and does not have blurriness on
- * high DPI screens.
- *
- * Only horizontal placement and left/right values need to be considered.
- */
- function getRoundedOffsets(data, shouldRound) {
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
- var round = Math.round,
- floor = Math.floor;
-
- var noRound = function noRound(v) {
- return v;
- };
-
- var referenceWidth = round(reference.width);
- var popperWidth = round(popper.width);
-
- var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
- var isVariation = data.placement.indexOf('-') !== -1;
- var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
- var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
-
- var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
- var verticalToInteger = !shouldRound ? noRound : round;
-
- return {
- left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
- top: verticalToInteger(popper.top),
- bottom: verticalToInteger(popper.bottom),
- right: horizontalToInteger(popper.right)
- };
- }
-
- var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function computeStyle(data, options) {
- var x = options.x,
- y = options.y;
- var popper = data.offsets.popper;
-
- // Remove this legacy support in Popper.js v2
-
- var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
- return modifier.name === 'applyStyle';
- }).gpuAcceleration;
- if (legacyGpuAccelerationOption !== undefined) {
- console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
- }
- var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
-
- var offsetParent = getOffsetParent(data.instance.popper);
- var offsetParentRect = getBoundingClientRect(offsetParent);
-
- // Styles
- var styles = {
- position: popper.position
- };
-
- var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
-
- var sideA = x === 'bottom' ? 'top' : 'bottom';
- var sideB = y === 'right' ? 'left' : 'right';
-
- // if gpuAcceleration is set to `true` and transform is supported,
- // we use `translate3d` to apply the position to the popper we
- // automatically use the supported prefixed version if needed
- var prefixedProperty = getSupportedPropertyName('transform');
-
- // now, let's make a step back and look at this code closely (wtf?)
- // If the content of the popper grows once it's been positioned, it
- // may happen that the popper gets misplaced because of the new content
- // overflowing its reference element
- // To avoid this problem, we provide two options (x and y), which allow
- // the consumer to define the offset origin.
- // If we position a popper on top of a reference element, we can set
- // `x` to `top` to make the popper grow towards its top instead of
- // its bottom.
- var left = void 0,
- top = void 0;
- if (sideA === 'bottom') {
- // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
- // and not the bottom of the html element
- if (offsetParent.nodeName === 'HTML') {
- top = -offsetParent.clientHeight + offsets.bottom;
- } else {
- top = -offsetParentRect.height + offsets.bottom;
- }
- } else {
- top = offsets.top;
- }
- if (sideB === 'right') {
- if (offsetParent.nodeName === 'HTML') {
- left = -offsetParent.clientWidth + offsets.right;
- } else {
- left = -offsetParentRect.width + offsets.right;
- }
- } else {
- left = offsets.left;
- }
- if (gpuAcceleration && prefixedProperty) {
- styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
- styles[sideA] = 0;
- styles[sideB] = 0;
- styles.willChange = 'transform';
- } else {
- // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
- var invertTop = sideA === 'bottom' ? -1 : 1;
- var invertLeft = sideB === 'right' ? -1 : 1;
- styles[sideA] = top * invertTop;
- styles[sideB] = left * invertLeft;
- styles.willChange = sideA + ', ' + sideB;
- }
-
- // Attributes
- var attributes = {
- 'x-placement': data.placement
- };
-
- // Update `data` attributes, styles and arrowStyles
- data.attributes = _extends({}, attributes, data.attributes);
- data.styles = _extends({}, styles, data.styles);
- data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
-
- return data;
- }
-
- /**
- * Helper used to know if the given modifier depends from another one.<br />
- * It checks if the needed modifier is listed and enabled.
- * @method
- * @memberof Popper.Utils
- * @param {Array} modifiers - list of modifiers
- * @param {String} requestingName - name of requesting modifier
- * @param {String} requestedName - name of requested modifier
- * @returns {Boolean}
- */
- function isModifierRequired(modifiers, requestingName, requestedName) {
- var requesting = find(modifiers, function (_ref) {
- var name = _ref.name;
- return name === requestingName;
- });
-
- var isRequired = !!requesting && modifiers.some(function (modifier) {
- return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
- });
-
- if (!isRequired) {
- var _requesting = '`' + requestingName + '`';
- var requested = '`' + requestedName + '`';
- console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
- }
- return isRequired;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function arrow(data, options) {
- var _data$offsets$arrow;
-
- // arrow depends on keepTogether in order to work
- if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
- return data;
- }
-
- var arrowElement = options.element;
-
- // if arrowElement is a string, suppose it's a CSS selector
- if (typeof arrowElement === 'string') {
- arrowElement = data.instance.popper.querySelector(arrowElement);
-
- // if arrowElement is not found, don't run the modifier
- if (!arrowElement) {
- return data;
- }
- } else {
- // if the arrowElement isn't a query selector we must check that the
- // provided DOM node is child of its popper node
- if (!data.instance.popper.contains(arrowElement)) {
- console.warn('WARNING: `arrow.element` must be child of its popper element!');
- return data;
- }
- }
-
- var placement = data.placement.split('-')[0];
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
-
- var isVertical = ['left', 'right'].indexOf(placement) !== -1;
-
- var len = isVertical ? 'height' : 'width';
- var sideCapitalized = isVertical ? 'Top' : 'Left';
- var side = sideCapitalized.toLowerCase();
- var altSide = isVertical ? 'left' : 'top';
- var opSide = isVertical ? 'bottom' : 'right';
- var arrowElementSize = getOuterSizes(arrowElement)[len];
-
- //
- // extends keepTogether behavior making sure the popper and its
- // reference have enough pixels in conjunction
- //
-
- // top/left side
- if (reference[opSide] - arrowElementSize < popper[side]) {
- data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
- }
- // bottom/right side
- if (reference[side] + arrowElementSize > popper[opSide]) {
- data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
- }
- data.offsets.popper = getClientRect(data.offsets.popper);
-
- // compute center of the popper
- var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
-
- // Compute the sideValue using the updated popper offsets
- // take popper margin in account because we don't have this info available
- var css = getStyleComputedProperty(data.instance.popper);
- var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);
- var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);
- var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
-
- // prevent arrowElement from being placed not contiguously to its popper
- sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
-
- data.arrowElement = arrowElement;
- data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
-
- return data;
- }
-
- /**
- * Get the opposite placement variation of the given one
- * @method
- * @memberof Popper.Utils
- * @argument {String} placement variation
- * @returns {String} flipped placement variation
- */
- function getOppositeVariation(variation) {
- if (variation === 'end') {
- return 'start';
- } else if (variation === 'start') {
- return 'end';
- }
- return variation;
- }
-
- /**
- * List of accepted placements to use as values of the `placement` option.<br />
- * Valid placements are:
- * - `auto`
- * - `top`
- * - `right`
- * - `bottom`
- * - `left`
- *
- * Each placement can have a variation from this list:
- * - `-start`
- * - `-end`
- *
- * Variations are interpreted easily if you think of them as the left to right
- * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
- * is right.<br />
- * Vertically (`left` and `right`), `start` is top and `end` is bottom.
- *
- * Some valid examples are:
- * - `top-end` (on top of reference, right aligned)
- * - `right-start` (on right of reference, top aligned)
- * - `bottom` (on bottom, centered)
- * - `auto-end` (on the side with more space available, alignment depends by placement)
- *
- * @static
- * @type {Array}
- * @enum {String}
- * @readonly
- * @method placements
- * @memberof Popper
- */
- var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
-
- // Get rid of `auto` `auto-start` and `auto-end`
- var validPlacements = placements.slice(3);
-
- /**
- * Given an initial placement, returns all the subsequent placements
- * clockwise (or counter-clockwise).
- *
- * @method
- * @memberof Popper.Utils
- * @argument {String} placement - A valid placement (it accepts variations)
- * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
- * @returns {Array} placements including their variations
- */
- function clockwise(placement) {
- var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
-
- var index = validPlacements.indexOf(placement);
- var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
- return counter ? arr.reverse() : arr;
- }
-
- var BEHAVIORS = {
- FLIP: 'flip',
- CLOCKWISE: 'clockwise',
- COUNTERCLOCKWISE: 'counterclockwise'
- };
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function flip(data, options) {
- // if `inner` modifier is enabled, we can't use the `flip` modifier
- if (isModifierEnabled(data.instance.modifiers, 'inner')) {
- return data;
- }
-
- if (data.flipped && data.placement === data.originalPlacement) {
- // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
- return data;
- }
-
- var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
-
- var placement = data.placement.split('-')[0];
- var placementOpposite = getOppositePlacement(placement);
- var variation = data.placement.split('-')[1] || '';
-
- var flipOrder = [];
-
- switch (options.behavior) {
- case BEHAVIORS.FLIP:
- flipOrder = [placement, placementOpposite];
- break;
- case BEHAVIORS.CLOCKWISE:
- flipOrder = clockwise(placement);
- break;
- case BEHAVIORS.COUNTERCLOCKWISE:
- flipOrder = clockwise(placement, true);
- break;
- default:
- flipOrder = options.behavior;
- }
-
- flipOrder.forEach(function (step, index) {
- if (placement !== step || flipOrder.length === index + 1) {
- return data;
- }
-
- placement = data.placement.split('-')[0];
- placementOpposite = getOppositePlacement(placement);
-
- var popperOffsets = data.offsets.popper;
- var refOffsets = data.offsets.reference;
-
- // using floor because the reference offsets may contain decimals we are not going to consider here
- var floor = Math.floor;
- var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
-
- var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
- var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
- var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
- var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
-
- var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
-
- // flip the variation if required
- var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
-
- // flips variation if reference element overflows boundaries
- var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
-
- // flips variation if popper content overflows boundaries
- var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
-
- var flippedVariation = flippedVariationByRef || flippedVariationByContent;
-
- if (overlapsRef || overflowsBoundaries || flippedVariation) {
- // this boolean to detect any flip loop
- data.flipped = true;
-
- if (overlapsRef || overflowsBoundaries) {
- placement = flipOrder[index + 1];
- }
-
- if (flippedVariation) {
- variation = getOppositeVariation(variation);
- }
-
- data.placement = placement + (variation ? '-' + variation : '');
-
- // this object contains `position`, we want to preserve it along with
- // any additional property we may add in the future
- data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
-
- data = runModifiers(data.instance.modifiers, data, 'flip');
- }
- });
- return data;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function keepTogether(data) {
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
-
- var placement = data.placement.split('-')[0];
- var floor = Math.floor;
- var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
- var side = isVertical ? 'right' : 'bottom';
- var opSide = isVertical ? 'left' : 'top';
- var measurement = isVertical ? 'width' : 'height';
-
- if (popper[side] < floor(reference[opSide])) {
- data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
- }
- if (popper[opSide] > floor(reference[side])) {
- data.offsets.popper[opSide] = floor(reference[side]);
- }
-
- return data;
- }
-
- /**
- * Converts a string containing value + unit into a px value number
- * @function
- * @memberof {modifiers~offset}
- * @private
- * @argument {String} str - Value + unit string
- * @argument {String} measurement - `height` or `width`
- * @argument {Object} popperOffsets
- * @argument {Object} referenceOffsets
- * @returns {Number|String}
- * Value in pixels, or original string if no values were extracted
- */
- function toValue(str, measurement, popperOffsets, referenceOffsets) {
- // separate value from unit
- var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
- var value = +split[1];
- var unit = split[2];
-
- // If it's not a number it's an operator, I guess
- if (!value) {
- return str;
- }
-
- if (unit.indexOf('%') === 0) {
- var element = void 0;
- switch (unit) {
- case '%p':
- element = popperOffsets;
- break;
- case '%':
- case '%r':
- default:
- element = referenceOffsets;
- }
-
- var rect = getClientRect(element);
- return rect[measurement] / 100 * value;
- } else if (unit === 'vh' || unit === 'vw') {
- // if is a vh or vw, we calculate the size based on the viewport
- var size = void 0;
- if (unit === 'vh') {
- size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
- } else {
- size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
- }
- return size / 100 * value;
- } else {
- // if is an explicit pixel unit, we get rid of the unit and keep the value
- // if is an implicit unit, it's px, and we return just the value
- return value;
- }
- }
-
- /**
- * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
- * @function
- * @memberof {modifiers~offset}
- * @private
- * @argument {String} offset
- * @argument {Object} popperOffsets
- * @argument {Object} referenceOffsets
- * @argument {String} basePlacement
- * @returns {Array} a two cells array with x and y offsets in numbers
- */
- function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
- var offsets = [0, 0];
-
- // Use height if placement is left or right and index is 0 otherwise use width
- // in this way the first offset will use an axis and the second one
- // will use the other one
- var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
-
- // Split the offset string to obtain a list of values and operands
- // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
- var fragments = offset.split(/(\+|\-)/).map(function (frag) {
- return frag.trim();
- });
-
- // Detect if the offset string contains a pair of values or a single one
- // they could be separated by comma or space
- var divider = fragments.indexOf(find(fragments, function (frag) {
- return frag.search(/,|\s/) !== -1;
- }));
-
- if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
- console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
- }
-
- // If divider is found, we divide the list of values and operands to divide
- // them by ofset X and Y.
- var splitRegex = /\s*,\s*|\s+/;
- var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
-
- // Convert the values with units to absolute pixels to allow our computations
- ops = ops.map(function (op, index) {
- // Most of the units rely on the orientation of the popper
- var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
- var mergeWithPrevious = false;
- return op
- // This aggregates any `+` or `-` sign that aren't considered operators
- // e.g.: 10 + +5 => [10, +, +5]
- .reduce(function (a, b) {
- if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
- a[a.length - 1] = b;
- mergeWithPrevious = true;
- return a;
- } else if (mergeWithPrevious) {
- a[a.length - 1] += b;
- mergeWithPrevious = false;
- return a;
- } else {
- return a.concat(b);
- }
- }, [])
- // Here we convert the string values into number values (in px)
- .map(function (str) {
- return toValue(str, measurement, popperOffsets, referenceOffsets);
- });
- });
-
- // Loop trough the offsets arrays and execute the operations
- ops.forEach(function (op, index) {
- op.forEach(function (frag, index2) {
- if (isNumeric(frag)) {
- offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
- }
- });
- });
- return offsets;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @argument {Number|String} options.offset=0
- * The offset value as described in the modifier description
- * @returns {Object} The data object, properly modified
- */
- function offset(data, _ref) {
- var offset = _ref.offset;
- var placement = data.placement,
- _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
-
- var basePlacement = placement.split('-')[0];
-
- var offsets = void 0;
- if (isNumeric(+offset)) {
- offsets = [+offset, 0];
- } else {
- offsets = parseOffset(offset, popper, reference, basePlacement);
- }
-
- if (basePlacement === 'left') {
- popper.top += offsets[0];
- popper.left -= offsets[1];
- } else if (basePlacement === 'right') {
- popper.top += offsets[0];
- popper.left += offsets[1];
- } else if (basePlacement === 'top') {
- popper.left += offsets[0];
- popper.top -= offsets[1];
- } else if (basePlacement === 'bottom') {
- popper.left += offsets[0];
- popper.top += offsets[1];
- }
-
- data.popper = popper;
- return data;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function preventOverflow(data, options) {
- var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
-
- // If offsetParent is the reference element, we really want to
- // go one step up and use the next offsetParent as reference to
- // avoid to make this modifier completely useless and look like broken
- if (data.instance.reference === boundariesElement) {
- boundariesElement = getOffsetParent(boundariesElement);
- }
-
- // NOTE: DOM access here
- // resets the popper's position so that the document size can be calculated excluding
- // the size of the popper element itself
- var transformProp = getSupportedPropertyName('transform');
- var popperStyles = data.instance.popper.style; // assignment to help minification
- var top = popperStyles.top,
- left = popperStyles.left,
- transform = popperStyles[transformProp];
-
- popperStyles.top = '';
- popperStyles.left = '';
- popperStyles[transformProp] = '';
-
- var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
-
- // NOTE: DOM access here
- // restores the original style properties after the offsets have been computed
- popperStyles.top = top;
- popperStyles.left = left;
- popperStyles[transformProp] = transform;
-
- options.boundaries = boundaries;
-
- var order = options.priority;
- var popper = data.offsets.popper;
-
- var check = {
- primary: function primary(placement) {
- var value = popper[placement];
- if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
- value = Math.max(popper[placement], boundaries[placement]);
- }
- return defineProperty({}, placement, value);
- },
- secondary: function secondary(placement) {
- var mainSide = placement === 'right' ? 'left' : 'top';
- var value = popper[mainSide];
- if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
- value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
- }
- return defineProperty({}, mainSide, value);
- }
- };
-
- order.forEach(function (placement) {
- var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
- popper = _extends({}, popper, check[side](placement));
- });
-
- data.offsets.popper = popper;
-
- return data;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function shift(data) {
- var placement = data.placement;
- var basePlacement = placement.split('-')[0];
- var shiftvariation = placement.split('-')[1];
-
- // if shift shiftvariation is specified, run the modifier
- if (shiftvariation) {
- var _data$offsets = data.offsets,
- reference = _data$offsets.reference,
- popper = _data$offsets.popper;
-
- var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
- var side = isVertical ? 'left' : 'top';
- var measurement = isVertical ? 'width' : 'height';
-
- var shiftOffsets = {
- start: defineProperty({}, side, reference[side]),
- end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
- };
-
- data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
- }
-
- return data;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by update method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function hide(data) {
- if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
- return data;
- }
-
- var refRect = data.offsets.reference;
- var bound = find(data.instance.modifiers, function (modifier) {
- return modifier.name === 'preventOverflow';
- }).boundaries;
-
- if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
- // Avoid unnecessary DOM access if visibility hasn't changed
- if (data.hide === true) {
- return data;
- }
-
- data.hide = true;
- data.attributes['x-out-of-boundaries'] = '';
- } else {
- // Avoid unnecessary DOM access if visibility hasn't changed
- if (data.hide === false) {
- return data;
- }
-
- data.hide = false;
- data.attributes['x-out-of-boundaries'] = false;
- }
-
- return data;
- }
-
- /**
- * @function
- * @memberof Modifiers
- * @argument {Object} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {Object} The data object, properly modified
- */
- function inner(data) {
- var placement = data.placement;
- var basePlacement = placement.split('-')[0];
- var _data$offsets = data.offsets,
- popper = _data$offsets.popper,
- reference = _data$offsets.reference;
-
- var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
-
- var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
-
- popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
-
- data.placement = getOppositePlacement(placement);
- data.offsets.popper = getClientRect(popper);
-
- return data;
- }
-
- /**
- * Modifier function, each modifier can have a function of this type assigned
- * to its `fn` property.<br />
- * These functions will be called on each update, this means that you must
- * make sure they are performant enough to avoid performance bottlenecks.
- *
- * @function ModifierFn
- * @argument {dataObject} data - The data object generated by `update` method
- * @argument {Object} options - Modifiers configuration and options
- * @returns {dataObject} The data object, properly modified
- */
-
- /**
- * Modifiers are plugins used to alter the behavior of your poppers.<br />
- * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
- * needed by the library.
- *
- * Usually you don't want to override the `order`, `fn` and `onLoad` props.
- * All the other properties are configurations that could be tweaked.
- * @namespace modifiers
- */
- var modifiers = {
- /**
- * Modifier used to shift the popper on the start or end of its reference
- * element.<br />
- * It will read the variation of the `placement` property.<br />
- * It can be one either `-end` or `-start`.
- * @memberof modifiers
- * @inner
- */
- shift: {
- /** @prop {number} order=100 - Index used to define the order of execution */
- order: 100,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: shift
- },
-
- /**
- * The `offset` modifier can shift your popper on both its axis.
- *
- * It accepts the following units:
- * - `px` or unit-less, interpreted as pixels
- * - `%` or `%r`, percentage relative to the length of the reference element
- * - `%p`, percentage relative to the length of the popper element
- * - `vw`, CSS viewport width unit
- * - `vh`, CSS viewport height unit
- *
- * For length is intended the main axis relative to the placement of the popper.<br />
- * This means that if the placement is `top` or `bottom`, the length will be the
- * `width`. In case of `left` or `right`, it will be the `height`.
- *
- * You can provide a single value (as `Number` or `String`), or a pair of values
- * as `String` divided by a comma or one (or more) white spaces.<br />
- * The latter is a deprecated method because it leads to confusion and will be
- * removed in v2.<br />
- * Additionally, it accepts additions and subtractions between different units.
- * Note that multiplications and divisions aren't supported.
- *
- * Valid examples are:
- * ```
- * 10
- * '10%'
- * '10, 10'
- * '10%, 10'
- * '10 + 10%'
- * '10 - 5vh + 3%'
- * '-10px + 5vh, 5px - 6%'
- * ```
- * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
- * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
- * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
- *
- * @memberof modifiers
- * @inner
- */
- offset: {
- /** @prop {number} order=200 - Index used to define the order of execution */
- order: 200,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: offset,
- /** @prop {Number|String} offset=0
- * The offset value as described in the modifier description
- */
- offset: 0
- },
-
- /**
- * Modifier used to prevent the popper from being positioned outside the boundary.
- *
- * A scenario exists where the reference itself is not within the boundaries.<br />
- * We can say it has "escaped the boundaries" — or just "escaped".<br />
- * In this case we need to decide whether the popper should either:
- *
- * - detach from the reference and remain "trapped" in the boundaries, or
- * - if it should ignore the boundary and "escape with its reference"
- *
- * When `escapeWithReference` is set to`true` and reference is completely
- * outside its boundaries, the popper will overflow (or completely leave)
- * the boundaries in order to remain attached to the edge of the reference.
- *
- * @memberof modifiers
- * @inner
- */
- preventOverflow: {
- /** @prop {number} order=300 - Index used to define the order of execution */
- order: 300,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: preventOverflow,
- /**
- * @prop {Array} [priority=['left','right','top','bottom']]
- * Popper will try to prevent overflow following these priorities by default,
- * then, it could overflow on the left and on top of the `boundariesElement`
- */
- priority: ['left', 'right', 'top', 'bottom'],
- /**
- * @prop {number} padding=5
- * Amount of pixel used to define a minimum distance between the boundaries
- * and the popper. This makes sure the popper always has a little padding
- * between the edges of its container
- */
- padding: 5,
- /**
- * @prop {String|HTMLElement} boundariesElement='scrollParent'
- * Boundaries used by the modifier. Can be `scrollParent`, `window`,
- * `viewport` or any DOM element.
- */
- boundariesElement: 'scrollParent'
- },
-
- /**
- * Modifier used to make sure the reference and its popper stay near each other
- * without leaving any gap between the two. Especially useful when the arrow is
- * enabled and you want to ensure that it points to its reference element.
- * It cares only about the first axis. You can still have poppers with margin
- * between the popper and its reference element.
- * @memberof modifiers
- * @inner
- */
- keepTogether: {
- /** @prop {number} order=400 - Index used to define the order of execution */
- order: 400,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: keepTogether
- },
-
- /**
- * This modifier is used to move the `arrowElement` of the popper to make
- * sure it is positioned between the reference element and its popper element.
- * It will read the outer size of the `arrowElement` node to detect how many
- * pixels of conjunction are needed.
- *
- * It has no effect if no `arrowElement` is provided.
- * @memberof modifiers
- * @inner
- */
- arrow: {
- /** @prop {number} order=500 - Index used to define the order of execution */
- order: 500,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: arrow,
- /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
- element: '[x-arrow]'
- },
-
- /**
- * Modifier used to flip the popper's placement when it starts to overlap its
- * reference element.
- *
- * Requires the `preventOverflow` modifier before it in order to work.
- *
- * **NOTE:** this modifier will interrupt the current update cycle and will
- * restart it if it detects the need to flip the placement.
- * @memberof modifiers
- * @inner
- */
- flip: {
- /** @prop {number} order=600 - Index used to define the order of execution */
- order: 600,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: flip,
- /**
- * @prop {String|Array} behavior='flip'
- * The behavior used to change the popper's placement. It can be one of
- * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
- * placements (with optional variations)
- */
- behavior: 'flip',
- /**
- * @prop {number} padding=5
- * The popper will flip if it hits the edges of the `boundariesElement`
- */
- padding: 5,
- /**
- * @prop {String|HTMLElement} boundariesElement='viewport'
- * The element which will define the boundaries of the popper position.
- * The popper will never be placed outside of the defined boundaries
- * (except if `keepTogether` is enabled)
- */
- boundariesElement: 'viewport',
- /**
- * @prop {Boolean} flipVariations=false
- * The popper will switch placement variation between `-start` and `-end` when
- * the reference element overlaps its boundaries.
- *
- * The original placement should have a set variation.
- */
- flipVariations: false,
- /**
- * @prop {Boolean} flipVariationsByContent=false
- * The popper will switch placement variation between `-start` and `-end` when
- * the popper element overlaps its reference boundaries.
- *
- * The original placement should have a set variation.
- */
- flipVariationsByContent: false
- },
-
- /**
- * Modifier used to make the popper flow toward the inner of the reference element.
- * By default, when this modifier is disabled, the popper will be placed outside
- * the reference element.
- * @memberof modifiers
- * @inner
- */
- inner: {
- /** @prop {number} order=700 - Index used to define the order of execution */
- order: 700,
- /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
- enabled: false,
- /** @prop {ModifierFn} */
- fn: inner
- },
-
- /**
- * Modifier used to hide the popper when its reference element is outside of the
- * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
- * be used to hide with a CSS selector the popper when its reference is
- * out of boundaries.
- *
- * Requires the `preventOverflow` modifier before it in order to work.
- * @memberof modifiers
- * @inner
- */
- hide: {
- /** @prop {number} order=800 - Index used to define the order of execution */
- order: 800,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: hide
- },
-
- /**
- * Computes the style that will be applied to the popper element to gets
- * properly positioned.
- *
- * Note that this modifier will not touch the DOM, it just prepares the styles
- * so that `applyStyle` modifier can apply it. This separation is useful
- * in case you need to replace `applyStyle` with a custom implementation.
- *
- * This modifier has `850` as `order` value to maintain backward compatibility
- * with previous versions of Popper.js. Expect the modifiers ordering method
- * to change in future major versions of the library.
- *
- * @memberof modifiers
- * @inner
- */
- computeStyle: {
- /** @prop {number} order=850 - Index used to define the order of execution */
- order: 850,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: computeStyle,
- /**
- * @prop {Boolean} gpuAcceleration=true
- * If true, it uses the CSS 3D transformation to position the popper.
- * Otherwise, it will use the `top` and `left` properties
- */
- gpuAcceleration: true,
- /**
- * @prop {string} [x='bottom']
- * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
- * Change this if your popper should grow in a direction different from `bottom`
- */
- x: 'bottom',
- /**
- * @prop {string} [x='left']
- * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
- * Change this if your popper should grow in a direction different from `right`
- */
- y: 'right'
- },
-
- /**
- * Applies the computed styles to the popper element.
- *
- * All the DOM manipulations are limited to this modifier. This is useful in case
- * you want to integrate Popper.js inside a framework or view library and you
- * want to delegate all the DOM manipulations to it.
- *
- * Note that if you disable this modifier, you must make sure the popper element
- * has its position set to `absolute` before Popper.js can do its work!
- *
- * Just disable this modifier and define your own to achieve the desired effect.
- *
- * @memberof modifiers
- * @inner
- */
- applyStyle: {
- /** @prop {number} order=900 - Index used to define the order of execution */
- order: 900,
- /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
- enabled: true,
- /** @prop {ModifierFn} */
- fn: applyStyle,
- /** @prop {Function} */
- onLoad: applyStyleOnLoad,
- /**
- * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
- * @prop {Boolean} gpuAcceleration=true
- * If true, it uses the CSS 3D transformation to position the popper.
- * Otherwise, it will use the `top` and `left` properties
- */
- gpuAcceleration: undefined
- }
- };
-
- /**
- * The `dataObject` is an object containing all the information used by Popper.js.
- * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
- * @name dataObject
- * @property {Object} data.instance The Popper.js instance
- * @property {String} data.placement Placement applied to popper
- * @property {String} data.originalPlacement Placement originally defined on init
- * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
- * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
- * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
- * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
- * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
- * @property {Object} data.boundaries Offsets of the popper boundaries
- * @property {Object} data.offsets The measurements of popper, reference and arrow elements
- * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
- * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
- * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
- */
-
- /**
- * Default options provided to Popper.js constructor.<br />
- * These can be overridden using the `options` argument of Popper.js.<br />
- * To override an option, simply pass an object with the same
- * structure of the `options` object, as the 3rd argument. For example:
- * ```
- * new Popper(ref, pop, {
- * modifiers: {
- * preventOverflow: { enabled: false }
- * }
- * })
- * ```
- * @type {Object}
- * @static
- * @memberof Popper
- */
- var Defaults = {
- /**
- * Popper's placement.
- * @prop {Popper.placements} placement='bottom'
- */
- placement: 'bottom',
-
- /**
- * Set this to true if you want popper to position it self in 'fixed' mode
- * @prop {Boolean} positionFixed=false
- */
- positionFixed: false,
-
- /**
- * Whether events (resize, scroll) are initially enabled.
- * @prop {Boolean} eventsEnabled=true
- */
- eventsEnabled: true,
-
- /**
- * Set to true if you want to automatically remove the popper when
- * you call the `destroy` method.
- * @prop {Boolean} removeOnDestroy=false
- */
- removeOnDestroy: false,
-
- /**
- * Callback called when the popper is created.<br />
- * By default, it is set to no-op.<br />
- * Access Popper.js instance with `data.instance`.
- * @prop {onCreate}
- */
- onCreate: function onCreate() {},
-
- /**
- * Callback called when the popper is updated. This callback is not called
- * on the initialization/creation of the popper, but only on subsequent
- * updates.<br />
- * By default, it is set to no-op.<br />
- * Access Popper.js instance with `data.instance`.
- * @prop {onUpdate}
- */
- onUpdate: function onUpdate() {},
-
- /**
- * List of modifiers used to modify the offsets before they are applied to the popper.
- * They provide most of the functionalities of Popper.js.
- * @prop {modifiers}
- */
- modifiers: modifiers
- };
-
- /**
- * @callback onCreate
- * @param {dataObject} data
- */
-
- /**
- * @callback onUpdate
- * @param {dataObject} data
- */
-
- // Utils
- // Methods
- var Popper = function () {
- /**
- * Creates a new Popper.js instance.
- * @class Popper
- * @param {Element|referenceObject} reference - The reference element used to position the popper
- * @param {Element} popper - The HTML / XML element used as the popper
- * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
- * @return {Object} instance - The generated Popper.js instance
- */
- function Popper(reference, popper) {
- var _this = this;
-
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
- classCallCheck(this, Popper);
-
- this.scheduleUpdate = function () {
- return requestAnimationFrame(_this.update);
- };
-
- // make update() debounced, so that it only runs at most once-per-tick
- this.update = debounce(this.update.bind(this));
-
- // with {} we create a new object with the options inside it
- this.options = _extends({}, Popper.Defaults, options);
-
- // init state
- this.state = {
- isDestroyed: false,
- isCreated: false,
- scrollParents: []
- };
-
- // get reference and popper elements (allow jQuery wrappers)
- this.reference = reference && reference.jquery ? reference[0] : reference;
- this.popper = popper && popper.jquery ? popper[0] : popper;
-
- // Deep merge modifiers options
- this.options.modifiers = {};
- Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
- _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
- });
-
- // Refactoring modifiers' list (Object => Array)
- this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
- return _extends({
- name: name
- }, _this.options.modifiers[name]);
- })
- // sort the modifiers by order
- .sort(function (a, b) {
- return a.order - b.order;
- });
-
- // modifiers have the ability to execute arbitrary code when Popper.js get inited
- // such code is executed in the same order of its modifier
- // they could add new properties to their options configuration
- // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
- this.modifiers.forEach(function (modifierOptions) {
- if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
- modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
- }
- });
-
- // fire the first update to position the popper in the right place
- this.update();
-
- var eventsEnabled = this.options.eventsEnabled;
- if (eventsEnabled) {
- // setup event listeners, they will take care of update the position in specific situations
- this.enableEventListeners();
- }
-
- this.state.eventsEnabled = eventsEnabled;
- }
-
- // We can't use class properties because they don't get listed in the
- // class prototype and break stuff like Sinon stubs
-
-
- createClass(Popper, [{
- key: 'update',
- value: function update$$1() {
- return update.call(this);
- }
- }, {
- key: 'destroy',
- value: function destroy$$1() {
- return destroy.call(this);
- }
- }, {
- key: 'enableEventListeners',
- value: function enableEventListeners$$1() {
- return enableEventListeners.call(this);
- }
- }, {
- key: 'disableEventListeners',
- value: function disableEventListeners$$1() {
- return disableEventListeners.call(this);
- }
-
- /**
- * Schedules an update. It will run on the next UI update available.
- * @method scheduleUpdate
- * @memberof Popper
- */
-
-
- /**
- * Collection of utilities useful when writing custom modifiers.
- * Starting from version 1.7, this method is available only if you
- * include `popper-utils.js` before `popper.js`.
- *
- * **DEPRECATION**: This way to access PopperUtils is deprecated
- * and will be removed in v2! Use the PopperUtils module directly instead.
- * Due to the high instability of the methods contained in Utils, we can't
- * guarantee them to follow semver. Use them at your own risk!
- * @static
- * @private
- * @type {Object}
- * @deprecated since version 1.8
- * @member Utils
- * @memberof Popper
- */
-
- }]);
- return Popper;
- }();
-
- /**
- * The `referenceObject` is an object that provides an interface compatible with Popper.js
- * and lets you use it as replacement of a real DOM node.<br />
- * You can use this method to position a popper relatively to a set of coordinates
- * in case you don't have a DOM node to use as reference.
- *
- * ```
- * new Popper(referenceObject, popperNode);
- * ```
- *
- * NB: This feature isn't supported in Internet Explorer 10.
- * @name referenceObject
- * @property {Function} data.getBoundingClientRect
- * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
- * @property {number} data.clientWidth
- * An ES6 getter that will return the width of the virtual reference element.
- * @property {number} data.clientHeight
- * An ES6 getter that will return the height of the virtual reference element.
- */
-
-
- Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
- Popper.placements = placements;
- Popper.Defaults = Defaults;
-
- /* harmony default export */ __webpack_exports__["default"] = (Popper);
- //# sourceMappingURL=popper.js.map
-
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
-
- /***/ }),
-
- /***/ "./node_modules/process/browser.js":
- /*!*****************************************!*\
- !*** ./node_modules/process/browser.js ***!
- \*****************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- // shim for using process in browser
- var process = module.exports = {};
-
- // cached from whatever global is present so that test runners that stub it
- // don't break things. But we need to wrap it in a try catch in case it is
- // wrapped in strict mode code which doesn't define any globals. It's inside a
- // function because try/catches deoptimize in certain engines.
-
- var cachedSetTimeout;
- var cachedClearTimeout;
-
- function defaultSetTimout() {
- throw new Error('setTimeout has not been defined');
- }
- function defaultClearTimeout () {
- throw new Error('clearTimeout has not been defined');
- }
- (function () {
- try {
- if (typeof setTimeout === 'function') {
- cachedSetTimeout = setTimeout;
- } else {
- cachedSetTimeout = defaultSetTimout;
- }
- } catch (e) {
- cachedSetTimeout = defaultSetTimout;
- }
- try {
- if (typeof clearTimeout === 'function') {
- cachedClearTimeout = clearTimeout;
- } else {
- cachedClearTimeout = defaultClearTimeout;
- }
- } catch (e) {
- cachedClearTimeout = defaultClearTimeout;
- }
- } ())
- function runTimeout(fun) {
- if (cachedSetTimeout === setTimeout) {
- //normal enviroments in sane situations
- return setTimeout(fun, 0);
- }
- // if setTimeout wasn't available but was latter defined
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
- cachedSetTimeout = setTimeout;
- return setTimeout(fun, 0);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedSetTimeout(fun, 0);
- } catch(e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedSetTimeout.call(null, fun, 0);
- } catch(e){
- // 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
- return cachedSetTimeout.call(this, fun, 0);
- }
- }
-
-
- }
- function runClearTimeout(marker) {
- if (cachedClearTimeout === clearTimeout) {
- //normal enviroments in sane situations
- return clearTimeout(marker);
- }
- // if clearTimeout wasn't available but was latter defined
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
- cachedClearTimeout = clearTimeout;
- return clearTimeout(marker);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedClearTimeout(marker);
- } catch (e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedClearTimeout.call(null, marker);
- } catch (e){
- // 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.
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
- return cachedClearTimeout.call(this, marker);
- }
- }
-
-
-
- }
- var queue = [];
- var draining = false;
- var currentQueue;
- var queueIndex = -1;
-
- function cleanUpNextTick() {
- if (!draining || !currentQueue) {
- return;
- }
- draining = false;
- if (currentQueue.length) {
- queue = currentQueue.concat(queue);
- } else {
- queueIndex = -1;
- }
- if (queue.length) {
- drainQueue();
- }
- }
-
- function drainQueue() {
- if (draining) {
- return;
- }
- var timeout = runTimeout(cleanUpNextTick);
- draining = true;
-
- var len = queue.length;
- while(len) {
- currentQueue = queue;
- queue = [];
- while (++queueIndex < len) {
- if (currentQueue) {
- currentQueue[queueIndex].run();
- }
- }
- queueIndex = -1;
- len = queue.length;
- }
- currentQueue = null;
- draining = false;
- runClearTimeout(timeout);
- }
-
- process.nextTick = function (fun) {
- var args = new Array(arguments.length - 1);
- if (arguments.length > 1) {
- for (var i = 1; i < arguments.length; i++) {
- args[i - 1] = arguments[i];
- }
- }
- queue.push(new Item(fun, args));
- if (queue.length === 1 && !draining) {
- runTimeout(drainQueue);
- }
- };
-
- // v8 likes predictible objects
- function Item(fun, array) {
- this.fun = fun;
- this.array = array;
- }
- Item.prototype.run = function () {
- this.fun.apply(null, this.array);
- };
- process.title = 'browser';
- process.browser = true;
- process.env = {};
- process.argv = [];
- process.version = ''; // empty string to avoid regexp issues
- process.versions = {};
-
- function noop() {}
-
- process.on = noop;
- process.addListener = noop;
- process.once = noop;
- process.off = noop;
- process.removeListener = noop;
- process.removeAllListeners = noop;
- process.emit = noop;
- process.prependListener = noop;
- process.prependOnceListener = noop;
-
- process.listeners = function (name) { return [] }
-
- process.binding = function (name) {
- throw new Error('process.binding is not supported');
- };
-
- process.cwd = function () { return '/' };
- process.chdir = function (dir) {
- throw new Error('process.chdir is not supported');
- };
- process.umask = function() { return 0; };
-
-
- /***/ }),
-
- /***/ "./node_modules/prop-types-extra/lib/all.js":
- /*!**************************************************!*\
- !*** ./node_modules/prop-types-extra/lib/all.js ***!
- \**************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = all;
-
- var _createChainableTypeChecker = __webpack_require__(/*! ./utils/createChainableTypeChecker */ "./node_modules/prop-types-extra/lib/utils/createChainableTypeChecker.js");
-
- var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function all() {
- for (var _len = arguments.length, validators = Array(_len), _key = 0; _key < _len; _key++) {
- validators[_key] = arguments[_key];
- }
-
- function allPropTypes() {
- for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
-
- var error = null;
-
- validators.forEach(function (validator) {
- if (error != null) {
- return;
- }
-
- var result = validator.apply(undefined, args);
- if (result != null) {
- error = result;
- }
- });
-
- return error;
- }
-
- return (0, _createChainableTypeChecker2.default)(allPropTypes);
- }
- module.exports = exports['default'];
-
- /***/ }),
-
- /***/ "./node_modules/prop-types-extra/lib/componentOrElement.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/prop-types-extra/lib/componentOrElement.js ***!
- \*****************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- 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; };
-
- var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js");
-
- var _react2 = _interopRequireDefault(_react);
-
- var _createChainableTypeChecker = __webpack_require__(/*! ./utils/createChainableTypeChecker */ "./node_modules/prop-types-extra/lib/utils/createChainableTypeChecker.js");
-
- var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- var propType = typeof propValue === 'undefined' ? 'undefined' : _typeof(propValue);
-
- if (_react2.default.isValidElement(propValue)) {
- return new Error('Invalid ' + location + ' `' + propFullName + '` of type ReactElement ' + ('supplied to `' + componentName + '`, expected a ReactComponent or a ') + 'DOMElement. You can usually obtain a ReactComponent or DOMElement ' + 'from a ReactElement by attaching a ref to it.');
- }
-
- if ((propType !== 'object' || typeof propValue.render !== 'function') && propValue.nodeType !== 1) {
- return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected a ReactComponent or a ') + 'DOMElement.');
- }
-
- return null;
- }
-
- exports.default = (0, _createChainableTypeChecker2.default)(validate);
- module.exports = exports['default'];
-
- /***/ }),
-
- /***/ "./node_modules/prop-types-extra/lib/elementType.js":
- /*!**********************************************************!*\
- !*** ./node_modules/prop-types-extra/lib/elementType.js ***!
- \**********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
-
- var _react = __webpack_require__(/*! react */ "./node_modules/react/index.js");
-
- var _react2 = _interopRequireDefault(_react);
-
- var _reactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
-
- var _createChainableTypeChecker = __webpack_require__(/*! ./utils/createChainableTypeChecker */ "./node_modules/prop-types-extra/lib/utils/createChainableTypeChecker.js");
-
- var _createChainableTypeChecker2 = _interopRequireDefault(_createChainableTypeChecker);
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function elementType(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
-
- if (_react2.default.isValidElement(propValue)) {
- return new Error('Invalid ' + location + ' `' + propFullName + '` of type ReactElement ' + ('supplied to `' + componentName + '`,expected an element type (a string ') + ', component class, or function component).');
- }
-
- if (!(0, _reactIs.isValidElementType)(propValue)) {
- return new Error('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected an element type (a string ') + ', component class, or function component).');
- }
-
- return null;
- }
-
- exports.default = (0, _createChainableTypeChecker2.default)(elementType);
- module.exports = exports['default'];
-
- /***/ }),
-
- /***/ "./node_modules/prop-types-extra/lib/isRequiredForA11y.js":
- /*!****************************************************************!*\
- !*** ./node_modules/prop-types-extra/lib/isRequiredForA11y.js ***!
- \****************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = isRequiredForA11y;
- function isRequiredForA11y(validator) {
- return function validate(props, propName, componentName, location, propFullName) {
- var componentNameSafe = componentName || '<<anonymous>>';
- var propFullNameSafe = propFullName || propName;
-
- if (props[propName] == null) {
- return new Error('The ' + location + ' `' + propFullNameSafe + '` is required to make ' + ('`' + componentNameSafe + '` accessible for users of assistive ') + 'technologies such as screen readers.');
- }
-
- for (var _len = arguments.length, args = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) {
- args[_key - 5] = arguments[_key];
- }
-
- return validator.apply(undefined, [props, propName, componentName, location, propFullName].concat(args));
- };
- }
- module.exports = exports['default'];
-
- /***/ }),
-
- /***/ "./node_modules/prop-types-extra/lib/utils/createChainableTypeChecker.js":
- /*!*******************************************************************************!*\
- !*** ./node_modules/prop-types-extra/lib/utils/createChainableTypeChecker.js ***!
- \*******************************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = createChainableTypeChecker;
- /**
- * Copyright 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- */
-
- // Mostly taken from ReactPropTypes.
-
- function createChainableTypeChecker(validate) {
- function checkType(isRequired, props, propName, componentName, location, propFullName) {
- var componentNameSafe = componentName || '<<anonymous>>';
- var propFullNameSafe = propFullName || propName;
-
- if (props[propName] == null) {
- if (isRequired) {
- return new Error('Required ' + location + ' `' + propFullNameSafe + '` was not specified ' + ('in `' + componentNameSafe + '`.'));
- }
-
- return null;
- }
-
- for (var _len = arguments.length, args = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) {
- args[_key - 6] = arguments[_key];
- }
-
- return validate.apply(undefined, [props, propName, componentNameSafe, location, propFullNameSafe].concat(args));
- }
-
- var chainedCheckType = checkType.bind(null, false);
- chainedCheckType.isRequired = checkType.bind(null, true);
-
- return chainedCheckType;
- }
- module.exports = exports['default'];
-
- /***/ }),
-
- /***/ "./node_modules/prop-types/checkPropTypes.js":
- /*!***************************************************!*\
- !*** ./node_modules/prop-types/checkPropTypes.js ***!
- \***************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
- /**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-
-
- var printWarning = function() {};
-
- if (true) {
- var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
- var loggedTypeFailures = {};
- var has = Function.call.bind(Object.prototype.hasOwnProperty);
-
- printWarning = function(text) {
- var message = 'Warning: ' + text;
- if (typeof console !== 'undefined') {
- console.error(message);
- }
- try {
- // --- Welcome to debugging React ---
- // This error was thrown as a convenience so that you can use this stack
- // to find the callsite that caused this warning to fire.
- throw new Error(message);
- } catch (x) {}
- };
- }
-
- /**
- * Assert that the values match with the type specs.
- * Error messages are memorized and will only be shown once.
- *
- * @param {object} typeSpecs Map of name to a ReactPropType
- * @param {object} values Runtime values that need to be type-checked
- * @param {string} location e.g. "prop", "context", "child context"
- * @param {string} componentName Name of the component for error messages.
- * @param {?Function} getStack Returns the component stack.
- * @private
- */
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
- if (true) {
- for (var typeSpecName in typeSpecs) {
- if (has(typeSpecs, typeSpecName)) {
- var error;
- // Prop type validation may throw. In case they do, we don't want to
- // fail the render phase where it didn't fail before. So we log it.
- // After these have been cleaned up, we'll let them throw.
- try {
- // This is intentionally an invariant that gets caught. It's the same
- // behavior as without this statement except with a better message.
- if (typeof typeSpecs[typeSpecName] !== 'function') {
- var err = Error(
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
- );
- err.name = 'Invariant Violation';
- throw err;
- }
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
- } catch (ex) {
- error = ex;
- }
- if (error && !(error instanceof Error)) {
- printWarning(
- (componentName || 'React class') + ': type specification of ' +
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
- 'You may have forgotten to pass an argument to the type checker ' +
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
- 'shape all require an argument).'
- );
- }
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
- // Only monitor this failure once because there tends to be a lot of the
- // same error.
- loggedTypeFailures[error.message] = true;
-
- var stack = getStack ? getStack() : '';
-
- printWarning(
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
- );
- }
- }
- }
- }
- }
-
- /**
- * Resets warning cache when testing.
- *
- * @private
- */
- checkPropTypes.resetWarningCache = function() {
- if (true) {
- loggedTypeFailures = {};
- }
- }
-
- module.exports = checkPropTypes;
-
-
- /***/ }),
-
- /***/ "./node_modules/prop-types/factoryWithTypeCheckers.js":
- /*!************************************************************!*\
- !*** ./node_modules/prop-types/factoryWithTypeCheckers.js ***!
- \************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
- /**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-
-
- var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
- var assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
-
- var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "./node_modules/prop-types/lib/ReactPropTypesSecret.js");
- var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js");
-
- var has = Function.call.bind(Object.prototype.hasOwnProperty);
- var printWarning = function() {};
-
- if (true) {
- printWarning = function(text) {
- var message = 'Warning: ' + text;
- if (typeof console !== 'undefined') {
- console.error(message);
- }
- try {
- // --- Welcome to debugging React ---
- // This error was thrown as a convenience so that you can use this stack
- // to find the callsite that caused this warning to fire.
- throw new Error(message);
- } catch (x) {}
- };
- }
-
- function emptyFunctionThatReturnsNull() {
- return null;
- }
-
- module.exports = function(isValidElement, throwOnDirectAccess) {
- /* global Symbol */
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
-
- /**
- * Returns the iterator method function contained on the iterable object.
- *
- * Be sure to invoke the function with the iterable as context:
- *
- * var iteratorFn = getIteratorFn(myIterable);
- * if (iteratorFn) {
- * var iterator = iteratorFn.call(myIterable);
- * ...
- * }
- *
- * @param {?object} maybeIterable
- * @return {?function}
- */
- function getIteratorFn(maybeIterable) {
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
- if (typeof iteratorFn === 'function') {
- return iteratorFn;
- }
- }
-
- /**
- * Collection of methods that allow declaration and validation of props that are
- * supplied to React components. Example usage:
- *
- * var Props = require('ReactPropTypes');
- * var MyArticle = React.createClass({
- * propTypes: {
- * // An optional string prop named "description".
- * description: Props.string,
- *
- * // A required enum prop named "category".
- * category: Props.oneOf(['News','Photos']).isRequired,
- *
- * // A prop named "dialog" that requires an instance of Dialog.
- * dialog: Props.instanceOf(Dialog).isRequired
- * },
- * render: function() { ... }
- * });
- *
- * A more formal specification of how these methods are used:
- *
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
- * decl := ReactPropTypes.{type}(.isRequired)?
- *
- * Each and every declaration produces a function with the same signature. This
- * allows the creation of custom validation functions. For example:
- *
- * var MyLink = React.createClass({
- * propTypes: {
- * // An optional string or URI prop named "href".
- * href: function(props, propName, componentName) {
- * var propValue = props[propName];
- * if (propValue != null && typeof propValue !== 'string' &&
- * !(propValue instanceof URI)) {
- * return new Error(
- * 'Expected a string or an URI for ' + propName + ' in ' +
- * componentName
- * );
- * }
- * }
- * },
- * render: function() {...}
- * });
- *
- * @internal
- */
-
- var ANONYMOUS = '<<anonymous>>';
-
- // Important!
- // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
- var ReactPropTypes = {
- array: createPrimitiveTypeChecker('array'),
- bool: createPrimitiveTypeChecker('boolean'),
- func: createPrimitiveTypeChecker('function'),
- number: createPrimitiveTypeChecker('number'),
- object: createPrimitiveTypeChecker('object'),
- string: createPrimitiveTypeChecker('string'),
- symbol: createPrimitiveTypeChecker('symbol'),
-
- any: createAnyTypeChecker(),
- arrayOf: createArrayOfTypeChecker,
- element: createElementTypeChecker(),
- elementType: createElementTypeTypeChecker(),
- instanceOf: createInstanceTypeChecker,
- node: createNodeChecker(),
- objectOf: createObjectOfTypeChecker,
- oneOf: createEnumTypeChecker,
- oneOfType: createUnionTypeChecker,
- shape: createShapeTypeChecker,
- exact: createStrictShapeTypeChecker,
- };
-
- /**
- * inlined Object.is polyfill to avoid requiring consumers ship their own
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
- */
- /*eslint-disable no-self-compare*/
- function is(x, y) {
- // SameValue algorithm
- if (x === y) {
- // Steps 1-5, 7-10
- // Steps 6.b-6.e: +0 != -0
- return x !== 0 || 1 / x === 1 / y;
- } else {
- // Step 6.a: NaN == NaN
- return x !== x && y !== y;
- }
- }
- /*eslint-enable no-self-compare*/
-
- /**
- * We use an Error-like object for backward compatibility as people may call
- * PropTypes directly and inspect their output. However, we don't use real
- * Errors anymore. We don't inspect their stack anyway, and creating them
- * is prohibitively expensive if they are created too often, such as what
- * happens in oneOfType() for any type before the one that matched.
- */
- function PropTypeError(message) {
- this.message = message;
- this.stack = '';
- }
- // Make `instanceof Error` still work for returned errors.
- PropTypeError.prototype = Error.prototype;
-
- function createChainableTypeChecker(validate) {
- if (true) {
- var manualPropTypeCallCache = {};
- var manualPropTypeWarningCount = 0;
- }
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
- componentName = componentName || ANONYMOUS;
- propFullName = propFullName || propName;
-
- if (secret !== ReactPropTypesSecret) {
- if (throwOnDirectAccess) {
- // New behavior only for users of `prop-types` package
- var err = new Error(
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
- 'Use `PropTypes.checkPropTypes()` to call them. ' +
- 'Read more at http://fb.me/use-check-prop-types'
- );
- err.name = 'Invariant Violation';
- throw err;
- } else if ( true && typeof console !== 'undefined') {
- // Old behavior for people using React.PropTypes
- var cacheKey = componentName + ':' + propName;
- if (
- !manualPropTypeCallCache[cacheKey] &&
- // Avoid spamming the console because they are often not actionable except for lib authors
- manualPropTypeWarningCount < 3
- ) {
- printWarning(
- 'You are manually calling a React.PropTypes validation ' +
- 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
- 'and will throw in the standalone `prop-types` package. ' +
- 'You may be seeing this warning due to a third-party PropTypes ' +
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
- );
- manualPropTypeCallCache[cacheKey] = true;
- manualPropTypeWarningCount++;
- }
- }
- }
- if (props[propName] == null) {
- if (isRequired) {
- if (props[propName] === null) {
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
- }
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
- }
- return null;
- } else {
- return validate(props, propName, componentName, location, propFullName);
- }
- }
-
- var chainedCheckType = checkType.bind(null, false);
- chainedCheckType.isRequired = checkType.bind(null, true);
-
- return chainedCheckType;
- }
-
- function createPrimitiveTypeChecker(expectedType) {
- function validate(props, propName, componentName, location, propFullName, secret) {
- var propValue = props[propName];
- var propType = getPropType(propValue);
- if (propType !== expectedType) {
- // `propValue` being instance of, say, date/regexp, pass the 'object'
- // check, but we can offer a more precise error message here rather than
- // 'of type `object`'.
- var preciseType = getPreciseType(propValue);
-
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
-
- function createAnyTypeChecker() {
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
- }
-
- function createArrayOfTypeChecker(typeChecker) {
- function validate(props, propName, componentName, location, propFullName) {
- if (typeof typeChecker !== 'function') {
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
- }
- var propValue = props[propName];
- if (!Array.isArray(propValue)) {
- var propType = getPropType(propValue);
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
- }
- for (var i = 0; i < propValue.length; i++) {
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
- if (error instanceof Error) {
- return error;
- }
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
-
- function createElementTypeChecker() {
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- if (!isValidElement(propValue)) {
- var propType = getPropType(propValue);
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
-
- function createElementTypeTypeChecker() {
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- if (!ReactIs.isValidElementType(propValue)) {
- var propType = getPropType(propValue);
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
-
- function createInstanceTypeChecker(expectedClass) {
- function validate(props, propName, componentName, location, propFullName) {
- if (!(props[propName] instanceof expectedClass)) {
- var expectedClassName = expectedClass.name || ANONYMOUS;
- var actualClassName = getClassName(props[propName]);
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
-
- function createEnumTypeChecker(expectedValues) {
- if (!Array.isArray(expectedValues)) {
- if (true) {
- if (arguments.length > 1) {
- printWarning(
- 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
- 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
- );
- } else {
- printWarning('Invalid argument supplied to oneOf, expected an array.');
- }
- }
- return emptyFunctionThatReturnsNull;
- }
-
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- for (var i = 0; i < expectedValues.length; i++) {
- if (is(propValue, expectedValues[i])) {
- return null;
- }
- }
-
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
- var type = getPreciseType(value);
- if (type === 'symbol') {
- return String(value);
- }
- return value;
- });
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
- }
- return createChainableTypeChecker(validate);
- }
-
- function createObjectOfTypeChecker(typeChecker) {
- function validate(props, propName, componentName, location, propFullName) {
- if (typeof typeChecker !== 'function') {
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
- }
- var propValue = props[propName];
- var propType = getPropType(propValue);
- if (propType !== 'object') {
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
- }
- for (var key in propValue) {
- if (has(propValue, key)) {
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
- if (error instanceof Error) {
- return error;
- }
- }
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
-
- function createUnionTypeChecker(arrayOfTypeCheckers) {
- if (!Array.isArray(arrayOfTypeCheckers)) {
- true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : undefined;
- return emptyFunctionThatReturnsNull;
- }
-
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
- var checker = arrayOfTypeCheckers[i];
- if (typeof checker !== 'function') {
- printWarning(
- 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
- 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
- );
- return emptyFunctionThatReturnsNull;
- }
- }
-
- function validate(props, propName, componentName, location, propFullName) {
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
- var checker = arrayOfTypeCheckers[i];
- if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
- return null;
- }
- }
-
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
- }
- return createChainableTypeChecker(validate);
- }
-
- function createNodeChecker() {
- function validate(props, propName, componentName, location, propFullName) {
- if (!isNode(props[propName])) {
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
-
- function createShapeTypeChecker(shapeTypes) {
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- var propType = getPropType(propValue);
- if (propType !== 'object') {
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
- }
- for (var key in shapeTypes) {
- var checker = shapeTypes[key];
- if (!checker) {
- continue;
- }
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
- if (error) {
- return error;
- }
- }
- return null;
- }
- return createChainableTypeChecker(validate);
- }
-
- function createStrictShapeTypeChecker(shapeTypes) {
- function validate(props, propName, componentName, location, propFullName) {
- var propValue = props[propName];
- var propType = getPropType(propValue);
- if (propType !== 'object') {
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
- }
- // We need to check all keys in case some are required but missing from
- // props.
- var allKeys = assign({}, props[propName], shapeTypes);
- for (var key in allKeys) {
- var checker = shapeTypes[key];
- if (!checker) {
- return new PropTypeError(
- 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
- '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
- '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
- );
- }
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
- if (error) {
- return error;
- }
- }
- return null;
- }
-
- return createChainableTypeChecker(validate);
- }
-
- function isNode(propValue) {
- switch (typeof propValue) {
- case 'number':
- case 'string':
- case 'undefined':
- return true;
- case 'boolean':
- return !propValue;
- case 'object':
- if (Array.isArray(propValue)) {
- return propValue.every(isNode);
- }
- if (propValue === null || isValidElement(propValue)) {
- return true;
- }
-
- var iteratorFn = getIteratorFn(propValue);
- if (iteratorFn) {
- var iterator = iteratorFn.call(propValue);
- var step;
- if (iteratorFn !== propValue.entries) {
- while (!(step = iterator.next()).done) {
- if (!isNode(step.value)) {
- return false;
- }
- }
- } else {
- // Iterator will provide entry [k,v] tuples rather than values.
- while (!(step = iterator.next()).done) {
- var entry = step.value;
- if (entry) {
- if (!isNode(entry[1])) {
- return false;
- }
- }
- }
- }
- } else {
- return false;
- }
-
- return true;
- default:
- return false;
- }
- }
-
- function isSymbol(propType, propValue) {
- // Native Symbol.
- if (propType === 'symbol') {
- return true;
- }
-
- // falsy value can't be a Symbol
- if (!propValue) {
- return false;
- }
-
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
- if (propValue['@@toStringTag'] === 'Symbol') {
- return true;
- }
-
- // Fallback for non-spec compliant Symbols which are polyfilled.
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
- return true;
- }
-
- return false;
- }
-
- // Equivalent of `typeof` but with special handling for array and regexp.
- function getPropType(propValue) {
- var propType = typeof propValue;
- if (Array.isArray(propValue)) {
- return 'array';
- }
- if (propValue instanceof RegExp) {
- // Old webkits (at least until Android 4.0) return 'function' rather than
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
- // passes PropTypes.object.
- return 'object';
- }
- if (isSymbol(propType, propValue)) {
- return 'symbol';
- }
- return propType;
- }
-
- // This handles more types than `getPropType`. Only used for error messages.
- // See `createPrimitiveTypeChecker`.
- function getPreciseType(propValue) {
- if (typeof propValue === 'undefined' || propValue === null) {
- return '' + propValue;
- }
- var propType = getPropType(propValue);
- if (propType === 'object') {
- if (propValue instanceof Date) {
- return 'date';
- } else if (propValue instanceof RegExp) {
- return 'regexp';
- }
- }
- return propType;
- }
-
- // Returns a string that is postfixed to a warning about an invalid type.
- // For example, "undefined" or "of type array"
- function getPostfixForTypeWarning(value) {
- var type = getPreciseType(value);
- switch (type) {
- case 'array':
- case 'object':
- return 'an ' + type;
- case 'boolean':
- case 'date':
- case 'regexp':
- return 'a ' + type;
- default:
- return type;
- }
- }
-
- // Returns class name of the object, if any.
- function getClassName(propValue) {
- if (!propValue.constructor || !propValue.constructor.name) {
- return ANONYMOUS;
- }
- return propValue.constructor.name;
- }
-
- ReactPropTypes.checkPropTypes = checkPropTypes;
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
- ReactPropTypes.PropTypes = ReactPropTypes;
-
- return ReactPropTypes;
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/prop-types/index.js":
- /*!******************************************!*\
- !*** ./node_modules/prop-types/index.js ***!
- \******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- /**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
- if (true) {
- var ReactIs = __webpack_require__(/*! react-is */ "./node_modules/react-is/index.js");
-
- // By explicitly using `prop-types` you are opting into new development behavior.
- // http://fb.me/prop-types-in-prod
- var throwOnDirectAccess = true;
- module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "./node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess);
- } else {}
-
-
- /***/ }),
-
- /***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js":
- /*!*************************************************************!*\
- !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
- \*************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
- /**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-
-
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
-
- module.exports = ReactPropTypesSecret;
-
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/AbstractNav.js":
- /*!*********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/AbstractNav.js ***!
- \*********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! dom-helpers/query/querySelectorAll */ "./node_modules/dom-helpers/query/querySelectorAll.js");
- /* harmony import */ var dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _restart_hooks_useForceUpdate__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @restart/hooks/useForceUpdate */ "./node_modules/@restart/hooks/esm/useForceUpdate.js");
- /* harmony import */ var _restart_hooks_useMergedRefs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @restart/hooks/useMergedRefs */ "./node_modules/@restart/hooks/esm/useMergedRefs.js");
- /* harmony import */ var _NavContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./NavContext */ "./node_modules/react-bootstrap/esm/NavContext.js");
- /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
- /* harmony import */ var _TabContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./TabContext */ "./node_modules/react-bootstrap/esm/TabContext.js");
-
-
-
-
-
-
-
-
-
-
- var noop = function noop() {};
-
- var AbstractNav = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'ul' : _ref$as,
- onSelect = _ref.onSelect,
- activeKey = _ref.activeKey,
- role = _ref.role,
- onKeyDown = _ref.onKeyDown,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["as", "onSelect", "activeKey", "role", "onKeyDown"]);
-
- // A ref and forceUpdate for refocus, b/c we only want to trigger when needed
- // and don't want to reset the set in the effect
- var forceUpdate = Object(_restart_hooks_useForceUpdate__WEBPACK_IMPORTED_MODULE_4__["default"])();
- var needsRefocusRef = Object(react__WEBPACK_IMPORTED_MODULE_3__["useRef"])(false);
- var parentOnSelect = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_SelectableContext__WEBPACK_IMPORTED_MODULE_7__["default"]);
- var tabContext = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_TabContext__WEBPACK_IMPORTED_MODULE_8__["default"]);
- var getControlledId, getControllerId;
-
- if (tabContext) {
- role = role || 'tablist';
- activeKey = tabContext.activeKey;
- getControlledId = tabContext.getControlledId;
- getControllerId = tabContext.getControllerId;
- }
-
- var listNode = Object(react__WEBPACK_IMPORTED_MODULE_3__["useRef"])(null);
-
- var getNextActiveChild = function getNextActiveChild(offset) {
- if (!listNode.current) return null;
- var items = dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_2___default()(listNode.current, '[data-rb-event-key]:not(.disabled)');
- var activeChild = listNode.current.querySelector('.active');
- var index = items.indexOf(activeChild);
- if (index === -1) return null;
- var nextIndex = index + offset;
- if (nextIndex >= items.length) nextIndex = 0;
- if (nextIndex < 0) nextIndex = items.length - 1;
- return items[nextIndex];
- };
-
- var handleSelect = function handleSelect(key, event) {
- if (key == null) return;
- if (onSelect) onSelect(key, event);
- if (parentOnSelect) parentOnSelect(key, event);
- };
-
- var handleKeyDown = function handleKeyDown(event) {
- if (onKeyDown) onKeyDown(event);
- var nextActiveChild;
-
- switch (event.key) {
- case 'ArrowLeft':
- case 'ArrowUp':
- nextActiveChild = getNextActiveChild(-1);
- break;
-
- case 'ArrowRight':
- case 'ArrowDown':
- nextActiveChild = getNextActiveChild(1);
- break;
-
- default:
- return;
- }
-
- if (!nextActiveChild) return;
- event.preventDefault();
- handleSelect(nextActiveChild.dataset.rbEventKey, event);
- needsRefocusRef.current = true;
- forceUpdate();
- };
-
- Object(react__WEBPACK_IMPORTED_MODULE_3__["useEffect"])(function () {
- if (listNode.current && needsRefocusRef.current) {
- var activeChild = listNode.current.querySelector('[data-rb-event-key].active');
- if (activeChild) activeChild.focus();
- }
-
- needsRefocusRef.current = false;
- });
- var mergedRef = Object(_restart_hooks_useMergedRefs__WEBPACK_IMPORTED_MODULE_5__["default"])(ref, listNode);
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_SelectableContext__WEBPACK_IMPORTED_MODULE_7__["default"].Provider, {
- value: handleSelect
- }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_NavContext__WEBPACK_IMPORTED_MODULE_6__["default"].Provider, {
- value: {
- role: role,
- // used by NavLink to determine it's role
- activeKey: Object(_SelectableContext__WEBPACK_IMPORTED_MODULE_7__["makeEventKey"])(activeKey),
- getControlledId: getControlledId || noop,
- getControllerId: getControllerId || noop
- }
- }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- onKeyDown: handleKeyDown,
- ref: mergedRef,
- role: role
- }))));
- });
- /* harmony default export */ __webpack_exports__["default"] = (AbstractNav);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/AbstractNavItem.js":
- /*!*************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/AbstractNavItem.js ***!
- \*************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
- /* harmony import */ var _NavContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./NavContext */ "./node_modules/react-bootstrap/esm/NavContext.js");
- /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
-
-
-
-
-
-
-
- var defaultProps = {
- disabled: false
- };
- var AbstractNavItem = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var active = _ref.active,
- className = _ref.className,
- tabIndex = _ref.tabIndex,
- eventKey = _ref.eventKey,
- onSelect = _ref.onSelect,
- onClick = _ref.onClick,
- Component = _ref.as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["active", "className", "tabIndex", "eventKey", "onSelect", "onClick", "as"]);
-
- var navKey = Object(_SelectableContext__WEBPACK_IMPORTED_MODULE_6__["makeEventKey"])(eventKey, props.href);
- var parentOnSelect = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_SelectableContext__WEBPACK_IMPORTED_MODULE_6__["default"]);
- var navContext = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_NavContext__WEBPACK_IMPORTED_MODULE_5__["default"]);
- var isActive = active;
-
- if (navContext) {
- if (!props.role && navContext.role === 'tablist') props.role = 'tab';
- props['data-rb-event-key'] = navKey;
- props.id = navContext.getControllerId(navKey);
- props['aria-controls'] = navContext.getControlledId(navKey);
- isActive = active == null && navKey != null ? navContext.activeKey === navKey : active;
- }
-
- if (props.role === 'tab') {
- props.tabIndex = isActive ? tabIndex : -1;
- props['aria-selected'] = isActive;
- }
-
- var handleOnclick = Object(_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__["default"])(function (e) {
- if (onClick) onClick(e);
- if (navKey == null) return;
- if (onSelect) onSelect(navKey, e);
- if (parentOnSelect) parentOnSelect(navKey, e);
- });
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- ref: ref,
- onClick: handleOnclick,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, isActive && 'active')
- }));
- });
- AbstractNavItem.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (AbstractNavItem);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Accordion.js":
- /*!*******************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Accordion.js ***!
- \*******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _AccordionToggle__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./AccordionToggle */ "./node_modules/react-bootstrap/esm/AccordionToggle.js");
- /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
- /* harmony import */ var _AccordionCollapse__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./AccordionCollapse */ "./node_modules/react-bootstrap/esm/AccordionCollapse.js");
- /* harmony import */ var _AccordionContext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./AccordionContext */ "./node_modules/react-bootstrap/esm/AccordionContext.js");
-
-
-
-
-
-
-
-
-
-
- var Accordion = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (props, ref) {
- var _useUncontrolled = Object(uncontrollable__WEBPACK_IMPORTED_MODULE_4__["useUncontrolled"])(props, {
- activeKey: 'onSelect'
- }),
- _useUncontrolled$as = _useUncontrolled.as,
- Component = _useUncontrolled$as === void 0 ? 'div' : _useUncontrolled$as,
- activeKey = _useUncontrolled.activeKey,
- bsPrefix = _useUncontrolled.bsPrefix,
- children = _useUncontrolled.children,
- className = _useUncontrolled.className,
- onSelect = _useUncontrolled.onSelect,
- controlledProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_useUncontrolled, ["as", "activeKey", "bsPrefix", "children", "className", "onSelect"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'accordion');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_AccordionContext__WEBPACK_IMPORTED_MODULE_9__["default"].Provider, {
- value: activeKey
- }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_SelectableContext__WEBPACK_IMPORTED_MODULE_7__["default"].Provider, {
- value: onSelect
- }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, controlledProps, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix)
- }), children)));
- });
- Accordion.Toggle = _AccordionToggle__WEBPACK_IMPORTED_MODULE_6__["default"];
- Accordion.Collapse = _AccordionCollapse__WEBPACK_IMPORTED_MODULE_8__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (Accordion);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/AccordionCollapse.js":
- /*!***************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/AccordionCollapse.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _Collapse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Collapse */ "./node_modules/react-bootstrap/esm/Collapse.js");
- /* harmony import */ var _AccordionContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AccordionContext */ "./node_modules/react-bootstrap/esm/AccordionContext.js");
-
-
-
-
-
- var AccordionCollapse = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (_ref, ref) {
- var children = _ref.children,
- eventKey = _ref.eventKey,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["children", "eventKey"]);
-
- var contextEventKey = Object(react__WEBPACK_IMPORTED_MODULE_2__["useContext"])(_AccordionContext__WEBPACK_IMPORTED_MODULE_4__["default"]);
- return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Collapse__WEBPACK_IMPORTED_MODULE_3__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref,
- in: contextEventKey === eventKey
- }, props), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_2___default.a.Children.only(children)));
- });
- AccordionCollapse.displayName = 'AccordionCollapse';
- /* harmony default export */ __webpack_exports__["default"] = (AccordionCollapse);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/AccordionContext.js":
- /*!**************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/AccordionContext.js ***!
- \**************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-
- /* harmony default export */ __webpack_exports__["default"] = (react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext(null));
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/AccordionToggle.js":
- /*!*************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/AccordionToggle.js ***!
- \*************************************************************/
- /*! exports provided: useAccordionToggle, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useAccordionToggle", function() { return useAccordionToggle; });
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
- /* harmony import */ var _AccordionContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AccordionContext */ "./node_modules/react-bootstrap/esm/AccordionContext.js");
-
-
-
-
-
- function useAccordionToggle(eventKey, onClick) {
- var contextEventKey = Object(react__WEBPACK_IMPORTED_MODULE_2__["useContext"])(_AccordionContext__WEBPACK_IMPORTED_MODULE_4__["default"]);
- var onSelect = Object(react__WEBPACK_IMPORTED_MODULE_2__["useContext"])(_SelectableContext__WEBPACK_IMPORTED_MODULE_3__["default"]);
- return function (e) {
- /*
- Compare the event key in context with the given event key.
- If they are the same, then collapse the component.
- */
- var eventKeyPassed = eventKey === contextEventKey ? null : eventKey;
- onSelect(eventKeyPassed, e);
- if (onClick) onClick(e);
- };
- }
- var AccordionToggle = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (_ref, ref) {
- var _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'button' : _ref$as,
- children = _ref.children,
- eventKey = _ref.eventKey,
- onClick = _ref.onClick,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["as", "children", "eventKey", "onClick"]);
-
- var accordionOnClick = useAccordionToggle(eventKey, onClick);
- return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref,
- onClick: accordionOnClick
- }, props), children);
- });
- /* harmony default export */ __webpack_exports__["default"] = (AccordionToggle);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Alert.js":
- /*!***************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Alert.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
- /* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
- /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
- /* harmony import */ var _utils_divWithClassName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/divWithClassName */ "./node_modules/react-bootstrap/esm/utils/divWithClassName.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _Fade__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Fade */ "./node_modules/react-bootstrap/esm/Fade.js");
- /* harmony import */ var _CloseButton__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./CloseButton */ "./node_modules/react-bootstrap/esm/CloseButton.js");
- /* harmony import */ var _SafeAnchor__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./SafeAnchor */ "./node_modules/react-bootstrap/esm/SafeAnchor.js");
-
-
-
-
-
-
-
-
-
-
-
-
- var defaultProps = {
- show: true,
- transition: _Fade__WEBPACK_IMPORTED_MODULE_9__["default"],
- closeLabel: 'Close alert'
- };
- var controllables = {
- show: 'onClose'
- };
- var Alert = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (uncontrolledProps, ref) {
- var _useUncontrolled = Object(uncontrollable__WEBPACK_IMPORTED_MODULE_4__["useUncontrolled"])(uncontrolledProps, controllables),
- bsPrefix = _useUncontrolled.bsPrefix,
- show = _useUncontrolled.show,
- closeLabel = _useUncontrolled.closeLabel,
- className = _useUncontrolled.className,
- children = _useUncontrolled.children,
- variant = _useUncontrolled.variant,
- onClose = _useUncontrolled.onClose,
- dismissible = _useUncontrolled.dismissible,
- Transition = _useUncontrolled.transition,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_useUncontrolled, ["bsPrefix", "show", "closeLabel", "className", "children", "variant", "onClose", "dismissible", "transition"]);
-
- var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_8__["useBootstrapPrefix"])(bsPrefix, 'alert');
- var handleClose = Object(_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_5__["default"])(function (e) {
- onClose(false, e);
- });
- var alert = react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- role: "alert"
- }, Transition ? props : undefined, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, prefix, variant && prefix + "-" + variant, dismissible && prefix + "-dismissible")
- }), dismissible && react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_CloseButton__WEBPACK_IMPORTED_MODULE_10__["default"], {
- onClick: handleClose,
- label: closeLabel
- }), children);
- if (!Transition) return show ? alert : null;
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Transition, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- unmountOnExit: true,
- ref: ref
- }, props, {
- in: show
- }), alert);
- });
- var DivStyledAsH4 = Object(_utils_divWithClassName__WEBPACK_IMPORTED_MODULE_7__["default"])('h4');
- DivStyledAsH4.displayName = 'DivStyledAsH4';
- Alert.displayName = 'Alert';
- Alert.defaultProps = defaultProps;
- Alert.Link = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_6__["default"])('alert-link', {
- Component: _SafeAnchor__WEBPACK_IMPORTED_MODULE_11__["default"]
- });
- Alert.Heading = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_6__["default"])('alert-heading', {
- Component: DivStyledAsH4
- });
- /* harmony default export */ __webpack_exports__["default"] = (Alert);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Badge.js":
- /*!***************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Badge.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
- var defaultProps = {
- pill: false
- };
- var Badge = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- variant = _ref.variant,
- pill = _ref.pill,
- className = _ref.className,
- _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'span' : _ref$as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "variant", "pill", "className", "as"]);
-
- var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'badge');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, props, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, prefix, pill && prefix + "-pill", variant && prefix + "-" + variant)
- }));
- });
- Badge.displayName = 'Badge';
- Badge.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (Badge);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Breadcrumb.js":
- /*!********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Breadcrumb.js ***!
- \********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _BreadcrumbItem__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./BreadcrumbItem */ "./node_modules/react-bootstrap/esm/BreadcrumbItem.js");
-
-
-
-
-
-
- var defaultProps = {
- label: 'breadcrumb',
- listProps: {}
- };
- var Breadcrumb = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- className = _ref.className,
- listProps = _ref.listProps,
- children = _ref.children,
- label = _ref.label,
- _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'nav' : _ref$as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "listProps", "children", "label", "as"]);
-
- var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'breadcrumb');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- "aria-label": label,
- className: className,
- ref: ref
- }, props), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("ol", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, listProps, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(prefix, listProps.className)
- }), children));
- });
- Breadcrumb.displayName = 'Breadcrumb';
- Breadcrumb.defaultProps = defaultProps;
- Breadcrumb.Item = _BreadcrumbItem__WEBPACK_IMPORTED_MODULE_5__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (Breadcrumb);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/BreadcrumbItem.js":
- /*!************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/BreadcrumbItem.js ***!
- \************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _SafeAnchor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SafeAnchor */ "./node_modules/react-bootstrap/esm/SafeAnchor.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
- var defaultProps = {
- active: false
- };
- var BreadcrumbItem = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
- function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- active = _ref.active,
- className = _ref.className,
- _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'li' : _ref$as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "active", "className", "as"]);
-
- var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'breadcrumb-item');
-
- var href = props.href,
- title = props.title,
- target = props.target,
- elementProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(props, ["href", "title", "target"]);
-
- var linkProps = {
- href: href,
- title: title,
- target: target
- };
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, {
- ref: ref,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(prefix, className, {
- active: active
- }),
- "aria-current": active ? 'page' : undefined
- }, active ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, elementProps, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()({
- active: active
- })
- })) : react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_SafeAnchor__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, elementProps, linkProps)));
- });
- BreadcrumbItem.displayName = 'BreadcrumbItem';
- BreadcrumbItem.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (BreadcrumbItem);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Button.js":
- /*!****************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Button.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _SafeAnchor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SafeAnchor */ "./node_modules/react-bootstrap/esm/SafeAnchor.js");
-
-
-
-
-
-
- var defaultProps = {
- variant: 'primary',
- active: false,
- disabled: false,
- type: 'button'
- };
- var Button = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- variant = _ref.variant,
- size = _ref.size,
- active = _ref.active,
- className = _ref.className,
- block = _ref.block,
- type = _ref.type,
- as = _ref.as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "variant", "size", "active", "className", "block", "type", "as"]);
-
- var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'btn');
- var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, prefix, active && 'active', prefix + "-" + variant, block && prefix + "-block", size && prefix + "-" + size);
-
- if (props.href) {
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_SafeAnchor__WEBPACK_IMPORTED_MODULE_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- as: as,
- ref: ref,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(classes, props.disabled && 'disabled')
- }));
- }
-
- if (ref) {
- props.ref = ref;
- }
-
- if (!as) {
- props.type = type;
- }
-
- var Component = as || 'button';
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- className: classes
- }));
- });
- Button.displayName = 'Button';
- Button.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (Button);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/ButtonGroup.js":
- /*!*********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/ButtonGroup.js ***!
- \*********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
- var defaultProps = {
- vertical: false,
- toggle: false,
- role: 'group'
- };
- var ButtonGroup = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (props, ref) {
- var bsPrefix = props.bsPrefix,
- size = props.size,
- toggle = props.toggle,
- vertical = props.vertical,
- className = props.className,
- _props$as = props.as,
- Component = _props$as === void 0 ? 'div' : _props$as,
- rest = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(props, ["bsPrefix", "size", "toggle", "vertical", "className", "as"]);
-
- var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'btn-group');
- var baseClass = prefix;
- if (vertical) baseClass = prefix + "-vertical";
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, rest, {
- ref: ref,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, baseClass, size && prefix + "-" + size, toggle && prefix + "-toggle")
- }));
- });
- ButtonGroup.displayName = 'ButtonGroup';
- ButtonGroup.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (ButtonGroup);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/ButtonToolbar.js":
- /*!***********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/ButtonToolbar.js ***!
- \***********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
- var defaultProps = {
- role: 'toolbar'
- };
- var ButtonToolbar = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- className = _ref.className,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className"]);
-
- var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'btn-toolbar');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- ref: ref,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, prefix)
- }));
- });
- ButtonToolbar.displayName = 'ButtonToolbar';
- ButtonToolbar.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (ButtonToolbar);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Card.js":
- /*!**************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Card.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
- /* harmony import */ var _utils_divWithClassName__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/divWithClassName */ "./node_modules/react-bootstrap/esm/utils/divWithClassName.js");
- /* harmony import */ var _CardContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./CardContext */ "./node_modules/react-bootstrap/esm/CardContext.js");
- /* harmony import */ var _CardImg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./CardImg */ "./node_modules/react-bootstrap/esm/CardImg.js");
-
-
-
-
-
-
-
-
-
- var DivStyledAsH5 = Object(_utils_divWithClassName__WEBPACK_IMPORTED_MODULE_6__["default"])('h5');
- var DivStyledAsH6 = Object(_utils_divWithClassName__WEBPACK_IMPORTED_MODULE_6__["default"])('h6');
- var CardBody = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__["default"])('card-body');
- var defaultProps = {
- body: false
- };
- var Card = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- className = _ref.className,
- bg = _ref.bg,
- text = _ref.text,
- border = _ref.border,
- body = _ref.body,
- children = _ref.children,
- _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'div' : _ref$as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "bg", "text", "border", "body", "children", "as"]);
-
- var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'card');
- var cardContext = Object(react__WEBPACK_IMPORTED_MODULE_3__["useMemo"])(function () {
- return {
- cardHeaderBsPrefix: prefix + "-header"
- };
- }, [prefix]);
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_CardContext__WEBPACK_IMPORTED_MODULE_7__["default"].Provider, {
- value: cardContext
- }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, props, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, prefix, bg && "bg-" + bg, text && "text-" + text, border && "border-" + border)
- }), body ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(CardBody, null, children) : children));
- });
- Card.displayName = 'Card';
- Card.defaultProps = defaultProps;
- Card.Img = _CardImg__WEBPACK_IMPORTED_MODULE_8__["default"];
- Card.Title = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__["default"])('card-title', {
- Component: DivStyledAsH5
- });
- Card.Subtitle = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__["default"])('card-subtitle', {
- Component: DivStyledAsH6
- });
- Card.Body = CardBody;
- Card.Link = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__["default"])('card-link', {
- Component: 'a'
- });
- Card.Text = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__["default"])('card-text', {
- Component: 'p'
- });
- Card.Header = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__["default"])('card-header');
- Card.Footer = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__["default"])('card-footer');
- Card.ImgOverlay = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__["default"])('card-img-overlay');
- /* harmony default export */ __webpack_exports__["default"] = (Card);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/CardColumns.js":
- /*!*********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/CardColumns.js ***!
- \*********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
-
- /* harmony default export */ __webpack_exports__["default"] = (Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('card-columns'));
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/CardContext.js":
- /*!*********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/CardContext.js ***!
- \*********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-
- /* harmony default export */ __webpack_exports__["default"] = (react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext(null));
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/CardDeck.js":
- /*!******************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/CardDeck.js ***!
- \******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
-
- /* harmony default export */ __webpack_exports__["default"] = (Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('card-deck'));
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/CardGroup.js":
- /*!*******************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/CardGroup.js ***!
- \*******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
-
- /* harmony default export */ __webpack_exports__["default"] = (Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('card-group'));
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/CardImg.js":
- /*!*****************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/CardImg.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
- var defaultProps = {
- variant: null
- };
- var CardImg = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
- function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- className = _ref.className,
- variant = _ref.variant,
- _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'img' : _ref$as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "variant", "as"]);
-
- var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'card-img');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(variant ? prefix + "-" + variant : prefix, className)
- }, props));
- });
- CardImg.displayName = 'CardImg';
- CardImg.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (CardImg);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Carousel.js":
- /*!******************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Carousel.js ***!
- \******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var dom_helpers_style__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! dom-helpers/style */ "./node_modules/dom-helpers/style/index.js");
- /* harmony import */ var dom_helpers_style__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_style__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var dom_helpers_transition__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! dom-helpers/transition */ "./node_modules/dom-helpers/transition/index.js");
- /* harmony import */ var dom_helpers_transition__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_transition__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_6__);
- /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
- /* harmony import */ var _CarouselCaption__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./CarouselCaption */ "./node_modules/react-bootstrap/esm/CarouselCaption.js");
- /* harmony import */ var _CarouselItem__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./CarouselItem */ "./node_modules/react-bootstrap/esm/CarouselItem.js");
- /* harmony import */ var _SafeAnchor__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./SafeAnchor */ "./node_modules/react-bootstrap/esm/SafeAnchor.js");
- /* harmony import */ var _utils_ElementChildren__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils/ElementChildren */ "./node_modules/react-bootstrap/esm/utils/ElementChildren.js");
- /* harmony import */ var _utils_triggerBrowserReflow__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils/triggerBrowserReflow */ "./node_modules/react-bootstrap/esm/utils/triggerBrowserReflow.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var countChildren = function countChildren(c) {
- return react__WEBPACK_IMPORTED_MODULE_6___default.a.Children.toArray(c).filter(react__WEBPACK_IMPORTED_MODULE_6___default.a.isValidElement).length;
- };
-
- var SWIPE_THRESHOLD = 40; // TODO: `slide` should be `animate`.
-
- var defaultProps = {
- slide: true,
- fade: false,
- interval: 5000,
- keyboard: true,
- pauseOnHover: true,
- wrap: true,
- indicators: true,
- controls: true,
- activeIndex: 0,
- prevIcon: react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement("span", {
- "aria-hidden": "true",
- className: "carousel-control-prev-icon"
- }),
- prevLabel: 'Previous',
- nextIcon: react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement("span", {
- "aria-hidden": "true",
- className: "carousel-control-next-icon"
- }),
- nextLabel: 'Next',
- touch: true
- };
-
- var Carousel =
- /*#__PURE__*/
- function (_React$Component) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(Carousel, _React$Component);
-
- function Carousel() {
- var _this;
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
- _this.state = {
- prevClasses: '',
- currentClasses: 'active',
- touchStartX: 0
- };
- _this.isUnmounted = false;
- _this.carousel = react__WEBPACK_IMPORTED_MODULE_6___default.a.createRef();
-
- _this.handleTouchStart = function (e) {
- _this.setState({
- touchStartX: e.changedTouches[0].screenX
- });
- };
-
- _this.handleTouchEnd = function (e) {
- // If the swipe is under the threshold, don't do anything.
- if (Math.abs(e.changedTouches[0].screenX - _this.state.touchStartX) < SWIPE_THRESHOLD) return;
-
- if (e.changedTouches[0].screenX < _this.state.touchStartX) {
- // Swiping left to navigate to next item.
- _this.handleNext(e);
- } else {
- // Swiping right to navigate to previous item.
- _this.handlePrev(e);
- }
- };
-
- _this.handleSlideEnd = function () {
- var pendingIndex = _this._pendingIndex;
- _this._isSliding = false;
- _this._pendingIndex = null;
- if (pendingIndex != null) _this.to(pendingIndex);else _this.cycle();
- };
-
- _this.handleMouseOut = function () {
- _this.cycle();
- };
-
- _this.handleMouseOver = function () {
- if (_this.props.pauseOnHover) _this.pause();
- };
-
- _this.handleKeyDown = function (event) {
- if (/input|textarea/i.test(event.target.tagName)) return;
-
- switch (event.key) {
- case 'ArrowLeft':
- event.preventDefault();
-
- _this.handlePrev(event);
-
- break;
-
- case 'ArrowRight':
- event.preventDefault();
-
- _this.handleNext(event);
-
- break;
-
- default:
- break;
- }
- };
-
- _this.handleNextWhenVisible = function () {
- if (!_this.isUnmounted && !document.hidden && dom_helpers_style__WEBPACK_IMPORTED_MODULE_4___default()(_this.carousel.current, 'visibility') !== 'hidden') {
- _this.handleNext();
- }
- };
-
- _this.handleNext = function (e) {
- if (_this._isSliding) return;
- var _this$props = _this.props,
- wrap = _this$props.wrap,
- activeIndex = _this$props.activeIndex;
- var index = activeIndex + 1;
- var count = countChildren(_this.props.children);
-
- if (index > count - 1) {
- if (!wrap) return;
- index = 0;
- }
-
- _this.select(index, e, 'next');
- };
-
- _this.handlePrev = function (e) {
- if (_this._isSliding) return;
- var _this$props2 = _this.props,
- wrap = _this$props2.wrap,
- activeIndex = _this$props2.activeIndex;
- var index = activeIndex - 1;
-
- if (index < 0) {
- if (!wrap) return;
- index = countChildren(_this.props.children) - 1;
- }
-
- _this.select(index, e, 'prev');
- };
-
- return _this;
- }
-
- var _proto = Carousel.prototype;
-
- _proto.componentDidMount = function componentDidMount() {
- this.cycle();
- };
-
- Carousel.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
- var previousActiveIndex = _ref.activeIndex;
-
- if (nextProps.activeIndex !== previousActiveIndex) {
- var lastPossibleIndex = countChildren(nextProps.children) - 1;
- var nextIndex = Math.max(0, Math.min(nextProps.activeIndex, lastPossibleIndex));
- var direction;
-
- if (nextIndex === 0 && previousActiveIndex >= lastPossibleIndex || previousActiveIndex <= nextIndex) {
- direction = 'next';
- } else {
- direction = 'prev';
- }
-
- return {
- direction: direction,
- previousActiveIndex: previousActiveIndex,
- activeIndex: nextIndex
- };
- }
-
- return null;
- };
-
- _proto.componentDidUpdate = function componentDidUpdate(_, prevState) {
- var _this2 = this;
-
- var _this$props3 = this.props,
- bsPrefix = _this$props3.bsPrefix,
- slide = _this$props3.slide,
- onSlideEnd = _this$props3.onSlideEnd;
- if (!slide || this.state.activeIndex === prevState.activeIndex || this._isSliding) return;
- var _this$state = this.state,
- activeIndex = _this$state.activeIndex,
- direction = _this$state.direction;
- var orderClassName, directionalClassName;
-
- if (direction === 'next') {
- orderClassName = bsPrefix + "-item-next";
- directionalClassName = bsPrefix + "-item-left";
- } else if (direction === 'prev') {
- orderClassName = bsPrefix + "-item-prev";
- directionalClassName = bsPrefix + "-item-right";
- }
-
- this._isSliding = true;
- this.pause(); // eslint-disable-next-line react/no-did-update-set-state
-
- this.safeSetState({
- prevClasses: 'active',
- currentClasses: orderClassName
- }, function () {
- var items = _this2.carousel.current.children;
- var nextElement = items[activeIndex];
- Object(_utils_triggerBrowserReflow__WEBPACK_IMPORTED_MODULE_12__["default"])(nextElement);
-
- _this2.safeSetState({
- prevClasses: classnames__WEBPACK_IMPORTED_MODULE_3___default()('active', directionalClassName),
- currentClasses: classnames__WEBPACK_IMPORTED_MODULE_3___default()(orderClassName, directionalClassName)
- }, function () {
- return dom_helpers_transition__WEBPACK_IMPORTED_MODULE_5___default.a.end(nextElement, function () {
- _this2.safeSetState({
- prevClasses: '',
- currentClasses: 'active'
- }, _this2.handleSlideEnd);
-
- if (onSlideEnd) {
- onSlideEnd();
- }
- });
- });
- });
- };
-
- _proto.componentWillUnmount = function componentWillUnmount() {
- clearTimeout(this.timeout);
- this.isUnmounted = true;
- };
-
- _proto.safeSetState = function safeSetState(state, cb) {
- var _this3 = this;
-
- if (this.isUnmounted) return;
- this.setState(state, function () {
- return !_this3.isUnmounted && cb();
- });
- } // This might be a public API.
- ;
-
- _proto.pause = function pause() {
- this._isPaused = true;
- clearInterval(this._interval);
- this._interval = null;
- };
-
- _proto.cycle = function cycle() {
- this._isPaused = false;
- clearInterval(this._interval);
- this._interval = null;
-
- if (this.props.interval && !this._isPaused) {
- this._interval = setInterval(document.visibilityState ? this.handleNextWhenVisible : this.handleNext, this.props.interval);
- }
- };
-
- _proto.to = function to(index, event) {
- var children = this.props.children;
-
- if (index < 0 || index > countChildren(children) - 1) {
- return;
- }
-
- if (this._isSliding) {
- this._pendingIndex = index;
- return;
- }
-
- this.select(index, event);
- };
-
- _proto.select = function select(index, event, direction) {
- var _this4 = this;
-
- clearTimeout(this.selectThrottle);
- if (event && event.persist) event.persist(); // The timeout throttles fast clicks, in order to give any pending state
- // a chance to update and propagate back through props
-
- this.selectThrottle = setTimeout(function () {
- clearTimeout(_this4.timeout);
- var _this4$props = _this4.props,
- activeIndex = _this4$props.activeIndex,
- onSelect = _this4$props.onSelect;
- if (index === activeIndex || _this4._isSliding || _this4.isUnmounted) return;
- onSelect(index, direction || (index < activeIndex ? 'prev' : 'next'), event);
- }, 50);
- };
-
- _proto.renderControls = function renderControls(properties) {
- var bsPrefix = this.props.bsPrefix;
- var wrap = properties.wrap,
- children = properties.children,
- activeIndex = properties.activeIndex,
- prevIcon = properties.prevIcon,
- nextIcon = properties.nextIcon,
- prevLabel = properties.prevLabel,
- nextLabel = properties.nextLabel;
- var count = countChildren(children);
- return [(wrap || activeIndex !== 0) && react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_SafeAnchor__WEBPACK_IMPORTED_MODULE_10__["default"], {
- key: "prev",
- className: bsPrefix + "-control-prev",
- onClick: this.handlePrev
- }, prevIcon, prevLabel && react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement("span", {
- className: "sr-only"
- }, prevLabel)), (wrap || activeIndex !== count - 1) && react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_SafeAnchor__WEBPACK_IMPORTED_MODULE_10__["default"], {
- key: "next",
- className: bsPrefix + "-control-next",
- onClick: this.handleNext
- }, nextIcon, nextLabel && react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement("span", {
- className: "sr-only"
- }, nextLabel))];
- };
-
- _proto.renderIndicators = function renderIndicators(children, activeIndex) {
- var _this5 = this;
-
- var bsPrefix = this.props.bsPrefix;
- var indicators = [];
- Object(_utils_ElementChildren__WEBPACK_IMPORTED_MODULE_11__["forEach"])(children, function (child, index) {
- indicators.push(react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement("li", {
- key: index,
- className: index === activeIndex ? 'active' : null,
- onClick: function onClick(e) {
- return _this5.to(index, e);
- }
- }), // Force whitespace between indicator elements. Bootstrap requires
- // this for correct spacing of elements.
- ' ');
- });
- return react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement("ol", {
- className: bsPrefix + "-indicators"
- }, indicators);
- };
-
- _proto.render = function render() {
- var _this$props4 = this.props,
- _this$props4$as = _this$props4.as,
- Component = _this$props4$as === void 0 ? 'div' : _this$props4$as,
- bsPrefix = _this$props4.bsPrefix,
- slide = _this$props4.slide,
- fade = _this$props4.fade,
- indicators = _this$props4.indicators,
- controls = _this$props4.controls,
- wrap = _this$props4.wrap,
- touch = _this$props4.touch,
- prevIcon = _this$props4.prevIcon,
- prevLabel = _this$props4.prevLabel,
- nextIcon = _this$props4.nextIcon,
- nextLabel = _this$props4.nextLabel,
- className = _this$props4.className,
- children = _this$props4.children,
- keyboard = _this$props4.keyboard,
- _5 = _this$props4.activeIndex,
- _4 = _this$props4.pauseOnHover,
- _3 = _this$props4.interval,
- _2 = _this$props4.onSelect,
- _1 = _this$props4.onSlideEnd,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props4, ["as", "bsPrefix", "slide", "fade", "indicators", "controls", "wrap", "touch", "prevIcon", "prevLabel", "nextIcon", "nextLabel", "className", "children", "keyboard", "activeIndex", "pauseOnHover", "interval", "onSelect", "onSlideEnd"]);
-
- var _this$state2 = this.state,
- activeIndex = _this$state2.activeIndex,
- previousActiveIndex = _this$state2.previousActiveIndex,
- prevClasses = _this$state2.prevClasses,
- currentClasses = _this$state2.currentClasses;
- return (// eslint-disable-next-line jsx-a11y/no-static-element-interactions
- react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- onTouchStart: touch ? this.handleTouchStart : undefined,
- onTouchEnd: touch ? this.handleTouchEnd : undefined
- }, props, {
- className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, bsPrefix, slide && 'slide', fade && bsPrefix + "-fade"),
- onKeyDown: keyboard ? this.handleKeyDown : undefined,
- onMouseOver: this.handleMouseOver,
- onMouseOut: this.handleMouseOut
- }), indicators && this.renderIndicators(children, activeIndex), react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement("div", {
- className: bsPrefix + "-inner",
- ref: this.carousel
- }, Object(_utils_ElementChildren__WEBPACK_IMPORTED_MODULE_11__["map"])(children, function (child, index) {
- var current = index === activeIndex;
- var previous = index === previousActiveIndex;
- return Object(react__WEBPACK_IMPORTED_MODULE_6__["cloneElement"])(child, {
- className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(child.props.className, bsPrefix + "-item", current && currentClasses, previous && prevClasses)
- });
- })), controls && this.renderControls({
- wrap: wrap,
- children: children,
- activeIndex: activeIndex,
- prevIcon: prevIcon,
- prevLabel: prevLabel,
- nextIcon: nextIcon,
- nextLabel: nextLabel
- }))
- );
- };
-
- return Carousel;
- }(react__WEBPACK_IMPORTED_MODULE_6___default.a.Component);
-
- Carousel.defaultProps = defaultProps;
- var DecoratedCarousel = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_13__["createBootstrapComponent"])(Object(uncontrollable__WEBPACK_IMPORTED_MODULE_7__["uncontrollable"])(Carousel, {
- activeIndex: 'onSelect'
- }), 'carousel');
- DecoratedCarousel.Caption = _CarouselCaption__WEBPACK_IMPORTED_MODULE_8__["default"];
- DecoratedCarousel.Item = _CarouselItem__WEBPACK_IMPORTED_MODULE_9__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (DecoratedCarousel);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/CarouselCaption.js":
- /*!*************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/CarouselCaption.js ***!
- \*************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
-
- /* harmony default export */ __webpack_exports__["default"] = (Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('carousel-caption', {
- Component: 'div'
- }));
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/CarouselItem.js":
- /*!**********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/CarouselItem.js ***!
- \**********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
-
- /* harmony default export */ __webpack_exports__["default"] = (Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('carousel-item'));
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/CloseButton.js":
- /*!*********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/CloseButton.js ***!
- \*********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__);
-
-
-
-
-
- var propTypes = {
- label: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string.isRequired,
- onClick: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func
- };
- var defaultProps = {
- label: 'Close'
- };
- var CloseButton = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var label = _ref.label,
- onClick = _ref.onClick,
- className = _ref.className,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["label", "onClick", "className"]);
-
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("button", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref,
- type: "button",
- className: classnames__WEBPACK_IMPORTED_MODULE_4___default()('close', className),
- onClick: onClick
- }, props), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
- "aria-hidden": "true"
- }, "\xD7"), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
- className: "sr-only"
- }, label));
- });
- CloseButton.displayName = 'CloseButton';
- CloseButton.propTypes = propTypes;
- CloseButton.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (CloseButton);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Col.js":
- /*!*************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Col.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
- var DEVICE_SIZES = ['xl', 'lg', 'md', 'sm', 'xs'];
- var Col = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
- function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- className = _ref.className,
- _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'div' : _ref$as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "as"]);
-
- var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'col');
- var spans = [];
- var classes = [];
- DEVICE_SIZES.forEach(function (brkPoint) {
- var propValue = props[brkPoint];
- delete props[brkPoint];
- var span, offset, order;
-
- if (propValue != null && typeof propValue === 'object') {
- var _propValue$span = propValue.span;
- span = _propValue$span === void 0 ? true : _propValue$span;
- offset = propValue.offset;
- order = propValue.order;
- } else {
- span = propValue;
- }
-
- var infix = brkPoint !== 'xs' ? "-" + brkPoint : '';
- if (span != null) spans.push(span === true ? "" + prefix + infix : "" + prefix + infix + "-" + span);
- if (order != null) classes.push("order" + infix + "-" + order);
- if (offset != null) classes.push("offset" + infix + "-" + offset);
- });
-
- if (!spans.length) {
- spans.push(prefix); // plain 'col'
- }
-
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- ref: ref,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default.a.apply(void 0, [className].concat(spans, classes))
- }));
- });
- Col.displayName = 'Col';
- /* harmony default export */ __webpack_exports__["default"] = (Col);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Collapse.js":
- /*!******************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Collapse.js ***!
- \******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var dom_helpers_style__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! dom-helpers/style */ "./node_modules/dom-helpers/style/index.js");
- /* harmony import */ var dom_helpers_style__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_style__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var dom_helpers_transition_end__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! dom-helpers/transition/end */ "./node_modules/dom-helpers/transition/end.js");
- /* harmony import */ var dom_helpers_transition_end__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_transition_end__WEBPACK_IMPORTED_MODULE_6__);
- /* harmony import */ var react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-transition-group/Transition */ "./node_modules/react-transition-group/esm/Transition.js");
- /* harmony import */ var _utils_triggerBrowserReflow__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/triggerBrowserReflow */ "./node_modules/react-bootstrap/esm/utils/triggerBrowserReflow.js");
- /* harmony import */ var _utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/createChainedFunction */ "./node_modules/react-bootstrap/esm/utils/createChainedFunction.js");
-
-
-
-
- var _collapseStyles;
-
-
-
-
-
-
-
-
- var MARGINS = {
- height: ['marginTop', 'marginBottom'],
- width: ['marginLeft', 'marginRight']
- };
-
- function getDimensionValue(dimension, elem) {
- var offset = "offset" + dimension[0].toUpperCase() + dimension.slice(1);
- var value = elem[offset];
- var margins = MARGINS[dimension];
- return value + parseInt(dom_helpers_style__WEBPACK_IMPORTED_MODULE_4___default()(elem, margins[0]), 10) + parseInt(dom_helpers_style__WEBPACK_IMPORTED_MODULE_4___default()(elem, margins[1]), 10);
- }
-
- var collapseStyles = (_collapseStyles = {}, _collapseStyles[react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_7__["EXITED"]] = 'collapse', _collapseStyles[react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_7__["EXITING"]] = 'collapsing', _collapseStyles[react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_7__["ENTERING"]] = 'collapsing', _collapseStyles[react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_7__["ENTERED"]] = 'collapse show', _collapseStyles);
- var defaultProps = {
- in: false,
- timeout: 300,
- mountOnEnter: false,
- unmountOnExit: false,
- appear: false,
- dimension: 'height',
- getDimensionValue: getDimensionValue
- };
-
- var Collapse =
- /*#__PURE__*/
- function (_React$Component) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(Collapse, _React$Component);
-
- function Collapse() {
- var _this;
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
-
- _this.handleEnter = function (elem) {
- elem.style[_this.getDimension()] = '0';
- };
-
- _this.handleEntering = function (elem) {
- var dimension = _this.getDimension();
-
- elem.style[dimension] = _this._getScrollDimensionValue(elem, dimension);
- };
-
- _this.handleEntered = function (elem) {
- elem.style[_this.getDimension()] = null;
- };
-
- _this.handleExit = function (elem) {
- var dimension = _this.getDimension();
-
- elem.style[dimension] = _this.props.getDimensionValue(dimension, elem) + "px";
- Object(_utils_triggerBrowserReflow__WEBPACK_IMPORTED_MODULE_8__["default"])(elem);
- };
-
- _this.handleExiting = function (elem) {
- elem.style[_this.getDimension()] = null;
- };
-
- return _this;
- }
-
- var _proto = Collapse.prototype;
-
- _proto.getDimension = function getDimension() {
- return typeof this.props.dimension === 'function' ? this.props.dimension() : this.props.dimension;
- }
- /* -- Expanding -- */
- ;
-
- // for testing
- _proto._getScrollDimensionValue = function _getScrollDimensionValue(elem, dimension) {
- var scroll = "scroll" + dimension[0].toUpperCase() + dimension.slice(1);
- return elem[scroll] + "px";
- };
-
- _proto.render = function render() {
- var _this2 = this;
-
- var _this$props = this.props,
- onEnter = _this$props.onEnter,
- onEntering = _this$props.onEntering,
- onEntered = _this$props.onEntered,
- onExit = _this$props.onExit,
- onExiting = _this$props.onExiting,
- className = _this$props.className,
- children = _this$props.children,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["onEnter", "onEntering", "onEntered", "onExit", "onExiting", "className", "children"]);
-
- delete props.dimension;
- delete props.getDimensionValue;
- var handleEnter = Object(_utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_9__["default"])(this.handleEnter, onEnter);
- var handleEntering = Object(_utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_9__["default"])(this.handleEntering, onEntering);
- var handleEntered = Object(_utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_9__["default"])(this.handleEntered, onEntered);
- var handleExit = Object(_utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_9__["default"])(this.handleExit, onExit);
- var handleExiting = Object(_utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_9__["default"])(this.handleExiting, onExiting);
- return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_7__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- addEndListener: dom_helpers_transition_end__WEBPACK_IMPORTED_MODULE_6___default.a
- }, props, {
- "aria-expanded": props.role ? props.in : null,
- onEnter: handleEnter,
- onEntering: handleEntering,
- onEntered: handleEntered,
- onExit: handleExit,
- onExiting: handleExiting
- }), function (state, innerProps) {
- return react__WEBPACK_IMPORTED_MODULE_5___default.a.cloneElement(children, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, innerProps, {
- className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, children.props.className, collapseStyles[state], _this2.getDimension() === 'width' && 'width')
- }));
- });
- };
-
- return Collapse;
- }(react__WEBPACK_IMPORTED_MODULE_5___default.a.Component);
-
- Collapse.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (Collapse);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Container.js":
- /*!*******************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Container.js ***!
- \*******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
- var defaultProps = {
- fluid: false
- };
- var Container = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
- function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- fluid = _ref.fluid,
- _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'div' : _ref$as,
- className = _ref.className,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "fluid", "as", "className"]);
-
- var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'container');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, props, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, fluid ? prefix + "-fluid" : prefix)
- }));
- });
- Container.displayName = 'Container';
- Container.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (Container);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Dropdown.js":
- /*!******************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Dropdown.js ***!
- \******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react_overlays_Dropdown__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-overlays/Dropdown */ "./node_modules/react-overlays/Dropdown.js");
- /* harmony import */ var react_overlays_Dropdown__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_overlays_Dropdown__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
- /* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _DropdownMenu__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./DropdownMenu */ "./node_modules/react-bootstrap/esm/DropdownMenu.js");
- /* harmony import */ var _DropdownToggle__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./DropdownToggle */ "./node_modules/react-bootstrap/esm/DropdownToggle.js");
- /* harmony import */ var _DropdownItem__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./DropdownItem */ "./node_modules/react-bootstrap/esm/DropdownItem.js");
- /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
- /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
-
-
-
-
-
-
-
-
-
-
-
-
-
- var defaultProps = {
- navbar: false
- };
- var Dropdown = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (uncontrolledProps, ref) {
- var _useUncontrolled = Object(uncontrollable__WEBPACK_IMPORTED_MODULE_5__["useUncontrolled"])(uncontrolledProps, {
- show: 'onToggle'
- }),
- bsPrefix = _useUncontrolled.bsPrefix,
- drop = _useUncontrolled.drop,
- show = _useUncontrolled.show,
- className = _useUncontrolled.className,
- alignRight = _useUncontrolled.alignRight,
- onSelect = _useUncontrolled.onSelect,
- onToggle = _useUncontrolled.onToggle,
- focusFirstItemOnShow = _useUncontrolled.focusFirstItemOnShow,
- _useUncontrolled$as = _useUncontrolled.as,
- Component = _useUncontrolled$as === void 0 ? 'div' : _useUncontrolled$as,
- _4 = _useUncontrolled.navbar,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_useUncontrolled, ["bsPrefix", "drop", "show", "className", "alignRight", "onSelect", "onToggle", "focusFirstItemOnShow", "as", "navbar"]);
-
- var onSelectCtx = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_SelectableContext__WEBPACK_IMPORTED_MODULE_11__["default"]);
- var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_7__["useBootstrapPrefix"])(bsPrefix, 'dropdown');
- var handleToggle = Object(_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_6__["default"])(function (nextShow, event, source) {
- if (source === void 0) {
- source = event.type;
- }
-
- if (event.currentTarget === document) source = 'rootClose';
- onToggle(nextShow, event, {
- source: source
- });
- });
- var handleSelect = Object(_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_6__["default"])(function (key, event) {
- if (onSelectCtx) onSelectCtx(key, event);
- if (onSelect) onSelect(key, event);
- handleToggle(false, event, 'select');
- });
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_SelectableContext__WEBPACK_IMPORTED_MODULE_11__["default"].Provider, {
- value: handleSelect
- }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_overlays_Dropdown__WEBPACK_IMPORTED_MODULE_4___default.a.ControlledComponent, {
- drop: drop,
- show: show,
- alignEnd: alignRight,
- onToggle: handleToggle,
- focusFirstItemOnShow: focusFirstItemOnShow,
- itemSelector: "." + prefix + "-item:not(.disabled):not(:disabled)"
- }, function (_ref) {
- var dropdownProps = _ref.props;
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, dropdownProps, {
- ref: ref,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, show && 'show', (!drop || drop === 'down') && prefix, drop === 'up' && 'dropup', drop === 'right' && 'dropright', drop === 'left' && 'dropleft')
- }));
- }));
- });
- Dropdown.displayName = 'Dropdown';
- Dropdown.defaultProps = defaultProps;
- Dropdown.Toggle = _DropdownToggle__WEBPACK_IMPORTED_MODULE_9__["default"];
- Dropdown.Menu = _DropdownMenu__WEBPACK_IMPORTED_MODULE_8__["default"];
- Dropdown.Item = _DropdownItem__WEBPACK_IMPORTED_MODULE_10__["default"];
- Dropdown.Header = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_12__["default"])('dropdown-header', {
- defaultProps: {
- role: 'heading'
- }
- });
- Dropdown.Divider = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_12__["default"])('dropdown-divider', {
- defaultProps: {
- role: 'separator'
- }
- });
- /* harmony default export */ __webpack_exports__["default"] = (Dropdown);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/DropdownButton.js":
- /*!************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/DropdownButton.js ***!
- \************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _Dropdown__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Dropdown */ "./node_modules/react-bootstrap/esm/Dropdown.js");
-
-
-
-
-
- var propTypes = {
- /**
- * An html id attribute for the Toggle button, necessary for assistive technologies, such as screen readers.
- * @type {string|number}
- * @required
- */
- id: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.any,
-
- /** An `href` passed to the Toggle component */
- href: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
-
- /** An `onClick` handler passed to the Toggle component */
- onClick: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func,
-
- /** The content of the non-toggle Button. */
- title: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.node.isRequired,
-
- /** Disables both Buttons */
- disabled: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.bool,
-
- /** An ARIA accessible role applied to the Menu component. When set to 'menu', The dropdown */
- menuRole: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
-
- /**
- * Which event when fired outside the component will cause it to be closed.
- *
- * _see [DropdownMenu](#menu-props) for more details_
- */
- rootCloseEvent: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
-
- /** @ignore */
- bsPrefix: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
-
- /** @ignore */
- variant: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
-
- /** @ignore */
- size: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string
- };
- /**
- * A convenience component for simple or general use dropdowns. Renders a `Button` toggle and all `children`
- * are passed directly to the default `Dropdown.Menu`.
- *
- * _All unknown props are passed through to the `Dropdown` component._ Only
- * the Button `variant`, `size` and `bsPrefix` props are passed to the toggle,
- * along with menu related props are passed to the `Dropdown.Menu`
- */
-
- var DropdownButton = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (_ref, ref) {
- var title = _ref.title,
- children = _ref.children,
- bsPrefix = _ref.bsPrefix,
- rootCloseEvent = _ref.rootCloseEvent,
- variant = _ref.variant,
- size = _ref.size,
- menuRole = _ref.menuRole,
- disabled = _ref.disabled,
- href = _ref.href,
- id = _ref.id,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["title", "children", "bsPrefix", "rootCloseEvent", "variant", "size", "menuRole", "disabled", "href", "id"]);
-
- return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Dropdown__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, props), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Dropdown__WEBPACK_IMPORTED_MODULE_4__["default"].Toggle, {
- id: id,
- href: href,
- size: size,
- variant: variant,
- disabled: disabled,
- childBsPrefix: bsPrefix
- }, title), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Dropdown__WEBPACK_IMPORTED_MODULE_4__["default"].Menu, {
- role: menuRole,
- rootCloseEvent: rootCloseEvent
- }, children));
- });
- DropdownButton.displayName = 'DropdownButton';
- DropdownButton.propTypes = propTypes;
- /* harmony default export */ __webpack_exports__["default"] = (DropdownButton);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/DropdownItem.js":
- /*!**********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/DropdownItem.js ***!
- \**********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
- /* harmony import */ var _SafeAnchor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SafeAnchor */ "./node_modules/react-bootstrap/esm/SafeAnchor.js");
- /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _NavContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./NavContext */ "./node_modules/react-bootstrap/esm/NavContext.js");
-
-
-
-
-
-
-
-
-
- var defaultProps = {
- as: _SafeAnchor__WEBPACK_IMPORTED_MODULE_5__["default"],
- disabled: false
- };
- var DropdownItem = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- className = _ref.className,
- children = _ref.children,
- eventKey = _ref.eventKey,
- disabled = _ref.disabled,
- href = _ref.href,
- onClick = _ref.onClick,
- onSelect = _ref.onSelect,
- propActive = _ref.active,
- Component = _ref.as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "children", "eventKey", "disabled", "href", "onClick", "onSelect", "active", "as"]);
-
- var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_7__["useBootstrapPrefix"])(bsPrefix, 'dropdown-item');
- var onSelectCtx = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_SelectableContext__WEBPACK_IMPORTED_MODULE_6__["default"]);
- var navContext = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_NavContext__WEBPACK_IMPORTED_MODULE_8__["default"]);
-
- var _ref2 = navContext || {},
- activeKey = _ref2.activeKey;
-
- var key = Object(_SelectableContext__WEBPACK_IMPORTED_MODULE_6__["makeEventKey"])(eventKey, href);
- var active = propActive == null && key != null ? Object(_SelectableContext__WEBPACK_IMPORTED_MODULE_6__["makeEventKey"])(activeKey) === key : propActive;
- var handleClick = Object(_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__["default"])(function (event) {
- // SafeAnchor handles the disabled case, but we handle it here
- // for other components
- if (disabled) return;
- if (onClick) onClick(event);
- if (onSelectCtx) onSelectCtx(key, event);
- if (onSelect) onSelect(key, event);
- });
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- ref: ref,
- href: href,
- disabled: disabled,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, prefix, active && 'active', disabled && 'disabled'),
- onClick: handleClick
- }), children);
- });
- DropdownItem.displayName = 'DropdownItem';
- DropdownItem.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (DropdownItem);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/DropdownMenu.js":
- /*!**********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/DropdownMenu.js ***!
- \**********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var react_overlays_DropdownMenu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-overlays/DropdownMenu */ "./node_modules/react-overlays/DropdownMenu.js");
- /* harmony import */ var react_overlays_DropdownMenu__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_overlays_DropdownMenu__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var _NavbarContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./NavbarContext */ "./node_modules/react-bootstrap/esm/NavbarContext.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
-
-
-
- var wrapRef = function wrapRef(props) {
- var ref = props.ref;
-
- props.ref = ref.__wrapped || (ref.__wrapped = function (r) {
- return ref(Object(react_dom__WEBPACK_IMPORTED_MODULE_3__["findDOMNode"])(r));
- });
-
- return props;
- };
-
- var defaultProps = {
- alignRight: false,
- flip: true
- };
- var DropdownMenu = react__WEBPACK_IMPORTED_MODULE_4___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- className = _ref.className,
- alignRight = _ref.alignRight,
- rootCloseEvent = _ref.rootCloseEvent,
- flip = _ref.flip,
- popperConfig = _ref.popperConfig,
- showProps = _ref.show,
- _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'div' : _ref$as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "alignRight", "rootCloseEvent", "flip", "popperConfig", "show", "as"]);
-
- var isNavbar = Object(react__WEBPACK_IMPORTED_MODULE_4__["useContext"])(_NavbarContext__WEBPACK_IMPORTED_MODULE_6__["default"]);
- var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_7__["useBootstrapPrefix"])(bsPrefix, 'dropdown-menu');
- return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(react_overlays_DropdownMenu__WEBPACK_IMPORTED_MODULE_5___default.a, {
- ref: ref // FIXME: the ref situation is out of hand here
- ,
- flip: flip,
- show: showProps,
- alignEnd: alignRight,
- usePopper: !isNavbar,
- popperConfig: popperConfig,
- rootCloseEvent: rootCloseEvent
- }, function (_ref2) {
- var placement = _ref2.placement,
- show = _ref2.show,
- alignEnd = _ref2.alignEnd,
- close = _ref2.close,
- menuProps = _ref2.props;
- wrapRef(menuProps); // For custom components provide additional, non-DOM, props;
-
- if (typeof Component !== 'string') {
- menuProps.show = show;
- menuProps.close = close;
- menuProps.alignRight = alignEnd;
- }
-
- var style = props.style;
-
- if (placement) {
- // we don't need the default popper style,
- // menus are display: none when not shown.
- style = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, style, {}, menuProps.style);
- props['x-placement'] = placement;
- }
-
- return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, menuProps, {
- style: style,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, prefix, show && 'show', alignEnd && prefix + "-right")
- }));
- });
- });
- DropdownMenu.displayName = 'DropdownMenu';
- DropdownMenu.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (DropdownMenu);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/DropdownToggle.js":
- /*!************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/DropdownToggle.js ***!
- \************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types-extra/lib/isRequiredForA11y */ "./node_modules/prop-types-extra/lib/isRequiredForA11y.js");
- /* harmony import */ var prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var react_overlays_DropdownToggle__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-overlays/DropdownToggle */ "./node_modules/react-overlays/DropdownToggle.js");
- /* harmony import */ var react_overlays_DropdownToggle__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(react_overlays_DropdownToggle__WEBPACK_IMPORTED_MODULE_6__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_7__);
- /* harmony import */ var _Button__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Button */ "./node_modules/react-bootstrap/esm/Button.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
-
-
-
-
-
- var wrapRef = function wrapRef(props) {
- var ref = props.ref;
-
- props.ref = ref.__wrapped || (ref.__wrapped = function (r) {
- return ref(Object(react_dom__WEBPACK_IMPORTED_MODULE_4__["findDOMNode"])(r));
- });
-
- return props;
- };
-
- var DropdownToggle =
- /*#__PURE__*/
- function (_React$Component) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(DropdownToggle, _React$Component);
-
- function DropdownToggle() {
- return _React$Component.apply(this, arguments) || this;
- }
-
- var _proto = DropdownToggle.prototype;
-
- _proto.render = function render() {
- var _this$props = this.props,
- bsPrefix = _this$props.bsPrefix,
- split = _this$props.split,
- className = _this$props.className,
- children = _this$props.children,
- childBsPrefix = _this$props.childBsPrefix,
- Component = _this$props.as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["bsPrefix", "split", "className", "children", "childBsPrefix", "as"]);
-
- if (childBsPrefix !== undefined) {
- props.bsPrefix = childBsPrefix;
- } // This intentionally forwards size and variant (if set) to the
- // underlying component, to allow it to render size and style variants.
-
-
- return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(react_overlays_DropdownToggle__WEBPACK_IMPORTED_MODULE_6___default.a, null, function (_ref) {
- var toggle = _ref.toggle,
- toggleProps = _ref.props;
- return react__WEBPACK_IMPORTED_MODULE_7___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- onClick: toggle,
- className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, bsPrefix, split && bsPrefix + "-split")
- }, wrapRef(toggleProps), props), children);
- });
- };
-
- return DropdownToggle;
- }(react__WEBPACK_IMPORTED_MODULE_7___default.a.Component); // Needs to be a class FTM, because it needs to accept a ref that can be used with findDOMNode
-
-
- DropdownToggle.defaultProps = {
- as: _Button__WEBPACK_IMPORTED_MODULE_8__["default"]
- };
- /* harmony default export */ __webpack_exports__["default"] = (Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_9__["createBootstrapComponent"])(DropdownToggle, 'dropdown-toggle'));
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Fade.js":
- /*!**************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Fade.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-transition-group/Transition */ "./node_modules/react-transition-group/esm/Transition.js");
- /* harmony import */ var dom_helpers_transition_end__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! dom-helpers/transition/end */ "./node_modules/dom-helpers/transition/end.js");
- /* harmony import */ var dom_helpers_transition_end__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_transition_end__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var _utils_triggerBrowserReflow__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/triggerBrowserReflow */ "./node_modules/react-bootstrap/esm/utils/triggerBrowserReflow.js");
-
-
-
- var _fadeStyles;
-
-
-
-
-
-
- var defaultProps = {
- in: false,
- timeout: 300,
- mountOnEnter: false,
- unmountOnExit: false,
- appear: false
- };
- var fadeStyles = (_fadeStyles = {}, _fadeStyles[react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_4__["ENTERING"]] = 'show', _fadeStyles[react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_4__["ENTERED"]] = 'show', _fadeStyles);
- var Fade = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var className = _ref.className,
- children = _ref.children,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["className", "children"]);
-
- var handleEnter = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (node) {
- Object(_utils_triggerBrowserReflow__WEBPACK_IMPORTED_MODULE_6__["default"])(node);
- if (props.onEnter) props.onEnter(node);
- }, [props]);
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(react_transition_group_Transition__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref,
- addEndListener: dom_helpers_transition_end__WEBPACK_IMPORTED_MODULE_5___default.a
- }, props, {
- onEnter: handleEnter
- }), function (status, innerProps) {
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.cloneElement(children, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, innerProps, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('fade', className, children.props.className, fadeStyles[status])
- }));
- });
- });
- Fade.defaultProps = defaultProps;
- Fade.displayName = 'Fade';
- /* harmony default export */ __webpack_exports__["default"] = (Fade);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Feedback.js":
- /*!******************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Feedback.js ***!
- \******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
-
-
-
-
-
- var propTypes = {
- /**
- * Specify whether the feedback is for valid or invalid fields
- *
- * @type {('valid'|'invalid')}
- */
- type: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.string.isRequired,
- as: prop_types__WEBPACK_IMPORTED_MODULE_4___default.a.elementType
- };
- var defaultProps = {
- type: 'valid'
- };
- var Feedback = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
- function (_ref, ref) {
- var _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'div' : _ref$as,
- className = _ref.className,
- type = _ref.type,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["as", "className", "type"]);
-
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- ref: ref,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, type && type + "-feedback")
- }));
- });
- Feedback.displayName = 'Feedback';
- Feedback.propTypes = propTypes;
- Feedback.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (Feedback);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Figure.js":
- /*!****************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Figure.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
- /* harmony import */ var _FigureImage__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FigureImage */ "./node_modules/react-bootstrap/esm/FigureImage.js");
- /* harmony import */ var _FigureCaption__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./FigureCaption */ "./node_modules/react-bootstrap/esm/FigureCaption.js");
-
-
-
- var Figure = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('figure', {
- Component: 'figure'
- });
- Figure.Image = _FigureImage__WEBPACK_IMPORTED_MODULE_1__["default"];
- Figure.Caption = _FigureCaption__WEBPACK_IMPORTED_MODULE_2__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (Figure);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/FigureCaption.js":
- /*!***********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/FigureCaption.js ***!
- \***********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
-
- var FigureCaption = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('figure-caption', {
- Component: 'figcaption'
- });
- /* harmony default export */ __webpack_exports__["default"] = (FigureCaption);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/FigureImage.js":
- /*!*********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/FigureImage.js ***!
- \*********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _Image__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Image */ "./node_modules/react-bootstrap/esm/Image.js");
-
-
-
-
-
-
- var propTypes = {
- /**
- * @default 'img'
- */
- bsPrefix: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
-
- /**
- * Sets image as fluid image.
- */
- fluid: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.bool,
-
- /**
- * Sets image shape as rounded.
- */
- rounded: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.bool,
-
- /**
- * Sets image shape as circle.
- */
- roundedCircle: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.bool,
-
- /**
- * Sets image shape as thumbnail.
- */
- thumbnail: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.bool
- };
- var defaultProps = {
- fluid: true
- };
- var FigureImage = react__WEBPACK_IMPORTED_MODULE_4___default.a.forwardRef(function (_ref, ref) {
- var className = _ref.className,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["className"]);
-
- return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_Image__WEBPACK_IMPORTED_MODULE_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, props, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, 'figure-img')
- }));
- });
- FigureImage.displayName = 'FigureImage';
- FigureImage.propTypes = propTypes;
- FigureImage.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (FigureImage);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Form.js":
- /*!**************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Form.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _FormCheck__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FormCheck */ "./node_modules/react-bootstrap/esm/FormCheck.js");
- /* harmony import */ var _FormControl__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./FormControl */ "./node_modules/react-bootstrap/esm/FormControl.js");
- /* harmony import */ var _FormGroup__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./FormGroup */ "./node_modules/react-bootstrap/esm/FormGroup.js");
- /* harmony import */ var _FormLabel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./FormLabel */ "./node_modules/react-bootstrap/esm/FormLabel.js");
- /* harmony import */ var _FormText__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./FormText */ "./node_modules/react-bootstrap/esm/FormText.js");
- /* harmony import */ var _Switch__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Switch */ "./node_modules/react-bootstrap/esm/Switch.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
-
-
-
-
-
-
-
-
-
-
-
-
- var defaultProps = {
- inline: false
- };
- var Form = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- inline = _ref.inline,
- className = _ref.className,
- validated = _ref.validated,
- _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'form' : _ref$as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "inline", "className", "validated", "as"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_10__["useBootstrapPrefix"])(bsPrefix, 'form');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- ref: ref,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, validated && 'was-validated', inline && bsPrefix + "-inline")
- }));
- });
- Form.displayName = 'Form';
- Form.defaultProps = defaultProps;
- Form.Row = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_11__["default"])('form-row');
- Form.Group = _FormGroup__WEBPACK_IMPORTED_MODULE_6__["default"];
- Form.Control = _FormControl__WEBPACK_IMPORTED_MODULE_5__["default"];
- Form.Check = _FormCheck__WEBPACK_IMPORTED_MODULE_4__["default"];
- Form.Switch = _Switch__WEBPACK_IMPORTED_MODULE_9__["default"];
- Form.Label = _FormLabel__WEBPACK_IMPORTED_MODULE_7__["default"];
- Form.Text = _FormText__WEBPACK_IMPORTED_MODULE_8__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (Form);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/FormCheck.js":
- /*!*******************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/FormCheck.js ***!
- \*******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var prop_types_extra_lib_all__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types-extra/lib/all */ "./node_modules/prop-types-extra/lib/all.js");
- /* harmony import */ var prop_types_extra_lib_all__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types_extra_lib_all__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _Feedback__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Feedback */ "./node_modules/react-bootstrap/esm/Feedback.js");
- /* harmony import */ var _FormCheckInput__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./FormCheckInput */ "./node_modules/react-bootstrap/esm/FormCheckInput.js");
- /* harmony import */ var _FormCheckLabel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./FormCheckLabel */ "./node_modules/react-bootstrap/esm/FormCheckLabel.js");
- /* harmony import */ var _FormContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./FormContext */ "./node_modules/react-bootstrap/esm/FormContext.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
-
-
-
-
- var defaultProps = {
- type: 'checkbox',
- inline: false,
- disabled: false,
- isValid: false,
- isInvalid: false,
- title: ''
- };
- var FormCheck = react__WEBPACK_IMPORTED_MODULE_4___default.a.forwardRef(function (_ref, ref) {
- var id = _ref.id,
- bsPrefix = _ref.bsPrefix,
- bsCustomPrefix = _ref.bsCustomPrefix,
- inline = _ref.inline,
- disabled = _ref.disabled,
- isValid = _ref.isValid,
- isInvalid = _ref.isInvalid,
- feedback = _ref.feedback,
- className = _ref.className,
- style = _ref.style,
- title = _ref.title,
- type = _ref.type,
- label = _ref.label,
- children = _ref.children,
- propCustom = _ref.custom,
- _ref$as = _ref.as,
- as = _ref$as === void 0 ? 'input' : _ref$as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["id", "bsPrefix", "bsCustomPrefix", "inline", "disabled", "isValid", "isInvalid", "feedback", "className", "style", "title", "type", "label", "children", "custom", "as"]);
-
- var custom = type === 'switch' ? true : propCustom;
- bsPrefix = custom ? Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_9__["useBootstrapPrefix"])(bsCustomPrefix, 'custom-control') : Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_9__["useBootstrapPrefix"])(bsPrefix, 'form-check');
-
- var _useContext = Object(react__WEBPACK_IMPORTED_MODULE_4__["useContext"])(_FormContext__WEBPACK_IMPORTED_MODULE_8__["default"]),
- controlId = _useContext.controlId;
-
- var innerFormContext = Object(react__WEBPACK_IMPORTED_MODULE_4__["useMemo"])(function () {
- return {
- controlId: id || controlId,
- custom: custom
- };
- }, [controlId, custom, id]);
- var hasLabel = label != null && label !== false && !children;
- var input = react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_FormCheckInput__WEBPACK_IMPORTED_MODULE_6__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- type: type === 'switch' ? 'checkbox' : type,
- ref: ref,
- isValid: isValid,
- isInvalid: isInvalid,
- isStatic: !hasLabel,
- disabled: disabled,
- as: as
- }));
- return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_FormContext__WEBPACK_IMPORTED_MODULE_8__["default"].Provider, {
- value: innerFormContext
- }, react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("div", {
- style: style,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, custom && "custom-" + type, inline && bsPrefix + "-inline")
- }, children || react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_4___default.a.Fragment, null, input, hasLabel && react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_FormCheckLabel__WEBPACK_IMPORTED_MODULE_7__["default"], {
- title: title
- }, label), (isValid || isInvalid) && react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_Feedback__WEBPACK_IMPORTED_MODULE_5__["default"], {
- type: isValid ? 'valid' : 'invalid'
- }, feedback))));
- });
- FormCheck.displayName = 'FormCheck';
- FormCheck.defaultProps = defaultProps;
- FormCheck.Input = _FormCheckInput__WEBPACK_IMPORTED_MODULE_6__["default"];
- FormCheck.Label = _FormCheckLabel__WEBPACK_IMPORTED_MODULE_7__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (FormCheck);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/FormCheckInput.js":
- /*!************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/FormCheckInput.js ***!
- \************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _FormContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FormContext */ "./node_modules/react-bootstrap/esm/FormContext.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
- var defaultProps = {
- type: 'checkbox'
- };
- var FormCheckInput = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var id = _ref.id,
- bsPrefix = _ref.bsPrefix,
- bsCustomPrefix = _ref.bsCustomPrefix,
- className = _ref.className,
- isValid = _ref.isValid,
- isInvalid = _ref.isInvalid,
- isStatic = _ref.isStatic,
- _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'input' : _ref$as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["id", "bsPrefix", "bsCustomPrefix", "className", "isValid", "isInvalid", "isStatic", "as"]);
-
- var _useContext = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_FormContext__WEBPACK_IMPORTED_MODULE_4__["default"]),
- controlId = _useContext.controlId,
- custom = _useContext.custom;
-
- bsPrefix = custom ? Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsCustomPrefix, 'custom-control-input') : Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'form-check-input');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- ref: ref,
- id: id || controlId,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, isValid && 'is-valid', isInvalid && 'is-invalid', isStatic && 'position-static')
- }));
- });
- FormCheckInput.displayName = 'FormCheckInput';
- FormCheckInput.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (FormCheckInput);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/FormCheckLabel.js":
- /*!************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/FormCheckLabel.js ***!
- \************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _FormContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FormContext */ "./node_modules/react-bootstrap/esm/FormContext.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
- var FormCheckLabel = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- bsCustomPrefix = _ref.bsCustomPrefix,
- className = _ref.className,
- htmlFor = _ref.htmlFor,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "bsCustomPrefix", "className", "htmlFor"]);
-
- var _useContext = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_FormContext__WEBPACK_IMPORTED_MODULE_4__["default"]),
- controlId = _useContext.controlId,
- custom = _useContext.custom;
-
- bsPrefix = custom ? Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsCustomPrefix, 'custom-control-label') : Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'form-check-label');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("label", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- ref: ref,
- htmlFor: htmlFor || controlId,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix)
- }));
- });
- FormCheckLabel.displayName = 'FormCheckLabel';
- /* harmony default export */ __webpack_exports__["default"] = (FormCheckLabel);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/FormContext.js":
- /*!*********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/FormContext.js ***!
- \*********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-
- var FormContext = react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext({
- controlId: undefined
- });
- /* harmony default export */ __webpack_exports__["default"] = (FormContext);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/FormControl.js":
- /*!*********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/FormControl.js ***!
- \*********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! warning */ "./node_modules/warning/warning.js");
- /* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(warning__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _Feedback__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Feedback */ "./node_modules/react-bootstrap/esm/Feedback.js");
- /* harmony import */ var _FormContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./FormContext */ "./node_modules/react-bootstrap/esm/FormContext.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
-
-
- var FormControl = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- type = _ref.type,
- size = _ref.size,
- id = _ref.id,
- className = _ref.className,
- isValid = _ref.isValid,
- isInvalid = _ref.isInvalid,
- plaintext = _ref.plaintext,
- readOnly = _ref.readOnly,
- _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'input' : _ref$as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "type", "size", "id", "className", "isValid", "isInvalid", "plaintext", "readOnly", "as"]);
-
- var _useContext = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_FormContext__WEBPACK_IMPORTED_MODULE_6__["default"]),
- controlId = _useContext.controlId;
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_7__["useBootstrapPrefix"])(bsPrefix, 'form-control');
- var classes;
-
- if (plaintext) {
- var _classes;
-
- classes = (_classes = {}, _classes[bsPrefix + "-plaintext"] = true, _classes);
- } else if (type === 'file') {
- var _classes2;
-
- classes = (_classes2 = {}, _classes2[bsPrefix + "-file"] = true, _classes2);
- } else {
- var _classes3;
-
- classes = (_classes3 = {}, _classes3[bsPrefix] = true, _classes3[bsPrefix + "-" + size] = size, _classes3);
- }
-
- true ? warning__WEBPACK_IMPORTED_MODULE_4___default()(controlId == null || !id, '`controlId` is ignored on `<FormControl>` when `id` is specified.') : undefined;
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- type: type,
- ref: ref,
- readOnly: readOnly,
- id: id || controlId,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, classes, isValid && "is-valid", isInvalid && "is-invalid")
- }));
- });
- FormControl.displayName = 'FormControl';
- FormControl.Feedback = _Feedback__WEBPACK_IMPORTED_MODULE_5__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (FormControl);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/FormGroup.js":
- /*!*******************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/FormGroup.js ***!
- \*******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _FormContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FormContext */ "./node_modules/react-bootstrap/esm/FormContext.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
- var FormGroup = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- className = _ref.className,
- children = _ref.children,
- controlId = _ref.controlId,
- _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'div' : _ref$as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "children", "controlId", "as"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'form-group');
- var context = Object(react__WEBPACK_IMPORTED_MODULE_3__["useMemo"])(function () {
- return {
- controlId: controlId
- };
- }, [controlId]);
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_FormContext__WEBPACK_IMPORTED_MODULE_4__["default"].Provider, {
- value: context
- }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- ref: ref,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix)
- }), children));
- });
- FormGroup.displayName = 'FormGroup';
- /* harmony default export */ __webpack_exports__["default"] = (FormGroup);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/FormLabel.js":
- /*!*******************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/FormLabel.js ***!
- \*******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! warning */ "./node_modules/warning/warning.js");
- /* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(warning__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _Col__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Col */ "./node_modules/react-bootstrap/esm/Col.js");
- /* harmony import */ var _FormContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./FormContext */ "./node_modules/react-bootstrap/esm/FormContext.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
-
-
- var defaultProps = {
- column: false,
- srOnly: false
- };
- var FormLabel = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- column = _ref.column,
- srOnly = _ref.srOnly,
- className = _ref.className,
- htmlFor = _ref.htmlFor,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "column", "srOnly", "className", "htmlFor"]);
-
- var _useContext = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_FormContext__WEBPACK_IMPORTED_MODULE_6__["default"]),
- controlId = _useContext.controlId;
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_7__["useBootstrapPrefix"])(bsPrefix, 'form-label');
- var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, srOnly && 'sr-only', column && 'col-form-label');
- true ? warning__WEBPACK_IMPORTED_MODULE_4___default()(controlId == null || !htmlFor, '`controlId` is ignored on `<FormLabel>` when `htmlFor` is specified.') : undefined;
- htmlFor = htmlFor || controlId;
- if (column) return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_Col__WEBPACK_IMPORTED_MODULE_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- as: "label",
- className: classes,
- htmlFor: htmlFor
- }, props));
- return (// eslint-disable-next-line jsx-a11y/label-has-for, jsx-a11y/label-has-associated-control
- react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("label", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref,
- className: classes,
- htmlFor: htmlFor
- }, props))
- );
- });
- FormLabel.displayName = 'FormLabel';
- FormLabel.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (FormLabel);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/FormText.js":
- /*!******************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/FormText.js ***!
- \******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
- var FormText = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
- function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- className = _ref.className,
- _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'small' : _ref$as,
- muted = _ref.muted,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "as", "muted"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'form-text');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- ref: ref,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, muted && 'text-muted')
- }));
- });
- FormText.displayName = 'FormText';
- /* harmony default export */ __webpack_exports__["default"] = (FormText);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Image.js":
- /*!***************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Image.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
- var defaultProps = {
- fluid: false,
- rounded: false,
- roundedCircle: false,
- thumbnail: false
- };
- var Image = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- className = _ref.className,
- fluid = _ref.fluid,
- rounded = _ref.rounded,
- roundedCircle = _ref.roundedCircle,
- thumbnail = _ref.thumbnail,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "fluid", "rounded", "roundedCircle", "thumbnail"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'img');
- var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(fluid && bsPrefix + "-fluid", rounded && "rounded", roundedCircle && "rounded-circle", thumbnail && bsPrefix + "-thumbnail");
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("img", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- // eslint-disable-line jsx-a11y/alt-text
- ref: ref
- }, props, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, classes)
- }));
- });
- Image.displayName = 'Image';
- Image.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (Image);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/InputGroup.js":
- /*!********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/InputGroup.js ***!
- \********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
-
- /**
- *
- * @property {InputGroupAppend} Append
- * @property {InputGroupPrepend} Prepend
- * @property {InputGroupText} Text
- * @property {InputGroupRadio} Radio
- * @property {InputGroupCheckbox} Checkbox
- */
- var InputGroup = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- size = _ref.size,
- className = _ref.className,
- _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'div' : _ref$as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "size", "className", "as"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'input-group');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, props, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, size && bsPrefix + "-" + size)
- }));
- });
- var InputGroupAppend = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_4__["default"])('input-group-append');
- var InputGroupPrepend = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_4__["default"])('input-group-prepend');
- var InputGroupText = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_4__["default"])('input-group-text', {
- Component: 'span'
- });
-
- var InputGroupCheckbox = function InputGroupCheckbox(props) {
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(InputGroupText, null, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("input", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- type: "checkbox"
- }, props)));
- };
-
- var InputGroupRadio = function InputGroupRadio(props) {
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(InputGroupText, null, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("input", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- type: "radio"
- }, props)));
- };
-
- InputGroup.displayName = 'InputGroup';
- InputGroup.Text = InputGroupText;
- InputGroup.Radio = InputGroupRadio;
- InputGroup.Checkbox = InputGroupCheckbox;
- InputGroup.Append = InputGroupAppend;
- InputGroup.Prepend = InputGroupPrepend;
- /* harmony default export */ __webpack_exports__["default"] = (InputGroup);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Jumbotron.js":
- /*!*******************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Jumbotron.js ***!
- \*******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
- var defaultProps = {
- fluid: false
- };
- var Jumbotron = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (_ref, ref) {
- var _classes;
-
- var _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'div' : _ref$as,
- className = _ref.className,
- fluid = _ref.fluid,
- bsPrefix = _ref.bsPrefix,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["as", "className", "fluid", "bsPrefix"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'jumbotron');
- var classes = (_classes = {}, _classes[bsPrefix] = true, _classes[bsPrefix + "-fluid"] = fluid, _classes);
- return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, props, {
- className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, classes)
- }));
- });
- Jumbotron.defaultProps = defaultProps;
- Jumbotron.displayName = 'Jumbotron';
- /* harmony default export */ __webpack_exports__["default"] = (Jumbotron);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/ListGroup.js":
- /*!*******************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/ListGroup.js ***!
- \*******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _AbstractNav__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./AbstractNav */ "./node_modules/react-bootstrap/esm/AbstractNav.js");
- /* harmony import */ var _ListGroupItem__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ListGroupItem */ "./node_modules/react-bootstrap/esm/ListGroupItem.js");
-
-
-
-
-
-
-
-
- var defaultProps = {
- variant: null
- };
- var ListGroup = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (props, ref) {
- var _useUncontrolled = Object(uncontrollable__WEBPACK_IMPORTED_MODULE_4__["useUncontrolled"])(props, {
- activeKey: 'onSelect'
- }),
- className = _useUncontrolled.className,
- bsPrefix = _useUncontrolled.bsPrefix,
- variant = _useUncontrolled.variant,
- _useUncontrolled$as = _useUncontrolled.as,
- as = _useUncontrolled$as === void 0 ? 'div' : _useUncontrolled$as,
- controlledProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_useUncontrolled, ["className", "bsPrefix", "variant", "as"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'list-group');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_AbstractNav__WEBPACK_IMPORTED_MODULE_6__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, controlledProps, {
- as: as,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, variant && bsPrefix + "-" + variant)
- }));
- });
- ListGroup.defaultProps = defaultProps;
- ListGroup.displayName = 'ListGroup';
- ListGroup.Item = _ListGroupItem__WEBPACK_IMPORTED_MODULE_7__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (ListGroup);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/ListGroupItem.js":
- /*!***********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/ListGroupItem.js ***!
- \***********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _AbstractNavItem__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AbstractNavItem */ "./node_modules/react-bootstrap/esm/AbstractNavItem.js");
- /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
-
- var defaultProps = {
- variant: null,
- active: false,
- disabled: false
- };
- var ListGroupItem = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- active = _ref.active,
- disabled = _ref.disabled,
- className = _ref.className,
- variant = _ref.variant,
- action = _ref.action,
- as = _ref.as,
- eventKey = _ref.eventKey,
- onClick = _ref.onClick,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "active", "disabled", "className", "variant", "action", "as", "eventKey", "onClick"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_6__["useBootstrapPrefix"])(bsPrefix, 'list-group-item');
- var handleClick = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) {
- if (disabled) {
- event.preventDefault();
- event.stopPropagation();
- return;
- }
-
- if (onClick) onClick(event);
- }, [disabled, onClick]);
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_AbstractNavItem__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, props, {
- eventKey: Object(_SelectableContext__WEBPACK_IMPORTED_MODULE_5__["makeEventKey"])(eventKey, props.href) // eslint-disable-next-line
- ,
- as: as || (action ? props.href ? 'a' : 'button' : 'div'),
- onClick: handleClick,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, active && 'active', disabled && 'disabled', variant && bsPrefix + "-" + variant, action && bsPrefix + "-action")
- }));
- });
- ListGroupItem.defaultProps = defaultProps;
- ListGroupItem.displayName = 'ListGroupItem';
- /* harmony default export */ __webpack_exports__["default"] = (ListGroupItem);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Media.js":
- /*!***************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Media.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
- var Media = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
- function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- className = _ref.className,
- _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'div' : _ref$as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "as"]);
-
- var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'media');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- ref: ref,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, prefix)
- }));
- });
- Media.displayName = 'Media';
- Media.Body = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_4__["default"])('media-body');
- /* harmony default export */ __webpack_exports__["default"] = (Media);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Modal.js":
- /*!***************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Modal.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var dom_helpers_events__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! dom-helpers/events */ "./node_modules/dom-helpers/events/index.js");
- /* harmony import */ var dom_helpers_events__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_events__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var dom_helpers_ownerDocument__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js");
- /* harmony import */ var dom_helpers_ownerDocument__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_ownerDocument__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var dom_helpers_util_inDOM__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! dom-helpers/util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js");
- /* harmony import */ var dom_helpers_util_inDOM__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_util_inDOM__WEBPACK_IMPORTED_MODULE_6__);
- /* harmony import */ var dom_helpers_util_scrollbarSize__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! dom-helpers/util/scrollbarSize */ "./node_modules/dom-helpers/util/scrollbarSize.js");
- /* harmony import */ var dom_helpers_util_scrollbarSize__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_util_scrollbarSize__WEBPACK_IMPORTED_MODULE_7__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_8__);
- /* harmony import */ var react_overlays_Modal__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react-overlays/Modal */ "./node_modules/react-overlays/Modal.js");
- /* harmony import */ var react_overlays_Modal__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react_overlays_Modal__WEBPACK_IMPORTED_MODULE_9__);
- /* harmony import */ var _Fade__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Fade */ "./node_modules/react-bootstrap/esm/Fade.js");
- /* harmony import */ var _ModalBody__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./ModalBody */ "./node_modules/react-bootstrap/esm/ModalBody.js");
- /* harmony import */ var _ModalDialog__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ModalDialog */ "./node_modules/react-bootstrap/esm/ModalDialog.js");
- /* harmony import */ var _ModalFooter__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./ModalFooter */ "./node_modules/react-bootstrap/esm/ModalFooter.js");
- /* harmony import */ var _ModalHeader__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./ModalHeader */ "./node_modules/react-bootstrap/esm/ModalHeader.js");
- /* harmony import */ var _ModalTitle__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./ModalTitle */ "./node_modules/react-bootstrap/esm/ModalTitle.js");
- /* harmony import */ var _utils_BootstrapModalManager__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./utils/BootstrapModalManager */ "./node_modules/react-bootstrap/esm/utils/BootstrapModalManager.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _ModalContext__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./ModalContext */ "./node_modules/react-bootstrap/esm/ModalContext.js");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var defaultProps = {
- show: false,
- backdrop: true,
- keyboard: true,
- autoFocus: true,
- enforceFocus: true,
- restoreFocus: true,
- animation: true,
- dialogAs: _ModalDialog__WEBPACK_IMPORTED_MODULE_12__["default"],
- manager: new _utils_BootstrapModalManager__WEBPACK_IMPORTED_MODULE_16__["default"]()
- };
- /* eslint-disable no-use-before-define, react/no-multi-comp */
-
- function DialogTransition(props) {
- return react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement(_Fade__WEBPACK_IMPORTED_MODULE_10__["default"], props);
- }
-
- function BackdropTransition(props) {
- return react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement(_Fade__WEBPACK_IMPORTED_MODULE_10__["default"], props);
- }
- /* eslint-enable no-use-before-define */
-
-
- var Modal =
- /*#__PURE__*/
- function (_React$Component) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(Modal, _React$Component);
-
- function Modal() {
- var _this;
-
- for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
- _args[_key] = arguments[_key];
- }
-
- _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
- _this.state = {
- style: {}
- };
- _this.modalContext = {
- onHide: function onHide() {
- return _this.props.onHide();
- }
- };
-
- _this.setModalRef = function (ref) {
- _this._modal = ref;
- };
-
- _this.handleDialogMouseDown = function () {
- _this._waitingForMouseUp = true;
- };
-
- _this.handleMouseUp = function (e) {
- if (_this._waitingForMouseUp && e.target === _this._modal.dialog) {
- _this._ignoreBackdropClick = true;
- }
-
- _this._waitingForMouseUp = false;
- };
-
- _this.handleClick = function (e) {
- if (_this._ignoreBackdropClick || e.target !== e.currentTarget) {
- _this._ignoreBackdropClick = false;
- return;
- }
-
- _this.props.onHide();
- };
-
- _this.handleEnter = function (node) {
- var _this$props;
-
- if (node) {
- node.style.display = 'block';
-
- _this.updateDialogStyle(node);
- }
-
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
- args[_key2 - 1] = arguments[_key2];
- }
-
- if (_this.props.onEnter) (_this$props = _this.props).onEnter.apply(_this$props, [node].concat(args));
- };
-
- _this.handleEntering = function (node) {
- var _this$props2;
-
- for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
- args[_key3 - 1] = arguments[_key3];
- }
-
- if (_this.props.onEntering) (_this$props2 = _this.props).onEntering.apply(_this$props2, [node].concat(args)); // FIXME: This should work even when animation is disabled.
-
- dom_helpers_events__WEBPACK_IMPORTED_MODULE_4___default.a.on(window, 'resize', _this.handleWindowResize);
- };
-
- _this.handleExited = function (node) {
- var _this$props3;
-
- if (node) node.style.display = ''; // RHL removes it sometimes
-
- for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
- args[_key4 - 1] = arguments[_key4];
- }
-
- if (_this.props.onExited) (_this$props3 = _this.props).onExited.apply(_this$props3, args); // FIXME: This should work even when animation is disabled.
-
- dom_helpers_events__WEBPACK_IMPORTED_MODULE_4___default.a.off(window, 'resize', _this.handleWindowResize);
- };
-
- _this.handleWindowResize = function () {
- _this.updateDialogStyle(_this._modal.dialog);
- };
-
- _this.renderBackdrop = function (props) {
- var _this$props4 = _this.props,
- bsPrefix = _this$props4.bsPrefix,
- backdropClassName = _this$props4.backdropClassName,
- animation = _this$props4.animation;
- return react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, props, {
- className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(bsPrefix + "-backdrop", backdropClassName, !animation && 'show')
- }));
- };
-
- return _this;
- }
-
- var _proto = Modal.prototype;
-
- _proto.componentWillUnmount = function componentWillUnmount() {
- // Clean up the listener if we need to.
- dom_helpers_events__WEBPACK_IMPORTED_MODULE_4___default.a.off(window, 'resize', this.handleWindowResize);
- };
-
- _proto.updateDialogStyle = function updateDialogStyle(node) {
- if (!dom_helpers_util_inDOM__WEBPACK_IMPORTED_MODULE_6___default.a) return;
- var manager = this.props.manager;
- var containerIsOverflowing = manager.isContainerOverflowing(this._modal);
- var modalIsOverflowing = node.scrollHeight > dom_helpers_ownerDocument__WEBPACK_IMPORTED_MODULE_5___default()(node).documentElement.clientHeight;
- this.setState({
- style: {
- paddingRight: containerIsOverflowing && !modalIsOverflowing ? dom_helpers_util_scrollbarSize__WEBPACK_IMPORTED_MODULE_7___default()() : undefined,
- paddingLeft: !containerIsOverflowing && modalIsOverflowing ? dom_helpers_util_scrollbarSize__WEBPACK_IMPORTED_MODULE_7___default()() : undefined
- }
- });
- };
-
- _proto.render = function render() {
- var _this$props5 = this.props,
- bsPrefix = _this$props5.bsPrefix,
- className = _this$props5.className,
- style = _this$props5.style,
- dialogClassName = _this$props5.dialogClassName,
- children = _this$props5.children,
- Dialog = _this$props5.dialogAs,
- show = _this$props5.show,
- animation = _this$props5.animation,
- backdrop = _this$props5.backdrop,
- keyboard = _this$props5.keyboard,
- manager = _this$props5.manager,
- onEscapeKeyDown = _this$props5.onEscapeKeyDown,
- onShow = _this$props5.onShow,
- onHide = _this$props5.onHide,
- container = _this$props5.container,
- autoFocus = _this$props5.autoFocus,
- enforceFocus = _this$props5.enforceFocus,
- restoreFocus = _this$props5.restoreFocus,
- onEntered = _this$props5.onEntered,
- onExit = _this$props5.onExit,
- onExiting = _this$props5.onExiting,
- _ = _this$props5.onExited,
- _1 = _this$props5.onEntering,
- _6 = _this$props5.onEnter,
- _4 = _this$props5.onEntering,
- _2 = _this$props5.backdropClassName,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(_this$props5, ["bsPrefix", "className", "style", "dialogClassName", "children", "dialogAs", "show", "animation", "backdrop", "keyboard", "manager", "onEscapeKeyDown", "onShow", "onHide", "container", "autoFocus", "enforceFocus", "restoreFocus", "onEntered", "onExit", "onExiting", "onExited", "onEntering", "onEnter", "onEntering", "backdropClassName"]);
-
- var clickHandler = backdrop === true ? this.handleClick : null;
-
- var baseModalStyle = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, style, {}, this.state.style); // Sets `display` always block when `animation` is false
-
-
- if (!animation) baseModalStyle.display = 'block';
- return react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement(_ModalContext__WEBPACK_IMPORTED_MODULE_18__["default"].Provider, {
- value: this.modalContext
- }, react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement(react_overlays_Modal__WEBPACK_IMPORTED_MODULE_9___default.a, {
- show: show,
- backdrop: backdrop,
- container: container,
- keyboard: keyboard,
- autoFocus: autoFocus,
- enforceFocus: enforceFocus,
- restoreFocus: restoreFocus,
- onEscapeKeyDown: onEscapeKeyDown,
- onShow: onShow,
- onHide: onHide,
- onEntered: onEntered,
- onExit: onExit,
- onExiting: onExiting,
- manager: manager,
- ref: this.setModalRef,
- style: baseModalStyle,
- className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, bsPrefix),
- containerClassName: bsPrefix + "-open",
- transition: animation ? DialogTransition : undefined,
- backdropTransition: animation ? BackdropTransition : undefined,
- renderBackdrop: this.renderBackdrop,
- onClick: clickHandler,
- onMouseUp: this.handleMouseUp,
- onEnter: this.handleEnter,
- onEntering: this.handleEntering,
- onExited: this.handleExited
- }, react__WEBPACK_IMPORTED_MODULE_8___default.a.createElement(Dialog, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, props, {
- onMouseDown: this.handleDialogMouseDown,
- className: dialogClassName
- }), children)));
- };
-
- return Modal;
- }(react__WEBPACK_IMPORTED_MODULE_8___default.a.Component);
-
- Modal.defaultProps = defaultProps;
- var DecoratedModal = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_17__["createBootstrapComponent"])(Modal, 'modal');
- DecoratedModal.Body = _ModalBody__WEBPACK_IMPORTED_MODULE_11__["default"];
- DecoratedModal.Header = _ModalHeader__WEBPACK_IMPORTED_MODULE_14__["default"];
- DecoratedModal.Title = _ModalTitle__WEBPACK_IMPORTED_MODULE_15__["default"];
- DecoratedModal.Footer = _ModalFooter__WEBPACK_IMPORTED_MODULE_13__["default"];
- DecoratedModal.Dialog = _ModalDialog__WEBPACK_IMPORTED_MODULE_12__["default"];
- DecoratedModal.TRANSITION_DURATION = 300;
- DecoratedModal.BACKDROP_TRANSITION_DURATION = 150;
- /* harmony default export */ __webpack_exports__["default"] = (DecoratedModal);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/ModalBody.js":
- /*!*******************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/ModalBody.js ***!
- \*******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
-
- /* harmony default export */ __webpack_exports__["default"] = (Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('modal-body'));
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/ModalContext.js":
- /*!**********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/ModalContext.js ***!
- \**********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-
- var ModalContext = react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext({
- onHide: function onHide() {}
- });
- /* harmony default export */ __webpack_exports__["default"] = (ModalContext);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/ModalDialog.js":
- /*!*********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/ModalDialog.js ***!
- \*********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
- var ModalDialog = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- className = _ref.className,
- centered = _ref.centered,
- size = _ref.size,
- children = _ref.children,
- scrollable = _ref.scrollable,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "centered", "size", "children", "scrollable"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'modal');
- var dialogClass = bsPrefix + "-dialog";
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- ref: ref,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(dialogClass, className, size && bsPrefix + "-" + size, centered && dialogClass + "-centered", scrollable && dialogClass + "-scrollable")
- }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(bsPrefix + "-content")
- }, children));
- });
- ModalDialog.displayName = 'ModalDialog';
- /* harmony default export */ __webpack_exports__["default"] = (ModalDialog);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/ModalFooter.js":
- /*!*********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/ModalFooter.js ***!
- \*********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
-
- /* harmony default export */ __webpack_exports__["default"] = (Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('modal-footer'));
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/ModalHeader.js":
- /*!*********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/ModalHeader.js ***!
- \*********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _CloseButton__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./CloseButton */ "./node_modules/react-bootstrap/esm/CloseButton.js");
- /* harmony import */ var _ModalContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ModalContext */ "./node_modules/react-bootstrap/esm/ModalContext.js");
-
-
-
-
-
-
-
-
- var defaultProps = {
- closeLabel: 'Close',
- closeButton: false
- };
- var ModalHeader = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- closeLabel = _ref.closeLabel,
- closeButton = _ref.closeButton,
- onHide = _ref.onHide,
- className = _ref.className,
- children = _ref.children,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "closeLabel", "closeButton", "onHide", "className", "children"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'modal-header');
- var context = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_ModalContext__WEBPACK_IMPORTED_MODULE_7__["default"]);
- var handleClick = Object(_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__["default"])(function () {
- if (context) context.onHide();
- if (onHide) onHide();
- });
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, props, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix)
- }), children, closeButton && react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_CloseButton__WEBPACK_IMPORTED_MODULE_6__["default"], {
- label: closeLabel,
- onClick: handleClick
- }));
- });
- ModalHeader.displayName = 'ModalHeader';
- ModalHeader.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (ModalHeader);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/ModalTitle.js":
- /*!********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/ModalTitle.js ***!
- \********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
- /* harmony import */ var _utils_divWithClassName__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/divWithClassName */ "./node_modules/react-bootstrap/esm/utils/divWithClassName.js");
-
-
- var DivStyledAsH4 = Object(_utils_divWithClassName__WEBPACK_IMPORTED_MODULE_1__["default"])('h4');
- /* harmony default export */ __webpack_exports__["default"] = (Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('modal-title', {
- Component: DivStyledAsH4
- }));
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Nav.js":
- /*!*************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Nav.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var prop_types_extra_lib_all__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types-extra/lib/all */ "./node_modules/prop-types-extra/lib/all.js");
- /* harmony import */ var prop_types_extra_lib_all__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types_extra_lib_all__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _NavbarContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./NavbarContext */ "./node_modules/react-bootstrap/esm/NavbarContext.js");
- /* harmony import */ var _CardContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./CardContext */ "./node_modules/react-bootstrap/esm/CardContext.js");
- /* harmony import */ var _AbstractNav__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./AbstractNav */ "./node_modules/react-bootstrap/esm/AbstractNav.js");
- /* harmony import */ var _NavItem__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./NavItem */ "./node_modules/react-bootstrap/esm/NavItem.js");
- /* harmony import */ var _NavLink__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./NavLink */ "./node_modules/react-bootstrap/esm/NavLink.js");
-
-
-
-
-
-
-
-
-
-
-
-
- var defaultProps = {
- justify: false,
- fill: false
- };
- var Nav = react__WEBPACK_IMPORTED_MODULE_4___default.a.forwardRef(function (uncontrolledProps, ref) {
- var _classNames;
-
- var _useUncontrolled = Object(uncontrollable__WEBPACK_IMPORTED_MODULE_5__["useUncontrolled"])(uncontrolledProps, {
- activeKey: 'onSelect'
- }),
- _useUncontrolled$as = _useUncontrolled.as,
- as = _useUncontrolled$as === void 0 ? 'div' : _useUncontrolled$as,
- bsPrefix = _useUncontrolled.bsPrefix,
- variant = _useUncontrolled.variant,
- fill = _useUncontrolled.fill,
- justify = _useUncontrolled.justify,
- navbar = _useUncontrolled.navbar,
- className = _useUncontrolled.className,
- children = _useUncontrolled.children,
- activeKey = _useUncontrolled.activeKey,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_useUncontrolled, ["as", "bsPrefix", "variant", "fill", "justify", "navbar", "className", "children", "activeKey"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_6__["useBootstrapPrefix"])(bsPrefix, 'nav');
- var navbarBsPrefix, cardHeaderBsPrefix;
- var navbarContext = Object(react__WEBPACK_IMPORTED_MODULE_4__["useContext"])(_NavbarContext__WEBPACK_IMPORTED_MODULE_7__["default"]);
- var cardContext = Object(react__WEBPACK_IMPORTED_MODULE_4__["useContext"])(_CardContext__WEBPACK_IMPORTED_MODULE_8__["default"]);
-
- if (navbarContext) {
- navbarBsPrefix = navbarContext.bsPrefix;
- navbar = navbar == null ? true : navbar;
- } else if (cardContext) {
- cardHeaderBsPrefix = cardContext.cardHeaderBsPrefix;
- }
-
- return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_AbstractNav__WEBPACK_IMPORTED_MODULE_9__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- as: as,
- ref: ref,
- activeKey: activeKey,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, (_classNames = {}, _classNames[bsPrefix] = !navbar, _classNames[navbarBsPrefix + "-nav"] = navbar, _classNames[cardHeaderBsPrefix + "-" + variant] = !!cardHeaderBsPrefix, _classNames[bsPrefix + "-" + variant] = !!variant, _classNames[bsPrefix + "-fill"] = fill, _classNames[bsPrefix + "-justified"] = justify, _classNames))
- }, props), children);
- });
- Nav.displayName = 'Nav';
- Nav.defaultProps = defaultProps;
- Nav.Item = _NavItem__WEBPACK_IMPORTED_MODULE_10__["default"];
- Nav.Link = _NavLink__WEBPACK_IMPORTED_MODULE_11__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (Nav);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/NavContext.js":
- /*!********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/NavContext.js ***!
- \********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-
- var NavContext = react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext(null);
- /* harmony default export */ __webpack_exports__["default"] = (NavContext);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/NavDropdown.js":
- /*!*********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/NavDropdown.js ***!
- \*********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _Dropdown__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Dropdown */ "./node_modules/react-bootstrap/esm/Dropdown.js");
- /* harmony import */ var _NavItem__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./NavItem */ "./node_modules/react-bootstrap/esm/NavItem.js");
- /* harmony import */ var _NavLink__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./NavLink */ "./node_modules/react-bootstrap/esm/NavLink.js");
-
-
-
-
-
-
-
-
- var NavDropdown =
- /*#__PURE__*/
- function (_React$Component) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(NavDropdown, _React$Component);
-
- function NavDropdown() {
- return _React$Component.apply(this, arguments) || this;
- }
-
- var _proto = NavDropdown.prototype;
-
- _proto.render = function render() {
- var _this$props = this.props,
- id = _this$props.id,
- title = _this$props.title,
- children = _this$props.children,
- bsPrefix = _this$props.bsPrefix,
- rootCloseEvent = _this$props.rootCloseEvent,
- menuRole = _this$props.menuRole,
- disabled = _this$props.disabled,
- active = _this$props.active,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["id", "title", "children", "bsPrefix", "rootCloseEvent", "menuRole", "disabled", "active"]);
-
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_Dropdown__WEBPACK_IMPORTED_MODULE_4__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- as: _NavItem__WEBPACK_IMPORTED_MODULE_5__["default"]
- }), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_Dropdown__WEBPACK_IMPORTED_MODULE_4__["default"].Toggle, {
- id: id,
- eventKey: null,
- active: active,
- disabled: disabled,
- childBsPrefix: bsPrefix,
- as: _NavLink__WEBPACK_IMPORTED_MODULE_6__["default"]
- }, title), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_Dropdown__WEBPACK_IMPORTED_MODULE_4__["default"].Menu, {
- role: menuRole,
- rootCloseEvent: rootCloseEvent
- }, children));
- };
-
- return NavDropdown;
- }(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component);
-
- NavDropdown.Item = _Dropdown__WEBPACK_IMPORTED_MODULE_4__["default"].Item;
- NavDropdown.Divider = _Dropdown__WEBPACK_IMPORTED_MODULE_4__["default"].Divider;
- NavDropdown.Header = _Dropdown__WEBPACK_IMPORTED_MODULE_4__["default"].Header;
- /* harmony default export */ __webpack_exports__["default"] = (NavDropdown);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/NavItem.js":
- /*!*****************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/NavItem.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
- var NavItem = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
- function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- className = _ref.className,
- children = _ref.children,
- _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'div' : _ref$as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "children", "as"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'nav-item');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- ref: ref,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix)
- }), children);
- });
- NavItem.displayName = 'NavItem';
- /* harmony default export */ __webpack_exports__["default"] = (NavItem);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/NavLink.js":
- /*!*****************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/NavLink.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _SafeAnchor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SafeAnchor */ "./node_modules/react-bootstrap/esm/SafeAnchor.js");
- /* harmony import */ var _AbstractNavItem__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./AbstractNavItem */ "./node_modules/react-bootstrap/esm/AbstractNavItem.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
-
- var defaultProps = {
- disabled: false,
- as: _SafeAnchor__WEBPACK_IMPORTED_MODULE_4__["default"]
- };
- var NavLink = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- disabled = _ref.disabled,
- className = _ref.className,
- href = _ref.href,
- eventKey = _ref.eventKey,
- onSelect = _ref.onSelect,
- as = _ref.as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "disabled", "className", "href", "eventKey", "onSelect", "as"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_6__["useBootstrapPrefix"])(bsPrefix, 'nav-link');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_AbstractNavItem__WEBPACK_IMPORTED_MODULE_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- href: href,
- ref: ref,
- eventKey: eventKey,
- as: as,
- disabled: disabled,
- onSelect: onSelect,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, disabled && 'disabled')
- }));
- });
- NavLink.displayName = 'NavLink';
- NavLink.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (NavLink);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Navbar.js":
- /*!****************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Navbar.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
- /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
- /* harmony import */ var _NavbarBrand__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./NavbarBrand */ "./node_modules/react-bootstrap/esm/NavbarBrand.js");
- /* harmony import */ var _NavbarCollapse__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./NavbarCollapse */ "./node_modules/react-bootstrap/esm/NavbarCollapse.js");
- /* harmony import */ var _NavbarToggle__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./NavbarToggle */ "./node_modules/react-bootstrap/esm/NavbarToggle.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _NavbarContext__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./NavbarContext */ "./node_modules/react-bootstrap/esm/NavbarContext.js");
- /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
-
-
-
-
-
-
-
-
-
-
-
-
- var defaultProps = {
- expand: true,
- variant: 'light',
- collapseOnSelect: false
- };
- var Navbar = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (props, ref) {
- var _useUncontrolled = Object(uncontrollable__WEBPACK_IMPORTED_MODULE_4__["useUncontrolled"])(props, {
- expanded: 'onToggle'
- }),
- bsPrefix = _useUncontrolled.bsPrefix,
- expand = _useUncontrolled.expand,
- variant = _useUncontrolled.variant,
- bg = _useUncontrolled.bg,
- fixed = _useUncontrolled.fixed,
- sticky = _useUncontrolled.sticky,
- className = _useUncontrolled.className,
- children = _useUncontrolled.children,
- _useUncontrolled$as = _useUncontrolled.as,
- Component = _useUncontrolled$as === void 0 ? 'nav' : _useUncontrolled$as,
- expanded = _useUncontrolled.expanded,
- _onToggle = _useUncontrolled.onToggle,
- onSelect = _useUncontrolled.onSelect,
- collapseOnSelect = _useUncontrolled.collapseOnSelect,
- controlledProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_useUncontrolled, ["bsPrefix", "expand", "variant", "bg", "fixed", "sticky", "className", "children", "as", "expanded", "onToggle", "onSelect", "collapseOnSelect"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_9__["useBootstrapPrefix"])(bsPrefix, 'navbar');
- var handleCollapse = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function () {
- if (onSelect) onSelect.apply(void 0, arguments);
-
- if (collapseOnSelect && expanded) {
- _onToggle(false);
- }
- }, [onSelect, collapseOnSelect, expanded, _onToggle]); // will result in some false positives but that seems better
- // than false negatives. strict `undefined` check allows explicit
- // "nulling" of the role if the user really doesn't want one
-
- if (controlledProps.role === undefined && Component !== 'nav') {
- controlledProps.role = 'navigation';
- }
-
- var expandClass = bsPrefix + "-expand";
- if (typeof expand === 'string') expandClass = expandClass + "-" + expand;
- var navbarContext = Object(react__WEBPACK_IMPORTED_MODULE_3__["useMemo"])(function () {
- return {
- onToggle: function onToggle() {
- return _onToggle(!expanded);
- },
- bsPrefix: bsPrefix,
- expanded: expanded
- };
- }, [bsPrefix, expanded, _onToggle]);
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_NavbarContext__WEBPACK_IMPORTED_MODULE_10__["default"].Provider, {
- value: navbarContext
- }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_SelectableContext__WEBPACK_IMPORTED_MODULE_11__["default"].Provider, {
- value: handleCollapse
- }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, controlledProps, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, expand && expandClass, variant && bsPrefix + "-" + variant, bg && "bg-" + bg, sticky && "sticky-" + sticky, fixed && "fixed-" + fixed)
- }), children)));
- });
- Navbar.defaultProps = defaultProps;
- Navbar.displayName = 'Navbar';
- Navbar.Brand = _NavbarBrand__WEBPACK_IMPORTED_MODULE_6__["default"];
- Navbar.Toggle = _NavbarToggle__WEBPACK_IMPORTED_MODULE_8__["default"];
- Navbar.Collapse = _NavbarCollapse__WEBPACK_IMPORTED_MODULE_7__["default"];
- Navbar.Text = Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_5__["default"])('navbar-text', {
- Component: 'span'
- });
- /* harmony default export */ __webpack_exports__["default"] = (Navbar);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/NavbarBrand.js":
- /*!*********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/NavbarBrand.js ***!
- \*********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
- var NavbarBrand = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- className = _ref.className,
- as = _ref.as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "as"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'navbar-brand');
- var Component = as || (props.href ? 'a' : 'span');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- ref: ref,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix)
- }));
- });
- NavbarBrand.displayName = 'NavbarBrand';
- /* harmony default export */ __webpack_exports__["default"] = (NavbarBrand);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/NavbarCollapse.js":
- /*!************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/NavbarCollapse.js ***!
- \************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _Collapse__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Collapse */ "./node_modules/react-bootstrap/esm/Collapse.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _NavbarContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./NavbarContext */ "./node_modules/react-bootstrap/esm/NavbarContext.js");
-
-
-
-
-
-
- var NavbarCollapse = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (_ref, ref) {
- var children = _ref.children,
- bsPrefix = _ref.bsPrefix,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["children", "bsPrefix"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'navbar-collapse');
- return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_NavbarContext__WEBPACK_IMPORTED_MODULE_5__["default"].Consumer, null, function (context) {
- return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Collapse__WEBPACK_IMPORTED_MODULE_3__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- in: !!(context && context.expanded)
- }, props), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", {
- ref: ref,
- className: bsPrefix
- }, children));
- });
- });
- NavbarCollapse.displayName = 'NavbarCollapse';
- /* harmony default export */ __webpack_exports__["default"] = (NavbarCollapse);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/NavbarContext.js":
- /*!***********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/NavbarContext.js ***!
- \***********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-
- /* harmony default export */ __webpack_exports__["default"] = (react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext(null));
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/NavbarToggle.js":
- /*!**********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/NavbarToggle.js ***!
- \**********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _NavbarContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./NavbarContext */ "./node_modules/react-bootstrap/esm/NavbarContext.js");
-
-
-
-
-
-
-
- var defaultProps = {
- label: 'Toggle navigation'
- };
- var NavbarToggle = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- className = _ref.className,
- children = _ref.children,
- label = _ref.label,
- _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'button' : _ref$as,
- onClick = _ref.onClick,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "children", "label", "as", "onClick"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'navbar-toggler');
-
- var _ref2 = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_NavbarContext__WEBPACK_IMPORTED_MODULE_6__["default"]) || {},
- onToggle = _ref2.onToggle,
- expanded = _ref2.expanded;
-
- var handleClick = Object(_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__["default"])(function (e) {
- if (onClick) onClick(e);
- if (onToggle) onToggle();
- });
-
- if (Component === 'button') {
- props.type = 'button';
- }
-
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- ref: ref,
- onClick: handleClick,
- "aria-label": label,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, !expanded && 'collapsed')
- }), children || react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
- className: bsPrefix + "-icon"
- }));
- });
- NavbarToggle.displayName = 'NavbarToggle';
- NavbarToggle.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (NavbarToggle);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Overlay.js":
- /*!*****************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Overlay.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var react_overlays_Overlay__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-overlays/Overlay */ "./node_modules/react-overlays/Overlay.js");
- /* harmony import */ var react_overlays_Overlay__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_overlays_Overlay__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var _Fade__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Fade */ "./node_modules/react-bootstrap/esm/Fade.js");
-
-
-
-
-
-
-
- var defaultProps = {
- transition: _Fade__WEBPACK_IMPORTED_MODULE_6__["default"],
- rootClose: false,
- show: false,
- placement: 'top'
- };
-
- function wrapRefs(props, arrowProps) {
- var ref = props.ref;
- var aRef = arrowProps.ref;
-
- props.ref = ref.__wrapped || (ref.__wrapped = function (r) {
- return ref(Object(react_dom__WEBPACK_IMPORTED_MODULE_3__["findDOMNode"])(r));
- });
-
- arrowProps.ref = aRef.__wrapped || (aRef.__wrapped = function (r) {
- return aRef(Object(react_dom__WEBPACK_IMPORTED_MODULE_3__["findDOMNode"])(r));
- });
- }
-
- function Overlay(_ref) {
- var overlay = _ref.children,
- transition = _ref.transition,
- outerProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["children", "transition"]);
-
- transition = transition === true ? _Fade__WEBPACK_IMPORTED_MODULE_6__["default"] : transition || null;
- return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_overlays_Overlay__WEBPACK_IMPORTED_MODULE_5___default.a, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, outerProps, {
- transition: transition
- }), function (_ref2) {
- var overlayProps = _ref2.props,
- arrowProps = _ref2.arrowProps,
- show = _ref2.show,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref2, ["props", "arrowProps", "show"]);
-
- wrapRefs(overlayProps, arrowProps);
- if (typeof overlay === 'function') return overlay(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {}, overlayProps, {
- show: show,
- arrowProps: arrowProps
- }));
- return react__WEBPACK_IMPORTED_MODULE_2___default.a.cloneElement(overlay, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {}, overlayProps, {
- arrowProps: arrowProps,
- className: classnames__WEBPACK_IMPORTED_MODULE_4___default()(overlay.props.className, !transition && show && 'show'),
- style: Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, overlay.props.style, {}, overlayProps.style)
- }));
- });
- }
-
- Overlay.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (Overlay);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/OverlayTrigger.js":
- /*!************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/OverlayTrigger.js ***!
- \************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
- /* harmony import */ var dom_helpers_query_contains__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! dom-helpers/query/contains */ "./node_modules/dom-helpers/query/contains.js");
- /* harmony import */ var dom_helpers_query_contains__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_query_contains__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! warning */ "./node_modules/warning/warning.js");
- /* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(warning__WEBPACK_IMPORTED_MODULE_6__);
- /* harmony import */ var _Overlay__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Overlay */ "./node_modules/react-bootstrap/esm/Overlay.js");
-
-
-
-
-
-
-
-
-
- var RefHolder =
- /*#__PURE__*/
- function (_React$Component) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(RefHolder, _React$Component);
-
- function RefHolder() {
- return _React$Component.apply(this, arguments) || this;
- }
-
- var _proto = RefHolder.prototype;
-
- _proto.render = function render() {
- return this.props.children;
- };
-
- return RefHolder;
- }(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component);
-
- var normalizeDelay = function normalizeDelay(delay) {
- return delay && typeof delay === 'object' ? delay : {
- show: delay,
- hide: delay
- };
- };
-
- var defaultProps = {
- defaultOverlayShown: false,
- trigger: ['hover', 'focus']
- }; // eslint-disable-next-line react/no-multi-comp
-
- var OverlayTrigger =
- /*#__PURE__*/
- function (_React$Component2) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(OverlayTrigger, _React$Component2);
-
- function OverlayTrigger(props, context) {
- var _this;
-
- _this = _React$Component2.call(this, props, context) || this;
-
- _this.getTarget = function () {
- return react_dom__WEBPACK_IMPORTED_MODULE_5___default.a.findDOMNode(_this.trigger.current);
- };
-
- _this.handleShow = function () {
- clearTimeout(_this._timeout);
- _this._hoverState = 'show';
- var delay = normalizeDelay(_this.props.delay);
-
- if (!delay.show) {
- _this.show();
-
- return;
- }
-
- _this._timeout = setTimeout(function () {
- if (_this._hoverState === 'show') _this.show();
- }, delay.show);
- };
-
- _this.handleHide = function () {
- clearTimeout(_this._timeout);
- _this._hoverState = 'hide';
- var delay = normalizeDelay(_this.props.delay);
-
- if (!delay.hide) {
- _this.hide();
-
- return;
- }
-
- _this._timeout = setTimeout(function () {
- if (_this._hoverState === 'hide') _this.hide();
- }, delay.hide);
- };
-
- _this.handleFocus = function (e) {
- var _this$getChildProps = _this.getChildProps(),
- onFocus = _this$getChildProps.onFocus;
-
- _this.handleShow(e);
-
- if (onFocus) onFocus(e);
- };
-
- _this.handleBlur = function (e) {
- var _this$getChildProps2 = _this.getChildProps(),
- onBlur = _this$getChildProps2.onBlur;
-
- _this.handleHide(e);
-
- if (onBlur) onBlur(e);
- };
-
- _this.handleClick = function (e) {
- var _this$getChildProps3 = _this.getChildProps(),
- onClick = _this$getChildProps3.onClick;
-
- if (_this.state.show) _this.hide();else _this.show();
- if (onClick) onClick(e);
- };
-
- _this.handleMouseOver = function (e) {
- _this.handleMouseOverOut(_this.handleShow, e, 'fromElement');
- };
-
- _this.handleMouseOut = function (e) {
- return _this.handleMouseOverOut(_this.handleHide, e, 'toElement');
- };
-
- _this.trigger = react__WEBPACK_IMPORTED_MODULE_4___default.a.createRef();
- _this.state = {
- show: !!props.defaultShow
- }; // We add aria-describedby in the case where the overlay is a role="tooltip"
- // for other cases describedby isn't appropriate (e.g. a popover with inputs) so we don't add it.
-
- _this.ariaModifier = {
- enabled: true,
- order: 900,
- fn: function fn(data) {
- var popper = data.instance.popper;
-
- var target = _this.getTarget();
-
- if (!_this.state.show || !target) return data;
- var role = popper.getAttribute('role') || '';
-
- if (popper.id && role.toLowerCase() === 'tooltip') {
- target.setAttribute('aria-describedby', popper.id);
- }
-
- return data;
- }
- };
- return _this;
- }
-
- var _proto2 = OverlayTrigger.prototype;
-
- _proto2.componentWillUnmount = function componentWillUnmount() {
- clearTimeout(this._timeout);
- };
-
- _proto2.getChildProps = function getChildProps() {
- return react__WEBPACK_IMPORTED_MODULE_4___default.a.Children.only(this.props.children).props;
- };
-
- // Simple implementation of mouseEnter and mouseLeave.
- // React's built version is broken: https://github.com/facebook/react/issues/4251
- // for cases when the trigger is disabled and mouseOut/Over can cause flicker
- // moving from one child element to another.
- _proto2.handleMouseOverOut = function handleMouseOverOut(handler, e, relatedNative) {
- var target = e.currentTarget;
- var related = e.relatedTarget || e.nativeEvent[relatedNative];
-
- if ((!related || related !== target) && !dom_helpers_query_contains__WEBPACK_IMPORTED_MODULE_3___default()(target, related)) {
- handler(e);
- }
- };
-
- _proto2.hide = function hide() {
- this.setState({
- show: false
- });
- };
-
- _proto2.show = function show() {
- this.setState({
- show: true
- });
- };
-
- _proto2.render = function render() {
- var _this$props = this.props,
- trigger = _this$props.trigger,
- overlay = _this$props.overlay,
- children = _this$props.children,
- _this$props$popperCon = _this$props.popperConfig,
- popperConfig = _this$props$popperCon === void 0 ? {} : _this$props$popperCon,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["trigger", "overlay", "children", "popperConfig"]);
-
- delete props.delay;
- delete props.defaultShow;
- var child = react__WEBPACK_IMPORTED_MODULE_4___default.a.Children.only(children);
- var triggerProps = {};
- var triggers = trigger == null ? [] : [].concat(trigger);
-
- if (triggers.indexOf('click') !== -1) {
- triggerProps.onClick = this.handleClick;
- }
-
- if (triggers.indexOf('focus') !== -1) {
- triggerProps.onFocus = this.handleShow;
- triggerProps.onBlur = this.handleHide;
- }
-
- if (triggers.indexOf('hover') !== -1) {
- true ? warning__WEBPACK_IMPORTED_MODULE_6___default()(triggers.length >= 1, '[react-bootstrap] Specifying only the `"hover"` trigger limits the ' + 'visibility of the overlay to just mouse users. Consider also ' + 'including the `"focus"` trigger so that touch and keyboard only ' + 'users can see the overlay as well.') : undefined;
- triggerProps.onMouseOver = this.handleMouseOver;
- triggerProps.onMouseOut = this.handleMouseOut;
- }
-
- return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_4___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(RefHolder, {
- ref: this.trigger
- }, Object(react__WEBPACK_IMPORTED_MODULE_4__["cloneElement"])(child, triggerProps)), react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_Overlay__WEBPACK_IMPORTED_MODULE_7__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- popperConfig: Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, popperConfig, {
- modifiers: Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, popperConfig.modifiers, {
- ariaModifier: this.ariaModifier
- })
- }),
- show: this.state.show,
- onHide: this.handleHide,
- target: this.getTarget
- }), overlay));
- };
-
- return OverlayTrigger;
- }(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component);
-
- OverlayTrigger.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (OverlayTrigger);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/PageItem.js":
- /*!******************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/PageItem.js ***!
- \******************************************************/
- /*! exports provided: default, First, Prev, Ellipsis, Next, Last */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return PageItem; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "First", function() { return First; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Prev", function() { return Prev; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Ellipsis", function() { return Ellipsis; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Next", function() { return Next; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Last", function() { return Last; });
- /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _SafeAnchor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SafeAnchor */ "./node_modules/react-bootstrap/esm/SafeAnchor.js");
-
-
-
-
- /* eslint-disable react/no-multi-comp */
-
-
-
- var defaultProps = {
- active: false,
- disabled: false,
- activeLabel: '(current)'
- };
- function PageItem(_ref) {
- var active = _ref.active,
- disabled = _ref.disabled,
- className = _ref.className,
- style = _ref.style,
- activeLabel = _ref.activeLabel,
- children = _ref.children,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(_ref, ["active", "disabled", "className", "style", "activeLabel", "children"]);
-
- var Component = active || disabled ? 'span' : _SafeAnchor__WEBPACK_IMPORTED_MODULE_5__["default"];
- return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("li", {
- style: style,
- className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, 'page-item', {
- active: active,
- disabled: disabled
- })
- }, react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({
- className: "page-link",
- disabled: disabled
- }, props), children, active && activeLabel && react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("span", {
- className: "sr-only"
- }, activeLabel)));
- }
- PageItem.defaultProps = defaultProps;
-
- function createButton(name, defaultValue, label) {
- var _class, _temp;
-
- if (label === void 0) {
- label = name;
- }
-
- return _temp = _class =
- /*#__PURE__*/
- function (_React$Component) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(_class, _React$Component);
-
- function _class() {
- return _React$Component.apply(this, arguments) || this;
- }
-
- var _proto = _class.prototype;
-
- _proto.render = function render() {
- var _this$props = this.props,
- children = _this$props.children,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(_this$props, ["children"]);
-
- delete props.active;
- return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(PageItem, props, react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("span", {
- "aria-hidden": "true"
- }, children || defaultValue), react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("span", {
- className: "sr-only"
- }, label));
- };
-
- return _class;
- }(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component), _class.displayName = name, _temp;
- }
-
- var First = createButton('First', '«');
- var Prev = createButton('Prev', '‹', 'Previous');
- var Ellipsis = createButton('Ellipsis', '…', 'More');
- var Next = createButton('Next', '›');
- var Last = createButton('Last', '»');
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Pagination.js":
- /*!********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Pagination.js ***!
- \********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _PageItem__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PageItem */ "./node_modules/react-bootstrap/esm/PageItem.js");
-
-
-
-
-
-
-
- /**
- * @property {PageItem} Item
- * @property {PageItem} First
- * @property {PageItem} Prev
- * @property {PageItem} Ellipsis
- * @property {PageItem} Next
- * @property {PageItem} Last
- */
-
- var Pagination =
- /*#__PURE__*/
- function (_React$Component) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(Pagination, _React$Component);
-
- function Pagination() {
- return _React$Component.apply(this, arguments) || this;
- }
-
- var _proto = Pagination.prototype;
-
- _proto.render = function render() {
- var _this$props = this.props,
- bsPrefix = _this$props.bsPrefix,
- className = _this$props.className,
- children = _this$props.children,
- size = _this$props.size,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["bsPrefix", "className", "children", "size"]);
-
- return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("ul", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, bsPrefix, size && bsPrefix + "-" + size)
- }), children);
- };
-
- return Pagination;
- }(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component);
-
- var DecoratedPagination = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["createBootstrapComponent"])(Pagination, 'pagination');
- DecoratedPagination.First = _PageItem__WEBPACK_IMPORTED_MODULE_6__["First"];
- DecoratedPagination.Prev = _PageItem__WEBPACK_IMPORTED_MODULE_6__["Prev"];
- DecoratedPagination.Ellipsis = _PageItem__WEBPACK_IMPORTED_MODULE_6__["Ellipsis"];
- DecoratedPagination.Item = _PageItem__WEBPACK_IMPORTED_MODULE_6__["default"];
- DecoratedPagination.Next = _PageItem__WEBPACK_IMPORTED_MODULE_6__["Next"];
- DecoratedPagination.Last = _PageItem__WEBPACK_IMPORTED_MODULE_6__["Last"];
- /* harmony default export */ __webpack_exports__["default"] = (DecoratedPagination);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Popover.js":
- /*!*****************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Popover.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types-extra/lib/isRequiredForA11y */ "./node_modules/prop-types-extra/lib/isRequiredForA11y.js");
- /* harmony import */ var prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _PopoverTitle__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PopoverTitle */ "./node_modules/react-bootstrap/esm/PopoverTitle.js");
- /* harmony import */ var _PopoverContent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PopoverContent */ "./node_modules/react-bootstrap/esm/PopoverContent.js");
-
-
-
-
-
-
-
-
- var defaultProps = {
- placement: 'right'
- };
-
- function Popover(_ref) {
- var bsPrefix = _ref.bsPrefix,
- innerRef = _ref.innerRef,
- placement = _ref.placement,
- className = _ref.className,
- style = _ref.style,
- children = _ref.children,
- content = _ref.content,
- arrowProps = _ref.arrowProps,
- _ = _ref.scheduleUpdate,
- _1 = _ref.outOfBoundaries,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "innerRef", "placement", "className", "style", "children", "content", "arrowProps", "scheduleUpdate", "outOfBoundaries"]);
-
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- role: "tooltip",
- ref: innerRef,
- style: style,
- "x-placement": placement,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, "bs-popover-" + placement)
- }, props), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- className: "arrow"
- }, arrowProps)), content ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_PopoverContent__WEBPACK_IMPORTED_MODULE_7__["default"], null, children) : children);
- }
-
- Popover.defaultProps = defaultProps;
- var DecoratedPopover = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["createBootstrapComponent"])(Popover, 'popover');
- DecoratedPopover.Title = _PopoverTitle__WEBPACK_IMPORTED_MODULE_6__["default"];
- DecoratedPopover.Content = _PopoverContent__WEBPACK_IMPORTED_MODULE_7__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (DecoratedPopover);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/PopoverContent.js":
- /*!************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/PopoverContent.js ***!
- \************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
- var PopoverContent = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'div' : _ref$as,
- bsPrefix = _ref.bsPrefix,
- className = _ref.className,
- children = _ref.children,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["as", "bsPrefix", "className", "children"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'popover-body');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, props, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix)
- }), children);
- });
- /* harmony default export */ __webpack_exports__["default"] = (PopoverContent);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/PopoverTitle.js":
- /*!**********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/PopoverTitle.js ***!
- \**********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
- var PopoverTitle = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'div' : _ref$as,
- bsPrefix = _ref.bsPrefix,
- className = _ref.className,
- children = _ref.children,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["as", "bsPrefix", "className", "children"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'popover-header');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, props, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(bsPrefix, className)
- }), children);
- });
- /* harmony default export */ __webpack_exports__["default"] = (PopoverTitle);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/ProgressBar.js":
- /*!*********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/ProgressBar.js ***!
- \*********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _utils_ElementChildren__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/ElementChildren */ "./node_modules/react-bootstrap/esm/utils/ElementChildren.js");
-
-
-
-
-
-
- var ROUND_PRECISION = 1000;
- /**
- * Validate that children, if any, are instances of `<ProgressBar>`.
- */
-
- function onlyProgressBar(props, propName, componentName) {
- var children = props[propName];
-
- if (!children) {
- return null;
- }
-
- var error = null;
- react__WEBPACK_IMPORTED_MODULE_3___default.a.Children.forEach(children, function (child) {
- if (error) {
- return;
- }
- /**
- * Compare types in a way that works with libraries that patch and proxy
- * components like react-hot-loader.
- *
- * see https://github.com/gaearon/react-hot-loader#checking-element-types
- */
-
-
- var element = react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ProgressBar, null);
- if (child.type === element.type) return;
- var childIdentifier = react__WEBPACK_IMPORTED_MODULE_3___default.a.isValidElement(child) ? child.type.displayName || child.type.name || child.type : child;
- error = new Error("Children of " + componentName + " can contain only ProgressBar " + ("components. Found " + childIdentifier + "."));
- });
- return error;
- }
-
- var defaultProps = {
- min: 0,
- max: 100,
- animated: false,
- isChild: false,
- srOnly: false,
- striped: false
- };
-
- function getPercentage(now, min, max) {
- var percentage = (now - min) / (max - min) * 100;
- return Math.round(percentage * ROUND_PRECISION) / ROUND_PRECISION;
- }
-
- function renderProgressBar(_ref, ref) {
- var _classNames;
-
- var min = _ref.min,
- now = _ref.now,
- max = _ref.max,
- label = _ref.label,
- srOnly = _ref.srOnly,
- striped = _ref.striped,
- animated = _ref.animated,
- className = _ref.className,
- style = _ref.style,
- variant = _ref.variant,
- bsPrefix = _ref.bsPrefix,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["min", "now", "max", "label", "srOnly", "striped", "animated", "className", "style", "variant", "bsPrefix"]);
-
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, props, {
- role: "progressbar",
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix + "-bar", (_classNames = {}, _classNames["bg-" + variant] = variant, _classNames[bsPrefix + "-bar-animated"] = animated, _classNames[bsPrefix + "-bar-striped"] = animated || striped, _classNames)),
- style: Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- width: getPercentage(now, min, max) + "%"
- }, style),
- "aria-valuenow": now,
- "aria-valuemin": min,
- "aria-valuemax": max
- }), srOnly ? react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("span", {
- className: "sr-only"
- }, label) : label);
- }
-
- var ProgressBar = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref2, ref) {
- var isChild = _ref2.isChild,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref2, ["isChild"]);
-
- props.bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(props.bsPrefix, 'progress');
-
- if (isChild) {
- return renderProgressBar(props, ref);
- }
-
- var min = props.min,
- now = props.now,
- max = props.max,
- label = props.label,
- srOnly = props.srOnly,
- striped = props.striped,
- animated = props.animated,
- bsPrefix = props.bsPrefix,
- variant = props.variant,
- className = props.className,
- children = props.children,
- wrapperProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(props, ["min", "now", "max", "label", "srOnly", "striped", "animated", "bsPrefix", "variant", "className", "children"]);
-
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, wrapperProps, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix)
- }), children ? Object(_utils_ElementChildren__WEBPACK_IMPORTED_MODULE_5__["map"])(children, function (child) {
- return Object(react__WEBPACK_IMPORTED_MODULE_3__["cloneElement"])(child, {
- isChild: true
- });
- }) : renderProgressBar({
- min: min,
- now: now,
- max: max,
- label: label,
- srOnly: srOnly,
- striped: striped,
- animated: animated,
- bsPrefix: bsPrefix,
- variant: variant
- }, ref));
- });
- ProgressBar.displayName = 'ProgressBar';
- ProgressBar.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (ProgressBar);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/ResponsiveEmbed.js":
- /*!*************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/ResponsiveEmbed.js ***!
- \*************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
- var defaultProps = {
- aspectRatio: '1by1'
- };
-
- var ResponsiveEmbed =
- /*#__PURE__*/
- function (_React$Component) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(ResponsiveEmbed, _React$Component);
-
- function ResponsiveEmbed() {
- return _React$Component.apply(this, arguments) || this;
- }
-
- var _proto = ResponsiveEmbed.prototype;
-
- _proto.render = function render() {
- var _this$props = this.props,
- bsPrefix = _this$props.bsPrefix,
- className = _this$props.className,
- children = _this$props.children,
- aspectRatio = _this$props.aspectRatio,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["bsPrefix", "className", "children", "aspectRatio"]);
-
- var child = react__WEBPACK_IMPORTED_MODULE_4___default.a.Children.only(children);
- return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(bsPrefix, className, aspectRatio && bsPrefix + "-" + aspectRatio)
- }), react__WEBPACK_IMPORTED_MODULE_4___default.a.cloneElement(child, {
- className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(child.props.className, bsPrefix + "-item")
- }));
- };
-
- return ResponsiveEmbed;
- }(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component);
-
- ResponsiveEmbed.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["createBootstrapComponent"])(ResponsiveEmbed, 'embed-responsive'));
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Row.js":
- /*!*************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Row.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
- var defaultProps = {
- noGutters: false
- };
- var Row = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (props, ref) {
- var bsPrefix = props.bsPrefix,
- noGutters = props.noGutters,
- _props$as = props.as,
- Component = _props$as === void 0 ? 'div' : _props$as,
- className = props.className,
- otherProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(props, ["bsPrefix", "noGutters", "as", "className"]);
-
- var decoratedBsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'row');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, otherProps, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, decoratedBsPrefix, noGutters && 'no-gutters')
- }));
- });
- Row.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (Row);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/SafeAnchor.js":
- /*!********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/SafeAnchor.js ***!
- \********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/createChainedFunction */ "./node_modules/react-bootstrap/esm/utils/createChainedFunction.js");
-
-
-
-
-
- function isTrivialHref(href) {
- return !href || href.trim() === '#';
- }
- /**
- * There are situations due to browser quirks or Bootstrap CSS where
- * an anchor tag is needed, when semantically a button tag is the
- * better choice. SafeAnchor ensures that when an anchor is used like a
- * button its accessible. It also emulates input `disabled` behavior for
- * links, which is usually desirable for Buttons, NavItems, DropdownItems, etc.
- */
-
-
- var SafeAnchor = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (_ref, ref) {
- var _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'a' : _ref$as,
- disabled = _ref.disabled,
- onKeyDown = _ref.onKeyDown,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["as", "disabled", "onKeyDown"]);
-
- var handleClick = function handleClick(event) {
- var href = props.href,
- onClick = props.onClick;
-
- if (disabled || isTrivialHref(href)) {
- event.preventDefault();
- }
-
- if (disabled) {
- event.stopPropagation();
- return;
- }
-
- if (onClick) {
- onClick(event);
- }
- };
-
- var handleKeyDown = function handleKeyDown(event) {
- if (event.key === ' ') {
- event.preventDefault();
- handleClick(event);
- }
- };
-
- if (isTrivialHref(props.href)) {
- props.role = props.role || 'button'; // we want to make sure there is a href attribute on the node
- // otherwise, the cursor incorrectly styled (except with role='button')
-
- props.href = props.href || '#';
- }
-
- if (disabled) {
- props.tabIndex = -1;
- props['aria-disabled'] = true;
- }
-
- return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, props, {
- onClick: handleClick,
- onKeyDown: Object(_utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_3__["default"])(handleKeyDown, onKeyDown)
- }));
- });
- SafeAnchor.displayName = 'SafeAnchor';
- /* harmony default export */ __webpack_exports__["default"] = (SafeAnchor);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/SelectableContext.js":
- /*!***************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/SelectableContext.js ***!
- \***************************************************************/
- /*! exports provided: makeEventKey, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeEventKey", function() { return makeEventKey; });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-
- var SelectableContext = react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext();
- var makeEventKey = function makeEventKey(eventKey, href) {
- if (eventKey != null) return String(eventKey);
- return href || null;
- };
- /* harmony default export */ __webpack_exports__["default"] = (SelectableContext);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Spinner.js":
- /*!*****************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Spinner.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
- var Spinner = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- variant = _ref.variant,
- animation = _ref.animation,
- size = _ref.size,
- children = _ref.children,
- _ref$as = _ref.as,
- Component = _ref$as === void 0 ? 'div' : _ref$as,
- className = _ref.className,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "variant", "animation", "size", "children", "as", "className"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'spinner');
- var bsSpinnerPrefix = bsPrefix + "-" + animation;
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, props, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsSpinnerPrefix, size && bsSpinnerPrefix + "-" + size, variant && "text-" + variant)
- }), children);
- });
- Spinner.displayName = 'Spinner';
- /* harmony default export */ __webpack_exports__["default"] = (Spinner);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/SplitButton.js":
- /*!*********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/SplitButton.js ***!
- \*********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _Button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Button */ "./node_modules/react-bootstrap/esm/Button.js");
- /* harmony import */ var _ButtonGroup__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ButtonGroup */ "./node_modules/react-bootstrap/esm/ButtonGroup.js");
- /* harmony import */ var _Dropdown__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Dropdown */ "./node_modules/react-bootstrap/esm/Dropdown.js");
-
-
-
-
-
-
-
- var propTypes = {
- /**
- * An html id attribute for the Toggle button, necessary for assistive technologies, such as screen readers.
- * @type {string|number}
- * @required
- */
- id: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.any,
-
- /**
- * Accessible label for the toggle; the value of `title` if not specified.
- */
- toggleLabel: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
-
- /** An `href` passed to the non-toggle Button */
- href: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
-
- /** An anchor `target` passed to the non-toggle Button */
- target: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
-
- /** An `onClick` handler passed to the non-toggle Button */
- onClick: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.func,
-
- /** The content of the non-toggle Button. */
- title: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.node.isRequired,
-
- /** Disables both Buttons */
- disabled: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.bool,
-
- /** An ARIA accessible role applied to the Menu component. When set to 'menu', The dropdown */
- menuRole: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
-
- /**
- * Which event when fired outside the component will cause it to be closed.
- *
- * _see [DropdownMenu](#menu-props) for more details_
- */
- rootCloseEvent: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
-
- /** @ignore */
- bsPrefix: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
-
- /** @ignore */
- variant: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string,
-
- /** @ignore */
- size: prop_types__WEBPACK_IMPORTED_MODULE_3___default.a.string
- };
- var defaultProps = {
- toggleLabel: 'Toggle dropdown'
- };
- var SplitButton = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (_ref, ref) {
- var id = _ref.id,
- bsPrefix = _ref.bsPrefix,
- size = _ref.size,
- variant = _ref.variant,
- title = _ref.title,
- toggleLabel = _ref.toggleLabel,
- children = _ref.children,
- onClick = _ref.onClick,
- href = _ref.href,
- target = _ref.target,
- menuRole = _ref.menuRole,
- rootCloseEvent = _ref.rootCloseEvent,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["id", "bsPrefix", "size", "variant", "title", "toggleLabel", "children", "onClick", "href", "target", "menuRole", "rootCloseEvent"]);
-
- return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Dropdown__WEBPACK_IMPORTED_MODULE_6__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, props, {
- as: _ButtonGroup__WEBPACK_IMPORTED_MODULE_5__["default"]
- }), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Button__WEBPACK_IMPORTED_MODULE_4__["default"], {
- size: size,
- variant: variant,
- disabled: props.disabled,
- bsPrefix: bsPrefix,
- href: href,
- target: target,
- onClick: onClick
- }, title), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Dropdown__WEBPACK_IMPORTED_MODULE_6__["default"].Toggle, {
- split: true,
- id: id,
- size: size,
- variant: variant,
- disabled: props.disabled,
- childBsPrefix: bsPrefix
- }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("span", {
- className: "sr-only"
- }, toggleLabel)), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Dropdown__WEBPACK_IMPORTED_MODULE_6__["default"].Menu, {
- role: menuRole,
- rootCloseEvent: rootCloseEvent
- }, children));
- });
- SplitButton.propTypes = propTypes;
- SplitButton.defaultProps = defaultProps;
- SplitButton.displayName = 'SplitButton';
- /* harmony default export */ __webpack_exports__["default"] = (SplitButton);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Switch.js":
- /*!****************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Switch.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _FormCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./FormCheck */ "./node_modules/react-bootstrap/esm/FormCheck.js");
-
-
-
- var Switch = react__WEBPACK_IMPORTED_MODULE_1___default.a.forwardRef(function (props, ref) {
- return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(_FormCheck__WEBPACK_IMPORTED_MODULE_2__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- ref: ref,
- type: "switch"
- }));
- });
- Switch.displayName = 'Switch';
- Switch.Input = _FormCheck__WEBPACK_IMPORTED_MODULE_2__["default"].Input;
- Switch.Label = _FormCheck__WEBPACK_IMPORTED_MODULE_2__["default"].Label;
- /* harmony default export */ __webpack_exports__["default"] = (Switch);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Tab.js":
- /*!*************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Tab.js ***!
- \*************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _TabContainer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TabContainer */ "./node_modules/react-bootstrap/esm/TabContainer.js");
- /* harmony import */ var _TabContent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./TabContent */ "./node_modules/react-bootstrap/esm/TabContent.js");
- /* harmony import */ var _TabPane__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./TabPane */ "./node_modules/react-bootstrap/esm/TabPane.js");
-
-
-
-
-
- /* eslint-disable react/require-render-return, react/no-unused-prop-types */
-
- var Tab =
- /*#__PURE__*/
- function (_React$Component) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(Tab, _React$Component);
-
- function Tab() {
- return _React$Component.apply(this, arguments) || this;
- }
-
- var _proto = Tab.prototype;
-
- _proto.render = function render() {
- throw new Error('ReactBootstrap: The `Tab` component is not meant to be rendered! ' + "It's an abstract component that is only valid as a direct Child of the `Tabs` Component. " + 'For custom tabs components use TabPane and TabsContainer directly');
- };
-
- return Tab;
- }(react__WEBPACK_IMPORTED_MODULE_1___default.a.Component);
-
- Tab.Container = _TabContainer__WEBPACK_IMPORTED_MODULE_2__["default"];
- Tab.Content = _TabContent__WEBPACK_IMPORTED_MODULE_3__["default"];
- Tab.Pane = _TabPane__WEBPACK_IMPORTED_MODULE_4__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (Tab);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/TabContainer.js":
- /*!**********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/TabContainer.js ***!
- \**********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
- /* harmony import */ var _TabContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TabContext */ "./node_modules/react-bootstrap/esm/TabContext.js");
- /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
-
-
-
-
- /* eslint-disable react/no-unused-prop-types */
-
- var TabContainer = function TabContainer(props) {
- var _useUncontrolled = Object(uncontrollable__WEBPACK_IMPORTED_MODULE_1__["useUncontrolled"])(props, {
- activeKey: 'onSelect'
- }),
- id = _useUncontrolled.id,
- generateCustomChildId = _useUncontrolled.generateChildId,
- onSelect = _useUncontrolled.onSelect,
- activeKey = _useUncontrolled.activeKey,
- transition = _useUncontrolled.transition,
- mountOnEnter = _useUncontrolled.mountOnEnter,
- unmountOnExit = _useUncontrolled.unmountOnExit,
- children = _useUncontrolled.children;
-
- var generateChildId = Object(react__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(function () {
- return generateCustomChildId || function (key, type) {
- return id ? id + "-" + type + "-" + key : null;
- };
- }, [id, generateCustomChildId]);
- var tabContext = Object(react__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(function () {
- return {
- onSelect: onSelect,
- activeKey: activeKey,
- transition: transition,
- mountOnEnter: mountOnEnter,
- unmountOnExit: unmountOnExit,
- getControlledId: function getControlledId(key) {
- return generateChildId(key, 'tabpane');
- },
- getControllerId: function getControllerId(key) {
- return generateChildId(key, 'tab');
- }
- };
- }, [onSelect, activeKey, transition, mountOnEnter, unmountOnExit, generateChildId]);
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_TabContext__WEBPACK_IMPORTED_MODULE_2__["default"].Provider, {
- value: tabContext
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_SelectableContext__WEBPACK_IMPORTED_MODULE_3__["default"].Provider, {
- value: onSelect
- }, children));
- };
-
- /* harmony default export */ __webpack_exports__["default"] = (TabContainer);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/TabContent.js":
- /*!********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/TabContent.js ***!
- \********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
-
- var TabContent =
- /*#__PURE__*/
- function (_React$Component) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(TabContent, _React$Component);
-
- function TabContent() {
- return _React$Component.apply(this, arguments) || this;
- }
-
- var _proto = TabContent.prototype;
-
- _proto.render = function render() {
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
- var _this$props = this.props,
- bsPrefix = _this$props.bsPrefix,
- _this$props$as = _this$props.as,
- Component = _this$props$as === void 0 ? 'div' : _this$props$as,
- className = _this$props.className,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["bsPrefix", "as", "className"]);
-
- return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, bsPrefix)
- }));
- };
-
- return TabContent;
- }(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component);
-
- /* harmony default export */ __webpack_exports__["default"] = (Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["createBootstrapComponent"])(TabContent, 'tab-content'));
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/TabContext.js":
- /*!********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/TabContext.js ***!
- \********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-
- var TabContext = react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext(null);
- /* harmony default export */ __webpack_exports__["default"] = (TabContext);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/TabPane.js":
- /*!*****************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/TabPane.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _TabContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./TabContext */ "./node_modules/react-bootstrap/esm/TabContext.js");
- /* harmony import */ var _SelectableContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SelectableContext */ "./node_modules/react-bootstrap/esm/SelectableContext.js");
- /* harmony import */ var _Fade__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Fade */ "./node_modules/react-bootstrap/esm/Fade.js");
-
-
-
-
-
-
-
-
-
- function useTabContext(props) {
- var context = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_TabContext__WEBPACK_IMPORTED_MODULE_5__["default"]);
- if (!context) return props;
-
- var activeKey = context.activeKey,
- getControlledId = context.getControlledId,
- getControllerId = context.getControllerId,
- rest = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(context, ["activeKey", "getControlledId", "getControllerId"]);
-
- var shouldTransition = props.transition !== false && rest.transition !== false;
- var key = Object(_SelectableContext__WEBPACK_IMPORTED_MODULE_6__["makeEventKey"])(props.eventKey);
- return Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- active: props.active == null && key != null ? Object(_SelectableContext__WEBPACK_IMPORTED_MODULE_6__["makeEventKey"])(activeKey) === key : props.active,
- id: getControlledId(props.eventKey),
- 'aria-labelledby': getControllerId(props.eventKey),
- transition: shouldTransition && (props.transition || rest.transition || _Fade__WEBPACK_IMPORTED_MODULE_7__["default"]),
- mountOnEnter: props.mountOnEnter != null ? props.mountOnEnter : rest.mountOnEnter,
- unmountOnExit: props.unmountOnExit != null ? props.unmountOnExit : rest.unmountOnExit
- });
- }
-
- var TabPane = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (props, ref) {
- var _useTabContext = useTabContext(props),
- bsPrefix = _useTabContext.bsPrefix,
- className = _useTabContext.className,
- active = _useTabContext.active,
- onEnter = _useTabContext.onEnter,
- onEntering = _useTabContext.onEntering,
- onEntered = _useTabContext.onEntered,
- onExit = _useTabContext.onExit,
- onExiting = _useTabContext.onExiting,
- onExited = _useTabContext.onExited,
- mountOnEnter = _useTabContext.mountOnEnter,
- unmountOnExit = _useTabContext.unmountOnExit,
- Transition = _useTabContext.transition,
- _useTabContext$as = _useTabContext.as,
- Component = _useTabContext$as === void 0 ? 'div' : _useTabContext$as,
- _ = _useTabContext.eventKey,
- rest = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_useTabContext, ["bsPrefix", "className", "active", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "mountOnEnter", "unmountOnExit", "transition", "as", "eventKey"]);
-
- var prefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_4__["useBootstrapPrefix"])(bsPrefix, 'tab-pane');
- if (!active && unmountOnExit) return null;
- var pane = react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, rest, {
- ref: ref,
- role: "tabpanel",
- "aria-hidden": !active,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, prefix, {
- active: active
- })
- }));
- if (Transition) pane = react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Transition, {
- in: active,
- onEnter: onEnter,
- onEntering: onEntering,
- onEntered: onEntered,
- onExit: onExit,
- onExiting: onExiting,
- onExited: onExited,
- mountOnEnter: mountOnEnter,
- unmountOnExit: unmountOnExit
- }, pane); // We provide an empty the TabContext so `<Nav>`s in `<TabPane>`s don't
- // conflict with the top level one.
-
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_TabContext__WEBPACK_IMPORTED_MODULE_5__["default"].Provider, {
- value: null
- }, react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_SelectableContext__WEBPACK_IMPORTED_MODULE_6__["default"].Provider, {
- value: null
- }, pane));
- });
- TabPane.displayName = 'TabPane';
- /* harmony default export */ __webpack_exports__["default"] = (TabPane);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Table.js":
- /*!***************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Table.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
-
- var Table =
- /*#__PURE__*/
- function (_React$Component) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(Table, _React$Component);
-
- function Table() {
- return _React$Component.apply(this, arguments) || this;
- }
-
- var _proto = Table.prototype;
-
- _proto.render = function render() {
- var _this$props = this.props,
- bsPrefix = _this$props.bsPrefix,
- className = _this$props.className,
- striped = _this$props.striped,
- bordered = _this$props.bordered,
- borderless = _this$props.borderless,
- hover = _this$props.hover,
- size = _this$props.size,
- variant = _this$props.variant,
- responsive = _this$props.responsive,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["bsPrefix", "className", "striped", "bordered", "borderless", "hover", "size", "variant", "responsive"]);
-
- var classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()(bsPrefix, className, variant && bsPrefix + "-" + variant, size && bsPrefix + "-" + size, striped && bsPrefix + "-striped", bordered && bsPrefix + "-bordered", borderless && bsPrefix + "-borderless", hover && bsPrefix + "-hover");
- var table = react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("table", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- className: classes
- }));
-
- if (responsive) {
- var responsiveClass = bsPrefix + "-responsive";
-
- if (typeof responsive === 'string') {
- responsiveClass = responsiveClass + "-" + responsive;
- }
-
- return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("div", {
- className: responsiveClass
- }, table);
- }
-
- return table;
- };
-
- return Table;
- }(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component);
-
- /* harmony default export */ __webpack_exports__["default"] = (Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["createBootstrapComponent"])(Table, 'table'));
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Tabs.js":
- /*!**************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Tabs.js ***!
- \**************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types-extra/lib/isRequiredForA11y */ "./node_modules/prop-types-extra/lib/isRequiredForA11y.js");
- /* harmony import */ var prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
- /* harmony import */ var _Nav__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Nav */ "./node_modules/react-bootstrap/esm/Nav.js");
- /* harmony import */ var _NavLink__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./NavLink */ "./node_modules/react-bootstrap/esm/NavLink.js");
- /* harmony import */ var _NavItem__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./NavItem */ "./node_modules/react-bootstrap/esm/NavItem.js");
- /* harmony import */ var _TabContainer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./TabContainer */ "./node_modules/react-bootstrap/esm/TabContainer.js");
- /* harmony import */ var _TabContent__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./TabContent */ "./node_modules/react-bootstrap/esm/TabContent.js");
- /* harmony import */ var _TabPane__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./TabPane */ "./node_modules/react-bootstrap/esm/TabPane.js");
- /* harmony import */ var _utils_ElementChildren__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils/ElementChildren */ "./node_modules/react-bootstrap/esm/utils/ElementChildren.js");
-
-
-
-
-
-
-
-
-
-
-
-
- var defaultProps = {
- variant: 'tabs',
- mountOnEnter: false,
- unmountOnExit: false
- };
-
- function getDefaultActiveKey(children) {
- var defaultActiveKey;
- Object(_utils_ElementChildren__WEBPACK_IMPORTED_MODULE_11__["forEach"])(children, function (child) {
- if (defaultActiveKey == null) {
- defaultActiveKey = child.props.eventKey;
- }
- });
- return defaultActiveKey;
- }
-
- function renderTab(child) {
- var _child$props = child.props,
- title = _child$props.title,
- eventKey = _child$props.eventKey,
- disabled = _child$props.disabled,
- tabClassName = _child$props.tabClassName;
-
- if (title == null) {
- return null;
- }
-
- return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_NavItem__WEBPACK_IMPORTED_MODULE_7__["default"], {
- as: _NavLink__WEBPACK_IMPORTED_MODULE_6__["default"],
- eventKey: eventKey,
- disabled: disabled,
- className: tabClassName
- }, title);
- }
-
- var Tabs = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (props, ref) {
- var _useUncontrolled = Object(uncontrollable__WEBPACK_IMPORTED_MODULE_4__["useUncontrolled"])(props, {
- activeKey: 'onSelect'
- }),
- id = _useUncontrolled.id,
- onSelect = _useUncontrolled.onSelect,
- transition = _useUncontrolled.transition,
- mountOnEnter = _useUncontrolled.mountOnEnter,
- unmountOnExit = _useUncontrolled.unmountOnExit,
- children = _useUncontrolled.children,
- _useUncontrolled$acti = _useUncontrolled.activeKey,
- activeKey = _useUncontrolled$acti === void 0 ? getDefaultActiveKey(children) : _useUncontrolled$acti,
- controlledProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_useUncontrolled, ["id", "onSelect", "transition", "mountOnEnter", "unmountOnExit", "children", "activeKey"]);
-
- return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_TabContainer__WEBPACK_IMPORTED_MODULE_8__["default"], {
- ref: ref,
- id: id,
- activeKey: activeKey,
- onSelect: onSelect,
- transition: transition,
- mountOnEnter: mountOnEnter,
- unmountOnExit: unmountOnExit
- }, react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_Nav__WEBPACK_IMPORTED_MODULE_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, controlledProps, {
- role: "tablist",
- as: "nav"
- }), Object(_utils_ElementChildren__WEBPACK_IMPORTED_MODULE_11__["map"])(children, renderTab)), react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_TabContent__WEBPACK_IMPORTED_MODULE_9__["default"], null, Object(_utils_ElementChildren__WEBPACK_IMPORTED_MODULE_11__["map"])(children, function (child) {
- var childProps = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, child.props);
-
- delete childProps.title;
- delete childProps.disabled;
- delete childProps.tabClassName;
- return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_TabPane__WEBPACK_IMPORTED_MODULE_10__["default"], childProps);
- })));
- });
- Tabs.defaultProps = defaultProps;
- Tabs.displayName = 'Tabs';
- /* harmony default export */ __webpack_exports__["default"] = (Tabs);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/ThemeProvider.js":
- /*!***********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/ThemeProvider.js ***!
- \***********************************************************/
- /*! exports provided: useBootstrapPrefix, createBootstrapComponent, ThemeConsumer, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useBootstrapPrefix", function() { return useBootstrapPrefix; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createBootstrapComponent", function() { return createBootstrapComponent; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ThemeConsumer", function() { return Consumer; });
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _restart_context_forwardRef__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @restart/context/forwardRef */ "./node_modules/@restart/context/forwardRef.js");
- /* harmony import */ var _restart_context_forwardRef__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_restart_context_forwardRef__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
-
-
-
- var ThemeContext = react__WEBPACK_IMPORTED_MODULE_2___default.a.createContext({});
- var Consumer = ThemeContext.Consumer,
- Provider = ThemeContext.Provider;
-
- function ThemeProvider(_ref) {
- var prefixes = _ref.prefixes,
- children = _ref.children;
- var copiedPrefixes = Object(react__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () {
- return Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, prefixes);
- }, [prefixes]);
- return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(Provider, {
- value: copiedPrefixes
- }, children);
- }
-
- function useBootstrapPrefix(prefix, defaultPrefix) {
- var prefixes = Object(react__WEBPACK_IMPORTED_MODULE_2__["useContext"])(ThemeContext);
- return prefix || prefixes[defaultPrefix] || defaultPrefix;
- }
-
- function createBootstrapComponent(Component, opts) {
- if (typeof opts === 'string') opts = {
- prefix: opts
- };
- var isClassy = Component.prototype && Component.prototype.isReactComponent; // If it's a functional component make sure we don't break it with a ref
-
- var _opts = opts,
- prefix = _opts.prefix,
- _opts$forwardRefAs = _opts.forwardRefAs,
- forwardRefAs = _opts$forwardRefAs === void 0 ? isClassy ? 'ref' : 'innerRef' : _opts$forwardRefAs;
- return _restart_context_forwardRef__WEBPACK_IMPORTED_MODULE_1___default()(function (_ref2, ref) {
- var props = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, _ref2);
-
- props[forwardRefAs] = ref; // eslint-disable-next-line react/prop-types
-
- var bsPrefix = useBootstrapPrefix(props.bsPrefix, prefix);
- return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- bsPrefix: bsPrefix
- }));
- }, {
- displayName: "Bootstrap(" + (Component.displayName || Component.name) + ")"
- });
- }
-
-
- /* harmony default export */ __webpack_exports__["default"] = (ThemeProvider);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Toast.js":
- /*!***************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Toast.js ***!
- \***************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _restart_hooks_useTimeout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @restart/hooks/useTimeout */ "./node_modules/@restart/hooks/esm/useTimeout.js");
- /* harmony import */ var _Fade__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Fade */ "./node_modules/react-bootstrap/esm/Fade.js");
- /* harmony import */ var _ToastHeader__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ToastHeader */ "./node_modules/react-bootstrap/esm/ToastHeader.js");
- /* harmony import */ var _ToastBody__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ToastBody */ "./node_modules/react-bootstrap/esm/ToastBody.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _ToastContext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ToastContext */ "./node_modules/react-bootstrap/esm/ToastContext.js");
-
-
-
-
-
-
-
-
-
-
- var defaultProps = {
- animation: true,
- autohide: false,
- delay: 3000,
- show: true,
- transition: _Fade__WEBPACK_IMPORTED_MODULE_5__["default"]
- };
- var Toast = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- className = _ref.className,
- children = _ref.children,
- Transition = _ref.transition,
- show = _ref.show,
- animation = _ref.animation,
- delay = _ref.delay,
- autohide = _ref.autohide,
- onClose = _ref.onClose,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "className", "children", "transition", "show", "animation", "delay", "autohide", "onClose"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_8__["useBootstrapPrefix"])('toast');
- var delayRef = Object(react__WEBPACK_IMPORTED_MODULE_2__["useRef"])(delay);
- var onCloseRef = Object(react__WEBPACK_IMPORTED_MODULE_2__["useRef"])(onClose);
- Object(react__WEBPACK_IMPORTED_MODULE_2__["useEffect"])(function () {
- // We use refs for these, because we don't want to restart the autohide
- // timer in case these values change.
- delayRef.current = delay;
- onCloseRef.current = onClose;
- }, [delay, onClose]);
- var autohideTimeout = Object(_restart_hooks_useTimeout__WEBPACK_IMPORTED_MODULE_4__["default"])();
- var autohideFunc = Object(react__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function () {
- if (!(autohide && show)) {
- return;
- }
-
- onCloseRef.current();
- }, [autohide, show]);
- autohideTimeout.set(autohideFunc, delayRef.current);
- var useAnimation = Object(react__WEBPACK_IMPORTED_MODULE_2__["useMemo"])(function () {
- return Transition && animation;
- }, [Transition, animation]);
- var toast = react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- ref: ref,
- className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(bsPrefix, className, !useAnimation && show && 'show'),
- role: "alert",
- "aria-live": "assertive",
- "aria-atomic": "true"
- }), children);
- var toastContext = {
- onClose: onClose
- };
- return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(_ToastContext__WEBPACK_IMPORTED_MODULE_9__["default"].Provider, {
- value: toastContext
- }, useAnimation ? react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(Transition, {
- in: show
- }, toast) : toast);
- });
- Toast.defaultProps = defaultProps;
- Toast.displayName = 'Toast';
- Toast.Body = _ToastBody__WEBPACK_IMPORTED_MODULE_7__["default"];
- Toast.Header = _ToastHeader__WEBPACK_IMPORTED_MODULE_6__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (Toast);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/ToastBody.js":
- /*!*******************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/ToastBody.js ***!
- \*******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/createWithBsPrefix */ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js");
-
- /* harmony default export */ __webpack_exports__["default"] = (Object(_utils_createWithBsPrefix__WEBPACK_IMPORTED_MODULE_0__["default"])('toast-body'));
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/ToastContext.js":
- /*!**********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/ToastContext.js ***!
- \**********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-
- var ToastContext = react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext({
- onClose: function onClose() {}
- });
- /* harmony default export */ __webpack_exports__["default"] = (ToastContext);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/ToastHeader.js":
- /*!*********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/ToastHeader.js ***!
- \*********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @restart/hooks/useEventCallback */ "./node_modules/@restart/hooks/esm/useEventCallback.js");
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony import */ var _CloseButton__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./CloseButton */ "./node_modules/react-bootstrap/esm/CloseButton.js");
- /* harmony import */ var _ToastContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ToastContext */ "./node_modules/react-bootstrap/esm/ToastContext.js");
-
-
-
-
-
-
-
-
- var defaultProps = {
- closeLabel: 'Close',
- closeButton: true
- };
- var ToastHeader = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- closeLabel = _ref.closeLabel,
- closeButton = _ref.closeButton,
- className = _ref.className,
- children = _ref.children,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "closeLabel", "closeButton", "className", "children"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'toast-header');
- var context = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_ToastContext__WEBPACK_IMPORTED_MODULE_7__["default"]);
- var handleClick = Object(_restart_hooks_useEventCallback__WEBPACK_IMPORTED_MODULE_4__["default"])(function () {
- if (context) {
- context.onClose();
- }
- });
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref
- }, props, {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(bsPrefix, className)
- }), children, closeButton && react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_CloseButton__WEBPACK_IMPORTED_MODULE_6__["default"], {
- label: closeLabel,
- onClick: handleClick,
- className: "ml-2 mb-1",
- "data-dismiss": "toast"
- }));
- });
- ToastHeader.displayName = 'ToastHeader';
- ToastHeader.defaultProps = defaultProps;
- /* harmony default export */ __webpack_exports__["default"] = (ToastHeader);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/ToggleButton.js":
- /*!**********************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/ToggleButton.js ***!
- \**********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _Button__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Button */ "./node_modules/react-bootstrap/esm/Button.js");
-
-
-
-
-
-
-
- var noop = function noop() {};
-
- var ToggleButton =
- /*#__PURE__*/
- function (_React$Component) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(ToggleButton, _React$Component);
-
- function ToggleButton() {
- var _this;
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
- _this.state = {
- focused: false
- };
-
- _this.handleFocus = function (e) {
- if (e.target.tagName === 'INPUT') _this.setState({
- focused: true
- });
- };
-
- _this.handleBlur = function (e) {
- if (e.target.tagName === 'INPUT') _this.setState({
- focused: false
- });
- };
-
- return _this;
- }
-
- var _proto = ToggleButton.prototype;
-
- _proto.render = function render() {
- var _this$props = this.props,
- children = _this$props.children,
- name = _this$props.name,
- className = _this$props.className,
- checked = _this$props.checked,
- type = _this$props.type,
- onChange = _this$props.onChange,
- value = _this$props.value,
- disabled = _this$props.disabled,
- inputRef = _this$props.inputRef,
- innerRef = _this$props.innerRef,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props, ["children", "name", "className", "checked", "type", "onChange", "value", "disabled", "inputRef", "innerRef"]);
-
- var focused = this.state.focused;
- return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(_Button__WEBPACK_IMPORTED_MODULE_5__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- ref: innerRef,
- className: classnames__WEBPACK_IMPORTED_MODULE_3___default()(className, focused && 'focus', disabled && 'disabled'),
- type: null,
- active: !!checked,
- as: "label"
- }), react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("input", {
- name: name,
- type: type,
- value: value,
- ref: inputRef,
- autoComplete: "off",
- checked: !!checked,
- disabled: !!disabled,
- onFocus: this.handleFocus,
- onBlur: this.handleBlur,
- onChange: onChange || noop
- }), children);
- };
-
- return ToggleButton;
- }(react__WEBPACK_IMPORTED_MODULE_4___default.a.Component);
-
- /* harmony default export */ __webpack_exports__["default"] = (react__WEBPACK_IMPORTED_MODULE_4___default.a.forwardRef(function (props, ref) {
- return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(ToggleButton, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- innerRef: ref
- }, props));
- }));
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/ToggleButtonGroup.js":
- /*!***************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/ToggleButtonGroup.js ***!
- \***************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! invariant */ "./node_modules/invariant/browser.js");
- /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var uncontrollable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! uncontrollable */ "./node_modules/uncontrollable/esm/index.js");
- /* harmony import */ var _utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/createChainedFunction */ "./node_modules/react-bootstrap/esm/utils/createChainedFunction.js");
- /* harmony import */ var _utils_ElementChildren__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/ElementChildren */ "./node_modules/react-bootstrap/esm/utils/ElementChildren.js");
- /* harmony import */ var _ButtonGroup__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ButtonGroup */ "./node_modules/react-bootstrap/esm/ButtonGroup.js");
- /* harmony import */ var _ToggleButton__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ToggleButton */ "./node_modules/react-bootstrap/esm/ToggleButton.js");
-
-
-
-
-
-
-
-
-
-
- var defaultProps = {
- type: 'radio'
- };
-
- var ToggleButtonGroup =
- /*#__PURE__*/
- function (_React$Component) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(ToggleButtonGroup, _React$Component);
-
- function ToggleButtonGroup() {
- return _React$Component.apply(this, arguments) || this;
- }
-
- var _proto = ToggleButtonGroup.prototype;
-
- _proto.getValues = function getValues() {
- var value = this.props.value;
- return value == null ? [] : [].concat(value);
- };
-
- _proto.handleToggle = function handleToggle(value, event) {
- var _this$props = this.props,
- type = _this$props.type,
- onChange = _this$props.onChange;
- var values = this.getValues();
- var isActive = values.indexOf(value) !== -1;
-
- if (type === 'radio') {
- if (!isActive) onChange(value, event);
- return;
- }
-
- if (isActive) {
- onChange(values.filter(function (n) {
- return n !== value;
- }), event);
- } else {
- onChange([].concat(values, [value]), event);
- }
- };
-
- _proto.render = function render() {
- var _this = this;
-
- var _this$props2 = this.props,
- children = _this$props2.children,
- type = _this$props2.type,
- name = _this$props2.name,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props2, ["children", "type", "name"]);
-
- delete props.onChange;
- delete props.value;
- var values = this.getValues();
- !(type !== 'radio' || !!name) ? true ? invariant__WEBPACK_IMPORTED_MODULE_4___default()(false, 'A `name` is required to group the toggle buttons when the `type` ' + 'is set to "radio"') : undefined : void 0;
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_ButtonGroup__WEBPACK_IMPORTED_MODULE_8__["default"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- toggle: true
- }), Object(_utils_ElementChildren__WEBPACK_IMPORTED_MODULE_7__["map"])(children, function (child) {
- var _child$props = child.props,
- value = _child$props.value,
- onChange = _child$props.onChange;
-
- var handler = function handler(e) {
- return _this.handleToggle(value, e);
- };
-
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.cloneElement(child, {
- type: type,
- name: child.name || name,
- checked: values.indexOf(value) !== -1,
- onChange: Object(_utils_createChainedFunction__WEBPACK_IMPORTED_MODULE_6__["default"])(onChange, handler)
- });
- }));
- };
-
- return ToggleButtonGroup;
- }(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component);
-
- ToggleButtonGroup.defaultProps = defaultProps;
- var UncontrolledToggleButtonGroup = Object(uncontrollable__WEBPACK_IMPORTED_MODULE_5__["uncontrollable"])(ToggleButtonGroup, {
- value: 'onChange'
- });
- UncontrolledToggleButtonGroup.Button = _ToggleButton__WEBPACK_IMPORTED_MODULE_9__["default"];
- /* harmony default export */ __webpack_exports__["default"] = (UncontrolledToggleButtonGroup);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/Tooltip.js":
- /*!*****************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/Tooltip.js ***!
- \*****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types-extra/lib/isRequiredForA11y */ "./node_modules/prop-types-extra/lib/isRequiredForA11y.js");
- /* harmony import */ var prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types_extra_lib_isRequiredForA11y__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
- var defaultProps = {
- placement: 'right'
- };
- var Tooltip = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (_ref, ref) {
- var bsPrefix = _ref.bsPrefix,
- placement = _ref.placement,
- className = _ref.className,
- style = _ref.style,
- children = _ref.children,
- arrowProps = _ref.arrowProps,
- _ = _ref.scheduleUpdate,
- _1 = _ref.outOfBoundaries,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, ["bsPrefix", "placement", "className", "style", "children", "arrowProps", "scheduleUpdate", "outOfBoundaries"]);
-
- bsPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, 'tooltip');
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref,
- style: style,
- role: "tooltip",
- "x-placement": placement,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, bsPrefix, "bs-tooltip-" + placement)
- }, props), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- className: "arrow"
- }, arrowProps)), react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement("div", {
- className: bsPrefix + "-inner"
- }, children));
- });
- Tooltip.defaultProps = defaultProps;
- Tooltip.displayName = 'Tooltip';
- /* harmony default export */ __webpack_exports__["default"] = (Tooltip);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/index.js":
- /*!***************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/index.js ***!
- \***************************************************/
- /*! exports provided: Accordion, AccordionToggle, useAccordionToggle, AccordionCollapse, Alert, Badge, Breadcrumb, BreadcrumbItem, Button, ButtonGroup, ButtonToolbar, Card, CardColumns, CardDeck, CardImg, CardGroup, Carousel, CarouselItem, CloseButton, Col, Collapse, Dropdown, DropdownButton, DropdownItem, Fade, Form, FormControl, FormCheck, Switch, FormGroup, FormLabel, FormText, Container, Image, Figure, InputGroup, Jumbotron, ListGroup, ListGroupItem, Media, Modal, ModalBody, ModalDialog, ModalFooter, ModalTitle, Nav, Navbar, NavbarBrand, NavDropdown, NavItem, Overlay, OverlayTrigger, PageItem, Pagination, Popover, PopoverContent, PopoverTitle, ProgressBar, ResponsiveEmbed, Row, SafeAnchor, Spinner, SplitButton, Tab, TabContainer, TabContent, Table, TabPane, Tabs, ThemeProvider, ToggleButton, ToggleButtonGroup, Tooltip, Toast, ToastBody, ToastHeader */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _Accordion__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Accordion */ "./node_modules/react-bootstrap/esm/Accordion.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Accordion", function() { return _Accordion__WEBPACK_IMPORTED_MODULE_0__["default"]; });
-
- /* harmony import */ var _AccordionToggle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AccordionToggle */ "./node_modules/react-bootstrap/esm/AccordionToggle.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AccordionToggle", function() { return _AccordionToggle__WEBPACK_IMPORTED_MODULE_1__["default"]; });
-
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useAccordionToggle", function() { return _AccordionToggle__WEBPACK_IMPORTED_MODULE_1__["useAccordionToggle"]; });
-
- /* harmony import */ var _AccordionCollapse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AccordionCollapse */ "./node_modules/react-bootstrap/esm/AccordionCollapse.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AccordionCollapse", function() { return _AccordionCollapse__WEBPACK_IMPORTED_MODULE_2__["default"]; });
-
- /* harmony import */ var _Alert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Alert */ "./node_modules/react-bootstrap/esm/Alert.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Alert", function() { return _Alert__WEBPACK_IMPORTED_MODULE_3__["default"]; });
-
- /* harmony import */ var _Badge__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Badge */ "./node_modules/react-bootstrap/esm/Badge.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Badge", function() { return _Badge__WEBPACK_IMPORTED_MODULE_4__["default"]; });
-
- /* harmony import */ var _Breadcrumb__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Breadcrumb */ "./node_modules/react-bootstrap/esm/Breadcrumb.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Breadcrumb", function() { return _Breadcrumb__WEBPACK_IMPORTED_MODULE_5__["default"]; });
-
- /* harmony import */ var _BreadcrumbItem__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./BreadcrumbItem */ "./node_modules/react-bootstrap/esm/BreadcrumbItem.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BreadcrumbItem", function() { return _BreadcrumbItem__WEBPACK_IMPORTED_MODULE_6__["default"]; });
-
- /* harmony import */ var _Button__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Button */ "./node_modules/react-bootstrap/esm/Button.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Button", function() { return _Button__WEBPACK_IMPORTED_MODULE_7__["default"]; });
-
- /* harmony import */ var _ButtonGroup__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ButtonGroup */ "./node_modules/react-bootstrap/esm/ButtonGroup.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ButtonGroup", function() { return _ButtonGroup__WEBPACK_IMPORTED_MODULE_8__["default"]; });
-
- /* harmony import */ var _ButtonToolbar__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ButtonToolbar */ "./node_modules/react-bootstrap/esm/ButtonToolbar.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ButtonToolbar", function() { return _ButtonToolbar__WEBPACK_IMPORTED_MODULE_9__["default"]; });
-
- /* harmony import */ var _Card__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Card */ "./node_modules/react-bootstrap/esm/Card.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Card", function() { return _Card__WEBPACK_IMPORTED_MODULE_10__["default"]; });
-
- /* harmony import */ var _CardColumns__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./CardColumns */ "./node_modules/react-bootstrap/esm/CardColumns.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CardColumns", function() { return _CardColumns__WEBPACK_IMPORTED_MODULE_11__["default"]; });
-
- /* harmony import */ var _CardDeck__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./CardDeck */ "./node_modules/react-bootstrap/esm/CardDeck.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CardDeck", function() { return _CardDeck__WEBPACK_IMPORTED_MODULE_12__["default"]; });
-
- /* harmony import */ var _CardImg__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./CardImg */ "./node_modules/react-bootstrap/esm/CardImg.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CardImg", function() { return _CardImg__WEBPACK_IMPORTED_MODULE_13__["default"]; });
-
- /* harmony import */ var _CardGroup__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./CardGroup */ "./node_modules/react-bootstrap/esm/CardGroup.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CardGroup", function() { return _CardGroup__WEBPACK_IMPORTED_MODULE_14__["default"]; });
-
- /* harmony import */ var _Carousel__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./Carousel */ "./node_modules/react-bootstrap/esm/Carousel.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Carousel", function() { return _Carousel__WEBPACK_IMPORTED_MODULE_15__["default"]; });
-
- /* harmony import */ var _CarouselItem__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./CarouselItem */ "./node_modules/react-bootstrap/esm/CarouselItem.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CarouselItem", function() { return _CarouselItem__WEBPACK_IMPORTED_MODULE_16__["default"]; });
-
- /* harmony import */ var _CloseButton__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./CloseButton */ "./node_modules/react-bootstrap/esm/CloseButton.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CloseButton", function() { return _CloseButton__WEBPACK_IMPORTED_MODULE_17__["default"]; });
-
- /* harmony import */ var _Col__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./Col */ "./node_modules/react-bootstrap/esm/Col.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Col", function() { return _Col__WEBPACK_IMPORTED_MODULE_18__["default"]; });
-
- /* harmony import */ var _Collapse__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./Collapse */ "./node_modules/react-bootstrap/esm/Collapse.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Collapse", function() { return _Collapse__WEBPACK_IMPORTED_MODULE_19__["default"]; });
-
- /* harmony import */ var _Dropdown__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./Dropdown */ "./node_modules/react-bootstrap/esm/Dropdown.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Dropdown", function() { return _Dropdown__WEBPACK_IMPORTED_MODULE_20__["default"]; });
-
- /* harmony import */ var _DropdownButton__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./DropdownButton */ "./node_modules/react-bootstrap/esm/DropdownButton.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropdownButton", function() { return _DropdownButton__WEBPACK_IMPORTED_MODULE_21__["default"]; });
-
- /* harmony import */ var _DropdownItem__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./DropdownItem */ "./node_modules/react-bootstrap/esm/DropdownItem.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DropdownItem", function() { return _DropdownItem__WEBPACK_IMPORTED_MODULE_22__["default"]; });
-
- /* harmony import */ var _Fade__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./Fade */ "./node_modules/react-bootstrap/esm/Fade.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Fade", function() { return _Fade__WEBPACK_IMPORTED_MODULE_23__["default"]; });
-
- /* harmony import */ var _Form__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./Form */ "./node_modules/react-bootstrap/esm/Form.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Form", function() { return _Form__WEBPACK_IMPORTED_MODULE_24__["default"]; });
-
- /* harmony import */ var _FormControl__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./FormControl */ "./node_modules/react-bootstrap/esm/FormControl.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormControl", function() { return _FormControl__WEBPACK_IMPORTED_MODULE_25__["default"]; });
-
- /* harmony import */ var _FormCheck__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./FormCheck */ "./node_modules/react-bootstrap/esm/FormCheck.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormCheck", function() { return _FormCheck__WEBPACK_IMPORTED_MODULE_26__["default"]; });
-
- /* harmony import */ var _Switch__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./Switch */ "./node_modules/react-bootstrap/esm/Switch.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return _Switch__WEBPACK_IMPORTED_MODULE_27__["default"]; });
-
- /* harmony import */ var _FormGroup__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./FormGroup */ "./node_modules/react-bootstrap/esm/FormGroup.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormGroup", function() { return _FormGroup__WEBPACK_IMPORTED_MODULE_28__["default"]; });
-
- /* harmony import */ var _FormLabel__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./FormLabel */ "./node_modules/react-bootstrap/esm/FormLabel.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormLabel", function() { return _FormLabel__WEBPACK_IMPORTED_MODULE_29__["default"]; });
-
- /* harmony import */ var _FormText__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./FormText */ "./node_modules/react-bootstrap/esm/FormText.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FormText", function() { return _FormText__WEBPACK_IMPORTED_MODULE_30__["default"]; });
-
- /* harmony import */ var _Container__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./Container */ "./node_modules/react-bootstrap/esm/Container.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Container", function() { return _Container__WEBPACK_IMPORTED_MODULE_31__["default"]; });
-
- /* harmony import */ var _Image__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./Image */ "./node_modules/react-bootstrap/esm/Image.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Image", function() { return _Image__WEBPACK_IMPORTED_MODULE_32__["default"]; });
-
- /* harmony import */ var _Figure__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./Figure */ "./node_modules/react-bootstrap/esm/Figure.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Figure", function() { return _Figure__WEBPACK_IMPORTED_MODULE_33__["default"]; });
-
- /* harmony import */ var _InputGroup__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./InputGroup */ "./node_modules/react-bootstrap/esm/InputGroup.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InputGroup", function() { return _InputGroup__WEBPACK_IMPORTED_MODULE_34__["default"]; });
-
- /* harmony import */ var _Jumbotron__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./Jumbotron */ "./node_modules/react-bootstrap/esm/Jumbotron.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Jumbotron", function() { return _Jumbotron__WEBPACK_IMPORTED_MODULE_35__["default"]; });
-
- /* harmony import */ var _ListGroup__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./ListGroup */ "./node_modules/react-bootstrap/esm/ListGroup.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListGroup", function() { return _ListGroup__WEBPACK_IMPORTED_MODULE_36__["default"]; });
-
- /* harmony import */ var _ListGroupItem__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./ListGroupItem */ "./node_modules/react-bootstrap/esm/ListGroupItem.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ListGroupItem", function() { return _ListGroupItem__WEBPACK_IMPORTED_MODULE_37__["default"]; });
-
- /* harmony import */ var _Media__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./Media */ "./node_modules/react-bootstrap/esm/Media.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Media", function() { return _Media__WEBPACK_IMPORTED_MODULE_38__["default"]; });
-
- /* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./Modal */ "./node_modules/react-bootstrap/esm/Modal.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Modal", function() { return _Modal__WEBPACK_IMPORTED_MODULE_39__["default"]; });
-
- /* harmony import */ var _ModalBody__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./ModalBody */ "./node_modules/react-bootstrap/esm/ModalBody.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ModalBody", function() { return _ModalBody__WEBPACK_IMPORTED_MODULE_40__["default"]; });
-
- /* harmony import */ var _ModalDialog__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./ModalDialog */ "./node_modules/react-bootstrap/esm/ModalDialog.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ModalDialog", function() { return _ModalDialog__WEBPACK_IMPORTED_MODULE_41__["default"]; });
-
- /* harmony import */ var _ModalFooter__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./ModalFooter */ "./node_modules/react-bootstrap/esm/ModalFooter.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ModalFooter", function() { return _ModalFooter__WEBPACK_IMPORTED_MODULE_42__["default"]; });
-
- /* harmony import */ var _ModalTitle__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./ModalTitle */ "./node_modules/react-bootstrap/esm/ModalTitle.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ModalTitle", function() { return _ModalTitle__WEBPACK_IMPORTED_MODULE_43__["default"]; });
-
- /* harmony import */ var _Nav__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./Nav */ "./node_modules/react-bootstrap/esm/Nav.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Nav", function() { return _Nav__WEBPACK_IMPORTED_MODULE_44__["default"]; });
-
- /* harmony import */ var _Navbar__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./Navbar */ "./node_modules/react-bootstrap/esm/Navbar.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Navbar", function() { return _Navbar__WEBPACK_IMPORTED_MODULE_45__["default"]; });
-
- /* harmony import */ var _NavbarBrand__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./NavbarBrand */ "./node_modules/react-bootstrap/esm/NavbarBrand.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NavbarBrand", function() { return _NavbarBrand__WEBPACK_IMPORTED_MODULE_46__["default"]; });
-
- /* harmony import */ var _NavDropdown__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./NavDropdown */ "./node_modules/react-bootstrap/esm/NavDropdown.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NavDropdown", function() { return _NavDropdown__WEBPACK_IMPORTED_MODULE_47__["default"]; });
-
- /* harmony import */ var _NavItem__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./NavItem */ "./node_modules/react-bootstrap/esm/NavItem.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NavItem", function() { return _NavItem__WEBPACK_IMPORTED_MODULE_48__["default"]; });
-
- /* harmony import */ var _Overlay__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./Overlay */ "./node_modules/react-bootstrap/esm/Overlay.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Overlay", function() { return _Overlay__WEBPACK_IMPORTED_MODULE_49__["default"]; });
-
- /* harmony import */ var _OverlayTrigger__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./OverlayTrigger */ "./node_modules/react-bootstrap/esm/OverlayTrigger.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OverlayTrigger", function() { return _OverlayTrigger__WEBPACK_IMPORTED_MODULE_50__["default"]; });
-
- /* harmony import */ var _PageItem__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./PageItem */ "./node_modules/react-bootstrap/esm/PageItem.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PageItem", function() { return _PageItem__WEBPACK_IMPORTED_MODULE_51__["default"]; });
-
- /* harmony import */ var _Pagination__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./Pagination */ "./node_modules/react-bootstrap/esm/Pagination.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Pagination", function() { return _Pagination__WEBPACK_IMPORTED_MODULE_52__["default"]; });
-
- /* harmony import */ var _Popover__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./Popover */ "./node_modules/react-bootstrap/esm/Popover.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Popover", function() { return _Popover__WEBPACK_IMPORTED_MODULE_53__["default"]; });
-
- /* harmony import */ var _PopoverContent__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./PopoverContent */ "./node_modules/react-bootstrap/esm/PopoverContent.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopoverContent", function() { return _PopoverContent__WEBPACK_IMPORTED_MODULE_54__["default"]; });
-
- /* harmony import */ var _PopoverTitle__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./PopoverTitle */ "./node_modules/react-bootstrap/esm/PopoverTitle.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PopoverTitle", function() { return _PopoverTitle__WEBPACK_IMPORTED_MODULE_55__["default"]; });
-
- /* harmony import */ var _ProgressBar__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./ProgressBar */ "./node_modules/react-bootstrap/esm/ProgressBar.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ProgressBar", function() { return _ProgressBar__WEBPACK_IMPORTED_MODULE_56__["default"]; });
-
- /* harmony import */ var _ResponsiveEmbed__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./ResponsiveEmbed */ "./node_modules/react-bootstrap/esm/ResponsiveEmbed.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ResponsiveEmbed", function() { return _ResponsiveEmbed__WEBPACK_IMPORTED_MODULE_57__["default"]; });
-
- /* harmony import */ var _Row__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./Row */ "./node_modules/react-bootstrap/esm/Row.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Row", function() { return _Row__WEBPACK_IMPORTED_MODULE_58__["default"]; });
-
- /* harmony import */ var _SafeAnchor__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./SafeAnchor */ "./node_modules/react-bootstrap/esm/SafeAnchor.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SafeAnchor", function() { return _SafeAnchor__WEBPACK_IMPORTED_MODULE_59__["default"]; });
-
- /* harmony import */ var _Spinner__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./Spinner */ "./node_modules/react-bootstrap/esm/Spinner.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Spinner", function() { return _Spinner__WEBPACK_IMPORTED_MODULE_60__["default"]; });
-
- /* harmony import */ var _SplitButton__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./SplitButton */ "./node_modules/react-bootstrap/esm/SplitButton.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SplitButton", function() { return _SplitButton__WEBPACK_IMPORTED_MODULE_61__["default"]; });
-
- /* harmony import */ var _Tab__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./Tab */ "./node_modules/react-bootstrap/esm/Tab.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tab", function() { return _Tab__WEBPACK_IMPORTED_MODULE_62__["default"]; });
-
- /* harmony import */ var _TabContainer__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./TabContainer */ "./node_modules/react-bootstrap/esm/TabContainer.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabContainer", function() { return _TabContainer__WEBPACK_IMPORTED_MODULE_63__["default"]; });
-
- /* harmony import */ var _TabContent__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./TabContent */ "./node_modules/react-bootstrap/esm/TabContent.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabContent", function() { return _TabContent__WEBPACK_IMPORTED_MODULE_64__["default"]; });
-
- /* harmony import */ var _Table__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./Table */ "./node_modules/react-bootstrap/esm/Table.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Table", function() { return _Table__WEBPACK_IMPORTED_MODULE_65__["default"]; });
-
- /* harmony import */ var _TabPane__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./TabPane */ "./node_modules/react-bootstrap/esm/TabPane.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TabPane", function() { return _TabPane__WEBPACK_IMPORTED_MODULE_66__["default"]; });
-
- /* harmony import */ var _Tabs__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./Tabs */ "./node_modules/react-bootstrap/esm/Tabs.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tabs", function() { return _Tabs__WEBPACK_IMPORTED_MODULE_67__["default"]; });
-
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ThemeProvider", function() { return _ThemeProvider__WEBPACK_IMPORTED_MODULE_68__["default"]; });
-
- /* harmony import */ var _ToggleButton__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./ToggleButton */ "./node_modules/react-bootstrap/esm/ToggleButton.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToggleButton", function() { return _ToggleButton__WEBPACK_IMPORTED_MODULE_69__["default"]; });
-
- /* harmony import */ var _ToggleButtonGroup__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./ToggleButtonGroup */ "./node_modules/react-bootstrap/esm/ToggleButtonGroup.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToggleButtonGroup", function() { return _ToggleButtonGroup__WEBPACK_IMPORTED_MODULE_70__["default"]; });
-
- /* harmony import */ var _Tooltip__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./Tooltip */ "./node_modules/react-bootstrap/esm/Tooltip.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return _Tooltip__WEBPACK_IMPORTED_MODULE_71__["default"]; });
-
- /* harmony import */ var _Toast__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./Toast */ "./node_modules/react-bootstrap/esm/Toast.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Toast", function() { return _Toast__WEBPACK_IMPORTED_MODULE_72__["default"]; });
-
- /* harmony import */ var _ToastBody__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./ToastBody */ "./node_modules/react-bootstrap/esm/ToastBody.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToastBody", function() { return _ToastBody__WEBPACK_IMPORTED_MODULE_73__["default"]; });
-
- /* harmony import */ var _ToastHeader__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./ToastHeader */ "./node_modules/react-bootstrap/esm/ToastHeader.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ToastHeader", function() { return _ToastHeader__WEBPACK_IMPORTED_MODULE_74__["default"]; });
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/utils/BootstrapModalManager.js":
- /*!*************************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/utils/BootstrapModalManager.js ***!
- \*************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return BootstrapModalManager; });
- /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
- /* harmony import */ var dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dom-helpers/query/querySelectorAll */ "./node_modules/dom-helpers/query/querySelectorAll.js");
- /* harmony import */ var dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var dom_helpers_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! dom-helpers/style */ "./node_modules/dom-helpers/style/index.js");
- /* harmony import */ var dom_helpers_style__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_style__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var dom_helpers_util_scrollbarSize__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! dom-helpers/util/scrollbarSize */ "./node_modules/dom-helpers/util/scrollbarSize.js");
- /* harmony import */ var dom_helpers_util_scrollbarSize__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_util_scrollbarSize__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react_overlays_ModalManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-overlays/ModalManager */ "./node_modules/react-overlays/ModalManager.js");
- /* harmony import */ var react_overlays_ModalManager__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_overlays_ModalManager__WEBPACK_IMPORTED_MODULE_4__);
-
-
-
-
-
- var Selector = {
- FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
- STICKY_CONTENT: '.sticky-top',
- NAVBAR_TOGGLER: '.navbar-toggler'
- };
-
- var BootstrapModalManager =
- /*#__PURE__*/
- function (_ModalManager) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(BootstrapModalManager, _ModalManager);
-
- function BootstrapModalManager() {
- var _this;
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = _ModalManager.call.apply(_ModalManager, [this].concat(args)) || this;
-
- _this.adjustAndStore = function (prop, element, adjust) {
- var actual = element.style[prop];
- element.dataset[prop] = actual;
- dom_helpers_style__WEBPACK_IMPORTED_MODULE_2___default()(element, prop, parseFloat(dom_helpers_style__WEBPACK_IMPORTED_MODULE_2___default()(element, prop)) + adjust + "px");
- };
-
- _this.restore = function (prop, element) {
- var value = element.dataset[prop];
-
- if (value !== undefined) {
- delete element.dataset[prop];
- dom_helpers_style__WEBPACK_IMPORTED_MODULE_2___default()(element, prop, value);
- }
- };
-
- return _this;
- }
-
- var _proto = BootstrapModalManager.prototype;
-
- _proto.setContainerStyle = function setContainerStyle(containerState, container) {
- var _this2 = this;
-
- _ModalManager.prototype.setContainerStyle.call(this, containerState, container);
-
- if (!containerState.overflowing) return;
- var size = dom_helpers_util_scrollbarSize__WEBPACK_IMPORTED_MODULE_3___default()();
- dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_1___default()(container, Selector.FIXED_CONTENT).forEach(function (el) {
- return _this2.adjustAndStore('paddingRight', el, size);
- });
- dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_1___default()(container, Selector.STICKY_CONTENT).forEach(function (el) {
- return _this2.adjustAndStore('margingRight', el, -size);
- });
- dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_1___default()(container, Selector.NAVBAR_TOGGLER).forEach(function (el) {
- return _this2.adjustAndStore('margingRight', el, size);
- });
- };
-
- _proto.removeContainerStyle = function removeContainerStyle(containerState, container) {
- var _this3 = this;
-
- _ModalManager.prototype.removeContainerStyle.call(this, containerState, container);
-
- dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_1___default()(container, Selector.FIXED_CONTENT).forEach(function (el) {
- return _this3.restore('paddingRight', el);
- });
- dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_1___default()(container, Selector.STICKY_CONTENT).forEach(function (el) {
- return _this3.restore('margingRight', el);
- });
- dom_helpers_query_querySelectorAll__WEBPACK_IMPORTED_MODULE_1___default()(container, Selector.NAVBAR_TOGGLER).forEach(function (el) {
- return _this3.restore('margingRight', el);
- });
- };
-
- return BootstrapModalManager;
- }(react_overlays_ModalManager__WEBPACK_IMPORTED_MODULE_4___default.a);
-
-
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/utils/ElementChildren.js":
- /*!*******************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/utils/ElementChildren.js ***!
- \*******************************************************************/
- /*! exports provided: map, forEach */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return map; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "forEach", function() { return forEach; });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-
- /**
- * Iterates through children that are typically specified as `props.children`,
- * but only maps over children that are "valid elements".
- *
- * The mapFunction provided index will be normalised to the components mapped,
- * so an invalid component would not increase the index.
- *
- */
-
- function map(children, func) {
- var index = 0;
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.Children.map(children, function (child) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.isValidElement(child) ? func(child, index++) : child;
- });
- }
- /**
- * Iterates through children that are "valid elements".
- *
- * The provided forEachFunc(child, index) will be called for each
- * leaf child with the index reflecting the position relative to "valid components".
- */
-
-
- function forEach(children, func) {
- var index = 0;
- react__WEBPACK_IMPORTED_MODULE_0___default.a.Children.forEach(children, function (child) {
- if (react__WEBPACK_IMPORTED_MODULE_0___default.a.isValidElement(child)) func(child, index++);
- });
- }
-
-
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/utils/createChainedFunction.js":
- /*!*************************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/utils/createChainedFunction.js ***!
- \*************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /**
- * Safe chained function
- *
- * Will only create a new function if needed,
- * otherwise will pass back existing functions or null.
- *
- * @param {function} functions to chain
- * @returns {function|null}
- */
- function createChainedFunction() {
- for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
- funcs[_key] = arguments[_key];
- }
-
- return funcs.filter(function (f) {
- return f != null;
- }).reduce(function (acc, f) {
- if (typeof f !== 'function') {
- throw new Error('Invalid Argument Type, must only provide functions, undefined, or null.');
- }
-
- if (acc === null) return f;
- return function chainedFunction() {
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- args[_key2] = arguments[_key2];
- }
-
- acc.apply(this, args);
- f.apply(this, args);
- };
- }, null);
- }
-
- /* harmony default export */ __webpack_exports__["default"] = (createChainedFunction);
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js":
- /*!**********************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/utils/createWithBsPrefix.js ***!
- \**********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return createWithBsPrefix; });
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var dom_helpers_util_camelize__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! dom-helpers/util/camelize */ "./node_modules/dom-helpers/util/camelize.js");
- /* harmony import */ var dom_helpers_util_camelize__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(dom_helpers_util_camelize__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _ThemeProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ThemeProvider */ "./node_modules/react-bootstrap/esm/ThemeProvider.js");
-
-
-
-
-
-
-
- var pascalCase = function pascalCase(str) {
- return str[0].toUpperCase() + dom_helpers_util_camelize__WEBPACK_IMPORTED_MODULE_4___default()(str).slice(1);
- };
-
- function createWithBsPrefix(prefix, _temp) {
- var _ref = _temp === void 0 ? {} : _temp,
- _ref$displayName = _ref.displayName,
- displayName = _ref$displayName === void 0 ? pascalCase(prefix) : _ref$displayName,
- _ref$Component = _ref.Component,
- Component = _ref$Component === void 0 ? 'div' : _ref$Component,
- defaultProps = _ref.defaultProps;
-
- var BsComponent = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef( // eslint-disable-next-line react/prop-types
- function (_ref2, ref) {
- var className = _ref2.className,
- bsPrefix = _ref2.bsPrefix,
- _ref2$as = _ref2.as,
- Tag = _ref2$as === void 0 ? Component : _ref2$as,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref2, ["className", "bsPrefix", "as"]);
-
- var resolvedPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__["useBootstrapPrefix"])(bsPrefix, prefix);
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Tag, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- ref: ref,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, resolvedPrefix)
- }, props));
- });
- BsComponent.defaultProps = defaultProps;
- BsComponent.displayName = displayName;
- return BsComponent;
- }
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/utils/divWithClassName.js":
- /*!********************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/utils/divWithClassName.js ***!
- \********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
- /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
-
-
-
- /* harmony default export */ __webpack_exports__["default"] = (function (className) {
- return react__WEBPACK_IMPORTED_MODULE_1___default.a.forwardRef(function (p, ref) {
- return react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, p, {
- ref: ref,
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(p.className, className)
- }));
- });
- });
-
- /***/ }),
-
- /***/ "./node_modules/react-bootstrap/esm/utils/triggerBrowserReflow.js":
- /*!************************************************************************!*\
- !*** ./node_modules/react-bootstrap/esm/utils/triggerBrowserReflow.js ***!
- \************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return triggerBrowserReflow; });
- // reading a dimension prop will cause the browser to recalculate,
- // which will let our animations work
- function triggerBrowserReflow(node) {
- node.offsetHeight; // eslint-disable-line no-unused-expressions
- }
-
- /***/ }),
-
- /***/ "./node_modules/react-context-toolbox/forwardRef.js":
- /*!**********************************************************!*\
- !*** ./node_modules/react-context-toolbox/forwardRef.js ***!
- \**********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = forwardRef;
-
- var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function forwardRef(renderFn, _ref) {
- var displayName = _ref.displayName,
- propTypes = _ref.propTypes,
- defaultProps = _ref.defaultProps,
- _ref$allowFallback = _ref.allowFallback,
- allowFallback = _ref$allowFallback === void 0 ? false : _ref$allowFallback;
-
- var render = function render(props, ref) {
- return renderFn(props, ref);
- };
-
- Object.assign(render, {
- displayName: displayName
- });
- if (_react.default.forwardRef || !allowFallback) return Object.assign(_react.default.forwardRef(render), {
- propTypes: propTypes,
- defaultProps: defaultProps
- });
- return Object.assign(function (props) {
- return render(props, null);
- }, {
- displayName: displayName,
- propTypes: propTypes,
- defaultProps: defaultProps
- });
- }
-
- /***/ }),
-
- /***/ "./node_modules/react-context-toolbox/mapContextToProps.js":
- /*!*****************************************************************!*\
- !*** ./node_modules/react-context-toolbox/mapContextToProps.js ***!
- \*****************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = mapContextToProps;
-
- var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
-
- var _forwardRef = _interopRequireDefault(__webpack_require__(/*! ./forwardRef */ "./node_modules/react-context-toolbox/forwardRef.js"));
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
-
- var getDisplayName = function getDisplayName(Component) {
- var name = typeof Component === 'string' ? Component : Component.name || Component.displayName;
- return name ? "ContextTransform(" + name + ")" : 'ContextTransform';
- };
-
- var ensureConsumer = function ensureConsumer(c) {
- return c.Consumer || c;
- };
-
- function $mapContextToProps(_ref, Component) {
- var maybeArrayOfConsumers = _ref.consumers,
- mapToProps = _ref.mapToProps,
- displayName = _ref.displayName,
- _ref$forwardRefAs = _ref.forwardRefAs,
- forwardRefAs = _ref$forwardRefAs === void 0 ? 'ref' : _ref$forwardRefAs;
- var consumers = maybeArrayOfConsumers;
-
- if (!Array.isArray(maybeArrayOfConsumers)) {
- consumers = [maybeArrayOfConsumers];
- }
-
- var SingleConsumer = ensureConsumer(consumers[0]);
-
- function singleRender(props, ref) {
- var _extends2;
-
- var propsWithRef = _extends((_extends2 = {}, _extends2[forwardRefAs] = ref, _extends2), props);
-
- return _react.default.createElement(SingleConsumer, null, function (value) {
- return _react.default.createElement(Component, _extends({}, propsWithRef, mapToProps(value, props)));
- });
- }
-
- function multiRender(props, ref) {
- var _extends3;
-
- var propsWithRef = _extends((_extends3 = {}, _extends3[forwardRefAs] = ref, _extends3), props);
-
- return consumers.reduceRight(function (inner, Context) {
- return function () {
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- var Consumer = ensureConsumer(Context);
- return _react.default.createElement(Consumer, null, function (value) {
- return inner.apply(void 0, args.concat([value]));
- });
- };
- }, function () {
- for (var _len2 = arguments.length, contexts = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
- contexts[_key2] = arguments[_key2];
- }
-
- return _react.default.createElement(Component, _extends({}, propsWithRef, mapToProps.apply(void 0, contexts.concat([props]))));
- })();
- }
-
- var contextTransform = consumers.length === 1 ? singleRender : multiRender;
- return (0, _forwardRef.default)(contextTransform, {
- displayName: displayName || getDisplayName(Component)
- });
- }
-
- function mapContextToProps(maybeOpts, mapToProps, Component) {
- if (arguments.length === 2) return $mapContextToProps(maybeOpts, mapToProps);
- return $mapContextToProps({
- consumers: maybeOpts,
- mapToProps: mapToProps
- }, Component);
- }
-
- /***/ }),
-
- /***/ "./node_modules/react-dom/cjs/react-dom.development.js":
- /*!*************************************************************!*\
- !*** ./node_modules/react-dom/cjs/react-dom.development.js ***!
- \*************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
- /** @license React v16.12.0
- * react-dom.development.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-
-
-
-
- if (true) {
- (function() {
- 'use strict';
-
- var React = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
- var Scheduler = __webpack_require__(/*! scheduler */ "./node_modules/scheduler/index.js");
- var checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js");
- var tracing = __webpack_require__(/*! scheduler/tracing */ "./node_modules/scheduler/tracing.js");
-
- // Do not require this module directly! Use normal `invariant` calls with
- // template literal strings. The messages will be replaced with error codes
- // during build.
-
- /**
- * Use invariant() to assert state which your program assumes to be true.
- *
- * Provide sprintf-style format (only %s is supported) and arguments
- * to provide information about what broke and what you were
- * expecting.
- *
- * The invariant message will be stripped in production, but the invariant
- * will remain to ensure logic does not differ in production.
- */
-
- if (!React) {
- {
- throw Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.");
- }
- }
-
- /**
- * Injectable ordering of event plugins.
- */
- var eventPluginOrder = null;
- /**
- * Injectable mapping from names to event plugin modules.
- */
-
- var namesToPlugins = {};
- /**
- * Recomputes the plugin list using the injected plugins and plugin ordering.
- *
- * @private
- */
-
- function recomputePluginOrdering() {
- if (!eventPluginOrder) {
- // Wait until an `eventPluginOrder` is injected.
- return;
- }
-
- for (var pluginName in namesToPlugins) {
- var pluginModule = namesToPlugins[pluginName];
- var pluginIndex = eventPluginOrder.indexOf(pluginName);
-
- if (!(pluginIndex > -1)) {
- {
- throw Error("EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + pluginName + "`.");
- }
- }
-
- if (plugins[pluginIndex]) {
- continue;
- }
-
- if (!pluginModule.extractEvents) {
- {
- throw Error("EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + pluginName + "` does not.");
- }
- }
-
- plugins[pluginIndex] = pluginModule;
- var publishedEvents = pluginModule.eventTypes;
-
- for (var eventName in publishedEvents) {
- if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {
- {
- throw Error("EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`.");
- }
- }
- }
- }
- }
- /**
- * Publishes an event so that it can be dispatched by the supplied plugin.
- *
- * @param {object} dispatchConfig Dispatch configuration for the event.
- * @param {object} PluginModule Plugin publishing the event.
- * @return {boolean} True if the event was successfully published.
- * @private
- */
-
-
- function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
- if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) {
- {
- throw Error("EventPluginHub: More than one plugin attempted to publish the same event name, `" + eventName + "`.");
- }
- }
-
- eventNameDispatchConfigs[eventName] = dispatchConfig;
- var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
-
- if (phasedRegistrationNames) {
- for (var phaseName in phasedRegistrationNames) {
- if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
- var phasedRegistrationName = phasedRegistrationNames[phaseName];
- publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
- }
- }
-
- return true;
- } else if (dispatchConfig.registrationName) {
- publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
- return true;
- }
-
- return false;
- }
- /**
- * Publishes a registration name that is used to identify dispatched events.
- *
- * @param {string} registrationName Registration name to add.
- * @param {object} PluginModule Plugin publishing the event.
- * @private
- */
-
-
- function publishRegistrationName(registrationName, pluginModule, eventName) {
- if (!!registrationNameModules[registrationName]) {
- {
- throw Error("EventPluginHub: More than one plugin attempted to publish the same registration name, `" + registrationName + "`.");
- }
- }
-
- registrationNameModules[registrationName] = pluginModule;
- registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
-
- {
- var lowerCasedName = registrationName.toLowerCase();
- possibleRegistrationNames[lowerCasedName] = registrationName;
-
- if (registrationName === 'onDoubleClick') {
- possibleRegistrationNames.ondblclick = registrationName;
- }
- }
- }
- /**
- * Registers plugins so that they can extract and dispatch events.
- *
- * @see {EventPluginHub}
- */
-
- /**
- * Ordered list of injected plugins.
- */
-
-
- var plugins = [];
- /**
- * Mapping from event name to dispatch config
- */
-
- var eventNameDispatchConfigs = {};
- /**
- * Mapping from registration name to plugin module
- */
-
- var registrationNameModules = {};
- /**
- * Mapping from registration name to event name
- */
-
- var registrationNameDependencies = {};
- /**
- * Mapping from lowercase registration names to the properly cased version,
- * used to warn in the case of missing event handlers. Available
- * only in true.
- * @type {Object}
- */
-
- var possibleRegistrationNames = {}; // Trust the developer to only use possibleRegistrationNames in true
-
- /**
- * Injects an ordering of plugins (by plugin name). This allows the ordering
- * to be decoupled from injection of the actual plugins so that ordering is
- * always deterministic regardless of packaging, on-the-fly injection, etc.
- *
- * @param {array} InjectedEventPluginOrder
- * @internal
- * @see {EventPluginHub.injection.injectEventPluginOrder}
- */
-
- function injectEventPluginOrder(injectedEventPluginOrder) {
- if (!!eventPluginOrder) {
- {
- throw Error("EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.");
- }
- } // Clone the ordering so it cannot be dynamically mutated.
-
-
- eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
- recomputePluginOrdering();
- }
- /**
- * Injects plugins to be used by `EventPluginHub`. The plugin names must be
- * in the ordering injected by `injectEventPluginOrder`.
- *
- * Plugins can be injected as part of page initialization or on-the-fly.
- *
- * @param {object} injectedNamesToPlugins Map from names to plugin modules.
- * @internal
- * @see {EventPluginHub.injection.injectEventPluginsByName}
- */
-
- function injectEventPluginsByName(injectedNamesToPlugins) {
- var isOrderingDirty = false;
-
- for (var pluginName in injectedNamesToPlugins) {
- if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
- continue;
- }
-
- var pluginModule = injectedNamesToPlugins[pluginName];
-
- if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
- if (!!namesToPlugins[pluginName]) {
- {
- throw Error("EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + pluginName + "`.");
- }
- }
-
- namesToPlugins[pluginName] = pluginModule;
- isOrderingDirty = true;
- }
- }
-
- if (isOrderingDirty) {
- recomputePluginOrdering();
- }
- }
-
- var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) {
- var funcArgs = Array.prototype.slice.call(arguments, 3);
-
- try {
- func.apply(context, funcArgs);
- } catch (error) {
- this.onError(error);
- }
- };
-
- {
- // In DEV mode, we swap out invokeGuardedCallback for a special version
- // that plays more nicely with the browser's DevTools. The idea is to preserve
- // "Pause on exceptions" behavior. Because React wraps all user-provided
- // functions in invokeGuardedCallback, and the production version of
- // invokeGuardedCallback uses a try-catch, all user exceptions are treated
- // like caught exceptions, and the DevTools won't pause unless the developer
- // takes the extra step of enabling pause on caught exceptions. This is
- // unintuitive, though, because even though React has caught the error, from
- // the developer's perspective, the error is uncaught.
- //
- // To preserve the expected "Pause on exceptions" behavior, we don't use a
- // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake
- // DOM node, and call the user-provided callback from inside an event handler
- // for that fake event. If the callback throws, the error is "captured" using
- // a global event handler. But because the error happens in a different
- // event loop context, it does not interrupt the normal program flow.
- // Effectively, this gives us try-catch behavior without actually using
- // try-catch. Neat!
- // Check that the browser supports the APIs we need to implement our special
- // DEV version of invokeGuardedCallback
- if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
- var fakeNode = document.createElement('react');
-
- var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {
- // If document doesn't exist we know for sure we will crash in this method
- // when we call document.createEvent(). However this can cause confusing
- // errors: https://github.com/facebookincubator/create-react-app/issues/3482
- // So we preemptively throw with a better message instead.
- if (!(typeof document !== 'undefined')) {
- {
- throw Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");
- }
- }
-
- var evt = document.createEvent('Event'); // Keeps track of whether the user-provided callback threw an error. We
- // set this to true at the beginning, then set it to false right after
- // calling the function. If the function errors, `didError` will never be
- // set to false. This strategy works even if the browser is flaky and
- // fails to call our global error handler, because it doesn't rely on
- // the error event at all.
-
- var didError = true; // Keeps track of the value of window.event so that we can reset it
- // during the callback to let user code access window.event in the
- // browsers that support it.
-
- var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event
- // dispatching: https://github.com/facebook/react/issues/13688
-
- var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); // Create an event handler for our fake event. We will synchronously
- // dispatch our fake event using `dispatchEvent`. Inside the handler, we
- // call the user-provided callback.
-
- var funcArgs = Array.prototype.slice.call(arguments, 3);
-
- function callCallback() {
- // We immediately remove the callback from event listeners so that
- // nested `invokeGuardedCallback` calls do not clash. Otherwise, a
- // nested call would trigger the fake event handlers of any call higher
- // in the stack.
- fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the
- // window.event assignment in both IE <= 10 as they throw an error
- // "Member not found" in strict mode, and in Firefox which does not
- // support window.event.
-
- if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {
- window.event = windowEvent;
- }
-
- func.apply(context, funcArgs);
- didError = false;
- } // Create a global error event handler. We use this to capture the value
- // that was thrown. It's possible that this error handler will fire more
- // than once; for example, if non-React code also calls `dispatchEvent`
- // and a handler for that event throws. We should be resilient to most of
- // those cases. Even if our error event handler fires more than once, the
- // last error event is always used. If the callback actually does error,
- // we know that the last error event is the correct one, because it's not
- // possible for anything else to have happened in between our callback
- // erroring and the code that follows the `dispatchEvent` call below. If
- // the callback doesn't error, but the error event was fired, we know to
- // ignore it because `didError` will be false, as described above.
-
-
- var error; // Use this to track whether the error event is ever called.
-
- var didSetError = false;
- var isCrossOriginError = false;
-
- function handleWindowError(event) {
- error = event.error;
- didSetError = true;
-
- if (error === null && event.colno === 0 && event.lineno === 0) {
- isCrossOriginError = true;
- }
-
- if (event.defaultPrevented) {
- // Some other error handler has prevented default.
- // Browsers silence the error report if this happens.
- // We'll remember this to later decide whether to log it or not.
- if (error != null && typeof error === 'object') {
- try {
- error._suppressLogging = true;
- } catch (inner) {// Ignore.
- }
- }
- }
- } // Create a fake event type.
-
-
- var evtType = "react-" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers
-
- window.addEventListener('error', handleWindowError);
- fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function
- // errors, it will trigger our global error handler.
-
- evt.initEvent(evtType, false, false);
- fakeNode.dispatchEvent(evt);
-
- if (windowEventDescriptor) {
- Object.defineProperty(window, 'event', windowEventDescriptor);
- }
-
- if (didError) {
- if (!didSetError) {
- // The callback errored, but the error event never fired.
- error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');
- } else if (isCrossOriginError) {
- error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');
- }
-
- this.onError(error);
- } // Remove our event listeners
-
-
- window.removeEventListener('error', handleWindowError);
- };
-
- invokeGuardedCallbackImpl = invokeGuardedCallbackDev;
- }
- }
-
- var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;
-
- var hasError = false;
- var caughtError = null; // Used by event system to capture/rethrow the first error.
-
- var hasRethrowError = false;
- var rethrowError = null;
- var reporter = {
- onError: function (error) {
- hasError = true;
- caughtError = error;
- }
- };
- /**
- * Call a function while guarding against errors that happens within it.
- * Returns an error if it throws, otherwise null.
- *
- * In production, this is implemented using a try-catch. The reason we don't
- * use a try-catch directly is so that we can swap out a different
- * implementation in DEV mode.
- *
- * @param {String} name of the guard to use for logging or debugging
- * @param {Function} func The function to invoke
- * @param {*} context The context to use when calling the function
- * @param {...*} args Arguments for function
- */
-
- function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
- hasError = false;
- caughtError = null;
- invokeGuardedCallbackImpl$1.apply(reporter, arguments);
- }
- /**
- * Same as invokeGuardedCallback, but instead of returning an error, it stores
- * it in a global so it can be rethrown by `rethrowCaughtError` later.
- * TODO: See if caughtError and rethrowError can be unified.
- *
- * @param {String} name of the guard to use for logging or debugging
- * @param {Function} func The function to invoke
- * @param {*} context The context to use when calling the function
- * @param {...*} args Arguments for function
- */
-
- function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {
- invokeGuardedCallback.apply(this, arguments);
-
- if (hasError) {
- var error = clearCaughtError();
-
- if (!hasRethrowError) {
- hasRethrowError = true;
- rethrowError = error;
- }
- }
- }
- /**
- * During execution of guarded functions we will capture the first error which
- * we will rethrow to be handled by the top level error handler.
- */
-
- function rethrowCaughtError() {
- if (hasRethrowError) {
- var error = rethrowError;
- hasRethrowError = false;
- rethrowError = null;
- throw error;
- }
- }
- function hasCaughtError() {
- return hasError;
- }
- function clearCaughtError() {
- if (hasError) {
- var error = caughtError;
- hasError = false;
- caughtError = null;
- return error;
- } else {
- {
- {
- throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
- }
- }
-
- /**
- * Similar to invariant but only logs a warning if the condition is not met.
- * This can be used to log issues in development environments in critical
- * paths. Removing the logging code for production environments will keep the
- * same logic and follow the same code paths.
- */
- var warningWithoutStack = function () {};
-
- {
- warningWithoutStack = function (condition, format) {
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
- args[_key - 2] = arguments[_key];
- }
-
- if (format === undefined) {
- throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
- }
-
- if (args.length > 8) {
- // Check before the condition to catch violations early.
- throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
- }
-
- if (condition) {
- return;
- }
-
- if (typeof console !== 'undefined') {
- var argsWithFormat = args.map(function (item) {
- return '' + item;
- });
- argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
- // breaks IE9: https://github.com/facebook/react/issues/13610
-
- Function.prototype.apply.call(console.error, console, argsWithFormat);
- }
-
- try {
- // --- Welcome to debugging React ---
- // This error was thrown as a convenience so that you can use this stack
- // to find the callsite that caused this warning to fire.
- var argIndex = 0;
- var message = 'Warning: ' + format.replace(/%s/g, function () {
- return args[argIndex++];
- });
- throw new Error(message);
- } catch (x) {}
- };
- }
-
- var warningWithoutStack$1 = warningWithoutStack;
-
- var getFiberCurrentPropsFromNode = null;
- var getInstanceFromNode = null;
- var getNodeFromInstance = null;
- function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {
- getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;
- getInstanceFromNode = getInstanceFromNodeImpl;
- getNodeFromInstance = getNodeFromInstanceImpl;
-
- {
- !(getNodeFromInstance && getInstanceFromNode) ? warningWithoutStack$1(false, 'EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
- }
- }
- var validateEventDispatches;
-
- {
- validateEventDispatches = function (event) {
- var dispatchListeners = event._dispatchListeners;
- var dispatchInstances = event._dispatchInstances;
- var listenersIsArr = Array.isArray(dispatchListeners);
- var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
- var instancesIsArr = Array.isArray(dispatchInstances);
- var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
- !(instancesIsArr === listenersIsArr && instancesLen === listenersLen) ? warningWithoutStack$1(false, 'EventPluginUtils: Invalid `event`.') : void 0;
- };
- }
- /**
- * Dispatch the event to the listener.
- * @param {SyntheticEvent} event SyntheticEvent to handle
- * @param {function} listener Application-level callback
- * @param {*} inst Internal component instance
- */
-
-
- function executeDispatch(event, listener, inst) {
- var type = event.type || 'unknown-event';
- event.currentTarget = getNodeFromInstance(inst);
- invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);
- event.currentTarget = null;
- }
- /**
- * Standard/simple iteration through an event's collected dispatches.
- */
-
- function executeDispatchesInOrder(event) {
- var dispatchListeners = event._dispatchListeners;
- var dispatchInstances = event._dispatchInstances;
-
- {
- validateEventDispatches(event);
- }
-
- if (Array.isArray(dispatchListeners)) {
- for (var i = 0; i < dispatchListeners.length; i++) {
- if (event.isPropagationStopped()) {
- break;
- } // Listeners and Instances are two parallel arrays that are always in sync.
-
-
- executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);
- }
- } else if (dispatchListeners) {
- executeDispatch(event, dispatchListeners, dispatchInstances);
- }
-
- event._dispatchListeners = null;
- event._dispatchInstances = null;
- }
- /**
- * @see executeDispatchesInOrderStopAtTrueImpl
- */
-
-
-
- /**
- * Execution of a "direct" dispatch - there must be at most one dispatch
- * accumulated on the event or it is considered an error. It doesn't really make
- * sense for an event with multiple dispatches (bubbled) to keep track of the
- * return values at each dispatch execution, but it does tend to make sense when
- * dealing with "direct" dispatches.
- *
- * @return {*} The return value of executing the single dispatch.
- */
-
-
- /**
- * @param {SyntheticEvent} event
- * @return {boolean} True iff number of dispatches accumulated is greater than 0.
- */
-
- /**
- * Accumulates items that must not be null or undefined into the first one. This
- * is used to conserve memory by avoiding array allocations, and thus sacrifices
- * API cleanness. Since `current` can be null before being passed in and not
- * null after this function, make sure to assign it back to `current`:
- *
- * `a = accumulateInto(a, b);`
- *
- * This API should be sparingly used. Try `accumulate` for something cleaner.
- *
- * @return {*|array<*>} An accumulation of items.
- */
-
- function accumulateInto(current, next) {
- if (!(next != null)) {
- {
- throw Error("accumulateInto(...): Accumulated items must not be null or undefined.");
- }
- }
-
- if (current == null) {
- return next;
- } // Both are not empty. Warning: Never call x.concat(y) when you are not
- // certain that x is an Array (x could be a string with concat method).
-
-
- if (Array.isArray(current)) {
- if (Array.isArray(next)) {
- current.push.apply(current, next);
- return current;
- }
-
- current.push(next);
- return current;
- }
-
- if (Array.isArray(next)) {
- // A bit too dangerous to mutate `next`.
- return [current].concat(next);
- }
-
- return [current, next];
- }
-
- /**
- * @param {array} arr an "accumulation" of items which is either an Array or
- * a single item. Useful when paired with the `accumulate` module. This is a
- * simple utility that allows us to reason about a collection of items, but
- * handling the case when there is exactly one item (and we do not need to
- * allocate an array).
- * @param {function} cb Callback invoked with each element or a collection.
- * @param {?} [scope] Scope used as `this` in a callback.
- */
- function forEachAccumulated(arr, cb, scope) {
- if (Array.isArray(arr)) {
- arr.forEach(cb, scope);
- } else if (arr) {
- cb.call(scope, arr);
- }
- }
-
- /**
- * Internal queue of events that have accumulated their dispatches and are
- * waiting to have their dispatches executed.
- */
-
- var eventQueue = null;
- /**
- * Dispatches an event and releases it back into the pool, unless persistent.
- *
- * @param {?object} event Synthetic event to be dispatched.
- * @private
- */
-
- var executeDispatchesAndRelease = function (event) {
- if (event) {
- executeDispatchesInOrder(event);
-
- if (!event.isPersistent()) {
- event.constructor.release(event);
- }
- }
- };
-
- var executeDispatchesAndReleaseTopLevel = function (e) {
- return executeDispatchesAndRelease(e);
- };
-
- function runEventsInBatch(events) {
- if (events !== null) {
- eventQueue = accumulateInto(eventQueue, events);
- } // Set `eventQueue` to null before processing it so that we can tell if more
- // events get enqueued while processing.
-
-
- var processingEventQueue = eventQueue;
- eventQueue = null;
-
- if (!processingEventQueue) {
- return;
- }
-
- forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
-
- if (!!eventQueue) {
- {
- throw Error("processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.");
- }
- } // This would be a good time to rethrow if any of the event handlers threw.
-
-
- rethrowCaughtError();
- }
-
- function isInteractive(tag) {
- return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
- }
-
- function shouldPreventMouseEvent(name, type, props) {
- switch (name) {
- case 'onClick':
- case 'onClickCapture':
- case 'onDoubleClick':
- case 'onDoubleClickCapture':
- case 'onMouseDown':
- case 'onMouseDownCapture':
- case 'onMouseMove':
- case 'onMouseMoveCapture':
- case 'onMouseUp':
- case 'onMouseUpCapture':
- return !!(props.disabled && isInteractive(type));
-
- default:
- return false;
- }
- }
- /**
- * This is a unified interface for event plugins to be installed and configured.
- *
- * Event plugins can implement the following properties:
- *
- * `extractEvents` {function(string, DOMEventTarget, string, object): *}
- * Required. When a top-level event is fired, this method is expected to
- * extract synthetic events that will in turn be queued and dispatched.
- *
- * `eventTypes` {object}
- * Optional, plugins that fire events must publish a mapping of registration
- * names that are used to register listeners. Values of this mapping must
- * be objects that contain `registrationName` or `phasedRegistrationNames`.
- *
- * `executeDispatch` {function(object, function, string)}
- * Optional, allows plugins to override how an event gets dispatched. By
- * default, the listener is simply invoked.
- *
- * Each plugin that is injected into `EventsPluginHub` is immediately operable.
- *
- * @public
- */
-
- /**
- * Methods for injecting dependencies.
- */
-
-
- var injection = {
- /**
- * @param {array} InjectedEventPluginOrder
- * @public
- */
- injectEventPluginOrder: injectEventPluginOrder,
-
- /**
- * @param {object} injectedNamesToPlugins Map from names to plugin modules.
- */
- injectEventPluginsByName: injectEventPluginsByName
- };
- /**
- * @param {object} inst The instance, which is the source of events.
- * @param {string} registrationName Name of listener (e.g. `onClick`).
- * @return {?function} The stored callback.
- */
-
- function getListener(inst, registrationName) {
- var listener; // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not
- // live here; needs to be moved to a better place soon
-
- var stateNode = inst.stateNode;
-
- if (!stateNode) {
- // Work in progress (ex: onload events in incremental mode).
- return null;
- }
-
- var props = getFiberCurrentPropsFromNode(stateNode);
-
- if (!props) {
- // Work in progress.
- return null;
- }
-
- listener = props[registrationName];
-
- if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
- return null;
- }
-
- if (!(!listener || typeof listener === 'function')) {
- {
- throw Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type.");
- }
- }
-
- return listener;
- }
- /**
- * Allows registered plugins an opportunity to extract events from top-level
- * native browser events.
- *
- * @return {*} An accumulation of synthetic events.
- * @internal
- */
-
- function extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
- var events = null;
-
- for (var i = 0; i < plugins.length; i++) {
- // Not every plugin in the ordering may be loaded at runtime.
- var possiblePlugin = plugins[i];
-
- if (possiblePlugin) {
- var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
-
- if (extractedEvents) {
- events = accumulateInto(events, extractedEvents);
- }
- }
- }
-
- return events;
- }
-
- function runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
- var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
- runEventsInBatch(events);
- }
-
- var FunctionComponent = 0;
- var ClassComponent = 1;
- var IndeterminateComponent = 2; // Before we know whether it is function or class
-
- var HostRoot = 3; // Root of a host tree. Could be nested inside another node.
-
- var HostPortal = 4; // A subtree. Could be an entry point to a different renderer.
-
- var HostComponent = 5;
- var HostText = 6;
- var Fragment = 7;
- var Mode = 8;
- var ContextConsumer = 9;
- var ContextProvider = 10;
- var ForwardRef = 11;
- var Profiler = 12;
- var SuspenseComponent = 13;
- var MemoComponent = 14;
- var SimpleMemoComponent = 15;
- var LazyComponent = 16;
- var IncompleteClassComponent = 17;
- var DehydratedFragment = 18;
- var SuspenseListComponent = 19;
- var FundamentalComponent = 20;
- var ScopeComponent = 21;
-
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions.
- // Current owner and dispatcher used to share the same ref,
- // but PR #14548 split them out to better support the react-debug-tools package.
-
- if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
- ReactSharedInternals.ReactCurrentDispatcher = {
- current: null
- };
- }
-
- if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
- ReactSharedInternals.ReactCurrentBatchConfig = {
- suspense: null
- };
- }
-
- var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
- var describeComponentFrame = function (name, source, ownerName) {
- var sourceInfo = '';
-
- if (source) {
- var path = source.fileName;
- var fileName = path.replace(BEFORE_SLASH_RE, '');
-
- {
- // In DEV, include code for a common special case:
- // prefer "folder/index.js" instead of just "index.js".
- if (/^index\./.test(fileName)) {
- var match = path.match(BEFORE_SLASH_RE);
-
- if (match) {
- var pathBeforeSlash = match[1];
-
- if (pathBeforeSlash) {
- var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
- fileName = folderName + '/' + fileName;
- }
- }
- }
- }
-
- sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
- } else if (ownerName) {
- sourceInfo = ' (created by ' + ownerName + ')';
- }
-
- return '\n in ' + (name || 'Unknown') + sourceInfo;
- };
-
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
- // nor polyfill, then a plain number is used for performance.
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
- // (unstable) APIs that have been removed. Can we remove the symbols?
-
-
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
- var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
- function getIteratorFn(maybeIterable) {
- if (maybeIterable === null || typeof maybeIterable !== 'object') {
- return null;
- }
-
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
-
- if (typeof maybeIterator === 'function') {
- return maybeIterator;
- }
-
- return null;
- }
-
- /**
- * Similar to invariant but only logs a warning if the condition is not met.
- * This can be used to log issues in development environments in critical
- * paths. Removing the logging code for production environments will keep the
- * same logic and follow the same code paths.
- */
-
- var warning = warningWithoutStack$1;
-
- {
- warning = function (condition, format) {
- if (condition) {
- return;
- }
-
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
- var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args
-
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
- args[_key - 2] = arguments[_key];
- }
-
- warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack]));
- };
- }
-
- var warning$1 = warning;
-
- var Uninitialized = -1;
- var Pending = 0;
- var Resolved = 1;
- var Rejected = 2;
- function refineResolvedLazyComponent(lazyComponent) {
- return lazyComponent._status === Resolved ? lazyComponent._result : null;
- }
- function initializeLazyComponentType(lazyComponent) {
- if (lazyComponent._status === Uninitialized) {
- lazyComponent._status = Pending;
- var ctor = lazyComponent._ctor;
- var thenable = ctor();
- lazyComponent._result = thenable;
- thenable.then(function (moduleObject) {
- if (lazyComponent._status === Pending) {
- var defaultExport = moduleObject.default;
-
- {
- if (defaultExport === undefined) {
- warning$1(false, 'lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
- }
- }
-
- lazyComponent._status = Resolved;
- lazyComponent._result = defaultExport;
- }
- }, function (error) {
- if (lazyComponent._status === Pending) {
- lazyComponent._status = Rejected;
- lazyComponent._result = error;
- }
- });
- }
- }
-
- function getWrappedName(outerType, innerType, wrapperName) {
- var functionName = innerType.displayName || innerType.name || '';
- return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
- }
-
- function getComponentName(type) {
- if (type == null) {
- // Host root, text node or just invalid type.
- return null;
- }
-
- {
- if (typeof type.tag === 'number') {
- warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
- }
- }
-
- if (typeof type === 'function') {
- return type.displayName || type.name || null;
- }
-
- if (typeof type === 'string') {
- return type;
- }
-
- switch (type) {
- case REACT_FRAGMENT_TYPE:
- return 'Fragment';
-
- case REACT_PORTAL_TYPE:
- return 'Portal';
-
- case REACT_PROFILER_TYPE:
- return "Profiler";
-
- case REACT_STRICT_MODE_TYPE:
- return 'StrictMode';
-
- case REACT_SUSPENSE_TYPE:
- return 'Suspense';
-
- case REACT_SUSPENSE_LIST_TYPE:
- return 'SuspenseList';
- }
-
- if (typeof type === 'object') {
- switch (type.$$typeof) {
- case REACT_CONTEXT_TYPE:
- return 'Context.Consumer';
-
- case REACT_PROVIDER_TYPE:
- return 'Context.Provider';
-
- case REACT_FORWARD_REF_TYPE:
- return getWrappedName(type, type.render, 'ForwardRef');
-
- case REACT_MEMO_TYPE:
- return getComponentName(type.type);
-
- case REACT_LAZY_TYPE:
- {
- var thenable = type;
- var resolvedThenable = refineResolvedLazyComponent(thenable);
-
- if (resolvedThenable) {
- return getComponentName(resolvedThenable);
- }
-
- break;
- }
- }
- }
-
- return null;
- }
-
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
-
- function describeFiber(fiber) {
- switch (fiber.tag) {
- case HostRoot:
- case HostPortal:
- case HostText:
- case Fragment:
- case ContextProvider:
- case ContextConsumer:
- return '';
-
- default:
- var owner = fiber._debugOwner;
- var source = fiber._debugSource;
- var name = getComponentName(fiber.type);
- var ownerName = null;
-
- if (owner) {
- ownerName = getComponentName(owner.type);
- }
-
- return describeComponentFrame(name, source, ownerName);
- }
- }
-
- function getStackByFiberInDevAndProd(workInProgress) {
- var info = '';
- var node = workInProgress;
-
- do {
- info += describeFiber(node);
- node = node.return;
- } while (node);
-
- return info;
- }
- var current = null;
- var phase = null;
- function getCurrentFiberOwnerNameInDevOrNull() {
- {
- if (current === null) {
- return null;
- }
-
- var owner = current._debugOwner;
-
- if (owner !== null && typeof owner !== 'undefined') {
- return getComponentName(owner.type);
- }
- }
-
- return null;
- }
- function getCurrentFiberStackInDev() {
- {
- if (current === null) {
- return '';
- } // Safe because if current fiber exists, we are reconciling,
- // and it is guaranteed to be the work-in-progress version.
-
-
- return getStackByFiberInDevAndProd(current);
- }
-
- return '';
- }
- function resetCurrentFiber() {
- {
- ReactDebugCurrentFrame.getCurrentStack = null;
- current = null;
- phase = null;
- }
- }
- function setCurrentFiber(fiber) {
- {
- ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;
- current = fiber;
- phase = null;
- }
- }
- function setCurrentPhase(lifeCyclePhase) {
- {
- phase = lifeCyclePhase;
- }
- }
-
- var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
-
- function endsWith(subject, search) {
- var length = subject.length;
- return subject.substring(length - search.length, length) === search;
- }
-
- var PLUGIN_EVENT_SYSTEM = 1;
- var RESPONDER_EVENT_SYSTEM = 1 << 1;
- var IS_PASSIVE = 1 << 2;
- var IS_ACTIVE = 1 << 3;
- var PASSIVE_NOT_SUPPORTED = 1 << 4;
- var IS_REPLAYED = 1 << 5;
-
- var restoreImpl = null;
- var restoreTarget = null;
- var restoreQueue = null;
-
- function restoreStateOfTarget(target) {
- // We perform this translation at the end of the event loop so that we
- // always receive the correct fiber here
- var internalInstance = getInstanceFromNode(target);
-
- if (!internalInstance) {
- // Unmounted
- return;
- }
-
- if (!(typeof restoreImpl === 'function')) {
- {
- throw Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
-
- var props = getFiberCurrentPropsFromNode(internalInstance.stateNode);
- restoreImpl(internalInstance.stateNode, internalInstance.type, props);
- }
-
- function setRestoreImplementation(impl) {
- restoreImpl = impl;
- }
- function enqueueStateRestore(target) {
- if (restoreTarget) {
- if (restoreQueue) {
- restoreQueue.push(target);
- } else {
- restoreQueue = [target];
- }
- } else {
- restoreTarget = target;
- }
- }
- function needsStateRestore() {
- return restoreTarget !== null || restoreQueue !== null;
- }
- function restoreStateIfNeeded() {
- if (!restoreTarget) {
- return;
- }
-
- var target = restoreTarget;
- var queuedTargets = restoreQueue;
- restoreTarget = null;
- restoreQueue = null;
- restoreStateOfTarget(target);
-
- if (queuedTargets) {
- for (var i = 0; i < queuedTargets.length; i++) {
- restoreStateOfTarget(queuedTargets[i]);
- }
- }
- }
-
- var enableUserTimingAPI = true; // Helps identify side effects in render-phase lifecycle hooks and setState
- // reducers by double invoking them in Strict Mode.
-
- var debugRenderPhaseSideEffectsForStrictMode = true; // To preserve the "Pause on caught exceptions" behavior of the debugger, we
- // replay the begin phase of a failed component inside invokeGuardedCallback.
-
- var replayFailedUnitOfWorkWithInvokeGuardedCallback = true; // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
-
- var warnAboutDeprecatedLifecycles = true; // Gather advanced timing metrics for Profiler subtrees.
-
- var enableProfilerTimer = true; // Trace which interactions trigger each commit.
-
- var enableSchedulerTracing = true; // SSR experiments
-
- var enableSuspenseServerRenderer = false;
- var enableSelectiveHydration = false; // Only used in www builds.
-
- // Only used in www builds.
-
- // Disable javascript: URL strings in href for XSS protection.
-
- var disableJavaScriptURLs = false; // React Fire: prevent the value and checked attributes from syncing
- // with their related DOM properties
-
- var disableInputAttributeSyncing = false; // These APIs will no longer be "unstable" in the upcoming 16.7 release,
- // Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
-
- var exposeConcurrentModeAPIs = false;
- var warnAboutShorthandPropertyCollision = false; // Experimental React Flare event system and event components support.
-
- var enableFlareAPI = false; // Experimental Host Component support.
-
- var enableFundamentalAPI = false; // Experimental Scope support.
-
- var enableScopeAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
-
- // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
- // Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version
-
- var warnAboutUnmockedScheduler = false; // For tests, we flush suspense fallbacks in an act scope;
- // *except* in some of our own tests, where we test incremental loading states.
-
- var flushSuspenseFallbacksInTests = true; // Add a callback property to suspense to notify which promises are currently
- // in the update queue. This allows reporting and tracing of what is causing
- // the user to see a loading state.
- // Also allows hydration callbacks to fire when a dehydrated boundary gets
- // hydrated or deleted.
-
- var enableSuspenseCallback = false; // Part of the simplification of React.createElement so we can eventually move
- // from React.createElement to React.jsx
- // https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
-
- var warnAboutDefaultPropsOnFunctionComponents = false;
- var warnAboutStringRefs = false;
- var disableLegacyContext = false;
- var disableSchedulerTimeoutBasedOnReactExpirationTime = false;
- var enableTrustedTypesIntegration = false; // Flag to turn event.target and event.currentTarget in ReactNative from a reactTag to a component instance
-
- // the renderer. Such as when we're dispatching events or if third party
- // libraries need to call batchedUpdates. Eventually, this API will go away when
- // everything is batched by default. We'll then have a similar API to opt-out of
- // scheduled work and instead do synchronous work.
- // Defaults
-
- var batchedUpdatesImpl = function (fn, bookkeeping) {
- return fn(bookkeeping);
- };
-
- var discreteUpdatesImpl = function (fn, a, b, c) {
- return fn(a, b, c);
- };
-
- var flushDiscreteUpdatesImpl = function () {};
-
- var batchedEventUpdatesImpl = batchedUpdatesImpl;
- var isInsideEventHandler = false;
- var isBatchingEventUpdates = false;
-
- function finishEventHandler() {
- // Here we wait until all updates have propagated, which is important
- // when using controlled components within layers:
- // https://github.com/facebook/react/issues/1698
- // Then we restore state of any controlled component.
- var controlledComponentsHavePendingUpdates = needsStateRestore();
-
- if (controlledComponentsHavePendingUpdates) {
- // If a controlled event was fired, we may need to restore the state of
- // the DOM node back to the controlled value. This is necessary when React
- // bails out of the update without touching the DOM.
- flushDiscreteUpdatesImpl();
- restoreStateIfNeeded();
- }
- }
-
- function batchedUpdates(fn, bookkeeping) {
- if (isInsideEventHandler) {
- // If we are currently inside another batch, we need to wait until it
- // fully completes before restoring state.
- return fn(bookkeeping);
- }
-
- isInsideEventHandler = true;
-
- try {
- return batchedUpdatesImpl(fn, bookkeeping);
- } finally {
- isInsideEventHandler = false;
- finishEventHandler();
- }
- }
- function batchedEventUpdates(fn, a, b) {
- if (isBatchingEventUpdates) {
- // If we are currently inside another batch, we need to wait until it
- // fully completes before restoring state.
- return fn(a, b);
- }
-
- isBatchingEventUpdates = true;
-
- try {
- return batchedEventUpdatesImpl(fn, a, b);
- } finally {
- isBatchingEventUpdates = false;
- finishEventHandler();
- }
- } // This is for the React Flare event system
-
- function executeUserEventHandler(fn, value) {
- var previouslyInEventHandler = isInsideEventHandler;
-
- try {
- isInsideEventHandler = true;
- var type = typeof value === 'object' && value !== null ? value.type : '';
- invokeGuardedCallbackAndCatchFirstError(type, fn, undefined, value);
- } finally {
- isInsideEventHandler = previouslyInEventHandler;
- }
- }
- function discreteUpdates(fn, a, b, c) {
- var prevIsInsideEventHandler = isInsideEventHandler;
- isInsideEventHandler = true;
-
- try {
- return discreteUpdatesImpl(fn, a, b, c);
- } finally {
- isInsideEventHandler = prevIsInsideEventHandler;
-
- if (!isInsideEventHandler) {
- finishEventHandler();
- }
- }
- }
- var lastFlushedEventTimeStamp = 0;
- function flushDiscreteUpdatesIfNeeded(timeStamp) {
- // event.timeStamp isn't overly reliable due to inconsistencies in
- // how different browsers have historically provided the time stamp.
- // Some browsers provide high-resolution time stamps for all events,
- // some provide low-resolution time stamps for all events. FF < 52
- // even mixes both time stamps together. Some browsers even report
- // negative time stamps or time stamps that are 0 (iOS9) in some cases.
- // Given we are only comparing two time stamps with equality (!==),
- // we are safe from the resolution differences. If the time stamp is 0
- // we bail-out of preventing the flush, which can affect semantics,
- // such as if an earlier flush removes or adds event listeners that
- // are fired in the subsequent flush. However, this is the same
- // behaviour as we had before this change, so the risks are low.
- if (!isInsideEventHandler && (!enableFlareAPI || timeStamp === 0 || lastFlushedEventTimeStamp !== timeStamp)) {
- lastFlushedEventTimeStamp = timeStamp;
- flushDiscreteUpdatesImpl();
- }
- }
- function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {
- batchedUpdatesImpl = _batchedUpdatesImpl;
- discreteUpdatesImpl = _discreteUpdatesImpl;
- flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;
- batchedEventUpdatesImpl = _batchedEventUpdatesImpl;
- }
-
- var DiscreteEvent = 0;
- var UserBlockingEvent = 1;
- var ContinuousEvent = 2;
-
- // CommonJS interop named imports.
-
- var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;
- var runWithPriority = Scheduler.unstable_runWithPriority;
- var listenToResponderEventTypesImpl;
- function setListenToResponderEventTypes(_listenToResponderEventTypesImpl) {
- listenToResponderEventTypesImpl = _listenToResponderEventTypesImpl;
- }
- var rootEventTypesToEventResponderInstances = new Map();
- var DoNotPropagateToNextResponder = 0;
- var PropagateToNextResponder = 1;
- var currentTimeStamp = 0;
- var currentInstance = null;
- var currentDocument = null;
- var currentPropagationBehavior = DoNotPropagateToNextResponder;
- var eventResponderContext = {
- dispatchEvent: function (eventValue, eventListener, eventPriority) {
- validateResponderContext();
- validateEventValue(eventValue);
-
- switch (eventPriority) {
- case DiscreteEvent:
- {
- flushDiscreteUpdatesIfNeeded(currentTimeStamp);
- discreteUpdates(function () {
- return executeUserEventHandler(eventListener, eventValue);
- });
- break;
- }
-
- case UserBlockingEvent:
- {
- runWithPriority(UserBlockingPriority, function () {
- return executeUserEventHandler(eventListener, eventValue);
- });
- break;
- }
-
- case ContinuousEvent:
- {
- executeUserEventHandler(eventListener, eventValue);
- break;
- }
- }
- },
- isTargetWithinResponder: function (target) {
- validateResponderContext();
-
- if (target != null) {
- var fiber = getClosestInstanceFromNode(target);
- var responderFiber = currentInstance.fiber;
-
- while (fiber !== null) {
- if (fiber === responderFiber || fiber.alternate === responderFiber) {
- return true;
- }
-
- fiber = fiber.return;
- }
- }
-
- return false;
- },
- isTargetWithinResponderScope: function (target) {
- validateResponderContext();
- var componentInstance = currentInstance;
- var responder = componentInstance.responder;
-
- if (target != null) {
- var fiber = getClosestInstanceFromNode(target);
- var responderFiber = currentInstance.fiber;
-
- while (fiber !== null) {
- if (fiber === responderFiber || fiber.alternate === responderFiber) {
- return true;
- }
-
- if (doesFiberHaveResponder(fiber, responder)) {
- return false;
- }
-
- fiber = fiber.return;
- }
- }
-
- return false;
- },
- isTargetWithinNode: function (childTarget, parentTarget) {
- validateResponderContext();
- var childFiber = getClosestInstanceFromNode(childTarget);
- var parentFiber = getClosestInstanceFromNode(parentTarget);
-
- if (childFiber != null && parentFiber != null) {
- var parentAlternateFiber = parentFiber.alternate;
- var node = childFiber;
-
- while (node !== null) {
- if (node === parentFiber || node === parentAlternateFiber) {
- return true;
- }
-
- node = node.return;
- }
-
- return false;
- } // Fallback to DOM APIs
-
-
- return parentTarget.contains(childTarget);
- },
- addRootEventTypes: function (rootEventTypes) {
- validateResponderContext();
- listenToResponderEventTypesImpl(rootEventTypes, currentDocument);
-
- for (var i = 0; i < rootEventTypes.length; i++) {
- var rootEventType = rootEventTypes[i];
- var eventResponderInstance = currentInstance;
- registerRootEventType(rootEventType, eventResponderInstance);
- }
- },
- removeRootEventTypes: function (rootEventTypes) {
- validateResponderContext();
-
- for (var i = 0; i < rootEventTypes.length; i++) {
- var rootEventType = rootEventTypes[i];
- var rootEventResponders = rootEventTypesToEventResponderInstances.get(rootEventType);
- var rootEventTypesSet = currentInstance.rootEventTypes;
-
- if (rootEventTypesSet !== null) {
- rootEventTypesSet.delete(rootEventType);
- }
-
- if (rootEventResponders !== undefined) {
- rootEventResponders.delete(currentInstance);
- }
- }
- },
- getActiveDocument: getActiveDocument,
- objectAssign: _assign,
- getTimeStamp: function () {
- validateResponderContext();
- return currentTimeStamp;
- },
- isTargetWithinHostComponent: function (target, elementType) {
- validateResponderContext();
- var fiber = getClosestInstanceFromNode(target);
-
- while (fiber !== null) {
- if (fiber.tag === HostComponent && fiber.type === elementType) {
- return true;
- }
-
- fiber = fiber.return;
- }
-
- return false;
- },
- continuePropagation: function () {
- currentPropagationBehavior = PropagateToNextResponder;
- },
- enqueueStateRestore: enqueueStateRestore,
- getResponderNode: function () {
- validateResponderContext();
- var responderFiber = currentInstance.fiber;
-
- if (responderFiber.tag === ScopeComponent) {
- return null;
- }
-
- return responderFiber.stateNode;
- }
- };
-
- function validateEventValue(eventValue) {
- if (typeof eventValue === 'object' && eventValue !== null) {
- var target = eventValue.target,
- type = eventValue.type,
- timeStamp = eventValue.timeStamp;
-
- if (target == null || type == null || timeStamp == null) {
- throw new Error('context.dispatchEvent: "target", "timeStamp", and "type" fields on event object are required.');
- }
-
- var showWarning = function (name) {
- {
- warning$1(false, '%s is not available on event objects created from event responder modules (React Flare). ' + 'Try wrapping in a conditional, i.e. `if (event.type !== "press") { event.%s }`', name, name);
- }
- };
-
- eventValue.isDefaultPrevented = function () {
- {
- showWarning('isDefaultPrevented()');
- }
- };
-
- eventValue.isPropagationStopped = function () {
- {
- showWarning('isPropagationStopped()');
- }
- }; // $FlowFixMe: we don't need value, Flow thinks we do
-
-
- Object.defineProperty(eventValue, 'nativeEvent', {
- get: function () {
- {
- showWarning('nativeEvent');
- }
- }
- });
- }
- }
-
- function doesFiberHaveResponder(fiber, responder) {
- var tag = fiber.tag;
-
- if (tag === HostComponent || tag === ScopeComponent) {
- var dependencies = fiber.dependencies;
-
- if (dependencies !== null) {
- var respondersMap = dependencies.responders;
-
- if (respondersMap !== null && respondersMap.has(responder)) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- function getActiveDocument() {
- return currentDocument;
- }
-
- function createDOMResponderEvent(topLevelType, nativeEvent, nativeEventTarget, passive, passiveSupported) {
- var _ref = nativeEvent,
- buttons = _ref.buttons,
- pointerType = _ref.pointerType;
- var eventPointerType = '';
-
- if (pointerType !== undefined) {
- eventPointerType = pointerType;
- } else if (nativeEvent.key !== undefined) {
- eventPointerType = 'keyboard';
- } else if (buttons !== undefined) {
- eventPointerType = 'mouse';
- } else if (nativeEvent.changedTouches !== undefined) {
- eventPointerType = 'touch';
- }
-
- return {
- nativeEvent: nativeEvent,
- passive: passive,
- passiveSupported: passiveSupported,
- pointerType: eventPointerType,
- target: nativeEventTarget,
- type: topLevelType
- };
- }
-
- function responderEventTypesContainType(eventTypes, type) {
- for (var i = 0, len = eventTypes.length; i < len; i++) {
- if (eventTypes[i] === type) {
- return true;
- }
- }
-
- return false;
- }
-
- function validateResponderTargetEventTypes(eventType, responder) {
- var targetEventTypes = responder.targetEventTypes; // Validate the target event type exists on the responder
-
- if (targetEventTypes !== null) {
- return responderEventTypesContainType(targetEventTypes, eventType);
- }
-
- return false;
- }
-
- function traverseAndHandleEventResponderInstances(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags) {
- var isPassiveEvent = (eventSystemFlags & IS_PASSIVE) !== 0;
- var isPassiveSupported = (eventSystemFlags & PASSIVE_NOT_SUPPORTED) === 0;
- var isPassive = isPassiveEvent || !isPassiveSupported;
- var eventType = isPassive ? topLevelType : topLevelType + '_active'; // Trigger event responders in this order:
- // - Bubble target responder phase
- // - Root responder phase
-
- var visitedResponders = new Set();
- var responderEvent = createDOMResponderEvent(topLevelType, nativeEvent, nativeEventTarget, isPassiveEvent, isPassiveSupported);
- var node = targetFiber;
- var insidePortal = false;
-
- while (node !== null) {
- var _node = node,
- dependencies = _node.dependencies,
- tag = _node.tag;
-
- if (tag === HostPortal) {
- insidePortal = true;
- } else if ((tag === HostComponent || tag === ScopeComponent) && dependencies !== null) {
- var respondersMap = dependencies.responders;
-
- if (respondersMap !== null) {
- var responderInstances = Array.from(respondersMap.values());
-
- for (var i = 0, length = responderInstances.length; i < length; i++) {
- var responderInstance = responderInstances[i];
- var props = responderInstance.props,
- responder = responderInstance.responder,
- state = responderInstance.state;
-
- if (!visitedResponders.has(responder) && validateResponderTargetEventTypes(eventType, responder) && (!insidePortal || responder.targetPortalPropagation)) {
- visitedResponders.add(responder);
- var onEvent = responder.onEvent;
-
- if (onEvent !== null) {
- currentInstance = responderInstance;
- onEvent(responderEvent, eventResponderContext, props, state);
-
- if (currentPropagationBehavior === PropagateToNextResponder) {
- visitedResponders.delete(responder);
- currentPropagationBehavior = DoNotPropagateToNextResponder;
- }
- }
- }
- }
- }
- }
-
- node = node.return;
- } // Root phase
-
-
- var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(eventType);
-
- if (rootEventResponderInstances !== undefined) {
- var _responderInstances = Array.from(rootEventResponderInstances);
-
- for (var _i = 0; _i < _responderInstances.length; _i++) {
- var _responderInstance = _responderInstances[_i];
- var props = _responderInstance.props,
- responder = _responderInstance.responder,
- state = _responderInstance.state;
- var onRootEvent = responder.onRootEvent;
-
- if (onRootEvent !== null) {
- currentInstance = _responderInstance;
- onRootEvent(responderEvent, eventResponderContext, props, state);
- }
- }
- }
- }
-
- function mountEventResponder(responder, responderInstance, props, state) {
- var onMount = responder.onMount;
-
- if (onMount !== null) {
- var previousInstance = currentInstance;
- currentInstance = responderInstance;
-
- try {
- batchedEventUpdates(function () {
- onMount(eventResponderContext, props, state);
- });
- } finally {
- currentInstance = previousInstance;
- }
- }
- }
- function unmountEventResponder(responderInstance) {
- var responder = responderInstance.responder;
- var onUnmount = responder.onUnmount;
-
- if (onUnmount !== null) {
- var props = responderInstance.props,
- state = responderInstance.state;
- var previousInstance = currentInstance;
- currentInstance = responderInstance;
-
- try {
- batchedEventUpdates(function () {
- onUnmount(eventResponderContext, props, state);
- });
- } finally {
- currentInstance = previousInstance;
- }
- }
-
- var rootEventTypesSet = responderInstance.rootEventTypes;
-
- if (rootEventTypesSet !== null) {
- var rootEventTypes = Array.from(rootEventTypesSet);
-
- for (var i = 0; i < rootEventTypes.length; i++) {
- var topLevelEventType = rootEventTypes[i];
- var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(topLevelEventType);
-
- if (rootEventResponderInstances !== undefined) {
- rootEventResponderInstances.delete(responderInstance);
- }
- }
- }
- }
-
- function validateResponderContext() {
- if (!(currentInstance !== null)) {
- {
- throw Error("An event responder context was used outside of an event cycle.");
- }
- }
- }
-
- function dispatchEventForResponderEventSystem(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags) {
- if (enableFlareAPI) {
- var previousInstance = currentInstance;
- var previousTimeStamp = currentTimeStamp;
- var previousDocument = currentDocument;
- var previousPropagationBehavior = currentPropagationBehavior;
- currentPropagationBehavior = DoNotPropagateToNextResponder; // nodeType 9 is DOCUMENT_NODE
-
- currentDocument = nativeEventTarget.nodeType === 9 ? nativeEventTarget : nativeEventTarget.ownerDocument; // We might want to control timeStamp another way here
-
- currentTimeStamp = nativeEvent.timeStamp;
-
- try {
- batchedEventUpdates(function () {
- traverseAndHandleEventResponderInstances(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags);
- });
- } finally {
- currentInstance = previousInstance;
- currentTimeStamp = previousTimeStamp;
- currentDocument = previousDocument;
- currentPropagationBehavior = previousPropagationBehavior;
- }
- }
- }
- function addRootEventTypesForResponderInstance(responderInstance, rootEventTypes) {
- for (var i = 0; i < rootEventTypes.length; i++) {
- var rootEventType = rootEventTypes[i];
- registerRootEventType(rootEventType, responderInstance);
- }
- }
-
- function registerRootEventType(rootEventType, eventResponderInstance) {
- var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(rootEventType);
-
- if (rootEventResponderInstances === undefined) {
- rootEventResponderInstances = new Set();
- rootEventTypesToEventResponderInstances.set(rootEventType, rootEventResponderInstances);
- }
-
- var rootEventTypesSet = eventResponderInstance.rootEventTypes;
-
- if (rootEventTypesSet === null) {
- rootEventTypesSet = eventResponderInstance.rootEventTypes = new Set();
- }
-
- if (!!rootEventTypesSet.has(rootEventType)) {
- {
- throw Error("addRootEventTypes() found a duplicate root event type of \"" + rootEventType + "\". This might be because the event type exists in the event responder \"rootEventTypes\" array or because of a previous addRootEventTypes() using this root event type.");
- }
- }
-
- rootEventTypesSet.add(rootEventType);
- rootEventResponderInstances.add(eventResponderInstance);
- }
-
- // A reserved attribute.
- // It is handled by React separately and shouldn't be written to the DOM.
- var RESERVED = 0; // A simple string attribute.
- // Attributes that aren't in the whitelist are presumed to have this type.
-
- var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called
- // "enumerated" attributes with "true" and "false" as possible values.
- // When true, it should be set to a "true" string.
- // When false, it should be set to a "false" string.
-
- var BOOLEANISH_STRING = 2; // A real boolean attribute.
- // When true, it should be present (set either to an empty string or its name).
- // When false, it should be omitted.
-
- var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.
- // When true, it should be present (set either to an empty string or its name).
- // When false, it should be omitted.
- // For any other value, should be present with that value.
-
- var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.
- // When falsy, it should be removed.
-
- var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.
- // When falsy, it should be removed.
-
- var POSITIVE_NUMERIC = 6;
-
- /* eslint-disable max-len */
- var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
- /* eslint-enable max-len */
-
- var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
-
- var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
- var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var illegalAttributeNameCache = {};
- var validatedAttributeNameCache = {};
- function isAttributeNameSafe(attributeName) {
- if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
- return true;
- }
-
- if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
- return false;
- }
-
- if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
- validatedAttributeNameCache[attributeName] = true;
- return true;
- }
-
- illegalAttributeNameCache[attributeName] = true;
-
- {
- warning$1(false, 'Invalid attribute name: `%s`', attributeName);
- }
-
- return false;
- }
- function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
- if (propertyInfo !== null) {
- return propertyInfo.type === RESERVED;
- }
-
- if (isCustomComponentTag) {
- return false;
- }
-
- if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
- return true;
- }
-
- return false;
- }
- function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
- if (propertyInfo !== null && propertyInfo.type === RESERVED) {
- return false;
- }
-
- switch (typeof value) {
- case 'function': // $FlowIssue symbol is perfectly valid here
-
- case 'symbol':
- // eslint-disable-line
- return true;
-
- case 'boolean':
- {
- if (isCustomComponentTag) {
- return false;
- }
-
- if (propertyInfo !== null) {
- return !propertyInfo.acceptsBooleans;
- } else {
- var prefix = name.toLowerCase().slice(0, 5);
- return prefix !== 'data-' && prefix !== 'aria-';
- }
- }
-
- default:
- return false;
- }
- }
- function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
- if (value === null || typeof value === 'undefined') {
- return true;
- }
-
- if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
- return true;
- }
-
- if (isCustomComponentTag) {
- return false;
- }
-
- if (propertyInfo !== null) {
- switch (propertyInfo.type) {
- case BOOLEAN:
- return !value;
-
- case OVERLOADED_BOOLEAN:
- return value === false;
-
- case NUMERIC:
- return isNaN(value);
-
- case POSITIVE_NUMERIC:
- return isNaN(value) || value < 1;
- }
- }
-
- return false;
- }
- function getPropertyInfo(name) {
- return properties.hasOwnProperty(name) ? properties[name] : null;
- }
-
- function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) {
- this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
- this.attributeName = attributeName;
- this.attributeNamespace = attributeNamespace;
- this.mustUseProperty = mustUseProperty;
- this.propertyName = name;
- this.type = type;
- this.sanitizeURL = sanitizeURL;
- } // When adding attributes to this list, be sure to also add them to
- // the `possibleStandardNames` module to ensure casing and incorrect
- // name warnings.
-
-
- var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.
-
- ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular
- // elements (not just inputs). Now that ReactDOMInput assigns to the
- // defaultValue property -- do we need this?
- 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
- name, // attributeName
- null, // attributeNamespace
- false);
- }); // A few React string attributes have a different name.
- // This is a mapping from React prop names to the attribute names.
-
- [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
- var name = _ref[0],
- attributeName = _ref[1];
- properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
- attributeName, // attributeName
- null, // attributeNamespace
- false);
- }); // These are "enumerated" HTML attributes that accept "true" and "false".
- // In React, we let users pass `true` and `false` even though technically
- // these aren't boolean attributes (they are coerced to strings).
-
- ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
- name.toLowerCase(), // attributeName
- null, // attributeNamespace
- false);
- }); // These are "enumerated" SVG attributes that accept "true" and "false".
- // In React, we let users pass `true` and `false` even though technically
- // these aren't boolean attributes (they are coerced to strings).
- // Since these are SVG attributes, their attribute names are case-sensitive.
-
- ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
- name, // attributeName
- null, // attributeNamespace
- false);
- }); // These are HTML boolean attributes.
-
- ['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM
- // on the client side because the browsers are inconsistent. Instead we call focus().
- 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata
- 'itemScope'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
- name.toLowerCase(), // attributeName
- null, // attributeNamespace
- false);
- }); // These are the few React props that we set as DOM properties
- // rather than attributes. These are all booleans.
-
- ['checked', // Note: `option.selected` is not updated if `select.multiple` is
- // disabled with `removeAttribute`. We have special logic for handling this.
- 'multiple', 'muted', 'selected'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
- name, // attributeName
- null, // attributeNamespace
- false);
- }); // These are HTML attributes that are "overloaded booleans": they behave like
- // booleans, but can also accept a string value.
-
- ['capture', 'download'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
- name, // attributeName
- null, // attributeNamespace
- false);
- }); // These are HTML attributes that must be positive numbers.
-
- ['cols', 'rows', 'size', 'span'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
- name, // attributeName
- null, // attributeNamespace
- false);
- }); // These are HTML attributes that must be numbers.
-
- ['rowSpan', 'start'].forEach(function (name) {
- properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
- name.toLowerCase(), // attributeName
- null, // attributeNamespace
- false);
- });
- var CAMELIZE = /[\-\:]([a-z])/g;
-
- var capitalize = function (token) {
- return token[1].toUpperCase();
- }; // This is a list of all SVG attributes that need special casing, namespacing,
- // or boolean value assignment. Regular attributes that just accept strings
- // and have the same names are omitted, just like in the HTML whitelist.
- // Some of these attributes can be hard to find. This list was created by
- // scrapping the MDN documentation.
-
-
- ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'].forEach(function (attributeName) {
- var name = attributeName.replace(CAMELIZE, capitalize);
- properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
- attributeName, null, // attributeNamespace
- false);
- }); // String SVG attributes with the xlink namespace.
-
- ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {
- var name = attributeName.replace(CAMELIZE, capitalize);
- properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
- attributeName, 'http://www.w3.org/1999/xlink', false);
- }); // String SVG attributes with the xml namespace.
-
- ['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) {
- var name = attributeName.replace(CAMELIZE, capitalize);
- properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
- attributeName, 'http://www.w3.org/XML/1998/namespace', false);
- }); // These attribute exists both in HTML and SVG.
- // The attribute name is case-sensitive in SVG so we can't just use
- // the React name like we do for attributes that exist only in HTML.
-
- ['tabIndex', 'crossOrigin'].forEach(function (attributeName) {
- properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
- attributeName.toLowerCase(), // attributeName
- null, // attributeNamespace
- false);
- }); // These attributes accept URLs. These must not allow javascript: URLS.
- // These will also need to accept Trusted Types object in the future.
-
- var xlinkHref = 'xlinkHref';
- properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty
- 'xlink:href', 'http://www.w3.org/1999/xlink', true);
- ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {
- properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
- attributeName.toLowerCase(), // attributeName
- null, // attributeNamespace
- true);
- });
-
- var ReactDebugCurrentFrame$1 = null;
-
- {
- ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
- } // A javascript: URL can contain leading C0 control or \u0020 SPACE,
- // and any newline or tab are filtered out as if they're not part of the URL.
- // https://url.spec.whatwg.org/#url-parsing
- // Tab or newline are defined as \r\n\t:
- // https://infra.spec.whatwg.org/#ascii-tab-or-newline
- // A C0 control is a code point in the range \u0000 NULL to \u001F
- // INFORMATION SEPARATOR ONE, inclusive:
- // https://infra.spec.whatwg.org/#c0-control-or-space
-
- /* eslint-disable max-len */
-
-
- var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
- var didWarn = false;
-
- function sanitizeURL(url) {
- if (disableJavaScriptURLs) {
- if (!!isJavaScriptProtocol.test(url)) {
- {
- throw Error("React has blocked a javascript: URL as a security precaution." + (ReactDebugCurrentFrame$1.getStackAddendum()));
- }
- }
- } else if ( true && !didWarn && isJavaScriptProtocol.test(url)) {
- didWarn = true;
- warning$1(false, 'A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));
- }
- }
-
- // Flow does not allow string concatenation of most non-string types. To work
- // around this limitation, we use an opaque type that can only be obtained by
- // passing the value through getToStringValue first.
- function toString(value) {
- return '' + value;
- }
- function getToStringValue(value) {
- switch (typeof value) {
- case 'boolean':
- case 'number':
- case 'object':
- case 'string':
- case 'undefined':
- return value;
-
- default:
- // function, symbol are assigned as empty strings
- return '';
- }
- }
- /** Trusted value is a wrapper for "safe" values which can be assigned to DOM execution sinks. */
-
- /**
- * We allow passing objects with toString method as element attributes or in dangerouslySetInnerHTML
- * and we do validations that the value is safe. Once we do validation we want to use the validated
- * value instead of the object (because object.toString may return something else on next call).
- *
- * If application uses Trusted Types we don't stringify trusted values, but preserve them as objects.
- */
- var toStringOrTrustedType = toString;
-
- if (enableTrustedTypesIntegration && typeof trustedTypes !== 'undefined') {
- toStringOrTrustedType = function (value) {
- if (typeof value === 'object' && (trustedTypes.isHTML(value) || trustedTypes.isScript(value) || trustedTypes.isScriptURL(value) ||
- /* TrustedURLs are deprecated and will be removed soon: https://github.com/WICG/trusted-types/pull/204 */
- trustedTypes.isURL && trustedTypes.isURL(value))) {
- // Pass Trusted Types through.
- return value;
- }
-
- return toString(value);
- };
- }
-
- /**
- * Set attribute for a node. The attribute value can be either string or
- * Trusted value (if application uses Trusted Types).
- */
- function setAttribute(node, attributeName, attributeValue) {
- node.setAttribute(attributeName, attributeValue);
- }
- /**
- * Set attribute with namespace for a node. The attribute value can be either string or
- * Trusted value (if application uses Trusted Types).
- */
-
- function setAttributeNS(node, attributeNamespace, attributeName, attributeValue) {
- node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
- }
-
- /**
- * Get the value for a property on a node. Only used in DEV for SSR validation.
- * The "expected" argument is used as a hint of what the expected value is.
- * Some properties have multiple equivalent values.
- */
- function getValueForProperty(node, name, expected, propertyInfo) {
- {
- if (propertyInfo.mustUseProperty) {
- var propertyName = propertyInfo.propertyName;
- return node[propertyName];
- } else {
- if (!disableJavaScriptURLs && propertyInfo.sanitizeURL) {
- // If we haven't fully disabled javascript: URLs, and if
- // the hydration is successful of a javascript: URL, we
- // still want to warn on the client.
- sanitizeURL('' + expected);
- }
-
- var attributeName = propertyInfo.attributeName;
- var stringValue = null;
-
- if (propertyInfo.type === OVERLOADED_BOOLEAN) {
- if (node.hasAttribute(attributeName)) {
- var value = node.getAttribute(attributeName);
-
- if (value === '') {
- return true;
- }
-
- if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
- return value;
- }
-
- if (value === '' + expected) {
- return expected;
- }
-
- return value;
- }
- } else if (node.hasAttribute(attributeName)) {
- if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
- // We had an attribute but shouldn't have had one, so read it
- // for the error message.
- return node.getAttribute(attributeName);
- }
-
- if (propertyInfo.type === BOOLEAN) {
- // If this was a boolean, it doesn't matter what the value is
- // the fact that we have it is the same as the expected.
- return expected;
- } // Even if this property uses a namespace we use getAttribute
- // because we assume its namespaced name is the same as our config.
- // To use getAttributeNS we need the local name which we don't have
- // in our config atm.
-
-
- stringValue = node.getAttribute(attributeName);
- }
-
- if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
- return stringValue === null ? expected : stringValue;
- } else if (stringValue === '' + expected) {
- return expected;
- } else {
- return stringValue;
- }
- }
- }
- }
- /**
- * Get the value for a attribute on a node. Only used in DEV for SSR validation.
- * The third argument is used as a hint of what the expected value is. Some
- * attributes have multiple equivalent values.
- */
-
- function getValueForAttribute(node, name, expected) {
- {
- if (!isAttributeNameSafe(name)) {
- return;
- }
-
- if (!node.hasAttribute(name)) {
- return expected === undefined ? undefined : null;
- }
-
- var value = node.getAttribute(name);
-
- if (value === '' + expected) {
- return expected;
- }
-
- return value;
- }
- }
- /**
- * Sets the value for a property on a node.
- *
- * @param {DOMElement} node
- * @param {string} name
- * @param {*} value
- */
-
- function setValueForProperty(node, name, value, isCustomComponentTag) {
- var propertyInfo = getPropertyInfo(name);
-
- if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
- return;
- }
-
- if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
- value = null;
- } // If the prop isn't in the special list, treat it as a simple attribute.
-
-
- if (isCustomComponentTag || propertyInfo === null) {
- if (isAttributeNameSafe(name)) {
- var _attributeName = name;
-
- if (value === null) {
- node.removeAttribute(_attributeName);
- } else {
- setAttribute(node, _attributeName, toStringOrTrustedType(value));
- }
- }
-
- return;
- }
-
- var mustUseProperty = propertyInfo.mustUseProperty;
-
- if (mustUseProperty) {
- var propertyName = propertyInfo.propertyName;
-
- if (value === null) {
- var type = propertyInfo.type;
- node[propertyName] = type === BOOLEAN ? false : '';
- } else {
- // Contrary to `setAttribute`, object properties are properly
- // `toString`ed by IE8/9.
- node[propertyName] = value;
- }
-
- return;
- } // The rest are treated as attributes with special cases.
-
-
- var attributeName = propertyInfo.attributeName,
- attributeNamespace = propertyInfo.attributeNamespace;
-
- if (value === null) {
- node.removeAttribute(attributeName);
- } else {
- var _type = propertyInfo.type;
- var attributeValue;
-
- if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
- // If attribute type is boolean, we know for sure it won't be an execution sink
- // and we won't require Trusted Type here.
- attributeValue = '';
- } else {
- // `setAttribute` with objects becomes only `[object]` in IE8/9,
- // ('' + value) makes it output the correct toString()-value.
- attributeValue = toStringOrTrustedType(value);
-
- if (propertyInfo.sanitizeURL) {
- sanitizeURL(attributeValue.toString());
- }
- }
-
- if (attributeNamespace) {
- setAttributeNS(node, attributeNamespace, attributeName, attributeValue);
- } else {
- setAttribute(node, attributeName, attributeValue);
- }
- }
- }
-
- var ReactDebugCurrentFrame$2 = null;
- var ReactControlledValuePropTypes = {
- checkPropTypes: null
- };
-
- {
- ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
- var hasReadOnlyValue = {
- button: true,
- checkbox: true,
- image: true,
- hidden: true,
- radio: true,
- reset: true,
- submit: true
- };
- var propTypes = {
- value: function (props, propName, componentName) {
- if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) {
- return null;
- }
-
- return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
- },
- checked: function (props, propName, componentName) {
- if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) {
- return null;
- }
-
- return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
- }
- };
- /**
- * Provide a linked `value` attribute for controlled forms. You should not use
- * this outside of the ReactDOM controlled form components.
- */
-
- ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
- checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum);
- };
- }
-
- function isCheckable(elem) {
- var type = elem.type;
- var nodeName = elem.nodeName;
- return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');
- }
-
- function getTracker(node) {
- return node._valueTracker;
- }
-
- function detachTracker(node) {
- node._valueTracker = null;
- }
-
- function getValueFromNode(node) {
- var value = '';
-
- if (!node) {
- return value;
- }
-
- if (isCheckable(node)) {
- value = node.checked ? 'true' : 'false';
- } else {
- value = node.value;
- }
-
- return value;
- }
-
- function trackValueOnNode(node) {
- var valueField = isCheckable(node) ? 'checked' : 'value';
- var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
- var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail
- // and don't track value will cause over reporting of changes,
- // but it's better then a hard failure
- // (needed for certain tests that spyOn input values and Safari)
-
- if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
- return;
- }
-
- var get = descriptor.get,
- set = descriptor.set;
- Object.defineProperty(node, valueField, {
- configurable: true,
- get: function () {
- return get.call(this);
- },
- set: function (value) {
- currentValue = '' + value;
- set.call(this, value);
- }
- }); // We could've passed this the first time
- // but it triggers a bug in IE11 and Edge 14/15.
- // Calling defineProperty() again should be equivalent.
- // https://github.com/facebook/react/issues/11768
-
- Object.defineProperty(node, valueField, {
- enumerable: descriptor.enumerable
- });
- var tracker = {
- getValue: function () {
- return currentValue;
- },
- setValue: function (value) {
- currentValue = '' + value;
- },
- stopTracking: function () {
- detachTracker(node);
- delete node[valueField];
- }
- };
- return tracker;
- }
-
- function track(node) {
- if (getTracker(node)) {
- return;
- } // TODO: Once it's just Fiber we can move this to node._wrapperState
-
-
- node._valueTracker = trackValueOnNode(node);
- }
- function updateValueIfChanged(node) {
- if (!node) {
- return false;
- }
-
- var tracker = getTracker(node); // if there is no tracker at this point it's unlikely
- // that trying again will succeed
-
- if (!tracker) {
- return true;
- }
-
- var lastValue = tracker.getValue();
- var nextValue = getValueFromNode(node);
-
- if (nextValue !== lastValue) {
- tracker.setValue(nextValue);
- return true;
- }
-
- return false;
- }
-
- // TODO: direct imports like some-package/src/* are bad. Fix me.
- var didWarnValueDefaultValue = false;
- var didWarnCheckedDefaultChecked = false;
- var didWarnControlledToUncontrolled = false;
- var didWarnUncontrolledToControlled = false;
-
- function isControlled(props) {
- var usesChecked = props.type === 'checkbox' || props.type === 'radio';
- return usesChecked ? props.checked != null : props.value != null;
- }
- /**
- * Implements an <input> host component that allows setting these optional
- * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
- *
- * If `checked` or `value` are not supplied (or null/undefined), user actions
- * that affect the checked state or value will trigger updates to the element.
- *
- * If they are supplied (and not null/undefined), the rendered element will not
- * trigger updates to the element. Instead, the props must change in order for
- * the rendered element to be updated.
- *
- * The rendered element will be initialized as unchecked (or `defaultChecked`)
- * with an empty value (or `defaultValue`).
- *
- * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
- */
-
-
- function getHostProps(element, props) {
- var node = element;
- var checked = props.checked;
-
- var hostProps = _assign({}, props, {
- defaultChecked: undefined,
- defaultValue: undefined,
- value: undefined,
- checked: checked != null ? checked : node._wrapperState.initialChecked
- });
-
- return hostProps;
- }
- function initWrapperState(element, props) {
- {
- ReactControlledValuePropTypes.checkPropTypes('input', props);
-
- if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
- warning$1(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
- didWarnCheckedDefaultChecked = true;
- }
-
- if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
- warning$1(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
- didWarnValueDefaultValue = true;
- }
- }
-
- var node = element;
- var defaultValue = props.defaultValue == null ? '' : props.defaultValue;
- node._wrapperState = {
- initialChecked: props.checked != null ? props.checked : props.defaultChecked,
- initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
- controlled: isControlled(props)
- };
- }
- function updateChecked(element, props) {
- var node = element;
- var checked = props.checked;
-
- if (checked != null) {
- setValueForProperty(node, 'checked', checked, false);
- }
- }
- function updateWrapper(element, props) {
- var node = element;
-
- {
- var controlled = isControlled(props);
-
- if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
- warning$1(false, 'A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
- didWarnUncontrolledToControlled = true;
- }
-
- if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
- warning$1(false, 'A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
- didWarnControlledToUncontrolled = true;
- }
- }
-
- updateChecked(element, props);
- var value = getToStringValue(props.value);
- var type = props.type;
-
- if (value != null) {
- if (type === 'number') {
- if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible.
- // eslint-disable-next-line
- node.value != value) {
- node.value = toString(value);
- }
- } else if (node.value !== toString(value)) {
- node.value = toString(value);
- }
- } else if (type === 'submit' || type === 'reset') {
- // Submit/reset inputs need the attribute removed completely to avoid
- // blank-text buttons.
- node.removeAttribute('value');
- return;
- }
-
- if (disableInputAttributeSyncing) {
- // When not syncing the value attribute, React only assigns a new value
- // whenever the defaultValue React prop has changed. When not present,
- // React does nothing
- if (props.hasOwnProperty('defaultValue')) {
- setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
- }
- } else {
- // When syncing the value attribute, the value comes from a cascade of
- // properties:
- // 1. The value React property
- // 2. The defaultValue React property
- // 3. Otherwise there should be no change
- if (props.hasOwnProperty('value')) {
- setDefaultValue(node, props.type, value);
- } else if (props.hasOwnProperty('defaultValue')) {
- setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
- }
- }
-
- if (disableInputAttributeSyncing) {
- // When not syncing the checked attribute, the attribute is directly
- // controllable from the defaultValue React property. It needs to be
- // updated as new props come in.
- if (props.defaultChecked == null) {
- node.removeAttribute('checked');
- } else {
- node.defaultChecked = !!props.defaultChecked;
- }
- } else {
- // When syncing the checked attribute, it only changes when it needs
- // to be removed, such as transitioning from a checkbox into a text input
- if (props.checked == null && props.defaultChecked != null) {
- node.defaultChecked = !!props.defaultChecked;
- }
- }
- }
- function postMountWrapper(element, props, isHydrating) {
- var node = element; // Do not assign value if it is already set. This prevents user text input
- // from being lost during SSR hydration.
-
- if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {
- var type = props.type;
- var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the
- // default value provided by the browser. See: #12872
-
- if (isButton && (props.value === undefined || props.value === null)) {
- return;
- }
-
- var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input
- // from being lost during SSR hydration.
-
- if (!isHydrating) {
- if (disableInputAttributeSyncing) {
- var value = getToStringValue(props.value); // When not syncing the value attribute, the value property points
- // directly to the React prop. Only assign it if it exists.
-
- if (value != null) {
- // Always assign on buttons so that it is possible to assign an
- // empty string to clear button text.
- //
- // Otherwise, do not re-assign the value property if is empty. This
- // potentially avoids a DOM write and prevents Firefox (~60.0.1) from
- // prematurely marking required inputs as invalid. Equality is compared
- // to the current value in case the browser provided value is not an
- // empty string.
- if (isButton || value !== node.value) {
- node.value = toString(value);
- }
- }
- } else {
- // When syncing the value attribute, the value property should use
- // the wrapperState._initialValue property. This uses:
- //
- // 1. The value React property when present
- // 2. The defaultValue React property when present
- // 3. An empty string
- if (initialValue !== node.value) {
- node.value = initialValue;
- }
- }
- }
-
- if (disableInputAttributeSyncing) {
- // When not syncing the value attribute, assign the value attribute
- // directly from the defaultValue React property (when present)
- var defaultValue = getToStringValue(props.defaultValue);
-
- if (defaultValue != null) {
- node.defaultValue = toString(defaultValue);
- }
- } else {
- // Otherwise, the value attribute is synchronized to the property,
- // so we assign defaultValue to the same thing as the value property
- // assignment step above.
- node.defaultValue = initialValue;
- }
- } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
- // this is needed to work around a chrome bug where setting defaultChecked
- // will sometimes influence the value of checked (even after detachment).
- // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
- // We need to temporarily unset name to avoid disrupting radio button groups.
-
-
- var name = node.name;
-
- if (name !== '') {
- node.name = '';
- }
-
- if (disableInputAttributeSyncing) {
- // When not syncing the checked attribute, the checked property
- // never gets assigned. It must be manually set. We don't want
- // to do this when hydrating so that existing user input isn't
- // modified
- if (!isHydrating) {
- updateChecked(element, props);
- } // Only assign the checked attribute if it is defined. This saves
- // a DOM write when controlling the checked attribute isn't needed
- // (text inputs, submit/reset)
-
-
- if (props.hasOwnProperty('defaultChecked')) {
- node.defaultChecked = !node.defaultChecked;
- node.defaultChecked = !!props.defaultChecked;
- }
- } else {
- // When syncing the checked attribute, both the checked property and
- // attribute are assigned at the same time using defaultChecked. This uses:
- //
- // 1. The checked React property when present
- // 2. The defaultChecked React property when present
- // 3. Otherwise, false
- node.defaultChecked = !node.defaultChecked;
- node.defaultChecked = !!node._wrapperState.initialChecked;
- }
-
- if (name !== '') {
- node.name = name;
- }
- }
- function restoreControlledState$1(element, props) {
- var node = element;
- updateWrapper(node, props);
- updateNamedCousins(node, props);
- }
-
- function updateNamedCousins(rootNode, props) {
- var name = props.name;
-
- if (props.type === 'radio' && name != null) {
- var queryRoot = rootNode;
-
- while (queryRoot.parentNode) {
- queryRoot = queryRoot.parentNode;
- } // If `rootNode.form` was non-null, then we could try `form.elements`,
- // but that sometimes behaves strangely in IE8. We could also try using
- // `form.getElementsByName`, but that will only return direct children
- // and won't include inputs that use the HTML5 `form=` attribute. Since
- // the input might not even be in a form. It might not even be in the
- // document. Let's just use the local `querySelectorAll` to ensure we don't
- // miss anything.
-
-
- var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
-
- for (var i = 0; i < group.length; i++) {
- var otherNode = group[i];
-
- if (otherNode === rootNode || otherNode.form !== rootNode.form) {
- continue;
- } // This will throw if radio buttons rendered by different copies of React
- // and the same name are rendered into the same form (same as #1939).
- // That's probably okay; we don't support it just as we don't support
- // mixing React radio buttons with non-React ones.
-
-
- var otherProps = getFiberCurrentPropsFromNode$1(otherNode);
-
- if (!otherProps) {
- {
- throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");
- }
- } // We need update the tracked value on the named cousin since the value
- // was changed but the input saw no event or value set
-
-
- updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that
- // was previously checked to update will cause it to be come re-checked
- // as appropriate.
-
- updateWrapper(otherNode, otherProps);
- }
- }
- } // In Chrome, assigning defaultValue to certain input types triggers input validation.
- // For number inputs, the display value loses trailing decimal points. For email inputs,
- // Chrome raises "The specified value <x> is not a valid email address".
- //
- // Here we check to see if the defaultValue has actually changed, avoiding these problems
- // when the user is inputting text
- //
- // https://github.com/facebook/react/issues/7253
-
-
- function setDefaultValue(node, type, value) {
- if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js
- type !== 'number' || node.ownerDocument.activeElement !== node) {
- if (value == null) {
- node.defaultValue = toString(node._wrapperState.initialValue);
- } else if (node.defaultValue !== toString(value)) {
- node.defaultValue = toString(value);
- }
- }
- }
-
- var didWarnSelectedSetOnOption = false;
- var didWarnInvalidChild = false;
-
- function flattenChildren(children) {
- var content = ''; // Flatten children. We'll warn if they are invalid
- // during validateProps() which runs for hydration too.
- // Note that this would throw on non-element objects.
- // Elements are stringified (which is normally irrelevant
- // but matters for <fbt>).
-
- React.Children.forEach(children, function (child) {
- if (child == null) {
- return;
- }
-
- content += child; // Note: we don't warn about invalid children here.
- // Instead, this is done separately below so that
- // it happens during the hydration codepath too.
- });
- return content;
- }
- /**
- * Implements an <option> host component that warns when `selected` is set.
- */
-
-
- function validateProps(element, props) {
- {
- // This mirrors the codepath above, but runs for hydration too.
- // Warn about invalid children here so that client and hydration are consistent.
- // TODO: this seems like it could cause a DEV-only throw for hydration
- // if children contains a non-element object. We should try to avoid that.
- if (typeof props.children === 'object' && props.children !== null) {
- React.Children.forEach(props.children, function (child) {
- if (child == null) {
- return;
- }
-
- if (typeof child === 'string' || typeof child === 'number') {
- return;
- }
-
- if (typeof child.type !== 'string') {
- return;
- }
-
- if (!didWarnInvalidChild) {
- didWarnInvalidChild = true;
- warning$1(false, 'Only strings and numbers are supported as <option> children.');
- }
- });
- } // TODO: Remove support for `selected` in <option>.
-
-
- if (props.selected != null && !didWarnSelectedSetOnOption) {
- warning$1(false, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.');
- didWarnSelectedSetOnOption = true;
- }
- }
- }
- function postMountWrapper$1(element, props) {
- // value="" should make a value attribute (#6219)
- if (props.value != null) {
- element.setAttribute('value', toString(getToStringValue(props.value)));
- }
- }
- function getHostProps$1(element, props) {
- var hostProps = _assign({
- children: undefined
- }, props);
-
- var content = flattenChildren(props.children);
-
- if (content) {
- hostProps.children = content;
- }
-
- return hostProps;
- }
-
- // TODO: direct imports like some-package/src/* are bad. Fix me.
- var didWarnValueDefaultValue$1;
-
- {
- didWarnValueDefaultValue$1 = false;
- }
-
- function getDeclarationErrorAddendum() {
- var ownerName = getCurrentFiberOwnerNameInDevOrNull();
-
- if (ownerName) {
- return '\n\nCheck the render method of `' + ownerName + '`.';
- }
-
- return '';
- }
-
- var valuePropNames = ['value', 'defaultValue'];
- /**
- * Validation function for `value` and `defaultValue`.
- */
-
- function checkSelectPropTypes(props) {
- ReactControlledValuePropTypes.checkPropTypes('select', props);
-
- for (var i = 0; i < valuePropNames.length; i++) {
- var propName = valuePropNames[i];
-
- if (props[propName] == null) {
- continue;
- }
-
- var isArray = Array.isArray(props[propName]);
-
- if (props.multiple && !isArray) {
- warning$1(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());
- } else if (!props.multiple && isArray) {
- warning$1(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());
- }
- }
- }
-
- function updateOptions(node, multiple, propValue, setDefaultSelected) {
- var options = node.options;
-
- if (multiple) {
- var selectedValues = propValue;
- var selectedValue = {};
-
- for (var i = 0; i < selectedValues.length; i++) {
- // Prefix to avoid chaos with special keys.
- selectedValue['$' + selectedValues[i]] = true;
- }
-
- for (var _i = 0; _i < options.length; _i++) {
- var selected = selectedValue.hasOwnProperty('$' + options[_i].value);
-
- if (options[_i].selected !== selected) {
- options[_i].selected = selected;
- }
-
- if (selected && setDefaultSelected) {
- options[_i].defaultSelected = true;
- }
- }
- } else {
- // Do not set `select.value` as exact behavior isn't consistent across all
- // browsers for all cases.
- var _selectedValue = toString(getToStringValue(propValue));
-
- var defaultSelected = null;
-
- for (var _i2 = 0; _i2 < options.length; _i2++) {
- if (options[_i2].value === _selectedValue) {
- options[_i2].selected = true;
-
- if (setDefaultSelected) {
- options[_i2].defaultSelected = true;
- }
-
- return;
- }
-
- if (defaultSelected === null && !options[_i2].disabled) {
- defaultSelected = options[_i2];
- }
- }
-
- if (defaultSelected !== null) {
- defaultSelected.selected = true;
- }
- }
- }
- /**
- * Implements a <select> host component that allows optionally setting the
- * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
- * stringable. If `multiple` is true, the prop must be an array of stringables.
- *
- * If `value` is not supplied (or null/undefined), user actions that change the
- * selected option will trigger updates to the rendered options.
- *
- * If it is supplied (and not null/undefined), the rendered options will not
- * update in response to user actions. Instead, the `value` prop must change in
- * order for the rendered options to update.
- *
- * If `defaultValue` is provided, any options with the supplied values will be
- * selected.
- */
-
-
- function getHostProps$2(element, props) {
- return _assign({}, props, {
- value: undefined
- });
- }
- function initWrapperState$1(element, props) {
- var node = element;
-
- {
- checkSelectPropTypes(props);
- }
-
- node._wrapperState = {
- wasMultiple: !!props.multiple
- };
-
- {
- if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {
- warning$1(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
- didWarnValueDefaultValue$1 = true;
- }
- }
- }
- function postMountWrapper$2(element, props) {
- var node = element;
- node.multiple = !!props.multiple;
- var value = props.value;
-
- if (value != null) {
- updateOptions(node, !!props.multiple, value, false);
- } else if (props.defaultValue != null) {
- updateOptions(node, !!props.multiple, props.defaultValue, true);
- }
- }
- function postUpdateWrapper(element, props) {
- var node = element;
- var wasMultiple = node._wrapperState.wasMultiple;
- node._wrapperState.wasMultiple = !!props.multiple;
- var value = props.value;
-
- if (value != null) {
- updateOptions(node, !!props.multiple, value, false);
- } else if (wasMultiple !== !!props.multiple) {
- // For simplicity, reapply `defaultValue` if `multiple` is toggled.
- if (props.defaultValue != null) {
- updateOptions(node, !!props.multiple, props.defaultValue, true);
- } else {
- // Revert the select back to its default unselected state.
- updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);
- }
- }
- }
- function restoreControlledState$2(element, props) {
- var node = element;
- var value = props.value;
-
- if (value != null) {
- updateOptions(node, !!props.multiple, value, false);
- }
- }
-
- var didWarnValDefaultVal = false;
-
- /**
- * Implements a <textarea> host component that allows setting `value`, and
- * `defaultValue`. This differs from the traditional DOM API because value is
- * usually set as PCDATA children.
- *
- * If `value` is not supplied (or null/undefined), user actions that affect the
- * value will trigger updates to the element.
- *
- * If `value` is supplied (and not null/undefined), the rendered element will
- * not trigger updates to the element. Instead, the `value` prop must change in
- * order for the rendered element to be updated.
- *
- * The rendered element will be initialized with an empty value, the prop
- * `defaultValue` if specified, or the children content (deprecated).
- */
- function getHostProps$3(element, props) {
- var node = element;
-
- if (!(props.dangerouslySetInnerHTML == null)) {
- {
- throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");
- }
- } // Always set children to the same thing. In IE9, the selection range will
- // get reset if `textContent` is mutated. We could add a check in setTextContent
- // to only set the value if/when the value differs from the node value (which would
- // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this
- // solution. The value can be a boolean or object so that's why it's forced
- // to be a string.
-
-
- var hostProps = _assign({}, props, {
- value: undefined,
- defaultValue: undefined,
- children: toString(node._wrapperState.initialValue)
- });
-
- return hostProps;
- }
- function initWrapperState$2(element, props) {
- var node = element;
-
- {
- ReactControlledValuePropTypes.checkPropTypes('textarea', props);
-
- if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
- warning$1(false, '%s contains a textarea with both value and defaultValue props. ' + 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
- didWarnValDefaultVal = true;
- }
- }
-
- var initialValue = props.value; // Only bother fetching default value if we're going to use it
-
- if (initialValue == null) {
- var defaultValue = props.defaultValue; // TODO (yungsters): Remove support for children content in <textarea>.
-
- var children = props.children;
-
- if (children != null) {
- {
- warning$1(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
- }
-
- if (!(defaultValue == null)) {
- {
- throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
- }
- }
-
- if (Array.isArray(children)) {
- if (!(children.length <= 1)) {
- {
- throw Error("<textarea> can only have at most one child.");
- }
- }
-
- children = children[0];
- }
-
- defaultValue = children;
- }
-
- if (defaultValue == null) {
- defaultValue = '';
- }
-
- initialValue = defaultValue;
- }
-
- node._wrapperState = {
- initialValue: getToStringValue(initialValue)
- };
- }
- function updateWrapper$1(element, props) {
- var node = element;
- var value = getToStringValue(props.value);
- var defaultValue = getToStringValue(props.defaultValue);
-
- if (value != null) {
- // Cast `value` to a string to ensure the value is set correctly. While
- // browsers typically do this as necessary, jsdom doesn't.
- var newValue = toString(value); // To avoid side effects (such as losing text selection), only set value if changed
-
- if (newValue !== node.value) {
- node.value = newValue;
- }
-
- if (props.defaultValue == null && node.defaultValue !== newValue) {
- node.defaultValue = newValue;
- }
- }
-
- if (defaultValue != null) {
- node.defaultValue = toString(defaultValue);
- }
- }
- function postMountWrapper$3(element, props) {
- var node = element; // This is in postMount because we need access to the DOM node, which is not
- // available until after the component has mounted.
-
- var textContent = node.textContent; // Only set node.value if textContent is equal to the expected
- // initial value. In IE10/IE11 there is a bug where the placeholder attribute
- // will populate textContent as well.
- // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/
-
- if (textContent === node._wrapperState.initialValue) {
- if (textContent !== '' && textContent !== null) {
- node.value = textContent;
- }
- }
- }
- function restoreControlledState$3(element, props) {
- // DOM component is still mounted; update
- updateWrapper$1(element, props);
- }
-
- var HTML_NAMESPACE$1 = 'http://www.w3.org/1999/xhtml';
- var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
- var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
- var Namespaces = {
- html: HTML_NAMESPACE$1,
- mathml: MATH_NAMESPACE,
- svg: SVG_NAMESPACE
- }; // Assumes there is no parent namespace.
-
- function getIntrinsicNamespace(type) {
- switch (type) {
- case 'svg':
- return SVG_NAMESPACE;
-
- case 'math':
- return MATH_NAMESPACE;
-
- default:
- return HTML_NAMESPACE$1;
- }
- }
- function getChildNamespace(parentNamespace, type) {
- if (parentNamespace == null || parentNamespace === HTML_NAMESPACE$1) {
- // No (or default) parent namespace: potential entry point.
- return getIntrinsicNamespace(type);
- }
-
- if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {
- // We're leaving SVG.
- return HTML_NAMESPACE$1;
- } // By default, pass namespace below.
-
-
- return parentNamespace;
- }
-
- /* globals MSApp */
-
- /**
- * Create a function which has 'unsafe' privileges (required by windows8 apps)
- */
- var createMicrosoftUnsafeLocalFunction = function (func) {
- if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
- return function (arg0, arg1, arg2, arg3) {
- MSApp.execUnsafeLocalFunction(function () {
- return func(arg0, arg1, arg2, arg3);
- });
- };
- } else {
- return func;
- }
- };
-
- var reusableSVGContainer;
- /**
- * Set the innerHTML property of a node
- *
- * @param {DOMElement} node
- * @param {string} html
- * @internal
- */
-
- var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
- if (node.namespaceURI === Namespaces.svg) {
- {
- if (enableTrustedTypesIntegration) {
- // TODO: reconsider the text of this warning and when it should show
- // before enabling the feature flag.
- !(typeof trustedTypes === 'undefined') ? warning$1(false, "Using 'dangerouslySetInnerHTML' in an svg element with " + 'Trusted Types enabled in an Internet Explorer will cause ' + 'the trusted value to be converted to string. Assigning string ' + "to 'innerHTML' will throw an error if Trusted Types are enforced. " + "You can try to wrap your svg element inside a div and use 'dangerouslySetInnerHTML' " + 'on the enclosing div instead.') : void 0;
- }
- }
-
- if (!('innerHTML' in node)) {
- // IE does not have innerHTML for SVG nodes, so instead we inject the
- // new markup in a temp node and then move the child nodes across into
- // the target node
- reusableSVGContainer = reusableSVGContainer || document.createElement('div');
- reusableSVGContainer.innerHTML = '<svg>' + html.valueOf().toString() + '</svg>';
- var svgNode = reusableSVGContainer.firstChild;
-
- while (node.firstChild) {
- node.removeChild(node.firstChild);
- }
-
- while (svgNode.firstChild) {
- node.appendChild(svgNode.firstChild);
- }
-
- return;
- }
- }
-
- node.innerHTML = html;
- });
-
- /**
- * HTML nodeType values that represent the type of the node
- */
- var ELEMENT_NODE = 1;
- var TEXT_NODE = 3;
- var COMMENT_NODE = 8;
- var DOCUMENT_NODE = 9;
- var DOCUMENT_FRAGMENT_NODE = 11;
-
- /**
- * Set the textContent property of a node. For text updates, it's faster
- * to set the `nodeValue` of the Text node directly instead of using
- * `.textContent` which will remove the existing node and create a new one.
- *
- * @param {DOMElement} node
- * @param {string} text
- * @internal
- */
-
- var setTextContent = function (node, text) {
- if (text) {
- var firstChild = node.firstChild;
-
- if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
- firstChild.nodeValue = text;
- return;
- }
- }
-
- node.textContent = text;
- };
-
- // Do not use the below two methods directly!
- // Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.
- // (It is the only module that is allowed to access these methods.)
- function unsafeCastStringToDOMTopLevelType(topLevelType) {
- return topLevelType;
- }
- function unsafeCastDOMTopLevelTypeToString(topLevelType) {
- return topLevelType;
- }
-
- /**
- * Generate a mapping of standard vendor prefixes using the defined style property and event name.
- *
- * @param {string} styleProp
- * @param {string} eventName
- * @returns {object}
- */
-
- function makePrefixMap(styleProp, eventName) {
- var prefixes = {};
- prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
- prefixes['Webkit' + styleProp] = 'webkit' + eventName;
- prefixes['Moz' + styleProp] = 'moz' + eventName;
- return prefixes;
- }
- /**
- * A list of event names to a configurable list of vendor prefixes.
- */
-
-
- var vendorPrefixes = {
- animationend: makePrefixMap('Animation', 'AnimationEnd'),
- animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
- animationstart: makePrefixMap('Animation', 'AnimationStart'),
- transitionend: makePrefixMap('Transition', 'TransitionEnd')
- };
- /**
- * Event names that have already been detected and prefixed (if applicable).
- */
-
- var prefixedEventNames = {};
- /**
- * Element to check for prefixes on.
- */
-
- var style = {};
- /**
- * Bootstrap if a DOM exists.
- */
-
- if (canUseDOM) {
- style = document.createElement('div').style; // On some platforms, in particular some releases of Android 4.x,
- // the un-prefixed "animation" and "transition" properties are defined on the
- // style object but the events that fire will still be prefixed, so we need
- // to check if the un-prefixed events are usable, and if not remove them from the map.
-
- if (!('AnimationEvent' in window)) {
- delete vendorPrefixes.animationend.animation;
- delete vendorPrefixes.animationiteration.animation;
- delete vendorPrefixes.animationstart.animation;
- } // Same as above
-
-
- if (!('TransitionEvent' in window)) {
- delete vendorPrefixes.transitionend.transition;
- }
- }
- /**
- * Attempts to determine the correct vendor prefixed event name.
- *
- * @param {string} eventName
- * @returns {string}
- */
-
-
- function getVendorPrefixedEventName(eventName) {
- if (prefixedEventNames[eventName]) {
- return prefixedEventNames[eventName];
- } else if (!vendorPrefixes[eventName]) {
- return eventName;
- }
-
- var prefixMap = vendorPrefixes[eventName];
-
- for (var styleProp in prefixMap) {
- if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
- return prefixedEventNames[eventName] = prefixMap[styleProp];
- }
- }
-
- return eventName;
- }
-
- /**
- * To identify top level events in ReactDOM, we use constants defined by this
- * module. This is the only module that uses the unsafe* methods to express
- * that the constants actually correspond to the browser event names. This lets
- * us save some bundle size by avoiding a top level type -> event name map.
- * The rest of ReactDOM code should import top level types from this file.
- */
-
- var TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort');
- var TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend'));
- var TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration'));
- var TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart'));
- var TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur');
- var TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay');
- var TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough');
- var TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel');
- var TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change');
- var TOP_CLICK = unsafeCastStringToDOMTopLevelType('click');
- var TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close');
- var TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend');
- var TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart');
- var TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate');
- var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');
- var TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');
- var TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');
- var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');
- var TOP_AUX_CLICK = unsafeCastStringToDOMTopLevelType('auxclick');
- var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');
- var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');
- var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');
- var TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit');
- var TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave');
- var TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover');
- var TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart');
- var TOP_DROP = unsafeCastStringToDOMTopLevelType('drop');
- var TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange');
- var TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied');
- var TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted');
- var TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended');
- var TOP_ERROR = unsafeCastStringToDOMTopLevelType('error');
- var TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus');
- var TOP_GOT_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('gotpointercapture');
- var TOP_INPUT = unsafeCastStringToDOMTopLevelType('input');
- var TOP_INVALID = unsafeCastStringToDOMTopLevelType('invalid');
- var TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown');
- var TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress');
- var TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup');
- var TOP_LOAD = unsafeCastStringToDOMTopLevelType('load');
- var TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart');
- var TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata');
- var TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata');
- var TOP_LOST_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('lostpointercapture');
- var TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown');
- var TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove');
- var TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout');
- var TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover');
- var TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup');
- var TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste');
- var TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause');
- var TOP_PLAY = unsafeCastStringToDOMTopLevelType('play');
- var TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing');
- var TOP_POINTER_CANCEL = unsafeCastStringToDOMTopLevelType('pointercancel');
- var TOP_POINTER_DOWN = unsafeCastStringToDOMTopLevelType('pointerdown');
-
-
- var TOP_POINTER_MOVE = unsafeCastStringToDOMTopLevelType('pointermove');
- var TOP_POINTER_OUT = unsafeCastStringToDOMTopLevelType('pointerout');
- var TOP_POINTER_OVER = unsafeCastStringToDOMTopLevelType('pointerover');
- var TOP_POINTER_UP = unsafeCastStringToDOMTopLevelType('pointerup');
- var TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress');
- var TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange');
- var TOP_RESET = unsafeCastStringToDOMTopLevelType('reset');
- var TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll');
- var TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked');
- var TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking');
- var TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange');
- var TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled');
- var TOP_SUBMIT = unsafeCastStringToDOMTopLevelType('submit');
- var TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend');
- var TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput');
- var TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate');
- var TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle');
- var TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel');
- var TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend');
- var TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove');
- var TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart');
- var TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend'));
- var TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange');
- var TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting');
- var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel'); // List of events that need to be individually attached to media elements.
- // Note that events in this list will *not* be listened to at the top level
- // unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`.
-
- var mediaEventTypes = [TOP_ABORT, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_VOLUME_CHANGE, TOP_WAITING];
- function getRawEventName(topLevelType) {
- return unsafeCastDOMTopLevelTypeToString(topLevelType);
- }
-
- /**
- * `ReactInstanceMap` maintains a mapping from a public facing stateful
- * instance (key) and the internal representation (value). This allows public
- * methods to accept the user facing instance as an argument and map them back
- * to internal methods.
- *
- * Note that this module is currently shared and assumed to be stateless.
- * If this becomes an actual Map, that will break.
- */
-
- /**
- * This API should be called `delete` but we'd have to make sure to always
- * transform these to strings for IE support. When this transform is fully
- * supported we can rename it.
- */
-
- function get(key) {
- return key._reactInternalFiber;
- }
- function has(key) {
- return key._reactInternalFiber !== undefined;
- }
- function set(key, value) {
- key._reactInternalFiber = value;
- }
-
- // Don't change these two values. They're used by React Dev Tools.
- var NoEffect =
- /* */
- 0;
- var PerformedWork =
- /* */
- 1; // You can change the rest (and add more).
-
- var Placement =
- /* */
- 2;
- var Update =
- /* */
- 4;
- var PlacementAndUpdate =
- /* */
- 6;
- var Deletion =
- /* */
- 8;
- var ContentReset =
- /* */
- 16;
- var Callback =
- /* */
- 32;
- var DidCapture =
- /* */
- 64;
- var Ref =
- /* */
- 128;
- var Snapshot =
- /* */
- 256;
- var Passive =
- /* */
- 512;
- var Hydrating =
- /* */
- 1024;
- var HydratingAndUpdate =
- /* */
- 1028; // Passive & Update & Callback & Ref & Snapshot
-
- var LifecycleEffectMask =
- /* */
- 932; // Union of all host effects
-
- var HostEffectMask =
- /* */
- 2047;
- var Incomplete =
- /* */
- 2048;
- var ShouldCapture =
- /* */
- 4096;
-
- var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
- function getNearestMountedFiber(fiber) {
- var node = fiber;
- var nearestMounted = fiber;
-
- if (!fiber.alternate) {
- // If there is no alternate, this might be a new tree that isn't inserted
- // yet. If it is, then it will have a pending insertion effect on it.
- var nextNode = node;
-
- do {
- node = nextNode;
-
- if ((node.effectTag & (Placement | Hydrating)) !== NoEffect) {
- // This is an insertion or in-progress hydration. The nearest possible
- // mounted fiber is the parent but we need to continue to figure out
- // if that one is still mounted.
- nearestMounted = node.return;
- }
-
- nextNode = node.return;
- } while (nextNode);
- } else {
- while (node.return) {
- node = node.return;
- }
- }
-
- if (node.tag === HostRoot) {
- // TODO: Check if this was a nested HostRoot when used with
- // renderContainerIntoSubtree.
- return nearestMounted;
- } // If we didn't hit the root, that means that we're in an disconnected tree
- // that has been unmounted.
-
-
- return null;
- }
- function getSuspenseInstanceFromFiber(fiber) {
- if (fiber.tag === SuspenseComponent) {
- var suspenseState = fiber.memoizedState;
-
- if (suspenseState === null) {
- var current = fiber.alternate;
-
- if (current !== null) {
- suspenseState = current.memoizedState;
- }
- }
-
- if (suspenseState !== null) {
- return suspenseState.dehydrated;
- }
- }
-
- return null;
- }
- function getContainerFromFiber(fiber) {
- return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;
- }
- function isFiberMounted(fiber) {
- return getNearestMountedFiber(fiber) === fiber;
- }
- function isMounted(component) {
- {
- var owner = ReactCurrentOwner.current;
-
- if (owner !== null && owner.tag === ClassComponent) {
- var ownerFiber = owner;
- var instance = ownerFiber.stateNode;
- !instance._warnedAboutRefsInRender ? warningWithoutStack$1(false, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component') : void 0;
- instance._warnedAboutRefsInRender = true;
- }
- }
-
- var fiber = get(component);
-
- if (!fiber) {
- return false;
- }
-
- return getNearestMountedFiber(fiber) === fiber;
- }
-
- function assertIsMounted(fiber) {
- if (!(getNearestMountedFiber(fiber) === fiber)) {
- {
- throw Error("Unable to find node on an unmounted component.");
- }
- }
- }
-
- function findCurrentFiberUsingSlowPath(fiber) {
- var alternate = fiber.alternate;
-
- if (!alternate) {
- // If there is no alternate, then we only need to check if it is mounted.
- var nearestMounted = getNearestMountedFiber(fiber);
-
- if (!(nearestMounted !== null)) {
- {
- throw Error("Unable to find node on an unmounted component.");
- }
- }
-
- if (nearestMounted !== fiber) {
- return null;
- }
-
- return fiber;
- } // If we have two possible branches, we'll walk backwards up to the root
- // to see what path the root points to. On the way we may hit one of the
- // special cases and we'll deal with them.
-
-
- var a = fiber;
- var b = alternate;
-
- while (true) {
- var parentA = a.return;
-
- if (parentA === null) {
- // We're at the root.
- break;
- }
-
- var parentB = parentA.alternate;
-
- if (parentB === null) {
- // There is no alternate. This is an unusual case. Currently, it only
- // happens when a Suspense component is hidden. An extra fragment fiber
- // is inserted in between the Suspense fiber and its children. Skip
- // over this extra fragment fiber and proceed to the next parent.
- var nextParent = parentA.return;
-
- if (nextParent !== null) {
- a = b = nextParent;
- continue;
- } // If there's no parent, we're at the root.
-
-
- break;
- } // If both copies of the parent fiber point to the same child, we can
- // assume that the child is current. This happens when we bailout on low
- // priority: the bailed out fiber's child reuses the current child.
-
-
- if (parentA.child === parentB.child) {
- var child = parentA.child;
-
- while (child) {
- if (child === a) {
- // We've determined that A is the current branch.
- assertIsMounted(parentA);
- return fiber;
- }
-
- if (child === b) {
- // We've determined that B is the current branch.
- assertIsMounted(parentA);
- return alternate;
- }
-
- child = child.sibling;
- } // We should never have an alternate for any mounting node. So the only
- // way this could possibly happen is if this was unmounted, if at all.
-
-
- {
- {
- throw Error("Unable to find node on an unmounted component.");
- }
- }
- }
-
- if (a.return !== b.return) {
- // The return pointer of A and the return pointer of B point to different
- // fibers. We assume that return pointers never criss-cross, so A must
- // belong to the child set of A.return, and B must belong to the child
- // set of B.return.
- a = parentA;
- b = parentB;
- } else {
- // The return pointers point to the same fiber. We'll have to use the
- // default, slow path: scan the child sets of each parent alternate to see
- // which child belongs to which set.
- //
- // Search parent A's child set
- var didFindChild = false;
- var _child = parentA.child;
-
- while (_child) {
- if (_child === a) {
- didFindChild = true;
- a = parentA;
- b = parentB;
- break;
- }
-
- if (_child === b) {
- didFindChild = true;
- b = parentA;
- a = parentB;
- break;
- }
-
- _child = _child.sibling;
- }
-
- if (!didFindChild) {
- // Search parent B's child set
- _child = parentB.child;
-
- while (_child) {
- if (_child === a) {
- didFindChild = true;
- a = parentB;
- b = parentA;
- break;
- }
-
- if (_child === b) {
- didFindChild = true;
- b = parentB;
- a = parentA;
- break;
- }
-
- _child = _child.sibling;
- }
-
- if (!didFindChild) {
- {
- throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");
- }
- }
- }
- }
-
- if (!(a.alternate === b)) {
- {
- throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
- } // If the root is not a host container, we're in a disconnected tree. I.e.
- // unmounted.
-
-
- if (!(a.tag === HostRoot)) {
- {
- throw Error("Unable to find node on an unmounted component.");
- }
- }
-
- if (a.stateNode.current === a) {
- // We've determined that A is the current branch.
- return fiber;
- } // Otherwise B has to be current branch.
-
-
- return alternate;
- }
- function findCurrentHostFiber(parent) {
- var currentParent = findCurrentFiberUsingSlowPath(parent);
-
- if (!currentParent) {
- return null;
- } // Next we'll drill down this component to find the first HostComponent/Text.
-
-
- var node = currentParent;
-
- while (true) {
- if (node.tag === HostComponent || node.tag === HostText) {
- return node;
- } else if (node.child) {
- node.child.return = node;
- node = node.child;
- continue;
- }
-
- if (node === currentParent) {
- return null;
- }
-
- while (!node.sibling) {
- if (!node.return || node.return === currentParent) {
- return null;
- }
-
- node = node.return;
- }
-
- node.sibling.return = node.return;
- node = node.sibling;
- } // Flow needs the return null here, but ESLint complains about it.
- // eslint-disable-next-line no-unreachable
-
-
- return null;
- }
- function findCurrentHostFiberWithNoPortals(parent) {
- var currentParent = findCurrentFiberUsingSlowPath(parent);
-
- if (!currentParent) {
- return null;
- } // Next we'll drill down this component to find the first HostComponent/Text.
-
-
- var node = currentParent;
-
- while (true) {
- if (node.tag === HostComponent || node.tag === HostText || enableFundamentalAPI && node.tag === FundamentalComponent) {
- return node;
- } else if (node.child && node.tag !== HostPortal) {
- node.child.return = node;
- node = node.child;
- continue;
- }
-
- if (node === currentParent) {
- return null;
- }
-
- while (!node.sibling) {
- if (!node.return || node.return === currentParent) {
- return null;
- }
-
- node = node.return;
- }
-
- node.sibling.return = node.return;
- node = node.sibling;
- } // Flow needs the return null here, but ESLint complains about it.
- // eslint-disable-next-line no-unreachable
-
-
- return null;
- }
-
- var attemptSynchronousHydration;
- function setAttemptSynchronousHydration(fn) {
- attemptSynchronousHydration = fn;
- }
- var attemptUserBlockingHydration;
- function setAttemptUserBlockingHydration(fn) {
- attemptUserBlockingHydration = fn;
- }
- var attemptContinuousHydration;
- function setAttemptContinuousHydration(fn) {
- attemptContinuousHydration = fn;
- }
- var attemptHydrationAtCurrentPriority;
- function setAttemptHydrationAtCurrentPriority(fn) {
- attemptHydrationAtCurrentPriority = fn;
- } // TODO: Upgrade this definition once we're on a newer version of Flow that
- // has this definition built-in.
-
- var hasScheduledReplayAttempt = false; // The queue of discrete events to be replayed.
-
- var queuedDiscreteEvents = []; // Indicates if any continuous event targets are non-null for early bailout.
-
- // if the last target was dehydrated.
-
- var queuedFocus = null;
- var queuedDrag = null;
- var queuedMouse = null; // For pointer events there can be one latest event per pointerId.
-
- var queuedPointers = new Map();
- var queuedPointerCaptures = new Map(); // We could consider replaying selectionchange and touchmoves too.
-
- var queuedExplicitHydrationTargets = [];
- function hasQueuedDiscreteEvents() {
- return queuedDiscreteEvents.length > 0;
- }
-
- var discreteReplayableEvents = [TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_TOUCH_CANCEL, TOP_TOUCH_END, TOP_TOUCH_START, TOP_AUX_CLICK, TOP_DOUBLE_CLICK, TOP_POINTER_CANCEL, TOP_POINTER_DOWN, TOP_POINTER_UP, TOP_DRAG_END, TOP_DRAG_START, TOP_DROP, TOP_COMPOSITION_END, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_INPUT, TOP_TEXT_INPUT, TOP_CLOSE, TOP_CANCEL, TOP_COPY, TOP_CUT, TOP_PASTE, TOP_CLICK, TOP_CHANGE, TOP_CONTEXT_MENU, TOP_RESET, TOP_SUBMIT];
- var continuousReplayableEvents = [TOP_FOCUS, TOP_BLUR, TOP_DRAG_ENTER, TOP_DRAG_LEAVE, TOP_MOUSE_OVER, TOP_MOUSE_OUT, TOP_POINTER_OVER, TOP_POINTER_OUT, TOP_GOT_POINTER_CAPTURE, TOP_LOST_POINTER_CAPTURE];
- function isReplayableDiscreteEvent(eventType) {
- return discreteReplayableEvents.indexOf(eventType) > -1;
- }
-
- function trapReplayableEvent(topLevelType, document, listeningSet) {
- listenToTopLevel(topLevelType, document, listeningSet);
-
- if (enableFlareAPI) {
- // Trap events for the responder system.
- var passiveEventKey = unsafeCastDOMTopLevelTypeToString(topLevelType) + '_passive';
-
- if (!listeningSet.has(passiveEventKey)) {
- trapEventForResponderEventSystem(document, topLevelType, true);
- listeningSet.add(passiveEventKey);
- } // TODO: This listens to all events as active which might have
- // undesirable effects. It's also unnecessary to have both
- // passive and active listeners. Instead, we could start with
- // a passive and upgrade it to an active one if needed.
- // For replaying purposes the active is never needed since we
- // currently don't preventDefault.
-
-
- var activeEventKey = unsafeCastDOMTopLevelTypeToString(topLevelType) + '_active';
-
- if (!listeningSet.has(activeEventKey)) {
- trapEventForResponderEventSystem(document, topLevelType, false);
- listeningSet.add(activeEventKey);
- }
- }
- }
-
- function eagerlyTrapReplayableEvents(document) {
- var listeningSet = getListeningSetForElement(document); // Discrete
-
- discreteReplayableEvents.forEach(function (topLevelType) {
- trapReplayableEvent(topLevelType, document, listeningSet);
- }); // Continuous
-
- continuousReplayableEvents.forEach(function (topLevelType) {
- trapReplayableEvent(topLevelType, document, listeningSet);
- });
- }
-
- function createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent) {
- return {
- blockedOn: blockedOn,
- topLevelType: topLevelType,
- eventSystemFlags: eventSystemFlags | IS_REPLAYED,
- nativeEvent: nativeEvent
- };
- }
-
- function queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent) {
- var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent);
- queuedDiscreteEvents.push(queuedEvent);
-
- if (enableSelectiveHydration) {
- if (queuedDiscreteEvents.length === 1) {
- // If this was the first discrete event, we might be able to
- // synchronously unblock it so that preventDefault still works.
- while (queuedEvent.blockedOn !== null) {
- var _fiber = getInstanceFromNode$1(queuedEvent.blockedOn);
-
- if (_fiber === null) {
- break;
- }
-
- attemptSynchronousHydration(_fiber);
-
- if (queuedEvent.blockedOn === null) {
- // We got unblocked by hydration. Let's try again.
- replayUnblockedEvents(); // If we're reblocked, on an inner boundary, we might need
- // to attempt hydrating that one.
-
- continue;
- } else {
- // We're still blocked from hydation, we have to give up
- // and replay later.
- break;
- }
- }
- }
- }
- } // Resets the replaying for this type of continuous event to no event.
-
- function clearIfContinuousEvent(topLevelType, nativeEvent) {
- switch (topLevelType) {
- case TOP_FOCUS:
- case TOP_BLUR:
- queuedFocus = null;
- break;
-
- case TOP_DRAG_ENTER:
- case TOP_DRAG_LEAVE:
- queuedDrag = null;
- break;
-
- case TOP_MOUSE_OVER:
- case TOP_MOUSE_OUT:
- queuedMouse = null;
- break;
-
- case TOP_POINTER_OVER:
- case TOP_POINTER_OUT:
- {
- var pointerId = nativeEvent.pointerId;
- queuedPointers.delete(pointerId);
- break;
- }
-
- case TOP_GOT_POINTER_CAPTURE:
- case TOP_LOST_POINTER_CAPTURE:
- {
- var _pointerId = nativeEvent.pointerId;
- queuedPointerCaptures.delete(_pointerId);
- break;
- }
- }
- }
-
- function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, topLevelType, eventSystemFlags, nativeEvent) {
- if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {
- var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent);
-
- if (blockedOn !== null) {
- var _fiber2 = getInstanceFromNode$1(blockedOn);
-
- if (_fiber2 !== null) {
- // Attempt to increase the priority of this target.
- attemptContinuousHydration(_fiber2);
- }
- }
-
- return queuedEvent;
- } // If we have already queued this exact event, then it's because
- // the different event systems have different DOM event listeners.
- // We can accumulate the flags and store a single event to be
- // replayed.
-
-
- existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
- return existingQueuedEvent;
- }
-
- function queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent) {
- // These set relatedTarget to null because the replayed event will be treated as if we
- // moved from outside the window (no target) onto the target once it hydrates.
- // Instead of mutating we could clone the event.
- switch (topLevelType) {
- case TOP_FOCUS:
- {
- var focusEvent = nativeEvent;
- queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, topLevelType, eventSystemFlags, focusEvent);
- return true;
- }
-
- case TOP_DRAG_ENTER:
- {
- var dragEvent = nativeEvent;
- queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, topLevelType, eventSystemFlags, dragEvent);
- return true;
- }
-
- case TOP_MOUSE_OVER:
- {
- var mouseEvent = nativeEvent;
- queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, topLevelType, eventSystemFlags, mouseEvent);
- return true;
- }
-
- case TOP_POINTER_OVER:
- {
- var pointerEvent = nativeEvent;
- var pointerId = pointerEvent.pointerId;
- queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, topLevelType, eventSystemFlags, pointerEvent));
- return true;
- }
-
- case TOP_GOT_POINTER_CAPTURE:
- {
- var _pointerEvent = nativeEvent;
- var _pointerId2 = _pointerEvent.pointerId;
- queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, topLevelType, eventSystemFlags, _pointerEvent));
- return true;
- }
- }
-
- return false;
- } // Check if this target is unblocked. Returns true if it's unblocked.
-
- function attemptExplicitHydrationTarget(queuedTarget) {
- // TODO: This function shares a lot of logic with attemptToDispatchEvent.
- // Try to unify them. It's a bit tricky since it would require two return
- // values.
- var targetInst = getClosestInstanceFromNode(queuedTarget.target);
-
- if (targetInst !== null) {
- var nearestMounted = getNearestMountedFiber(targetInst);
-
- if (nearestMounted !== null) {
- var tag = nearestMounted.tag;
-
- if (tag === SuspenseComponent) {
- var instance = getSuspenseInstanceFromFiber(nearestMounted);
-
- if (instance !== null) {
- // We're blocked on hydrating this boundary.
- // Increase its priority.
- queuedTarget.blockedOn = instance;
- Scheduler.unstable_runWithPriority(queuedTarget.priority, function () {
- attemptHydrationAtCurrentPriority(nearestMounted);
- });
- return;
- }
- } else if (tag === HostRoot) {
- var root = nearestMounted.stateNode;
-
- if (root.hydrate) {
- queuedTarget.blockedOn = getContainerFromFiber(nearestMounted); // We don't currently have a way to increase the priority of
- // a root other than sync.
-
- return;
- }
- }
- }
- }
-
- queuedTarget.blockedOn = null;
- }
-
- function queueExplicitHydrationTarget(target) {
- if (enableSelectiveHydration) {
- var priority = Scheduler.unstable_getCurrentPriorityLevel();
- var queuedTarget = {
- blockedOn: null,
- target: target,
- priority: priority
- };
- var i = 0;
-
- for (; i < queuedExplicitHydrationTargets.length; i++) {
- if (priority <= queuedExplicitHydrationTargets[i].priority) {
- break;
- }
- }
-
- queuedExplicitHydrationTargets.splice(i, 0, queuedTarget);
-
- if (i === 0) {
- attemptExplicitHydrationTarget(queuedTarget);
- }
- }
- }
-
- function attemptReplayContinuousQueuedEvent(queuedEvent) {
- if (queuedEvent.blockedOn !== null) {
- return false;
- }
-
- var nextBlockedOn = attemptToDispatchEvent(queuedEvent.topLevelType, queuedEvent.eventSystemFlags, queuedEvent.nativeEvent);
-
- if (nextBlockedOn !== null) {
- // We're still blocked. Try again later.
- var _fiber3 = getInstanceFromNode$1(nextBlockedOn);
-
- if (_fiber3 !== null) {
- attemptContinuousHydration(_fiber3);
- }
-
- queuedEvent.blockedOn = nextBlockedOn;
- return false;
- }
-
- return true;
- }
-
- function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {
- if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
- map.delete(key);
- }
- }
-
- function replayUnblockedEvents() {
- hasScheduledReplayAttempt = false; // First replay discrete events.
-
- while (queuedDiscreteEvents.length > 0) {
- var nextDiscreteEvent = queuedDiscreteEvents[0];
-
- if (nextDiscreteEvent.blockedOn !== null) {
- // We're still blocked.
- // Increase the priority of this boundary to unblock
- // the next discrete event.
- var _fiber4 = getInstanceFromNode$1(nextDiscreteEvent.blockedOn);
-
- if (_fiber4 !== null) {
- attemptUserBlockingHydration(_fiber4);
- }
-
- break;
- }
-
- var nextBlockedOn = attemptToDispatchEvent(nextDiscreteEvent.topLevelType, nextDiscreteEvent.eventSystemFlags, nextDiscreteEvent.nativeEvent);
-
- if (nextBlockedOn !== null) {
- // We're still blocked. Try again later.
- nextDiscreteEvent.blockedOn = nextBlockedOn;
- } else {
- // We've successfully replayed the first event. Let's try the next one.
- queuedDiscreteEvents.shift();
- }
- } // Next replay any continuous events.
-
-
- if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {
- queuedFocus = null;
- }
-
- if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {
- queuedDrag = null;
- }
-
- if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {
- queuedMouse = null;
- }
-
- queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
- queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
- }
-
- function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
- if (queuedEvent.blockedOn === unblocked) {
- queuedEvent.blockedOn = null;
-
- if (!hasScheduledReplayAttempt) {
- hasScheduledReplayAttempt = true; // Schedule a callback to attempt replaying as many events as are
- // now unblocked. This first might not actually be unblocked yet.
- // We could check it early to avoid scheduling an unnecessary callback.
-
- Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);
- }
- }
- }
-
- function retryIfBlockedOn(unblocked) {
- // Mark anything that was blocked on this as no longer blocked
- // and eligible for a replay.
- if (queuedDiscreteEvents.length > 0) {
- scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); // This is a exponential search for each boundary that commits. I think it's
- // worth it because we expect very few discrete events to queue up and once
- // we are actually fully unblocked it will be fast to replay them.
-
- for (var i = 1; i < queuedDiscreteEvents.length; i++) {
- var queuedEvent = queuedDiscreteEvents[i];
-
- if (queuedEvent.blockedOn === unblocked) {
- queuedEvent.blockedOn = null;
- }
- }
- }
-
- if (queuedFocus !== null) {
- scheduleCallbackIfUnblocked(queuedFocus, unblocked);
- }
-
- if (queuedDrag !== null) {
- scheduleCallbackIfUnblocked(queuedDrag, unblocked);
- }
-
- if (queuedMouse !== null) {
- scheduleCallbackIfUnblocked(queuedMouse, unblocked);
- }
-
- var unblock = function (queuedEvent) {
- return scheduleCallbackIfUnblocked(queuedEvent, unblocked);
- };
-
- queuedPointers.forEach(unblock);
- queuedPointerCaptures.forEach(unblock);
-
- for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {
- var queuedTarget = queuedExplicitHydrationTargets[_i];
-
- if (queuedTarget.blockedOn === unblocked) {
- queuedTarget.blockedOn = null;
- }
- }
-
- while (queuedExplicitHydrationTargets.length > 0) {
- var nextExplicitTarget = queuedExplicitHydrationTargets[0];
-
- if (nextExplicitTarget.blockedOn !== null) {
- // We're still blocked.
- break;
- } else {
- attemptExplicitHydrationTarget(nextExplicitTarget);
-
- if (nextExplicitTarget.blockedOn === null) {
- // We're unblocked.
- queuedExplicitHydrationTargets.shift();
- }
- }
- }
- }
-
- function addEventBubbleListener(element, eventType, listener) {
- element.addEventListener(eventType, listener, false);
- }
- function addEventCaptureListener(element, eventType, listener) {
- element.addEventListener(eventType, listener, true);
- }
- function addEventCaptureListenerWithPassiveFlag(element, eventType, listener, passive) {
- element.addEventListener(eventType, listener, {
- capture: true,
- passive: passive
- });
- }
-
- /**
- * Gets the target node from a native browser event by accounting for
- * inconsistencies in browser DOM APIs.
- *
- * @param {object} nativeEvent Native browser event.
- * @return {DOMEventTarget} Target node.
- */
-
- function getEventTarget(nativeEvent) {
- // Fallback to nativeEvent.srcElement for IE9
- // https://github.com/facebook/react/issues/12506
- var target = nativeEvent.target || nativeEvent.srcElement || window; // Normalize SVG <use> element events #4963
-
- if (target.correspondingUseElement) {
- target = target.correspondingUseElement;
- } // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
- // @see http://www.quirksmode.org/js/events_properties.html
-
-
- return target.nodeType === TEXT_NODE ? target.parentNode : target;
- }
-
- function getParent(inst) {
- do {
- inst = inst.return; // TODO: If this is a HostRoot we might want to bail out.
- // That is depending on if we want nested subtrees (layers) to bubble
- // events to their parent. We could also go through parentNode on the
- // host node but that wouldn't work for React Native and doesn't let us
- // do the portal feature.
- } while (inst && inst.tag !== HostComponent);
-
- if (inst) {
- return inst;
- }
-
- return null;
- }
- /**
- * Return the lowest common ancestor of A and B, or null if they are in
- * different trees.
- */
-
-
- function getLowestCommonAncestor(instA, instB) {
- var depthA = 0;
-
- for (var tempA = instA; tempA; tempA = getParent(tempA)) {
- depthA++;
- }
-
- var depthB = 0;
-
- for (var tempB = instB; tempB; tempB = getParent(tempB)) {
- depthB++;
- } // If A is deeper, crawl up.
-
-
- while (depthA - depthB > 0) {
- instA = getParent(instA);
- depthA--;
- } // If B is deeper, crawl up.
-
-
- while (depthB - depthA > 0) {
- instB = getParent(instB);
- depthB--;
- } // Walk in lockstep until we find a match.
-
-
- var depth = depthA;
-
- while (depth--) {
- if (instA === instB || instA === instB.alternate) {
- return instA;
- }
-
- instA = getParent(instA);
- instB = getParent(instB);
- }
-
- return null;
- }
- /**
- * Return if A is an ancestor of B.
- */
-
-
- /**
- * Return the parent instance of the passed-in instance.
- */
-
-
- /**
- * Simulates the traversal of a two-phase, capture/bubble event dispatch.
- */
-
- function traverseTwoPhase(inst, fn, arg) {
- var path = [];
-
- while (inst) {
- path.push(inst);
- inst = getParent(inst);
- }
-
- var i;
-
- for (i = path.length; i-- > 0;) {
- fn(path[i], 'captured', arg);
- }
-
- for (i = 0; i < path.length; i++) {
- fn(path[i], 'bubbled', arg);
- }
- }
- /**
- * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
- * should would receive a `mouseEnter` or `mouseLeave` event.
- *
- * Does not invoke the callback on the nearest common ancestor because nothing
- * "entered" or "left" that element.
- */
-
- function traverseEnterLeave(from, to, fn, argFrom, argTo) {
- var common = from && to ? getLowestCommonAncestor(from, to) : null;
- var pathFrom = [];
-
- while (true) {
- if (!from) {
- break;
- }
-
- if (from === common) {
- break;
- }
-
- var alternate = from.alternate;
-
- if (alternate !== null && alternate === common) {
- break;
- }
-
- pathFrom.push(from);
- from = getParent(from);
- }
-
- var pathTo = [];
-
- while (true) {
- if (!to) {
- break;
- }
-
- if (to === common) {
- break;
- }
-
- var _alternate = to.alternate;
-
- if (_alternate !== null && _alternate === common) {
- break;
- }
-
- pathTo.push(to);
- to = getParent(to);
- }
-
- for (var i = 0; i < pathFrom.length; i++) {
- fn(pathFrom[i], 'bubbled', argFrom);
- }
-
- for (var _i = pathTo.length; _i-- > 0;) {
- fn(pathTo[_i], 'captured', argTo);
- }
- }
-
- /**
- * Some event types have a notion of different registration names for different
- * "phases" of propagation. This finds listeners by a given phase.
- */
- function listenerAtPhase(inst, event, propagationPhase) {
- var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
- return getListener(inst, registrationName);
- }
- /**
- * A small set of propagation patterns, each of which will accept a small amount
- * of information, and generate a set of "dispatch ready event objects" - which
- * are sets of events that have already been annotated with a set of dispatched
- * listener functions/ids. The API is designed this way to discourage these
- * propagation strategies from actually executing the dispatches, since we
- * always want to collect the entire set of dispatches before executing even a
- * single one.
- */
-
- /**
- * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
- * here, allows us to not have to bind or create functions for each event.
- * Mutating the event's members allows us to not have to create a wrapping
- * "dispatch" object that pairs the event with the listener.
- */
-
-
- function accumulateDirectionalDispatches(inst, phase, event) {
- {
- !inst ? warningWithoutStack$1(false, 'Dispatching inst must not be null') : void 0;
- }
-
- var listener = listenerAtPhase(inst, event, phase);
-
- if (listener) {
- event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
- event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
- }
- }
- /**
- * Collect dispatches (must be entirely collected before dispatching - see unit
- * tests). Lazily allocate the array to conserve memory. We must loop through
- * each event and perform the traversal for each one. We cannot perform a
- * single traversal for the entire collection of events because each event may
- * have a different target.
- */
-
-
- function accumulateTwoPhaseDispatchesSingle(event) {
- if (event && event.dispatchConfig.phasedRegistrationNames) {
- traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
- }
- }
- /**
- * Accumulates without regard to direction, does not look for phased
- * registration names. Same as `accumulateDirectDispatchesSingle` but without
- * requiring that the `dispatchMarker` be the same as the dispatched ID.
- */
-
-
- function accumulateDispatches(inst, ignoredDirection, event) {
- if (inst && event && event.dispatchConfig.registrationName) {
- var registrationName = event.dispatchConfig.registrationName;
- var listener = getListener(inst, registrationName);
-
- if (listener) {
- event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
- event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
- }
- }
- }
- /**
- * Accumulates dispatches on an `SyntheticEvent`, but only for the
- * `dispatchMarker`.
- * @param {SyntheticEvent} event
- */
-
-
- function accumulateDirectDispatchesSingle(event) {
- if (event && event.dispatchConfig.registrationName) {
- accumulateDispatches(event._targetInst, null, event);
- }
- }
-
- function accumulateTwoPhaseDispatches(events) {
- forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
- }
-
- function accumulateEnterLeaveDispatches(leave, enter, from, to) {
- traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
- }
- function accumulateDirectDispatches(events) {
- forEachAccumulated(events, accumulateDirectDispatchesSingle);
- }
-
- /* eslint valid-typeof: 0 */
- var EVENT_POOL_SIZE = 10;
- /**
- * @interface Event
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-
- var EventInterface = {
- type: null,
- target: null,
- // currentTarget is set when dispatching; no use in copying it here
- currentTarget: function () {
- return null;
- },
- eventPhase: null,
- bubbles: null,
- cancelable: null,
- timeStamp: function (event) {
- return event.timeStamp || Date.now();
- },
- defaultPrevented: null,
- isTrusted: null
- };
-
- function functionThatReturnsTrue() {
- return true;
- }
-
- function functionThatReturnsFalse() {
- return false;
- }
- /**
- * Synthetic events are dispatched by event plugins, typically in response to a
- * top-level event delegation handler.
- *
- * These systems should generally use pooling to reduce the frequency of garbage
- * collection. The system should check `isPersistent` to determine whether the
- * event should be released into the pool after being dispatched. Users that
- * need a persisted event should invoke `persist`.
- *
- * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
- * normalizing browser quirks. Subclasses do not necessarily have to implement a
- * DOM interface; custom application-specific events can also subclass this.
- *
- * @param {object} dispatchConfig Configuration used to dispatch this event.
- * @param {*} targetInst Marker identifying the event target.
- * @param {object} nativeEvent Native browser event.
- * @param {DOMEventTarget} nativeEventTarget Target node.
- */
-
-
- function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
- {
- // these have a getter/setter for warnings
- delete this.nativeEvent;
- delete this.preventDefault;
- delete this.stopPropagation;
- delete this.isDefaultPrevented;
- delete this.isPropagationStopped;
- }
-
- this.dispatchConfig = dispatchConfig;
- this._targetInst = targetInst;
- this.nativeEvent = nativeEvent;
- var Interface = this.constructor.Interface;
-
- for (var propName in Interface) {
- if (!Interface.hasOwnProperty(propName)) {
- continue;
- }
-
- {
- delete this[propName]; // this has a getter/setter for warnings
- }
-
- var normalize = Interface[propName];
-
- if (normalize) {
- this[propName] = normalize(nativeEvent);
- } else {
- if (propName === 'target') {
- this.target = nativeEventTarget;
- } else {
- this[propName] = nativeEvent[propName];
- }
- }
- }
-
- var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
-
- if (defaultPrevented) {
- this.isDefaultPrevented = functionThatReturnsTrue;
- } else {
- this.isDefaultPrevented = functionThatReturnsFalse;
- }
-
- this.isPropagationStopped = functionThatReturnsFalse;
- return this;
- }
-
- _assign(SyntheticEvent.prototype, {
- preventDefault: function () {
- this.defaultPrevented = true;
- var event = this.nativeEvent;
-
- if (!event) {
- return;
- }
-
- if (event.preventDefault) {
- event.preventDefault();
- } else if (typeof event.returnValue !== 'unknown') {
- event.returnValue = false;
- }
-
- this.isDefaultPrevented = functionThatReturnsTrue;
- },
- stopPropagation: function () {
- var event = this.nativeEvent;
-
- if (!event) {
- return;
- }
-
- if (event.stopPropagation) {
- event.stopPropagation();
- } else if (typeof event.cancelBubble !== 'unknown') {
- // The ChangeEventPlugin registers a "propertychange" event for
- // IE. This event does not support bubbling or cancelling, and
- // any references to cancelBubble throw "Member not found". A
- // typeof check of "unknown" circumvents this issue (and is also
- // IE specific).
- event.cancelBubble = true;
- }
-
- this.isPropagationStopped = functionThatReturnsTrue;
- },
-
- /**
- * We release all dispatched `SyntheticEvent`s after each event loop, adding
- * them back into the pool. This allows a way to hold onto a reference that
- * won't be added back into the pool.
- */
- persist: function () {
- this.isPersistent = functionThatReturnsTrue;
- },
-
- /**
- * Checks if this event should be released back into the pool.
- *
- * @return {boolean} True if this should not be released, false otherwise.
- */
- isPersistent: functionThatReturnsFalse,
-
- /**
- * `PooledClass` looks for `destructor` on each instance it releases.
- */
- destructor: function () {
- var Interface = this.constructor.Interface;
-
- for (var propName in Interface) {
- {
- Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
- }
- }
-
- this.dispatchConfig = null;
- this._targetInst = null;
- this.nativeEvent = null;
- this.isDefaultPrevented = functionThatReturnsFalse;
- this.isPropagationStopped = functionThatReturnsFalse;
- this._dispatchListeners = null;
- this._dispatchInstances = null;
-
- {
- Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
- Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse));
- Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse));
- Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {}));
- Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {}));
- }
- }
- });
-
- SyntheticEvent.Interface = EventInterface;
- /**
- * Helper to reduce boilerplate when creating subclasses.
- */
-
- SyntheticEvent.extend = function (Interface) {
- var Super = this;
-
- var E = function () {};
-
- E.prototype = Super.prototype;
- var prototype = new E();
-
- function Class() {
- return Super.apply(this, arguments);
- }
-
- _assign(prototype, Class.prototype);
-
- Class.prototype = prototype;
- Class.prototype.constructor = Class;
- Class.Interface = _assign({}, Super.Interface, Interface);
- Class.extend = Super.extend;
- addEventPoolingTo(Class);
- return Class;
- };
-
- addEventPoolingTo(SyntheticEvent);
- /**
- * Helper to nullify syntheticEvent instance properties when destructing
- *
- * @param {String} propName
- * @param {?object} getVal
- * @return {object} defineProperty object
- */
-
- function getPooledWarningPropertyDefinition(propName, getVal) {
- var isFunction = typeof getVal === 'function';
- return {
- configurable: true,
- set: set,
- get: get
- };
-
- function set(val) {
- var action = isFunction ? 'setting the method' : 'setting the property';
- warn(action, 'This is effectively a no-op');
- return val;
- }
-
- function get() {
- var action = isFunction ? 'accessing the method' : 'accessing the property';
- var result = isFunction ? 'This is a no-op function' : 'This is set to null';
- warn(action, result);
- return getVal;
- }
-
- function warn(action, result) {
- var warningCondition = false;
- !warningCondition ? warningWithoutStack$1(false, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
- }
- }
-
- function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
- var EventConstructor = this;
-
- if (EventConstructor.eventPool.length) {
- var instance = EventConstructor.eventPool.pop();
- EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
- return instance;
- }
-
- return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);
- }
-
- function releasePooledEvent(event) {
- var EventConstructor = this;
-
- if (!(event instanceof EventConstructor)) {
- {
- throw Error("Trying to release an event instance into a pool of a different type.");
- }
- }
-
- event.destructor();
-
- if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {
- EventConstructor.eventPool.push(event);
- }
- }
-
- function addEventPoolingTo(EventConstructor) {
- EventConstructor.eventPool = [];
- EventConstructor.getPooled = getPooledEvent;
- EventConstructor.release = releasePooledEvent;
- }
-
- /**
- * @interface Event
- * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
- * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
- */
-
- var SyntheticAnimationEvent = SyntheticEvent.extend({
- animationName: null,
- elapsedTime: null,
- pseudoElement: null
- });
-
- /**
- * @interface Event
- * @see http://www.w3.org/TR/clipboard-apis/
- */
-
- var SyntheticClipboardEvent = SyntheticEvent.extend({
- clipboardData: function (event) {
- return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
- }
- });
-
- var SyntheticUIEvent = SyntheticEvent.extend({
- view: null,
- detail: null
- });
-
- /**
- * @interface FocusEvent
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-
- var SyntheticFocusEvent = SyntheticUIEvent.extend({
- relatedTarget: null
- });
-
- /**
- * `charCode` represents the actual "character code" and is safe to use with
- * `String.fromCharCode`. As such, only keys that correspond to printable
- * characters produce a valid `charCode`, the only exception to this is Enter.
- * The Tab-key is considered non-printable and does not have a `charCode`,
- * presumably because it does not produce a tab-character in browsers.
- *
- * @param {object} nativeEvent Native browser event.
- * @return {number} Normalized `charCode` property.
- */
- function getEventCharCode(nativeEvent) {
- var charCode;
- var keyCode = nativeEvent.keyCode;
-
- if ('charCode' in nativeEvent) {
- charCode = nativeEvent.charCode; // FF does not set `charCode` for the Enter-key, check against `keyCode`.
-
- if (charCode === 0 && keyCode === 13) {
- charCode = 13;
- }
- } else {
- // IE8 does not implement `charCode`, but `keyCode` has the correct value.
- charCode = keyCode;
- } // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux)
- // report Enter as charCode 10 when ctrl is pressed.
-
-
- if (charCode === 10) {
- charCode = 13;
- } // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
- // Must not discard the (non-)printable Enter-key.
-
-
- if (charCode >= 32 || charCode === 13) {
- return charCode;
- }
-
- return 0;
- }
-
- /**
- * Normalization of deprecated HTML5 `key` values
- * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
- */
-
- var normalizeKey = {
- Esc: 'Escape',
- Spacebar: ' ',
- Left: 'ArrowLeft',
- Up: 'ArrowUp',
- Right: 'ArrowRight',
- Down: 'ArrowDown',
- Del: 'Delete',
- Win: 'OS',
- Menu: 'ContextMenu',
- Apps: 'ContextMenu',
- Scroll: 'ScrollLock',
- MozPrintableKey: 'Unidentified'
- };
- /**
- * Translation from legacy `keyCode` to HTML5 `key`
- * Only special keys supported, all others depend on keyboard layout or browser
- * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
- */
-
- var translateToKey = {
- '8': 'Backspace',
- '9': 'Tab',
- '12': 'Clear',
- '13': 'Enter',
- '16': 'Shift',
- '17': 'Control',
- '18': 'Alt',
- '19': 'Pause',
- '20': 'CapsLock',
- '27': 'Escape',
- '32': ' ',
- '33': 'PageUp',
- '34': 'PageDown',
- '35': 'End',
- '36': 'Home',
- '37': 'ArrowLeft',
- '38': 'ArrowUp',
- '39': 'ArrowRight',
- '40': 'ArrowDown',
- '45': 'Insert',
- '46': 'Delete',
- '112': 'F1',
- '113': 'F2',
- '114': 'F3',
- '115': 'F4',
- '116': 'F5',
- '117': 'F6',
- '118': 'F7',
- '119': 'F8',
- '120': 'F9',
- '121': 'F10',
- '122': 'F11',
- '123': 'F12',
- '144': 'NumLock',
- '145': 'ScrollLock',
- '224': 'Meta'
- };
- /**
- * @param {object} nativeEvent Native browser event.
- * @return {string} Normalized `key` property.
- */
-
- function getEventKey(nativeEvent) {
- if (nativeEvent.key) {
- // Normalize inconsistent values reported by browsers due to
- // implementations of a working draft specification.
- // FireFox implements `key` but returns `MozPrintableKey` for all
- // printable characters (normalized to `Unidentified`), ignore it.
- var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
-
- if (key !== 'Unidentified') {
- return key;
- }
- } // Browser does not implement `key`, polyfill as much of it as we can.
-
-
- if (nativeEvent.type === 'keypress') {
- var charCode = getEventCharCode(nativeEvent); // The enter-key is technically both printable and non-printable and can
- // thus be captured by `keypress`, no other non-printable key should.
-
- return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
- }
-
- if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
- // While user keyboard layout determines the actual meaning of each
- // `keyCode` value, almost all function keys have a universal value.
- return translateToKey[nativeEvent.keyCode] || 'Unidentified';
- }
-
- return '';
- }
-
- /**
- * Translation from modifier key to the associated property in the event.
- * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
- */
- var modifierKeyToProp = {
- Alt: 'altKey',
- Control: 'ctrlKey',
- Meta: 'metaKey',
- Shift: 'shiftKey'
- }; // Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support
- // getModifierState. If getModifierState is not supported, we map it to a set of
- // modifier keys exposed by the event. In this case, Lock-keys are not supported.
-
- function modifierStateGetter(keyArg) {
- var syntheticEvent = this;
- var nativeEvent = syntheticEvent.nativeEvent;
-
- if (nativeEvent.getModifierState) {
- return nativeEvent.getModifierState(keyArg);
- }
-
- var keyProp = modifierKeyToProp[keyArg];
- return keyProp ? !!nativeEvent[keyProp] : false;
- }
-
- function getEventModifierState(nativeEvent) {
- return modifierStateGetter;
- }
-
- /**
- * @interface KeyboardEvent
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-
- var SyntheticKeyboardEvent = SyntheticUIEvent.extend({
- key: getEventKey,
- location: null,
- ctrlKey: null,
- shiftKey: null,
- altKey: null,
- metaKey: null,
- repeat: null,
- locale: null,
- getModifierState: getEventModifierState,
- // Legacy Interface
- charCode: function (event) {
- // `charCode` is the result of a KeyPress event and represents the value of
- // the actual printable character.
- // KeyPress is deprecated, but its replacement is not yet final and not
- // implemented in any major browser. Only KeyPress has charCode.
- if (event.type === 'keypress') {
- return getEventCharCode(event);
- }
-
- return 0;
- },
- keyCode: function (event) {
- // `keyCode` is the result of a KeyDown/Up event and represents the value of
- // physical keyboard key.
- // The actual meaning of the value depends on the users' keyboard layout
- // which cannot be detected. Assuming that it is a US keyboard layout
- // provides a surprisingly accurate mapping for US and European users.
- // Due to this, it is left to the user to implement at this time.
- if (event.type === 'keydown' || event.type === 'keyup') {
- return event.keyCode;
- }
-
- return 0;
- },
- which: function (event) {
- // `which` is an alias for either `keyCode` or `charCode` depending on the
- // type of the event.
- if (event.type === 'keypress') {
- return getEventCharCode(event);
- }
-
- if (event.type === 'keydown' || event.type === 'keyup') {
- return event.keyCode;
- }
-
- return 0;
- }
- });
-
- var previousScreenX = 0;
- var previousScreenY = 0; // Use flags to signal movementX/Y has already been set
-
- var isMovementXSet = false;
- var isMovementYSet = false;
- /**
- * @interface MouseEvent
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-
- var SyntheticMouseEvent = SyntheticUIEvent.extend({
- screenX: null,
- screenY: null,
- clientX: null,
- clientY: null,
- pageX: null,
- pageY: null,
- ctrlKey: null,
- shiftKey: null,
- altKey: null,
- metaKey: null,
- getModifierState: getEventModifierState,
- button: null,
- buttons: null,
- relatedTarget: function (event) {
- return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
- },
- movementX: function (event) {
- if ('movementX' in event) {
- return event.movementX;
- }
-
- var screenX = previousScreenX;
- previousScreenX = event.screenX;
-
- if (!isMovementXSet) {
- isMovementXSet = true;
- return 0;
- }
-
- return event.type === 'mousemove' ? event.screenX - screenX : 0;
- },
- movementY: function (event) {
- if ('movementY' in event) {
- return event.movementY;
- }
-
- var screenY = previousScreenY;
- previousScreenY = event.screenY;
-
- if (!isMovementYSet) {
- isMovementYSet = true;
- return 0;
- }
-
- return event.type === 'mousemove' ? event.screenY - screenY : 0;
- }
- });
-
- /**
- * @interface PointerEvent
- * @see http://www.w3.org/TR/pointerevents/
- */
-
- var SyntheticPointerEvent = SyntheticMouseEvent.extend({
- pointerId: null,
- width: null,
- height: null,
- pressure: null,
- tangentialPressure: null,
- tiltX: null,
- tiltY: null,
- twist: null,
- pointerType: null,
- isPrimary: null
- });
-
- /**
- * @interface DragEvent
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-
- var SyntheticDragEvent = SyntheticMouseEvent.extend({
- dataTransfer: null
- });
-
- /**
- * @interface TouchEvent
- * @see http://www.w3.org/TR/touch-events/
- */
-
- var SyntheticTouchEvent = SyntheticUIEvent.extend({
- touches: null,
- targetTouches: null,
- changedTouches: null,
- altKey: null,
- metaKey: null,
- ctrlKey: null,
- shiftKey: null,
- getModifierState: getEventModifierState
- });
-
- /**
- * @interface Event
- * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
- * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
- */
-
- var SyntheticTransitionEvent = SyntheticEvent.extend({
- propertyName: null,
- elapsedTime: null,
- pseudoElement: null
- });
-
- /**
- * @interface WheelEvent
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
- */
-
- var SyntheticWheelEvent = SyntheticMouseEvent.extend({
- deltaX: function (event) {
- return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
- 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
- },
- deltaY: function (event) {
- return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
- 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
- 'wheelDelta' in event ? -event.wheelDelta : 0;
- },
- deltaZ: null,
- // Browsers without "deltaMode" is reporting in raw wheel delta where one
- // notch on the scroll is always +/- 120, roughly equivalent to pixels.
- // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
- // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
- deltaMode: null
- });
-
- /**
- * Turns
- * ['abort', ...]
- * into
- * eventTypes = {
- * 'abort': {
- * phasedRegistrationNames: {
- * bubbled: 'onAbort',
- * captured: 'onAbortCapture',
- * },
- * dependencies: [TOP_ABORT],
- * },
- * ...
- * };
- * topLevelEventsToDispatchConfig = new Map([
- * [TOP_ABORT, { sameConfig }],
- * ]);
- */
-
- var eventTuples = [// Discrete events
- [TOP_BLUR, 'blur', DiscreteEvent], [TOP_CANCEL, 'cancel', DiscreteEvent], [TOP_CLICK, 'click', DiscreteEvent], [TOP_CLOSE, 'close', DiscreteEvent], [TOP_CONTEXT_MENU, 'contextMenu', DiscreteEvent], [TOP_COPY, 'copy', DiscreteEvent], [TOP_CUT, 'cut', DiscreteEvent], [TOP_AUX_CLICK, 'auxClick', DiscreteEvent], [TOP_DOUBLE_CLICK, 'doubleClick', DiscreteEvent], [TOP_DRAG_END, 'dragEnd', DiscreteEvent], [TOP_DRAG_START, 'dragStart', DiscreteEvent], [TOP_DROP, 'drop', DiscreteEvent], [TOP_FOCUS, 'focus', DiscreteEvent], [TOP_INPUT, 'input', DiscreteEvent], [TOP_INVALID, 'invalid', DiscreteEvent], [TOP_KEY_DOWN, 'keyDown', DiscreteEvent], [TOP_KEY_PRESS, 'keyPress', DiscreteEvent], [TOP_KEY_UP, 'keyUp', DiscreteEvent], [TOP_MOUSE_DOWN, 'mouseDown', DiscreteEvent], [TOP_MOUSE_UP, 'mouseUp', DiscreteEvent], [TOP_PASTE, 'paste', DiscreteEvent], [TOP_PAUSE, 'pause', DiscreteEvent], [TOP_PLAY, 'play', DiscreteEvent], [TOP_POINTER_CANCEL, 'pointerCancel', DiscreteEvent], [TOP_POINTER_DOWN, 'pointerDown', DiscreteEvent], [TOP_POINTER_UP, 'pointerUp', DiscreteEvent], [TOP_RATE_CHANGE, 'rateChange', DiscreteEvent], [TOP_RESET, 'reset', DiscreteEvent], [TOP_SEEKED, 'seeked', DiscreteEvent], [TOP_SUBMIT, 'submit', DiscreteEvent], [TOP_TOUCH_CANCEL, 'touchCancel', DiscreteEvent], [TOP_TOUCH_END, 'touchEnd', DiscreteEvent], [TOP_TOUCH_START, 'touchStart', DiscreteEvent], [TOP_VOLUME_CHANGE, 'volumeChange', DiscreteEvent], // User-blocking events
- [TOP_DRAG, 'drag', UserBlockingEvent], [TOP_DRAG_ENTER, 'dragEnter', UserBlockingEvent], [TOP_DRAG_EXIT, 'dragExit', UserBlockingEvent], [TOP_DRAG_LEAVE, 'dragLeave', UserBlockingEvent], [TOP_DRAG_OVER, 'dragOver', UserBlockingEvent], [TOP_MOUSE_MOVE, 'mouseMove', UserBlockingEvent], [TOP_MOUSE_OUT, 'mouseOut', UserBlockingEvent], [TOP_MOUSE_OVER, 'mouseOver', UserBlockingEvent], [TOP_POINTER_MOVE, 'pointerMove', UserBlockingEvent], [TOP_POINTER_OUT, 'pointerOut', UserBlockingEvent], [TOP_POINTER_OVER, 'pointerOver', UserBlockingEvent], [TOP_SCROLL, 'scroll', UserBlockingEvent], [TOP_TOGGLE, 'toggle', UserBlockingEvent], [TOP_TOUCH_MOVE, 'touchMove', UserBlockingEvent], [TOP_WHEEL, 'wheel', UserBlockingEvent], // Continuous events
- [TOP_ABORT, 'abort', ContinuousEvent], [TOP_ANIMATION_END, 'animationEnd', ContinuousEvent], [TOP_ANIMATION_ITERATION, 'animationIteration', ContinuousEvent], [TOP_ANIMATION_START, 'animationStart', ContinuousEvent], [TOP_CAN_PLAY, 'canPlay', ContinuousEvent], [TOP_CAN_PLAY_THROUGH, 'canPlayThrough', ContinuousEvent], [TOP_DURATION_CHANGE, 'durationChange', ContinuousEvent], [TOP_EMPTIED, 'emptied', ContinuousEvent], [TOP_ENCRYPTED, 'encrypted', ContinuousEvent], [TOP_ENDED, 'ended', ContinuousEvent], [TOP_ERROR, 'error', ContinuousEvent], [TOP_GOT_POINTER_CAPTURE, 'gotPointerCapture', ContinuousEvent], [TOP_LOAD, 'load', ContinuousEvent], [TOP_LOADED_DATA, 'loadedData', ContinuousEvent], [TOP_LOADED_METADATA, 'loadedMetadata', ContinuousEvent], [TOP_LOAD_START, 'loadStart', ContinuousEvent], [TOP_LOST_POINTER_CAPTURE, 'lostPointerCapture', ContinuousEvent], [TOP_PLAYING, 'playing', ContinuousEvent], [TOP_PROGRESS, 'progress', ContinuousEvent], [TOP_SEEKING, 'seeking', ContinuousEvent], [TOP_STALLED, 'stalled', ContinuousEvent], [TOP_SUSPEND, 'suspend', ContinuousEvent], [TOP_TIME_UPDATE, 'timeUpdate', ContinuousEvent], [TOP_TRANSITION_END, 'transitionEnd', ContinuousEvent], [TOP_WAITING, 'waiting', ContinuousEvent]];
- var eventTypes = {};
- var topLevelEventsToDispatchConfig = {};
-
- for (var i = 0; i < eventTuples.length; i++) {
- var eventTuple = eventTuples[i];
- var topEvent = eventTuple[0];
- var event = eventTuple[1];
- var eventPriority = eventTuple[2];
- var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
- var onEvent = 'on' + capitalizedEvent;
- var config = {
- phasedRegistrationNames: {
- bubbled: onEvent,
- captured: onEvent + 'Capture'
- },
- dependencies: [topEvent],
- eventPriority: eventPriority
- };
- eventTypes[event] = config;
- topLevelEventsToDispatchConfig[topEvent] = config;
- } // Only used in DEV for exhaustiveness validation.
-
-
- var knownHTMLTopLevelTypes = [TOP_ABORT, TOP_CANCEL, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_CLOSE, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_INPUT, TOP_INVALID, TOP_LOAD, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_RESET, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUBMIT, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_TOGGLE, TOP_VOLUME_CHANGE, TOP_WAITING];
- var SimpleEventPlugin = {
- eventTypes: eventTypes,
- getEventPriority: function (topLevelType) {
- var config = topLevelEventsToDispatchConfig[topLevelType];
- return config !== undefined ? config.eventPriority : ContinuousEvent;
- },
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
- var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
-
- if (!dispatchConfig) {
- return null;
- }
-
- var EventConstructor;
-
- switch (topLevelType) {
- case TOP_KEY_PRESS:
- // Firefox creates a keypress event for function keys too. This removes
- // the unwanted keypress events. Enter is however both printable and
- // non-printable. One would expect Tab to be as well (but it isn't).
- if (getEventCharCode(nativeEvent) === 0) {
- return null;
- }
-
- /* falls through */
-
- case TOP_KEY_DOWN:
- case TOP_KEY_UP:
- EventConstructor = SyntheticKeyboardEvent;
- break;
-
- case TOP_BLUR:
- case TOP_FOCUS:
- EventConstructor = SyntheticFocusEvent;
- break;
-
- case TOP_CLICK:
- // Firefox creates a click event on right mouse clicks. This removes the
- // unwanted click events.
- if (nativeEvent.button === 2) {
- return null;
- }
-
- /* falls through */
-
- case TOP_AUX_CLICK:
- case TOP_DOUBLE_CLICK:
- case TOP_MOUSE_DOWN:
- case TOP_MOUSE_MOVE:
- case TOP_MOUSE_UP: // TODO: Disabled elements should not respond to mouse events
-
- /* falls through */
-
- case TOP_MOUSE_OUT:
- case TOP_MOUSE_OVER:
- case TOP_CONTEXT_MENU:
- EventConstructor = SyntheticMouseEvent;
- break;
-
- case TOP_DRAG:
- case TOP_DRAG_END:
- case TOP_DRAG_ENTER:
- case TOP_DRAG_EXIT:
- case TOP_DRAG_LEAVE:
- case TOP_DRAG_OVER:
- case TOP_DRAG_START:
- case TOP_DROP:
- EventConstructor = SyntheticDragEvent;
- break;
-
- case TOP_TOUCH_CANCEL:
- case TOP_TOUCH_END:
- case TOP_TOUCH_MOVE:
- case TOP_TOUCH_START:
- EventConstructor = SyntheticTouchEvent;
- break;
-
- case TOP_ANIMATION_END:
- case TOP_ANIMATION_ITERATION:
- case TOP_ANIMATION_START:
- EventConstructor = SyntheticAnimationEvent;
- break;
-
- case TOP_TRANSITION_END:
- EventConstructor = SyntheticTransitionEvent;
- break;
-
- case TOP_SCROLL:
- EventConstructor = SyntheticUIEvent;
- break;
-
- case TOP_WHEEL:
- EventConstructor = SyntheticWheelEvent;
- break;
-
- case TOP_COPY:
- case TOP_CUT:
- case TOP_PASTE:
- EventConstructor = SyntheticClipboardEvent;
- break;
-
- case TOP_GOT_POINTER_CAPTURE:
- case TOP_LOST_POINTER_CAPTURE:
- case TOP_POINTER_CANCEL:
- case TOP_POINTER_DOWN:
- case TOP_POINTER_MOVE:
- case TOP_POINTER_OUT:
- case TOP_POINTER_OVER:
- case TOP_POINTER_UP:
- EventConstructor = SyntheticPointerEvent;
- break;
-
- default:
- {
- if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) {
- warningWithoutStack$1(false, 'SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType);
- }
- } // HTML Events
- // @see http://www.w3.org/TR/html5/index.html#events-0
-
-
- EventConstructor = SyntheticEvent;
- break;
- }
-
- var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
- accumulateTwoPhaseDispatches(event);
- return event;
- }
- };
-
- var passiveBrowserEventsSupported = false; // Check if browser support events with passive listeners
- // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
-
- if (enableFlareAPI && canUseDOM) {
- try {
- var options = {}; // $FlowFixMe: Ignore Flow complaining about needing a value
-
- Object.defineProperty(options, 'passive', {
- get: function () {
- passiveBrowserEventsSupported = true;
- }
- });
- window.addEventListener('test', options, options);
- window.removeEventListener('test', options, options);
- } catch (e) {
- passiveBrowserEventsSupported = false;
- }
- }
-
- // Intentionally not named imports because Rollup would use dynamic dispatch for
- // CommonJS interop named imports.
- var UserBlockingPriority$1 = Scheduler.unstable_UserBlockingPriority;
- var runWithPriority$1 = Scheduler.unstable_runWithPriority;
- var getEventPriority = SimpleEventPlugin.getEventPriority;
- var CALLBACK_BOOKKEEPING_POOL_SIZE = 10;
- var callbackBookkeepingPool = [];
-
- /**
- * Find the deepest React component completely containing the root of the
- * passed-in instance (for use when entire React trees are nested within each
- * other). If React trees are not nested, returns null.
- */
- function findRootContainerNode(inst) {
- if (inst.tag === HostRoot) {
- return inst.stateNode.containerInfo;
- } // TODO: It may be a good idea to cache this to prevent unnecessary DOM
- // traversal, but caching is difficult to do correctly without using a
- // mutation observer to listen for all DOM changes.
-
-
- while (inst.return) {
- inst = inst.return;
- }
-
- if (inst.tag !== HostRoot) {
- // This can happen if we're in a detached tree.
- return null;
- }
-
- return inst.stateNode.containerInfo;
- } // Used to store ancestor hierarchy in top level callback
-
-
- function getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags) {
- if (callbackBookkeepingPool.length) {
- var instance = callbackBookkeepingPool.pop();
- instance.topLevelType = topLevelType;
- instance.eventSystemFlags = eventSystemFlags;
- instance.nativeEvent = nativeEvent;
- instance.targetInst = targetInst;
- return instance;
- }
-
- return {
- topLevelType: topLevelType,
- eventSystemFlags: eventSystemFlags,
- nativeEvent: nativeEvent,
- targetInst: targetInst,
- ancestors: []
- };
- }
-
- function releaseTopLevelCallbackBookKeeping(instance) {
- instance.topLevelType = null;
- instance.nativeEvent = null;
- instance.targetInst = null;
- instance.ancestors.length = 0;
-
- if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) {
- callbackBookkeepingPool.push(instance);
- }
- }
-
- function handleTopLevel(bookKeeping) {
- var targetInst = bookKeeping.targetInst; // Loop through the hierarchy, in case there's any nested components.
- // It's important that we build the array of ancestors before calling any
- // event handlers, because event handlers can modify the DOM, leading to
- // inconsistencies with ReactMount's node cache. See #1105.
-
- var ancestor = targetInst;
-
- do {
- if (!ancestor) {
- var ancestors = bookKeeping.ancestors;
- ancestors.push(ancestor);
- break;
- }
-
- var root = findRootContainerNode(ancestor);
-
- if (!root) {
- break;
- }
-
- var tag = ancestor.tag;
-
- if (tag === HostComponent || tag === HostText) {
- bookKeeping.ancestors.push(ancestor);
- }
-
- ancestor = getClosestInstanceFromNode(root);
- } while (ancestor);
-
- for (var i = 0; i < bookKeeping.ancestors.length; i++) {
- targetInst = bookKeeping.ancestors[i];
- var eventTarget = getEventTarget(bookKeeping.nativeEvent);
- var topLevelType = bookKeeping.topLevelType;
- var nativeEvent = bookKeeping.nativeEvent;
- runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, eventTarget, bookKeeping.eventSystemFlags);
- }
- } // TODO: can we stop exporting these?
-
-
- var _enabled = true;
- function setEnabled(enabled) {
- _enabled = !!enabled;
- }
- function isEnabled() {
- return _enabled;
- }
- function trapBubbledEvent(topLevelType, element) {
- trapEventForPluginEventSystem(element, topLevelType, false);
- }
- function trapCapturedEvent(topLevelType, element) {
- trapEventForPluginEventSystem(element, topLevelType, true);
- }
- function trapEventForResponderEventSystem(element, topLevelType, passive) {
- if (enableFlareAPI) {
- var rawEventName = getRawEventName(topLevelType);
- var eventFlags = RESPONDER_EVENT_SYSTEM; // If passive option is not supported, then the event will be
- // active and not passive, but we flag it as using not being
- // supported too. This way the responder event plugins know,
- // and can provide polyfills if needed.
-
- if (passive) {
- if (passiveBrowserEventsSupported) {
- eventFlags |= IS_PASSIVE;
- } else {
- eventFlags |= IS_ACTIVE;
- eventFlags |= PASSIVE_NOT_SUPPORTED;
- passive = false;
- }
- } else {
- eventFlags |= IS_ACTIVE;
- } // Check if interactive and wrap in discreteUpdates
-
-
- var listener = dispatchEvent.bind(null, topLevelType, eventFlags);
-
- if (passiveBrowserEventsSupported) {
- addEventCaptureListenerWithPassiveFlag(element, rawEventName, listener, passive);
- } else {
- addEventCaptureListener(element, rawEventName, listener);
- }
- }
- }
-
- function trapEventForPluginEventSystem(element, topLevelType, capture) {
- var listener;
-
- switch (getEventPriority(topLevelType)) {
- case DiscreteEvent:
- listener = dispatchDiscreteEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM);
- break;
-
- case UserBlockingEvent:
- listener = dispatchUserBlockingUpdate.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM);
- break;
-
- case ContinuousEvent:
- default:
- listener = dispatchEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM);
- break;
- }
-
- var rawEventName = getRawEventName(topLevelType);
-
- if (capture) {
- addEventCaptureListener(element, rawEventName, listener);
- } else {
- addEventBubbleListener(element, rawEventName, listener);
- }
- }
-
- function dispatchDiscreteEvent(topLevelType, eventSystemFlags, nativeEvent) {
- flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);
- discreteUpdates(dispatchEvent, topLevelType, eventSystemFlags, nativeEvent);
- }
-
- function dispatchUserBlockingUpdate(topLevelType, eventSystemFlags, nativeEvent) {
- runWithPriority$1(UserBlockingPriority$1, dispatchEvent.bind(null, topLevelType, eventSystemFlags, nativeEvent));
- }
-
- function dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst) {
- var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags);
-
- try {
- // Event queue being processed in the same cycle allows
- // `preventDefault`.
- batchedEventUpdates(handleTopLevel, bookKeeping);
- } finally {
- releaseTopLevelCallbackBookKeeping(bookKeeping);
- }
- }
-
- function dispatchEvent(topLevelType, eventSystemFlags, nativeEvent) {
- if (!_enabled) {
- return;
- }
-
- if (hasQueuedDiscreteEvents() && isReplayableDiscreteEvent(topLevelType)) {
- // If we already have a queue of discrete events, and this is another discrete
- // event, then we can't dispatch it regardless of its target, since they
- // need to dispatch in order.
- queueDiscreteEvent(null, // Flags that we're not actually blocked on anything as far as we know.
- topLevelType, eventSystemFlags, nativeEvent);
- return;
- }
-
- var blockedOn = attemptToDispatchEvent(topLevelType, eventSystemFlags, nativeEvent);
-
- if (blockedOn === null) {
- // We successfully dispatched this event.
- clearIfContinuousEvent(topLevelType, nativeEvent);
- return;
- }
-
- if (isReplayableDiscreteEvent(topLevelType)) {
- // This this to be replayed later once the target is available.
- queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent);
- return;
- }
-
- if (queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent)) {
- return;
- } // We need to clear only if we didn't queue because
- // queueing is accummulative.
-
-
- clearIfContinuousEvent(topLevelType, nativeEvent); // This is not replayable so we'll invoke it but without a target,
- // in case the event system needs to trace it.
-
- if (enableFlareAPI) {
- if (eventSystemFlags & PLUGIN_EVENT_SYSTEM) {
- dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, null);
- }
-
- if (eventSystemFlags & RESPONDER_EVENT_SYSTEM) {
- // React Flare event system
- dispatchEventForResponderEventSystem(topLevelType, null, nativeEvent, getEventTarget(nativeEvent), eventSystemFlags);
- }
- } else {
- dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, null);
- }
- } // Attempt dispatching an event. Returns a SuspenseInstance or Container if it's blocked.
-
- function attemptToDispatchEvent(topLevelType, eventSystemFlags, nativeEvent) {
- // TODO: Warn if _enabled is false.
- var nativeEventTarget = getEventTarget(nativeEvent);
- var targetInst = getClosestInstanceFromNode(nativeEventTarget);
-
- if (targetInst !== null) {
- var nearestMounted = getNearestMountedFiber(targetInst);
-
- if (nearestMounted === null) {
- // This tree has been unmounted already. Dispatch without a target.
- targetInst = null;
- } else {
- var tag = nearestMounted.tag;
-
- if (tag === SuspenseComponent) {
- var instance = getSuspenseInstanceFromFiber(nearestMounted);
-
- if (instance !== null) {
- // Queue the event to be replayed later. Abort dispatching since we
- // don't want this event dispatched twice through the event system.
- // TODO: If this is the first discrete event in the queue. Schedule an increased
- // priority for this boundary.
- return instance;
- } // This shouldn't happen, something went wrong but to avoid blocking
- // the whole system, dispatch the event without a target.
- // TODO: Warn.
-
-
- targetInst = null;
- } else if (tag === HostRoot) {
- var root = nearestMounted.stateNode;
-
- if (root.hydrate) {
- // If this happens during a replay something went wrong and it might block
- // the whole system.
- return getContainerFromFiber(nearestMounted);
- }
-
- targetInst = null;
- } else if (nearestMounted !== targetInst) {
- // If we get an event (ex: img onload) before committing that
- // component's mount, ignore it for now (that is, treat it as if it was an
- // event on a non-React tree). We might also consider queueing events and
- // dispatching them after the mount.
- targetInst = null;
- }
- }
- }
-
- if (enableFlareAPI) {
- if (eventSystemFlags & PLUGIN_EVENT_SYSTEM) {
- dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst);
- }
-
- if (eventSystemFlags & RESPONDER_EVENT_SYSTEM) {
- // React Flare event system
- dispatchEventForResponderEventSystem(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
- }
- } else {
- dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst);
- } // We're not blocked on anything.
-
-
- return null;
- }
-
- /**
- * Checks if an event is supported in the current execution environment.
- *
- * NOTE: This will not work correctly for non-generic events such as `change`,
- * `reset`, `load`, `error`, and `select`.
- *
- * Borrows from Modernizr.
- *
- * @param {string} eventNameSuffix Event name, e.g. "click".
- * @return {boolean} True if the event is supported.
- * @internal
- * @license Modernizr 3.0.0pre (Custom Build) | MIT
- */
-
- function isEventSupported(eventNameSuffix) {
- if (!canUseDOM) {
- return false;
- }
-
- var eventName = 'on' + eventNameSuffix;
- var isSupported = eventName in document;
-
- if (!isSupported) {
- var element = document.createElement('div');
- element.setAttribute(eventName, 'return;');
- isSupported = typeof element[eventName] === 'function';
- }
-
- return isSupported;
- }
-
- /**
- * Summary of `ReactBrowserEventEmitter` event handling:
- *
- * - Top-level delegation is used to trap most native browser events. This
- * may only occur in the main thread and is the responsibility of
- * ReactDOMEventListener, which is injected and can therefore support
- * pluggable event sources. This is the only work that occurs in the main
- * thread.
- *
- * - We normalize and de-duplicate events to account for browser quirks. This
- * may be done in the worker thread.
- *
- * - Forward these native events (with the associated top-level type used to
- * trap it) to `EventPluginHub`, which in turn will ask plugins if they want
- * to extract any synthetic events.
- *
- * - The `EventPluginHub` will then process each event by annotating them with
- * "dispatches", a sequence of listeners and IDs that care about that event.
- *
- * - The `EventPluginHub` then dispatches the events.
- *
- * Overview of React and the event system:
- *
- * +------------+ .
- * | DOM | .
- * +------------+ .
- * | .
- * v .
- * +------------+ .
- * | ReactEvent | .
- * | Listener | .
- * +------------+ . +-----------+
- * | . +--------+|SimpleEvent|
- * | . | |Plugin |
- * +-----|------+ . v +-----------+
- * | | | . +--------------+ +------------+
- * | +-----------.--->|EventPluginHub| | Event |
- * | | . | | +-----------+ | Propagators|
- * | ReactEvent | . | | |TapEvent | |------------|
- * | Emitter | . | |<---+|Plugin | |other plugin|
- * | | . | | +-----------+ | utilities |
- * | +-----------.--->| | +------------+
- * | | | . +--------------+
- * +-----|------+ . ^ +-----------+
- * | . | |Enter/Leave|
- * + . +-------+|Plugin |
- * +-------------+ . +-----------+
- * | application | .
- * |-------------| .
- * | | .
- * | | .
- * +-------------+ .
- * .
- * React Core . General Purpose Event Plugin System
- */
-
- var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
- var elementListeningSets = new PossiblyWeakMap();
- function getListeningSetForElement(element) {
- var listeningSet = elementListeningSets.get(element);
-
- if (listeningSet === undefined) {
- listeningSet = new Set();
- elementListeningSets.set(element, listeningSet);
- }
-
- return listeningSet;
- }
- /**
- * We listen for bubbled touch events on the document object.
- *
- * Firefox v8.01 (and possibly others) exhibited strange behavior when
- * mounting `onmousemove` events at some node that was not the document
- * element. The symptoms were that if your mouse is not moving over something
- * contained within that mount point (for example on the background) the
- * top-level listeners for `onmousemove` won't be called. However, if you
- * register the `mousemove` on the document object, then it will of course
- * catch all `mousemove`s. This along with iOS quirks, justifies restricting
- * top-level listeners to the document object only, at least for these
- * movement types of events and possibly all events.
- *
- * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
- *
- * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
- * they bubble to document.
- *
- * @param {string} registrationName Name of listener (e.g. `onClick`).
- * @param {object} mountAt Container where to mount the listener
- */
-
- function listenTo(registrationName, mountAt) {
- var listeningSet = getListeningSetForElement(mountAt);
- var dependencies = registrationNameDependencies[registrationName];
-
- for (var i = 0; i < dependencies.length; i++) {
- var dependency = dependencies[i];
- listenToTopLevel(dependency, mountAt, listeningSet);
- }
- }
- function listenToTopLevel(topLevelType, mountAt, listeningSet) {
- if (!listeningSet.has(topLevelType)) {
- switch (topLevelType) {
- case TOP_SCROLL:
- trapCapturedEvent(TOP_SCROLL, mountAt);
- break;
-
- case TOP_FOCUS:
- case TOP_BLUR:
- trapCapturedEvent(TOP_FOCUS, mountAt);
- trapCapturedEvent(TOP_BLUR, mountAt); // We set the flag for a single dependency later in this function,
- // but this ensures we mark both as attached rather than just one.
-
- listeningSet.add(TOP_BLUR);
- listeningSet.add(TOP_FOCUS);
- break;
-
- case TOP_CANCEL:
- case TOP_CLOSE:
- if (isEventSupported(getRawEventName(topLevelType))) {
- trapCapturedEvent(topLevelType, mountAt);
- }
-
- break;
-
- case TOP_INVALID:
- case TOP_SUBMIT:
- case TOP_RESET:
- // We listen to them on the target DOM elements.
- // Some of them bubble so we don't want them to fire twice.
- break;
-
- default:
- // By default, listen on the top level to all non-media events.
- // Media events don't bubble so adding the listener wouldn't do anything.
- var isMediaEvent = mediaEventTypes.indexOf(topLevelType) !== -1;
-
- if (!isMediaEvent) {
- trapBubbledEvent(topLevelType, mountAt);
- }
-
- break;
- }
-
- listeningSet.add(topLevelType);
- }
- }
- function isListeningToAllDependencies(registrationName, mountAt) {
- var listeningSet = getListeningSetForElement(mountAt);
- var dependencies = registrationNameDependencies[registrationName];
-
- for (var i = 0; i < dependencies.length; i++) {
- var dependency = dependencies[i];
-
- if (!listeningSet.has(dependency)) {
- return false;
- }
- }
-
- return true;
- }
-
- // List derived from Gecko source code:
- // https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js
- var shorthandToLonghand = {
- animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],
- background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'],
- backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],
- border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'],
- borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'],
- borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'],
- borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],
- borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],
- borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],
- borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'],
- borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'],
- borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],
- borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'],
- borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'],
- borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'],
- borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'],
- borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'],
- columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],
- columns: ['columnCount', 'columnWidth'],
- flex: ['flexBasis', 'flexGrow', 'flexShrink'],
- flexFlow: ['flexDirection', 'flexWrap'],
- font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'],
- fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'],
- gap: ['columnGap', 'rowGap'],
- grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
- gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'],
- gridColumn: ['gridColumnEnd', 'gridColumnStart'],
- gridColumnGap: ['columnGap'],
- gridGap: ['columnGap', 'rowGap'],
- gridRow: ['gridRowEnd', 'gridRowStart'],
- gridRowGap: ['rowGap'],
- gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
- listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],
- margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],
- marker: ['markerEnd', 'markerMid', 'markerStart'],
- mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'],
- maskPosition: ['maskPositionX', 'maskPositionY'],
- outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],
- overflow: ['overflowX', 'overflowY'],
- padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],
- placeContent: ['alignContent', 'justifyContent'],
- placeItems: ['alignItems', 'justifyItems'],
- placeSelf: ['alignSelf', 'justifySelf'],
- textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'],
- textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],
- transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],
- wordWrap: ['overflowWrap']
- };
-
- /**
- * CSS properties which accept numbers but are not in units of "px".
- */
- var isUnitlessNumber = {
- animationIterationCount: true,
- borderImageOutset: true,
- borderImageSlice: true,
- borderImageWidth: true,
- boxFlex: true,
- boxFlexGroup: true,
- boxOrdinalGroup: true,
- columnCount: true,
- columns: true,
- flex: true,
- flexGrow: true,
- flexPositive: true,
- flexShrink: true,
- flexNegative: true,
- flexOrder: true,
- gridArea: true,
- gridRow: true,
- gridRowEnd: true,
- gridRowSpan: true,
- gridRowStart: true,
- gridColumn: true,
- gridColumnEnd: true,
- gridColumnSpan: true,
- gridColumnStart: true,
- fontWeight: true,
- lineClamp: true,
- lineHeight: true,
- opacity: true,
- order: true,
- orphans: true,
- tabSize: true,
- widows: true,
- zIndex: true,
- zoom: true,
- // SVG-related properties
- fillOpacity: true,
- floodOpacity: true,
- stopOpacity: true,
- strokeDasharray: true,
- strokeDashoffset: true,
- strokeMiterlimit: true,
- strokeOpacity: true,
- strokeWidth: true
- };
- /**
- * @param {string} prefix vendor-specific prefix, eg: Webkit
- * @param {string} key style name, eg: transitionDuration
- * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
- * WebkitTransitionDuration
- */
-
- function prefixKey(prefix, key) {
- return prefix + key.charAt(0).toUpperCase() + key.substring(1);
- }
- /**
- * Support style names that may come passed in prefixed by adding permutations
- * of vendor prefixes.
- */
-
-
- var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
- // infinite loop, because it iterates over the newly added props too.
-
- Object.keys(isUnitlessNumber).forEach(function (prop) {
- prefixes.forEach(function (prefix) {
- isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
- });
- });
-
- /**
- * Convert a value into the proper css writable value. The style name `name`
- * should be logical (no hyphens), as specified
- * in `CSSProperty.isUnitlessNumber`.
- *
- * @param {string} name CSS property name such as `topMargin`.
- * @param {*} value CSS property value such as `10px`.
- * @return {string} Normalized style value with dimensions applied.
- */
-
- function dangerousStyleValue(name, value, isCustomProperty) {
- // Note that we've removed escapeTextForBrowser() calls here since the
- // whole string will be escaped when the attribute is injected into
- // the markup. If you provide unsafe user data here they can inject
- // arbitrary CSS which may be problematic (I couldn't repro this):
- // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
- // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
- // This is not an XSS hole but instead a potential CSS injection issue
- // which has lead to a greater discussion about how we're going to
- // trust URLs moving forward. See #2115901
- var isEmpty = value == null || typeof value === 'boolean' || value === '';
-
- if (isEmpty) {
- return '';
- }
-
- if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
- return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
- }
-
- return ('' + value).trim();
- }
-
- var uppercasePattern = /([A-Z])/g;
- var msPattern = /^ms-/;
- /**
- * Hyphenates a camelcased CSS property name, for example:
- *
- * > hyphenateStyleName('backgroundColor')
- * < "background-color"
- * > hyphenateStyleName('MozTransition')
- * < "-moz-transition"
- * > hyphenateStyleName('msTransition')
- * < "-ms-transition"
- *
- * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
- * is converted to `-ms-`.
- */
-
- function hyphenateStyleName(name) {
- return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
- }
-
- var warnValidStyle = function () {};
-
- {
- // 'msTransform' is correct, but the other prefixes should be capitalized
- var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
- var msPattern$1 = /^-ms-/;
- var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon
-
- var badStyleValueWithSemicolonPattern = /;\s*$/;
- var warnedStyleNames = {};
- var warnedStyleValues = {};
- var warnedForNaNValue = false;
- var warnedForInfinityValue = false;
-
- var camelize = function (string) {
- return string.replace(hyphenPattern, function (_, character) {
- return character.toUpperCase();
- });
- };
-
- var warnHyphenatedStyleName = function (name) {
- if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
- return;
- }
-
- warnedStyleNames[name] = true;
- warning$1(false, 'Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests
- // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
- // is converted to lowercase `ms`.
- camelize(name.replace(msPattern$1, 'ms-')));
- };
-
- var warnBadVendoredStyleName = function (name) {
- if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
- return;
- }
-
- warnedStyleNames[name] = true;
- warning$1(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
- };
-
- var warnStyleValueWithSemicolon = function (name, value) {
- if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
- return;
- }
-
- warnedStyleValues[value] = true;
- warning$1(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
- };
-
- var warnStyleValueIsNaN = function (name, value) {
- if (warnedForNaNValue) {
- return;
- }
-
- warnedForNaNValue = true;
- warning$1(false, '`NaN` is an invalid value for the `%s` css style property.', name);
- };
-
- var warnStyleValueIsInfinity = function (name, value) {
- if (warnedForInfinityValue) {
- return;
- }
-
- warnedForInfinityValue = true;
- warning$1(false, '`Infinity` is an invalid value for the `%s` css style property.', name);
- };
-
- warnValidStyle = function (name, value) {
- if (name.indexOf('-') > -1) {
- warnHyphenatedStyleName(name);
- } else if (badVendoredStyleNamePattern.test(name)) {
- warnBadVendoredStyleName(name);
- } else if (badStyleValueWithSemicolonPattern.test(value)) {
- warnStyleValueWithSemicolon(name, value);
- }
-
- if (typeof value === 'number') {
- if (isNaN(value)) {
- warnStyleValueIsNaN(name, value);
- } else if (!isFinite(value)) {
- warnStyleValueIsInfinity(name, value);
- }
- }
- };
- }
-
- var warnValidStyle$1 = warnValidStyle;
-
- /**
- * Operations for dealing with CSS properties.
- */
-
- /**
- * This creates a string that is expected to be equivalent to the style
- * attribute generated by server-side rendering. It by-passes warnings and
- * security checks so it's not safe to use this value for anything other than
- * comparison. It is only used in DEV for SSR validation.
- */
-
- function createDangerousStringForStyles(styles) {
- {
- var serialized = '';
- var delimiter = '';
-
- for (var styleName in styles) {
- if (!styles.hasOwnProperty(styleName)) {
- continue;
- }
-
- var styleValue = styles[styleName];
-
- if (styleValue != null) {
- var isCustomProperty = styleName.indexOf('--') === 0;
- serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';
- serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
- delimiter = ';';
- }
- }
-
- return serialized || null;
- }
- }
- /**
- * Sets the value for multiple styles on a node. If a value is specified as
- * '' (empty string), the corresponding style property will be unset.
- *
- * @param {DOMElement} node
- * @param {object} styles
- */
-
- function setValueForStyles(node, styles) {
- var style = node.style;
-
- for (var styleName in styles) {
- if (!styles.hasOwnProperty(styleName)) {
- continue;
- }
-
- var isCustomProperty = styleName.indexOf('--') === 0;
-
- {
- if (!isCustomProperty) {
- warnValidStyle$1(styleName, styles[styleName]);
- }
- }
-
- var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);
-
- if (styleName === 'float') {
- styleName = 'cssFloat';
- }
-
- if (isCustomProperty) {
- style.setProperty(styleName, styleValue);
- } else {
- style[styleName] = styleValue;
- }
- }
- }
-
- function isValueEmpty(value) {
- return value == null || typeof value === 'boolean' || value === '';
- }
- /**
- * Given {color: 'red', overflow: 'hidden'} returns {
- * color: 'color',
- * overflowX: 'overflow',
- * overflowY: 'overflow',
- * }. This can be read as "the overflowY property was set by the overflow
- * shorthand". That is, the values are the property that each was derived from.
- */
-
-
- function expandShorthandMap(styles) {
- var expanded = {};
-
- for (var key in styles) {
- var longhands = shorthandToLonghand[key] || [key];
-
- for (var i = 0; i < longhands.length; i++) {
- expanded[longhands[i]] = key;
- }
- }
-
- return expanded;
- }
- /**
- * When mixing shorthand and longhand property names, we warn during updates if
- * we expect an incorrect result to occur. In particular, we warn for:
- *
- * Updating a shorthand property (longhand gets overwritten):
- * {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'}
- * becomes .style.font = 'baz'
- * Removing a shorthand property (longhand gets lost too):
- * {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'}
- * becomes .style.font = ''
- * Removing a longhand property (should revert to shorthand; doesn't):
- * {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'}
- * becomes .style.fontVariant = ''
- */
-
-
- function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
- if (!warnAboutShorthandPropertyCollision) {
- return;
- }
-
- if (!nextStyles) {
- return;
- }
-
- var expandedUpdates = expandShorthandMap(styleUpdates);
- var expandedStyles = expandShorthandMap(nextStyles);
- var warnedAbout = {};
-
- for (var key in expandedUpdates) {
- var originalKey = expandedUpdates[key];
- var correctOriginalKey = expandedStyles[key];
-
- if (correctOriginalKey && originalKey !== correctOriginalKey) {
- var warningKey = originalKey + ',' + correctOriginalKey;
-
- if (warnedAbout[warningKey]) {
- continue;
- }
-
- warnedAbout[warningKey] = true;
- warning$1(false, '%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + "avoid this, don't mix shorthand and non-shorthand properties " + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey);
- }
- }
- }
-
- // For HTML, certain tags should omit their close tag. We keep a whitelist for
- // those special-case tags.
- var omittedCloseTags = {
- area: true,
- base: true,
- br: true,
- col: true,
- embed: true,
- hr: true,
- img: true,
- input: true,
- keygen: true,
- link: true,
- meta: true,
- param: true,
- source: true,
- track: true,
- wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems.
-
- };
-
- // `omittedCloseTags` except that `menuitem` should still have its closing tag.
-
- var voidElementTags = _assign({
- menuitem: true
- }, omittedCloseTags);
-
- // or add stack by default to invariants where possible.
-
- var HTML$1 = '__html';
- var ReactDebugCurrentFrame$3 = null;
-
- {
- ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;
- }
-
- function assertValidProps(tag, props) {
- if (!props) {
- return;
- } // Note the use of `==` which checks for null or undefined.
-
-
- if (voidElementTags[tag]) {
- if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {
- {
- throw Error(tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`." + (ReactDebugCurrentFrame$3.getStackAddendum()));
- }
- }
- }
-
- if (props.dangerouslySetInnerHTML != null) {
- if (!(props.children == null)) {
- {
- throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
- }
- }
-
- if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML$1 in props.dangerouslySetInnerHTML)) {
- {
- throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.");
- }
- }
- }
-
- {
- !(props.suppressContentEditableWarning || !props.contentEditable || props.children == null) ? warning$1(false, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
- }
-
- if (!(props.style == null || typeof props.style === 'object')) {
- {
- throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." + (ReactDebugCurrentFrame$3.getStackAddendum()));
- }
- }
- }
-
- function isCustomComponent(tagName, props) {
- if (tagName.indexOf('-') === -1) {
- return typeof props.is === 'string';
- }
-
- switch (tagName) {
- // These are reserved SVG and MathML elements.
- // We don't mind this whitelist too much because we expect it to never grow.
- // The alternative is to track the namespace in a few places which is convoluted.
- // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
- case 'annotation-xml':
- case 'color-profile':
- case 'font-face':
- case 'font-face-src':
- case 'font-face-uri':
- case 'font-face-format':
- case 'font-face-name':
- case 'missing-glyph':
- return false;
-
- default:
- return true;
- }
- }
-
- // When adding attributes to the HTML or SVG whitelist, be sure to
- // also add them to this module to ensure casing and incorrect name
- // warnings.
- var possibleStandardNames = {
- // HTML
- accept: 'accept',
- acceptcharset: 'acceptCharset',
- 'accept-charset': 'acceptCharset',
- accesskey: 'accessKey',
- action: 'action',
- allowfullscreen: 'allowFullScreen',
- alt: 'alt',
- as: 'as',
- async: 'async',
- autocapitalize: 'autoCapitalize',
- autocomplete: 'autoComplete',
- autocorrect: 'autoCorrect',
- autofocus: 'autoFocus',
- autoplay: 'autoPlay',
- autosave: 'autoSave',
- capture: 'capture',
- cellpadding: 'cellPadding',
- cellspacing: 'cellSpacing',
- challenge: 'challenge',
- charset: 'charSet',
- checked: 'checked',
- children: 'children',
- cite: 'cite',
- class: 'className',
- classid: 'classID',
- classname: 'className',
- cols: 'cols',
- colspan: 'colSpan',
- content: 'content',
- contenteditable: 'contentEditable',
- contextmenu: 'contextMenu',
- controls: 'controls',
- controlslist: 'controlsList',
- coords: 'coords',
- crossorigin: 'crossOrigin',
- dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
- data: 'data',
- datetime: 'dateTime',
- default: 'default',
- defaultchecked: 'defaultChecked',
- defaultvalue: 'defaultValue',
- defer: 'defer',
- dir: 'dir',
- disabled: 'disabled',
- disablepictureinpicture: 'disablePictureInPicture',
- download: 'download',
- draggable: 'draggable',
- enctype: 'encType',
- for: 'htmlFor',
- form: 'form',
- formmethod: 'formMethod',
- formaction: 'formAction',
- formenctype: 'formEncType',
- formnovalidate: 'formNoValidate',
- formtarget: 'formTarget',
- frameborder: 'frameBorder',
- headers: 'headers',
- height: 'height',
- hidden: 'hidden',
- high: 'high',
- href: 'href',
- hreflang: 'hrefLang',
- htmlfor: 'htmlFor',
- httpequiv: 'httpEquiv',
- 'http-equiv': 'httpEquiv',
- icon: 'icon',
- id: 'id',
- innerhtml: 'innerHTML',
- inputmode: 'inputMode',
- integrity: 'integrity',
- is: 'is',
- itemid: 'itemID',
- itemprop: 'itemProp',
- itemref: 'itemRef',
- itemscope: 'itemScope',
- itemtype: 'itemType',
- keyparams: 'keyParams',
- keytype: 'keyType',
- kind: 'kind',
- label: 'label',
- lang: 'lang',
- list: 'list',
- loop: 'loop',
- low: 'low',
- manifest: 'manifest',
- marginwidth: 'marginWidth',
- marginheight: 'marginHeight',
- max: 'max',
- maxlength: 'maxLength',
- media: 'media',
- mediagroup: 'mediaGroup',
- method: 'method',
- min: 'min',
- minlength: 'minLength',
- multiple: 'multiple',
- muted: 'muted',
- name: 'name',
- nomodule: 'noModule',
- nonce: 'nonce',
- novalidate: 'noValidate',
- open: 'open',
- optimum: 'optimum',
- pattern: 'pattern',
- placeholder: 'placeholder',
- playsinline: 'playsInline',
- poster: 'poster',
- preload: 'preload',
- profile: 'profile',
- radiogroup: 'radioGroup',
- readonly: 'readOnly',
- referrerpolicy: 'referrerPolicy',
- rel: 'rel',
- required: 'required',
- reversed: 'reversed',
- role: 'role',
- rows: 'rows',
- rowspan: 'rowSpan',
- sandbox: 'sandbox',
- scope: 'scope',
- scoped: 'scoped',
- scrolling: 'scrolling',
- seamless: 'seamless',
- selected: 'selected',
- shape: 'shape',
- size: 'size',
- sizes: 'sizes',
- span: 'span',
- spellcheck: 'spellCheck',
- src: 'src',
- srcdoc: 'srcDoc',
- srclang: 'srcLang',
- srcset: 'srcSet',
- start: 'start',
- step: 'step',
- style: 'style',
- summary: 'summary',
- tabindex: 'tabIndex',
- target: 'target',
- title: 'title',
- type: 'type',
- usemap: 'useMap',
- value: 'value',
- width: 'width',
- wmode: 'wmode',
- wrap: 'wrap',
- // SVG
- about: 'about',
- accentheight: 'accentHeight',
- 'accent-height': 'accentHeight',
- accumulate: 'accumulate',
- additive: 'additive',
- alignmentbaseline: 'alignmentBaseline',
- 'alignment-baseline': 'alignmentBaseline',
- allowreorder: 'allowReorder',
- alphabetic: 'alphabetic',
- amplitude: 'amplitude',
- arabicform: 'arabicForm',
- 'arabic-form': 'arabicForm',
- ascent: 'ascent',
- attributename: 'attributeName',
- attributetype: 'attributeType',
- autoreverse: 'autoReverse',
- azimuth: 'azimuth',
- basefrequency: 'baseFrequency',
- baselineshift: 'baselineShift',
- 'baseline-shift': 'baselineShift',
- baseprofile: 'baseProfile',
- bbox: 'bbox',
- begin: 'begin',
- bias: 'bias',
- by: 'by',
- calcmode: 'calcMode',
- capheight: 'capHeight',
- 'cap-height': 'capHeight',
- clip: 'clip',
- clippath: 'clipPath',
- 'clip-path': 'clipPath',
- clippathunits: 'clipPathUnits',
- cliprule: 'clipRule',
- 'clip-rule': 'clipRule',
- color: 'color',
- colorinterpolation: 'colorInterpolation',
- 'color-interpolation': 'colorInterpolation',
- colorinterpolationfilters: 'colorInterpolationFilters',
- 'color-interpolation-filters': 'colorInterpolationFilters',
- colorprofile: 'colorProfile',
- 'color-profile': 'colorProfile',
- colorrendering: 'colorRendering',
- 'color-rendering': 'colorRendering',
- contentscripttype: 'contentScriptType',
- contentstyletype: 'contentStyleType',
- cursor: 'cursor',
- cx: 'cx',
- cy: 'cy',
- d: 'd',
- datatype: 'datatype',
- decelerate: 'decelerate',
- descent: 'descent',
- diffuseconstant: 'diffuseConstant',
- direction: 'direction',
- display: 'display',
- divisor: 'divisor',
- dominantbaseline: 'dominantBaseline',
- 'dominant-baseline': 'dominantBaseline',
- dur: 'dur',
- dx: 'dx',
- dy: 'dy',
- edgemode: 'edgeMode',
- elevation: 'elevation',
- enablebackground: 'enableBackground',
- 'enable-background': 'enableBackground',
- end: 'end',
- exponent: 'exponent',
- externalresourcesrequired: 'externalResourcesRequired',
- fill: 'fill',
- fillopacity: 'fillOpacity',
- 'fill-opacity': 'fillOpacity',
- fillrule: 'fillRule',
- 'fill-rule': 'fillRule',
- filter: 'filter',
- filterres: 'filterRes',
- filterunits: 'filterUnits',
- floodopacity: 'floodOpacity',
- 'flood-opacity': 'floodOpacity',
- floodcolor: 'floodColor',
- 'flood-color': 'floodColor',
- focusable: 'focusable',
- fontfamily: 'fontFamily',
- 'font-family': 'fontFamily',
- fontsize: 'fontSize',
- 'font-size': 'fontSize',
- fontsizeadjust: 'fontSizeAdjust',
- 'font-size-adjust': 'fontSizeAdjust',
- fontstretch: 'fontStretch',
- 'font-stretch': 'fontStretch',
- fontstyle: 'fontStyle',
- 'font-style': 'fontStyle',
- fontvariant: 'fontVariant',
- 'font-variant': 'fontVariant',
- fontweight: 'fontWeight',
- 'font-weight': 'fontWeight',
- format: 'format',
- from: 'from',
- fx: 'fx',
- fy: 'fy',
- g1: 'g1',
- g2: 'g2',
- glyphname: 'glyphName',
- 'glyph-name': 'glyphName',
- glyphorientationhorizontal: 'glyphOrientationHorizontal',
- 'glyph-orientation-horizontal': 'glyphOrientationHorizontal',
- glyphorientationvertical: 'glyphOrientationVertical',
- 'glyph-orientation-vertical': 'glyphOrientationVertical',
- glyphref: 'glyphRef',
- gradienttransform: 'gradientTransform',
- gradientunits: 'gradientUnits',
- hanging: 'hanging',
- horizadvx: 'horizAdvX',
- 'horiz-adv-x': 'horizAdvX',
- horizoriginx: 'horizOriginX',
- 'horiz-origin-x': 'horizOriginX',
- ideographic: 'ideographic',
- imagerendering: 'imageRendering',
- 'image-rendering': 'imageRendering',
- in2: 'in2',
- in: 'in',
- inlist: 'inlist',
- intercept: 'intercept',
- k1: 'k1',
- k2: 'k2',
- k3: 'k3',
- k4: 'k4',
- k: 'k',
- kernelmatrix: 'kernelMatrix',
- kernelunitlength: 'kernelUnitLength',
- kerning: 'kerning',
- keypoints: 'keyPoints',
- keysplines: 'keySplines',
- keytimes: 'keyTimes',
- lengthadjust: 'lengthAdjust',
- letterspacing: 'letterSpacing',
- 'letter-spacing': 'letterSpacing',
- lightingcolor: 'lightingColor',
- 'lighting-color': 'lightingColor',
- limitingconeangle: 'limitingConeAngle',
- local: 'local',
- markerend: 'markerEnd',
- 'marker-end': 'markerEnd',
- markerheight: 'markerHeight',
- markermid: 'markerMid',
- 'marker-mid': 'markerMid',
- markerstart: 'markerStart',
- 'marker-start': 'markerStart',
- markerunits: 'markerUnits',
- markerwidth: 'markerWidth',
- mask: 'mask',
- maskcontentunits: 'maskContentUnits',
- maskunits: 'maskUnits',
- mathematical: 'mathematical',
- mode: 'mode',
- numoctaves: 'numOctaves',
- offset: 'offset',
- opacity: 'opacity',
- operator: 'operator',
- order: 'order',
- orient: 'orient',
- orientation: 'orientation',
- origin: 'origin',
- overflow: 'overflow',
- overlineposition: 'overlinePosition',
- 'overline-position': 'overlinePosition',
- overlinethickness: 'overlineThickness',
- 'overline-thickness': 'overlineThickness',
- paintorder: 'paintOrder',
- 'paint-order': 'paintOrder',
- panose1: 'panose1',
- 'panose-1': 'panose1',
- pathlength: 'pathLength',
- patterncontentunits: 'patternContentUnits',
- patterntransform: 'patternTransform',
- patternunits: 'patternUnits',
- pointerevents: 'pointerEvents',
- 'pointer-events': 'pointerEvents',
- points: 'points',
- pointsatx: 'pointsAtX',
- pointsaty: 'pointsAtY',
- pointsatz: 'pointsAtZ',
- prefix: 'prefix',
- preservealpha: 'preserveAlpha',
- preserveaspectratio: 'preserveAspectRatio',
- primitiveunits: 'primitiveUnits',
- property: 'property',
- r: 'r',
- radius: 'radius',
- refx: 'refX',
- refy: 'refY',
- renderingintent: 'renderingIntent',
- 'rendering-intent': 'renderingIntent',
- repeatcount: 'repeatCount',
- repeatdur: 'repeatDur',
- requiredextensions: 'requiredExtensions',
- requiredfeatures: 'requiredFeatures',
- resource: 'resource',
- restart: 'restart',
- result: 'result',
- results: 'results',
- rotate: 'rotate',
- rx: 'rx',
- ry: 'ry',
- scale: 'scale',
- security: 'security',
- seed: 'seed',
- shaperendering: 'shapeRendering',
- 'shape-rendering': 'shapeRendering',
- slope: 'slope',
- spacing: 'spacing',
- specularconstant: 'specularConstant',
- specularexponent: 'specularExponent',
- speed: 'speed',
- spreadmethod: 'spreadMethod',
- startoffset: 'startOffset',
- stddeviation: 'stdDeviation',
- stemh: 'stemh',
- stemv: 'stemv',
- stitchtiles: 'stitchTiles',
- stopcolor: 'stopColor',
- 'stop-color': 'stopColor',
- stopopacity: 'stopOpacity',
- 'stop-opacity': 'stopOpacity',
- strikethroughposition: 'strikethroughPosition',
- 'strikethrough-position': 'strikethroughPosition',
- strikethroughthickness: 'strikethroughThickness',
- 'strikethrough-thickness': 'strikethroughThickness',
- string: 'string',
- stroke: 'stroke',
- strokedasharray: 'strokeDasharray',
- 'stroke-dasharray': 'strokeDasharray',
- strokedashoffset: 'strokeDashoffset',
- 'stroke-dashoffset': 'strokeDashoffset',
- strokelinecap: 'strokeLinecap',
- 'stroke-linecap': 'strokeLinecap',
- strokelinejoin: 'strokeLinejoin',
- 'stroke-linejoin': 'strokeLinejoin',
- strokemiterlimit: 'strokeMiterlimit',
- 'stroke-miterlimit': 'strokeMiterlimit',
- strokewidth: 'strokeWidth',
- 'stroke-width': 'strokeWidth',
- strokeopacity: 'strokeOpacity',
- 'stroke-opacity': 'strokeOpacity',
- suppresscontenteditablewarning: 'suppressContentEditableWarning',
- suppresshydrationwarning: 'suppressHydrationWarning',
- surfacescale: 'surfaceScale',
- systemlanguage: 'systemLanguage',
- tablevalues: 'tableValues',
- targetx: 'targetX',
- targety: 'targetY',
- textanchor: 'textAnchor',
- 'text-anchor': 'textAnchor',
- textdecoration: 'textDecoration',
- 'text-decoration': 'textDecoration',
- textlength: 'textLength',
- textrendering: 'textRendering',
- 'text-rendering': 'textRendering',
- to: 'to',
- transform: 'transform',
- typeof: 'typeof',
- u1: 'u1',
- u2: 'u2',
- underlineposition: 'underlinePosition',
- 'underline-position': 'underlinePosition',
- underlinethickness: 'underlineThickness',
- 'underline-thickness': 'underlineThickness',
- unicode: 'unicode',
- unicodebidi: 'unicodeBidi',
- 'unicode-bidi': 'unicodeBidi',
- unicoderange: 'unicodeRange',
- 'unicode-range': 'unicodeRange',
- unitsperem: 'unitsPerEm',
- 'units-per-em': 'unitsPerEm',
- unselectable: 'unselectable',
- valphabetic: 'vAlphabetic',
- 'v-alphabetic': 'vAlphabetic',
- values: 'values',
- vectoreffect: 'vectorEffect',
- 'vector-effect': 'vectorEffect',
- version: 'version',
- vertadvy: 'vertAdvY',
- 'vert-adv-y': 'vertAdvY',
- vertoriginx: 'vertOriginX',
- 'vert-origin-x': 'vertOriginX',
- vertoriginy: 'vertOriginY',
- 'vert-origin-y': 'vertOriginY',
- vhanging: 'vHanging',
- 'v-hanging': 'vHanging',
- videographic: 'vIdeographic',
- 'v-ideographic': 'vIdeographic',
- viewbox: 'viewBox',
- viewtarget: 'viewTarget',
- visibility: 'visibility',
- vmathematical: 'vMathematical',
- 'v-mathematical': 'vMathematical',
- vocab: 'vocab',
- widths: 'widths',
- wordspacing: 'wordSpacing',
- 'word-spacing': 'wordSpacing',
- writingmode: 'writingMode',
- 'writing-mode': 'writingMode',
- x1: 'x1',
- x2: 'x2',
- x: 'x',
- xchannelselector: 'xChannelSelector',
- xheight: 'xHeight',
- 'x-height': 'xHeight',
- xlinkactuate: 'xlinkActuate',
- 'xlink:actuate': 'xlinkActuate',
- xlinkarcrole: 'xlinkArcrole',
- 'xlink:arcrole': 'xlinkArcrole',
- xlinkhref: 'xlinkHref',
- 'xlink:href': 'xlinkHref',
- xlinkrole: 'xlinkRole',
- 'xlink:role': 'xlinkRole',
- xlinkshow: 'xlinkShow',
- 'xlink:show': 'xlinkShow',
- xlinktitle: 'xlinkTitle',
- 'xlink:title': 'xlinkTitle',
- xlinktype: 'xlinkType',
- 'xlink:type': 'xlinkType',
- xmlbase: 'xmlBase',
- 'xml:base': 'xmlBase',
- xmllang: 'xmlLang',
- 'xml:lang': 'xmlLang',
- xmlns: 'xmlns',
- 'xml:space': 'xmlSpace',
- xmlnsxlink: 'xmlnsXlink',
- 'xmlns:xlink': 'xmlnsXlink',
- xmlspace: 'xmlSpace',
- y1: 'y1',
- y2: 'y2',
- y: 'y',
- ychannelselector: 'yChannelSelector',
- z: 'z',
- zoomandpan: 'zoomAndPan'
- };
-
- var ariaProperties = {
- 'aria-current': 0,
- // state
- 'aria-details': 0,
- 'aria-disabled': 0,
- // state
- 'aria-hidden': 0,
- // state
- 'aria-invalid': 0,
- // state
- 'aria-keyshortcuts': 0,
- 'aria-label': 0,
- 'aria-roledescription': 0,
- // Widget Attributes
- 'aria-autocomplete': 0,
- 'aria-checked': 0,
- 'aria-expanded': 0,
- 'aria-haspopup': 0,
- 'aria-level': 0,
- 'aria-modal': 0,
- 'aria-multiline': 0,
- 'aria-multiselectable': 0,
- 'aria-orientation': 0,
- 'aria-placeholder': 0,
- 'aria-pressed': 0,
- 'aria-readonly': 0,
- 'aria-required': 0,
- 'aria-selected': 0,
- 'aria-sort': 0,
- 'aria-valuemax': 0,
- 'aria-valuemin': 0,
- 'aria-valuenow': 0,
- 'aria-valuetext': 0,
- // Live Region Attributes
- 'aria-atomic': 0,
- 'aria-busy': 0,
- 'aria-live': 0,
- 'aria-relevant': 0,
- // Drag-and-Drop Attributes
- 'aria-dropeffect': 0,
- 'aria-grabbed': 0,
- // Relationship Attributes
- 'aria-activedescendant': 0,
- 'aria-colcount': 0,
- 'aria-colindex': 0,
- 'aria-colspan': 0,
- 'aria-controls': 0,
- 'aria-describedby': 0,
- 'aria-errormessage': 0,
- 'aria-flowto': 0,
- 'aria-labelledby': 0,
- 'aria-owns': 0,
- 'aria-posinset': 0,
- 'aria-rowcount': 0,
- 'aria-rowindex': 0,
- 'aria-rowspan': 0,
- 'aria-setsize': 0
- };
-
- var warnedProperties = {};
- var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
- var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
- var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
-
- function validateProperty(tagName, name) {
- if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {
- return true;
- }
-
- if (rARIACamel.test(name)) {
- var ariaName = 'aria-' + name.slice(4).toLowerCase();
- var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM
- // DOM properties, then it is an invalid aria-* attribute.
-
- if (correctName == null) {
- warning$1(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);
- warnedProperties[name] = true;
- return true;
- } // aria-* attributes should be lowercase; suggest the lowercase version.
-
-
- if (name !== correctName) {
- warning$1(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);
- warnedProperties[name] = true;
- return true;
- }
- }
-
- if (rARIA.test(name)) {
- var lowerCasedName = name.toLowerCase();
- var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM
- // DOM properties, then it is an invalid aria-* attribute.
-
- if (standardName == null) {
- warnedProperties[name] = true;
- return false;
- } // aria-* attributes should be lowercase; suggest the lowercase version.
-
-
- if (name !== standardName) {
- warning$1(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);
- warnedProperties[name] = true;
- return true;
- }
- }
-
- return true;
- }
-
- function warnInvalidARIAProps(type, props) {
- var invalidProps = [];
-
- for (var key in props) {
- var isValid = validateProperty(type, key);
-
- if (!isValid) {
- invalidProps.push(key);
- }
- }
-
- var unknownPropString = invalidProps.map(function (prop) {
- return '`' + prop + '`';
- }).join(', ');
-
- if (invalidProps.length === 1) {
- warning$1(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
- } else if (invalidProps.length > 1) {
- warning$1(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
- }
- }
-
- function validateProperties(type, props) {
- if (isCustomComponent(type, props)) {
- return;
- }
-
- warnInvalidARIAProps(type, props);
- }
-
- var didWarnValueNull = false;
- function validateProperties$1(type, props) {
- if (type !== 'input' && type !== 'textarea' && type !== 'select') {
- return;
- }
-
- if (props != null && props.value === null && !didWarnValueNull) {
- didWarnValueNull = true;
-
- if (type === 'select' && props.multiple) {
- warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);
- } else {
- warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);
- }
- }
- }
-
- var validateProperty$1 = function () {};
-
- {
- var warnedProperties$1 = {};
- var _hasOwnProperty = Object.prototype.hasOwnProperty;
- var EVENT_NAME_REGEX = /^on./;
- var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
- var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
- var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
-
- validateProperty$1 = function (tagName, name, value, canUseEventSystem) {
- if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
- return true;
- }
-
- var lowerCasedName = name.toLowerCase();
-
- if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
- warning$1(false, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');
- warnedProperties$1[name] = true;
- return true;
- } // We can't rely on the event system being injected on the server.
-
-
- if (canUseEventSystem) {
- if (registrationNameModules.hasOwnProperty(name)) {
- return true;
- }
-
- var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
-
- if (registrationName != null) {
- warning$1(false, 'Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);
- warnedProperties$1[name] = true;
- return true;
- }
-
- if (EVENT_NAME_REGEX.test(name)) {
- warning$1(false, 'Unknown event handler property `%s`. It will be ignored.', name);
- warnedProperties$1[name] = true;
- return true;
- }
- } else if (EVENT_NAME_REGEX.test(name)) {
- // If no event plugins have been injected, we are in a server environment.
- // So we can't tell if the event name is correct for sure, but we can filter
- // out known bad ones like `onclick`. We can't suggest a specific replacement though.
- if (INVALID_EVENT_NAME_REGEX.test(name)) {
- warning$1(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
- }
-
- warnedProperties$1[name] = true;
- return true;
- } // Let the ARIA attribute hook validate ARIA attributes
-
-
- if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
- return true;
- }
-
- if (lowerCasedName === 'innerhtml') {
- warning$1(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
- warnedProperties$1[name] = true;
- return true;
- }
-
- if (lowerCasedName === 'aria') {
- warning$1(false, 'The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
- warnedProperties$1[name] = true;
- return true;
- }
-
- if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
- warning$1(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);
- warnedProperties$1[name] = true;
- return true;
- }
-
- if (typeof value === 'number' && isNaN(value)) {
- warning$1(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);
- warnedProperties$1[name] = true;
- return true;
- }
-
- var propertyInfo = getPropertyInfo(name);
- var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config.
-
- if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
- var standardName = possibleStandardNames[lowerCasedName];
-
- if (standardName !== name) {
- warning$1(false, 'Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);
- warnedProperties$1[name] = true;
- return true;
- }
- } else if (!isReserved && name !== lowerCasedName) {
- // Unknown attributes should have lowercase casing since that's how they
- // will be cased anyway with server rendering.
- warning$1(false, 'React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);
- warnedProperties$1[name] = true;
- return true;
- }
-
- if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
- if (value) {
- warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name);
- } else {
- warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
- }
-
- warnedProperties$1[name] = true;
- return true;
- } // Now that we've validated casing, do not validate
- // data types for reserved props
-
-
- if (isReserved) {
- return true;
- } // Warn when a known attribute is a bad type
-
-
- if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
- warnedProperties$1[name] = true;
- return false;
- } // Warn when passing the strings 'false' or 'true' into a boolean prop
-
-
- if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
- warning$1(false, 'Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value);
- warnedProperties$1[name] = true;
- return true;
- }
-
- return true;
- };
- }
-
- var warnUnknownProperties = function (type, props, canUseEventSystem) {
- var unknownProps = [];
-
- for (var key in props) {
- var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
-
- if (!isValid) {
- unknownProps.push(key);
- }
- }
-
- var unknownPropString = unknownProps.map(function (prop) {
- return '`' + prop + '`';
- }).join(', ');
-
- if (unknownProps.length === 1) {
- warning$1(false, 'Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
- } else if (unknownProps.length > 1) {
- warning$1(false, 'Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
- }
- };
-
- function validateProperties$2(type, props, canUseEventSystem) {
- if (isCustomComponent(type, props)) {
- return;
- }
-
- warnUnknownProperties(type, props, canUseEventSystem);
- }
-
- // TODO: direct imports like some-package/src/* are bad. Fix me.
- var didWarnInvalidHydration = false;
- var didWarnShadyDOM = false;
- var didWarnScriptTags = false;
- var DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
- var SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';
- var SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';
- var AUTOFOCUS = 'autoFocus';
- var CHILDREN = 'children';
- var STYLE$1 = 'style';
- var HTML = '__html';
- var LISTENERS = 'listeners';
- var HTML_NAMESPACE = Namespaces.html;
- var warnedUnknownTags;
- var suppressHydrationWarning;
- var validatePropertiesInDevelopment;
- var warnForTextDifference;
- var warnForPropDifference;
- var warnForExtraAttributes;
- var warnForInvalidEventListener;
- var canDiffStyleForHydrationWarning;
- var normalizeMarkupForTextOrAttribute;
- var normalizeHTML;
-
- {
- warnedUnknownTags = {
- // Chrome is the only major browser not shipping <time>. But as of July
- // 2017 it intends to ship it due to widespread usage. We intentionally
- // *don't* warn for <time> even if it's unrecognized by Chrome because
- // it soon will be, and many apps have been using it anyway.
- time: true,
- // There are working polyfills for <dialog>. Let people use it.
- dialog: true,
- // Electron ships a custom <webview> tag to display external web content in
- // an isolated frame and process.
- // This tag is not present in non Electron environments such as JSDom which
- // is often used for testing purposes.
- // @see https://electronjs.org/docs/api/webview-tag
- webview: true
- };
-
- validatePropertiesInDevelopment = function (type, props) {
- validateProperties(type, props);
- validateProperties$1(type, props);
- validateProperties$2(type, props,
- /* canUseEventSystem */
- true);
- }; // IE 11 parses & normalizes the style attribute as opposed to other
- // browsers. It adds spaces and sorts the properties in some
- // non-alphabetical order. Handling that would require sorting CSS
- // properties in the client & server versions or applying
- // `expectedStyle` to a temporary DOM node to read its `style` attribute
- // normalized. Since it only affects IE, we're skipping style warnings
- // in that browser completely in favor of doing all that work.
- // See https://github.com/facebook/react/issues/11807
-
-
- canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode; // HTML parsing normalizes CR and CRLF to LF.
- // It also can turn \u0000 into \uFFFD inside attributes.
- // https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream
- // If we have a mismatch, it might be caused by that.
- // We will still patch up in this case but not fire the warning.
-
- var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
- var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
-
- normalizeMarkupForTextOrAttribute = function (markup) {
- var markupString = typeof markup === 'string' ? markup : '' + markup;
- return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');
- };
-
- warnForTextDifference = function (serverText, clientText) {
- if (didWarnInvalidHydration) {
- return;
- }
-
- var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
- var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
-
- if (normalizedServerText === normalizedClientText) {
- return;
- }
-
- didWarnInvalidHydration = true;
- warningWithoutStack$1(false, 'Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
- };
-
- warnForPropDifference = function (propName, serverValue, clientValue) {
- if (didWarnInvalidHydration) {
- return;
- }
-
- var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
- var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);
-
- if (normalizedServerValue === normalizedClientValue) {
- return;
- }
-
- didWarnInvalidHydration = true;
- warningWithoutStack$1(false, 'Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
- };
-
- warnForExtraAttributes = function (attributeNames) {
- if (didWarnInvalidHydration) {
- return;
- }
-
- didWarnInvalidHydration = true;
- var names = [];
- attributeNames.forEach(function (name) {
- names.push(name);
- });
- warningWithoutStack$1(false, 'Extra attributes from the server: %s', names);
- };
-
- warnForInvalidEventListener = function (registrationName, listener) {
- if (listener === false) {
- warning$1(false, 'Expected `%s` listener to be a function, instead got `false`.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName);
- } else {
- warning$1(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener);
- }
- }; // Parse the HTML and read it back to normalize the HTML string so that it
- // can be used for comparison.
-
-
- normalizeHTML = function (parent, html) {
- // We could have created a separate document here to avoid
- // re-initializing custom elements if they exist. But this breaks
- // how <noscript> is being handled. So we use the same document.
- // See the discussion in https://github.com/facebook/react/pull/11157.
- var testElement = parent.namespaceURI === HTML_NAMESPACE ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
- testElement.innerHTML = html;
- return testElement.innerHTML;
- };
- }
-
- function ensureListeningTo(rootContainerElement, registrationName) {
- var isDocumentOrFragment = rootContainerElement.nodeType === DOCUMENT_NODE || rootContainerElement.nodeType === DOCUMENT_FRAGMENT_NODE;
- var doc = isDocumentOrFragment ? rootContainerElement : rootContainerElement.ownerDocument;
- listenTo(registrationName, doc);
- }
-
- function getOwnerDocumentFromRootContainer(rootContainerElement) {
- return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
- }
-
- function noop() {}
-
- function trapClickOnNonInteractiveElement(node) {
- // Mobile Safari does not fire properly bubble click events on
- // non-interactive elements, which means delegated click listeners do not
- // fire. The workaround for this bug involves attaching an empty click
- // listener on the target node.
- // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
- // Just set it using the onclick property so that we don't have to manage any
- // bookkeeping for it. Not sure if we need to clear it when the listener is
- // removed.
- // TODO: Only do this for the relevant Safaris maybe?
- node.onclick = noop;
- }
-
- function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
- for (var propKey in nextProps) {
- if (!nextProps.hasOwnProperty(propKey)) {
- continue;
- }
-
- var nextProp = nextProps[propKey];
-
- if (propKey === STYLE$1) {
- {
- if (nextProp) {
- // Freeze the next style object so that we can assume it won't be
- // mutated. We have already warned for this in the past.
- Object.freeze(nextProp);
- }
- } // Relies on `updateStylesByID` not mutating `styleUpdates`.
-
-
- setValueForStyles(domElement, nextProp);
- } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
- var nextHtml = nextProp ? nextProp[HTML] : undefined;
-
- if (nextHtml != null) {
- setInnerHTML(domElement, nextHtml);
- }
- } else if (propKey === CHILDREN) {
- if (typeof nextProp === 'string') {
- // Avoid setting initial textContent when the text is empty. In IE11 setting
- // textContent on a <textarea> will cause the placeholder to not
- // show within the <textarea> until it has been focused and blurred again.
- // https://github.com/facebook/react/issues/6731#issuecomment-254874553
- var canSetTextContent = tag !== 'textarea' || nextProp !== '';
-
- if (canSetTextContent) {
- setTextContent(domElement, nextProp);
- }
- } else if (typeof nextProp === 'number') {
- setTextContent(domElement, '' + nextProp);
- }
- } else if (enableFlareAPI && propKey === LISTENERS || propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {// Noop
- } else if (propKey === AUTOFOCUS) {// We polyfill it separately on the client during commit.
- // We could have excluded it in the property list instead of
- // adding a special case here, but then it wouldn't be emitted
- // on server rendering (but we *do* want to emit it in SSR).
- } else if (registrationNameModules.hasOwnProperty(propKey)) {
- if (nextProp != null) {
- if ( true && typeof nextProp !== 'function') {
- warnForInvalidEventListener(propKey, nextProp);
- }
-
- ensureListeningTo(rootContainerElement, propKey);
- }
- } else if (nextProp != null) {
- setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
- }
- }
- }
-
- function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
- // TODO: Handle wasCustomComponentTag
- for (var i = 0; i < updatePayload.length; i += 2) {
- var propKey = updatePayload[i];
- var propValue = updatePayload[i + 1];
-
- if (propKey === STYLE$1) {
- setValueForStyles(domElement, propValue);
- } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
- setInnerHTML(domElement, propValue);
- } else if (propKey === CHILDREN) {
- setTextContent(domElement, propValue);
- } else {
- setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
- }
- }
- }
-
- function createElement(type, props, rootContainerElement, parentNamespace) {
- var isCustomComponentTag; // We create tags in the namespace of their parent container, except HTML
- // tags get no namespace.
-
- var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
- var domElement;
- var namespaceURI = parentNamespace;
-
- if (namespaceURI === HTML_NAMESPACE) {
- namespaceURI = getIntrinsicNamespace(type);
- }
-
- if (namespaceURI === HTML_NAMESPACE) {
- {
- isCustomComponentTag = isCustomComponent(type, props); // Should this check be gated by parent namespace? Not sure we want to
- // allow <SVG> or <mATH>.
-
- !(isCustomComponentTag || type === type.toLowerCase()) ? warning$1(false, '<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type) : void 0;
- }
-
- if (type === 'script') {
- // Create the script via .innerHTML so its "parser-inserted" flag is
- // set to true and it does not execute
- var div = ownerDocument.createElement('div');
-
- {
- if (enableTrustedTypesIntegration && !didWarnScriptTags) {
- warning$1(false, 'Encountered a script tag while rendering React component. ' + 'Scripts inside React components are never executed when rendering ' + 'on the client. Consider using template tag instead ' + '(https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template).');
- didWarnScriptTags = true;
- }
- }
-
- div.innerHTML = '<script><' + '/script>'; // eslint-disable-line
- // This is guaranteed to yield a script element.
-
- var firstChild = div.firstChild;
- domElement = div.removeChild(firstChild);
- } else if (typeof props.is === 'string') {
- // $FlowIssue `createElement` should be updated for Web Components
- domElement = ownerDocument.createElement(type, {
- is: props.is
- });
- } else {
- // Separate else branch instead of using `props.is || undefined` above because of a Firefox bug.
- // See discussion in https://github.com/facebook/react/pull/6896
- // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240
- domElement = ownerDocument.createElement(type); // Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` and `size`
- // attributes on `select`s needs to be added before `option`s are inserted.
- // This prevents:
- // - a bug where the `select` does not scroll to the correct option because singular
- // `select` elements automatically pick the first item #13222
- // - a bug where the `select` set the first item as selected despite the `size` attribute #14239
- // See https://github.com/facebook/react/issues/13222
- // and https://github.com/facebook/react/issues/14239
-
- if (type === 'select') {
- var node = domElement;
-
- if (props.multiple) {
- node.multiple = true;
- } else if (props.size) {
- // Setting a size greater than 1 causes a select to behave like `multiple=true`, where
- // it is possible that no option is selected.
- //
- // This is only necessary when a select in "single selection mode".
- node.size = props.size;
- }
- }
- }
- } else {
- domElement = ownerDocument.createElementNS(namespaceURI, type);
- }
-
- {
- if (namespaceURI === HTML_NAMESPACE) {
- if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {
- warnedUnknownTags[type] = true;
- warning$1(false, 'The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type);
- }
- }
- }
-
- return domElement;
- }
- function createTextNode(text, rootContainerElement) {
- return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
- }
- function setInitialProperties(domElement, tag, rawProps, rootContainerElement) {
- var isCustomComponentTag = isCustomComponent(tag, rawProps);
-
- {
- validatePropertiesInDevelopment(tag, rawProps);
-
- if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
- warning$1(false, '%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
- didWarnShadyDOM = true;
- }
- } // TODO: Make sure that we check isMounted before firing any of these events.
-
-
- var props;
-
- switch (tag) {
- case 'iframe':
- case 'object':
- case 'embed':
- trapBubbledEvent(TOP_LOAD, domElement);
- props = rawProps;
- break;
-
- case 'video':
- case 'audio':
- // Create listener for each media event
- for (var i = 0; i < mediaEventTypes.length; i++) {
- trapBubbledEvent(mediaEventTypes[i], domElement);
- }
-
- props = rawProps;
- break;
-
- case 'source':
- trapBubbledEvent(TOP_ERROR, domElement);
- props = rawProps;
- break;
-
- case 'img':
- case 'image':
- case 'link':
- trapBubbledEvent(TOP_ERROR, domElement);
- trapBubbledEvent(TOP_LOAD, domElement);
- props = rawProps;
- break;
-
- case 'form':
- trapBubbledEvent(TOP_RESET, domElement);
- trapBubbledEvent(TOP_SUBMIT, domElement);
- props = rawProps;
- break;
-
- case 'details':
- trapBubbledEvent(TOP_TOGGLE, domElement);
- props = rawProps;
- break;
-
- case 'input':
- initWrapperState(domElement, rawProps);
- props = getHostProps(domElement, rawProps);
- trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
- // to onChange. Even if there is no listener.
-
- ensureListeningTo(rootContainerElement, 'onChange');
- break;
-
- case 'option':
- validateProps(domElement, rawProps);
- props = getHostProps$1(domElement, rawProps);
- break;
-
- case 'select':
- initWrapperState$1(domElement, rawProps);
- props = getHostProps$2(domElement, rawProps);
- trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
- // to onChange. Even if there is no listener.
-
- ensureListeningTo(rootContainerElement, 'onChange');
- break;
-
- case 'textarea':
- initWrapperState$2(domElement, rawProps);
- props = getHostProps$3(domElement, rawProps);
- trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
- // to onChange. Even if there is no listener.
-
- ensureListeningTo(rootContainerElement, 'onChange');
- break;
-
- default:
- props = rawProps;
- }
-
- assertValidProps(tag, props);
- setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);
-
- switch (tag) {
- case 'input':
- // TODO: Make sure we check if this is still unmounted or do any clean
- // up necessary since we never stop tracking anymore.
- track(domElement);
- postMountWrapper(domElement, rawProps, false);
- break;
-
- case 'textarea':
- // TODO: Make sure we check if this is still unmounted or do any clean
- // up necessary since we never stop tracking anymore.
- track(domElement);
- postMountWrapper$3(domElement, rawProps);
- break;
-
- case 'option':
- postMountWrapper$1(domElement, rawProps);
- break;
-
- case 'select':
- postMountWrapper$2(domElement, rawProps);
- break;
-
- default:
- if (typeof props.onClick === 'function') {
- // TODO: This cast may not be sound for SVG, MathML or custom elements.
- trapClickOnNonInteractiveElement(domElement);
- }
-
- break;
- }
- } // Calculate the diff between the two objects.
-
- function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
- {
- validatePropertiesInDevelopment(tag, nextRawProps);
- }
-
- var updatePayload = null;
- var lastProps;
- var nextProps;
-
- switch (tag) {
- case 'input':
- lastProps = getHostProps(domElement, lastRawProps);
- nextProps = getHostProps(domElement, nextRawProps);
- updatePayload = [];
- break;
-
- case 'option':
- lastProps = getHostProps$1(domElement, lastRawProps);
- nextProps = getHostProps$1(domElement, nextRawProps);
- updatePayload = [];
- break;
-
- case 'select':
- lastProps = getHostProps$2(domElement, lastRawProps);
- nextProps = getHostProps$2(domElement, nextRawProps);
- updatePayload = [];
- break;
-
- case 'textarea':
- lastProps = getHostProps$3(domElement, lastRawProps);
- nextProps = getHostProps$3(domElement, nextRawProps);
- updatePayload = [];
- break;
-
- default:
- lastProps = lastRawProps;
- nextProps = nextRawProps;
-
- if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {
- // TODO: This cast may not be sound for SVG, MathML or custom elements.
- trapClickOnNonInteractiveElement(domElement);
- }
-
- break;
- }
-
- assertValidProps(tag, nextProps);
- var propKey;
- var styleName;
- var styleUpdates = null;
-
- for (propKey in lastProps) {
- if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
- continue;
- }
-
- if (propKey === STYLE$1) {
- var lastStyle = lastProps[propKey];
-
- for (styleName in lastStyle) {
- if (lastStyle.hasOwnProperty(styleName)) {
- if (!styleUpdates) {
- styleUpdates = {};
- }
-
- styleUpdates[styleName] = '';
- }
- }
- } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) {// Noop. This is handled by the clear text mechanism.
- } else if (enableFlareAPI && propKey === LISTENERS || propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {// Noop
- } else if (propKey === AUTOFOCUS) {// Noop. It doesn't work on updates anyway.
- } else if (registrationNameModules.hasOwnProperty(propKey)) {
- // This is a special case. If any listener updates we need to ensure
- // that the "current" fiber pointer gets updated so we need a commit
- // to update this element.
- if (!updatePayload) {
- updatePayload = [];
- }
- } else {
- // For all other deleted properties we add it to the queue. We use
- // the whitelist in the commit phase instead.
- (updatePayload = updatePayload || []).push(propKey, null);
- }
- }
-
- for (propKey in nextProps) {
- var nextProp = nextProps[propKey];
- var lastProp = lastProps != null ? lastProps[propKey] : undefined;
-
- if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
- continue;
- }
-
- if (propKey === STYLE$1) {
- {
- if (nextProp) {
- // Freeze the next style object so that we can assume it won't be
- // mutated. We have already warned for this in the past.
- Object.freeze(nextProp);
- }
- }
-
- if (lastProp) {
- // Unset styles on `lastProp` but not on `nextProp`.
- for (styleName in lastProp) {
- if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
- if (!styleUpdates) {
- styleUpdates = {};
- }
-
- styleUpdates[styleName] = '';
- }
- } // Update styles that changed since `lastProp`.
-
-
- for (styleName in nextProp) {
- if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
- if (!styleUpdates) {
- styleUpdates = {};
- }
-
- styleUpdates[styleName] = nextProp[styleName];
- }
- }
- } else {
- // Relies on `updateStylesByID` not mutating `styleUpdates`.
- if (!styleUpdates) {
- if (!updatePayload) {
- updatePayload = [];
- }
-
- updatePayload.push(propKey, styleUpdates);
- }
-
- styleUpdates = nextProp;
- }
- } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
- var nextHtml = nextProp ? nextProp[HTML] : undefined;
- var lastHtml = lastProp ? lastProp[HTML] : undefined;
-
- if (nextHtml != null) {
- if (lastHtml !== nextHtml) {
- (updatePayload = updatePayload || []).push(propKey, toStringOrTrustedType(nextHtml));
- }
- } else {// TODO: It might be too late to clear this if we have children
- // inserted already.
- }
- } else if (propKey === CHILDREN) {
- if (lastProp !== nextProp && (typeof nextProp === 'string' || typeof nextProp === 'number')) {
- (updatePayload = updatePayload || []).push(propKey, '' + nextProp);
- }
- } else if (enableFlareAPI && propKey === LISTENERS || propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {// Noop
- } else if (registrationNameModules.hasOwnProperty(propKey)) {
- if (nextProp != null) {
- // We eagerly listen to this even though we haven't committed yet.
- if ( true && typeof nextProp !== 'function') {
- warnForInvalidEventListener(propKey, nextProp);
- }
-
- ensureListeningTo(rootContainerElement, propKey);
- }
-
- if (!updatePayload && lastProp !== nextProp) {
- // This is a special case. If any listener updates we need to ensure
- // that the "current" props pointer gets updated so we need a commit
- // to update this element.
- updatePayload = [];
- }
- } else {
- // For any other property we always add it to the queue and then we
- // filter it out using the whitelist during the commit.
- (updatePayload = updatePayload || []).push(propKey, nextProp);
- }
- }
-
- if (styleUpdates) {
- {
- validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE$1]);
- }
-
- (updatePayload = updatePayload || []).push(STYLE$1, styleUpdates);
- }
-
- return updatePayload;
- } // Apply the diff.
-
- function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
- // Update checked *before* name.
- // In the middle of an update, it is possible to have multiple checked.
- // When a checked radio tries to change name, browser makes another radio's checked false.
- if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {
- updateChecked(domElement, nextRawProps);
- }
-
- var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
- var isCustomComponentTag = isCustomComponent(tag, nextRawProps); // Apply the diff.
-
- updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag); // TODO: Ensure that an update gets scheduled if any of the special props
- // changed.
-
- switch (tag) {
- case 'input':
- // Update the wrapper around inputs *after* updating props. This has to
- // happen after `updateDOMProperties`. Otherwise HTML5 input validations
- // raise warnings and prevent the new value from being assigned.
- updateWrapper(domElement, nextRawProps);
- break;
-
- case 'textarea':
- updateWrapper$1(domElement, nextRawProps);
- break;
-
- case 'select':
- // <select> value update needs to occur after <option> children
- // reconciliation
- postUpdateWrapper(domElement, nextRawProps);
- break;
- }
- }
-
- function getPossibleStandardName(propName) {
- {
- var lowerCasedName = propName.toLowerCase();
-
- if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {
- return null;
- }
-
- return possibleStandardNames[lowerCasedName] || null;
- }
-
- return null;
- }
-
- function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) {
- var isCustomComponentTag;
- var extraAttributeNames;
-
- {
- suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING$1] === true;
- isCustomComponentTag = isCustomComponent(tag, rawProps);
- validatePropertiesInDevelopment(tag, rawProps);
-
- if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
- warning$1(false, '%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
- didWarnShadyDOM = true;
- }
- } // TODO: Make sure that we check isMounted before firing any of these events.
-
-
- switch (tag) {
- case 'iframe':
- case 'object':
- case 'embed':
- trapBubbledEvent(TOP_LOAD, domElement);
- break;
-
- case 'video':
- case 'audio':
- // Create listener for each media event
- for (var i = 0; i < mediaEventTypes.length; i++) {
- trapBubbledEvent(mediaEventTypes[i], domElement);
- }
-
- break;
-
- case 'source':
- trapBubbledEvent(TOP_ERROR, domElement);
- break;
-
- case 'img':
- case 'image':
- case 'link':
- trapBubbledEvent(TOP_ERROR, domElement);
- trapBubbledEvent(TOP_LOAD, domElement);
- break;
-
- case 'form':
- trapBubbledEvent(TOP_RESET, domElement);
- trapBubbledEvent(TOP_SUBMIT, domElement);
- break;
-
- case 'details':
- trapBubbledEvent(TOP_TOGGLE, domElement);
- break;
-
- case 'input':
- initWrapperState(domElement, rawProps);
- trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
- // to onChange. Even if there is no listener.
-
- ensureListeningTo(rootContainerElement, 'onChange');
- break;
-
- case 'option':
- validateProps(domElement, rawProps);
- break;
-
- case 'select':
- initWrapperState$1(domElement, rawProps);
- trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
- // to onChange. Even if there is no listener.
-
- ensureListeningTo(rootContainerElement, 'onChange');
- break;
-
- case 'textarea':
- initWrapperState$2(domElement, rawProps);
- trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
- // to onChange. Even if there is no listener.
-
- ensureListeningTo(rootContainerElement, 'onChange');
- break;
- }
-
- assertValidProps(tag, rawProps);
-
- {
- extraAttributeNames = new Set();
- var attributes = domElement.attributes;
-
- for (var _i = 0; _i < attributes.length; _i++) {
- var name = attributes[_i].name.toLowerCase();
-
- switch (name) {
- // Built-in SSR attribute is whitelisted
- case 'data-reactroot':
- break;
- // Controlled attributes are not validated
- // TODO: Only ignore them on controlled tags.
-
- case 'value':
- break;
-
- case 'checked':
- break;
-
- case 'selected':
- break;
-
- default:
- // Intentionally use the original name.
- // See discussion in https://github.com/facebook/react/pull/10676.
- extraAttributeNames.add(attributes[_i].name);
- }
- }
- }
-
- var updatePayload = null;
-
- for (var propKey in rawProps) {
- if (!rawProps.hasOwnProperty(propKey)) {
- continue;
- }
-
- var nextProp = rawProps[propKey];
-
- if (propKey === CHILDREN) {
- // For text content children we compare against textContent. This
- // might match additional HTML that is hidden when we read it using
- // textContent. E.g. "foo" will match "f<span>oo</span>" but that still
- // satisfies our requirement. Our requirement is not to produce perfect
- // HTML and attributes. Ideally we should preserve structure but it's
- // ok not to if the visible content is still enough to indicate what
- // even listeners these nodes might be wired up to.
- // TODO: Warn if there is more than a single textNode as a child.
- // TODO: Should we use domElement.firstChild.nodeValue to compare?
- if (typeof nextProp === 'string') {
- if (domElement.textContent !== nextProp) {
- if ( true && !suppressHydrationWarning) {
- warnForTextDifference(domElement.textContent, nextProp);
- }
-
- updatePayload = [CHILDREN, nextProp];
- }
- } else if (typeof nextProp === 'number') {
- if (domElement.textContent !== '' + nextProp) {
- if ( true && !suppressHydrationWarning) {
- warnForTextDifference(domElement.textContent, nextProp);
- }
-
- updatePayload = [CHILDREN, '' + nextProp];
- }
- }
- } else if (registrationNameModules.hasOwnProperty(propKey)) {
- if (nextProp != null) {
- if ( true && typeof nextProp !== 'function') {
- warnForInvalidEventListener(propKey, nextProp);
- }
-
- ensureListeningTo(rootContainerElement, propKey);
- }
- } else if ( true && // Convince Flow we've calculated it (it's DEV-only in this method.)
- typeof isCustomComponentTag === 'boolean') {
- // Validate that the properties correspond to their expected values.
- var serverValue = void 0;
- var propertyInfo = getPropertyInfo(propKey);
-
- if (suppressHydrationWarning) {// Don't bother comparing. We're ignoring all these warnings.
- } else if (enableFlareAPI && propKey === LISTENERS || propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1 || // Controlled attributes are not validated
- // TODO: Only ignore them on controlled tags.
- propKey === 'value' || propKey === 'checked' || propKey === 'selected') {// Noop
- } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
- var serverHTML = domElement.innerHTML;
- var nextHtml = nextProp ? nextProp[HTML] : undefined;
- var expectedHTML = normalizeHTML(domElement, nextHtml != null ? nextHtml : '');
-
- if (expectedHTML !== serverHTML) {
- warnForPropDifference(propKey, serverHTML, expectedHTML);
- }
- } else if (propKey === STYLE$1) {
- // $FlowFixMe - Should be inferred as not undefined.
- extraAttributeNames.delete(propKey);
-
- if (canDiffStyleForHydrationWarning) {
- var expectedStyle = createDangerousStringForStyles(nextProp);
- serverValue = domElement.getAttribute('style');
-
- if (expectedStyle !== serverValue) {
- warnForPropDifference(propKey, serverValue, expectedStyle);
- }
- }
- } else if (isCustomComponentTag) {
- // $FlowFixMe - Should be inferred as not undefined.
- extraAttributeNames.delete(propKey.toLowerCase());
- serverValue = getValueForAttribute(domElement, propKey, nextProp);
-
- if (nextProp !== serverValue) {
- warnForPropDifference(propKey, serverValue, nextProp);
- }
- } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {
- var isMismatchDueToBadCasing = false;
-
- if (propertyInfo !== null) {
- // $FlowFixMe - Should be inferred as not undefined.
- extraAttributeNames.delete(propertyInfo.attributeName);
- serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);
- } else {
- var ownNamespace = parentNamespace;
-
- if (ownNamespace === HTML_NAMESPACE) {
- ownNamespace = getIntrinsicNamespace(tag);
- }
-
- if (ownNamespace === HTML_NAMESPACE) {
- // $FlowFixMe - Should be inferred as not undefined.
- extraAttributeNames.delete(propKey.toLowerCase());
- } else {
- var standardName = getPossibleStandardName(propKey);
-
- if (standardName !== null && standardName !== propKey) {
- // If an SVG prop is supplied with bad casing, it will
- // be successfully parsed from HTML, but will produce a mismatch
- // (and would be incorrectly rendered on the client).
- // However, we already warn about bad casing elsewhere.
- // So we'll skip the misleading extra mismatch warning in this case.
- isMismatchDueToBadCasing = true; // $FlowFixMe - Should be inferred as not undefined.
-
- extraAttributeNames.delete(standardName);
- } // $FlowFixMe - Should be inferred as not undefined.
-
-
- extraAttributeNames.delete(propKey);
- }
-
- serverValue = getValueForAttribute(domElement, propKey, nextProp);
- }
-
- if (nextProp !== serverValue && !isMismatchDueToBadCasing) {
- warnForPropDifference(propKey, serverValue, nextProp);
- }
- }
- }
- }
-
- {
- // $FlowFixMe - Should be inferred as not undefined.
- if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {
- // $FlowFixMe - Should be inferred as not undefined.
- warnForExtraAttributes(extraAttributeNames);
- }
- }
-
- switch (tag) {
- case 'input':
- // TODO: Make sure we check if this is still unmounted or do any clean
- // up necessary since we never stop tracking anymore.
- track(domElement);
- postMountWrapper(domElement, rawProps, true);
- break;
-
- case 'textarea':
- // TODO: Make sure we check if this is still unmounted or do any clean
- // up necessary since we never stop tracking anymore.
- track(domElement);
- postMountWrapper$3(domElement, rawProps);
- break;
-
- case 'select':
- case 'option':
- // For input and textarea we current always set the value property at
- // post mount to force it to diverge from attributes. However, for
- // option and select we don't quite do the same thing and select
- // is not resilient to the DOM state changing so we don't do that here.
- // TODO: Consider not doing this for input and textarea.
- break;
-
- default:
- if (typeof rawProps.onClick === 'function') {
- // TODO: This cast may not be sound for SVG, MathML or custom elements.
- trapClickOnNonInteractiveElement(domElement);
- }
-
- break;
- }
-
- return updatePayload;
- }
- function diffHydratedText(textNode, text) {
- var isDifferent = textNode.nodeValue !== text;
- return isDifferent;
- }
- function warnForUnmatchedText(textNode, text) {
- {
- warnForTextDifference(textNode.nodeValue, text);
- }
- }
- function warnForDeletedHydratableElement(parentNode, child) {
- {
- if (didWarnInvalidHydration) {
- return;
- }
-
- didWarnInvalidHydration = true;
- warningWithoutStack$1(false, 'Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
- }
- }
- function warnForDeletedHydratableText(parentNode, child) {
- {
- if (didWarnInvalidHydration) {
- return;
- }
-
- didWarnInvalidHydration = true;
- warningWithoutStack$1(false, 'Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
- }
- }
- function warnForInsertedHydratedElement(parentNode, tag, props) {
- {
- if (didWarnInvalidHydration) {
- return;
- }
-
- didWarnInvalidHydration = true;
- warningWithoutStack$1(false, 'Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase());
- }
- }
- function warnForInsertedHydratedText(parentNode, text) {
- {
- if (text === '') {
- // We expect to insert empty text nodes since they're not represented in
- // the HTML.
- // TODO: Remove this special case if we can just avoid inserting empty
- // text nodes.
- return;
- }
-
- if (didWarnInvalidHydration) {
- return;
- }
-
- didWarnInvalidHydration = true;
- warningWithoutStack$1(false, 'Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
- }
- }
- function restoreControlledState$$1(domElement, tag, props) {
- switch (tag) {
- case 'input':
- restoreControlledState$1(domElement, props);
- return;
-
- case 'textarea':
- restoreControlledState$3(domElement, props);
- return;
-
- case 'select':
- restoreControlledState$2(domElement, props);
- return;
- }
- }
- function listenToEventResponderEventTypes(eventTypes, element) {
- if (enableFlareAPI) {
- // Get the listening Set for this element. We use this to track
- // what events we're listening to.
- var listeningSet = getListeningSetForElement(element); // Go through each target event type of the event responder
-
- for (var i = 0, length = eventTypes.length; i < length; ++i) {
- var eventType = eventTypes[i];
- var isPassive = !endsWith(eventType, '_active');
- var eventKey = isPassive ? eventType + '_passive' : eventType;
- var targetEventType = isPassive ? eventType : eventType.substring(0, eventType.length - 7);
-
- if (!listeningSet.has(eventKey)) {
- trapEventForResponderEventSystem(element, targetEventType, isPassive);
- listeningSet.add(eventKey);
- }
- }
- }
- } // We can remove this once the event API is stable and out of a flag
-
- if (enableFlareAPI) {
- setListenToResponderEventTypes(listenToEventResponderEventTypes);
- }
-
- function getActiveElement(doc) {
- doc = doc || (typeof document !== 'undefined' ? document : undefined);
-
- if (typeof doc === 'undefined') {
- return null;
- }
-
- try {
- return doc.activeElement || doc.body;
- } catch (e) {
- return doc.body;
- }
- }
-
- /**
- * Given any node return the first leaf node without children.
- *
- * @param {DOMElement|DOMTextNode} node
- * @return {DOMElement|DOMTextNode}
- */
-
- function getLeafNode(node) {
- while (node && node.firstChild) {
- node = node.firstChild;
- }
-
- return node;
- }
- /**
- * Get the next sibling within a container. This will walk up the
- * DOM if a node's siblings have been exhausted.
- *
- * @param {DOMElement|DOMTextNode} node
- * @return {?DOMElement|DOMTextNode}
- */
-
-
- function getSiblingNode(node) {
- while (node) {
- if (node.nextSibling) {
- return node.nextSibling;
- }
-
- node = node.parentNode;
- }
- }
- /**
- * Get object describing the nodes which contain characters at offset.
- *
- * @param {DOMElement|DOMTextNode} root
- * @param {number} offset
- * @return {?object}
- */
-
-
- function getNodeForCharacterOffset(root, offset) {
- var node = getLeafNode(root);
- var nodeStart = 0;
- var nodeEnd = 0;
-
- while (node) {
- if (node.nodeType === TEXT_NODE) {
- nodeEnd = nodeStart + node.textContent.length;
-
- if (nodeStart <= offset && nodeEnd >= offset) {
- return {
- node: node,
- offset: offset - nodeStart
- };
- }
-
- nodeStart = nodeEnd;
- }
-
- node = getLeafNode(getSiblingNode(node));
- }
- }
-
- /**
- * @param {DOMElement} outerNode
- * @return {?object}
- */
-
- function getOffsets(outerNode) {
- var ownerDocument = outerNode.ownerDocument;
- var win = ownerDocument && ownerDocument.defaultView || window;
- var selection = win.getSelection && win.getSelection();
-
- if (!selection || selection.rangeCount === 0) {
- return null;
- }
-
- var anchorNode = selection.anchorNode,
- anchorOffset = selection.anchorOffset,
- focusNode = selection.focusNode,
- focusOffset = selection.focusOffset; // In Firefox, anchorNode and focusNode can be "anonymous divs", e.g. the
- // up/down buttons on an <input type="number">. Anonymous divs do not seem to
- // expose properties, triggering a "Permission denied error" if any of its
- // properties are accessed. The only seemingly possible way to avoid erroring
- // is to access a property that typically works for non-anonymous divs and
- // catch any error that may otherwise arise. See
- // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
-
- try {
- /* eslint-disable no-unused-expressions */
- anchorNode.nodeType;
- focusNode.nodeType;
- /* eslint-enable no-unused-expressions */
- } catch (e) {
- return null;
- }
-
- return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
- }
- /**
- * Returns {start, end} where `start` is the character/codepoint index of
- * (anchorNode, anchorOffset) within the textContent of `outerNode`, and
- * `end` is the index of (focusNode, focusOffset).
- *
- * Returns null if you pass in garbage input but we should probably just crash.
- *
- * Exported only for testing.
- */
-
- function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
- var length = 0;
- var start = -1;
- var end = -1;
- var indexWithinAnchor = 0;
- var indexWithinFocus = 0;
- var node = outerNode;
- var parentNode = null;
-
- outer: while (true) {
- var next = null;
-
- while (true) {
- if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
- start = length + anchorOffset;
- }
-
- if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
- end = length + focusOffset;
- }
-
- if (node.nodeType === TEXT_NODE) {
- length += node.nodeValue.length;
- }
-
- if ((next = node.firstChild) === null) {
- break;
- } // Moving from `node` to its first child `next`.
-
-
- parentNode = node;
- node = next;
- }
-
- while (true) {
- if (node === outerNode) {
- // If `outerNode` has children, this is always the second time visiting
- // it. If it has no children, this is still the first loop, and the only
- // valid selection is anchorNode and focusNode both equal to this node
- // and both offsets 0, in which case we will have handled above.
- break outer;
- }
-
- if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
- start = length;
- }
-
- if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
- end = length;
- }
-
- if ((next = node.nextSibling) !== null) {
- break;
- }
-
- node = parentNode;
- parentNode = node.parentNode;
- } // Moving from `node` to its next sibling `next`.
-
-
- node = next;
- }
-
- if (start === -1 || end === -1) {
- // This should never happen. (Would happen if the anchor/focus nodes aren't
- // actually inside the passed-in node.)
- return null;
- }
-
- return {
- start: start,
- end: end
- };
- }
- /**
- * In modern non-IE browsers, we can support both forward and backward
- * selections.
- *
- * Note: IE10+ supports the Selection object, but it does not support
- * the `extend` method, which means that even in modern IE, it's not possible
- * to programmatically create a backward selection. Thus, for all IE
- * versions, we use the old IE API to create our selections.
- *
- * @param {DOMElement|DOMTextNode} node
- * @param {object} offsets
- */
-
- function setOffsets(node, offsets) {
- var doc = node.ownerDocument || document;
- var win = doc && doc.defaultView || window; // Edge fails with "Object expected" in some scenarios.
- // (For instance: TinyMCE editor used in a list component that supports pasting to add more,
- // fails when pasting 100+ items)
-
- if (!win.getSelection) {
- return;
- }
-
- var selection = win.getSelection();
- var length = node.textContent.length;
- var start = Math.min(offsets.start, length);
- var end = offsets.end === undefined ? start : Math.min(offsets.end, length); // IE 11 uses modern selection, but doesn't support the extend method.
- // Flip backward selections, so we can set with a single range.
-
- if (!selection.extend && start > end) {
- var temp = end;
- end = start;
- start = temp;
- }
-
- var startMarker = getNodeForCharacterOffset(node, start);
- var endMarker = getNodeForCharacterOffset(node, end);
-
- if (startMarker && endMarker) {
- if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
- return;
- }
-
- var range = doc.createRange();
- range.setStart(startMarker.node, startMarker.offset);
- selection.removeAllRanges();
-
- if (start > end) {
- selection.addRange(range);
- selection.extend(endMarker.node, endMarker.offset);
- } else {
- range.setEnd(endMarker.node, endMarker.offset);
- selection.addRange(range);
- }
- }
- }
-
- function isTextNode(node) {
- return node && node.nodeType === TEXT_NODE;
- }
-
- function containsNode(outerNode, innerNode) {
- if (!outerNode || !innerNode) {
- return false;
- } else if (outerNode === innerNode) {
- return true;
- } else if (isTextNode(outerNode)) {
- return false;
- } else if (isTextNode(innerNode)) {
- return containsNode(outerNode, innerNode.parentNode);
- } else if ('contains' in outerNode) {
- return outerNode.contains(innerNode);
- } else if (outerNode.compareDocumentPosition) {
- return !!(outerNode.compareDocumentPosition(innerNode) & 16);
- } else {
- return false;
- }
- }
-
- function isInDocument(node) {
- return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
- }
-
- function isSameOriginFrame(iframe) {
- try {
- // Accessing the contentDocument of a HTMLIframeElement can cause the browser
- // to throw, e.g. if it has a cross-origin src attribute.
- // Safari will show an error in the console when the access results in "Blocked a frame with origin". e.g:
- // iframe.contentDocument.defaultView;
- // A safety way is to access one of the cross origin properties: Window or Location
- // Which might result in "SecurityError" DOM Exception and it is compatible to Safari.
- // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl
- return typeof iframe.contentWindow.location.href === 'string';
- } catch (err) {
- return false;
- }
- }
-
- function getActiveElementDeep() {
- var win = window;
- var element = getActiveElement();
-
- while (element instanceof win.HTMLIFrameElement) {
- if (isSameOriginFrame(element)) {
- win = element.contentWindow;
- } else {
- return element;
- }
-
- element = getActiveElement(win.document);
- }
-
- return element;
- }
- /**
- * @ReactInputSelection: React input selection module. Based on Selection.js,
- * but modified to be suitable for react and has a couple of bug fixes (doesn't
- * assume buttons have range selections allowed).
- * Input selection module for React.
- */
-
- /**
- * @hasSelectionCapabilities: we get the element types that support selection
- * from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart`
- * and `selectionEnd` rows.
- */
-
-
- function hasSelectionCapabilities(elem) {
- var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
- return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true');
- }
- function getSelectionInformation() {
- var focusedElem = getActiveElementDeep();
- return {
- focusedElem: focusedElem,
- selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null
- };
- }
- /**
- * @restoreSelection: If any selection information was potentially lost,
- * restore it. This is useful when performing operations that could remove dom
- * nodes and place them back in, resulting in focus being lost.
- */
-
- function restoreSelection(priorSelectionInformation) {
- var curFocusedElem = getActiveElementDeep();
- var priorFocusedElem = priorSelectionInformation.focusedElem;
- var priorSelectionRange = priorSelectionInformation.selectionRange;
-
- if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
- if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
- setSelection(priorFocusedElem, priorSelectionRange);
- } // Focusing a node can change the scroll position, which is undesirable
-
-
- var ancestors = [];
- var ancestor = priorFocusedElem;
-
- while (ancestor = ancestor.parentNode) {
- if (ancestor.nodeType === ELEMENT_NODE) {
- ancestors.push({
- element: ancestor,
- left: ancestor.scrollLeft,
- top: ancestor.scrollTop
- });
- }
- }
-
- if (typeof priorFocusedElem.focus === 'function') {
- priorFocusedElem.focus();
- }
-
- for (var i = 0; i < ancestors.length; i++) {
- var info = ancestors[i];
- info.element.scrollLeft = info.left;
- info.element.scrollTop = info.top;
- }
- }
- }
- /**
- * @getSelection: Gets the selection bounds of a focused textarea, input or
- * contentEditable node.
- * -@input: Look up selection bounds of this input
- * -@return {start: selectionStart, end: selectionEnd}
- */
-
- function getSelection(input) {
- var selection;
-
- if ('selectionStart' in input) {
- // Modern browser with input or textarea.
- selection = {
- start: input.selectionStart,
- end: input.selectionEnd
- };
- } else {
- // Content editable or old IE textarea.
- selection = getOffsets(input);
- }
-
- return selection || {
- start: 0,
- end: 0
- };
- }
- /**
- * @setSelection: Sets the selection bounds of a textarea or input and focuses
- * the input.
- * -@input Set selection bounds of this input or textarea
- * -@offsets Object of same form that is returned from get*
- */
-
- function setSelection(input, offsets) {
- var start = offsets.start,
- end = offsets.end;
-
- if (end === undefined) {
- end = start;
- }
-
- if ('selectionStart' in input) {
- input.selectionStart = start;
- input.selectionEnd = Math.min(end, input.value.length);
- } else {
- setOffsets(input, offsets);
- }
- }
-
- var validateDOMNesting = function () {};
-
- var updatedAncestorInfo = function () {};
-
- {
- // This validation code was written based on the HTML5 parsing spec:
- // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
- //
- // Note: this does not catch all invalid nesting, nor does it try to (as it's
- // not clear what practical benefit doing so provides); instead, we warn only
- // for cases where the parser will give a parse tree differing from what React
- // intended. For example, <b><div></div></b> is invalid but we don't warn
- // because it still parses correctly; we do warn for other cases like nested
- // <p> tags where the beginning of the second element implicitly closes the
- // first, causing a confusing mess.
- // https://html.spec.whatwg.org/multipage/syntax.html#special
- var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
-
- var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
- // TODO: Distinguish by namespace here -- for <title>, including it here
- // errs on the side of fewer warnings
- 'foreignObject', 'desc', 'title']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
-
- var buttonScopeTags = inScopeTags.concat(['button']); // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
-
- var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
- var emptyAncestorInfo = {
- current: null,
- formTag: null,
- aTagInScope: null,
- buttonTagInScope: null,
- nobrTagInScope: null,
- pTagInButtonScope: null,
- listItemTagAutoclosing: null,
- dlItemTagAutoclosing: null
- };
-
- updatedAncestorInfo = function (oldInfo, tag) {
- var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
-
- var info = {
- tag: tag
- };
-
- if (inScopeTags.indexOf(tag) !== -1) {
- ancestorInfo.aTagInScope = null;
- ancestorInfo.buttonTagInScope = null;
- ancestorInfo.nobrTagInScope = null;
- }
-
- if (buttonScopeTags.indexOf(tag) !== -1) {
- ancestorInfo.pTagInButtonScope = null;
- } // See rules for 'li', 'dd', 'dt' start tags in
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
-
-
- if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
- ancestorInfo.listItemTagAutoclosing = null;
- ancestorInfo.dlItemTagAutoclosing = null;
- }
-
- ancestorInfo.current = info;
-
- if (tag === 'form') {
- ancestorInfo.formTag = info;
- }
-
- if (tag === 'a') {
- ancestorInfo.aTagInScope = info;
- }
-
- if (tag === 'button') {
- ancestorInfo.buttonTagInScope = info;
- }
-
- if (tag === 'nobr') {
- ancestorInfo.nobrTagInScope = info;
- }
-
- if (tag === 'p') {
- ancestorInfo.pTagInButtonScope = info;
- }
-
- if (tag === 'li') {
- ancestorInfo.listItemTagAutoclosing = info;
- }
-
- if (tag === 'dd' || tag === 'dt') {
- ancestorInfo.dlItemTagAutoclosing = info;
- }
-
- return ancestorInfo;
- };
- /**
- * Returns whether
- */
-
-
- var isTagValidWithParent = function (tag, parentTag) {
- // First, let's check if we're in an unusual parsing mode...
- switch (parentTag) {
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
- case 'select':
- return tag === 'option' || tag === 'optgroup' || tag === '#text';
-
- case 'optgroup':
- return tag === 'option' || tag === '#text';
- // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
- // but
-
- case 'option':
- return tag === '#text';
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
- // No special behavior since these rules fall back to "in body" mode for
- // all except special table nodes which cause bad parsing behavior anyway.
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
-
- case 'tr':
- return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
-
- case 'tbody':
- case 'thead':
- case 'tfoot':
- return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
-
- case 'colgroup':
- return tag === 'col' || tag === 'template';
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
-
- case 'table':
- return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
-
- case 'head':
- return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
- // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
-
- case 'html':
- return tag === 'head' || tag === 'body' || tag === 'frameset';
-
- case 'frameset':
- return tag === 'frame';
-
- case '#document':
- return tag === 'html';
- } // Probably in the "in body" parsing mode, so we outlaw only tag combos
- // where the parsing rules cause implicit opens or closes to be added.
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
-
-
- switch (tag) {
- case 'h1':
- case 'h2':
- case 'h3':
- case 'h4':
- case 'h5':
- case 'h6':
- return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
-
- case 'rp':
- case 'rt':
- return impliedEndTags.indexOf(parentTag) === -1;
-
- case 'body':
- case 'caption':
- case 'col':
- case 'colgroup':
- case 'frameset':
- case 'frame':
- case 'head':
- case 'html':
- case 'tbody':
- case 'td':
- case 'tfoot':
- case 'th':
- case 'thead':
- case 'tr':
- // These tags are only valid with a few parents that have special child
- // parsing rules -- if we're down here, then none of those matched and
- // so we allow it only if we don't know what the parent is, as all other
- // cases are invalid.
- return parentTag == null;
- }
-
- return true;
- };
- /**
- * Returns whether
- */
-
-
- var findInvalidAncestorForTag = function (tag, ancestorInfo) {
- switch (tag) {
- case 'address':
- case 'article':
- case 'aside':
- case 'blockquote':
- case 'center':
- case 'details':
- case 'dialog':
- case 'dir':
- case 'div':
- case 'dl':
- case 'fieldset':
- case 'figcaption':
- case 'figure':
- case 'footer':
- case 'header':
- case 'hgroup':
- case 'main':
- case 'menu':
- case 'nav':
- case 'ol':
- case 'p':
- case 'section':
- case 'summary':
- case 'ul':
- case 'pre':
- case 'listing':
- case 'table':
- case 'hr':
- case 'xmp':
- case 'h1':
- case 'h2':
- case 'h3':
- case 'h4':
- case 'h5':
- case 'h6':
- return ancestorInfo.pTagInButtonScope;
-
- case 'form':
- return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
-
- case 'li':
- return ancestorInfo.listItemTagAutoclosing;
-
- case 'dd':
- case 'dt':
- return ancestorInfo.dlItemTagAutoclosing;
-
- case 'button':
- return ancestorInfo.buttonTagInScope;
-
- case 'a':
- // Spec says something about storing a list of markers, but it sounds
- // equivalent to this check.
- return ancestorInfo.aTagInScope;
-
- case 'nobr':
- return ancestorInfo.nobrTagInScope;
- }
-
- return null;
- };
-
- var didWarn$1 = {};
-
- validateDOMNesting = function (childTag, childText, ancestorInfo) {
- ancestorInfo = ancestorInfo || emptyAncestorInfo;
- var parentInfo = ancestorInfo.current;
- var parentTag = parentInfo && parentInfo.tag;
-
- if (childText != null) {
- !(childTag == null) ? warningWithoutStack$1(false, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0;
- childTag = '#text';
- }
-
- var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
- var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
- var invalidParentOrAncestor = invalidParent || invalidAncestor;
-
- if (!invalidParentOrAncestor) {
- return;
- }
-
- var ancestorTag = invalidParentOrAncestor.tag;
- var addendum = getCurrentFiberStackInDev();
- var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + addendum;
-
- if (didWarn$1[warnKey]) {
- return;
- }
-
- didWarn$1[warnKey] = true;
- var tagDisplayName = childTag;
- var whitespaceInfo = '';
-
- if (childTag === '#text') {
- if (/\S/.test(childText)) {
- tagDisplayName = 'Text nodes';
- } else {
- tagDisplayName = 'Whitespace text nodes';
- whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.';
- }
- } else {
- tagDisplayName = '<' + childTag + '>';
- }
-
- if (invalidParent) {
- var info = '';
-
- if (ancestorTag === 'table' && childTag === 'tr') {
- info += ' Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by ' + 'the browser.';
- }
-
- warningWithoutStack$1(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info, addendum);
- } else {
- warningWithoutStack$1(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.%s', tagDisplayName, ancestorTag, addendum);
- }
- };
- }
-
- // can re-export everything from this module.
-
- function shim() {
- {
- {
- throw Error("The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
- } // Persistence (when unsupported)
-
-
- var supportsPersistence = false;
- var cloneInstance = shim;
- var cloneFundamentalInstance = shim;
- var createContainerChildSet = shim;
- var appendChildToContainerChildSet = shim;
- var finalizeContainerChildren = shim;
- var replaceContainerChildren = shim;
- var cloneHiddenInstance = shim;
- var cloneHiddenTextInstance = shim;
-
- var SUPPRESS_HYDRATION_WARNING;
-
- {
- SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';
- }
-
- var SUSPENSE_START_DATA = '$';
- var SUSPENSE_END_DATA = '/$';
- var SUSPENSE_PENDING_START_DATA = '$?';
- var SUSPENSE_FALLBACK_START_DATA = '$!';
- var STYLE = 'style';
- var eventsEnabled = null;
- var selectionInformation = null;
-
- function shouldAutoFocusHostComponent(type, props) {
- switch (type) {
- case 'button':
- case 'input':
- case 'select':
- case 'textarea':
- return !!props.autoFocus;
- }
-
- return false;
- }
-
- function getRootHostContext(rootContainerInstance) {
- var type;
- var namespace;
- var nodeType = rootContainerInstance.nodeType;
-
- switch (nodeType) {
- case DOCUMENT_NODE:
- case DOCUMENT_FRAGMENT_NODE:
- {
- type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';
- var root = rootContainerInstance.documentElement;
- namespace = root ? root.namespaceURI : getChildNamespace(null, '');
- break;
- }
-
- default:
- {
- var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
- var ownNamespace = container.namespaceURI || null;
- type = container.tagName;
- namespace = getChildNamespace(ownNamespace, type);
- break;
- }
- }
-
- {
- var validatedTag = type.toLowerCase();
- var ancestorInfo = updatedAncestorInfo(null, validatedTag);
- return {
- namespace: namespace,
- ancestorInfo: ancestorInfo
- };
- }
-
- return namespace;
- }
- function getChildHostContext(parentHostContext, type, rootContainerInstance) {
- {
- var parentHostContextDev = parentHostContext;
- var namespace = getChildNamespace(parentHostContextDev.namespace, type);
- var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);
- return {
- namespace: namespace,
- ancestorInfo: ancestorInfo
- };
- }
-
- var parentNamespace = parentHostContext;
- return getChildNamespace(parentNamespace, type);
- }
- function getPublicInstance(instance) {
- return instance;
- }
- function prepareForCommit(containerInfo) {
- eventsEnabled = isEnabled();
- selectionInformation = getSelectionInformation();
- setEnabled(false);
- }
- function resetAfterCommit(containerInfo) {
- restoreSelection(selectionInformation);
- selectionInformation = null;
- setEnabled(eventsEnabled);
- eventsEnabled = null;
- }
- function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
- var parentNamespace;
-
- {
- // TODO: take namespace into account when validating.
- var hostContextDev = hostContext;
- validateDOMNesting(type, null, hostContextDev.ancestorInfo);
-
- if (typeof props.children === 'string' || typeof props.children === 'number') {
- var string = '' + props.children;
- var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
- validateDOMNesting(null, string, ownAncestorInfo);
- }
-
- parentNamespace = hostContextDev.namespace;
- }
-
- var domElement = createElement(type, props, rootContainerInstance, parentNamespace);
- precacheFiberNode(internalInstanceHandle, domElement);
- updateFiberProps(domElement, props);
- return domElement;
- }
- function appendInitialChild(parentInstance, child) {
- parentInstance.appendChild(child);
- }
- function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {
- setInitialProperties(domElement, type, props, rootContainerInstance);
- return shouldAutoFocusHostComponent(type, props);
- }
- function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
- {
- var hostContextDev = hostContext;
-
- if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {
- var string = '' + newProps.children;
- var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
- validateDOMNesting(null, string, ownAncestorInfo);
- }
- }
-
- return diffProperties(domElement, type, oldProps, newProps, rootContainerInstance);
- }
- function shouldSetTextContent(type, props) {
- return type === 'textarea' || type === 'option' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
- }
- function shouldDeprioritizeSubtree(type, props) {
- return !!props.hidden;
- }
- function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
- {
- var hostContextDev = hostContext;
- validateDOMNesting(null, text, hostContextDev.ancestorInfo);
- }
-
- var textNode = createTextNode(text, rootContainerInstance);
- precacheFiberNode(internalInstanceHandle, textNode);
- return textNode;
- }
- var isPrimaryRenderer = true;
- var warnsIfNotActing = true; // This initialization code may run even on server environments
- // if a component just imports ReactDOM (e.g. for findDOMNode).
- // Some environments might not have setTimeout or clearTimeout.
-
- var scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined;
- var cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;
- var noTimeout = -1; // -------------------
- // Mutation
- // -------------------
-
- var supportsMutation = true;
- function commitMount(domElement, type, newProps, internalInstanceHandle) {
- // Despite the naming that might imply otherwise, this method only
- // fires if there is an `Update` effect scheduled during mounting.
- // This happens if `finalizeInitialChildren` returns `true` (which it
- // does to implement the `autoFocus` attribute on the client). But
- // there are also other cases when this might happen (such as patching
- // up text content during hydration mismatch). So we'll check this again.
- if (shouldAutoFocusHostComponent(type, newProps)) {
- domElement.focus();
- }
- }
- function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
- // Update the props handle so that we know which props are the ones with
- // with current event handlers.
- updateFiberProps(domElement, newProps); // Apply the diff to the DOM node.
-
- updateProperties(domElement, updatePayload, type, oldProps, newProps);
- }
- function resetTextContent(domElement) {
- setTextContent(domElement, '');
- }
- function commitTextUpdate(textInstance, oldText, newText) {
- textInstance.nodeValue = newText;
- }
- function appendChild(parentInstance, child) {
- parentInstance.appendChild(child);
- }
- function appendChildToContainer(container, child) {
- var parentNode;
-
- if (container.nodeType === COMMENT_NODE) {
- parentNode = container.parentNode;
- parentNode.insertBefore(child, container);
- } else {
- parentNode = container;
- parentNode.appendChild(child);
- } // This container might be used for a portal.
- // If something inside a portal is clicked, that click should bubble
- // through the React tree. However, on Mobile Safari the click would
- // never bubble through the *DOM* tree unless an ancestor with onclick
- // event exists. So we wouldn't see it and dispatch it.
- // This is why we ensure that non React root containers have inline onclick
- // defined.
- // https://github.com/facebook/react/issues/11918
-
-
- var reactRootContainer = container._reactRootContainer;
-
- if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) {
- // TODO: This cast may not be sound for SVG, MathML or custom elements.
- trapClickOnNonInteractiveElement(parentNode);
- }
- }
- function insertBefore(parentInstance, child, beforeChild) {
- parentInstance.insertBefore(child, beforeChild);
- }
- function insertInContainerBefore(container, child, beforeChild) {
- if (container.nodeType === COMMENT_NODE) {
- container.parentNode.insertBefore(child, beforeChild);
- } else {
- container.insertBefore(child, beforeChild);
- }
- } // This is a specific event for the React Flare
- // event system, so event responders can act
- // accordingly to a DOM node being unmounted that
- // previously had active document focus.
-
- function dispatchDetachedVisibleNodeEvent(child) {
- if (enableFlareAPI && selectionInformation && child === selectionInformation.focusedElem) {
- var targetFiber = getClosestInstanceFromNode(child); // Simlulate a blur event to the React Flare responder system.
-
- dispatchEventForResponderEventSystem('detachedvisiblenode', targetFiber, {
- target: child,
- timeStamp: Date.now()
- }, child, RESPONDER_EVENT_SYSTEM | IS_PASSIVE);
- }
- }
-
- function removeChild(parentInstance, child) {
- dispatchDetachedVisibleNodeEvent(child);
- parentInstance.removeChild(child);
- }
- function removeChildFromContainer(container, child) {
- if (container.nodeType === COMMENT_NODE) {
- container.parentNode.removeChild(child);
- } else {
- dispatchDetachedVisibleNodeEvent(child);
- container.removeChild(child);
- }
- }
- function clearSuspenseBoundary(parentInstance, suspenseInstance) {
- var node = suspenseInstance; // Delete all nodes within this suspense boundary.
- // There might be nested nodes so we need to keep track of how
- // deep we are and only break out when we're back on top.
-
- var depth = 0;
-
- do {
- var nextNode = node.nextSibling;
- parentInstance.removeChild(node);
-
- if (nextNode && nextNode.nodeType === COMMENT_NODE) {
- var data = nextNode.data;
-
- if (data === SUSPENSE_END_DATA) {
- if (depth === 0) {
- parentInstance.removeChild(nextNode); // Retry if any event replaying was blocked on this.
-
- retryIfBlockedOn(suspenseInstance);
- return;
- } else {
- depth--;
- }
- } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_PENDING_START_DATA || data === SUSPENSE_FALLBACK_START_DATA) {
- depth++;
- }
- }
-
- node = nextNode;
- } while (node); // TODO: Warn, we didn't find the end comment boundary.
- // Retry if any event replaying was blocked on this.
-
-
- retryIfBlockedOn(suspenseInstance);
- }
- function clearSuspenseBoundaryFromContainer(container, suspenseInstance) {
- if (container.nodeType === COMMENT_NODE) {
- clearSuspenseBoundary(container.parentNode, suspenseInstance);
- } else if (container.nodeType === ELEMENT_NODE) {
- clearSuspenseBoundary(container, suspenseInstance);
- } else {} // Document nodes should never contain suspense boundaries.
- // Retry if any event replaying was blocked on this.
-
-
- retryIfBlockedOn(container);
- }
- function hideInstance(instance) {
- // TODO: Does this work for all element types? What about MathML? Should we
- // pass host context to this method?
- instance = instance;
- var style = instance.style;
-
- if (typeof style.setProperty === 'function') {
- style.setProperty('display', 'none', 'important');
- } else {
- style.display = 'none';
- }
- }
- function hideTextInstance(textInstance) {
- textInstance.nodeValue = '';
- }
- function unhideInstance(instance, props) {
- instance = instance;
- var styleProp = props[STYLE];
- var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null;
- instance.style.display = dangerousStyleValue('display', display);
- }
- function unhideTextInstance(textInstance, text) {
- textInstance.nodeValue = text;
- } // -------------------
- // Hydration
- // -------------------
-
- var supportsHydration = true;
- function canHydrateInstance(instance, type, props) {
- if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
- return null;
- } // This has now been refined to an element node.
-
-
- return instance;
- }
- function canHydrateTextInstance(instance, text) {
- if (text === '' || instance.nodeType !== TEXT_NODE) {
- // Empty strings are not parsed by HTML so there won't be a correct match here.
- return null;
- } // This has now been refined to a text node.
-
-
- return instance;
- }
- function canHydrateSuspenseInstance(instance) {
- if (instance.nodeType !== COMMENT_NODE) {
- // Empty strings are not parsed by HTML so there won't be a correct match here.
- return null;
- } // This has now been refined to a suspense node.
-
-
- return instance;
- }
- function isSuspenseInstancePending(instance) {
- return instance.data === SUSPENSE_PENDING_START_DATA;
- }
- function isSuspenseInstanceFallback(instance) {
- return instance.data === SUSPENSE_FALLBACK_START_DATA;
- }
- function registerSuspenseInstanceRetry(instance, callback) {
- instance._reactRetry = callback;
- }
-
- function getNextHydratable(node) {
- // Skip non-hydratable nodes.
- for (; node != null; node = node.nextSibling) {
- var nodeType = node.nodeType;
-
- if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {
- break;
- }
-
- if (enableSuspenseServerRenderer) {
- if (nodeType === COMMENT_NODE) {
- var nodeData = node.data;
-
- if (nodeData === SUSPENSE_START_DATA || nodeData === SUSPENSE_FALLBACK_START_DATA || nodeData === SUSPENSE_PENDING_START_DATA) {
- break;
- }
- }
- }
- }
-
- return node;
- }
-
- function getNextHydratableSibling(instance) {
- return getNextHydratable(instance.nextSibling);
- }
- function getFirstHydratableChild(parentInstance) {
- return getNextHydratable(parentInstance.firstChild);
- }
- function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
- precacheFiberNode(internalInstanceHandle, instance); // TODO: Possibly defer this until the commit phase where all the events
- // get attached.
-
- updateFiberProps(instance, props);
- var parentNamespace;
-
- {
- var hostContextDev = hostContext;
- parentNamespace = hostContextDev.namespace;
- }
-
- return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance);
- }
- function hydrateTextInstance(textInstance, text, internalInstanceHandle) {
- precacheFiberNode(internalInstanceHandle, textInstance);
- return diffHydratedText(textInstance, text);
- }
- function hydrateSuspenseInstance(suspenseInstance, internalInstanceHandle) {
- precacheFiberNode(internalInstanceHandle, suspenseInstance);
- }
- function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {
- var node = suspenseInstance.nextSibling; // Skip past all nodes within this suspense boundary.
- // There might be nested nodes so we need to keep track of how
- // deep we are and only break out when we're back on top.
-
- var depth = 0;
-
- while (node) {
- if (node.nodeType === COMMENT_NODE) {
- var data = node.data;
-
- if (data === SUSPENSE_END_DATA) {
- if (depth === 0) {
- return getNextHydratableSibling(node);
- } else {
- depth--;
- }
- } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
- depth++;
- }
- }
-
- node = node.nextSibling;
- } // TODO: Warn, we didn't find the end comment boundary.
-
-
- return null;
- } // Returns the SuspenseInstance if this node is a direct child of a
- // SuspenseInstance. I.e. if its previous sibling is a Comment with
- // SUSPENSE_x_START_DATA. Otherwise, null.
-
- function getParentSuspenseInstance(targetInstance) {
- var node = targetInstance.previousSibling; // Skip past all nodes within this suspense boundary.
- // There might be nested nodes so we need to keep track of how
- // deep we are and only break out when we're back on top.
-
- var depth = 0;
-
- while (node) {
- if (node.nodeType === COMMENT_NODE) {
- var data = node.data;
-
- if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
- if (depth === 0) {
- return node;
- } else {
- depth--;
- }
- } else if (data === SUSPENSE_END_DATA) {
- depth++;
- }
- }
-
- node = node.previousSibling;
- }
-
- return null;
- }
- function commitHydratedContainer(container) {
- // Retry if any event replaying was blocked on this.
- retryIfBlockedOn(container);
- }
- function commitHydratedSuspenseInstance(suspenseInstance) {
- // Retry if any event replaying was blocked on this.
- retryIfBlockedOn(suspenseInstance);
- }
- function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {
- {
- warnForUnmatchedText(textInstance, text);
- }
- }
- function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {
- if ( true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
- warnForUnmatchedText(textInstance, text);
- }
- }
- function didNotHydrateContainerInstance(parentContainer, instance) {
- {
- if (instance.nodeType === ELEMENT_NODE) {
- warnForDeletedHydratableElement(parentContainer, instance);
- } else if (instance.nodeType === COMMENT_NODE) {// TODO: warnForDeletedHydratableSuspenseBoundary
- } else {
- warnForDeletedHydratableText(parentContainer, instance);
- }
- }
- }
- function didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {
- if ( true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
- if (instance.nodeType === ELEMENT_NODE) {
- warnForDeletedHydratableElement(parentInstance, instance);
- } else if (instance.nodeType === COMMENT_NODE) {// TODO: warnForDeletedHydratableSuspenseBoundary
- } else {
- warnForDeletedHydratableText(parentInstance, instance);
- }
- }
- }
- function didNotFindHydratableContainerInstance(parentContainer, type, props) {
- {
- warnForInsertedHydratedElement(parentContainer, type, props);
- }
- }
- function didNotFindHydratableContainerTextInstance(parentContainer, text) {
- {
- warnForInsertedHydratedText(parentContainer, text);
- }
- }
-
- function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {
- if ( true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
- warnForInsertedHydratedElement(parentInstance, type, props);
- }
- }
- function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {
- if ( true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
- warnForInsertedHydratedText(parentInstance, text);
- }
- }
- function didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) {
- if ( true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {// TODO: warnForInsertedHydratedSuspense(parentInstance);
- }
- }
- function mountResponderInstance(responder, responderInstance, responderProps, responderState, instance) {
- // Listen to events
- var doc = instance.ownerDocument;
- var _ref = responder,
- rootEventTypes = _ref.rootEventTypes,
- targetEventTypes = _ref.targetEventTypes;
-
- if (targetEventTypes !== null) {
- listenToEventResponderEventTypes(targetEventTypes, doc);
- }
-
- if (rootEventTypes !== null) {
- addRootEventTypesForResponderInstance(responderInstance, rootEventTypes);
- listenToEventResponderEventTypes(rootEventTypes, doc);
- }
-
- mountEventResponder(responder, responderInstance, responderProps, responderState);
- return responderInstance;
- }
- function unmountResponderInstance(responderInstance) {
- if (enableFlareAPI) {
- // TODO stop listening to targetEventTypes
- unmountEventResponder(responderInstance);
- }
- }
- function getFundamentalComponentInstance(fundamentalInstance) {
- if (enableFundamentalAPI) {
- var currentFiber = fundamentalInstance.currentFiber,
- impl = fundamentalInstance.impl,
- props = fundamentalInstance.props,
- state = fundamentalInstance.state;
- var instance = impl.getInstance(null, props, state);
- precacheFiberNode(currentFiber, instance);
- return instance;
- } // Because of the flag above, this gets around the Flow error;
-
-
- return null;
- }
- function mountFundamentalComponent(fundamentalInstance) {
- if (enableFundamentalAPI) {
- var impl = fundamentalInstance.impl,
- instance = fundamentalInstance.instance,
- props = fundamentalInstance.props,
- state = fundamentalInstance.state;
- var onMount = impl.onMount;
-
- if (onMount !== undefined) {
- onMount(null, instance, props, state);
- }
- }
- }
- function shouldUpdateFundamentalComponent(fundamentalInstance) {
- if (enableFundamentalAPI) {
- var impl = fundamentalInstance.impl,
- prevProps = fundamentalInstance.prevProps,
- props = fundamentalInstance.props,
- state = fundamentalInstance.state;
- var shouldUpdate = impl.shouldUpdate;
-
- if (shouldUpdate !== undefined) {
- return shouldUpdate(null, prevProps, props, state);
- }
- }
-
- return true;
- }
- function updateFundamentalComponent(fundamentalInstance) {
- if (enableFundamentalAPI) {
- var impl = fundamentalInstance.impl,
- instance = fundamentalInstance.instance,
- prevProps = fundamentalInstance.prevProps,
- props = fundamentalInstance.props,
- state = fundamentalInstance.state;
- var onUpdate = impl.onUpdate;
-
- if (onUpdate !== undefined) {
- onUpdate(null, instance, prevProps, props, state);
- }
- }
- }
- function unmountFundamentalComponent(fundamentalInstance) {
- if (enableFundamentalAPI) {
- var impl = fundamentalInstance.impl,
- instance = fundamentalInstance.instance,
- props = fundamentalInstance.props,
- state = fundamentalInstance.state;
- var onUnmount = impl.onUnmount;
-
- if (onUnmount !== undefined) {
- onUnmount(null, instance, props, state);
- }
- }
- }
- function getInstanceFromNode$2(node) {
- return getClosestInstanceFromNode(node) || null;
- }
-
- var randomKey = Math.random().toString(36).slice(2);
- var internalInstanceKey = '__reactInternalInstance$' + randomKey;
- var internalEventHandlersKey = '__reactEventHandlers$' + randomKey;
- var internalContainerInstanceKey = '__reactContainere$' + randomKey;
- function precacheFiberNode(hostInst, node) {
- node[internalInstanceKey] = hostInst;
- }
- function markContainerAsRoot(hostRoot, node) {
- node[internalContainerInstanceKey] = hostRoot;
- }
- function unmarkContainerAsRoot(node) {
- node[internalContainerInstanceKey] = null;
- }
- function isContainerMarkedAsRoot(node) {
- return !!node[internalContainerInstanceKey];
- } // Given a DOM node, return the closest HostComponent or HostText fiber ancestor.
- // If the target node is part of a hydrated or not yet rendered subtree, then
- // this may also return a SuspenseComponent or HostRoot to indicate that.
- // Conceptually the HostRoot fiber is a child of the Container node. So if you
- // pass the Container node as the targetNode, you will not actually get the
- // HostRoot back. To get to the HostRoot, you need to pass a child of it.
- // The same thing applies to Suspense boundaries.
-
- function getClosestInstanceFromNode(targetNode) {
- var targetInst = targetNode[internalInstanceKey];
-
- if (targetInst) {
- // Don't return HostRoot or SuspenseComponent here.
- return targetInst;
- } // If the direct event target isn't a React owned DOM node, we need to look
- // to see if one of its parents is a React owned DOM node.
-
-
- var parentNode = targetNode.parentNode;
-
- while (parentNode) {
- // We'll check if this is a container root that could include
- // React nodes in the future. We need to check this first because
- // if we're a child of a dehydrated container, we need to first
- // find that inner container before moving on to finding the parent
- // instance. Note that we don't check this field on the targetNode
- // itself because the fibers are conceptually between the container
- // node and the first child. It isn't surrounding the container node.
- // If it's not a container, we check if it's an instance.
- targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];
-
- if (targetInst) {
- // Since this wasn't the direct target of the event, we might have
- // stepped past dehydrated DOM nodes to get here. However they could
- // also have been non-React nodes. We need to answer which one.
- // If we the instance doesn't have any children, then there can't be
- // a nested suspense boundary within it. So we can use this as a fast
- // bailout. Most of the time, when people add non-React children to
- // the tree, it is using a ref to a child-less DOM node.
- // Normally we'd only need to check one of the fibers because if it
- // has ever gone from having children to deleting them or vice versa
- // it would have deleted the dehydrated boundary nested inside already.
- // However, since the HostRoot starts out with an alternate it might
- // have one on the alternate so we need to check in case this was a
- // root.
- var alternate = targetInst.alternate;
-
- if (targetInst.child !== null || alternate !== null && alternate.child !== null) {
- // Next we need to figure out if the node that skipped past is
- // nested within a dehydrated boundary and if so, which one.
- var suspenseInstance = getParentSuspenseInstance(targetNode);
-
- while (suspenseInstance !== null) {
- // We found a suspense instance. That means that we haven't
- // hydrated it yet. Even though we leave the comments in the
- // DOM after hydrating, and there are boundaries in the DOM
- // that could already be hydrated, we wouldn't have found them
- // through this pass since if the target is hydrated it would
- // have had an internalInstanceKey on it.
- // Let's get the fiber associated with the SuspenseComponent
- // as the deepest instance.
- var targetSuspenseInst = suspenseInstance[internalInstanceKey];
-
- if (targetSuspenseInst) {
- return targetSuspenseInst;
- } // If we don't find a Fiber on the comment, it might be because
- // we haven't gotten to hydrate it yet. There might still be a
- // parent boundary that hasn't above this one so we need to find
- // the outer most that is known.
-
-
- suspenseInstance = getParentSuspenseInstance(suspenseInstance); // If we don't find one, then that should mean that the parent
- // host component also hasn't hydrated yet. We can return it
- // below since it will bail out on the isMounted check later.
- }
- }
-
- return targetInst;
- }
-
- targetNode = parentNode;
- parentNode = targetNode.parentNode;
- }
-
- return null;
- }
- /**
- * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
- * instance, or null if the node was not rendered by this React.
- */
-
- function getInstanceFromNode$1(node) {
- var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];
-
- if (inst) {
- if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {
- return inst;
- } else {
- return null;
- }
- }
-
- return null;
- }
- /**
- * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
- * DOM node.
- */
-
- function getNodeFromInstance$1(inst) {
- if (inst.tag === HostComponent || inst.tag === HostText) {
- // In Fiber this, is just the state node right now. We assume it will be
- // a host component or host text.
- return inst.stateNode;
- } // Without this first invariant, passing a non-DOM-component triggers the next
- // invariant for a missing parent, which is super confusing.
-
-
- {
- {
- throw Error("getNodeFromInstance: Invalid argument.");
- }
- }
- }
- function getFiberCurrentPropsFromNode$1(node) {
- return node[internalEventHandlersKey] || null;
- }
- function updateFiberProps(node, props) {
- node[internalEventHandlersKey] = props;
- }
-
- /**
- * These variables store information about text content of a target node,
- * allowing comparison of content before and after a given event.
- *
- * Identify the node where selection currently begins, then observe
- * both its text content and its current position in the DOM. Since the
- * browser may natively replace the target node during composition, we can
- * use its position to find its replacement.
- *
- *
- */
- var root = null;
- var startText = null;
- var fallbackText = null;
- function initialize(nativeEventTarget) {
- root = nativeEventTarget;
- startText = getText();
- return true;
- }
- function reset() {
- root = null;
- startText = null;
- fallbackText = null;
- }
- function getData() {
- if (fallbackText) {
- return fallbackText;
- }
-
- var start;
- var startValue = startText;
- var startLength = startValue.length;
- var end;
- var endValue = getText();
- var endLength = endValue.length;
-
- for (start = 0; start < startLength; start++) {
- if (startValue[start] !== endValue[start]) {
- break;
- }
- }
-
- var minEnd = startLength - start;
-
- for (end = 1; end <= minEnd; end++) {
- if (startValue[startLength - end] !== endValue[endLength - end]) {
- break;
- }
- }
-
- var sliceTail = end > 1 ? 1 - end : undefined;
- fallbackText = endValue.slice(start, sliceTail);
- return fallbackText;
- }
- function getText() {
- if ('value' in root) {
- return root.value;
- }
-
- return root.textContent;
- }
-
- /**
- * @interface Event
- * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
- */
-
- var SyntheticCompositionEvent = SyntheticEvent.extend({
- data: null
- });
-
- /**
- * @interface Event
- * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
- * /#events-inputevents
- */
-
- var SyntheticInputEvent = SyntheticEvent.extend({
- data: null
- });
-
- var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
-
- var START_KEYCODE = 229;
- var canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;
- var documentMode = null;
-
- if (canUseDOM && 'documentMode' in document) {
- documentMode = document.documentMode;
- } // Webkit offers a very useful `textInput` event that can be used to
- // directly represent `beforeInput`. The IE `textinput` event is not as
- // useful, so we don't use it.
-
-
- var canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode; // In IE9+, we have access to composition events, but the data supplied
- // by the native compositionend event may be incorrect. Japanese ideographic
- // spaces, for instance (\u3000) are not recorded correctly.
-
- var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
- var SPACEBAR_CODE = 32;
- var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); // Events and their corresponding property names.
-
- var eventTypes$1 = {
- beforeInput: {
- phasedRegistrationNames: {
- bubbled: 'onBeforeInput',
- captured: 'onBeforeInputCapture'
- },
- dependencies: [TOP_COMPOSITION_END, TOP_KEY_PRESS, TOP_TEXT_INPUT, TOP_PASTE]
- },
- compositionEnd: {
- phasedRegistrationNames: {
- bubbled: 'onCompositionEnd',
- captured: 'onCompositionEndCapture'
- },
- dependencies: [TOP_BLUR, TOP_COMPOSITION_END, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
- },
- compositionStart: {
- phasedRegistrationNames: {
- bubbled: 'onCompositionStart',
- captured: 'onCompositionStartCapture'
- },
- dependencies: [TOP_BLUR, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
- },
- compositionUpdate: {
- phasedRegistrationNames: {
- bubbled: 'onCompositionUpdate',
- captured: 'onCompositionUpdateCapture'
- },
- dependencies: [TOP_BLUR, TOP_COMPOSITION_UPDATE, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
- }
- }; // Track whether we've ever handled a keypress on the space key.
-
- var hasSpaceKeypress = false;
- /**
- * Return whether a native keypress event is assumed to be a command.
- * This is required because Firefox fires `keypress` events for key commands
- * (cut, copy, select-all, etc.) even though no character is inserted.
- */
-
- function isKeypressCommand(nativeEvent) {
- return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.
- !(nativeEvent.ctrlKey && nativeEvent.altKey);
- }
- /**
- * Translate native top level events into event types.
- *
- * @param {string} topLevelType
- * @return {object}
- */
-
-
- function getCompositionEventType(topLevelType) {
- switch (topLevelType) {
- case TOP_COMPOSITION_START:
- return eventTypes$1.compositionStart;
-
- case TOP_COMPOSITION_END:
- return eventTypes$1.compositionEnd;
-
- case TOP_COMPOSITION_UPDATE:
- return eventTypes$1.compositionUpdate;
- }
- }
- /**
- * Does our fallback best-guess model think this event signifies that
- * composition has begun?
- *
- * @param {string} topLevelType
- * @param {object} nativeEvent
- * @return {boolean}
- */
-
-
- function isFallbackCompositionStart(topLevelType, nativeEvent) {
- return topLevelType === TOP_KEY_DOWN && nativeEvent.keyCode === START_KEYCODE;
- }
- /**
- * Does our fallback mode think that this event is the end of composition?
- *
- * @param {string} topLevelType
- * @param {object} nativeEvent
- * @return {boolean}
- */
-
-
- function isFallbackCompositionEnd(topLevelType, nativeEvent) {
- switch (topLevelType) {
- case TOP_KEY_UP:
- // Command keys insert or clear IME input.
- return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
-
- case TOP_KEY_DOWN:
- // Expect IME keyCode on each keydown. If we get any other
- // code we must have exited earlier.
- return nativeEvent.keyCode !== START_KEYCODE;
-
- case TOP_KEY_PRESS:
- case TOP_MOUSE_DOWN:
- case TOP_BLUR:
- // Events are not possible without cancelling IME.
- return true;
-
- default:
- return false;
- }
- }
- /**
- * Google Input Tools provides composition data via a CustomEvent,
- * with the `data` property populated in the `detail` object. If this
- * is available on the event object, use it. If not, this is a plain
- * composition event and we have nothing special to extract.
- *
- * @param {object} nativeEvent
- * @return {?string}
- */
-
-
- function getDataFromCustomEvent(nativeEvent) {
- var detail = nativeEvent.detail;
-
- if (typeof detail === 'object' && 'data' in detail) {
- return detail.data;
- }
-
- return null;
- }
- /**
- * Check if a composition event was triggered by Korean IME.
- * Our fallback mode does not work well with IE's Korean IME,
- * so just use native composition events when Korean IME is used.
- * Although CompositionEvent.locale property is deprecated,
- * it is available in IE, where our fallback mode is enabled.
- *
- * @param {object} nativeEvent
- * @return {boolean}
- */
-
-
- function isUsingKoreanIME(nativeEvent) {
- return nativeEvent.locale === 'ko';
- } // Track the current IME composition status, if any.
-
-
- var isComposing = false;
- /**
- * @return {?object} A SyntheticCompositionEvent.
- */
-
- function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var eventType;
- var fallbackData;
-
- if (canUseCompositionEvent) {
- eventType = getCompositionEventType(topLevelType);
- } else if (!isComposing) {
- if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
- eventType = eventTypes$1.compositionStart;
- }
- } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
- eventType = eventTypes$1.compositionEnd;
- }
-
- if (!eventType) {
- return null;
- }
-
- if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
- // The current composition is stored statically and must not be
- // overwritten while composition continues.
- if (!isComposing && eventType === eventTypes$1.compositionStart) {
- isComposing = initialize(nativeEventTarget);
- } else if (eventType === eventTypes$1.compositionEnd) {
- if (isComposing) {
- fallbackData = getData();
- }
- }
- }
-
- var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
-
- if (fallbackData) {
- // Inject data generated from fallback path into the synthetic event.
- // This matches the property of native CompositionEventInterface.
- event.data = fallbackData;
- } else {
- var customData = getDataFromCustomEvent(nativeEvent);
-
- if (customData !== null) {
- event.data = customData;
- }
- }
-
- accumulateTwoPhaseDispatches(event);
- return event;
- }
- /**
- * @param {TopLevelType} topLevelType Number from `TopLevelType`.
- * @param {object} nativeEvent Native browser event.
- * @return {?string} The string corresponding to this `beforeInput` event.
- */
-
-
- function getNativeBeforeInputChars(topLevelType, nativeEvent) {
- switch (topLevelType) {
- case TOP_COMPOSITION_END:
- return getDataFromCustomEvent(nativeEvent);
-
- case TOP_KEY_PRESS:
- /**
- * If native `textInput` events are available, our goal is to make
- * use of them. However, there is a special case: the spacebar key.
- * In Webkit, preventing default on a spacebar `textInput` event
- * cancels character insertion, but it *also* causes the browser
- * to fall back to its default spacebar behavior of scrolling the
- * page.
- *
- * Tracking at:
- * https://code.google.com/p/chromium/issues/detail?id=355103
- *
- * To avoid this issue, use the keypress event as if no `textInput`
- * event is available.
- */
- var which = nativeEvent.which;
-
- if (which !== SPACEBAR_CODE) {
- return null;
- }
-
- hasSpaceKeypress = true;
- return SPACEBAR_CHAR;
-
- case TOP_TEXT_INPUT:
- // Record the characters to be added to the DOM.
- var chars = nativeEvent.data; // If it's a spacebar character, assume that we have already handled
- // it at the keypress level and bail immediately. Android Chrome
- // doesn't give us keycodes, so we need to ignore it.
-
- if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
- return null;
- }
-
- return chars;
-
- default:
- // For other native event types, do nothing.
- return null;
- }
- }
- /**
- * For browsers that do not provide the `textInput` event, extract the
- * appropriate string to use for SyntheticInputEvent.
- *
- * @param {number} topLevelType Number from `TopLevelEventTypes`.
- * @param {object} nativeEvent Native browser event.
- * @return {?string} The fallback string for this `beforeInput` event.
- */
-
-
- function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
- // If we are currently composing (IME) and using a fallback to do so,
- // try to extract the composed characters from the fallback object.
- // If composition event is available, we extract a string only at
- // compositionevent, otherwise extract it at fallback events.
- if (isComposing) {
- if (topLevelType === TOP_COMPOSITION_END || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
- var chars = getData();
- reset();
- isComposing = false;
- return chars;
- }
-
- return null;
- }
-
- switch (topLevelType) {
- case TOP_PASTE:
- // If a paste event occurs after a keypress, throw out the input
- // chars. Paste events should not lead to BeforeInput events.
- return null;
-
- case TOP_KEY_PRESS:
- /**
- * As of v27, Firefox may fire keypress events even when no character
- * will be inserted. A few possibilities:
- *
- * - `which` is `0`. Arrow keys, Esc key, etc.
- *
- * - `which` is the pressed key code, but no char is available.
- * Ex: 'AltGr + d` in Polish. There is no modified character for
- * this key combination and no character is inserted into the
- * document, but FF fires the keypress for char code `100` anyway.
- * No `input` event will occur.
- *
- * - `which` is the pressed key code, but a command combination is
- * being used. Ex: `Cmd+C`. No character is inserted, and no
- * `input` event will occur.
- */
- if (!isKeypressCommand(nativeEvent)) {
- // IE fires the `keypress` event when a user types an emoji via
- // Touch keyboard of Windows. In such a case, the `char` property
- // holds an emoji character like `\uD83D\uDE0A`. Because its length
- // is 2, the property `which` does not represent an emoji correctly.
- // In such a case, we directly return the `char` property instead of
- // using `which`.
- if (nativeEvent.char && nativeEvent.char.length > 1) {
- return nativeEvent.char;
- } else if (nativeEvent.which) {
- return String.fromCharCode(nativeEvent.which);
- }
- }
-
- return null;
-
- case TOP_COMPOSITION_END:
- return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
-
- default:
- return null;
- }
- }
- /**
- * Extract a SyntheticInputEvent for `beforeInput`, based on either native
- * `textInput` or fallback behavior.
- *
- * @return {?object} A SyntheticInputEvent.
- */
-
-
- function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
- var chars;
-
- if (canUseTextInputEvent) {
- chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
- } else {
- chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
- } // If no characters are being inserted, no BeforeInput event should
- // be fired.
-
-
- if (!chars) {
- return null;
- }
-
- var event = SyntheticInputEvent.getPooled(eventTypes$1.beforeInput, targetInst, nativeEvent, nativeEventTarget);
- event.data = chars;
- accumulateTwoPhaseDispatches(event);
- return event;
- }
- /**
- * Create an `onBeforeInput` event to match
- * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
- *
- * This event plugin is based on the native `textInput` event
- * available in Chrome, Safari, Opera, and IE. This event fires after
- * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
- *
- * `beforeInput` is spec'd but not implemented in any browsers, and
- * the `input` event does not provide any useful information about what has
- * actually been added, contrary to the spec. Thus, `textInput` is the best
- * available event to identify the characters that have actually been inserted
- * into the target node.
- *
- * This plugin is also responsible for emitting `composition` events, thus
- * allowing us to share composition fallback code for both `beforeInput` and
- * `composition` event types.
- */
-
-
- var BeforeInputEventPlugin = {
- eventTypes: eventTypes$1,
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
- var composition = extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);
- var beforeInput = extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);
-
- if (composition === null) {
- return beforeInput;
- }
-
- if (beforeInput === null) {
- return composition;
- }
-
- return [composition, beforeInput];
- }
- };
-
- /**
- * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
- */
- var supportedInputTypes = {
- color: true,
- date: true,
- datetime: true,
- 'datetime-local': true,
- email: true,
- month: true,
- number: true,
- password: true,
- range: true,
- search: true,
- tel: true,
- text: true,
- time: true,
- url: true,
- week: true
- };
-
- function isTextInputElement(elem) {
- var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
-
- if (nodeName === 'input') {
- return !!supportedInputTypes[elem.type];
- }
-
- if (nodeName === 'textarea') {
- return true;
- }
-
- return false;
- }
-
- var eventTypes$2 = {
- change: {
- phasedRegistrationNames: {
- bubbled: 'onChange',
- captured: 'onChangeCapture'
- },
- dependencies: [TOP_BLUR, TOP_CHANGE, TOP_CLICK, TOP_FOCUS, TOP_INPUT, TOP_KEY_DOWN, TOP_KEY_UP, TOP_SELECTION_CHANGE]
- }
- };
-
- function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
- var event = SyntheticEvent.getPooled(eventTypes$2.change, inst, nativeEvent, target);
- event.type = 'change'; // Flag this event loop as needing state restore.
-
- enqueueStateRestore(target);
- accumulateTwoPhaseDispatches(event);
- return event;
- }
- /**
- * For IE shims
- */
-
-
- var activeElement = null;
- var activeElementInst = null;
- /**
- * SECTION: handle `change` event
- */
-
- function shouldUseChangeEvent(elem) {
- var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
- return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
- }
-
- function manualDispatchChangeEvent(nativeEvent) {
- var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent)); // If change and propertychange bubbled, we'd just bind to it like all the
- // other events and have it go through ReactBrowserEventEmitter. Since it
- // doesn't, we manually listen for the events and so we have to enqueue and
- // process the abstract event manually.
- //
- // Batching is necessary here in order to ensure that all event handlers run
- // before the next rerender (including event handlers attached to ancestor
- // elements instead of directly on the input). Without this, controlled
- // components don't work properly in conjunction with event bubbling because
- // the component is rerendered and the value reverted before all the event
- // handlers can run. See https://github.com/facebook/react/issues/708.
-
- batchedUpdates(runEventInBatch, event);
- }
-
- function runEventInBatch(event) {
- runEventsInBatch(event);
- }
-
- function getInstIfValueChanged(targetInst) {
- var targetNode = getNodeFromInstance$1(targetInst);
-
- if (updateValueIfChanged(targetNode)) {
- return targetInst;
- }
- }
-
- function getTargetInstForChangeEvent(topLevelType, targetInst) {
- if (topLevelType === TOP_CHANGE) {
- return targetInst;
- }
- }
- /**
- * SECTION: handle `input` event
- */
-
-
- var isInputEventSupported = false;
-
- if (canUseDOM) {
- // IE9 claims to support the input event but fails to trigger it when
- // deleting text, so we ignore its input events.
- isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);
- }
- /**
- * (For IE <=9) Starts tracking propertychange events on the passed-in element
- * and override the value property so that we can distinguish user events from
- * value changes in JS.
- */
-
-
- function startWatchingForValueChange(target, targetInst) {
- activeElement = target;
- activeElementInst = targetInst;
- activeElement.attachEvent('onpropertychange', handlePropertyChange);
- }
- /**
- * (For IE <=9) Removes the event listeners from the currently-tracked element,
- * if any exists.
- */
-
-
- function stopWatchingForValueChange() {
- if (!activeElement) {
- return;
- }
-
- activeElement.detachEvent('onpropertychange', handlePropertyChange);
- activeElement = null;
- activeElementInst = null;
- }
- /**
- * (For IE <=9) Handles a propertychange event, sending a `change` event if
- * the value of the active element has changed.
- */
-
-
- function handlePropertyChange(nativeEvent) {
- if (nativeEvent.propertyName !== 'value') {
- return;
- }
-
- if (getInstIfValueChanged(activeElementInst)) {
- manualDispatchChangeEvent(nativeEvent);
- }
- }
-
- function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) {
- if (topLevelType === TOP_FOCUS) {
- // In IE9, propertychange fires for most input events but is buggy and
- // doesn't fire when text is deleted, but conveniently, selectionchange
- // appears to fire in all of the remaining cases so we catch those and
- // forward the event if the value has changed
- // In either case, we don't want to call the event handler if the value
- // is changed from JS so we redefine a setter for `.value` that updates
- // our activeElementValue variable, allowing us to ignore those changes
- //
- // stopWatching() should be a noop here but we call it just in case we
- // missed a blur event somehow.
- stopWatchingForValueChange();
- startWatchingForValueChange(target, targetInst);
- } else if (topLevelType === TOP_BLUR) {
- stopWatchingForValueChange();
- }
- } // For IE8 and IE9.
-
-
- function getTargetInstForInputEventPolyfill(topLevelType, targetInst) {
- if (topLevelType === TOP_SELECTION_CHANGE || topLevelType === TOP_KEY_UP || topLevelType === TOP_KEY_DOWN) {
- // On the selectionchange event, the target is just document which isn't
- // helpful for us so just check activeElement instead.
- //
- // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
- // propertychange on the first input event after setting `value` from a
- // script and fires only keydown, keypress, keyup. Catching keyup usually
- // gets it and catching keydown lets us fire an event for the first
- // keystroke if user does a key repeat (it'll be a little delayed: right
- // before the second keystroke). Other input methods (e.g., paste) seem to
- // fire selectionchange normally.
- return getInstIfValueChanged(activeElementInst);
- }
- }
- /**
- * SECTION: handle `click` event
- */
-
-
- function shouldUseClickEvent(elem) {
- // Use the `click` event to detect changes to checkbox and radio inputs.
- // This approach works across all browsers, whereas `change` does not fire
- // until `blur` in IE8.
- var nodeName = elem.nodeName;
- return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
- }
-
- function getTargetInstForClickEvent(topLevelType, targetInst) {
- if (topLevelType === TOP_CLICK) {
- return getInstIfValueChanged(targetInst);
- }
- }
-
- function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
- if (topLevelType === TOP_INPUT || topLevelType === TOP_CHANGE) {
- return getInstIfValueChanged(targetInst);
- }
- }
-
- function handleControlledInputBlur(node) {
- var state = node._wrapperState;
-
- if (!state || !state.controlled || node.type !== 'number') {
- return;
- }
-
- if (!disableInputAttributeSyncing) {
- // If controlled, assign the value attribute to the current value on blur
- setDefaultValue(node, 'number', node.value);
- }
- }
- /**
- * This plugin creates an `onChange` event that normalizes change events
- * across form elements. This event fires at a time when it's possible to
- * change the element's value without seeing a flicker.
- *
- * Supported elements are:
- * - input (see `isTextInputElement`)
- * - textarea
- * - select
- */
-
-
- var ChangeEventPlugin = {
- eventTypes: eventTypes$2,
- _isInputEventSupported: isInputEventSupported,
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
- var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;
- var getTargetInstFunc, handleEventFunc;
-
- if (shouldUseChangeEvent(targetNode)) {
- getTargetInstFunc = getTargetInstForChangeEvent;
- } else if (isTextInputElement(targetNode)) {
- if (isInputEventSupported) {
- getTargetInstFunc = getTargetInstForInputOrChangeEvent;
- } else {
- getTargetInstFunc = getTargetInstForInputEventPolyfill;
- handleEventFunc = handleEventsForInputEventPolyfill;
- }
- } else if (shouldUseClickEvent(targetNode)) {
- getTargetInstFunc = getTargetInstForClickEvent;
- }
-
- if (getTargetInstFunc) {
- var inst = getTargetInstFunc(topLevelType, targetInst);
-
- if (inst) {
- var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);
- return event;
- }
- }
-
- if (handleEventFunc) {
- handleEventFunc(topLevelType, targetNode, targetInst);
- } // When blurring, set the value attribute for number inputs
-
-
- if (topLevelType === TOP_BLUR) {
- handleControlledInputBlur(targetNode);
- }
- }
- };
-
- /**
- * Module that is injectable into `EventPluginHub`, that specifies a
- * deterministic ordering of `EventPlugin`s. A convenient way to reason about
- * plugins, without having to package every one of them. This is better than
- * having plugins be ordered in the same order that they are injected because
- * that ordering would be influenced by the packaging order.
- * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
- * preventing default on events is convenient in `SimpleEventPlugin` handlers.
- */
- var DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];
-
- var eventTypes$3 = {
- mouseEnter: {
- registrationName: 'onMouseEnter',
- dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
- },
- mouseLeave: {
- registrationName: 'onMouseLeave',
- dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
- },
- pointerEnter: {
- registrationName: 'onPointerEnter',
- dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
- },
- pointerLeave: {
- registrationName: 'onPointerLeave',
- dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
- }
- }; // We track the lastNativeEvent to ensure that when we encounter
- // cases where we process the same nativeEvent multiple times,
- // which can happen when have multiple ancestors, that we don't
- // duplicate enter
-
- var lastNativeEvent;
- var EnterLeaveEventPlugin = {
- eventTypes: eventTypes$3,
-
- /**
- * For almost every interaction we care about, there will be both a top-level
- * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
- * we do not extract duplicate events. However, moving the mouse into the
- * browser from outside will not fire a `mouseout` event. In this case, we use
- * the `mouseover` top-level event.
- */
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
- var isOverEvent = topLevelType === TOP_MOUSE_OVER || topLevelType === TOP_POINTER_OVER;
- var isOutEvent = topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_POINTER_OUT;
-
- if (isOverEvent && (eventSystemFlags & IS_REPLAYED) === 0 && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
- // If this is an over event with a target, then we've already dispatched
- // the event in the out event of the other target. If this is replayed,
- // then it's because we couldn't dispatch against this target previously
- // so we have to do it now instead.
- return null;
- }
-
- if (!isOutEvent && !isOverEvent) {
- // Must not be a mouse or pointer in or out - ignoring.
- return null;
- }
-
- var win;
-
- if (nativeEventTarget.window === nativeEventTarget) {
- // `nativeEventTarget` is probably a window object.
- win = nativeEventTarget;
- } else {
- // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
- var doc = nativeEventTarget.ownerDocument;
-
- if (doc) {
- win = doc.defaultView || doc.parentWindow;
- } else {
- win = window;
- }
- }
-
- var from;
- var to;
-
- if (isOutEvent) {
- from = targetInst;
- var related = nativeEvent.relatedTarget || nativeEvent.toElement;
- to = related ? getClosestInstanceFromNode(related) : null;
-
- if (to !== null) {
- var nearestMounted = getNearestMountedFiber(to);
-
- if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {
- to = null;
- }
- }
- } else {
- // Moving to a node from outside the window.
- from = null;
- to = targetInst;
- }
-
- if (from === to) {
- // Nothing pertains to our managed components.
- return null;
- }
-
- var eventInterface, leaveEventType, enterEventType, eventTypePrefix;
-
- if (topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_MOUSE_OVER) {
- eventInterface = SyntheticMouseEvent;
- leaveEventType = eventTypes$3.mouseLeave;
- enterEventType = eventTypes$3.mouseEnter;
- eventTypePrefix = 'mouse';
- } else if (topLevelType === TOP_POINTER_OUT || topLevelType === TOP_POINTER_OVER) {
- eventInterface = SyntheticPointerEvent;
- leaveEventType = eventTypes$3.pointerLeave;
- enterEventType = eventTypes$3.pointerEnter;
- eventTypePrefix = 'pointer';
- }
-
- var fromNode = from == null ? win : getNodeFromInstance$1(from);
- var toNode = to == null ? win : getNodeFromInstance$1(to);
- var leave = eventInterface.getPooled(leaveEventType, from, nativeEvent, nativeEventTarget);
- leave.type = eventTypePrefix + 'leave';
- leave.target = fromNode;
- leave.relatedTarget = toNode;
- var enter = eventInterface.getPooled(enterEventType, to, nativeEvent, nativeEventTarget);
- enter.type = eventTypePrefix + 'enter';
- enter.target = toNode;
- enter.relatedTarget = fromNode;
- accumulateEnterLeaveDispatches(leave, enter, from, to);
-
- if (nativeEvent === lastNativeEvent) {
- lastNativeEvent = null;
- return [leave];
- }
-
- lastNativeEvent = nativeEvent;
- return [leave, enter];
- }
- };
-
- /**
- * inlined Object.is polyfill to avoid requiring consumers ship their own
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
- */
- function is(x, y) {
- return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
- ;
- }
-
- var is$1 = typeof Object.is === 'function' ? Object.is : is;
-
- var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
- /**
- * Performs equality by iterating through keys on an object and returning false
- * when any key has values which are not strictly equal between the arguments.
- * Returns true when the values of all keys are strictly equal.
- */
-
- function shallowEqual(objA, objB) {
- if (is$1(objA, objB)) {
- return true;
- }
-
- if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
- return false;
- }
-
- var keysA = Object.keys(objA);
- var keysB = Object.keys(objB);
-
- if (keysA.length !== keysB.length) {
- return false;
- } // Test for A's keys different from B.
-
-
- for (var i = 0; i < keysA.length; i++) {
- if (!hasOwnProperty$2.call(objB, keysA[i]) || !is$1(objA[keysA[i]], objB[keysA[i]])) {
- return false;
- }
- }
-
- return true;
- }
-
- var skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11;
- var eventTypes$4 = {
- select: {
- phasedRegistrationNames: {
- bubbled: 'onSelect',
- captured: 'onSelectCapture'
- },
- dependencies: [TOP_BLUR, TOP_CONTEXT_MENU, TOP_DRAG_END, TOP_FOCUS, TOP_KEY_DOWN, TOP_KEY_UP, TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_SELECTION_CHANGE]
- }
- };
- var activeElement$1 = null;
- var activeElementInst$1 = null;
- var lastSelection = null;
- var mouseDown = false;
- /**
- * Get an object which is a unique representation of the current selection.
- *
- * The return value will not be consistent across nodes or browsers, but
- * two identical selections on the same node will return identical objects.
- *
- * @param {DOMElement} node
- * @return {object}
- */
-
- function getSelection$1(node) {
- if ('selectionStart' in node && hasSelectionCapabilities(node)) {
- return {
- start: node.selectionStart,
- end: node.selectionEnd
- };
- } else {
- var win = node.ownerDocument && node.ownerDocument.defaultView || window;
- var selection = win.getSelection();
- return {
- anchorNode: selection.anchorNode,
- anchorOffset: selection.anchorOffset,
- focusNode: selection.focusNode,
- focusOffset: selection.focusOffset
- };
- }
- }
- /**
- * Get document associated with the event target.
- *
- * @param {object} nativeEventTarget
- * @return {Document}
- */
-
-
- function getEventTargetDocument(eventTarget) {
- return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
- }
- /**
- * Poll selection to see whether it's changed.
- *
- * @param {object} nativeEvent
- * @param {object} nativeEventTarget
- * @return {?SyntheticEvent}
- */
-
-
- function constructSelectEvent(nativeEvent, nativeEventTarget) {
- // Ensure we have the right element, and that the user is not dragging a
- // selection (this matches native `select` event behavior). In HTML5, select
- // fires only on input and textarea thus if there's no focused element we
- // won't dispatch.
- var doc = getEventTargetDocument(nativeEventTarget);
-
- if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
- return null;
- } // Only fire when selection has actually changed.
-
-
- var currentSelection = getSelection$1(activeElement$1);
-
- if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
- lastSelection = currentSelection;
- var syntheticEvent = SyntheticEvent.getPooled(eventTypes$4.select, activeElementInst$1, nativeEvent, nativeEventTarget);
- syntheticEvent.type = 'select';
- syntheticEvent.target = activeElement$1;
- accumulateTwoPhaseDispatches(syntheticEvent);
- return syntheticEvent;
- }
-
- return null;
- }
- /**
- * This plugin creates an `onSelect` event that normalizes select events
- * across form elements.
- *
- * Supported elements are:
- * - input (see `isTextInputElement`)
- * - textarea
- * - contentEditable
- *
- * This differs from native browser implementations in the following ways:
- * - Fires on contentEditable fields as well as inputs.
- * - Fires for collapsed selection.
- * - Fires after user input.
- */
-
-
- var SelectEventPlugin = {
- eventTypes: eventTypes$4,
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
- var doc = getEventTargetDocument(nativeEventTarget); // Track whether all listeners exists for this plugin. If none exist, we do
- // not extract events. See #3639.
-
- if (!doc || !isListeningToAllDependencies('onSelect', doc)) {
- return null;
- }
-
- var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;
-
- switch (topLevelType) {
- // Track the input node that has focus.
- case TOP_FOCUS:
- if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
- activeElement$1 = targetNode;
- activeElementInst$1 = targetInst;
- lastSelection = null;
- }
-
- break;
-
- case TOP_BLUR:
- activeElement$1 = null;
- activeElementInst$1 = null;
- lastSelection = null;
- break;
- // Don't fire the event while the user is dragging. This matches the
- // semantics of the native select event.
-
- case TOP_MOUSE_DOWN:
- mouseDown = true;
- break;
-
- case TOP_CONTEXT_MENU:
- case TOP_MOUSE_UP:
- case TOP_DRAG_END:
- mouseDown = false;
- return constructSelectEvent(nativeEvent, nativeEventTarget);
- // Chrome and IE fire non-standard event when selection is changed (and
- // sometimes when it hasn't). IE's event fires out of order with respect
- // to key and input events on deletion, so we discard it.
- //
- // Firefox doesn't support selectionchange, so check selection status
- // after each key entry. The selection changes after keydown and before
- // keyup, but we check on keydown as well in the case of holding down a
- // key, when multiple keydown events are fired but only one keyup is.
- // This is also our approach for IE handling, for the reason above.
-
- case TOP_SELECTION_CHANGE:
- if (skipSelectionChangeEvent) {
- break;
- }
-
- // falls through
-
- case TOP_KEY_DOWN:
- case TOP_KEY_UP:
- return constructSelectEvent(nativeEvent, nativeEventTarget);
- }
-
- return null;
- }
- };
-
- /**
- * Inject modules for resolving DOM hierarchy and plugin ordering.
- */
-
- injection.injectEventPluginOrder(DOMEventPluginOrder);
- setComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromNode$1, getNodeFromInstance$1);
- /**
- * Some important event plugins included by default (without having to require
- * them).
- */
-
- injection.injectEventPluginsByName({
- SimpleEventPlugin: SimpleEventPlugin,
- EnterLeaveEventPlugin: EnterLeaveEventPlugin,
- ChangeEventPlugin: ChangeEventPlugin,
- SelectEventPlugin: SelectEventPlugin,
- BeforeInputEventPlugin: BeforeInputEventPlugin
- });
-
- // Prefix measurements so that it's possible to filter them.
- // Longer prefixes are hard to read in DevTools.
- var reactEmoji = "\u269B";
- var warningEmoji = "\u26D4";
- var supportsUserTiming = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function'; // Keep track of current fiber so that we know the path to unwind on pause.
- // TODO: this looks the same as nextUnitOfWork in scheduler. Can we unify them?
-
- var currentFiber = null; // If we're in the middle of user code, which fiber and method is it?
- // Reusing `currentFiber` would be confusing for this because user code fiber
- // can change during commit phase too, but we don't need to unwind it (since
- // lifecycles in the commit phase don't resemble a tree).
-
- var currentPhase = null;
- var currentPhaseFiber = null; // Did lifecycle hook schedule an update? This is often a performance problem,
- // so we will keep track of it, and include it in the report.
- // Track commits caused by cascading updates.
-
- var isCommitting = false;
- var hasScheduledUpdateInCurrentCommit = false;
- var hasScheduledUpdateInCurrentPhase = false;
- var commitCountInCurrentWorkLoop = 0;
- var effectCountInCurrentCommit = 0;
- // to avoid stretch the commit phase with measurement overhead.
-
- var labelsInCurrentCommit = new Set();
-
- var formatMarkName = function (markName) {
- return reactEmoji + " " + markName;
- };
-
- var formatLabel = function (label, warning) {
- var prefix = warning ? warningEmoji + " " : reactEmoji + " ";
- var suffix = warning ? " Warning: " + warning : '';
- return "" + prefix + label + suffix;
- };
-
- var beginMark = function (markName) {
- performance.mark(formatMarkName(markName));
- };
-
- var clearMark = function (markName) {
- performance.clearMarks(formatMarkName(markName));
- };
-
- var endMark = function (label, markName, warning) {
- var formattedMarkName = formatMarkName(markName);
- var formattedLabel = formatLabel(label, warning);
-
- try {
- performance.measure(formattedLabel, formattedMarkName);
- } catch (err) {} // If previous mark was missing for some reason, this will throw.
- // This could only happen if React crashed in an unexpected place earlier.
- // Don't pile on with more errors.
- // Clear marks immediately to avoid growing buffer.
-
-
- performance.clearMarks(formattedMarkName);
- performance.clearMeasures(formattedLabel);
- };
-
- var getFiberMarkName = function (label, debugID) {
- return label + " (#" + debugID + ")";
- };
-
- var getFiberLabel = function (componentName, isMounted, phase) {
- if (phase === null) {
- // These are composite component total time measurements.
- return componentName + " [" + (isMounted ? 'update' : 'mount') + "]";
- } else {
- // Composite component methods.
- return componentName + "." + phase;
- }
- };
-
- var beginFiberMark = function (fiber, phase) {
- var componentName = getComponentName(fiber.type) || 'Unknown';
- var debugID = fiber._debugID;
- var isMounted = fiber.alternate !== null;
- var label = getFiberLabel(componentName, isMounted, phase);
-
- if (isCommitting && labelsInCurrentCommit.has(label)) {
- // During the commit phase, we don't show duplicate labels because
- // there is a fixed overhead for every measurement, and we don't
- // want to stretch the commit phase beyond necessary.
- return false;
- }
-
- labelsInCurrentCommit.add(label);
- var markName = getFiberMarkName(label, debugID);
- beginMark(markName);
- return true;
- };
-
- var clearFiberMark = function (fiber, phase) {
- var componentName = getComponentName(fiber.type) || 'Unknown';
- var debugID = fiber._debugID;
- var isMounted = fiber.alternate !== null;
- var label = getFiberLabel(componentName, isMounted, phase);
- var markName = getFiberMarkName(label, debugID);
- clearMark(markName);
- };
-
- var endFiberMark = function (fiber, phase, warning) {
- var componentName = getComponentName(fiber.type) || 'Unknown';
- var debugID = fiber._debugID;
- var isMounted = fiber.alternate !== null;
- var label = getFiberLabel(componentName, isMounted, phase);
- var markName = getFiberMarkName(label, debugID);
- endMark(label, markName, warning);
- };
-
- var shouldIgnoreFiber = function (fiber) {
- // Host components should be skipped in the timeline.
- // We could check typeof fiber.type, but does this work with RN?
- switch (fiber.tag) {
- case HostRoot:
- case HostComponent:
- case HostText:
- case HostPortal:
- case Fragment:
- case ContextProvider:
- case ContextConsumer:
- case Mode:
- return true;
-
- default:
- return false;
- }
- };
-
- var clearPendingPhaseMeasurement = function () {
- if (currentPhase !== null && currentPhaseFiber !== null) {
- clearFiberMark(currentPhaseFiber, currentPhase);
- }
-
- currentPhaseFiber = null;
- currentPhase = null;
- hasScheduledUpdateInCurrentPhase = false;
- };
-
- var pauseTimers = function () {
- // Stops all currently active measurements so that they can be resumed
- // if we continue in a later deferred loop from the same unit of work.
- var fiber = currentFiber;
-
- while (fiber) {
- if (fiber._debugIsCurrentlyTiming) {
- endFiberMark(fiber, null, null);
- }
-
- fiber = fiber.return;
- }
- };
-
- var resumeTimersRecursively = function (fiber) {
- if (fiber.return !== null) {
- resumeTimersRecursively(fiber.return);
- }
-
- if (fiber._debugIsCurrentlyTiming) {
- beginFiberMark(fiber, null);
- }
- };
-
- var resumeTimers = function () {
- // Resumes all measurements that were active during the last deferred loop.
- if (currentFiber !== null) {
- resumeTimersRecursively(currentFiber);
- }
- };
-
- function recordEffect() {
- if (enableUserTimingAPI) {
- effectCountInCurrentCommit++;
- }
- }
- function recordScheduleUpdate() {
- if (enableUserTimingAPI) {
- if (isCommitting) {
- hasScheduledUpdateInCurrentCommit = true;
- }
-
- if (currentPhase !== null && currentPhase !== 'componentWillMount' && currentPhase !== 'componentWillReceiveProps') {
- hasScheduledUpdateInCurrentPhase = true;
- }
- }
- }
-
-
- function startWorkTimer(fiber) {
- if (enableUserTimingAPI) {
- if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
- return;
- } // If we pause, this is the fiber to unwind from.
-
-
- currentFiber = fiber;
-
- if (!beginFiberMark(fiber, null)) {
- return;
- }
-
- fiber._debugIsCurrentlyTiming = true;
- }
- }
- function cancelWorkTimer(fiber) {
- if (enableUserTimingAPI) {
- if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
- return;
- } // Remember we shouldn't complete measurement for this fiber.
- // Otherwise flamechart will be deep even for small updates.
-
-
- fiber._debugIsCurrentlyTiming = false;
- clearFiberMark(fiber, null);
- }
- }
- function stopWorkTimer(fiber) {
- if (enableUserTimingAPI) {
- if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
- return;
- } // If we pause, its parent is the fiber to unwind from.
-
-
- currentFiber = fiber.return;
-
- if (!fiber._debugIsCurrentlyTiming) {
- return;
- }
-
- fiber._debugIsCurrentlyTiming = false;
- endFiberMark(fiber, null, null);
- }
- }
- function stopFailedWorkTimer(fiber) {
- if (enableUserTimingAPI) {
- if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
- return;
- } // If we pause, its parent is the fiber to unwind from.
-
-
- currentFiber = fiber.return;
-
- if (!fiber._debugIsCurrentlyTiming) {
- return;
- }
-
- fiber._debugIsCurrentlyTiming = false;
- var warning = fiber.tag === SuspenseComponent ? 'Rendering was suspended' : 'An error was thrown inside this error boundary';
- endFiberMark(fiber, null, warning);
- }
- }
- function startPhaseTimer(fiber, phase) {
- if (enableUserTimingAPI) {
- if (!supportsUserTiming) {
- return;
- }
-
- clearPendingPhaseMeasurement();
-
- if (!beginFiberMark(fiber, phase)) {
- return;
- }
-
- currentPhaseFiber = fiber;
- currentPhase = phase;
- }
- }
- function stopPhaseTimer() {
- if (enableUserTimingAPI) {
- if (!supportsUserTiming) {
- return;
- }
-
- if (currentPhase !== null && currentPhaseFiber !== null) {
- var warning = hasScheduledUpdateInCurrentPhase ? 'Scheduled a cascading update' : null;
- endFiberMark(currentPhaseFiber, currentPhase, warning);
- }
-
- currentPhase = null;
- currentPhaseFiber = null;
- }
- }
- function startWorkLoopTimer(nextUnitOfWork) {
- if (enableUserTimingAPI) {
- currentFiber = nextUnitOfWork;
-
- if (!supportsUserTiming) {
- return;
- }
-
- commitCountInCurrentWorkLoop = 0; // This is top level call.
- // Any other measurements are performed within.
-
- beginMark('(React Tree Reconciliation)'); // Resume any measurements that were in progress during the last loop.
-
- resumeTimers();
- }
- }
- function stopWorkLoopTimer(interruptedBy, didCompleteRoot) {
- if (enableUserTimingAPI) {
- if (!supportsUserTiming) {
- return;
- }
-
- var warning = null;
-
- if (interruptedBy !== null) {
- if (interruptedBy.tag === HostRoot) {
- warning = 'A top-level update interrupted the previous render';
- } else {
- var componentName = getComponentName(interruptedBy.type) || 'Unknown';
- warning = "An update to " + componentName + " interrupted the previous render";
- }
- } else if (commitCountInCurrentWorkLoop > 1) {
- warning = 'There were cascading updates';
- }
-
- commitCountInCurrentWorkLoop = 0;
- var label = didCompleteRoot ? '(React Tree Reconciliation: Completed Root)' : '(React Tree Reconciliation: Yielded)'; // Pause any measurements until the next loop.
-
- pauseTimers();
- endMark(label, '(React Tree Reconciliation)', warning);
- }
- }
- function startCommitTimer() {
- if (enableUserTimingAPI) {
- if (!supportsUserTiming) {
- return;
- }
-
- isCommitting = true;
- hasScheduledUpdateInCurrentCommit = false;
- labelsInCurrentCommit.clear();
- beginMark('(Committing Changes)');
- }
- }
- function stopCommitTimer() {
- if (enableUserTimingAPI) {
- if (!supportsUserTiming) {
- return;
- }
-
- var warning = null;
-
- if (hasScheduledUpdateInCurrentCommit) {
- warning = 'Lifecycle hook scheduled a cascading update';
- } else if (commitCountInCurrentWorkLoop > 0) {
- warning = 'Caused by a cascading update in earlier commit';
- }
-
- hasScheduledUpdateInCurrentCommit = false;
- commitCountInCurrentWorkLoop++;
- isCommitting = false;
- labelsInCurrentCommit.clear();
- endMark('(Committing Changes)', '(Committing Changes)', warning);
- }
- }
- function startCommitSnapshotEffectsTimer() {
- if (enableUserTimingAPI) {
- if (!supportsUserTiming) {
- return;
- }
-
- effectCountInCurrentCommit = 0;
- beginMark('(Committing Snapshot Effects)');
- }
- }
- function stopCommitSnapshotEffectsTimer() {
- if (enableUserTimingAPI) {
- if (!supportsUserTiming) {
- return;
- }
-
- var count = effectCountInCurrentCommit;
- effectCountInCurrentCommit = 0;
- endMark("(Committing Snapshot Effects: " + count + " Total)", '(Committing Snapshot Effects)', null);
- }
- }
- function startCommitHostEffectsTimer() {
- if (enableUserTimingAPI) {
- if (!supportsUserTiming) {
- return;
- }
-
- effectCountInCurrentCommit = 0;
- beginMark('(Committing Host Effects)');
- }
- }
- function stopCommitHostEffectsTimer() {
- if (enableUserTimingAPI) {
- if (!supportsUserTiming) {
- return;
- }
-
- var count = effectCountInCurrentCommit;
- effectCountInCurrentCommit = 0;
- endMark("(Committing Host Effects: " + count + " Total)", '(Committing Host Effects)', null);
- }
- }
- function startCommitLifeCyclesTimer() {
- if (enableUserTimingAPI) {
- if (!supportsUserTiming) {
- return;
- }
-
- effectCountInCurrentCommit = 0;
- beginMark('(Calling Lifecycle Methods)');
- }
- }
- function stopCommitLifeCyclesTimer() {
- if (enableUserTimingAPI) {
- if (!supportsUserTiming) {
- return;
- }
-
- var count = effectCountInCurrentCommit;
- effectCountInCurrentCommit = 0;
- endMark("(Calling Lifecycle Methods: " + count + " Total)", '(Calling Lifecycle Methods)', null);
- }
- }
-
- var valueStack = [];
- var fiberStack;
-
- {
- fiberStack = [];
- }
-
- var index = -1;
-
- function createCursor(defaultValue) {
- return {
- current: defaultValue
- };
- }
-
- function pop(cursor, fiber) {
- if (index < 0) {
- {
- warningWithoutStack$1(false, 'Unexpected pop.');
- }
-
- return;
- }
-
- {
- if (fiber !== fiberStack[index]) {
- warningWithoutStack$1(false, 'Unexpected Fiber popped.');
- }
- }
-
- cursor.current = valueStack[index];
- valueStack[index] = null;
-
- {
- fiberStack[index] = null;
- }
-
- index--;
- }
-
- function push(cursor, value, fiber) {
- index++;
- valueStack[index] = cursor.current;
-
- {
- fiberStack[index] = fiber;
- }
-
- cursor.current = value;
- }
-
- var warnedAboutMissingGetChildContext;
-
- {
- warnedAboutMissingGetChildContext = {};
- }
-
- var emptyContextObject = {};
-
- {
- Object.freeze(emptyContextObject);
- } // A cursor to the current merged context object on the stack.
-
-
- var contextStackCursor = createCursor(emptyContextObject); // A cursor to a boolean indicating whether the context has changed.
-
- var didPerformWorkStackCursor = createCursor(false); // Keep track of the previous context object that was on the stack.
- // We use this to get access to the parent context after we have already
- // pushed the next context provider, and now need to merge their contexts.
-
- var previousContext = emptyContextObject;
-
- function getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) {
- if (disableLegacyContext) {
- return emptyContextObject;
- } else {
- if (didPushOwnContextIfProvider && isContextProvider(Component)) {
- // If the fiber is a context provider itself, when we read its context
- // we may have already pushed its own child context on the stack. A context
- // provider should not "see" its own child context. Therefore we read the
- // previous (parent) context instead for a context provider.
- return previousContext;
- }
-
- return contextStackCursor.current;
- }
- }
-
- function cacheContext(workInProgress, unmaskedContext, maskedContext) {
- if (disableLegacyContext) {
- return;
- } else {
- var instance = workInProgress.stateNode;
- instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
- instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
- }
- }
-
- function getMaskedContext(workInProgress, unmaskedContext) {
- if (disableLegacyContext) {
- return emptyContextObject;
- } else {
- var type = workInProgress.type;
- var contextTypes = type.contextTypes;
-
- if (!contextTypes) {
- return emptyContextObject;
- } // Avoid recreating masked context unless unmasked context has changed.
- // Failing to do this will result in unnecessary calls to componentWillReceiveProps.
- // This may trigger infinite loops if componentWillReceiveProps calls setState.
-
-
- var instance = workInProgress.stateNode;
-
- if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
- return instance.__reactInternalMemoizedMaskedChildContext;
- }
-
- var context = {};
-
- for (var key in contextTypes) {
- context[key] = unmaskedContext[key];
- }
-
- {
- var name = getComponentName(type) || 'Unknown';
- checkPropTypes(contextTypes, context, 'context', name, getCurrentFiberStackInDev);
- } // Cache unmasked context so we can avoid recreating masked context unless necessary.
- // Context is created before the class component is instantiated so check for instance.
-
-
- if (instance) {
- cacheContext(workInProgress, unmaskedContext, context);
- }
-
- return context;
- }
- }
-
- function hasContextChanged() {
- if (disableLegacyContext) {
- return false;
- } else {
- return didPerformWorkStackCursor.current;
- }
- }
-
- function isContextProvider(type) {
- if (disableLegacyContext) {
- return false;
- } else {
- var childContextTypes = type.childContextTypes;
- return childContextTypes !== null && childContextTypes !== undefined;
- }
- }
-
- function popContext(fiber) {
- if (disableLegacyContext) {
- return;
- } else {
- pop(didPerformWorkStackCursor, fiber);
- pop(contextStackCursor, fiber);
- }
- }
-
- function popTopLevelContextObject(fiber) {
- if (disableLegacyContext) {
- return;
- } else {
- pop(didPerformWorkStackCursor, fiber);
- pop(contextStackCursor, fiber);
- }
- }
-
- function pushTopLevelContextObject(fiber, context, didChange) {
- if (disableLegacyContext) {
- return;
- } else {
- if (!(contextStackCursor.current === emptyContextObject)) {
- {
- throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
-
- push(contextStackCursor, context, fiber);
- push(didPerformWorkStackCursor, didChange, fiber);
- }
- }
-
- function processChildContext(fiber, type, parentContext) {
- if (disableLegacyContext) {
- return parentContext;
- } else {
- var instance = fiber.stateNode;
- var childContextTypes = type.childContextTypes; // TODO (bvaughn) Replace this behavior with an invariant() in the future.
- // It has only been added in Fiber to match the (unintentional) behavior in Stack.
-
- if (typeof instance.getChildContext !== 'function') {
- {
- var componentName = getComponentName(type) || 'Unknown';
-
- if (!warnedAboutMissingGetChildContext[componentName]) {
- warnedAboutMissingGetChildContext[componentName] = true;
- warningWithoutStack$1(false, '%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName);
- }
- }
-
- return parentContext;
- }
-
- var childContext;
-
- {
- setCurrentPhase('getChildContext');
- }
-
- startPhaseTimer(fiber, 'getChildContext');
- childContext = instance.getChildContext();
- stopPhaseTimer();
-
- {
- setCurrentPhase(null);
- }
-
- for (var contextKey in childContext) {
- if (!(contextKey in childContextTypes)) {
- {
- throw Error((getComponentName(type) || 'Unknown') + ".getChildContext(): key \"" + contextKey + "\" is not defined in childContextTypes.");
- }
- }
- }
-
- {
- var name = getComponentName(type) || 'Unknown';
- checkPropTypes(childContextTypes, childContext, 'child context', name, // In practice, there is one case in which we won't get a stack. It's when
- // somebody calls unstable_renderSubtreeIntoContainer() and we process
- // context from the parent component instance. The stack will be missing
- // because it's outside of the reconciliation, and so the pointer has not
- // been set. This is rare and doesn't matter. We'll also remove that API.
- getCurrentFiberStackInDev);
- }
-
- return _assign({}, parentContext, {}, childContext);
- }
- }
-
- function pushContextProvider(workInProgress) {
- if (disableLegacyContext) {
- return false;
- } else {
- var instance = workInProgress.stateNode; // We push the context as early as possible to ensure stack integrity.
- // If the instance does not exist yet, we will push null at first,
- // and replace it on the stack later when invalidating the context.
-
- var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject; // Remember the parent context so we can merge with it later.
- // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.
-
- previousContext = contextStackCursor.current;
- push(contextStackCursor, memoizedMergedChildContext, workInProgress);
- push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);
- return true;
- }
- }
-
- function invalidateContextProvider(workInProgress, type, didChange) {
- if (disableLegacyContext) {
- return;
- } else {
- var instance = workInProgress.stateNode;
-
- if (!instance) {
- {
- throw Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
-
- if (didChange) {
- // Merge parent and own context.
- // Skip this if we're not updating due to sCU.
- // This avoids unnecessarily recomputing memoized values.
- var mergedContext = processChildContext(workInProgress, type, previousContext);
- instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one.
- // It is important to unwind the context in the reverse order.
-
- pop(didPerformWorkStackCursor, workInProgress);
- pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed.
-
- push(contextStackCursor, mergedContext, workInProgress);
- push(didPerformWorkStackCursor, didChange, workInProgress);
- } else {
- pop(didPerformWorkStackCursor, workInProgress);
- push(didPerformWorkStackCursor, didChange, workInProgress);
- }
- }
- }
-
- function findCurrentUnmaskedContext(fiber) {
- if (disableLegacyContext) {
- return emptyContextObject;
- } else {
- // Currently this is only used with renderSubtreeIntoContainer; not sure if it
- // makes sense elsewhere
- if (!(isFiberMounted(fiber) && fiber.tag === ClassComponent)) {
- {
- throw Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
-
- var node = fiber;
-
- do {
- switch (node.tag) {
- case HostRoot:
- return node.stateNode.context;
-
- case ClassComponent:
- {
- var Component = node.type;
-
- if (isContextProvider(Component)) {
- return node.stateNode.__reactInternalMemoizedMergedChildContext;
- }
-
- break;
- }
- }
-
- node = node.return;
- } while (node !== null);
-
- {
- {
- throw Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
- }
- }
-
- var LegacyRoot = 0;
- var BlockingRoot = 1;
- var ConcurrentRoot = 2;
-
- // Intentionally not named imports because Rollup would use dynamic dispatch for
- // CommonJS interop named imports.
- var Scheduler_runWithPriority = Scheduler.unstable_runWithPriority;
- var Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback;
- var Scheduler_cancelCallback = Scheduler.unstable_cancelCallback;
- var Scheduler_shouldYield = Scheduler.unstable_shouldYield;
- var Scheduler_requestPaint = Scheduler.unstable_requestPaint;
- var Scheduler_now = Scheduler.unstable_now;
- var Scheduler_getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel;
- var Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority;
- var Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;
- var Scheduler_NormalPriority = Scheduler.unstable_NormalPriority;
- var Scheduler_LowPriority = Scheduler.unstable_LowPriority;
- var Scheduler_IdlePriority = Scheduler.unstable_IdlePriority;
-
- if (enableSchedulerTracing) {
- // Provide explicit error message when production+profiling bundle of e.g.
- // react-dom is used with production (non-profiling) bundle of
- // scheduler/tracing
- if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {
- {
- throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling");
- }
- }
- }
-
- var fakeCallbackNode = {}; // Except for NoPriority, these correspond to Scheduler priorities. We use
- // ascending numbers so we can compare them like numbers. They start at 90 to
- // avoid clashing with Scheduler's priorities.
-
- var ImmediatePriority = 99;
- var UserBlockingPriority$2 = 98;
- var NormalPriority = 97;
- var LowPriority = 96;
- var IdlePriority = 95; // NoPriority is the absence of priority. Also React-only.
-
- var NoPriority = 90;
- var shouldYield = Scheduler_shouldYield;
- var requestPaint = // Fall back gracefully if we're running an older version of Scheduler.
- Scheduler_requestPaint !== undefined ? Scheduler_requestPaint : function () {};
- var syncQueue = null;
- var immediateQueueCallbackNode = null;
- var isFlushingSyncQueue = false;
- var initialTimeMs = Scheduler_now(); // If the initial timestamp is reasonably small, use Scheduler's `now` directly.
- // This will be the case for modern browsers that support `performance.now`. In
- // older browsers, Scheduler falls back to `Date.now`, which returns a Unix
- // timestamp. In that case, subtract the module initialization time to simulate
- // the behavior of performance.now and keep our times small enough to fit
- // within 32 bits.
- // TODO: Consider lifting this into Scheduler.
-
- var now = initialTimeMs < 10000 ? Scheduler_now : function () {
- return Scheduler_now() - initialTimeMs;
- };
- function getCurrentPriorityLevel() {
- switch (Scheduler_getCurrentPriorityLevel()) {
- case Scheduler_ImmediatePriority:
- return ImmediatePriority;
-
- case Scheduler_UserBlockingPriority:
- return UserBlockingPriority$2;
-
- case Scheduler_NormalPriority:
- return NormalPriority;
-
- case Scheduler_LowPriority:
- return LowPriority;
-
- case Scheduler_IdlePriority:
- return IdlePriority;
-
- default:
- {
- {
- throw Error("Unknown priority level.");
- }
- }
-
- }
- }
-
- function reactPriorityToSchedulerPriority(reactPriorityLevel) {
- switch (reactPriorityLevel) {
- case ImmediatePriority:
- return Scheduler_ImmediatePriority;
-
- case UserBlockingPriority$2:
- return Scheduler_UserBlockingPriority;
-
- case NormalPriority:
- return Scheduler_NormalPriority;
-
- case LowPriority:
- return Scheduler_LowPriority;
-
- case IdlePriority:
- return Scheduler_IdlePriority;
-
- default:
- {
- {
- throw Error("Unknown priority level.");
- }
- }
-
- }
- }
-
- function runWithPriority$2(reactPriorityLevel, fn) {
- var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
- return Scheduler_runWithPriority(priorityLevel, fn);
- }
- function scheduleCallback(reactPriorityLevel, callback, options) {
- var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
- return Scheduler_scheduleCallback(priorityLevel, callback, options);
- }
- function scheduleSyncCallback(callback) {
- // Push this callback into an internal queue. We'll flush these either in
- // the next tick, or earlier if something calls `flushSyncCallbackQueue`.
- if (syncQueue === null) {
- syncQueue = [callback]; // Flush the queue in the next tick, at the earliest.
-
- immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl);
- } else {
- // Push onto existing queue. Don't need to schedule a callback because
- // we already scheduled one when we created the queue.
- syncQueue.push(callback);
- }
-
- return fakeCallbackNode;
- }
- function cancelCallback(callbackNode) {
- if (callbackNode !== fakeCallbackNode) {
- Scheduler_cancelCallback(callbackNode);
- }
- }
- function flushSyncCallbackQueue() {
- if (immediateQueueCallbackNode !== null) {
- var node = immediateQueueCallbackNode;
- immediateQueueCallbackNode = null;
- Scheduler_cancelCallback(node);
- }
-
- flushSyncCallbackQueueImpl();
- }
-
- function flushSyncCallbackQueueImpl() {
- if (!isFlushingSyncQueue && syncQueue !== null) {
- // Prevent re-entrancy.
- isFlushingSyncQueue = true;
- var i = 0;
-
- try {
- var _isSync = true;
- var queue = syncQueue;
- runWithPriority$2(ImmediatePriority, function () {
- for (; i < queue.length; i++) {
- var callback = queue[i];
-
- do {
- callback = callback(_isSync);
- } while (callback !== null);
- }
- });
- syncQueue = null;
- } catch (error) {
- // If something throws, leave the remaining callbacks on the queue.
- if (syncQueue !== null) {
- syncQueue = syncQueue.slice(i + 1);
- } // Resume flushing in the next tick
-
-
- Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue);
- throw error;
- } finally {
- isFlushingSyncQueue = false;
- }
- }
- }
-
- var NoMode = 0;
- var StrictMode = 1; // TODO: Remove BlockingMode and ConcurrentMode by reading from the root
- // tag instead
-
- var BlockingMode = 2;
- var ConcurrentMode = 4;
- var ProfileMode = 8;
-
- // Max 31 bit integer. The max integer size in V8 for 32-bit systems.
- // Math.pow(2, 30) - 1
- // 0b111111111111111111111111111111
- var MAX_SIGNED_31_BIT_INT = 1073741823;
-
- var NoWork = 0; // TODO: Think of a better name for Never. The key difference with Idle is that
- // Never work can be committed in an inconsistent state without tearing the UI.
- // The main example is offscreen content, like a hidden subtree. So one possible
- // name is Offscreen. However, it also includes dehydrated Suspense boundaries,
- // which are inconsistent in the sense that they haven't finished yet, but
- // aren't visibly inconsistent because the server rendered HTML matches what the
- // hydrated tree would look like.
-
- var Never = 1; // Idle is slightly higher priority than Never. It must completely finish in
- // order to be consistent.
-
- var Idle = 2; // Continuous Hydration is a moving priority. It is slightly higher than Idle
- // and is used to increase priority of hover targets. It is increasing with
- // each usage so that last always wins.
-
- var ContinuousHydration = 3;
- var Sync = MAX_SIGNED_31_BIT_INT;
- var Batched = Sync - 1;
- var UNIT_SIZE = 10;
- var MAGIC_NUMBER_OFFSET = Batched - 1; // 1 unit of expiration time represents 10ms.
-
- function msToExpirationTime(ms) {
- // Always add an offset so that we don't clash with the magic number for NoWork.
- return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);
- }
- function expirationTimeToMs(expirationTime) {
- return (MAGIC_NUMBER_OFFSET - expirationTime) * UNIT_SIZE;
- }
-
- function ceiling(num, precision) {
- return ((num / precision | 0) + 1) * precision;
- }
-
- function computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) {
- return MAGIC_NUMBER_OFFSET - ceiling(MAGIC_NUMBER_OFFSET - currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE);
- } // TODO: This corresponds to Scheduler's NormalPriority, not LowPriority. Update
- // the names to reflect.
-
-
- var LOW_PRIORITY_EXPIRATION = 5000;
- var LOW_PRIORITY_BATCH_SIZE = 250;
- function computeAsyncExpiration(currentTime) {
- return computeExpirationBucket(currentTime, LOW_PRIORITY_EXPIRATION, LOW_PRIORITY_BATCH_SIZE);
- }
- function computeSuspenseExpiration(currentTime, timeoutMs) {
- // TODO: Should we warn if timeoutMs is lower than the normal pri expiration time?
- return computeExpirationBucket(currentTime, timeoutMs, LOW_PRIORITY_BATCH_SIZE);
- } // We intentionally set a higher expiration time for interactive updates in
- // dev than in production.
- //
- // If the main thread is being blocked so long that you hit the expiration,
- // it's a problem that could be solved with better scheduling.
- //
- // People will be more likely to notice this and fix it with the long
- // expiration time in development.
- //
- // In production we opt for better UX at the risk of masking scheduling
- // problems, by expiring fast.
-
- var HIGH_PRIORITY_EXPIRATION = 500;
- var HIGH_PRIORITY_BATCH_SIZE = 100;
- function computeInteractiveExpiration(currentTime) {
- return computeExpirationBucket(currentTime, HIGH_PRIORITY_EXPIRATION, HIGH_PRIORITY_BATCH_SIZE);
- }
- function computeContinuousHydrationExpiration(currentTime) {
- // Each time we ask for a new one of these we increase the priority.
- // This ensures that the last one always wins since we can't deprioritize
- // once we've scheduled work already.
- return ContinuousHydration++;
- }
- function inferPriorityFromExpirationTime(currentTime, expirationTime) {
- if (expirationTime === Sync) {
- return ImmediatePriority;
- }
-
- if (expirationTime === Never || expirationTime === Idle) {
- return IdlePriority;
- }
-
- var msUntil = expirationTimeToMs(expirationTime) - expirationTimeToMs(currentTime);
-
- if (msUntil <= 0) {
- return ImmediatePriority;
- }
-
- if (msUntil <= HIGH_PRIORITY_EXPIRATION + HIGH_PRIORITY_BATCH_SIZE) {
- return UserBlockingPriority$2;
- }
-
- if (msUntil <= LOW_PRIORITY_EXPIRATION + LOW_PRIORITY_BATCH_SIZE) {
- return NormalPriority;
- } // TODO: Handle LowPriority
- // Assume anything lower has idle priority
-
-
- return IdlePriority;
- }
-
- /**
- * Forked from fbjs/warning:
- * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
- *
- * Only change is we use console.warn instead of console.error,
- * and do nothing when 'console' is not supported.
- * This really simplifies the code.
- * ---
- * Similar to invariant but only logs a warning if the condition is not met.
- * This can be used to log issues in development environments in critical
- * paths. Removing the logging code for production environments will keep the
- * same logic and follow the same code paths.
- */
- var lowPriorityWarningWithoutStack = function () {};
-
- {
- var printWarning = function (format) {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- var argIndex = 0;
- var message = 'Warning: ' + format.replace(/%s/g, function () {
- return args[argIndex++];
- });
-
- if (typeof console !== 'undefined') {
- console.warn(message);
- }
-
- try {
- // --- Welcome to debugging React ---
- // This error was thrown as a convenience so that you can use this stack
- // to find the callsite that caused this warning to fire.
- throw new Error(message);
- } catch (x) {}
- };
-
- lowPriorityWarningWithoutStack = function (condition, format) {
- if (format === undefined) {
- throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
- }
-
- if (!condition) {
- for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
- args[_key2 - 2] = arguments[_key2];
- }
-
- printWarning.apply(void 0, [format].concat(args));
- }
- };
- }
-
- var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
-
- var ReactStrictModeWarnings = {
- recordUnsafeLifecycleWarnings: function (fiber, instance) {},
- flushPendingUnsafeLifecycleWarnings: function () {},
- recordLegacyContextWarning: function (fiber, instance) {},
- flushLegacyContextWarning: function () {},
- discardPendingWarnings: function () {}
- };
-
- {
- var findStrictRoot = function (fiber) {
- var maybeStrictRoot = null;
- var node = fiber;
-
- while (node !== null) {
- if (node.mode & StrictMode) {
- maybeStrictRoot = node;
- }
-
- node = node.return;
- }
-
- return maybeStrictRoot;
- };
-
- var setToSortedString = function (set) {
- var array = [];
- set.forEach(function (value) {
- array.push(value);
- });
- return array.sort().join(', ');
- };
-
- var pendingComponentWillMountWarnings = [];
- var pendingUNSAFE_ComponentWillMountWarnings = [];
- var pendingComponentWillReceivePropsWarnings = [];
- var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
- var pendingComponentWillUpdateWarnings = [];
- var pendingUNSAFE_ComponentWillUpdateWarnings = []; // Tracks components we have already warned about.
-
- var didWarnAboutUnsafeLifecycles = new Set();
-
- ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) {
- // Dedup strategy: Warn once per component.
- if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
- return;
- }
-
- if (typeof instance.componentWillMount === 'function' && // Don't warn about react-lifecycles-compat polyfilled components.
- instance.componentWillMount.__suppressDeprecationWarning !== true) {
- pendingComponentWillMountWarnings.push(fiber);
- }
-
- if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillMount === 'function') {
- pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
- }
-
- if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
- pendingComponentWillReceivePropsWarnings.push(fiber);
- }
-
- if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
- pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
- }
-
- if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
- pendingComponentWillUpdateWarnings.push(fiber);
- }
-
- if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillUpdate === 'function') {
- pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);
- }
- };
-
- ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () {
- // We do an initial pass to gather component names
- var componentWillMountUniqueNames = new Set();
-
- if (pendingComponentWillMountWarnings.length > 0) {
- pendingComponentWillMountWarnings.forEach(function (fiber) {
- componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');
- didWarnAboutUnsafeLifecycles.add(fiber.type);
- });
- pendingComponentWillMountWarnings = [];
- }
-
- var UNSAFE_componentWillMountUniqueNames = new Set();
-
- if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {
- pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) {
- UNSAFE_componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');
- didWarnAboutUnsafeLifecycles.add(fiber.type);
- });
- pendingUNSAFE_ComponentWillMountWarnings = [];
- }
-
- var componentWillReceivePropsUniqueNames = new Set();
-
- if (pendingComponentWillReceivePropsWarnings.length > 0) {
- pendingComponentWillReceivePropsWarnings.forEach(function (fiber) {
- componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');
- didWarnAboutUnsafeLifecycles.add(fiber.type);
- });
- pendingComponentWillReceivePropsWarnings = [];
- }
-
- var UNSAFE_componentWillReceivePropsUniqueNames = new Set();
-
- if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
- pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) {
- UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');
- didWarnAboutUnsafeLifecycles.add(fiber.type);
- });
- pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
- }
-
- var componentWillUpdateUniqueNames = new Set();
-
- if (pendingComponentWillUpdateWarnings.length > 0) {
- pendingComponentWillUpdateWarnings.forEach(function (fiber) {
- componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');
- didWarnAboutUnsafeLifecycles.add(fiber.type);
- });
- pendingComponentWillUpdateWarnings = [];
- }
-
- var UNSAFE_componentWillUpdateUniqueNames = new Set();
-
- if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {
- pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) {
- UNSAFE_componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');
- didWarnAboutUnsafeLifecycles.add(fiber.type);
- });
- pendingUNSAFE_ComponentWillUpdateWarnings = [];
- } // Finally, we flush all the warnings
- // UNSAFE_ ones before the deprecated ones, since they'll be 'louder'
-
-
- if (UNSAFE_componentWillMountUniqueNames.size > 0) {
- var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);
- warningWithoutStack$1(false, 'Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '\nPlease update the following components: %s', sortedNames);
- }
-
- if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {
- var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);
-
- warningWithoutStack$1(false, 'Using UNSAFE_componentWillReceiveProps in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, " + 'refactor your code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\n' + '\nPlease update the following components: %s', _sortedNames);
- }
-
- if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {
- var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);
-
- warningWithoutStack$1(false, 'Using UNSAFE_componentWillUpdate in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '\nPlease update the following components: %s', _sortedNames2);
- }
-
- if (componentWillMountUniqueNames.size > 0) {
- var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);
-
- lowPriorityWarningWithoutStack$1(false, 'componentWillMount has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames3);
- }
-
- if (componentWillReceivePropsUniqueNames.size > 0) {
- var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);
-
- lowPriorityWarningWithoutStack$1(false, 'componentWillReceiveProps has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, refactor your " + 'code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\n' + '* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames4);
- }
-
- if (componentWillUpdateUniqueNames.size > 0) {
- var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);
-
- lowPriorityWarningWithoutStack$1(false, 'componentWillUpdate has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames5);
- }
- };
-
- var pendingLegacyContextWarning = new Map(); // Tracks components we have already warned about.
-
- var didWarnAboutLegacyContext = new Set();
-
- ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) {
- var strictRoot = findStrictRoot(fiber);
-
- if (strictRoot === null) {
- warningWithoutStack$1(false, 'Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.');
- return;
- } // Dedup strategy: Warn once per component.
-
-
- if (didWarnAboutLegacyContext.has(fiber.type)) {
- return;
- }
-
- var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);
-
- if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') {
- if (warningsForRoot === undefined) {
- warningsForRoot = [];
- pendingLegacyContextWarning.set(strictRoot, warningsForRoot);
- }
-
- warningsForRoot.push(fiber);
- }
- };
-
- ReactStrictModeWarnings.flushLegacyContextWarning = function () {
- pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) {
- var uniqueNames = new Set();
- fiberArray.forEach(function (fiber) {
- uniqueNames.add(getComponentName(fiber.type) || 'Component');
- didWarnAboutLegacyContext.add(fiber.type);
- });
- var sortedNames = setToSortedString(uniqueNames);
- var strictRootComponentStack = getStackByFiberInDevAndProd(strictRoot);
- warningWithoutStack$1(false, 'Legacy context API has been detected within a strict-mode tree.' + '\n\nThe old API will be supported in all 16.x releases, but applications ' + 'using it should migrate to the new version.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here: https://fb.me/react-legacy-context' + '%s', sortedNames, strictRootComponentStack);
- });
- };
-
- ReactStrictModeWarnings.discardPendingWarnings = function () {
- pendingComponentWillMountWarnings = [];
- pendingUNSAFE_ComponentWillMountWarnings = [];
- pendingComponentWillReceivePropsWarnings = [];
- pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
- pendingComponentWillUpdateWarnings = [];
- pendingUNSAFE_ComponentWillUpdateWarnings = [];
- pendingLegacyContextWarning = new Map();
- };
- }
-
- var resolveFamily = null; // $FlowFixMe Flow gets confused by a WeakSet feature check below.
-
- var failedBoundaries = null;
- var setRefreshHandler = function (handler) {
- {
- resolveFamily = handler;
- }
- };
- function resolveFunctionForHotReloading(type) {
- {
- if (resolveFamily === null) {
- // Hot reloading is disabled.
- return type;
- }
-
- var family = resolveFamily(type);
-
- if (family === undefined) {
- return type;
- } // Use the latest known implementation.
-
-
- return family.current;
- }
- }
- function resolveClassForHotReloading(type) {
- // No implementation differences.
- return resolveFunctionForHotReloading(type);
- }
- function resolveForwardRefForHotReloading(type) {
- {
- if (resolveFamily === null) {
- // Hot reloading is disabled.
- return type;
- }
-
- var family = resolveFamily(type);
-
- if (family === undefined) {
- // Check if we're dealing with a real forwardRef. Don't want to crash early.
- if (type !== null && type !== undefined && typeof type.render === 'function') {
- // ForwardRef is special because its resolved .type is an object,
- // but it's possible that we only have its inner render function in the map.
- // If that inner render function is different, we'll build a new forwardRef type.
- var currentRender = resolveFunctionForHotReloading(type.render);
-
- if (type.render !== currentRender) {
- var syntheticType = {
- $$typeof: REACT_FORWARD_REF_TYPE,
- render: currentRender
- };
-
- if (type.displayName !== undefined) {
- syntheticType.displayName = type.displayName;
- }
-
- return syntheticType;
- }
- }
-
- return type;
- } // Use the latest known implementation.
-
-
- return family.current;
- }
- }
- function isCompatibleFamilyForHotReloading(fiber, element) {
- {
- if (resolveFamily === null) {
- // Hot reloading is disabled.
- return false;
- }
-
- var prevType = fiber.elementType;
- var nextType = element.type; // If we got here, we know types aren't === equal.
-
- var needsCompareFamilies = false;
- var $$typeofNextType = typeof nextType === 'object' && nextType !== null ? nextType.$$typeof : null;
-
- switch (fiber.tag) {
- case ClassComponent:
- {
- if (typeof nextType === 'function') {
- needsCompareFamilies = true;
- }
-
- break;
- }
-
- case FunctionComponent:
- {
- if (typeof nextType === 'function') {
- needsCompareFamilies = true;
- } else if ($$typeofNextType === REACT_LAZY_TYPE) {
- // We don't know the inner type yet.
- // We're going to assume that the lazy inner type is stable,
- // and so it is sufficient to avoid reconciling it away.
- // We're not going to unwrap or actually use the new lazy type.
- needsCompareFamilies = true;
- }
-
- break;
- }
-
- case ForwardRef:
- {
- if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {
- needsCompareFamilies = true;
- } else if ($$typeofNextType === REACT_LAZY_TYPE) {
- needsCompareFamilies = true;
- }
-
- break;
- }
-
- case MemoComponent:
- case SimpleMemoComponent:
- {
- if ($$typeofNextType === REACT_MEMO_TYPE) {
- // TODO: if it was but can no longer be simple,
- // we shouldn't set this.
- needsCompareFamilies = true;
- } else if ($$typeofNextType === REACT_LAZY_TYPE) {
- needsCompareFamilies = true;
- }
-
- break;
- }
-
- default:
- return false;
- } // Check if both types have a family and it's the same one.
-
-
- if (needsCompareFamilies) {
- // Note: memo() and forwardRef() we'll compare outer rather than inner type.
- // This means both of them need to be registered to preserve state.
- // If we unwrapped and compared the inner types for wrappers instead,
- // then we would risk falsely saying two separate memo(Foo)
- // calls are equivalent because they wrap the same Foo function.
- var prevFamily = resolveFamily(prevType);
-
- if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) {
- return true;
- }
- }
-
- return false;
- }
- }
- function markFailedErrorBoundaryForHotReloading(fiber) {
- {
- if (resolveFamily === null) {
- // Hot reloading is disabled.
- return;
- }
-
- if (typeof WeakSet !== 'function') {
- return;
- }
-
- if (failedBoundaries === null) {
- failedBoundaries = new WeakSet();
- }
-
- failedBoundaries.add(fiber);
- }
- }
- var scheduleRefresh = function (root, update) {
- {
- if (resolveFamily === null) {
- // Hot reloading is disabled.
- return;
- }
-
- var staleFamilies = update.staleFamilies,
- updatedFamilies = update.updatedFamilies;
- flushPassiveEffects();
- flushSync(function () {
- scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies);
- });
- }
- };
- var scheduleRoot = function (root, element) {
- {
- if (root.context !== emptyContextObject) {
- // Super edge case: root has a legacy _renderSubtree context
- // but we don't know the parentComponent so we can't pass it.
- // Just ignore. We'll delete this with _renderSubtree code path later.
- return;
- }
-
- flushPassiveEffects();
- syncUpdates(function () {
- updateContainer(element, root, null, null);
- });
- }
- };
-
- function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {
- {
- var alternate = fiber.alternate,
- child = fiber.child,
- sibling = fiber.sibling,
- tag = fiber.tag,
- type = fiber.type;
- var candidateType = null;
-
- switch (tag) {
- case FunctionComponent:
- case SimpleMemoComponent:
- case ClassComponent:
- candidateType = type;
- break;
-
- case ForwardRef:
- candidateType = type.render;
- break;
-
- default:
- break;
- }
-
- if (resolveFamily === null) {
- throw new Error('Expected resolveFamily to be set during hot reload.');
- }
-
- var needsRender = false;
- var needsRemount = false;
-
- if (candidateType !== null) {
- var family = resolveFamily(candidateType);
-
- if (family !== undefined) {
- if (staleFamilies.has(family)) {
- needsRemount = true;
- } else if (updatedFamilies.has(family)) {
- if (tag === ClassComponent) {
- needsRemount = true;
- } else {
- needsRender = true;
- }
- }
- }
- }
-
- if (failedBoundaries !== null) {
- if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {
- needsRemount = true;
- }
- }
-
- if (needsRemount) {
- fiber._debugNeedsRemount = true;
- }
-
- if (needsRemount || needsRender) {
- scheduleWork(fiber, Sync);
- }
-
- if (child !== null && !needsRemount) {
- scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
- }
-
- if (sibling !== null) {
- scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
- }
- }
- }
-
- var findHostInstancesForRefresh = function (root, families) {
- {
- var hostInstances = new Set();
- var types = new Set(families.map(function (family) {
- return family.current;
- }));
- findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances);
- return hostInstances;
- }
- };
-
- function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {
- {
- var child = fiber.child,
- sibling = fiber.sibling,
- tag = fiber.tag,
- type = fiber.type;
- var candidateType = null;
-
- switch (tag) {
- case FunctionComponent:
- case SimpleMemoComponent:
- case ClassComponent:
- candidateType = type;
- break;
-
- case ForwardRef:
- candidateType = type.render;
- break;
-
- default:
- break;
- }
-
- var didMatch = false;
-
- if (candidateType !== null) {
- if (types.has(candidateType)) {
- didMatch = true;
- }
- }
-
- if (didMatch) {
- // We have a match. This only drills down to the closest host components.
- // There's no need to search deeper because for the purpose of giving
- // visual feedback, "flashing" outermost parent rectangles is sufficient.
- findHostInstancesForFiberShallowly(fiber, hostInstances);
- } else {
- // If there's no match, maybe there will be one further down in the child tree.
- if (child !== null) {
- findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);
- }
- }
-
- if (sibling !== null) {
- findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);
- }
- }
- }
-
- function findHostInstancesForFiberShallowly(fiber, hostInstances) {
- {
- var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);
-
- if (foundHostInstances) {
- return;
- } // If we didn't find any host children, fallback to closest host parent.
-
-
- var node = fiber;
-
- while (true) {
- switch (node.tag) {
- case HostComponent:
- hostInstances.add(node.stateNode);
- return;
-
- case HostPortal:
- hostInstances.add(node.stateNode.containerInfo);
- return;
-
- case HostRoot:
- hostInstances.add(node.stateNode.containerInfo);
- return;
- }
-
- if (node.return === null) {
- throw new Error('Expected to reach root first.');
- }
-
- node = node.return;
- }
- }
- }
-
- function findChildHostInstancesForFiberShallowly(fiber, hostInstances) {
- {
- var node = fiber;
- var foundHostInstances = false;
-
- while (true) {
- if (node.tag === HostComponent) {
- // We got a match.
- foundHostInstances = true;
- hostInstances.add(node.stateNode); // There may still be more, so keep searching.
- } else if (node.child !== null) {
- node.child.return = node;
- node = node.child;
- continue;
- }
-
- if (node === fiber) {
- return foundHostInstances;
- }
-
- while (node.sibling === null) {
- if (node.return === null || node.return === fiber) {
- return foundHostInstances;
- }
-
- node = node.return;
- }
-
- node.sibling.return = node.return;
- node = node.sibling;
- }
- }
-
- return false;
- }
-
- function resolveDefaultProps(Component, baseProps) {
- if (Component && Component.defaultProps) {
- // Resolve default props. Taken from ReactElement
- var props = _assign({}, baseProps);
-
- var defaultProps = Component.defaultProps;
-
- for (var propName in defaultProps) {
- if (props[propName] === undefined) {
- props[propName] = defaultProps[propName];
- }
- }
-
- return props;
- }
-
- return baseProps;
- }
- function readLazyComponentType(lazyComponent) {
- initializeLazyComponentType(lazyComponent);
-
- if (lazyComponent._status !== Resolved) {
- throw lazyComponent._result;
- }
-
- return lazyComponent._result;
- }
-
- var valueCursor = createCursor(null);
- var rendererSigil;
-
- {
- // Use this to detect multiple renderers using the same context
- rendererSigil = {};
- }
-
- var currentlyRenderingFiber = null;
- var lastContextDependency = null;
- var lastContextWithAllBitsObserved = null;
- var isDisallowedContextReadInDEV = false;
- function resetContextDependencies() {
- // This is called right before React yields execution, to ensure `readContext`
- // cannot be called outside the render phase.
- currentlyRenderingFiber = null;
- lastContextDependency = null;
- lastContextWithAllBitsObserved = null;
-
- {
- isDisallowedContextReadInDEV = false;
- }
- }
- function enterDisallowedContextReadInDEV() {
- {
- isDisallowedContextReadInDEV = true;
- }
- }
- function exitDisallowedContextReadInDEV() {
- {
- isDisallowedContextReadInDEV = false;
- }
- }
- function pushProvider(providerFiber, nextValue) {
- var context = providerFiber.type._context;
-
- if (isPrimaryRenderer) {
- push(valueCursor, context._currentValue, providerFiber);
- context._currentValue = nextValue;
-
- {
- !(context._currentRenderer === undefined || context._currentRenderer === null || context._currentRenderer === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0;
- context._currentRenderer = rendererSigil;
- }
- } else {
- push(valueCursor, context._currentValue2, providerFiber);
- context._currentValue2 = nextValue;
-
- {
- !(context._currentRenderer2 === undefined || context._currentRenderer2 === null || context._currentRenderer2 === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0;
- context._currentRenderer2 = rendererSigil;
- }
- }
- }
- function popProvider(providerFiber) {
- var currentValue = valueCursor.current;
- pop(valueCursor, providerFiber);
- var context = providerFiber.type._context;
-
- if (isPrimaryRenderer) {
- context._currentValue = currentValue;
- } else {
- context._currentValue2 = currentValue;
- }
- }
- function calculateChangedBits(context, newValue, oldValue) {
- if (is$1(oldValue, newValue)) {
- // No change
- return 0;
- } else {
- var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
-
- {
- !((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits) ? warning$1(false, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits) : void 0;
- }
-
- return changedBits | 0;
- }
- }
- function scheduleWorkOnParentPath(parent, renderExpirationTime) {
- // Update the child expiration time of all the ancestors, including
- // the alternates.
- var node = parent;
-
- while (node !== null) {
- var alternate = node.alternate;
-
- if (node.childExpirationTime < renderExpirationTime) {
- node.childExpirationTime = renderExpirationTime;
-
- if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {
- alternate.childExpirationTime = renderExpirationTime;
- }
- } else if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {
- alternate.childExpirationTime = renderExpirationTime;
- } else {
- // Neither alternate was updated, which means the rest of the
- // ancestor path already has sufficient priority.
- break;
- }
-
- node = node.return;
- }
- }
- function propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) {
- var fiber = workInProgress.child;
-
- if (fiber !== null) {
- // Set the return pointer of the child to the work-in-progress fiber.
- fiber.return = workInProgress;
- }
-
- while (fiber !== null) {
- var nextFiber = void 0; // Visit this fiber.
-
- var list = fiber.dependencies;
-
- if (list !== null) {
- nextFiber = fiber.child;
- var dependency = list.firstContext;
-
- while (dependency !== null) {
- // Check if the context matches.
- if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) {
- // Match! Schedule an update on this fiber.
- if (fiber.tag === ClassComponent) {
- // Schedule a force update on the work-in-progress.
- var update = createUpdate(renderExpirationTime, null);
- update.tag = ForceUpdate; // TODO: Because we don't have a work-in-progress, this will add the
- // update to the current fiber, too, which means it will persist even if
- // this render is thrown away. Since it's a race condition, not sure it's
- // worth fixing.
-
- enqueueUpdate(fiber, update);
- }
-
- if (fiber.expirationTime < renderExpirationTime) {
- fiber.expirationTime = renderExpirationTime;
- }
-
- var alternate = fiber.alternate;
-
- if (alternate !== null && alternate.expirationTime < renderExpirationTime) {
- alternate.expirationTime = renderExpirationTime;
- }
-
- scheduleWorkOnParentPath(fiber.return, renderExpirationTime); // Mark the expiration time on the list, too.
-
- if (list.expirationTime < renderExpirationTime) {
- list.expirationTime = renderExpirationTime;
- } // Since we already found a match, we can stop traversing the
- // dependency list.
-
-
- break;
- }
-
- dependency = dependency.next;
- }
- } else if (fiber.tag === ContextProvider) {
- // Don't scan deeper if this is a matching provider
- nextFiber = fiber.type === workInProgress.type ? null : fiber.child;
- } else if (enableSuspenseServerRenderer && fiber.tag === DehydratedFragment) {
- // If a dehydrated suspense bounudary is in this subtree, we don't know
- // if it will have any context consumers in it. The best we can do is
- // mark it as having updates.
- var parentSuspense = fiber.return;
-
- if (!(parentSuspense !== null)) {
- {
- throw Error("We just came from a parent so we must have had a parent. This is a bug in React.");
- }
- }
-
- if (parentSuspense.expirationTime < renderExpirationTime) {
- parentSuspense.expirationTime = renderExpirationTime;
- }
-
- var _alternate = parentSuspense.alternate;
-
- if (_alternate !== null && _alternate.expirationTime < renderExpirationTime) {
- _alternate.expirationTime = renderExpirationTime;
- } // This is intentionally passing this fiber as the parent
- // because we want to schedule this fiber as having work
- // on its children. We'll use the childExpirationTime on
- // this fiber to indicate that a context has changed.
-
-
- scheduleWorkOnParentPath(parentSuspense, renderExpirationTime);
- nextFiber = fiber.sibling;
- } else {
- // Traverse down.
- nextFiber = fiber.child;
- }
-
- if (nextFiber !== null) {
- // Set the return pointer of the child to the work-in-progress fiber.
- nextFiber.return = fiber;
- } else {
- // No child. Traverse to next sibling.
- nextFiber = fiber;
-
- while (nextFiber !== null) {
- if (nextFiber === workInProgress) {
- // We're back to the root of this subtree. Exit.
- nextFiber = null;
- break;
- }
-
- var sibling = nextFiber.sibling;
-
- if (sibling !== null) {
- // Set the return pointer of the sibling to the work-in-progress fiber.
- sibling.return = nextFiber.return;
- nextFiber = sibling;
- break;
- } // No more siblings. Traverse up.
-
-
- nextFiber = nextFiber.return;
- }
- }
-
- fiber = nextFiber;
- }
- }
- function prepareToReadContext(workInProgress, renderExpirationTime) {
- currentlyRenderingFiber = workInProgress;
- lastContextDependency = null;
- lastContextWithAllBitsObserved = null;
- var dependencies = workInProgress.dependencies;
-
- if (dependencies !== null) {
- var firstContext = dependencies.firstContext;
-
- if (firstContext !== null) {
- if (dependencies.expirationTime >= renderExpirationTime) {
- // Context list has a pending update. Mark that this fiber performed work.
- markWorkInProgressReceivedUpdate();
- } // Reset the work-in-progress list
-
-
- dependencies.firstContext = null;
- }
- }
- }
- function readContext(context, observedBits) {
- {
- // This warning would fire if you read context inside a Hook like useMemo.
- // Unlike the class check below, it's not enforced in production for perf.
- !!isDisallowedContextReadInDEV ? warning$1(false, 'Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().') : void 0;
- }
-
- if (lastContextWithAllBitsObserved === context) {// Nothing to do. We already observe everything in this context.
- } else if (observedBits === false || observedBits === 0) {// Do not observe any updates.
- } else {
- var resolvedObservedBits; // Avoid deopting on observable arguments or heterogeneous types.
-
- if (typeof observedBits !== 'number' || observedBits === MAX_SIGNED_31_BIT_INT) {
- // Observe all updates.
- lastContextWithAllBitsObserved = context;
- resolvedObservedBits = MAX_SIGNED_31_BIT_INT;
- } else {
- resolvedObservedBits = observedBits;
- }
-
- var contextItem = {
- context: context,
- observedBits: resolvedObservedBits,
- next: null
- };
-
- if (lastContextDependency === null) {
- if (!(currentlyRenderingFiber !== null)) {
- {
- throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
- }
- } // This is the first dependency for this component. Create a new list.
-
-
- lastContextDependency = contextItem;
- currentlyRenderingFiber.dependencies = {
- expirationTime: NoWork,
- firstContext: contextItem,
- responders: null
- };
- } else {
- // Append a new context item.
- lastContextDependency = lastContextDependency.next = contextItem;
- }
- }
-
- return isPrimaryRenderer ? context._currentValue : context._currentValue2;
- }
-
- // UpdateQueue is a linked list of prioritized updates.
- //
- // Like fibers, update queues come in pairs: a current queue, which represents
- // the visible state of the screen, and a work-in-progress queue, which can be
- // mutated and processed asynchronously before it is committed — a form of
- // double buffering. If a work-in-progress render is discarded before finishing,
- // we create a new work-in-progress by cloning the current queue.
- //
- // Both queues share a persistent, singly-linked list structure. To schedule an
- // update, we append it to the end of both queues. Each queue maintains a
- // pointer to first update in the persistent list that hasn't been processed.
- // The work-in-progress pointer always has a position equal to or greater than
- // the current queue, since we always work on that one. The current queue's
- // pointer is only updated during the commit phase, when we swap in the
- // work-in-progress.
- //
- // For example:
- //
- // Current pointer: A - B - C - D - E - F
- // Work-in-progress pointer: D - E - F
- // ^
- // The work-in-progress queue has
- // processed more updates than current.
- //
- // The reason we append to both queues is because otherwise we might drop
- // updates without ever processing them. For example, if we only add updates to
- // the work-in-progress queue, some updates could be lost whenever a work-in
- // -progress render restarts by cloning from current. Similarly, if we only add
- // updates to the current queue, the updates will be lost whenever an already
- // in-progress queue commits and swaps with the current queue. However, by
- // adding to both queues, we guarantee that the update will be part of the next
- // work-in-progress. (And because the work-in-progress queue becomes the
- // current queue once it commits, there's no danger of applying the same
- // update twice.)
- //
- // Prioritization
- // --------------
- //
- // Updates are not sorted by priority, but by insertion; new updates are always
- // appended to the end of the list.
- //
- // The priority is still important, though. When processing the update queue
- // during the render phase, only the updates with sufficient priority are
- // included in the result. If we skip an update because it has insufficient
- // priority, it remains in the queue to be processed later, during a lower
- // priority render. Crucially, all updates subsequent to a skipped update also
- // remain in the queue *regardless of their priority*. That means high priority
- // updates are sometimes processed twice, at two separate priorities. We also
- // keep track of a base state, that represents the state before the first
- // update in the queue is applied.
- //
- // For example:
- //
- // Given a base state of '', and the following queue of updates
- //
- // A1 - B2 - C1 - D2
- //
- // where the number indicates the priority, and the update is applied to the
- // previous state by appending a letter, React will process these updates as
- // two separate renders, one per distinct priority level:
- //
- // First render, at priority 1:
- // Base state: ''
- // Updates: [A1, C1]
- // Result state: 'AC'
- //
- // Second render, at priority 2:
- // Base state: 'A' <- The base state does not include C1,
- // because B2 was skipped.
- // Updates: [B2, C1, D2] <- C1 was rebased on top of B2
- // Result state: 'ABCD'
- //
- // Because we process updates in insertion order, and rebase high priority
- // updates when preceding updates are skipped, the final result is deterministic
- // regardless of priority. Intermediate state may vary according to system
- // resources, but the final state is always the same.
- var UpdateState = 0;
- var ReplaceState = 1;
- var ForceUpdate = 2;
- var CaptureUpdate = 3; // Global state that is reset at the beginning of calling `processUpdateQueue`.
- // It should only be read right after calling `processUpdateQueue`, via
- // `checkHasForceUpdateAfterProcessing`.
-
- var hasForceUpdate = false;
- var didWarnUpdateInsideUpdate;
- var currentlyProcessingQueue;
-
-
- {
- didWarnUpdateInsideUpdate = false;
- currentlyProcessingQueue = null;
-
-
- }
-
- function createUpdateQueue(baseState) {
- var queue = {
- baseState: baseState,
- firstUpdate: null,
- lastUpdate: null,
- firstCapturedUpdate: null,
- lastCapturedUpdate: null,
- firstEffect: null,
- lastEffect: null,
- firstCapturedEffect: null,
- lastCapturedEffect: null
- };
- return queue;
- }
-
- function cloneUpdateQueue(currentQueue) {
- var queue = {
- baseState: currentQueue.baseState,
- firstUpdate: currentQueue.firstUpdate,
- lastUpdate: currentQueue.lastUpdate,
- // TODO: With resuming, if we bail out and resuse the child tree, we should
- // keep these effects.
- firstCapturedUpdate: null,
- lastCapturedUpdate: null,
- firstEffect: null,
- lastEffect: null,
- firstCapturedEffect: null,
- lastCapturedEffect: null
- };
- return queue;
- }
-
- function createUpdate(expirationTime, suspenseConfig) {
- var update = {
- expirationTime: expirationTime,
- suspenseConfig: suspenseConfig,
- tag: UpdateState,
- payload: null,
- callback: null,
- next: null,
- nextEffect: null
- };
-
- {
- update.priority = getCurrentPriorityLevel();
- }
-
- return update;
- }
-
- function appendUpdateToQueue(queue, update) {
- // Append the update to the end of the list.
- if (queue.lastUpdate === null) {
- // Queue is empty
- queue.firstUpdate = queue.lastUpdate = update;
- } else {
- queue.lastUpdate.next = update;
- queue.lastUpdate = update;
- }
- }
-
- function enqueueUpdate(fiber, update) {
- // Update queues are created lazily.
- var alternate = fiber.alternate;
- var queue1;
- var queue2;
-
- if (alternate === null) {
- // There's only one fiber.
- queue1 = fiber.updateQueue;
- queue2 = null;
-
- if (queue1 === null) {
- queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState);
- }
- } else {
- // There are two owners.
- queue1 = fiber.updateQueue;
- queue2 = alternate.updateQueue;
-
- if (queue1 === null) {
- if (queue2 === null) {
- // Neither fiber has an update queue. Create new ones.
- queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState);
- queue2 = alternate.updateQueue = createUpdateQueue(alternate.memoizedState);
- } else {
- // Only one fiber has an update queue. Clone to create a new one.
- queue1 = fiber.updateQueue = cloneUpdateQueue(queue2);
- }
- } else {
- if (queue2 === null) {
- // Only one fiber has an update queue. Clone to create a new one.
- queue2 = alternate.updateQueue = cloneUpdateQueue(queue1);
- } else {// Both owners have an update queue.
- }
- }
- }
-
- if (queue2 === null || queue1 === queue2) {
- // There's only a single queue.
- appendUpdateToQueue(queue1, update);
- } else {
- // There are two queues. We need to append the update to both queues,
- // while accounting for the persistent structure of the list — we don't
- // want the same update to be added multiple times.
- if (queue1.lastUpdate === null || queue2.lastUpdate === null) {
- // One of the queues is not empty. We must add the update to both queues.
- appendUpdateToQueue(queue1, update);
- appendUpdateToQueue(queue2, update);
- } else {
- // Both queues are non-empty. The last update is the same in both lists,
- // because of structural sharing. So, only append to one of the lists.
- appendUpdateToQueue(queue1, update); // But we still need to update the `lastUpdate` pointer of queue2.
-
- queue2.lastUpdate = update;
- }
- }
-
- {
- if (fiber.tag === ClassComponent && (currentlyProcessingQueue === queue1 || queue2 !== null && currentlyProcessingQueue === queue2) && !didWarnUpdateInsideUpdate) {
- warningWithoutStack$1(false, 'An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.');
- didWarnUpdateInsideUpdate = true;
- }
- }
- }
- function enqueueCapturedUpdate(workInProgress, update) {
- // Captured updates go into a separate list, and only on the work-in-
- // progress queue.
- var workInProgressQueue = workInProgress.updateQueue;
-
- if (workInProgressQueue === null) {
- workInProgressQueue = workInProgress.updateQueue = createUpdateQueue(workInProgress.memoizedState);
- } else {
- // TODO: I put this here rather than createWorkInProgress so that we don't
- // clone the queue unnecessarily. There's probably a better way to
- // structure this.
- workInProgressQueue = ensureWorkInProgressQueueIsAClone(workInProgress, workInProgressQueue);
- } // Append the update to the end of the list.
-
-
- if (workInProgressQueue.lastCapturedUpdate === null) {
- // This is the first render phase update
- workInProgressQueue.firstCapturedUpdate = workInProgressQueue.lastCapturedUpdate = update;
- } else {
- workInProgressQueue.lastCapturedUpdate.next = update;
- workInProgressQueue.lastCapturedUpdate = update;
- }
- }
-
- function ensureWorkInProgressQueueIsAClone(workInProgress, queue) {
- var current = workInProgress.alternate;
-
- if (current !== null) {
- // If the work-in-progress queue is equal to the current queue,
- // we need to clone it first.
- if (queue === current.updateQueue) {
- queue = workInProgress.updateQueue = cloneUpdateQueue(queue);
- }
- }
-
- return queue;
- }
-
- function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) {
- switch (update.tag) {
- case ReplaceState:
- {
- var payload = update.payload;
-
- if (typeof payload === 'function') {
- // Updater function
- {
- enterDisallowedContextReadInDEV();
-
- if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
- payload.call(instance, prevState, nextProps);
- }
- }
-
- var nextState = payload.call(instance, prevState, nextProps);
-
- {
- exitDisallowedContextReadInDEV();
- }
-
- return nextState;
- } // State object
-
-
- return payload;
- }
-
- case CaptureUpdate:
- {
- workInProgress.effectTag = workInProgress.effectTag & ~ShouldCapture | DidCapture;
- }
- // Intentional fallthrough
-
- case UpdateState:
- {
- var _payload = update.payload;
- var partialState;
-
- if (typeof _payload === 'function') {
- // Updater function
- {
- enterDisallowedContextReadInDEV();
-
- if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
- _payload.call(instance, prevState, nextProps);
- }
- }
-
- partialState = _payload.call(instance, prevState, nextProps);
-
- {
- exitDisallowedContextReadInDEV();
- }
- } else {
- // Partial state object
- partialState = _payload;
- }
-
- if (partialState === null || partialState === undefined) {
- // Null and undefined are treated as no-ops.
- return prevState;
- } // Merge the partial state and the previous state.
-
-
- return _assign({}, prevState, partialState);
- }
-
- case ForceUpdate:
- {
- hasForceUpdate = true;
- return prevState;
- }
- }
-
- return prevState;
- }
-
- function processUpdateQueue(workInProgress, queue, props, instance, renderExpirationTime) {
- hasForceUpdate = false;
- queue = ensureWorkInProgressQueueIsAClone(workInProgress, queue);
-
- {
- currentlyProcessingQueue = queue;
- } // These values may change as we process the queue.
-
-
- var newBaseState = queue.baseState;
- var newFirstUpdate = null;
- var newExpirationTime = NoWork; // Iterate through the list of updates to compute the result.
-
- var update = queue.firstUpdate;
- var resultState = newBaseState;
-
- while (update !== null) {
- var updateExpirationTime = update.expirationTime;
-
- if (updateExpirationTime < renderExpirationTime) {
- // This update does not have sufficient priority. Skip it.
- if (newFirstUpdate === null) {
- // This is the first skipped update. It will be the first update in
- // the new list.
- newFirstUpdate = update; // Since this is the first update that was skipped, the current result
- // is the new base state.
-
- newBaseState = resultState;
- } // Since this update will remain in the list, update the remaining
- // expiration time.
-
-
- if (newExpirationTime < updateExpirationTime) {
- newExpirationTime = updateExpirationTime;
- }
- } else {
- // This update does have sufficient priority.
- // Mark the event time of this update as relevant to this render pass.
- // TODO: This should ideally use the true event time of this update rather than
- // its priority which is a derived and not reverseable value.
- // TODO: We should skip this update if it was already committed but currently
- // we have no way of detecting the difference between a committed and suspended
- // update here.
- markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig); // Process it and compute a new result.
-
- resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance);
- var callback = update.callback;
-
- if (callback !== null) {
- workInProgress.effectTag |= Callback; // Set this to null, in case it was mutated during an aborted render.
-
- update.nextEffect = null;
-
- if (queue.lastEffect === null) {
- queue.firstEffect = queue.lastEffect = update;
- } else {
- queue.lastEffect.nextEffect = update;
- queue.lastEffect = update;
- }
- }
- } // Continue to the next update.
-
-
- update = update.next;
- } // Separately, iterate though the list of captured updates.
-
-
- var newFirstCapturedUpdate = null;
- update = queue.firstCapturedUpdate;
-
- while (update !== null) {
- var _updateExpirationTime = update.expirationTime;
-
- if (_updateExpirationTime < renderExpirationTime) {
- // This update does not have sufficient priority. Skip it.
- if (newFirstCapturedUpdate === null) {
- // This is the first skipped captured update. It will be the first
- // update in the new list.
- newFirstCapturedUpdate = update; // If this is the first update that was skipped, the current result is
- // the new base state.
-
- if (newFirstUpdate === null) {
- newBaseState = resultState;
- }
- } // Since this update will remain in the list, update the remaining
- // expiration time.
-
-
- if (newExpirationTime < _updateExpirationTime) {
- newExpirationTime = _updateExpirationTime;
- }
- } else {
- // This update does have sufficient priority. Process it and compute
- // a new result.
- resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance);
- var _callback = update.callback;
-
- if (_callback !== null) {
- workInProgress.effectTag |= Callback; // Set this to null, in case it was mutated during an aborted render.
-
- update.nextEffect = null;
-
- if (queue.lastCapturedEffect === null) {
- queue.firstCapturedEffect = queue.lastCapturedEffect = update;
- } else {
- queue.lastCapturedEffect.nextEffect = update;
- queue.lastCapturedEffect = update;
- }
- }
- }
-
- update = update.next;
- }
-
- if (newFirstUpdate === null) {
- queue.lastUpdate = null;
- }
-
- if (newFirstCapturedUpdate === null) {
- queue.lastCapturedUpdate = null;
- } else {
- workInProgress.effectTag |= Callback;
- }
-
- if (newFirstUpdate === null && newFirstCapturedUpdate === null) {
- // We processed every update, without skipping. That means the new base
- // state is the same as the result state.
- newBaseState = resultState;
- }
-
- queue.baseState = newBaseState;
- queue.firstUpdate = newFirstUpdate;
- queue.firstCapturedUpdate = newFirstCapturedUpdate; // Set the remaining expiration time to be whatever is remaining in the queue.
- // This should be fine because the only two other things that contribute to
- // expiration time are props and context. We're already in the middle of the
- // begin phase by the time we start processing the queue, so we've already
- // dealt with the props. Context in components that specify
- // shouldComponentUpdate is tricky; but we'll have to account for
- // that regardless.
-
- markUnprocessedUpdateTime(newExpirationTime);
- workInProgress.expirationTime = newExpirationTime;
- workInProgress.memoizedState = resultState;
-
- {
- currentlyProcessingQueue = null;
- }
- }
-
- function callCallback(callback, context) {
- if (!(typeof callback === 'function')) {
- {
- throw Error("Invalid argument passed as callback. Expected a function. Instead received: " + callback);
- }
- }
-
- callback.call(context);
- }
-
- function resetHasForceUpdateBeforeProcessing() {
- hasForceUpdate = false;
- }
- function checkHasForceUpdateAfterProcessing() {
- return hasForceUpdate;
- }
- function commitUpdateQueue(finishedWork, finishedQueue, instance, renderExpirationTime) {
- // If the finished render included captured updates, and there are still
- // lower priority updates left over, we need to keep the captured updates
- // in the queue so that they are rebased and not dropped once we process the
- // queue again at the lower priority.
- if (finishedQueue.firstCapturedUpdate !== null) {
- // Join the captured update list to the end of the normal list.
- if (finishedQueue.lastUpdate !== null) {
- finishedQueue.lastUpdate.next = finishedQueue.firstCapturedUpdate;
- finishedQueue.lastUpdate = finishedQueue.lastCapturedUpdate;
- } // Clear the list of captured updates.
-
-
- finishedQueue.firstCapturedUpdate = finishedQueue.lastCapturedUpdate = null;
- } // Commit the effects
-
-
- commitUpdateEffects(finishedQueue.firstEffect, instance);
- finishedQueue.firstEffect = finishedQueue.lastEffect = null;
- commitUpdateEffects(finishedQueue.firstCapturedEffect, instance);
- finishedQueue.firstCapturedEffect = finishedQueue.lastCapturedEffect = null;
- }
-
- function commitUpdateEffects(effect, instance) {
- while (effect !== null) {
- var callback = effect.callback;
-
- if (callback !== null) {
- effect.callback = null;
- callCallback(callback, instance);
- }
-
- effect = effect.nextEffect;
- }
- }
-
- var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
- function requestCurrentSuspenseConfig() {
- return ReactCurrentBatchConfig.suspense;
- }
-
- var fakeInternalInstance = {};
- var isArray$1 = Array.isArray; // React.Component uses a shared frozen object by default.
- // We'll use it to determine whether we need to initialize legacy refs.
-
- var emptyRefsObject = new React.Component().refs;
- var didWarnAboutStateAssignmentForComponent;
- var didWarnAboutUninitializedState;
- var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
- var didWarnAboutLegacyLifecyclesAndDerivedState;
- var didWarnAboutUndefinedDerivedState;
- var warnOnUndefinedDerivedState;
- var warnOnInvalidCallback$1;
- var didWarnAboutDirectlyAssigningPropsToState;
- var didWarnAboutContextTypeAndContextTypes;
- var didWarnAboutInvalidateContextType;
-
- {
- didWarnAboutStateAssignmentForComponent = new Set();
- didWarnAboutUninitializedState = new Set();
- didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();
- didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
- didWarnAboutDirectlyAssigningPropsToState = new Set();
- didWarnAboutUndefinedDerivedState = new Set();
- didWarnAboutContextTypeAndContextTypes = new Set();
- didWarnAboutInvalidateContextType = new Set();
- var didWarnOnInvalidCallback = new Set();
-
- warnOnInvalidCallback$1 = function (callback, callerName) {
- if (callback === null || typeof callback === 'function') {
- return;
- }
-
- var key = callerName + "_" + callback;
-
- if (!didWarnOnInvalidCallback.has(key)) {
- didWarnOnInvalidCallback.add(key);
- warningWithoutStack$1(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);
- }
- };
-
- warnOnUndefinedDerivedState = function (type, partialState) {
- if (partialState === undefined) {
- var componentName = getComponentName(type) || 'Component';
-
- if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
- didWarnAboutUndefinedDerivedState.add(componentName);
- warningWithoutStack$1(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName);
- }
- }
- }; // This is so gross but it's at least non-critical and can be removed if
- // it causes problems. This is meant to give a nicer error message for
- // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component,
- // ...)) which otherwise throws a "_processChildContext is not a function"
- // exception.
-
-
- Object.defineProperty(fakeInternalInstance, '_processChildContext', {
- enumerable: false,
- value: function () {
- {
- {
- throw Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).");
- }
- }
- }
- });
- Object.freeze(fakeInternalInstance);
- }
-
- function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) {
- var prevState = workInProgress.memoizedState;
-
- {
- if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
- // Invoke the function an extra time to help detect side-effects.
- getDerivedStateFromProps(nextProps, prevState);
- }
- }
-
- var partialState = getDerivedStateFromProps(nextProps, prevState);
-
- {
- warnOnUndefinedDerivedState(ctor, partialState);
- } // Merge the partial state and the previous state.
-
-
- var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState);
- workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the
- // base state.
-
- var updateQueue = workInProgress.updateQueue;
-
- if (updateQueue !== null && workInProgress.expirationTime === NoWork) {
- updateQueue.baseState = memoizedState;
- }
- }
- var classComponentUpdater = {
- isMounted: isMounted,
- enqueueSetState: function (inst, payload, callback) {
- var fiber = get(inst);
- var currentTime = requestCurrentTimeForUpdate();
- var suspenseConfig = requestCurrentSuspenseConfig();
- var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
- var update = createUpdate(expirationTime, suspenseConfig);
- update.payload = payload;
-
- if (callback !== undefined && callback !== null) {
- {
- warnOnInvalidCallback$1(callback, 'setState');
- }
-
- update.callback = callback;
- }
-
- enqueueUpdate(fiber, update);
- scheduleWork(fiber, expirationTime);
- },
- enqueueReplaceState: function (inst, payload, callback) {
- var fiber = get(inst);
- var currentTime = requestCurrentTimeForUpdate();
- var suspenseConfig = requestCurrentSuspenseConfig();
- var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
- var update = createUpdate(expirationTime, suspenseConfig);
- update.tag = ReplaceState;
- update.payload = payload;
-
- if (callback !== undefined && callback !== null) {
- {
- warnOnInvalidCallback$1(callback, 'replaceState');
- }
-
- update.callback = callback;
- }
-
- enqueueUpdate(fiber, update);
- scheduleWork(fiber, expirationTime);
- },
- enqueueForceUpdate: function (inst, callback) {
- var fiber = get(inst);
- var currentTime = requestCurrentTimeForUpdate();
- var suspenseConfig = requestCurrentSuspenseConfig();
- var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
- var update = createUpdate(expirationTime, suspenseConfig);
- update.tag = ForceUpdate;
-
- if (callback !== undefined && callback !== null) {
- {
- warnOnInvalidCallback$1(callback, 'forceUpdate');
- }
-
- update.callback = callback;
- }
-
- enqueueUpdate(fiber, update);
- scheduleWork(fiber, expirationTime);
- }
- };
-
- function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) {
- var instance = workInProgress.stateNode;
-
- if (typeof instance.shouldComponentUpdate === 'function') {
- startPhaseTimer(workInProgress, 'shouldComponentUpdate');
- var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
- stopPhaseTimer();
-
- {
- !(shouldUpdate !== undefined) ? warningWithoutStack$1(false, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component') : void 0;
- }
-
- return shouldUpdate;
- }
-
- if (ctor.prototype && ctor.prototype.isPureReactComponent) {
- return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
- }
-
- return true;
- }
-
- function checkClassInstance(workInProgress, ctor, newProps) {
- var instance = workInProgress.stateNode;
-
- {
- var name = getComponentName(ctor) || 'Component';
- var renderPresent = instance.render;
-
- if (!renderPresent) {
- if (ctor.prototype && typeof ctor.prototype.render === 'function') {
- warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name);
- } else {
- warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name);
- }
- }
-
- var noGetInitialStateOnES6 = !instance.getInitialState || instance.getInitialState.isReactClassApproved || instance.state;
- !noGetInitialStateOnES6 ? warningWithoutStack$1(false, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name) : void 0;
- var noGetDefaultPropsOnES6 = !instance.getDefaultProps || instance.getDefaultProps.isReactClassApproved;
- !noGetDefaultPropsOnES6 ? warningWithoutStack$1(false, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name) : void 0;
- var noInstancePropTypes = !instance.propTypes;
- !noInstancePropTypes ? warningWithoutStack$1(false, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name) : void 0;
- var noInstanceContextType = !instance.contextType;
- !noInstanceContextType ? warningWithoutStack$1(false, 'contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name) : void 0;
-
- if (disableLegacyContext) {
- if (ctor.childContextTypes) {
- warningWithoutStack$1(false, '%s uses the legacy childContextTypes API which is no longer supported. ' + 'Use React.createContext() instead.', name);
- }
-
- if (ctor.contextTypes) {
- warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with static contextType instead.', name);
- }
- } else {
- var noInstanceContextTypes = !instance.contextTypes;
- !noInstanceContextTypes ? warningWithoutStack$1(false, 'contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name) : void 0;
-
- if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {
- didWarnAboutContextTypeAndContextTypes.add(ctor);
- warningWithoutStack$1(false, '%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name);
- }
- }
-
- var noComponentShouldUpdate = typeof instance.componentShouldUpdate !== 'function';
- !noComponentShouldUpdate ? warningWithoutStack$1(false, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name) : void 0;
-
- if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {
- warningWithoutStack$1(false, '%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(ctor) || 'A pure component');
- }
-
- var noComponentDidUnmount = typeof instance.componentDidUnmount !== 'function';
- !noComponentDidUnmount ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name) : void 0;
- var noComponentDidReceiveProps = typeof instance.componentDidReceiveProps !== 'function';
- !noComponentDidReceiveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name) : void 0;
- var noComponentWillRecieveProps = typeof instance.componentWillRecieveProps !== 'function';
- !noComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name) : void 0;
- var noUnsafeComponentWillRecieveProps = typeof instance.UNSAFE_componentWillRecieveProps !== 'function';
- !noUnsafeComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name) : void 0;
- var hasMutatedProps = instance.props !== newProps;
- !(instance.props === undefined || !hasMutatedProps) ? warningWithoutStack$1(false, '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name) : void 0;
- var noInstanceDefaultProps = !instance.defaultProps;
- !noInstanceDefaultProps ? warningWithoutStack$1(false, 'Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name) : void 0;
-
- if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {
- didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);
- warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(ctor));
- }
-
- var noInstanceGetDerivedStateFromProps = typeof instance.getDerivedStateFromProps !== 'function';
- !noInstanceGetDerivedStateFromProps ? warningWithoutStack$1(false, '%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0;
- var noInstanceGetDerivedStateFromCatch = typeof instance.getDerivedStateFromError !== 'function';
- !noInstanceGetDerivedStateFromCatch ? warningWithoutStack$1(false, '%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0;
- var noStaticGetSnapshotBeforeUpdate = typeof ctor.getSnapshotBeforeUpdate !== 'function';
- !noStaticGetSnapshotBeforeUpdate ? warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name) : void 0;
- var _state = instance.state;
-
- if (_state && (typeof _state !== 'object' || isArray$1(_state))) {
- warningWithoutStack$1(false, '%s.state: must be set to an object or null', name);
- }
-
- if (typeof instance.getChildContext === 'function') {
- !(typeof ctor.childContextTypes === 'object') ? warningWithoutStack$1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name) : void 0;
- }
- }
- }
-
- function adoptClassInstance(workInProgress, instance) {
- instance.updater = classComponentUpdater;
- workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates
-
- set(instance, workInProgress);
-
- {
- instance._reactInternalInstance = fakeInternalInstance;
- }
- }
-
- function constructClassInstance(workInProgress, ctor, props, renderExpirationTime) {
- var isLegacyContextConsumer = false;
- var unmaskedContext = emptyContextObject;
- var context = emptyContextObject;
- var contextType = ctor.contextType;
-
- {
- if ('contextType' in ctor) {
- var isValid = // Allow null for conditional declaration
- contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a <Context.Consumer>
-
- if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {
- didWarnAboutInvalidateContextType.add(ctor);
- var addendum = '';
-
- if (contextType === undefined) {
- addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';
- } else if (typeof contextType !== 'object') {
- addendum = ' However, it is set to a ' + typeof contextType + '.';
- } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
- addendum = ' Did you accidentally pass the Context.Provider instead?';
- } else if (contextType._context !== undefined) {
- // <Context.Consumer>
- addendum = ' Did you accidentally pass the Context.Consumer instead?';
- } else {
- addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';
- }
-
- warningWithoutStack$1(false, '%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(ctor) || 'Component', addendum);
- }
- }
- }
-
- if (typeof contextType === 'object' && contextType !== null) {
- context = readContext(contextType);
- } else if (!disableLegacyContext) {
- unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
- var contextTypes = ctor.contextTypes;
- isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined;
- context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject;
- } // Instantiate twice to help detect side-effects.
-
-
- {
- if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
- new ctor(props, context); // eslint-disable-line no-new
- }
- }
-
- var instance = new ctor(props, context);
- var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null;
- adoptClassInstance(workInProgress, instance);
-
- {
- if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) {
- var componentName = getComponentName(ctor) || 'Component';
-
- if (!didWarnAboutUninitializedState.has(componentName)) {
- didWarnAboutUninitializedState.add(componentName);
- warningWithoutStack$1(false, '`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName);
- }
- } // If new component APIs are defined, "unsafe" lifecycles won't be called.
- // Warn about these lifecycles if they are present.
- // Don't warn about react-lifecycles-compat polyfilled methods though.
-
-
- if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') {
- var foundWillMountName = null;
- var foundWillReceivePropsName = null;
- var foundWillUpdateName = null;
-
- if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) {
- foundWillMountName = 'componentWillMount';
- } else if (typeof instance.UNSAFE_componentWillMount === 'function') {
- foundWillMountName = 'UNSAFE_componentWillMount';
- }
-
- if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
- foundWillReceivePropsName = 'componentWillReceiveProps';
- } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
- foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
- }
-
- if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
- foundWillUpdateName = 'componentWillUpdate';
- } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
- foundWillUpdateName = 'UNSAFE_componentWillUpdate';
- }
-
- if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
- var _componentName = getComponentName(ctor) || 'Component';
-
- var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
-
- if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {
- didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);
- warningWithoutStack$1(false, 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + 'The above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-unsafe-component-lifecycles', _componentName, newApiName, foundWillMountName !== null ? "\n " + foundWillMountName : '', foundWillReceivePropsName !== null ? "\n " + foundWillReceivePropsName : '', foundWillUpdateName !== null ? "\n " + foundWillUpdateName : '');
- }
- }
- }
- } // Cache unmasked context so we can avoid recreating masked context unless necessary.
- // ReactFiberContext usually updates this cache but can't for newly-created instances.
-
-
- if (isLegacyContextConsumer) {
- cacheContext(workInProgress, unmaskedContext, context);
- }
-
- return instance;
- }
-
- function callComponentWillMount(workInProgress, instance) {
- startPhaseTimer(workInProgress, 'componentWillMount');
- var oldState = instance.state;
-
- if (typeof instance.componentWillMount === 'function') {
- instance.componentWillMount();
- }
-
- if (typeof instance.UNSAFE_componentWillMount === 'function') {
- instance.UNSAFE_componentWillMount();
- }
-
- stopPhaseTimer();
-
- if (oldState !== instance.state) {
- {
- warningWithoutStack$1(false, '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component');
- }
-
- classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
- }
- }
-
- function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) {
- var oldState = instance.state;
- startPhaseTimer(workInProgress, 'componentWillReceiveProps');
-
- if (typeof instance.componentWillReceiveProps === 'function') {
- instance.componentWillReceiveProps(newProps, nextContext);
- }
-
- if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
- instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
- }
-
- stopPhaseTimer();
-
- if (instance.state !== oldState) {
- {
- var componentName = getComponentName(workInProgress.type) || 'Component';
-
- if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {
- didWarnAboutStateAssignmentForComponent.add(componentName);
- warningWithoutStack$1(false, '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName);
- }
- }
-
- classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
- }
- } // Invokes the mount life-cycles on a previously never rendered instance.
-
-
- function mountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {
- {
- checkClassInstance(workInProgress, ctor, newProps);
- }
-
- var instance = workInProgress.stateNode;
- instance.props = newProps;
- instance.state = workInProgress.memoizedState;
- instance.refs = emptyRefsObject;
- var contextType = ctor.contextType;
-
- if (typeof contextType === 'object' && contextType !== null) {
- instance.context = readContext(contextType);
- } else if (disableLegacyContext) {
- instance.context = emptyContextObject;
- } else {
- var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
- instance.context = getMaskedContext(workInProgress, unmaskedContext);
- }
-
- {
- if (instance.state === newProps) {
- var componentName = getComponentName(ctor) || 'Component';
-
- if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {
- didWarnAboutDirectlyAssigningPropsToState.add(componentName);
- warningWithoutStack$1(false, '%s: It is not recommended to assign props directly to state ' + "because updates to props won't be reflected in state. " + 'In most cases, it is better to use props directly.', componentName);
- }
- }
-
- if (workInProgress.mode & StrictMode) {
- ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance);
- }
-
- if (warnAboutDeprecatedLifecycles) {
- ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);
- }
- }
-
- var updateQueue = workInProgress.updateQueue;
-
- if (updateQueue !== null) {
- processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
- instance.state = workInProgress.memoizedState;
- }
-
- var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
-
- if (typeof getDerivedStateFromProps === 'function') {
- applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
- instance.state = workInProgress.memoizedState;
- } // In order to support react-lifecycles-compat polyfilled components,
- // Unsafe lifecycles should not be invoked for components using the new APIs.
-
-
- if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
- callComponentWillMount(workInProgress, instance); // If we had additional state updates during this life-cycle, let's
- // process them now.
-
- updateQueue = workInProgress.updateQueue;
-
- if (updateQueue !== null) {
- processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
- instance.state = workInProgress.memoizedState;
- }
- }
-
- if (typeof instance.componentDidMount === 'function') {
- workInProgress.effectTag |= Update;
- }
- }
-
- function resumeMountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {
- var instance = workInProgress.stateNode;
- var oldProps = workInProgress.memoizedProps;
- instance.props = oldProps;
- var oldContext = instance.context;
- var contextType = ctor.contextType;
- var nextContext = emptyContextObject;
-
- if (typeof contextType === 'object' && contextType !== null) {
- nextContext = readContext(contextType);
- } else if (!disableLegacyContext) {
- var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
- nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext);
- }
-
- var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
- var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what
- // ever the previously attempted to render - not the "current". However,
- // during componentDidUpdate we pass the "current" props.
- // In order to support react-lifecycles-compat polyfilled components,
- // Unsafe lifecycles should not be invoked for components using the new APIs.
-
- if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
- if (oldProps !== newProps || oldContext !== nextContext) {
- callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
- }
- }
-
- resetHasForceUpdateBeforeProcessing();
- var oldState = workInProgress.memoizedState;
- var newState = instance.state = oldState;
- var updateQueue = workInProgress.updateQueue;
-
- if (updateQueue !== null) {
- processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
- newState = workInProgress.memoizedState;
- }
-
- if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
- // If an update was already in progress, we should schedule an Update
- // effect even though we're bailing out, so that cWU/cDU are called.
- if (typeof instance.componentDidMount === 'function') {
- workInProgress.effectTag |= Update;
- }
-
- return false;
- }
-
- if (typeof getDerivedStateFromProps === 'function') {
- applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
- newState = workInProgress.memoizedState;
- }
-
- var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);
-
- if (shouldUpdate) {
- // In order to support react-lifecycles-compat polyfilled components,
- // Unsafe lifecycles should not be invoked for components using the new APIs.
- if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
- startPhaseTimer(workInProgress, 'componentWillMount');
-
- if (typeof instance.componentWillMount === 'function') {
- instance.componentWillMount();
- }
-
- if (typeof instance.UNSAFE_componentWillMount === 'function') {
- instance.UNSAFE_componentWillMount();
- }
-
- stopPhaseTimer();
- }
-
- if (typeof instance.componentDidMount === 'function') {
- workInProgress.effectTag |= Update;
- }
- } else {
- // If an update was already in progress, we should schedule an Update
- // effect even though we're bailing out, so that cWU/cDU are called.
- if (typeof instance.componentDidMount === 'function') {
- workInProgress.effectTag |= Update;
- } // If shouldComponentUpdate returned false, we should still update the
- // memoized state to indicate that this work can be reused.
-
-
- workInProgress.memoizedProps = newProps;
- workInProgress.memoizedState = newState;
- } // Update the existing instance's state, props, and context pointers even
- // if shouldComponentUpdate returns false.
-
-
- instance.props = newProps;
- instance.state = newState;
- instance.context = nextContext;
- return shouldUpdate;
- } // Invokes the update life-cycles and returns false if it shouldn't rerender.
-
-
- function updateClassInstance(current, workInProgress, ctor, newProps, renderExpirationTime) {
- var instance = workInProgress.stateNode;
- var oldProps = workInProgress.memoizedProps;
- instance.props = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps);
- var oldContext = instance.context;
- var contextType = ctor.contextType;
- var nextContext = emptyContextObject;
-
- if (typeof contextType === 'object' && contextType !== null) {
- nextContext = readContext(contextType);
- } else if (!disableLegacyContext) {
- var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
- nextContext = getMaskedContext(workInProgress, nextUnmaskedContext);
- }
-
- var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
- var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what
- // ever the previously attempted to render - not the "current". However,
- // during componentDidUpdate we pass the "current" props.
- // In order to support react-lifecycles-compat polyfilled components,
- // Unsafe lifecycles should not be invoked for components using the new APIs.
-
- if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
- if (oldProps !== newProps || oldContext !== nextContext) {
- callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
- }
- }
-
- resetHasForceUpdateBeforeProcessing();
- var oldState = workInProgress.memoizedState;
- var newState = instance.state = oldState;
- var updateQueue = workInProgress.updateQueue;
-
- if (updateQueue !== null) {
- processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
- newState = workInProgress.memoizedState;
- }
-
- if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
- // If an update was already in progress, we should schedule an Update
- // effect even though we're bailing out, so that cWU/cDU are called.
- if (typeof instance.componentDidUpdate === 'function') {
- if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
- workInProgress.effectTag |= Update;
- }
- }
-
- if (typeof instance.getSnapshotBeforeUpdate === 'function') {
- if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
- workInProgress.effectTag |= Snapshot;
- }
- }
-
- return false;
- }
-
- if (typeof getDerivedStateFromProps === 'function') {
- applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
- newState = workInProgress.memoizedState;
- }
-
- var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);
-
- if (shouldUpdate) {
- // In order to support react-lifecycles-compat polyfilled components,
- // Unsafe lifecycles should not be invoked for components using the new APIs.
- if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) {
- startPhaseTimer(workInProgress, 'componentWillUpdate');
-
- if (typeof instance.componentWillUpdate === 'function') {
- instance.componentWillUpdate(newProps, newState, nextContext);
- }
-
- if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
- instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
- }
-
- stopPhaseTimer();
- }
-
- if (typeof instance.componentDidUpdate === 'function') {
- workInProgress.effectTag |= Update;
- }
-
- if (typeof instance.getSnapshotBeforeUpdate === 'function') {
- workInProgress.effectTag |= Snapshot;
- }
- } else {
- // If an update was already in progress, we should schedule an Update
- // effect even though we're bailing out, so that cWU/cDU are called.
- if (typeof instance.componentDidUpdate === 'function') {
- if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
- workInProgress.effectTag |= Update;
- }
- }
-
- if (typeof instance.getSnapshotBeforeUpdate === 'function') {
- if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
- workInProgress.effectTag |= Snapshot;
- }
- } // If shouldComponentUpdate returned false, we should still update the
- // memoized props/state to indicate that this work can be reused.
-
-
- workInProgress.memoizedProps = newProps;
- workInProgress.memoizedState = newState;
- } // Update the existing instance's state, props, and context pointers even
- // if shouldComponentUpdate returns false.
-
-
- instance.props = newProps;
- instance.state = newState;
- instance.context = nextContext;
- return shouldUpdate;
- }
-
- var didWarnAboutMaps;
- var didWarnAboutGenerators;
- var didWarnAboutStringRefs;
- var ownerHasKeyUseWarning;
- var ownerHasFunctionTypeWarning;
-
- var warnForMissingKey = function (child) {};
-
- {
- didWarnAboutMaps = false;
- didWarnAboutGenerators = false;
- didWarnAboutStringRefs = {};
- /**
- * Warn if there's no key explicitly set on dynamic arrays of children or
- * object keys are not valid. This allows us to keep track of children between
- * updates.
- */
-
- ownerHasKeyUseWarning = {};
- ownerHasFunctionTypeWarning = {};
-
- warnForMissingKey = function (child) {
- if (child === null || typeof child !== 'object') {
- return;
- }
-
- if (!child._store || child._store.validated || child.key != null) {
- return;
- }
-
- if (!(typeof child._store === 'object')) {
- {
- throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
-
- child._store.validated = true;
- var currentComponentErrorInfo = 'Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + getCurrentFiberStackInDev();
-
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
- return;
- }
-
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
- warning$1(false, 'Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.');
- };
- }
-
- var isArray = Array.isArray;
-
- function coerceRef(returnFiber, current$$1, element) {
- var mixedRef = element.ref;
-
- if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') {
- {
- // TODO: Clean this up once we turn on the string ref warning for
- // everyone, because the strict mode case will no longer be relevant
- if (returnFiber.mode & StrictMode || warnAboutStringRefs) {
- var componentName = getComponentName(returnFiber.type) || 'Component';
-
- if (!didWarnAboutStringRefs[componentName]) {
- if (warnAboutStringRefs) {
- warningWithoutStack$1(false, 'Component "%s" contains the string ref "%s". Support for string refs ' + 'will be removed in a future major release. We recommend using ' + 'useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref%s', componentName, mixedRef, getStackByFiberInDevAndProd(returnFiber));
- } else {
- warningWithoutStack$1(false, 'A string ref, "%s", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref%s', mixedRef, getStackByFiberInDevAndProd(returnFiber));
- }
-
- didWarnAboutStringRefs[componentName] = true;
- }
- }
- }
-
- if (element._owner) {
- var owner = element._owner;
- var inst;
-
- if (owner) {
- var ownerFiber = owner;
-
- if (!(ownerFiber.tag === ClassComponent)) {
- {
- throw Error("Function components cannot have refs. Did you mean to use React.forwardRef()?");
- }
- }
-
- inst = ownerFiber.stateNode;
- }
-
- if (!inst) {
- {
- throw Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue.");
- }
- }
-
- var stringRef = '' + mixedRef; // Check if previous string ref matches new string ref
-
- if (current$$1 !== null && current$$1.ref !== null && typeof current$$1.ref === 'function' && current$$1.ref._stringRef === stringRef) {
- return current$$1.ref;
- }
-
- var ref = function (value) {
- var refs = inst.refs;
-
- if (refs === emptyRefsObject) {
- // This is a lazy pooled frozen object, so we need to initialize.
- refs = inst.refs = {};
- }
-
- if (value === null) {
- delete refs[stringRef];
- } else {
- refs[stringRef] = value;
- }
- };
-
- ref._stringRef = stringRef;
- return ref;
- } else {
- if (!(typeof mixedRef === 'string')) {
- {
- throw Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");
- }
- }
-
- if (!element._owner) {
- {
- throw Error("Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://fb.me/react-refs-must-have-owner for more information.");
- }
- }
- }
- }
-
- return mixedRef;
- }
-
- function throwOnInvalidObjectType(returnFiber, newChild) {
- if (returnFiber.type !== 'textarea') {
- var addendum = '';
-
- {
- addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentFiberStackInDev();
- }
-
- {
- {
- throw Error("Objects are not valid as a React child (found: " + (Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild) + ")." + addendum);
- }
- }
- }
- }
-
- function warnOnFunctionType() {
- var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.' + getCurrentFiberStackInDev();
-
- if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) {
- return;
- }
-
- ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true;
- warning$1(false, 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.');
- } // This wrapper function exists because I expect to clone the code in each path
- // to be able to optimize each path individually by branching early. This needs
- // a compiler or we can do it manually. Helpers that don't need this branching
- // live outside of this function.
-
-
- function ChildReconciler(shouldTrackSideEffects) {
- function deleteChild(returnFiber, childToDelete) {
- if (!shouldTrackSideEffects) {
- // Noop.
- return;
- } // Deletions are added in reversed order so we add it to the front.
- // At this point, the return fiber's effect list is empty except for
- // deletions, so we can just append the deletion to the list. The remaining
- // effects aren't added until the complete phase. Once we implement
- // resuming, this may not be true.
-
-
- var last = returnFiber.lastEffect;
-
- if (last !== null) {
- last.nextEffect = childToDelete;
- returnFiber.lastEffect = childToDelete;
- } else {
- returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
- }
-
- childToDelete.nextEffect = null;
- childToDelete.effectTag = Deletion;
- }
-
- function deleteRemainingChildren(returnFiber, currentFirstChild) {
- if (!shouldTrackSideEffects) {
- // Noop.
- return null;
- } // TODO: For the shouldClone case, this could be micro-optimized a bit by
- // assuming that after the first child we've already added everything.
-
-
- var childToDelete = currentFirstChild;
-
- while (childToDelete !== null) {
- deleteChild(returnFiber, childToDelete);
- childToDelete = childToDelete.sibling;
- }
-
- return null;
- }
-
- function mapRemainingChildren(returnFiber, currentFirstChild) {
- // Add the remaining children to a temporary map so that we can find them by
- // keys quickly. Implicit (null) keys get added to this set with their index
- // instead.
- var existingChildren = new Map();
- var existingChild = currentFirstChild;
-
- while (existingChild !== null) {
- if (existingChild.key !== null) {
- existingChildren.set(existingChild.key, existingChild);
- } else {
- existingChildren.set(existingChild.index, existingChild);
- }
-
- existingChild = existingChild.sibling;
- }
-
- return existingChildren;
- }
-
- function useFiber(fiber, pendingProps, expirationTime) {
- // We currently set sibling to null and index to 0 here because it is easy
- // to forget to do before returning it. E.g. for the single child case.
- var clone = createWorkInProgress(fiber, pendingProps, expirationTime);
- clone.index = 0;
- clone.sibling = null;
- return clone;
- }
-
- function placeChild(newFiber, lastPlacedIndex, newIndex) {
- newFiber.index = newIndex;
-
- if (!shouldTrackSideEffects) {
- // Noop.
- return lastPlacedIndex;
- }
-
- var current$$1 = newFiber.alternate;
-
- if (current$$1 !== null) {
- var oldIndex = current$$1.index;
-
- if (oldIndex < lastPlacedIndex) {
- // This is a move.
- newFiber.effectTag = Placement;
- return lastPlacedIndex;
- } else {
- // This item can stay in place.
- return oldIndex;
- }
- } else {
- // This is an insertion.
- newFiber.effectTag = Placement;
- return lastPlacedIndex;
- }
- }
-
- function placeSingleChild(newFiber) {
- // This is simpler for the single child case. We only need to do a
- // placement for inserting new children.
- if (shouldTrackSideEffects && newFiber.alternate === null) {
- newFiber.effectTag = Placement;
- }
-
- return newFiber;
- }
-
- function updateTextNode(returnFiber, current$$1, textContent, expirationTime) {
- if (current$$1 === null || current$$1.tag !== HostText) {
- // Insert
- var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
- created.return = returnFiber;
- return created;
- } else {
- // Update
- var existing = useFiber(current$$1, textContent, expirationTime);
- existing.return = returnFiber;
- return existing;
- }
- }
-
- function updateElement(returnFiber, current$$1, element, expirationTime) {
- if (current$$1 !== null && (current$$1.elementType === element.type || ( // Keep this check inline so it only runs on the false path:
- isCompatibleFamilyForHotReloading(current$$1, element)))) {
- // Move based on index
- var existing = useFiber(current$$1, element.props, expirationTime);
- existing.ref = coerceRef(returnFiber, current$$1, element);
- existing.return = returnFiber;
-
- {
- existing._debugSource = element._source;
- existing._debugOwner = element._owner;
- }
-
- return existing;
- } else {
- // Insert
- var created = createFiberFromElement(element, returnFiber.mode, expirationTime);
- created.ref = coerceRef(returnFiber, current$$1, element);
- created.return = returnFiber;
- return created;
- }
- }
-
- function updatePortal(returnFiber, current$$1, portal, expirationTime) {
- if (current$$1 === null || current$$1.tag !== HostPortal || current$$1.stateNode.containerInfo !== portal.containerInfo || current$$1.stateNode.implementation !== portal.implementation) {
- // Insert
- var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
- created.return = returnFiber;
- return created;
- } else {
- // Update
- var existing = useFiber(current$$1, portal.children || [], expirationTime);
- existing.return = returnFiber;
- return existing;
- }
- }
-
- function updateFragment(returnFiber, current$$1, fragment, expirationTime, key) {
- if (current$$1 === null || current$$1.tag !== Fragment) {
- // Insert
- var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key);
- created.return = returnFiber;
- return created;
- } else {
- // Update
- var existing = useFiber(current$$1, fragment, expirationTime);
- existing.return = returnFiber;
- return existing;
- }
- }
-
- function createChild(returnFiber, newChild, expirationTime) {
- if (typeof newChild === 'string' || typeof newChild === 'number') {
- // Text nodes don't have keys. If the previous node is implicitly keyed
- // we can continue to replace it without aborting even if it is not a text
- // node.
- var created = createFiberFromText('' + newChild, returnFiber.mode, expirationTime);
- created.return = returnFiber;
- return created;
- }
-
- if (typeof newChild === 'object' && newChild !== null) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- {
- var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime);
-
- _created.ref = coerceRef(returnFiber, null, newChild);
- _created.return = returnFiber;
- return _created;
- }
-
- case REACT_PORTAL_TYPE:
- {
- var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime);
-
- _created2.return = returnFiber;
- return _created2;
- }
- }
-
- if (isArray(newChild) || getIteratorFn(newChild)) {
- var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null);
-
- _created3.return = returnFiber;
- return _created3;
- }
-
- throwOnInvalidObjectType(returnFiber, newChild);
- }
-
- {
- if (typeof newChild === 'function') {
- warnOnFunctionType();
- }
- }
-
- return null;
- }
-
- function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {
- // Update the fiber if the keys match, otherwise return null.
- var key = oldFiber !== null ? oldFiber.key : null;
-
- if (typeof newChild === 'string' || typeof newChild === 'number') {
- // Text nodes don't have keys. If the previous node is implicitly keyed
- // we can continue to replace it without aborting even if it is not a text
- // node.
- if (key !== null) {
- return null;
- }
-
- return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime);
- }
-
- if (typeof newChild === 'object' && newChild !== null) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- {
- if (newChild.key === key) {
- if (newChild.type === REACT_FRAGMENT_TYPE) {
- return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key);
- }
-
- return updateElement(returnFiber, oldFiber, newChild, expirationTime);
- } else {
- return null;
- }
- }
-
- case REACT_PORTAL_TYPE:
- {
- if (newChild.key === key) {
- return updatePortal(returnFiber, oldFiber, newChild, expirationTime);
- } else {
- return null;
- }
- }
- }
-
- if (isArray(newChild) || getIteratorFn(newChild)) {
- if (key !== null) {
- return null;
- }
-
- return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null);
- }
-
- throwOnInvalidObjectType(returnFiber, newChild);
- }
-
- {
- if (typeof newChild === 'function') {
- warnOnFunctionType();
- }
- }
-
- return null;
- }
-
- function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) {
- if (typeof newChild === 'string' || typeof newChild === 'number') {
- // Text nodes don't have keys, so we neither have to check the old nor
- // new node for the key. If both are text nodes, they match.
- var matchedFiber = existingChildren.get(newIdx) || null;
- return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime);
- }
-
- if (typeof newChild === 'object' && newChild !== null) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- {
- var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
-
- if (newChild.type === REACT_FRAGMENT_TYPE) {
- return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key);
- }
-
- return updateElement(returnFiber, _matchedFiber, newChild, expirationTime);
- }
-
- case REACT_PORTAL_TYPE:
- {
- var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
-
- return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime);
- }
- }
-
- if (isArray(newChild) || getIteratorFn(newChild)) {
- var _matchedFiber3 = existingChildren.get(newIdx) || null;
-
- return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null);
- }
-
- throwOnInvalidObjectType(returnFiber, newChild);
- }
-
- {
- if (typeof newChild === 'function') {
- warnOnFunctionType();
- }
- }
-
- return null;
- }
- /**
- * Warns if there is a duplicate or missing key
- */
-
-
- function warnOnInvalidKey(child, knownKeys) {
- {
- if (typeof child !== 'object' || child === null) {
- return knownKeys;
- }
-
- switch (child.$$typeof) {
- case REACT_ELEMENT_TYPE:
- case REACT_PORTAL_TYPE:
- warnForMissingKey(child);
- var key = child.key;
-
- if (typeof key !== 'string') {
- break;
- }
-
- if (knownKeys === null) {
- knownKeys = new Set();
- knownKeys.add(key);
- break;
- }
-
- if (!knownKeys.has(key)) {
- knownKeys.add(key);
- break;
- }
-
- warning$1(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);
- break;
-
- default:
- break;
- }
- }
-
- return knownKeys;
- }
-
- function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) {
- // This algorithm can't optimize by searching from both ends since we
- // don't have backpointers on fibers. I'm trying to see how far we can get
- // with that model. If it ends up not being worth the tradeoffs, we can
- // add it later.
- // Even with a two ended optimization, we'd want to optimize for the case
- // where there are few changes and brute force the comparison instead of
- // going for the Map. It'd like to explore hitting that path first in
- // forward-only mode and only go for the Map once we notice that we need
- // lots of look ahead. This doesn't handle reversal as well as two ended
- // search but that's unusual. Besides, for the two ended optimization to
- // work on Iterables, we'd need to copy the whole set.
- // In this first iteration, we'll just live with hitting the bad case
- // (adding everything to a Map) in for every insert/move.
- // If you change this code, also update reconcileChildrenIterator() which
- // uses the same algorithm.
- {
- // First, validate keys.
- var knownKeys = null;
-
- for (var i = 0; i < newChildren.length; i++) {
- var child = newChildren[i];
- knownKeys = warnOnInvalidKey(child, knownKeys);
- }
- }
-
- var resultingFirstChild = null;
- var previousNewFiber = null;
- var oldFiber = currentFirstChild;
- var lastPlacedIndex = 0;
- var newIdx = 0;
- var nextOldFiber = null;
-
- for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
- if (oldFiber.index > newIdx) {
- nextOldFiber = oldFiber;
- oldFiber = null;
- } else {
- nextOldFiber = oldFiber.sibling;
- }
-
- var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime);
-
- if (newFiber === null) {
- // TODO: This breaks on empty slots like null children. That's
- // unfortunate because it triggers the slow path all the time. We need
- // a better way to communicate whether this was a miss or null,
- // boolean, undefined, etc.
- if (oldFiber === null) {
- oldFiber = nextOldFiber;
- }
-
- break;
- }
-
- if (shouldTrackSideEffects) {
- if (oldFiber && newFiber.alternate === null) {
- // We matched the slot, but we didn't reuse the existing fiber, so we
- // need to delete the existing child.
- deleteChild(returnFiber, oldFiber);
- }
- }
-
- lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
-
- if (previousNewFiber === null) {
- // TODO: Move out of the loop. This only happens for the first run.
- resultingFirstChild = newFiber;
- } else {
- // TODO: Defer siblings if we're not at the right index for this slot.
- // I.e. if we had null values before, then we want to defer this
- // for each null value. However, we also don't want to call updateSlot
- // with the previous one.
- previousNewFiber.sibling = newFiber;
- }
-
- previousNewFiber = newFiber;
- oldFiber = nextOldFiber;
- }
-
- if (newIdx === newChildren.length) {
- // We've reached the end of the new children. We can delete the rest.
- deleteRemainingChildren(returnFiber, oldFiber);
- return resultingFirstChild;
- }
-
- if (oldFiber === null) {
- // If we don't have any more existing children we can choose a fast path
- // since the rest will all be insertions.
- for (; newIdx < newChildren.length; newIdx++) {
- var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime);
-
- if (_newFiber === null) {
- continue;
- }
-
- lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
-
- if (previousNewFiber === null) {
- // TODO: Move out of the loop. This only happens for the first run.
- resultingFirstChild = _newFiber;
- } else {
- previousNewFiber.sibling = _newFiber;
- }
-
- previousNewFiber = _newFiber;
- }
-
- return resultingFirstChild;
- } // Add all children to a key map for quick lookups.
-
-
- var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.
-
- for (; newIdx < newChildren.length; newIdx++) {
- var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime);
-
- if (_newFiber2 !== null) {
- if (shouldTrackSideEffects) {
- if (_newFiber2.alternate !== null) {
- // The new fiber is a work in progress, but if there exists a
- // current, that means that we reused the fiber. We need to delete
- // it from the child list so that we don't add it to the deletion
- // list.
- existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);
- }
- }
-
- lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);
-
- if (previousNewFiber === null) {
- resultingFirstChild = _newFiber2;
- } else {
- previousNewFiber.sibling = _newFiber2;
- }
-
- previousNewFiber = _newFiber2;
- }
- }
-
- if (shouldTrackSideEffects) {
- // Any existing children that weren't consumed above were deleted. We need
- // to add them to the deletion list.
- existingChildren.forEach(function (child) {
- return deleteChild(returnFiber, child);
- });
- }
-
- return resultingFirstChild;
- }
-
- function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) {
- // This is the same implementation as reconcileChildrenArray(),
- // but using the iterator instead.
- var iteratorFn = getIteratorFn(newChildrenIterable);
-
- if (!(typeof iteratorFn === 'function')) {
- {
- throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
-
- {
- // We don't support rendering Generators because it's a mutation.
- // See https://github.com/facebook/react/issues/12995
- if (typeof Symbol === 'function' && // $FlowFixMe Flow doesn't know about toStringTag
- newChildrenIterable[Symbol.toStringTag] === 'Generator') {
- !didWarnAboutGenerators ? warning$1(false, 'Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.') : void 0;
- didWarnAboutGenerators = true;
- } // Warn about using Maps as children
-
-
- if (newChildrenIterable.entries === iteratorFn) {
- !didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0;
- didWarnAboutMaps = true;
- } // First, validate keys.
- // We'll get a different iterator later for the main pass.
-
-
- var _newChildren = iteratorFn.call(newChildrenIterable);
-
- if (_newChildren) {
- var knownKeys = null;
-
- var _step = _newChildren.next();
-
- for (; !_step.done; _step = _newChildren.next()) {
- var child = _step.value;
- knownKeys = warnOnInvalidKey(child, knownKeys);
- }
- }
- }
-
- var newChildren = iteratorFn.call(newChildrenIterable);
-
- if (!(newChildren != null)) {
- {
- throw Error("An iterable object provided no iterator.");
- }
- }
-
- var resultingFirstChild = null;
- var previousNewFiber = null;
- var oldFiber = currentFirstChild;
- var lastPlacedIndex = 0;
- var newIdx = 0;
- var nextOldFiber = null;
- var step = newChildren.next();
-
- for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
- if (oldFiber.index > newIdx) {
- nextOldFiber = oldFiber;
- oldFiber = null;
- } else {
- nextOldFiber = oldFiber.sibling;
- }
-
- var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime);
-
- if (newFiber === null) {
- // TODO: This breaks on empty slots like null children. That's
- // unfortunate because it triggers the slow path all the time. We need
- // a better way to communicate whether this was a miss or null,
- // boolean, undefined, etc.
- if (oldFiber === null) {
- oldFiber = nextOldFiber;
- }
-
- break;
- }
-
- if (shouldTrackSideEffects) {
- if (oldFiber && newFiber.alternate === null) {
- // We matched the slot, but we didn't reuse the existing fiber, so we
- // need to delete the existing child.
- deleteChild(returnFiber, oldFiber);
- }
- }
-
- lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
-
- if (previousNewFiber === null) {
- // TODO: Move out of the loop. This only happens for the first run.
- resultingFirstChild = newFiber;
- } else {
- // TODO: Defer siblings if we're not at the right index for this slot.
- // I.e. if we had null values before, then we want to defer this
- // for each null value. However, we also don't want to call updateSlot
- // with the previous one.
- previousNewFiber.sibling = newFiber;
- }
-
- previousNewFiber = newFiber;
- oldFiber = nextOldFiber;
- }
-
- if (step.done) {
- // We've reached the end of the new children. We can delete the rest.
- deleteRemainingChildren(returnFiber, oldFiber);
- return resultingFirstChild;
- }
-
- if (oldFiber === null) {
- // If we don't have any more existing children we can choose a fast path
- // since the rest will all be insertions.
- for (; !step.done; newIdx++, step = newChildren.next()) {
- var _newFiber3 = createChild(returnFiber, step.value, expirationTime);
-
- if (_newFiber3 === null) {
- continue;
- }
-
- lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
-
- if (previousNewFiber === null) {
- // TODO: Move out of the loop. This only happens for the first run.
- resultingFirstChild = _newFiber3;
- } else {
- previousNewFiber.sibling = _newFiber3;
- }
-
- previousNewFiber = _newFiber3;
- }
-
- return resultingFirstChild;
- } // Add all children to a key map for quick lookups.
-
-
- var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.
-
- for (; !step.done; newIdx++, step = newChildren.next()) {
- var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime);
-
- if (_newFiber4 !== null) {
- if (shouldTrackSideEffects) {
- if (_newFiber4.alternate !== null) {
- // The new fiber is a work in progress, but if there exists a
- // current, that means that we reused the fiber. We need to delete
- // it from the child list so that we don't add it to the deletion
- // list.
- existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);
- }
- }
-
- lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);
-
- if (previousNewFiber === null) {
- resultingFirstChild = _newFiber4;
- } else {
- previousNewFiber.sibling = _newFiber4;
- }
-
- previousNewFiber = _newFiber4;
- }
- }
-
- if (shouldTrackSideEffects) {
- // Any existing children that weren't consumed above were deleted. We need
- // to add them to the deletion list.
- existingChildren.forEach(function (child) {
- return deleteChild(returnFiber, child);
- });
- }
-
- return resultingFirstChild;
- }
-
- function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {
- // There's no need to check for keys on text nodes since we don't have a
- // way to define them.
- if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
- // We already have an existing node so let's just update it and delete
- // the rest.
- deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
- var existing = useFiber(currentFirstChild, textContent, expirationTime);
- existing.return = returnFiber;
- return existing;
- } // The existing first child is not a text node so we need to create one
- // and delete the existing ones.
-
-
- deleteRemainingChildren(returnFiber, currentFirstChild);
- var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
- created.return = returnFiber;
- return created;
- }
-
- function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {
- var key = element.key;
- var child = currentFirstChild;
-
- while (child !== null) {
- // TODO: If key === null and child.key === null, then this only applies to
- // the first item in the list.
- if (child.key === key) {
- if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.elementType === element.type || ( // Keep this check inline so it only runs on the false path:
- isCompatibleFamilyForHotReloading(child, element))) {
- deleteRemainingChildren(returnFiber, child.sibling);
- var existing = useFiber(child, element.type === REACT_FRAGMENT_TYPE ? element.props.children : element.props, expirationTime);
- existing.ref = coerceRef(returnFiber, child, element);
- existing.return = returnFiber;
-
- {
- existing._debugSource = element._source;
- existing._debugOwner = element._owner;
- }
-
- return existing;
- } else {
- deleteRemainingChildren(returnFiber, child);
- break;
- }
- } else {
- deleteChild(returnFiber, child);
- }
-
- child = child.sibling;
- }
-
- if (element.type === REACT_FRAGMENT_TYPE) {
- var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key);
- created.return = returnFiber;
- return created;
- } else {
- var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime);
-
- _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
- _created4.return = returnFiber;
- return _created4;
- }
- }
-
- function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {
- var key = portal.key;
- var child = currentFirstChild;
-
- while (child !== null) {
- // TODO: If key === null and child.key === null, then this only applies to
- // the first item in the list.
- if (child.key === key) {
- if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
- deleteRemainingChildren(returnFiber, child.sibling);
- var existing = useFiber(child, portal.children || [], expirationTime);
- existing.return = returnFiber;
- return existing;
- } else {
- deleteRemainingChildren(returnFiber, child);
- break;
- }
- } else {
- deleteChild(returnFiber, child);
- }
-
- child = child.sibling;
- }
-
- var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
- created.return = returnFiber;
- return created;
- } // This API will tag the children with the side-effect of the reconciliation
- // itself. They will be added to the side-effect list as we pass through the
- // children and the parent.
-
-
- function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {
- // This function is not recursive.
- // If the top level item is an array, we treat it as a set of children,
- // not as a fragment. Nested arrays on the other hand will be treated as
- // fragment nodes. Recursion happens at the normal flow.
- // Handle top level unkeyed fragments as if they were arrays.
- // This leads to an ambiguity between <>{[...]}</> and <>...</>.
- // We treat the ambiguous cases above the same.
- var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;
-
- if (isUnkeyedTopLevelFragment) {
- newChild = newChild.props.children;
- } // Handle object types
-
-
- var isObject = typeof newChild === 'object' && newChild !== null;
-
- if (isObject) {
- switch (newChild.$$typeof) {
- case REACT_ELEMENT_TYPE:
- return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));
-
- case REACT_PORTAL_TYPE:
- return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));
- }
- }
-
- if (typeof newChild === 'string' || typeof newChild === 'number') {
- return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));
- }
-
- if (isArray(newChild)) {
- return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);
- }
-
- if (getIteratorFn(newChild)) {
- return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);
- }
-
- if (isObject) {
- throwOnInvalidObjectType(returnFiber, newChild);
- }
-
- {
- if (typeof newChild === 'function') {
- warnOnFunctionType();
- }
- }
-
- if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {
- // If the new child is undefined, and the return fiber is a composite
- // component, throw an error. If Fiber return types are disabled,
- // we already threw above.
- switch (returnFiber.tag) {
- case ClassComponent:
- {
- {
- var instance = returnFiber.stateNode;
-
- if (instance.render._isMockFunction) {
- // We allow auto-mocks to proceed as if they're returning null.
- break;
- }
- }
- }
- // Intentionally fall through to the next case, which handles both
- // functions and classes
- // eslint-disable-next-lined no-fallthrough
-
- case FunctionComponent:
- {
- var Component = returnFiber.type;
-
- {
- {
- throw Error((Component.displayName || Component.name || 'Component') + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.");
- }
- }
- }
- }
- } // Remaining cases are all treated as empty.
-
-
- return deleteRemainingChildren(returnFiber, currentFirstChild);
- }
-
- return reconcileChildFibers;
- }
-
- var reconcileChildFibers = ChildReconciler(true);
- var mountChildFibers = ChildReconciler(false);
- function cloneChildFibers(current$$1, workInProgress) {
- if (!(current$$1 === null || workInProgress.child === current$$1.child)) {
- {
- throw Error("Resuming work not yet implemented.");
- }
- }
-
- if (workInProgress.child === null) {
- return;
- }
-
- var currentChild = workInProgress.child;
- var newChild = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime);
- workInProgress.child = newChild;
- newChild.return = workInProgress;
-
- while (currentChild.sibling !== null) {
- currentChild = currentChild.sibling;
- newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime);
- newChild.return = workInProgress;
- }
-
- newChild.sibling = null;
- } // Reset a workInProgress child set to prepare it for a second pass.
-
- function resetChildFibers(workInProgress, renderExpirationTime) {
- var child = workInProgress.child;
-
- while (child !== null) {
- resetWorkInProgress(child, renderExpirationTime);
- child = child.sibling;
- }
- }
-
- var NO_CONTEXT = {};
- var contextStackCursor$1 = createCursor(NO_CONTEXT);
- var contextFiberStackCursor = createCursor(NO_CONTEXT);
- var rootInstanceStackCursor = createCursor(NO_CONTEXT);
-
- function requiredContext(c) {
- if (!(c !== NO_CONTEXT)) {
- {
- throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
-
- return c;
- }
-
- function getRootHostContainer() {
- var rootInstance = requiredContext(rootInstanceStackCursor.current);
- return rootInstance;
- }
-
- function pushHostContainer(fiber, nextRootInstance) {
- // Push current root instance onto the stack;
- // This allows us to reset root when portals are popped.
- push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it.
- // This enables us to pop only Fibers that provide unique contexts.
-
- push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack.
- // However, we can't just call getRootHostContext() and push it because
- // we'd have a different number of entries on the stack depending on
- // whether getRootHostContext() throws somewhere in renderer code or not.
- // So we push an empty value first. This lets us safely unwind on errors.
-
- push(contextStackCursor$1, NO_CONTEXT, fiber);
- var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it.
-
- pop(contextStackCursor$1, fiber);
- push(contextStackCursor$1, nextRootContext, fiber);
- }
-
- function popHostContainer(fiber) {
- pop(contextStackCursor$1, fiber);
- pop(contextFiberStackCursor, fiber);
- pop(rootInstanceStackCursor, fiber);
- }
-
- function getHostContext() {
- var context = requiredContext(contextStackCursor$1.current);
- return context;
- }
-
- function pushHostContext(fiber) {
- var rootInstance = requiredContext(rootInstanceStackCursor.current);
- var context = requiredContext(contextStackCursor$1.current);
- var nextContext = getChildHostContext(context, fiber.type, rootInstance); // Don't push this Fiber's context unless it's unique.
-
- if (context === nextContext) {
- return;
- } // Track the context and the Fiber that provided it.
- // This enables us to pop only Fibers that provide unique contexts.
-
-
- push(contextFiberStackCursor, fiber, fiber);
- push(contextStackCursor$1, nextContext, fiber);
- }
-
- function popHostContext(fiber) {
- // Do not pop unless this Fiber provided the current context.
- // pushHostContext() only pushes Fibers that provide unique contexts.
- if (contextFiberStackCursor.current !== fiber) {
- return;
- }
-
- pop(contextStackCursor$1, fiber);
- pop(contextFiberStackCursor, fiber);
- }
-
- var DefaultSuspenseContext = 0; // The Suspense Context is split into two parts. The lower bits is
- // inherited deeply down the subtree. The upper bits only affect
- // this immediate suspense boundary and gets reset each new
- // boundary or suspense list.
-
- var SubtreeSuspenseContextMask = 1; // Subtree Flags:
- // InvisibleParentSuspenseContext indicates that one of our parent Suspense
- // boundaries is not currently showing visible main content.
- // Either because it is already showing a fallback or is not mounted at all.
- // We can use this to determine if it is desirable to trigger a fallback at
- // the parent. If not, then we might need to trigger undesirable boundaries
- // and/or suspend the commit to avoid hiding the parent content.
-
- var InvisibleParentSuspenseContext = 1; // Shallow Flags:
- // ForceSuspenseFallback can be used by SuspenseList to force newly added
- // items into their fallback state during one of the render passes.
-
- var ForceSuspenseFallback = 2;
- var suspenseStackCursor = createCursor(DefaultSuspenseContext);
- function hasSuspenseContext(parentContext, flag) {
- return (parentContext & flag) !== 0;
- }
- function setDefaultShallowSuspenseContext(parentContext) {
- return parentContext & SubtreeSuspenseContextMask;
- }
- function setShallowSuspenseContext(parentContext, shallowContext) {
- return parentContext & SubtreeSuspenseContextMask | shallowContext;
- }
- function addSubtreeSuspenseContext(parentContext, subtreeContext) {
- return parentContext | subtreeContext;
- }
- function pushSuspenseContext(fiber, newContext) {
- push(suspenseStackCursor, newContext, fiber);
- }
- function popSuspenseContext(fiber) {
- pop(suspenseStackCursor, fiber);
- }
-
- function shouldCaptureSuspense(workInProgress, hasInvisibleParent) {
- // If it was the primary children that just suspended, capture and render the
- // fallback. Otherwise, don't capture and bubble to the next boundary.
- var nextState = workInProgress.memoizedState;
-
- if (nextState !== null) {
- if (nextState.dehydrated !== null) {
- // A dehydrated boundary always captures.
- return true;
- }
-
- return false;
- }
-
- var props = workInProgress.memoizedProps; // In order to capture, the Suspense component must have a fallback prop.
-
- if (props.fallback === undefined) {
- return false;
- } // Regular boundaries always capture.
-
-
- if (props.unstable_avoidThisFallback !== true) {
- return true;
- } // If it's a boundary we should avoid, then we prefer to bubble up to the
- // parent boundary if it is currently invisible.
-
-
- if (hasInvisibleParent) {
- return false;
- } // If the parent is not able to handle it, we must handle it.
-
-
- return true;
- }
- function findFirstSuspended(row) {
- var node = row;
-
- while (node !== null) {
- if (node.tag === SuspenseComponent) {
- var state = node.memoizedState;
-
- if (state !== null) {
- var dehydrated = state.dehydrated;
-
- if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {
- return node;
- }
- }
- } else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't
- // keep track of whether it suspended or not.
- node.memoizedProps.revealOrder !== undefined) {
- var didSuspend = (node.effectTag & DidCapture) !== NoEffect;
-
- if (didSuspend) {
- return node;
- }
- } else if (node.child !== null) {
- node.child.return = node;
- node = node.child;
- continue;
- }
-
- if (node === row) {
- return null;
- }
-
- while (node.sibling === null) {
- if (node.return === null || node.return === row) {
- return null;
- }
-
- node = node.return;
- }
-
- node.sibling.return = node.return;
- node = node.sibling;
- }
-
- return null;
- }
-
- var emptyObject = {};
- var isArray$2 = Array.isArray;
- function createResponderInstance(responder, responderProps, responderState, fiber) {
- return {
- fiber: fiber,
- props: responderProps,
- responder: responder,
- rootEventTypes: null,
- state: responderState
- };
- }
-
- function mountEventResponder$1(responder, responderProps, fiber, respondersMap, rootContainerInstance) {
- var responderState = emptyObject;
- var getInitialState = responder.getInitialState;
-
- if (getInitialState !== null) {
- responderState = getInitialState(responderProps);
- }
-
- var responderInstance = createResponderInstance(responder, responderProps, responderState, fiber);
-
- if (!rootContainerInstance) {
- var node = fiber;
-
- while (node !== null) {
- var tag = node.tag;
-
- if (tag === HostComponent) {
- rootContainerInstance = node.stateNode;
- break;
- } else if (tag === HostRoot) {
- rootContainerInstance = node.stateNode.containerInfo;
- break;
- }
-
- node = node.return;
- }
- }
-
- mountResponderInstance(responder, responderInstance, responderProps, responderState, rootContainerInstance);
- respondersMap.set(responder, responderInstance);
- }
-
- function updateEventListener(listener, fiber, visistedResponders, respondersMap, rootContainerInstance) {
- var responder;
- var props;
-
- if (listener) {
- responder = listener.responder;
- props = listener.props;
- }
-
- if (!(responder && responder.$$typeof === REACT_RESPONDER_TYPE)) {
- {
- throw Error("An invalid value was used as an event listener. Expect one or many event listeners created via React.unstable_useResponder().");
- }
- }
-
- var listenerProps = props;
-
- if (visistedResponders.has(responder)) {
- // show warning
- {
- warning$1(false, 'Duplicate event responder "%s" found in event listeners. ' + 'Event listeners passed to elements cannot use the same event responder more than once.', responder.displayName);
- }
-
- return;
- }
-
- visistedResponders.add(responder);
- var responderInstance = respondersMap.get(responder);
-
- if (responderInstance === undefined) {
- // Mount (happens in either complete or commit phase)
- mountEventResponder$1(responder, listenerProps, fiber, respondersMap, rootContainerInstance);
- } else {
- // Update (happens during commit phase only)
- responderInstance.props = listenerProps;
- responderInstance.fiber = fiber;
- }
- }
-
- function updateEventListeners(listeners, fiber, rootContainerInstance) {
- var visistedResponders = new Set();
- var dependencies = fiber.dependencies;
-
- if (listeners != null) {
- if (dependencies === null) {
- dependencies = fiber.dependencies = {
- expirationTime: NoWork,
- firstContext: null,
- responders: new Map()
- };
- }
-
- var respondersMap = dependencies.responders;
-
- if (respondersMap === null) {
- respondersMap = new Map();
- }
-
- if (isArray$2(listeners)) {
- for (var i = 0, length = listeners.length; i < length; i++) {
- var listener = listeners[i];
- updateEventListener(listener, fiber, visistedResponders, respondersMap, rootContainerInstance);
- }
- } else {
- updateEventListener(listeners, fiber, visistedResponders, respondersMap, rootContainerInstance);
- }
- }
-
- if (dependencies !== null) {
- var _respondersMap = dependencies.responders;
-
- if (_respondersMap !== null) {
- // Unmount
- var mountedResponders = Array.from(_respondersMap.keys());
-
- for (var _i = 0, _length = mountedResponders.length; _i < _length; _i++) {
- var mountedResponder = mountedResponders[_i];
-
- if (!visistedResponders.has(mountedResponder)) {
- var responderInstance = _respondersMap.get(mountedResponder);
-
- unmountResponderInstance(responderInstance);
-
- _respondersMap.delete(mountedResponder);
- }
- }
- }
- }
- }
- function createResponderListener(responder, props) {
- var eventResponderListener = {
- responder: responder,
- props: props
- };
-
- {
- Object.freeze(eventResponderListener);
- }
-
- return eventResponderListener;
- }
-
- var NoEffect$1 =
- /* */
- 0;
- var UnmountSnapshot =
- /* */
- 2;
- var UnmountMutation =
- /* */
- 4;
- var MountMutation =
- /* */
- 8;
- var UnmountLayout =
- /* */
- 16;
- var MountLayout =
- /* */
- 32;
- var MountPassive =
- /* */
- 64;
- var UnmountPassive =
- /* */
- 128;
-
- var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
- var ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
- var didWarnAboutMismatchedHooksForComponent;
-
- {
- didWarnAboutMismatchedHooksForComponent = new Set();
- }
-
- // These are set right before calling the component.
- var renderExpirationTime$1 = NoWork; // The work-in-progress fiber. I've named it differently to distinguish it from
- // the work-in-progress hook.
-
- var currentlyRenderingFiber$1 = null; // Hooks are stored as a linked list on the fiber's memoizedState field. The
- // current hook list is the list that belongs to the current fiber. The
- // work-in-progress hook list is a new list that will be added to the
- // work-in-progress fiber.
-
- var currentHook = null;
- var nextCurrentHook = null;
- var firstWorkInProgressHook = null;
- var workInProgressHook = null;
- var nextWorkInProgressHook = null;
- var remainingExpirationTime = NoWork;
- var componentUpdateQueue = null;
- var sideEffectTag = 0; // Updates scheduled during render will trigger an immediate re-render at the
- // end of the current pass. We can't store these updates on the normal queue,
- // because if the work is aborted, they should be discarded. Because this is
- // a relatively rare case, we also don't want to add an additional field to
- // either the hook or queue object types. So we store them in a lazily create
- // map of queue -> render-phase updates, which are discarded once the component
- // completes without re-rendering.
- // Whether an update was scheduled during the currently executing render pass.
-
- var didScheduleRenderPhaseUpdate = false; // Lazily created map of render-phase updates
-
- var renderPhaseUpdates = null; // Counter to prevent infinite loops.
-
- var numberOfReRenders = 0;
- var RE_RENDER_LIMIT = 25; // In DEV, this is the name of the currently executing primitive hook
-
- var currentHookNameInDev = null; // In DEV, this list ensures that hooks are called in the same order between renders.
- // The list stores the order of hooks used during the initial render (mount).
- // Subsequent renders (updates) reference this list.
-
- var hookTypesDev = null;
- var hookTypesUpdateIndexDev = -1; // In DEV, this tracks whether currently rendering component needs to ignore
- // the dependencies for Hooks that need them (e.g. useEffect or useMemo).
- // When true, such Hooks will always be "remounted". Only used during hot reload.
-
- var ignorePreviousDependencies = false;
-
- function mountHookTypesDev() {
- {
- var hookName = currentHookNameInDev;
-
- if (hookTypesDev === null) {
- hookTypesDev = [hookName];
- } else {
- hookTypesDev.push(hookName);
- }
- }
- }
-
- function updateHookTypesDev() {
- {
- var hookName = currentHookNameInDev;
-
- if (hookTypesDev !== null) {
- hookTypesUpdateIndexDev++;
-
- if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
- warnOnHookMismatchInDev(hookName);
- }
- }
- }
- }
-
- function checkDepsAreArrayDev(deps) {
- {
- if (deps !== undefined && deps !== null && !Array.isArray(deps)) {
- // Verify deps, but only on mount to avoid extra checks.
- // It's unlikely their type would change as usually you define them inline.
- warning$1(false, '%s received a final argument that is not an array (instead, received `%s`). When ' + 'specified, the final argument must be an array.', currentHookNameInDev, typeof deps);
- }
- }
- }
-
- function warnOnHookMismatchInDev(currentHookName) {
- {
- var componentName = getComponentName(currentlyRenderingFiber$1.type);
-
- if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
- didWarnAboutMismatchedHooksForComponent.add(componentName);
-
- if (hookTypesDev !== null) {
- var table = '';
- var secondColumnStart = 30;
-
- for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
- var oldHookName = hookTypesDev[i];
- var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
- var row = i + 1 + ". " + oldHookName; // Extra space so second column lines up
- // lol @ IE not supporting String#repeat
-
- while (row.length < secondColumnStart) {
- row += ' ';
- }
-
- row += newHookName + '\n';
- table += row;
- }
-
- warning$1(false, 'React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://fb.me/rules-of-hooks\n\n' + ' Previous render Next render\n' + ' ------------------------------------------------------\n' + '%s' + ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', componentName, table);
- }
- }
- }
- }
-
- function throwInvalidHookError() {
- {
- {
- throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");
- }
- }
- }
-
- function areHookInputsEqual(nextDeps, prevDeps) {
- {
- if (ignorePreviousDependencies) {
- // Only true when this component is being hot reloaded.
- return false;
- }
- }
-
- if (prevDeps === null) {
- {
- warning$1(false, '%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);
- }
-
- return false;
- }
-
- {
- // Don't bother comparing lengths in prod because these arrays should be
- // passed inline.
- if (nextDeps.length !== prevDeps.length) {
- warning$1(false, 'The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, "[" + prevDeps.join(', ') + "]", "[" + nextDeps.join(', ') + "]");
- }
- }
-
- for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
- if (is$1(nextDeps[i], prevDeps[i])) {
- continue;
- }
-
- return false;
- }
-
- return true;
- }
-
- function renderWithHooks(current, workInProgress, Component, props, refOrContext, nextRenderExpirationTime) {
- renderExpirationTime$1 = nextRenderExpirationTime;
- currentlyRenderingFiber$1 = workInProgress;
- nextCurrentHook = current !== null ? current.memoizedState : null;
-
- {
- hookTypesDev = current !== null ? current._debugHookTypes : null;
- hookTypesUpdateIndexDev = -1; // Used for hot reloading:
-
- ignorePreviousDependencies = current !== null && current.type !== workInProgress.type;
- } // The following should have already been reset
- // currentHook = null;
- // workInProgressHook = null;
- // remainingExpirationTime = NoWork;
- // componentUpdateQueue = null;
- // didScheduleRenderPhaseUpdate = false;
- // renderPhaseUpdates = null;
- // numberOfReRenders = 0;
- // sideEffectTag = 0;
- // TODO Warn if no hooks are used at all during mount, then some are used during update.
- // Currently we will identify the update render as a mount because nextCurrentHook === null.
- // This is tricky because it's valid for certain types of components (e.g. React.lazy)
- // Using nextCurrentHook to differentiate between mount/update only works if at least one stateful hook is used.
- // Non-stateful hooks (e.g. context) don't get added to memoizedState,
- // so nextCurrentHook would be null during updates and mounts.
-
-
- {
- if (nextCurrentHook !== null) {
- ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
- } else if (hookTypesDev !== null) {
- // This dispatcher handles an edge case where a component is updating,
- // but no stateful hooks have been used.
- // We want to match the production code behavior (which will use HooksDispatcherOnMount),
- // but with the extra DEV validation to ensure hooks ordering hasn't changed.
- // This dispatcher does that.
- ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
- } else {
- ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
- }
- }
-
- var children = Component(props, refOrContext);
-
- if (didScheduleRenderPhaseUpdate) {
- do {
- didScheduleRenderPhaseUpdate = false;
- numberOfReRenders += 1;
-
- {
- // Even when hot reloading, allow dependencies to stabilize
- // after first render to prevent infinite render phase updates.
- ignorePreviousDependencies = false;
- } // Start over from the beginning of the list
-
-
- nextCurrentHook = current !== null ? current.memoizedState : null;
- nextWorkInProgressHook = firstWorkInProgressHook;
- currentHook = null;
- workInProgressHook = null;
- componentUpdateQueue = null;
-
- {
- // Also validate hook order for cascading updates.
- hookTypesUpdateIndexDev = -1;
- }
-
- ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
- children = Component(props, refOrContext);
- } while (didScheduleRenderPhaseUpdate);
-
- renderPhaseUpdates = null;
- numberOfReRenders = 0;
- } // We can assume the previous dispatcher is always this one, since we set it
- // at the beginning of the render phase and there's no re-entrancy.
-
-
- ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
- var renderedWork = currentlyRenderingFiber$1;
- renderedWork.memoizedState = firstWorkInProgressHook;
- renderedWork.expirationTime = remainingExpirationTime;
- renderedWork.updateQueue = componentUpdateQueue;
- renderedWork.effectTag |= sideEffectTag;
-
- {
- renderedWork._debugHookTypes = hookTypesDev;
- } // This check uses currentHook so that it works the same in DEV and prod bundles.
- // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.
-
-
- var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
- renderExpirationTime$1 = NoWork;
- currentlyRenderingFiber$1 = null;
- currentHook = null;
- nextCurrentHook = null;
- firstWorkInProgressHook = null;
- workInProgressHook = null;
- nextWorkInProgressHook = null;
-
- {
- currentHookNameInDev = null;
- hookTypesDev = null;
- hookTypesUpdateIndexDev = -1;
- }
-
- remainingExpirationTime = NoWork;
- componentUpdateQueue = null;
- sideEffectTag = 0; // These were reset above
- // didScheduleRenderPhaseUpdate = false;
- // renderPhaseUpdates = null;
- // numberOfReRenders = 0;
-
- if (!!didRenderTooFewHooks) {
- {
- throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
- }
- }
-
- return children;
- }
- function bailoutHooks(current, workInProgress, expirationTime) {
- workInProgress.updateQueue = current.updateQueue;
- workInProgress.effectTag &= ~(Passive | Update);
-
- if (current.expirationTime <= expirationTime) {
- current.expirationTime = NoWork;
- }
- }
- function resetHooks() {
- // We can assume the previous dispatcher is always this one, since we set it
- // at the beginning of the render phase and there's no re-entrancy.
- ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; // This is used to reset the state of this module when a component throws.
- // It's also called inside mountIndeterminateComponent if we determine the
- // component is a module-style component.
-
- renderExpirationTime$1 = NoWork;
- currentlyRenderingFiber$1 = null;
- currentHook = null;
- nextCurrentHook = null;
- firstWorkInProgressHook = null;
- workInProgressHook = null;
- nextWorkInProgressHook = null;
-
- {
- hookTypesDev = null;
- hookTypesUpdateIndexDev = -1;
- currentHookNameInDev = null;
- }
-
- remainingExpirationTime = NoWork;
- componentUpdateQueue = null;
- sideEffectTag = 0;
- didScheduleRenderPhaseUpdate = false;
- renderPhaseUpdates = null;
- numberOfReRenders = 0;
- }
-
- function mountWorkInProgressHook() {
- var hook = {
- memoizedState: null,
- baseState: null,
- queue: null,
- baseUpdate: null,
- next: null
- };
-
- if (workInProgressHook === null) {
- // This is the first hook in the list
- firstWorkInProgressHook = workInProgressHook = hook;
- } else {
- // Append to the end of the list
- workInProgressHook = workInProgressHook.next = hook;
- }
-
- return workInProgressHook;
- }
-
- function updateWorkInProgressHook() {
- // This function is used both for updates and for re-renders triggered by a
- // render phase update. It assumes there is either a current hook we can
- // clone, or a work-in-progress hook from a previous render pass that we can
- // use as a base. When we reach the end of the base list, we must switch to
- // the dispatcher used for mounts.
- if (nextWorkInProgressHook !== null) {
- // There's already a work-in-progress. Reuse it.
- workInProgressHook = nextWorkInProgressHook;
- nextWorkInProgressHook = workInProgressHook.next;
- currentHook = nextCurrentHook;
- nextCurrentHook = currentHook !== null ? currentHook.next : null;
- } else {
- // Clone from the current hook.
- if (!(nextCurrentHook !== null)) {
- {
- throw Error("Rendered more hooks than during the previous render.");
- }
- }
-
- currentHook = nextCurrentHook;
- var newHook = {
- memoizedState: currentHook.memoizedState,
- baseState: currentHook.baseState,
- queue: currentHook.queue,
- baseUpdate: currentHook.baseUpdate,
- next: null
- };
-
- if (workInProgressHook === null) {
- // This is the first hook in the list.
- workInProgressHook = firstWorkInProgressHook = newHook;
- } else {
- // Append to the end of the list.
- workInProgressHook = workInProgressHook.next = newHook;
- }
-
- nextCurrentHook = currentHook.next;
- }
-
- return workInProgressHook;
- }
-
- function createFunctionComponentUpdateQueue() {
- return {
- lastEffect: null
- };
- }
-
- function basicStateReducer(state, action) {
- return typeof action === 'function' ? action(state) : action;
- }
-
- function mountReducer(reducer, initialArg, init) {
- var hook = mountWorkInProgressHook();
- var initialState;
-
- if (init !== undefined) {
- initialState = init(initialArg);
- } else {
- initialState = initialArg;
- }
-
- hook.memoizedState = hook.baseState = initialState;
- var queue = hook.queue = {
- last: null,
- dispatch: null,
- lastRenderedReducer: reducer,
- lastRenderedState: initialState
- };
- var dispatch = queue.dispatch = dispatchAction.bind(null, // Flow doesn't know this is non-null, but we do.
- currentlyRenderingFiber$1, queue);
- return [hook.memoizedState, dispatch];
- }
-
- function updateReducer(reducer, initialArg, init) {
- var hook = updateWorkInProgressHook();
- var queue = hook.queue;
-
- if (!(queue !== null)) {
- {
- throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");
- }
- }
-
- queue.lastRenderedReducer = reducer;
-
- if (numberOfReRenders > 0) {
- // This is a re-render. Apply the new render phase updates to the previous
- // work-in-progress hook.
- var _dispatch = queue.dispatch;
-
- if (renderPhaseUpdates !== null) {
- // Render phase updates are stored in a map of queue -> linked list
- var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
-
- if (firstRenderPhaseUpdate !== undefined) {
- renderPhaseUpdates.delete(queue);
- var newState = hook.memoizedState;
- var update = firstRenderPhaseUpdate;
-
- do {
- // Process this render phase update. We don't have to check the
- // priority because it will always be the same as the current
- // render's.
- var action = update.action;
- newState = reducer(newState, action);
- update = update.next;
- } while (update !== null); // Mark that the fiber performed work, but only if the new state is
- // different from the current state.
-
-
- if (!is$1(newState, hook.memoizedState)) {
- markWorkInProgressReceivedUpdate();
- }
-
- hook.memoizedState = newState; // Don't persist the state accumulated from the render phase updates to
- // the base state unless the queue is empty.
- // TODO: Not sure if this is the desired semantics, but it's what we
- // do for gDSFP. I can't remember why.
-
- if (hook.baseUpdate === queue.last) {
- hook.baseState = newState;
- }
-
- queue.lastRenderedState = newState;
- return [newState, _dispatch];
- }
- }
-
- return [hook.memoizedState, _dispatch];
- } // The last update in the entire queue
-
-
- var last = queue.last; // The last update that is part of the base state.
-
- var baseUpdate = hook.baseUpdate;
- var baseState = hook.baseState; // Find the first unprocessed update.
-
- var first;
-
- if (baseUpdate !== null) {
- if (last !== null) {
- // For the first update, the queue is a circular linked list where
- // `queue.last.next = queue.first`. Once the first update commits, and
- // the `baseUpdate` is no longer empty, we can unravel the list.
- last.next = null;
- }
-
- first = baseUpdate.next;
- } else {
- first = last !== null ? last.next : null;
- }
-
- if (first !== null) {
- var _newState = baseState;
- var newBaseState = null;
- var newBaseUpdate = null;
- var prevUpdate = baseUpdate;
- var _update = first;
- var didSkip = false;
-
- do {
- var updateExpirationTime = _update.expirationTime;
-
- if (updateExpirationTime < renderExpirationTime$1) {
- // Priority is insufficient. Skip this update. If this is the first
- // skipped update, the previous update/state is the new base
- // update/state.
- if (!didSkip) {
- didSkip = true;
- newBaseUpdate = prevUpdate;
- newBaseState = _newState;
- } // Update the remaining priority in the queue.
-
-
- if (updateExpirationTime > remainingExpirationTime) {
- remainingExpirationTime = updateExpirationTime;
- markUnprocessedUpdateTime(remainingExpirationTime);
- }
- } else {
- // This update does have sufficient priority.
- // Mark the event time of this update as relevant to this render pass.
- // TODO: This should ideally use the true event time of this update rather than
- // its priority which is a derived and not reverseable value.
- // TODO: We should skip this update if it was already committed but currently
- // we have no way of detecting the difference between a committed and suspended
- // update here.
- markRenderEventTimeAndConfig(updateExpirationTime, _update.suspenseConfig); // Process this update.
-
- if (_update.eagerReducer === reducer) {
- // If this update was processed eagerly, and its reducer matches the
- // current reducer, we can use the eagerly computed state.
- _newState = _update.eagerState;
- } else {
- var _action = _update.action;
- _newState = reducer(_newState, _action);
- }
- }
-
- prevUpdate = _update;
- _update = _update.next;
- } while (_update !== null && _update !== first);
-
- if (!didSkip) {
- newBaseUpdate = prevUpdate;
- newBaseState = _newState;
- } // Mark that the fiber performed work, but only if the new state is
- // different from the current state.
-
-
- if (!is$1(_newState, hook.memoizedState)) {
- markWorkInProgressReceivedUpdate();
- }
-
- hook.memoizedState = _newState;
- hook.baseUpdate = newBaseUpdate;
- hook.baseState = newBaseState;
- queue.lastRenderedState = _newState;
- }
-
- var dispatch = queue.dispatch;
- return [hook.memoizedState, dispatch];
- }
-
- function mountState(initialState) {
- var hook = mountWorkInProgressHook();
-
- if (typeof initialState === 'function') {
- initialState = initialState();
- }
-
- hook.memoizedState = hook.baseState = initialState;
- var queue = hook.queue = {
- last: null,
- dispatch: null,
- lastRenderedReducer: basicStateReducer,
- lastRenderedState: initialState
- };
- var dispatch = queue.dispatch = dispatchAction.bind(null, // Flow doesn't know this is non-null, but we do.
- currentlyRenderingFiber$1, queue);
- return [hook.memoizedState, dispatch];
- }
-
- function updateState(initialState) {
- return updateReducer(basicStateReducer, initialState);
- }
-
- function pushEffect(tag, create, destroy, deps) {
- var effect = {
- tag: tag,
- create: create,
- destroy: destroy,
- deps: deps,
- // Circular
- next: null
- };
-
- if (componentUpdateQueue === null) {
- componentUpdateQueue = createFunctionComponentUpdateQueue();
- componentUpdateQueue.lastEffect = effect.next = effect;
- } else {
- var lastEffect = componentUpdateQueue.lastEffect;
-
- if (lastEffect === null) {
- componentUpdateQueue.lastEffect = effect.next = effect;
- } else {
- var firstEffect = lastEffect.next;
- lastEffect.next = effect;
- effect.next = firstEffect;
- componentUpdateQueue.lastEffect = effect;
- }
- }
-
- return effect;
- }
-
- function mountRef(initialValue) {
- var hook = mountWorkInProgressHook();
- var ref = {
- current: initialValue
- };
-
- {
- Object.seal(ref);
- }
-
- hook.memoizedState = ref;
- return ref;
- }
-
- function updateRef(initialValue) {
- var hook = updateWorkInProgressHook();
- return hook.memoizedState;
- }
-
- function mountEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
- var hook = mountWorkInProgressHook();
- var nextDeps = deps === undefined ? null : deps;
- sideEffectTag |= fiberEffectTag;
- hook.memoizedState = pushEffect(hookEffectTag, create, undefined, nextDeps);
- }
-
- function updateEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
- var hook = updateWorkInProgressHook();
- var nextDeps = deps === undefined ? null : deps;
- var destroy = undefined;
-
- if (currentHook !== null) {
- var prevEffect = currentHook.memoizedState;
- destroy = prevEffect.destroy;
-
- if (nextDeps !== null) {
- var prevDeps = prevEffect.deps;
-
- if (areHookInputsEqual(nextDeps, prevDeps)) {
- pushEffect(NoEffect$1, create, destroy, nextDeps);
- return;
- }
- }
- }
-
- sideEffectTag |= fiberEffectTag;
- hook.memoizedState = pushEffect(hookEffectTag, create, destroy, nextDeps);
- }
-
- function mountEffect(create, deps) {
- {
- // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
- if ('undefined' !== typeof jest) {
- warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
- }
- }
-
- return mountEffectImpl(Update | Passive, UnmountPassive | MountPassive, create, deps);
- }
-
- function updateEffect(create, deps) {
- {
- // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
- if ('undefined' !== typeof jest) {
- warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
- }
- }
-
- return updateEffectImpl(Update | Passive, UnmountPassive | MountPassive, create, deps);
- }
-
- function mountLayoutEffect(create, deps) {
- return mountEffectImpl(Update, UnmountMutation | MountLayout, create, deps);
- }
-
- function updateLayoutEffect(create, deps) {
- return updateEffectImpl(Update, UnmountMutation | MountLayout, create, deps);
- }
-
- function imperativeHandleEffect(create, ref) {
- if (typeof ref === 'function') {
- var refCallback = ref;
-
- var _inst = create();
-
- refCallback(_inst);
- return function () {
- refCallback(null);
- };
- } else if (ref !== null && ref !== undefined) {
- var refObject = ref;
-
- {
- !refObject.hasOwnProperty('current') ? warning$1(false, 'Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}') : void 0;
- }
-
- var _inst2 = create();
-
- refObject.current = _inst2;
- return function () {
- refObject.current = null;
- };
- }
- }
-
- function mountImperativeHandle(ref, create, deps) {
- {
- !(typeof create === 'function') ? warning$1(false, 'Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null') : void 0;
- } // TODO: If deps are provided, should we skip comparing the ref itself?
-
-
- var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;
- return mountEffectImpl(Update, UnmountMutation | MountLayout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
- }
-
- function updateImperativeHandle(ref, create, deps) {
- {
- !(typeof create === 'function') ? warning$1(false, 'Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null') : void 0;
- } // TODO: If deps are provided, should we skip comparing the ref itself?
-
-
- var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;
- return updateEffectImpl(Update, UnmountMutation | MountLayout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
- }
-
- function mountDebugValue(value, formatterFn) {// This hook is normally a no-op.
- // The react-debug-hooks package injects its own implementation
- // so that e.g. DevTools can display custom hook values.
- }
-
- var updateDebugValue = mountDebugValue;
-
- function mountCallback(callback, deps) {
- var hook = mountWorkInProgressHook();
- var nextDeps = deps === undefined ? null : deps;
- hook.memoizedState = [callback, nextDeps];
- return callback;
- }
-
- function updateCallback(callback, deps) {
- var hook = updateWorkInProgressHook();
- var nextDeps = deps === undefined ? null : deps;
- var prevState = hook.memoizedState;
-
- if (prevState !== null) {
- if (nextDeps !== null) {
- var prevDeps = prevState[1];
-
- if (areHookInputsEqual(nextDeps, prevDeps)) {
- return prevState[0];
- }
- }
- }
-
- hook.memoizedState = [callback, nextDeps];
- return callback;
- }
-
- function mountMemo(nextCreate, deps) {
- var hook = mountWorkInProgressHook();
- var nextDeps = deps === undefined ? null : deps;
- var nextValue = nextCreate();
- hook.memoizedState = [nextValue, nextDeps];
- return nextValue;
- }
-
- function updateMemo(nextCreate, deps) {
- var hook = updateWorkInProgressHook();
- var nextDeps = deps === undefined ? null : deps;
- var prevState = hook.memoizedState;
-
- if (prevState !== null) {
- // Assume these are defined. If they're not, areHookInputsEqual will warn.
- if (nextDeps !== null) {
- var prevDeps = prevState[1];
-
- if (areHookInputsEqual(nextDeps, prevDeps)) {
- return prevState[0];
- }
- }
- }
-
- var nextValue = nextCreate();
- hook.memoizedState = [nextValue, nextDeps];
- return nextValue;
- }
-
- function mountDeferredValue(value, config) {
- var _mountState = mountState(value),
- prevValue = _mountState[0],
- setValue = _mountState[1];
-
- mountEffect(function () {
- Scheduler.unstable_next(function () {
- var previousConfig = ReactCurrentBatchConfig$1.suspense;
- ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
-
- try {
- setValue(value);
- } finally {
- ReactCurrentBatchConfig$1.suspense = previousConfig;
- }
- });
- }, [value, config]);
- return prevValue;
- }
-
- function updateDeferredValue(value, config) {
- var _updateState = updateState(value),
- prevValue = _updateState[0],
- setValue = _updateState[1];
-
- updateEffect(function () {
- Scheduler.unstable_next(function () {
- var previousConfig = ReactCurrentBatchConfig$1.suspense;
- ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
-
- try {
- setValue(value);
- } finally {
- ReactCurrentBatchConfig$1.suspense = previousConfig;
- }
- });
- }, [value, config]);
- return prevValue;
- }
-
- function mountTransition(config) {
- var _mountState2 = mountState(false),
- isPending = _mountState2[0],
- setPending = _mountState2[1];
-
- var startTransition = mountCallback(function (callback) {
- setPending(true);
- Scheduler.unstable_next(function () {
- var previousConfig = ReactCurrentBatchConfig$1.suspense;
- ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
-
- try {
- setPending(false);
- callback();
- } finally {
- ReactCurrentBatchConfig$1.suspense = previousConfig;
- }
- });
- }, [config, isPending]);
- return [startTransition, isPending];
- }
-
- function updateTransition(config) {
- var _updateState2 = updateState(false),
- isPending = _updateState2[0],
- setPending = _updateState2[1];
-
- var startTransition = updateCallback(function (callback) {
- setPending(true);
- Scheduler.unstable_next(function () {
- var previousConfig = ReactCurrentBatchConfig$1.suspense;
- ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
-
- try {
- setPending(false);
- callback();
- } finally {
- ReactCurrentBatchConfig$1.suspense = previousConfig;
- }
- });
- }, [config, isPending]);
- return [startTransition, isPending];
- }
-
- function dispatchAction(fiber, queue, action) {
- if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
- {
- throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
- }
- }
-
- {
- !(typeof arguments[3] !== 'function') ? warning$1(false, "State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().') : void 0;
- }
-
- var alternate = fiber.alternate;
-
- if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {
- // This is a render phase update. Stash it in a lazily-created map of
- // queue -> linked list of updates. After this render pass, we'll restart
- // and apply the stashed updates on top of the work-in-progress hook.
- didScheduleRenderPhaseUpdate = true;
- var update = {
- expirationTime: renderExpirationTime$1,
- suspenseConfig: null,
- action: action,
- eagerReducer: null,
- eagerState: null,
- next: null
- };
-
- {
- update.priority = getCurrentPriorityLevel();
- }
-
- if (renderPhaseUpdates === null) {
- renderPhaseUpdates = new Map();
- }
-
- var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
-
- if (firstRenderPhaseUpdate === undefined) {
- renderPhaseUpdates.set(queue, update);
- } else {
- // Append the update to the end of the list.
- var lastRenderPhaseUpdate = firstRenderPhaseUpdate;
-
- while (lastRenderPhaseUpdate.next !== null) {
- lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;
- }
-
- lastRenderPhaseUpdate.next = update;
- }
- } else {
- var currentTime = requestCurrentTimeForUpdate();
- var suspenseConfig = requestCurrentSuspenseConfig();
- var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
- var _update2 = {
- expirationTime: expirationTime,
- suspenseConfig: suspenseConfig,
- action: action,
- eagerReducer: null,
- eagerState: null,
- next: null
- };
-
- {
- _update2.priority = getCurrentPriorityLevel();
- } // Append the update to the end of the list.
-
-
- var last = queue.last;
-
- if (last === null) {
- // This is the first update. Create a circular list.
- _update2.next = _update2;
- } else {
- var first = last.next;
-
- if (first !== null) {
- // Still circular.
- _update2.next = first;
- }
-
- last.next = _update2;
- }
-
- queue.last = _update2;
-
- if (fiber.expirationTime === NoWork && (alternate === null || alternate.expirationTime === NoWork)) {
- // The queue is currently empty, which means we can eagerly compute the
- // next state before entering the render phase. If the new state is the
- // same as the current state, we may be able to bail out entirely.
- var lastRenderedReducer = queue.lastRenderedReducer;
-
- if (lastRenderedReducer !== null) {
- var prevDispatcher;
-
- {
- prevDispatcher = ReactCurrentDispatcher$1.current;
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
- }
-
- try {
- var currentState = queue.lastRenderedState;
- var eagerState = lastRenderedReducer(currentState, action); // Stash the eagerly computed state, and the reducer used to compute
- // it, on the update object. If the reducer hasn't changed by the
- // time we enter the render phase, then the eager state can be used
- // without calling the reducer again.
-
- _update2.eagerReducer = lastRenderedReducer;
- _update2.eagerState = eagerState;
-
- if (is$1(eagerState, currentState)) {
- // Fast path. We can bail out without scheduling React to re-render.
- // It's still possible that we'll need to rebase this update later,
- // if the component re-renders for a different reason and by that
- // time the reducer has changed.
- return;
- }
- } catch (error) {// Suppress the error. It will throw again in the render phase.
- } finally {
- {
- ReactCurrentDispatcher$1.current = prevDispatcher;
- }
- }
- }
- }
-
- {
- // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
- if ('undefined' !== typeof jest) {
- warnIfNotScopedWithMatchingAct(fiber);
- warnIfNotCurrentlyActingUpdatesInDev(fiber);
- }
- }
-
- scheduleWork(fiber, expirationTime);
- }
- }
-
- var ContextOnlyDispatcher = {
- readContext: readContext,
- useCallback: throwInvalidHookError,
- useContext: throwInvalidHookError,
- useEffect: throwInvalidHookError,
- useImperativeHandle: throwInvalidHookError,
- useLayoutEffect: throwInvalidHookError,
- useMemo: throwInvalidHookError,
- useReducer: throwInvalidHookError,
- useRef: throwInvalidHookError,
- useState: throwInvalidHookError,
- useDebugValue: throwInvalidHookError,
- useResponder: throwInvalidHookError,
- useDeferredValue: throwInvalidHookError,
- useTransition: throwInvalidHookError
- };
- var HooksDispatcherOnMountInDEV = null;
- var HooksDispatcherOnMountWithHookTypesInDEV = null;
- var HooksDispatcherOnUpdateInDEV = null;
- var InvalidNestedHooksDispatcherOnMountInDEV = null;
- var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
-
- {
- var warnInvalidContextAccess = function () {
- warning$1(false, 'Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');
- };
-
- var warnInvalidHookAccess = function () {
- warning$1(false, 'Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://fb.me/rules-of-hooks');
- };
-
- HooksDispatcherOnMountInDEV = {
- readContext: function (context, observedBits) {
- return readContext(context, observedBits);
- },
- useCallback: function (callback, deps) {
- currentHookNameInDev = 'useCallback';
- mountHookTypesDev();
- checkDepsAreArrayDev(deps);
- return mountCallback(callback, deps);
- },
- useContext: function (context, observedBits) {
- currentHookNameInDev = 'useContext';
- mountHookTypesDev();
- return readContext(context, observedBits);
- },
- useEffect: function (create, deps) {
- currentHookNameInDev = 'useEffect';
- mountHookTypesDev();
- checkDepsAreArrayDev(deps);
- return mountEffect(create, deps);
- },
- useImperativeHandle: function (ref, create, deps) {
- currentHookNameInDev = 'useImperativeHandle';
- mountHookTypesDev();
- checkDepsAreArrayDev(deps);
- return mountImperativeHandle(ref, create, deps);
- },
- useLayoutEffect: function (create, deps) {
- currentHookNameInDev = 'useLayoutEffect';
- mountHookTypesDev();
- checkDepsAreArrayDev(deps);
- return mountLayoutEffect(create, deps);
- },
- useMemo: function (create, deps) {
- currentHookNameInDev = 'useMemo';
- mountHookTypesDev();
- checkDepsAreArrayDev(deps);
- var prevDispatcher = ReactCurrentDispatcher$1.current;
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
-
- try {
- return mountMemo(create, deps);
- } finally {
- ReactCurrentDispatcher$1.current = prevDispatcher;
- }
- },
- useReducer: function (reducer, initialArg, init) {
- currentHookNameInDev = 'useReducer';
- mountHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher$1.current;
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
-
- try {
- return mountReducer(reducer, initialArg, init);
- } finally {
- ReactCurrentDispatcher$1.current = prevDispatcher;
- }
- },
- useRef: function (initialValue) {
- currentHookNameInDev = 'useRef';
- mountHookTypesDev();
- return mountRef(initialValue);
- },
- useState: function (initialState) {
- currentHookNameInDev = 'useState';
- mountHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher$1.current;
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
-
- try {
- return mountState(initialState);
- } finally {
- ReactCurrentDispatcher$1.current = prevDispatcher;
- }
- },
- useDebugValue: function (value, formatterFn) {
- currentHookNameInDev = 'useDebugValue';
- mountHookTypesDev();
- return mountDebugValue(value, formatterFn);
- },
- useResponder: function (responder, props) {
- currentHookNameInDev = 'useResponder';
- mountHookTypesDev();
- return createResponderListener(responder, props);
- },
- useDeferredValue: function (value, config) {
- currentHookNameInDev = 'useDeferredValue';
- mountHookTypesDev();
- return mountDeferredValue(value, config);
- },
- useTransition: function (config) {
- currentHookNameInDev = 'useTransition';
- mountHookTypesDev();
- return mountTransition(config);
- }
- };
- HooksDispatcherOnMountWithHookTypesInDEV = {
- readContext: function (context, observedBits) {
- return readContext(context, observedBits);
- },
- useCallback: function (callback, deps) {
- currentHookNameInDev = 'useCallback';
- updateHookTypesDev();
- return mountCallback(callback, deps);
- },
- useContext: function (context, observedBits) {
- currentHookNameInDev = 'useContext';
- updateHookTypesDev();
- return readContext(context, observedBits);
- },
- useEffect: function (create, deps) {
- currentHookNameInDev = 'useEffect';
- updateHookTypesDev();
- return mountEffect(create, deps);
- },
- useImperativeHandle: function (ref, create, deps) {
- currentHookNameInDev = 'useImperativeHandle';
- updateHookTypesDev();
- return mountImperativeHandle(ref, create, deps);
- },
- useLayoutEffect: function (create, deps) {
- currentHookNameInDev = 'useLayoutEffect';
- updateHookTypesDev();
- return mountLayoutEffect(create, deps);
- },
- useMemo: function (create, deps) {
- currentHookNameInDev = 'useMemo';
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher$1.current;
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
-
- try {
- return mountMemo(create, deps);
- } finally {
- ReactCurrentDispatcher$1.current = prevDispatcher;
- }
- },
- useReducer: function (reducer, initialArg, init) {
- currentHookNameInDev = 'useReducer';
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher$1.current;
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
-
- try {
- return mountReducer(reducer, initialArg, init);
- } finally {
- ReactCurrentDispatcher$1.current = prevDispatcher;
- }
- },
- useRef: function (initialValue) {
- currentHookNameInDev = 'useRef';
- updateHookTypesDev();
- return mountRef(initialValue);
- },
- useState: function (initialState) {
- currentHookNameInDev = 'useState';
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher$1.current;
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
-
- try {
- return mountState(initialState);
- } finally {
- ReactCurrentDispatcher$1.current = prevDispatcher;
- }
- },
- useDebugValue: function (value, formatterFn) {
- currentHookNameInDev = 'useDebugValue';
- updateHookTypesDev();
- return mountDebugValue(value, formatterFn);
- },
- useResponder: function (responder, props) {
- currentHookNameInDev = 'useResponder';
- updateHookTypesDev();
- return createResponderListener(responder, props);
- },
- useDeferredValue: function (value, config) {
- currentHookNameInDev = 'useDeferredValue';
- updateHookTypesDev();
- return mountDeferredValue(value, config);
- },
- useTransition: function (config) {
- currentHookNameInDev = 'useTransition';
- updateHookTypesDev();
- return mountTransition(config);
- }
- };
- HooksDispatcherOnUpdateInDEV = {
- readContext: function (context, observedBits) {
- return readContext(context, observedBits);
- },
- useCallback: function (callback, deps) {
- currentHookNameInDev = 'useCallback';
- updateHookTypesDev();
- return updateCallback(callback, deps);
- },
- useContext: function (context, observedBits) {
- currentHookNameInDev = 'useContext';
- updateHookTypesDev();
- return readContext(context, observedBits);
- },
- useEffect: function (create, deps) {
- currentHookNameInDev = 'useEffect';
- updateHookTypesDev();
- return updateEffect(create, deps);
- },
- useImperativeHandle: function (ref, create, deps) {
- currentHookNameInDev = 'useImperativeHandle';
- updateHookTypesDev();
- return updateImperativeHandle(ref, create, deps);
- },
- useLayoutEffect: function (create, deps) {
- currentHookNameInDev = 'useLayoutEffect';
- updateHookTypesDev();
- return updateLayoutEffect(create, deps);
- },
- useMemo: function (create, deps) {
- currentHookNameInDev = 'useMemo';
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher$1.current;
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
-
- try {
- return updateMemo(create, deps);
- } finally {
- ReactCurrentDispatcher$1.current = prevDispatcher;
- }
- },
- useReducer: function (reducer, initialArg, init) {
- currentHookNameInDev = 'useReducer';
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher$1.current;
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
-
- try {
- return updateReducer(reducer, initialArg, init);
- } finally {
- ReactCurrentDispatcher$1.current = prevDispatcher;
- }
- },
- useRef: function (initialValue) {
- currentHookNameInDev = 'useRef';
- updateHookTypesDev();
- return updateRef(initialValue);
- },
- useState: function (initialState) {
- currentHookNameInDev = 'useState';
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher$1.current;
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
-
- try {
- return updateState(initialState);
- } finally {
- ReactCurrentDispatcher$1.current = prevDispatcher;
- }
- },
- useDebugValue: function (value, formatterFn) {
- currentHookNameInDev = 'useDebugValue';
- updateHookTypesDev();
- return updateDebugValue(value, formatterFn);
- },
- useResponder: function (responder, props) {
- currentHookNameInDev = 'useResponder';
- updateHookTypesDev();
- return createResponderListener(responder, props);
- },
- useDeferredValue: function (value, config) {
- currentHookNameInDev = 'useDeferredValue';
- updateHookTypesDev();
- return updateDeferredValue(value, config);
- },
- useTransition: function (config) {
- currentHookNameInDev = 'useTransition';
- updateHookTypesDev();
- return updateTransition(config);
- }
- };
- InvalidNestedHooksDispatcherOnMountInDEV = {
- readContext: function (context, observedBits) {
- warnInvalidContextAccess();
- return readContext(context, observedBits);
- },
- useCallback: function (callback, deps) {
- currentHookNameInDev = 'useCallback';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountCallback(callback, deps);
- },
- useContext: function (context, observedBits) {
- currentHookNameInDev = 'useContext';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return readContext(context, observedBits);
- },
- useEffect: function (create, deps) {
- currentHookNameInDev = 'useEffect';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountEffect(create, deps);
- },
- useImperativeHandle: function (ref, create, deps) {
- currentHookNameInDev = 'useImperativeHandle';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountImperativeHandle(ref, create, deps);
- },
- useLayoutEffect: function (create, deps) {
- currentHookNameInDev = 'useLayoutEffect';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountLayoutEffect(create, deps);
- },
- useMemo: function (create, deps) {
- currentHookNameInDev = 'useMemo';
- warnInvalidHookAccess();
- mountHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher$1.current;
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
-
- try {
- return mountMemo(create, deps);
- } finally {
- ReactCurrentDispatcher$1.current = prevDispatcher;
- }
- },
- useReducer: function (reducer, initialArg, init) {
- currentHookNameInDev = 'useReducer';
- warnInvalidHookAccess();
- mountHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher$1.current;
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
-
- try {
- return mountReducer(reducer, initialArg, init);
- } finally {
- ReactCurrentDispatcher$1.current = prevDispatcher;
- }
- },
- useRef: function (initialValue) {
- currentHookNameInDev = 'useRef';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountRef(initialValue);
- },
- useState: function (initialState) {
- currentHookNameInDev = 'useState';
- warnInvalidHookAccess();
- mountHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher$1.current;
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
-
- try {
- return mountState(initialState);
- } finally {
- ReactCurrentDispatcher$1.current = prevDispatcher;
- }
- },
- useDebugValue: function (value, formatterFn) {
- currentHookNameInDev = 'useDebugValue';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountDebugValue(value, formatterFn);
- },
- useResponder: function (responder, props) {
- currentHookNameInDev = 'useResponder';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return createResponderListener(responder, props);
- },
- useDeferredValue: function (value, config) {
- currentHookNameInDev = 'useDeferredValue';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountDeferredValue(value, config);
- },
- useTransition: function (config) {
- currentHookNameInDev = 'useTransition';
- warnInvalidHookAccess();
- mountHookTypesDev();
- return mountTransition(config);
- }
- };
- InvalidNestedHooksDispatcherOnUpdateInDEV = {
- readContext: function (context, observedBits) {
- warnInvalidContextAccess();
- return readContext(context, observedBits);
- },
- useCallback: function (callback, deps) {
- currentHookNameInDev = 'useCallback';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateCallback(callback, deps);
- },
- useContext: function (context, observedBits) {
- currentHookNameInDev = 'useContext';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return readContext(context, observedBits);
- },
- useEffect: function (create, deps) {
- currentHookNameInDev = 'useEffect';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateEffect(create, deps);
- },
- useImperativeHandle: function (ref, create, deps) {
- currentHookNameInDev = 'useImperativeHandle';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateImperativeHandle(ref, create, deps);
- },
- useLayoutEffect: function (create, deps) {
- currentHookNameInDev = 'useLayoutEffect';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateLayoutEffect(create, deps);
- },
- useMemo: function (create, deps) {
- currentHookNameInDev = 'useMemo';
- warnInvalidHookAccess();
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher$1.current;
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
-
- try {
- return updateMemo(create, deps);
- } finally {
- ReactCurrentDispatcher$1.current = prevDispatcher;
- }
- },
- useReducer: function (reducer, initialArg, init) {
- currentHookNameInDev = 'useReducer';
- warnInvalidHookAccess();
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher$1.current;
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
-
- try {
- return updateReducer(reducer, initialArg, init);
- } finally {
- ReactCurrentDispatcher$1.current = prevDispatcher;
- }
- },
- useRef: function (initialValue) {
- currentHookNameInDev = 'useRef';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateRef(initialValue);
- },
- useState: function (initialState) {
- currentHookNameInDev = 'useState';
- warnInvalidHookAccess();
- updateHookTypesDev();
- var prevDispatcher = ReactCurrentDispatcher$1.current;
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
-
- try {
- return updateState(initialState);
- } finally {
- ReactCurrentDispatcher$1.current = prevDispatcher;
- }
- },
- useDebugValue: function (value, formatterFn) {
- currentHookNameInDev = 'useDebugValue';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateDebugValue(value, formatterFn);
- },
- useResponder: function (responder, props) {
- currentHookNameInDev = 'useResponder';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return createResponderListener(responder, props);
- },
- useDeferredValue: function (value, config) {
- currentHookNameInDev = 'useDeferredValue';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateDeferredValue(value, config);
- },
- useTransition: function (config) {
- currentHookNameInDev = 'useTransition';
- warnInvalidHookAccess();
- updateHookTypesDev();
- return updateTransition(config);
- }
- };
- }
-
- // CommonJS interop named imports.
-
- var now$1 = Scheduler.unstable_now;
- var commitTime = 0;
- var profilerStartTime = -1;
-
- function getCommitTime() {
- return commitTime;
- }
-
- function recordCommitTime() {
- if (!enableProfilerTimer) {
- return;
- }
-
- commitTime = now$1();
- }
-
- function startProfilerTimer(fiber) {
- if (!enableProfilerTimer) {
- return;
- }
-
- profilerStartTime = now$1();
-
- if (fiber.actualStartTime < 0) {
- fiber.actualStartTime = now$1();
- }
- }
-
- function stopProfilerTimerIfRunning(fiber) {
- if (!enableProfilerTimer) {
- return;
- }
-
- profilerStartTime = -1;
- }
-
- function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {
- if (!enableProfilerTimer) {
- return;
- }
-
- if (profilerStartTime >= 0) {
- var elapsedTime = now$1() - profilerStartTime;
- fiber.actualDuration += elapsedTime;
-
- if (overrideBaseTime) {
- fiber.selfBaseDuration = elapsedTime;
- }
-
- profilerStartTime = -1;
- }
- }
-
- // This may have been an insertion or a hydration.
-
- var hydrationParentFiber = null;
- var nextHydratableInstance = null;
- var isHydrating = false;
-
- function warnIfHydrating() {
- {
- !!isHydrating ? warning$1(false, 'We should not be hydrating here. This is a bug in React. Please file a bug.') : void 0;
- }
- }
-
- function enterHydrationState(fiber) {
- if (!supportsHydration) {
- return false;
- }
-
- var parentInstance = fiber.stateNode.containerInfo;
- nextHydratableInstance = getFirstHydratableChild(parentInstance);
- hydrationParentFiber = fiber;
- isHydrating = true;
- return true;
- }
-
- function reenterHydrationStateFromDehydratedSuspenseInstance(fiber, suspenseInstance) {
- if (!supportsHydration) {
- return false;
- }
-
- nextHydratableInstance = getNextHydratableSibling(suspenseInstance);
- popToNextHostParent(fiber);
- isHydrating = true;
- return true;
- }
-
- function deleteHydratableInstance(returnFiber, instance) {
- {
- switch (returnFiber.tag) {
- case HostRoot:
- didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);
- break;
-
- case HostComponent:
- didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);
- break;
- }
- }
-
- var childToDelete = createFiberFromHostInstanceForDeletion();
- childToDelete.stateNode = instance;
- childToDelete.return = returnFiber;
- childToDelete.effectTag = Deletion; // This might seem like it belongs on progressedFirstDeletion. However,
- // these children are not part of the reconciliation list of children.
- // Even if we abort and rereconcile the children, that will try to hydrate
- // again and the nodes are still in the host tree so these will be
- // recreated.
-
- if (returnFiber.lastEffect !== null) {
- returnFiber.lastEffect.nextEffect = childToDelete;
- returnFiber.lastEffect = childToDelete;
- } else {
- returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
- }
- }
-
- function insertNonHydratedInstance(returnFiber, fiber) {
- fiber.effectTag = fiber.effectTag & ~Hydrating | Placement;
-
- {
- switch (returnFiber.tag) {
- case HostRoot:
- {
- var parentContainer = returnFiber.stateNode.containerInfo;
-
- switch (fiber.tag) {
- case HostComponent:
- var type = fiber.type;
- var props = fiber.pendingProps;
- didNotFindHydratableContainerInstance(parentContainer, type, props);
- break;
-
- case HostText:
- var text = fiber.pendingProps;
- didNotFindHydratableContainerTextInstance(parentContainer, text);
- break;
-
- case SuspenseComponent:
-
- break;
- }
-
- break;
- }
-
- case HostComponent:
- {
- var parentType = returnFiber.type;
- var parentProps = returnFiber.memoizedProps;
- var parentInstance = returnFiber.stateNode;
-
- switch (fiber.tag) {
- case HostComponent:
- var _type = fiber.type;
- var _props = fiber.pendingProps;
- didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type, _props);
- break;
-
- case HostText:
- var _text = fiber.pendingProps;
- didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);
- break;
-
- case SuspenseComponent:
- didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance);
- break;
- }
-
- break;
- }
-
- default:
- return;
- }
- }
- }
-
- function tryHydrate(fiber, nextInstance) {
- switch (fiber.tag) {
- case HostComponent:
- {
- var type = fiber.type;
- var props = fiber.pendingProps;
- var instance = canHydrateInstance(nextInstance, type, props);
-
- if (instance !== null) {
- fiber.stateNode = instance;
- return true;
- }
-
- return false;
- }
-
- case HostText:
- {
- var text = fiber.pendingProps;
- var textInstance = canHydrateTextInstance(nextInstance, text);
-
- if (textInstance !== null) {
- fiber.stateNode = textInstance;
- return true;
- }
-
- return false;
- }
-
- case SuspenseComponent:
- {
- if (enableSuspenseServerRenderer) {
- var suspenseInstance = canHydrateSuspenseInstance(nextInstance);
-
- if (suspenseInstance !== null) {
- var suspenseState = {
- dehydrated: suspenseInstance,
- retryTime: Never
- };
- fiber.memoizedState = suspenseState; // Store the dehydrated fragment as a child fiber.
- // This simplifies the code for getHostSibling and deleting nodes,
- // since it doesn't have to consider all Suspense boundaries and
- // check if they're dehydrated ones or not.
-
- var dehydratedFragment = createFiberFromDehydratedFragment(suspenseInstance);
- dehydratedFragment.return = fiber;
- fiber.child = dehydratedFragment;
- return true;
- }
- }
-
- return false;
- }
-
- default:
- return false;
- }
- }
-
- function tryToClaimNextHydratableInstance(fiber) {
- if (!isHydrating) {
- return;
- }
-
- var nextInstance = nextHydratableInstance;
-
- if (!nextInstance) {
- // Nothing to hydrate. Make it an insertion.
- insertNonHydratedInstance(hydrationParentFiber, fiber);
- isHydrating = false;
- hydrationParentFiber = fiber;
- return;
- }
-
- var firstAttemptedInstance = nextInstance;
-
- if (!tryHydrate(fiber, nextInstance)) {
- // If we can't hydrate this instance let's try the next one.
- // We use this as a heuristic. It's based on intuition and not data so it
- // might be flawed or unnecessary.
- nextInstance = getNextHydratableSibling(firstAttemptedInstance);
-
- if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
- // Nothing to hydrate. Make it an insertion.
- insertNonHydratedInstance(hydrationParentFiber, fiber);
- isHydrating = false;
- hydrationParentFiber = fiber;
- return;
- } // We matched the next one, we'll now assume that the first one was
- // superfluous and we'll delete it. Since we can't eagerly delete it
- // we'll have to schedule a deletion. To do that, this node needs a dummy
- // fiber associated with it.
-
-
- deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance);
- }
-
- hydrationParentFiber = fiber;
- nextHydratableInstance = getFirstHydratableChild(nextInstance);
- }
-
- function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
- if (!supportsHydration) {
- {
- {
- throw Error("Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
- }
-
- var instance = fiber.stateNode;
- var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber); // TODO: Type this specific to this type of component.
-
- fiber.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
- // is a new ref we mark this as an update.
-
- if (updatePayload !== null) {
- return true;
- }
-
- return false;
- }
-
- function prepareToHydrateHostTextInstance(fiber) {
- if (!supportsHydration) {
- {
- {
- throw Error("Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
- }
-
- var textInstance = fiber.stateNode;
- var textContent = fiber.memoizedProps;
- var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);
-
- {
- if (shouldUpdate) {
- // We assume that prepareToHydrateHostTextInstance is called in a context where the
- // hydration parent is the parent host component of this host text.
- var returnFiber = hydrationParentFiber;
-
- if (returnFiber !== null) {
- switch (returnFiber.tag) {
- case HostRoot:
- {
- var parentContainer = returnFiber.stateNode.containerInfo;
- didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);
- break;
- }
-
- case HostComponent:
- {
- var parentType = returnFiber.type;
- var parentProps = returnFiber.memoizedProps;
- var parentInstance = returnFiber.stateNode;
- didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);
- break;
- }
- }
- }
- }
- }
-
- return shouldUpdate;
- }
-
- function prepareToHydrateHostSuspenseInstance(fiber) {
- if (!supportsHydration) {
- {
- {
- throw Error("Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
- }
-
- var suspenseState = fiber.memoizedState;
- var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
-
- if (!suspenseInstance) {
- {
- throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
-
- hydrateSuspenseInstance(suspenseInstance, fiber);
- }
-
- function skipPastDehydratedSuspenseInstance(fiber) {
- if (!supportsHydration) {
- {
- {
- throw Error("Expected skipPastDehydratedSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
- }
-
- var suspenseState = fiber.memoizedState;
- var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;
-
- if (!suspenseInstance) {
- {
- throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
-
- return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
- }
-
- function popToNextHostParent(fiber) {
- var parent = fiber.return;
-
- while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {
- parent = parent.return;
- }
-
- hydrationParentFiber = parent;
- }
-
- function popHydrationState(fiber) {
- if (!supportsHydration) {
- return false;
- }
-
- if (fiber !== hydrationParentFiber) {
- // We're deeper than the current hydration context, inside an inserted
- // tree.
- return false;
- }
-
- if (!isHydrating) {
- // If we're not currently hydrating but we're in a hydration context, then
- // we were an insertion and now need to pop up reenter hydration of our
- // siblings.
- popToNextHostParent(fiber);
- isHydrating = true;
- return false;
- }
-
- var type = fiber.type; // If we have any remaining hydratable nodes, we need to delete them now.
- // We only do this deeper than head and body since they tend to have random
- // other nodes in them. We also ignore components with pure text content in
- // side of them.
- // TODO: Better heuristic.
-
- if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) {
- var nextInstance = nextHydratableInstance;
-
- while (nextInstance) {
- deleteHydratableInstance(fiber, nextInstance);
- nextInstance = getNextHydratableSibling(nextInstance);
- }
- }
-
- popToNextHostParent(fiber);
-
- if (fiber.tag === SuspenseComponent) {
- nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);
- } else {
- nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
- }
-
- return true;
- }
-
- function resetHydrationState() {
- if (!supportsHydration) {
- return;
- }
-
- hydrationParentFiber = null;
- nextHydratableInstance = null;
- isHydrating = false;
- }
-
- var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;
- var didReceiveUpdate = false;
- var didWarnAboutBadClass;
- var didWarnAboutModulePatternComponent;
- var didWarnAboutContextTypeOnFunctionComponent;
- var didWarnAboutGetDerivedStateOnFunctionComponent;
- var didWarnAboutFunctionRefs;
- var didWarnAboutReassigningProps;
- var didWarnAboutMaxDuration;
- var didWarnAboutRevealOrder;
- var didWarnAboutTailOptions;
- var didWarnAboutDefaultPropsOnFunctionComponent;
-
- {
- didWarnAboutBadClass = {};
- didWarnAboutModulePatternComponent = {};
- didWarnAboutContextTypeOnFunctionComponent = {};
- didWarnAboutGetDerivedStateOnFunctionComponent = {};
- didWarnAboutFunctionRefs = {};
- didWarnAboutReassigningProps = false;
- didWarnAboutMaxDuration = false;
- didWarnAboutRevealOrder = {};
- didWarnAboutTailOptions = {};
- didWarnAboutDefaultPropsOnFunctionComponent = {};
- }
-
- function reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime) {
- if (current$$1 === null) {
- // If this is a fresh new component that hasn't been rendered yet, we
- // won't update its child set by applying minimal side-effects. Instead,
- // we will add them all to the child before it gets rendered. That means
- // we can optimize this reconciliation pass by not tracking side-effects.
- workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
- } else {
- // If the current child is the same as the work in progress, it means that
- // we haven't yet started any work on these children. Therefore, we use
- // the clone algorithm to create a copy of all the current children.
- // If we had any progressed work already, that is invalid at this point so
- // let's throw it out.
- workInProgress.child = reconcileChildFibers(workInProgress, current$$1.child, nextChildren, renderExpirationTime);
- }
- }
-
- function forceUnmountCurrentAndReconcile(current$$1, workInProgress, nextChildren, renderExpirationTime) {
- // This function is fork of reconcileChildren. It's used in cases where we
- // want to reconcile without matching against the existing set. This has the
- // effect of all current children being unmounted; even if the type and key
- // are the same, the old child is unmounted and a new child is created.
- //
- // To do this, we're going to go through the reconcile algorithm twice. In
- // the first pass, we schedule a deletion for all the current children by
- // passing null.
- workInProgress.child = reconcileChildFibers(workInProgress, current$$1.child, null, renderExpirationTime); // In the second pass, we mount the new children. The trick here is that we
- // pass null in place of where we usually pass the current child set. This has
- // the effect of remounting all children regardless of whether their their
- // identity matches.
-
- workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
- }
-
- function updateForwardRef(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
- // TODO: current can be non-null here even if the component
- // hasn't yet mounted. This happens after the first render suspends.
- // We'll need to figure out if this is fine or can cause issues.
- {
- if (workInProgress.type !== workInProgress.elementType) {
- // Lazy component props can't be validated in createElement
- // because they're only guaranteed to be resolved here.
- var innerPropTypes = Component.propTypes;
-
- if (innerPropTypes) {
- checkPropTypes(innerPropTypes, nextProps, // Resolved props
- 'prop', getComponentName(Component), getCurrentFiberStackInDev);
- }
- }
- }
-
- var render = Component.render;
- var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent
-
- var nextChildren;
- prepareToReadContext(workInProgress, renderExpirationTime);
-
- {
- ReactCurrentOwner$3.current = workInProgress;
- setCurrentPhase('render');
- nextChildren = renderWithHooks(current$$1, workInProgress, render, nextProps, ref, renderExpirationTime);
-
- if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
- // Only double-render components with Hooks
- if (workInProgress.memoizedState !== null) {
- nextChildren = renderWithHooks(current$$1, workInProgress, render, nextProps, ref, renderExpirationTime);
- }
- }
-
- setCurrentPhase(null);
- }
-
- if (current$$1 !== null && !didReceiveUpdate) {
- bailoutHooks(current$$1, workInProgress, renderExpirationTime);
- return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
- } // React DevTools reads this flag.
-
-
- workInProgress.effectTag |= PerformedWork;
- reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
- return workInProgress.child;
- }
-
- function updateMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
- if (current$$1 === null) {
- var type = Component.type;
-
- if (isSimpleFunctionComponent(type) && Component.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either.
- Component.defaultProps === undefined) {
- var resolvedType = type;
-
- {
- resolvedType = resolveFunctionForHotReloading(type);
- } // If this is a plain function component without default props,
- // and with only the default shallow comparison, we upgrade it
- // to a SimpleMemoComponent to allow fast path updates.
-
-
- workInProgress.tag = SimpleMemoComponent;
- workInProgress.type = resolvedType;
-
- {
- validateFunctionComponentInDev(workInProgress, type);
- }
-
- return updateSimpleMemoComponent(current$$1, workInProgress, resolvedType, nextProps, updateExpirationTime, renderExpirationTime);
- }
-
- {
- var innerPropTypes = type.propTypes;
-
- if (innerPropTypes) {
- // Inner memo component props aren't currently validated in createElement.
- // We could move it there, but we'd still need this for lazy code path.
- checkPropTypes(innerPropTypes, nextProps, // Resolved props
- 'prop', getComponentName(type), getCurrentFiberStackInDev);
- }
- }
-
- var child = createFiberFromTypeAndProps(Component.type, null, nextProps, null, workInProgress.mode, renderExpirationTime);
- child.ref = workInProgress.ref;
- child.return = workInProgress;
- workInProgress.child = child;
- return child;
- }
-
- {
- var _type = Component.type;
- var _innerPropTypes = _type.propTypes;
-
- if (_innerPropTypes) {
- // Inner memo component props aren't currently validated in createElement.
- // We could move it there, but we'd still need this for lazy code path.
- checkPropTypes(_innerPropTypes, nextProps, // Resolved props
- 'prop', getComponentName(_type), getCurrentFiberStackInDev);
- }
- }
-
- var currentChild = current$$1.child; // This is always exactly one child
-
- if (updateExpirationTime < renderExpirationTime) {
- // This will be the props with resolved defaultProps,
- // unlike current.memoizedProps which will be the unresolved ones.
- var prevProps = currentChild.memoizedProps; // Default to shallow comparison
-
- var compare = Component.compare;
- compare = compare !== null ? compare : shallowEqual;
-
- if (compare(prevProps, nextProps) && current$$1.ref === workInProgress.ref) {
- return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
- }
- } // React DevTools reads this flag.
-
-
- workInProgress.effectTag |= PerformedWork;
- var newChild = createWorkInProgress(currentChild, nextProps, renderExpirationTime);
- newChild.ref = workInProgress.ref;
- newChild.return = workInProgress;
- workInProgress.child = newChild;
- return newChild;
- }
-
- function updateSimpleMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
- // TODO: current can be non-null here even if the component
- // hasn't yet mounted. This happens when the inner render suspends.
- // We'll need to figure out if this is fine or can cause issues.
- {
- if (workInProgress.type !== workInProgress.elementType) {
- // Lazy component props can't be validated in createElement
- // because they're only guaranteed to be resolved here.
- var outerMemoType = workInProgress.elementType;
-
- if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
- // We warn when you define propTypes on lazy()
- // so let's just skip over it to find memo() outer wrapper.
- // Inner props for memo are validated later.
- outerMemoType = refineResolvedLazyComponent(outerMemoType);
- }
-
- var outerPropTypes = outerMemoType && outerMemoType.propTypes;
-
- if (outerPropTypes) {
- checkPropTypes(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps)
- 'prop', getComponentName(outerMemoType), getCurrentFiberStackInDev);
- } // Inner propTypes will be validated in the function component path.
-
- }
- }
-
- if (current$$1 !== null) {
- var prevProps = current$$1.memoizedProps;
-
- if (shallowEqual(prevProps, nextProps) && current$$1.ref === workInProgress.ref && ( // Prevent bailout if the implementation changed due to hot reload:
- workInProgress.type === current$$1.type)) {
- didReceiveUpdate = false;
-
- if (updateExpirationTime < renderExpirationTime) {
- return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
- }
- }
- }
-
- return updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime);
- }
-
- function updateFragment(current$$1, workInProgress, renderExpirationTime) {
- var nextChildren = workInProgress.pendingProps;
- reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
- return workInProgress.child;
- }
-
- function updateMode(current$$1, workInProgress, renderExpirationTime) {
- var nextChildren = workInProgress.pendingProps.children;
- reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
- return workInProgress.child;
- }
-
- function updateProfiler(current$$1, workInProgress, renderExpirationTime) {
- if (enableProfilerTimer) {
- workInProgress.effectTag |= Update;
- }
-
- var nextProps = workInProgress.pendingProps;
- var nextChildren = nextProps.children;
- reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
- return workInProgress.child;
- }
-
- function markRef(current$$1, workInProgress) {
- var ref = workInProgress.ref;
-
- if (current$$1 === null && ref !== null || current$$1 !== null && current$$1.ref !== ref) {
- // Schedule a Ref effect
- workInProgress.effectTag |= Ref;
- }
- }
-
- function updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
- {
- if (workInProgress.type !== workInProgress.elementType) {
- // Lazy component props can't be validated in createElement
- // because they're only guaranteed to be resolved here.
- var innerPropTypes = Component.propTypes;
-
- if (innerPropTypes) {
- checkPropTypes(innerPropTypes, nextProps, // Resolved props
- 'prop', getComponentName(Component), getCurrentFiberStackInDev);
- }
- }
- }
-
- var context;
-
- if (!disableLegacyContext) {
- var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);
- context = getMaskedContext(workInProgress, unmaskedContext);
- }
-
- var nextChildren;
- prepareToReadContext(workInProgress, renderExpirationTime);
-
- {
- ReactCurrentOwner$3.current = workInProgress;
- setCurrentPhase('render');
- nextChildren = renderWithHooks(current$$1, workInProgress, Component, nextProps, context, renderExpirationTime);
-
- if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
- // Only double-render components with Hooks
- if (workInProgress.memoizedState !== null) {
- nextChildren = renderWithHooks(current$$1, workInProgress, Component, nextProps, context, renderExpirationTime);
- }
- }
-
- setCurrentPhase(null);
- }
-
- if (current$$1 !== null && !didReceiveUpdate) {
- bailoutHooks(current$$1, workInProgress, renderExpirationTime);
- return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
- } // React DevTools reads this flag.
-
-
- workInProgress.effectTag |= PerformedWork;
- reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
- return workInProgress.child;
- }
-
- function updateClassComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
- {
- if (workInProgress.type !== workInProgress.elementType) {
- // Lazy component props can't be validated in createElement
- // because they're only guaranteed to be resolved here.
- var innerPropTypes = Component.propTypes;
-
- if (innerPropTypes) {
- checkPropTypes(innerPropTypes, nextProps, // Resolved props
- 'prop', getComponentName(Component), getCurrentFiberStackInDev);
- }
- }
- } // Push context providers early to prevent context stack mismatches.
- // During mounting we don't know the child context yet as the instance doesn't exist.
- // We will invalidate the child context in finishClassComponent() right after rendering.
-
-
- var hasContext;
-
- if (isContextProvider(Component)) {
- hasContext = true;
- pushContextProvider(workInProgress);
- } else {
- hasContext = false;
- }
-
- prepareToReadContext(workInProgress, renderExpirationTime);
- var instance = workInProgress.stateNode;
- var shouldUpdate;
-
- if (instance === null) {
- if (current$$1 !== null) {
- // An class component without an instance only mounts if it suspended
- // inside a non- concurrent tree, in an inconsistent state. We want to
- // tree it like a new mount, even though an empty version of it already
- // committed. Disconnect the alternate pointers.
- current$$1.alternate = null;
- workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect
-
- workInProgress.effectTag |= Placement;
- } // In the initial pass we might need to construct the instance.
-
-
- constructClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
- mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
- shouldUpdate = true;
- } else if (current$$1 === null) {
- // In a resume, we'll already have an instance we can reuse.
- shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
- } else {
- shouldUpdate = updateClassInstance(current$$1, workInProgress, Component, nextProps, renderExpirationTime);
- }
-
- var nextUnitOfWork = finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime);
-
- {
- var inst = workInProgress.stateNode;
-
- if (inst.props !== nextProps) {
- !didWarnAboutReassigningProps ? warning$1(false, 'It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentName(workInProgress.type) || 'a component') : void 0;
- didWarnAboutReassigningProps = true;
- }
- }
-
- return nextUnitOfWork;
- }
-
- function finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime) {
- // Refs should update even if shouldComponentUpdate returns false
- markRef(current$$1, workInProgress);
- var didCaptureError = (workInProgress.effectTag & DidCapture) !== NoEffect;
-
- if (!shouldUpdate && !didCaptureError) {
- // Context providers should defer to sCU for rendering
- if (hasContext) {
- invalidateContextProvider(workInProgress, Component, false);
- }
-
- return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
- }
-
- var instance = workInProgress.stateNode; // Rerender
-
- ReactCurrentOwner$3.current = workInProgress;
- var nextChildren;
-
- if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') {
- // If we captured an error, but getDerivedStateFrom catch is not defined,
- // unmount all the children. componentDidCatch will schedule an update to
- // re-render a fallback. This is temporary until we migrate everyone to
- // the new API.
- // TODO: Warn in a future release.
- nextChildren = null;
-
- if (enableProfilerTimer) {
- stopProfilerTimerIfRunning(workInProgress);
- }
- } else {
- {
- setCurrentPhase('render');
- nextChildren = instance.render();
-
- if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
- instance.render();
- }
-
- setCurrentPhase(null);
- }
- } // React DevTools reads this flag.
-
-
- workInProgress.effectTag |= PerformedWork;
-
- if (current$$1 !== null && didCaptureError) {
- // If we're recovering from an error, reconcile without reusing any of
- // the existing children. Conceptually, the normal children and the children
- // that are shown on error are two different sets, so we shouldn't reuse
- // normal children even if their identities match.
- forceUnmountCurrentAndReconcile(current$$1, workInProgress, nextChildren, renderExpirationTime);
- } else {
- reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
- } // Memoize state using the values we just used to render.
- // TODO: Restructure so we never read values from the instance.
-
-
- workInProgress.memoizedState = instance.state; // The context might have changed so we need to recalculate it.
-
- if (hasContext) {
- invalidateContextProvider(workInProgress, Component, true);
- }
-
- return workInProgress.child;
- }
-
- function pushHostRootContext(workInProgress) {
- var root = workInProgress.stateNode;
-
- if (root.pendingContext) {
- pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context);
- } else if (root.context) {
- // Should always be set
- pushTopLevelContextObject(workInProgress, root.context, false);
- }
-
- pushHostContainer(workInProgress, root.containerInfo);
- }
-
- function updateHostRoot(current$$1, workInProgress, renderExpirationTime) {
- pushHostRootContext(workInProgress);
- var updateQueue = workInProgress.updateQueue;
-
- if (!(updateQueue !== null)) {
- {
- throw Error("If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
-
- var nextProps = workInProgress.pendingProps;
- var prevState = workInProgress.memoizedState;
- var prevChildren = prevState !== null ? prevState.element : null;
- processUpdateQueue(workInProgress, updateQueue, nextProps, null, renderExpirationTime);
- var nextState = workInProgress.memoizedState; // Caution: React DevTools currently depends on this property
- // being called "element".
-
- var nextChildren = nextState.element;
-
- if (nextChildren === prevChildren) {
- // If the state is the same as before, that's a bailout because we had
- // no work that expires at this time.
- resetHydrationState();
- return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
- }
-
- var root = workInProgress.stateNode;
-
- if (root.hydrate && enterHydrationState(workInProgress)) {
- // If we don't have any current children this might be the first pass.
- // We always try to hydrate. If this isn't a hydration pass there won't
- // be any children to hydrate which is effectively the same thing as
- // not hydrating.
- var child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
- workInProgress.child = child;
- var node = child;
-
- while (node) {
- // Mark each child as hydrating. This is a fast path to know whether this
- // tree is part of a hydrating tree. This is used to determine if a child
- // node has fully mounted yet, and for scheduling event replaying.
- // Conceptually this is similar to Placement in that a new subtree is
- // inserted into the React tree here. It just happens to not need DOM
- // mutations because it already exists.
- node.effectTag = node.effectTag & ~Placement | Hydrating;
- node = node.sibling;
- }
- } else {
- // Otherwise reset hydration state in case we aborted and resumed another
- // root.
- reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
- resetHydrationState();
- }
-
- return workInProgress.child;
- }
-
- function updateHostComponent(current$$1, workInProgress, renderExpirationTime) {
- pushHostContext(workInProgress);
-
- if (current$$1 === null) {
- tryToClaimNextHydratableInstance(workInProgress);
- }
-
- var type = workInProgress.type;
- var nextProps = workInProgress.pendingProps;
- var prevProps = current$$1 !== null ? current$$1.memoizedProps : null;
- var nextChildren = nextProps.children;
- var isDirectTextChild = shouldSetTextContent(type, nextProps);
-
- if (isDirectTextChild) {
- // We special case a direct text child of a host node. This is a common
- // case. We won't handle it as a reified child. We will instead handle
- // this in the host environment that also have access to this prop. That
- // avoids allocating another HostText fiber and traversing it.
- nextChildren = null;
- } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
- // If we're switching from a direct text child to a normal child, or to
- // empty, we need to schedule the text content to be reset.
- workInProgress.effectTag |= ContentReset;
- }
-
- markRef(current$$1, workInProgress); // Check the host config to see if the children are offscreen/hidden.
-
- if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(type, nextProps)) {
- if (enableSchedulerTracing) {
- markSpawnedWork(Never);
- } // Schedule this fiber to re-render at offscreen priority. Then bailout.
-
-
- workInProgress.expirationTime = workInProgress.childExpirationTime = Never;
- return null;
- }
-
- reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
- return workInProgress.child;
- }
-
- function updateHostText(current$$1, workInProgress) {
- if (current$$1 === null) {
- tryToClaimNextHydratableInstance(workInProgress);
- } // Nothing to do here. This is terminal. We'll do the completion step
- // immediately after.
-
-
- return null;
- }
-
- function mountLazyComponent(_current, workInProgress, elementType, updateExpirationTime, renderExpirationTime) {
- if (_current !== null) {
- // An lazy component only mounts if it suspended inside a non-
- // concurrent tree, in an inconsistent state. We want to treat it like
- // a new mount, even though an empty version of it already committed.
- // Disconnect the alternate pointers.
- _current.alternate = null;
- workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect
-
- workInProgress.effectTag |= Placement;
- }
-
- var props = workInProgress.pendingProps; // We can't start a User Timing measurement with correct label yet.
- // Cancel and resume right after we know the tag.
-
- cancelWorkTimer(workInProgress);
- var Component = readLazyComponentType(elementType); // Store the unwrapped component in the type.
-
- workInProgress.type = Component;
- var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component);
- startWorkTimer(workInProgress);
- var resolvedProps = resolveDefaultProps(Component, props);
- var child;
-
- switch (resolvedTag) {
- case FunctionComponent:
- {
- {
- validateFunctionComponentInDev(workInProgress, Component);
- workInProgress.type = Component = resolveFunctionForHotReloading(Component);
- }
-
- child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);
- break;
- }
-
- case ClassComponent:
- {
- {
- workInProgress.type = Component = resolveClassForHotReloading(Component);
- }
-
- child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);
- break;
- }
-
- case ForwardRef:
- {
- {
- workInProgress.type = Component = resolveForwardRefForHotReloading(Component);
- }
-
- child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderExpirationTime);
- break;
- }
-
- case MemoComponent:
- {
- {
- if (workInProgress.type !== workInProgress.elementType) {
- var outerPropTypes = Component.propTypes;
-
- if (outerPropTypes) {
- checkPropTypes(outerPropTypes, resolvedProps, // Resolved for outer only
- 'prop', getComponentName(Component), getCurrentFiberStackInDev);
- }
- }
- }
-
- child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too
- updateExpirationTime, renderExpirationTime);
- break;
- }
-
- default:
- {
- var hint = '';
-
- {
- if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) {
- hint = ' Did you wrap a component in React.lazy() more than once?';
- }
- } // This message intentionally doesn't mention ForwardRef or MemoComponent
- // because the fact that it's a separate type of work is an
- // implementation detail.
-
-
- {
- {
- throw Error("Element type is invalid. Received a promise that resolves to: " + Component + ". Lazy element type must resolve to a class or function." + hint);
- }
- }
- }
- }
-
- return child;
- }
-
- function mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderExpirationTime) {
- if (_current !== null) {
- // An incomplete component only mounts if it suspended inside a non-
- // concurrent tree, in an inconsistent state. We want to treat it like
- // a new mount, even though an empty version of it already committed.
- // Disconnect the alternate pointers.
- _current.alternate = null;
- workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect
-
- workInProgress.effectTag |= Placement;
- } // Promote the fiber to a class and try rendering again.
-
-
- workInProgress.tag = ClassComponent; // The rest of this function is a fork of `updateClassComponent`
- // Push context providers early to prevent context stack mismatches.
- // During mounting we don't know the child context yet as the instance doesn't exist.
- // We will invalidate the child context in finishClassComponent() right after rendering.
-
- var hasContext;
-
- if (isContextProvider(Component)) {
- hasContext = true;
- pushContextProvider(workInProgress);
- } else {
- hasContext = false;
- }
-
- prepareToReadContext(workInProgress, renderExpirationTime);
- constructClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
- mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
- return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);
- }
-
- function mountIndeterminateComponent(_current, workInProgress, Component, renderExpirationTime) {
- if (_current !== null) {
- // An indeterminate component only mounts if it suspended inside a non-
- // concurrent tree, in an inconsistent state. We want to treat it like
- // a new mount, even though an empty version of it already committed.
- // Disconnect the alternate pointers.
- _current.alternate = null;
- workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect
-
- workInProgress.effectTag |= Placement;
- }
-
- var props = workInProgress.pendingProps;
- var context;
-
- if (!disableLegacyContext) {
- var unmaskedContext = getUnmaskedContext(workInProgress, Component, false);
- context = getMaskedContext(workInProgress, unmaskedContext);
- }
-
- prepareToReadContext(workInProgress, renderExpirationTime);
- var value;
-
- {
- if (Component.prototype && typeof Component.prototype.render === 'function') {
- var componentName = getComponentName(Component) || 'Unknown';
-
- if (!didWarnAboutBadClass[componentName]) {
- warningWithoutStack$1(false, "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName);
- didWarnAboutBadClass[componentName] = true;
- }
- }
-
- if (workInProgress.mode & StrictMode) {
- ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);
- }
-
- ReactCurrentOwner$3.current = workInProgress;
- value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);
- } // React DevTools reads this flag.
-
-
- workInProgress.effectTag |= PerformedWork;
-
- if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {
- {
- var _componentName = getComponentName(Component) || 'Unknown';
-
- if (!didWarnAboutModulePatternComponent[_componentName]) {
- warningWithoutStack$1(false, 'The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName, _componentName, _componentName);
- didWarnAboutModulePatternComponent[_componentName] = true;
- }
- } // Proceed under the assumption that this is a class instance
-
-
- workInProgress.tag = ClassComponent; // Throw out any hooks that were used.
-
- resetHooks(); // Push context providers early to prevent context stack mismatches.
- // During mounting we don't know the child context yet as the instance doesn't exist.
- // We will invalidate the child context in finishClassComponent() right after rendering.
-
- var hasContext = false;
-
- if (isContextProvider(Component)) {
- hasContext = true;
- pushContextProvider(workInProgress);
- } else {
- hasContext = false;
- }
-
- workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null;
- var getDerivedStateFromProps = Component.getDerivedStateFromProps;
-
- if (typeof getDerivedStateFromProps === 'function') {
- applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps, props);
- }
-
- adoptClassInstance(workInProgress, value);
- mountClassInstance(workInProgress, Component, props, renderExpirationTime);
- return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);
- } else {
- // Proceed under the assumption that this is a function component
- workInProgress.tag = FunctionComponent;
-
- {
- if (disableLegacyContext && Component.contextTypes) {
- warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with React.useContext() instead.', getComponentName(Component) || 'Unknown');
- }
-
- if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
- // Only double-render components with Hooks
- if (workInProgress.memoizedState !== null) {
- value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);
- }
- }
- }
-
- reconcileChildren(null, workInProgress, value, renderExpirationTime);
-
- {
- validateFunctionComponentInDev(workInProgress, Component);
- }
-
- return workInProgress.child;
- }
- }
-
- function validateFunctionComponentInDev(workInProgress, Component) {
- if (Component) {
- !!Component.childContextTypes ? warningWithoutStack$1(false, '%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component') : void 0;
- }
-
- if (workInProgress.ref !== null) {
- var info = '';
- var ownerName = getCurrentFiberOwnerNameInDevOrNull();
-
- if (ownerName) {
- info += '\n\nCheck the render method of `' + ownerName + '`.';
- }
-
- var warningKey = ownerName || workInProgress._debugID || '';
- var debugSource = workInProgress._debugSource;
-
- if (debugSource) {
- warningKey = debugSource.fileName + ':' + debugSource.lineNumber;
- }
-
- if (!didWarnAboutFunctionRefs[warningKey]) {
- didWarnAboutFunctionRefs[warningKey] = true;
- warning$1(false, 'Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info);
- }
- }
-
- if (warnAboutDefaultPropsOnFunctionComponents && Component.defaultProps !== undefined) {
- var componentName = getComponentName(Component) || 'Unknown';
-
- if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) {
- warningWithoutStack$1(false, '%s: Support for defaultProps will be removed from function components ' + 'in a future major release. Use JavaScript default parameters instead.', componentName);
- didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true;
- }
- }
-
- if (typeof Component.getDerivedStateFromProps === 'function') {
- var _componentName2 = getComponentName(Component) || 'Unknown';
-
- if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2]) {
- warningWithoutStack$1(false, '%s: Function components do not support getDerivedStateFromProps.', _componentName2);
- didWarnAboutGetDerivedStateOnFunctionComponent[_componentName2] = true;
- }
- }
-
- if (typeof Component.contextType === 'object' && Component.contextType !== null) {
- var _componentName3 = getComponentName(Component) || 'Unknown';
-
- if (!didWarnAboutContextTypeOnFunctionComponent[_componentName3]) {
- warningWithoutStack$1(false, '%s: Function components do not support contextType.', _componentName3);
- didWarnAboutContextTypeOnFunctionComponent[_componentName3] = true;
- }
- }
- }
-
- var SUSPENDED_MARKER = {
- dehydrated: null,
- retryTime: NoWork
- };
-
- function shouldRemainOnFallback(suspenseContext, current$$1, workInProgress) {
- // If the context is telling us that we should show a fallback, and we're not
- // already showing content, then we should show the fallback instead.
- return hasSuspenseContext(suspenseContext, ForceSuspenseFallback) && (current$$1 === null || current$$1.memoizedState !== null);
- }
-
- function updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime) {
- var mode = workInProgress.mode;
- var nextProps = workInProgress.pendingProps; // This is used by DevTools to force a boundary to suspend.
-
- {
- if (shouldSuspend(workInProgress)) {
- workInProgress.effectTag |= DidCapture;
- }
- }
-
- var suspenseContext = suspenseStackCursor.current;
- var nextDidTimeout = false;
- var didSuspend = (workInProgress.effectTag & DidCapture) !== NoEffect;
-
- if (didSuspend || shouldRemainOnFallback(suspenseContext, current$$1, workInProgress)) {
- // Something in this boundary's subtree already suspended. Switch to
- // rendering the fallback children.
- nextDidTimeout = true;
- workInProgress.effectTag &= ~DidCapture;
- } else {
- // Attempting the main content
- if (current$$1 === null || current$$1.memoizedState !== null) {
- // This is a new mount or this boundary is already showing a fallback state.
- // Mark this subtree context as having at least one invisible parent that could
- // handle the fallback state.
- // Boundaries without fallbacks or should be avoided are not considered since
- // they cannot handle preferred fallback states.
- if (nextProps.fallback !== undefined && nextProps.unstable_avoidThisFallback !== true) {
- suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);
- }
- }
- }
-
- suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
- pushSuspenseContext(workInProgress, suspenseContext);
-
- {
- if ('maxDuration' in nextProps) {
- if (!didWarnAboutMaxDuration) {
- didWarnAboutMaxDuration = true;
- warning$1(false, 'maxDuration has been removed from React. ' + 'Remove the maxDuration prop.');
- }
- }
- } // This next part is a bit confusing. If the children timeout, we switch to
- // showing the fallback children in place of the "primary" children.
- // However, we don't want to delete the primary children because then their
- // state will be lost (both the React state and the host state, e.g.
- // uncontrolled form inputs). Instead we keep them mounted and hide them.
- // Both the fallback children AND the primary children are rendered at the
- // same time. Once the primary children are un-suspended, we can delete
- // the fallback children — don't need to preserve their state.
- //
- // The two sets of children are siblings in the host environment, but
- // semantically, for purposes of reconciliation, they are two separate sets.
- // So we store them using two fragment fibers.
- //
- // However, we want to avoid allocating extra fibers for every placeholder.
- // They're only necessary when the children time out, because that's the
- // only time when both sets are mounted.
- //
- // So, the extra fragment fibers are only used if the children time out.
- // Otherwise, we render the primary children directly. This requires some
- // custom reconciliation logic to preserve the state of the primary
- // children. It's essentially a very basic form of re-parenting.
-
-
- if (current$$1 === null) {
- // If we're currently hydrating, try to hydrate this boundary.
- // But only if this has a fallback.
- if (nextProps.fallback !== undefined) {
- tryToClaimNextHydratableInstance(workInProgress); // This could've been a dehydrated suspense component.
-
- if (enableSuspenseServerRenderer) {
- var suspenseState = workInProgress.memoizedState;
-
- if (suspenseState !== null) {
- var dehydrated = suspenseState.dehydrated;
-
- if (dehydrated !== null) {
- return mountDehydratedSuspenseComponent(workInProgress, dehydrated, renderExpirationTime);
- }
- }
- }
- } // This is the initial mount. This branch is pretty simple because there's
- // no previous state that needs to be preserved.
-
-
- if (nextDidTimeout) {
- // Mount separate fragments for primary and fallback children.
- var nextFallbackChildren = nextProps.fallback;
- var primaryChildFragment = createFiberFromFragment(null, mode, NoWork, null);
- primaryChildFragment.return = workInProgress;
-
- if ((workInProgress.mode & BlockingMode) === NoMode) {
- // Outside of blocking mode, we commit the effects from the
- // partially completed, timed-out tree, too.
- var progressedState = workInProgress.memoizedState;
- var progressedPrimaryChild = progressedState !== null ? workInProgress.child.child : workInProgress.child;
- primaryChildFragment.child = progressedPrimaryChild;
- var progressedChild = progressedPrimaryChild;
-
- while (progressedChild !== null) {
- progressedChild.return = primaryChildFragment;
- progressedChild = progressedChild.sibling;
- }
- }
-
- var fallbackChildFragment = createFiberFromFragment(nextFallbackChildren, mode, renderExpirationTime, null);
- fallbackChildFragment.return = workInProgress;
- primaryChildFragment.sibling = fallbackChildFragment; // Skip the primary children, and continue working on the
- // fallback children.
-
- workInProgress.memoizedState = SUSPENDED_MARKER;
- workInProgress.child = primaryChildFragment;
- return fallbackChildFragment;
- } else {
- // Mount the primary children without an intermediate fragment fiber.
- var nextPrimaryChildren = nextProps.children;
- workInProgress.memoizedState = null;
- return workInProgress.child = mountChildFibers(workInProgress, null, nextPrimaryChildren, renderExpirationTime);
- }
- } else {
- // This is an update. This branch is more complicated because we need to
- // ensure the state of the primary children is preserved.
- var prevState = current$$1.memoizedState;
-
- if (prevState !== null) {
- if (enableSuspenseServerRenderer) {
- var _dehydrated = prevState.dehydrated;
-
- if (_dehydrated !== null) {
- if (!didSuspend) {
- return updateDehydratedSuspenseComponent(current$$1, workInProgress, _dehydrated, prevState, renderExpirationTime);
- } else if (workInProgress.memoizedState !== null) {
- // Something suspended and we should still be in dehydrated mode.
- // Leave the existing child in place.
- workInProgress.child = current$$1.child; // The dehydrated completion pass expects this flag to be there
- // but the normal suspense pass doesn't.
-
- workInProgress.effectTag |= DidCapture;
- return null;
- } else {
- // Suspended but we should no longer be in dehydrated mode.
- // Therefore we now have to render the fallback. Wrap the children
- // in a fragment fiber to keep them separate from the fallback
- // children.
- var _nextFallbackChildren = nextProps.fallback;
-
- var _primaryChildFragment = createFiberFromFragment( // It shouldn't matter what the pending props are because we aren't
- // going to render this fragment.
- null, mode, NoWork, null);
-
- _primaryChildFragment.return = workInProgress; // This is always null since we never want the previous child
- // that we're not going to hydrate.
-
- _primaryChildFragment.child = null;
-
- if ((workInProgress.mode & BlockingMode) === NoMode) {
- // Outside of blocking mode, we commit the effects from the
- // partially completed, timed-out tree, too.
- var _progressedChild = _primaryChildFragment.child = workInProgress.child;
-
- while (_progressedChild !== null) {
- _progressedChild.return = _primaryChildFragment;
- _progressedChild = _progressedChild.sibling;
- }
- } else {
- // We will have dropped the effect list which contains the deletion.
- // We need to reconcile to delete the current child.
- reconcileChildFibers(workInProgress, current$$1.child, null, renderExpirationTime);
- } // Because primaryChildFragment is a new fiber that we're inserting as the
- // parent of a new tree, we need to set its treeBaseDuration.
-
-
- if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
- // treeBaseDuration is the sum of all the child tree base durations.
- var treeBaseDuration = 0;
- var hiddenChild = _primaryChildFragment.child;
-
- while (hiddenChild !== null) {
- treeBaseDuration += hiddenChild.treeBaseDuration;
- hiddenChild = hiddenChild.sibling;
- }
-
- _primaryChildFragment.treeBaseDuration = treeBaseDuration;
- } // Create a fragment from the fallback children, too.
-
-
- var _fallbackChildFragment = createFiberFromFragment(_nextFallbackChildren, mode, renderExpirationTime, null);
-
- _fallbackChildFragment.return = workInProgress;
- _primaryChildFragment.sibling = _fallbackChildFragment;
- _fallbackChildFragment.effectTag |= Placement;
- _primaryChildFragment.childExpirationTime = NoWork;
- workInProgress.memoizedState = SUSPENDED_MARKER;
- workInProgress.child = _primaryChildFragment; // Skip the primary children, and continue working on the
- // fallback children.
-
- return _fallbackChildFragment;
- }
- }
- } // The current tree already timed out. That means each child set is
- // wrapped in a fragment fiber.
-
-
- var currentPrimaryChildFragment = current$$1.child;
- var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
-
- if (nextDidTimeout) {
- // Still timed out. Reuse the current primary children by cloning
- // its fragment. We're going to skip over these entirely.
- var _nextFallbackChildren2 = nextProps.fallback;
-
- var _primaryChildFragment2 = createWorkInProgress(currentPrimaryChildFragment, currentPrimaryChildFragment.pendingProps, NoWork);
-
- _primaryChildFragment2.return = workInProgress;
-
- if ((workInProgress.mode & BlockingMode) === NoMode) {
- // Outside of blocking mode, we commit the effects from the
- // partially completed, timed-out tree, too.
- var _progressedState = workInProgress.memoizedState;
-
- var _progressedPrimaryChild = _progressedState !== null ? workInProgress.child.child : workInProgress.child;
-
- if (_progressedPrimaryChild !== currentPrimaryChildFragment.child) {
- _primaryChildFragment2.child = _progressedPrimaryChild;
- var _progressedChild2 = _progressedPrimaryChild;
-
- while (_progressedChild2 !== null) {
- _progressedChild2.return = _primaryChildFragment2;
- _progressedChild2 = _progressedChild2.sibling;
- }
- }
- } // Because primaryChildFragment is a new fiber that we're inserting as the
- // parent of a new tree, we need to set its treeBaseDuration.
-
-
- if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
- // treeBaseDuration is the sum of all the child tree base durations.
- var _treeBaseDuration = 0;
- var _hiddenChild = _primaryChildFragment2.child;
-
- while (_hiddenChild !== null) {
- _treeBaseDuration += _hiddenChild.treeBaseDuration;
- _hiddenChild = _hiddenChild.sibling;
- }
-
- _primaryChildFragment2.treeBaseDuration = _treeBaseDuration;
- } // Clone the fallback child fragment, too. These we'll continue
- // working on.
-
-
- var _fallbackChildFragment2 = createWorkInProgress(currentFallbackChildFragment, _nextFallbackChildren2, currentFallbackChildFragment.expirationTime);
-
- _fallbackChildFragment2.return = workInProgress;
- _primaryChildFragment2.sibling = _fallbackChildFragment2;
- _primaryChildFragment2.childExpirationTime = NoWork; // Skip the primary children, and continue working on the
- // fallback children.
-
- workInProgress.memoizedState = SUSPENDED_MARKER;
- workInProgress.child = _primaryChildFragment2;
- return _fallbackChildFragment2;
- } else {
- // No longer suspended. Switch back to showing the primary children,
- // and remove the intermediate fragment fiber.
- var _nextPrimaryChildren = nextProps.children;
- var currentPrimaryChild = currentPrimaryChildFragment.child;
- var primaryChild = reconcileChildFibers(workInProgress, currentPrimaryChild, _nextPrimaryChildren, renderExpirationTime); // If this render doesn't suspend, we need to delete the fallback
- // children. Wait until the complete phase, after we've confirmed the
- // fallback is no longer needed.
- // TODO: Would it be better to store the fallback fragment on
- // the stateNode?
- // Continue rendering the children, like we normally do.
-
- workInProgress.memoizedState = null;
- return workInProgress.child = primaryChild;
- }
- } else {
- // The current tree has not already timed out. That means the primary
- // children are not wrapped in a fragment fiber.
- var _currentPrimaryChild = current$$1.child;
-
- if (nextDidTimeout) {
- // Timed out. Wrap the children in a fragment fiber to keep them
- // separate from the fallback children.
- var _nextFallbackChildren3 = nextProps.fallback;
-
- var _primaryChildFragment3 = createFiberFromFragment( // It shouldn't matter what the pending props are because we aren't
- // going to render this fragment.
- null, mode, NoWork, null);
-
- _primaryChildFragment3.return = workInProgress;
- _primaryChildFragment3.child = _currentPrimaryChild;
-
- if (_currentPrimaryChild !== null) {
- _currentPrimaryChild.return = _primaryChildFragment3;
- } // Even though we're creating a new fiber, there are no new children,
- // because we're reusing an already mounted tree. So we don't need to
- // schedule a placement.
- // primaryChildFragment.effectTag |= Placement;
-
-
- if ((workInProgress.mode & BlockingMode) === NoMode) {
- // Outside of blocking mode, we commit the effects from the
- // partially completed, timed-out tree, too.
- var _progressedState2 = workInProgress.memoizedState;
-
- var _progressedPrimaryChild2 = _progressedState2 !== null ? workInProgress.child.child : workInProgress.child;
-
- _primaryChildFragment3.child = _progressedPrimaryChild2;
- var _progressedChild3 = _progressedPrimaryChild2;
-
- while (_progressedChild3 !== null) {
- _progressedChild3.return = _primaryChildFragment3;
- _progressedChild3 = _progressedChild3.sibling;
- }
- } // Because primaryChildFragment is a new fiber that we're inserting as the
- // parent of a new tree, we need to set its treeBaseDuration.
-
-
- if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
- // treeBaseDuration is the sum of all the child tree base durations.
- var _treeBaseDuration2 = 0;
- var _hiddenChild2 = _primaryChildFragment3.child;
-
- while (_hiddenChild2 !== null) {
- _treeBaseDuration2 += _hiddenChild2.treeBaseDuration;
- _hiddenChild2 = _hiddenChild2.sibling;
- }
-
- _primaryChildFragment3.treeBaseDuration = _treeBaseDuration2;
- } // Create a fragment from the fallback children, too.
-
-
- var _fallbackChildFragment3 = createFiberFromFragment(_nextFallbackChildren3, mode, renderExpirationTime, null);
-
- _fallbackChildFragment3.return = workInProgress;
- _primaryChildFragment3.sibling = _fallbackChildFragment3;
- _fallbackChildFragment3.effectTag |= Placement;
- _primaryChildFragment3.childExpirationTime = NoWork; // Skip the primary children, and continue working on the
- // fallback children.
-
- workInProgress.memoizedState = SUSPENDED_MARKER;
- workInProgress.child = _primaryChildFragment3;
- return _fallbackChildFragment3;
- } else {
- // Still haven't timed out. Continue rendering the children, like we
- // normally do.
- workInProgress.memoizedState = null;
- var _nextPrimaryChildren2 = nextProps.children;
- return workInProgress.child = reconcileChildFibers(workInProgress, _currentPrimaryChild, _nextPrimaryChildren2, renderExpirationTime);
- }
- }
- }
- }
-
- function retrySuspenseComponentWithoutHydrating(current$$1, workInProgress, renderExpirationTime) {
- // We're now not suspended nor dehydrated.
- workInProgress.memoizedState = null; // Retry with the full children.
-
- var nextProps = workInProgress.pendingProps;
- var nextChildren = nextProps.children; // This will ensure that the children get Placement effects and
- // that the old child gets a Deletion effect.
- // We could also call forceUnmountCurrentAndReconcile.
-
- reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
- return workInProgress.child;
- }
-
- function mountDehydratedSuspenseComponent(workInProgress, suspenseInstance, renderExpirationTime) {
- // During the first pass, we'll bail out and not drill into the children.
- // Instead, we'll leave the content in place and try to hydrate it later.
- if ((workInProgress.mode & BlockingMode) === NoMode) {
- {
- warning$1(false, 'Cannot hydrate Suspense in legacy mode. Switch from ' + 'ReactDOM.hydrate(element, container) to ' + 'ReactDOM.createBlockingRoot(container, { hydrate: true })' + '.render(element) or remove the Suspense components from ' + 'the server rendered components.');
- }
-
- workInProgress.expirationTime = Sync;
- } else if (isSuspenseInstanceFallback(suspenseInstance)) {
- // This is a client-only boundary. Since we won't get any content from the server
- // for this, we need to schedule that at a higher priority based on when it would
- // have timed out. In theory we could render it in this pass but it would have the
- // wrong priority associated with it and will prevent hydration of parent path.
- // Instead, we'll leave work left on it to render it in a separate commit.
- // TODO This time should be the time at which the server rendered response that is
- // a parent to this boundary was displayed. However, since we currently don't have
- // a protocol to transfer that time, we'll just estimate it by using the current
- // time. This will mean that Suspense timeouts are slightly shifted to later than
- // they should be.
- var serverDisplayTime = requestCurrentTimeForUpdate(); // Schedule a normal pri update to render this content.
-
- var newExpirationTime = computeAsyncExpiration(serverDisplayTime);
-
- if (enableSchedulerTracing) {
- markSpawnedWork(newExpirationTime);
- }
-
- workInProgress.expirationTime = newExpirationTime;
- } else {
- // We'll continue hydrating the rest at offscreen priority since we'll already
- // be showing the right content coming from the server, it is no rush.
- workInProgress.expirationTime = Never;
-
- if (enableSchedulerTracing) {
- markSpawnedWork(Never);
- }
- }
-
- return null;
- }
-
- function updateDehydratedSuspenseComponent(current$$1, workInProgress, suspenseInstance, suspenseState, renderExpirationTime) {
- // We should never be hydrating at this point because it is the first pass,
- // but after we've already committed once.
- warnIfHydrating();
-
- if ((workInProgress.mode & BlockingMode) === NoMode) {
- return retrySuspenseComponentWithoutHydrating(current$$1, workInProgress, renderExpirationTime);
- }
-
- if (isSuspenseInstanceFallback(suspenseInstance)) {
- // This boundary is in a permanent fallback state. In this case, we'll never
- // get an update and we'll never be able to hydrate the final content. Let's just try the
- // client side render instead.
- return retrySuspenseComponentWithoutHydrating(current$$1, workInProgress, renderExpirationTime);
- } // We use childExpirationTime to indicate that a child might depend on context, so if
- // any context has changed, we need to treat is as if the input might have changed.
-
-
- var hasContextChanged$$1 = current$$1.childExpirationTime >= renderExpirationTime;
-
- if (didReceiveUpdate || hasContextChanged$$1) {
- // This boundary has changed since the first render. This means that we are now unable to
- // hydrate it. We might still be able to hydrate it using an earlier expiration time, if
- // we are rendering at lower expiration than sync.
- if (renderExpirationTime < Sync) {
- if (suspenseState.retryTime <= renderExpirationTime) {
- // This render is even higher pri than we've seen before, let's try again
- // at even higher pri.
- var attemptHydrationAtExpirationTime = renderExpirationTime + 1;
- suspenseState.retryTime = attemptHydrationAtExpirationTime;
- scheduleWork(current$$1, attemptHydrationAtExpirationTime); // TODO: Early abort this render.
- } else {// We have already tried to ping at a higher priority than we're rendering with
- // so if we got here, we must have failed to hydrate at those levels. We must
- // now give up. Instead, we're going to delete the whole subtree and instead inject
- // a new real Suspense boundary to take its place, which may render content
- // or fallback. This might suspend for a while and if it does we might still have
- // an opportunity to hydrate before this pass commits.
- }
- } // If we have scheduled higher pri work above, this will probably just abort the render
- // since we now have higher priority work, but in case it doesn't, we need to prepare to
- // render something, if we time out. Even if that requires us to delete everything and
- // skip hydration.
- // Delay having to do this as long as the suspense timeout allows us.
-
-
- renderDidSuspendDelayIfPossible();
- return retrySuspenseComponentWithoutHydrating(current$$1, workInProgress, renderExpirationTime);
- } else if (isSuspenseInstancePending(suspenseInstance)) {
- // This component is still pending more data from the server, so we can't hydrate its
- // content. We treat it as if this component suspended itself. It might seem as if
- // we could just try to render it client-side instead. However, this will perform a
- // lot of unnecessary work and is unlikely to complete since it often will suspend
- // on missing data anyway. Additionally, the server might be able to render more
- // than we can on the client yet. In that case we'd end up with more fallback states
- // on the client than if we just leave it alone. If the server times out or errors
- // these should update this boundary to the permanent Fallback state instead.
- // Mark it as having captured (i.e. suspended).
- workInProgress.effectTag |= DidCapture; // Leave the child in place. I.e. the dehydrated fragment.
-
- workInProgress.child = current$$1.child; // Register a callback to retry this boundary once the server has sent the result.
-
- registerSuspenseInstanceRetry(suspenseInstance, retryDehydratedSuspenseBoundary.bind(null, current$$1));
- return null;
- } else {
- // This is the first attempt.
- reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress, suspenseInstance);
- var nextProps = workInProgress.pendingProps;
- var nextChildren = nextProps.children;
- var child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
- var node = child;
-
- while (node) {
- // Mark each child as hydrating. This is a fast path to know whether this
- // tree is part of a hydrating tree. This is used to determine if a child
- // node has fully mounted yet, and for scheduling event replaying.
- // Conceptually this is similar to Placement in that a new subtree is
- // inserted into the React tree here. It just happens to not need DOM
- // mutations because it already exists.
- node.effectTag |= Hydrating;
- node = node.sibling;
- }
-
- workInProgress.child = child;
- return workInProgress.child;
- }
- }
-
- function scheduleWorkOnFiber(fiber, renderExpirationTime) {
- if (fiber.expirationTime < renderExpirationTime) {
- fiber.expirationTime = renderExpirationTime;
- }
-
- var alternate = fiber.alternate;
-
- if (alternate !== null && alternate.expirationTime < renderExpirationTime) {
- alternate.expirationTime = renderExpirationTime;
- }
-
- scheduleWorkOnParentPath(fiber.return, renderExpirationTime);
- }
-
- function propagateSuspenseContextChange(workInProgress, firstChild, renderExpirationTime) {
- // Mark any Suspense boundaries with fallbacks as having work to do.
- // If they were previously forced into fallbacks, they may now be able
- // to unblock.
- var node = firstChild;
-
- while (node !== null) {
- if (node.tag === SuspenseComponent) {
- var state = node.memoizedState;
-
- if (state !== null) {
- scheduleWorkOnFiber(node, renderExpirationTime);
- }
- } else if (node.tag === SuspenseListComponent) {
- // If the tail is hidden there might not be an Suspense boundaries
- // to schedule work on. In this case we have to schedule it on the
- // list itself.
- // We don't have to traverse to the children of the list since
- // the list will propagate the change when it rerenders.
- scheduleWorkOnFiber(node, renderExpirationTime);
- } else if (node.child !== null) {
- node.child.return = node;
- node = node.child;
- continue;
- }
-
- if (node === workInProgress) {
- return;
- }
-
- while (node.sibling === null) {
- if (node.return === null || node.return === workInProgress) {
- return;
- }
-
- node = node.return;
- }
-
- node.sibling.return = node.return;
- node = node.sibling;
- }
- }
-
- function findLastContentRow(firstChild) {
- // This is going to find the last row among these children that is already
- // showing content on the screen, as opposed to being in fallback state or
- // new. If a row has multiple Suspense boundaries, any of them being in the
- // fallback state, counts as the whole row being in a fallback state.
- // Note that the "rows" will be workInProgress, but any nested children
- // will still be current since we haven't rendered them yet. The mounted
- // order may not be the same as the new order. We use the new order.
- var row = firstChild;
- var lastContentRow = null;
-
- while (row !== null) {
- var currentRow = row.alternate; // New rows can't be content rows.
-
- if (currentRow !== null && findFirstSuspended(currentRow) === null) {
- lastContentRow = row;
- }
-
- row = row.sibling;
- }
-
- return lastContentRow;
- }
-
- function validateRevealOrder(revealOrder) {
- {
- if (revealOrder !== undefined && revealOrder !== 'forwards' && revealOrder !== 'backwards' && revealOrder !== 'together' && !didWarnAboutRevealOrder[revealOrder]) {
- didWarnAboutRevealOrder[revealOrder] = true;
-
- if (typeof revealOrder === 'string') {
- switch (revealOrder.toLowerCase()) {
- case 'together':
- case 'forwards':
- case 'backwards':
- {
- warning$1(false, '"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase());
- break;
- }
-
- case 'forward':
- case 'backward':
- {
- warning$1(false, '"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase());
- break;
- }
-
- default:
- warning$1(false, '"%s" is not a supported revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder);
- break;
- }
- } else {
- warning$1(false, '%s is not a supported value for revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder);
- }
- }
- }
- }
-
- function validateTailOptions(tailMode, revealOrder) {
- {
- if (tailMode !== undefined && !didWarnAboutTailOptions[tailMode]) {
- if (tailMode !== 'collapsed' && tailMode !== 'hidden') {
- didWarnAboutTailOptions[tailMode] = true;
- warning$1(false, '"%s" is not a supported value for tail on <SuspenseList />. ' + 'Did you mean "collapsed" or "hidden"?', tailMode);
- } else if (revealOrder !== 'forwards' && revealOrder !== 'backwards') {
- didWarnAboutTailOptions[tailMode] = true;
- warning$1(false, '<SuspenseList tail="%s" /> is only valid if revealOrder is ' + '"forwards" or "backwards". ' + 'Did you mean to specify revealOrder="forwards"?', tailMode);
- }
- }
- }
- }
-
- function validateSuspenseListNestedChild(childSlot, index) {
- {
- var isArray = Array.isArray(childSlot);
- var isIterable = !isArray && typeof getIteratorFn(childSlot) === 'function';
-
- if (isArray || isIterable) {
- var type = isArray ? 'array' : 'iterable';
- warning$1(false, 'A nested %s was passed to row #%s in <SuspenseList />. Wrap it in ' + 'an additional SuspenseList to configure its revealOrder: ' + '<SuspenseList revealOrder=...> ... ' + '<SuspenseList revealOrder=...>{%s}</SuspenseList> ... ' + '</SuspenseList>', type, index, type);
- return false;
- }
- }
-
- return true;
- }
-
- function validateSuspenseListChildren(children, revealOrder) {
- {
- if ((revealOrder === 'forwards' || revealOrder === 'backwards') && children !== undefined && children !== null && children !== false) {
- if (Array.isArray(children)) {
- for (var i = 0; i < children.length; i++) {
- if (!validateSuspenseListNestedChild(children[i], i)) {
- return;
- }
- }
- } else {
- var iteratorFn = getIteratorFn(children);
-
- if (typeof iteratorFn === 'function') {
- var childrenIterator = iteratorFn.call(children);
-
- if (childrenIterator) {
- var step = childrenIterator.next();
- var _i = 0;
-
- for (; !step.done; step = childrenIterator.next()) {
- if (!validateSuspenseListNestedChild(step.value, _i)) {
- return;
- }
-
- _i++;
- }
- }
- } else {
- warning$1(false, 'A single row was passed to a <SuspenseList revealOrder="%s" />. ' + 'This is not useful since it needs multiple rows. ' + 'Did you mean to pass multiple children or an array?', revealOrder);
- }
- }
- }
- }
- }
-
- function initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode, lastEffectBeforeRendering) {
- var renderState = workInProgress.memoizedState;
-
- if (renderState === null) {
- workInProgress.memoizedState = {
- isBackwards: isBackwards,
- rendering: null,
- last: lastContentRow,
- tail: tail,
- tailExpiration: 0,
- tailMode: tailMode,
- lastEffect: lastEffectBeforeRendering
- };
- } else {
- // We can reuse the existing object from previous renders.
- renderState.isBackwards = isBackwards;
- renderState.rendering = null;
- renderState.last = lastContentRow;
- renderState.tail = tail;
- renderState.tailExpiration = 0;
- renderState.tailMode = tailMode;
- renderState.lastEffect = lastEffectBeforeRendering;
- }
- } // This can end up rendering this component multiple passes.
- // The first pass splits the children fibers into two sets. A head and tail.
- // We first render the head. If anything is in fallback state, we do another
- // pass through beginWork to rerender all children (including the tail) with
- // the force suspend context. If the first render didn't have anything in
- // in fallback state. Then we render each row in the tail one-by-one.
- // That happens in the completeWork phase without going back to beginWork.
-
-
- function updateSuspenseListComponent(current$$1, workInProgress, renderExpirationTime) {
- var nextProps = workInProgress.pendingProps;
- var revealOrder = nextProps.revealOrder;
- var tailMode = nextProps.tail;
- var newChildren = nextProps.children;
- validateRevealOrder(revealOrder);
- validateTailOptions(tailMode, revealOrder);
- validateSuspenseListChildren(newChildren, revealOrder);
- reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime);
- var suspenseContext = suspenseStackCursor.current;
- var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);
-
- if (shouldForceFallback) {
- suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
- workInProgress.effectTag |= DidCapture;
- } else {
- var didSuspendBefore = current$$1 !== null && (current$$1.effectTag & DidCapture) !== NoEffect;
-
- if (didSuspendBefore) {
- // If we previously forced a fallback, we need to schedule work
- // on any nested boundaries to let them know to try to render
- // again. This is the same as context updating.
- propagateSuspenseContextChange(workInProgress, workInProgress.child, renderExpirationTime);
- }
-
- suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
- }
-
- pushSuspenseContext(workInProgress, suspenseContext);
-
- if ((workInProgress.mode & BlockingMode) === NoMode) {
- // Outside of blocking mode, SuspenseList doesn't work so we just
- // use make it a noop by treating it as the default revealOrder.
- workInProgress.memoizedState = null;
- } else {
- switch (revealOrder) {
- case 'forwards':
- {
- var lastContentRow = findLastContentRow(workInProgress.child);
- var tail;
-
- if (lastContentRow === null) {
- // The whole list is part of the tail.
- // TODO: We could fast path by just rendering the tail now.
- tail = workInProgress.child;
- workInProgress.child = null;
- } else {
- // Disconnect the tail rows after the content row.
- // We're going to render them separately later.
- tail = lastContentRow.sibling;
- lastContentRow.sibling = null;
- }
-
- initSuspenseListRenderState(workInProgress, false, // isBackwards
- tail, lastContentRow, tailMode, workInProgress.lastEffect);
- break;
- }
-
- case 'backwards':
- {
- // We're going to find the first row that has existing content.
- // At the same time we're going to reverse the list of everything
- // we pass in the meantime. That's going to be our tail in reverse
- // order.
- var _tail = null;
- var row = workInProgress.child;
- workInProgress.child = null;
-
- while (row !== null) {
- var currentRow = row.alternate; // New rows can't be content rows.
-
- if (currentRow !== null && findFirstSuspended(currentRow) === null) {
- // This is the beginning of the main content.
- workInProgress.child = row;
- break;
- }
-
- var nextRow = row.sibling;
- row.sibling = _tail;
- _tail = row;
- row = nextRow;
- } // TODO: If workInProgress.child is null, we can continue on the tail immediately.
-
-
- initSuspenseListRenderState(workInProgress, true, // isBackwards
- _tail, null, // last
- tailMode, workInProgress.lastEffect);
- break;
- }
-
- case 'together':
- {
- initSuspenseListRenderState(workInProgress, false, // isBackwards
- null, // tail
- null, // last
- undefined, workInProgress.lastEffect);
- break;
- }
-
- default:
- {
- // The default reveal order is the same as not having
- // a boundary.
- workInProgress.memoizedState = null;
- }
- }
- }
-
- return workInProgress.child;
- }
-
- function updatePortalComponent(current$$1, workInProgress, renderExpirationTime) {
- pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
- var nextChildren = workInProgress.pendingProps;
-
- if (current$$1 === null) {
- // Portals are special because we don't append the children during mount
- // but at commit. Therefore we need to track insertions which the normal
- // flow doesn't do during mount. This doesn't happen at the root because
- // the root always starts with a "current" with a null child.
- // TODO: Consider unifying this with how the root works.
- workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
- } else {
- reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
- }
-
- return workInProgress.child;
- }
-
- function updateContextProvider(current$$1, workInProgress, renderExpirationTime) {
- var providerType = workInProgress.type;
- var context = providerType._context;
- var newProps = workInProgress.pendingProps;
- var oldProps = workInProgress.memoizedProps;
- var newValue = newProps.value;
-
- {
- var providerPropTypes = workInProgress.type.propTypes;
-
- if (providerPropTypes) {
- checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider', getCurrentFiberStackInDev);
- }
- }
-
- pushProvider(workInProgress, newValue);
-
- if (oldProps !== null) {
- var oldValue = oldProps.value;
- var changedBits = calculateChangedBits(context, newValue, oldValue);
-
- if (changedBits === 0) {
- // No change. Bailout early if children are the same.
- if (oldProps.children === newProps.children && !hasContextChanged()) {
- return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
- }
- } else {
- // The context value changed. Search for matching consumers and schedule
- // them to update.
- propagateContextChange(workInProgress, context, changedBits, renderExpirationTime);
- }
- }
-
- var newChildren = newProps.children;
- reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime);
- return workInProgress.child;
- }
-
- var hasWarnedAboutUsingContextAsConsumer = false;
-
- function updateContextConsumer(current$$1, workInProgress, renderExpirationTime) {
- var context = workInProgress.type; // The logic below for Context differs depending on PROD or DEV mode. In
- // DEV mode, we create a separate object for Context.Consumer that acts
- // like a proxy to Context. This proxy object adds unnecessary code in PROD
- // so we use the old behaviour (Context.Consumer references Context) to
- // reduce size and overhead. The separate object references context via
- // a property called "_context", which also gives us the ability to check
- // in DEV mode if this property exists or not and warn if it does not.
-
- {
- if (context._context === undefined) {
- // This may be because it's a Context (rather than a Consumer).
- // Or it may be because it's older React where they're the same thing.
- // We only want to warn if we're sure it's a new React.
- if (context !== context.Consumer) {
- if (!hasWarnedAboutUsingContextAsConsumer) {
- hasWarnedAboutUsingContextAsConsumer = true;
- warning$1(false, 'Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
- }
- }
- } else {
- context = context._context;
- }
- }
-
- var newProps = workInProgress.pendingProps;
- var render = newProps.children;
-
- {
- !(typeof render === 'function') ? warningWithoutStack$1(false, 'A context consumer was rendered with multiple children, or a child ' + "that isn't a function. A context consumer expects a single child " + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.') : void 0;
- }
-
- prepareToReadContext(workInProgress, renderExpirationTime);
- var newValue = readContext(context, newProps.unstable_observedBits);
- var newChildren;
-
- {
- ReactCurrentOwner$3.current = workInProgress;
- setCurrentPhase('render');
- newChildren = render(newValue);
- setCurrentPhase(null);
- } // React DevTools reads this flag.
-
-
- workInProgress.effectTag |= PerformedWork;
- reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime);
- return workInProgress.child;
- }
-
- function updateFundamentalComponent$1(current$$1, workInProgress, renderExpirationTime) {
- var fundamentalImpl = workInProgress.type.impl;
-
- if (fundamentalImpl.reconcileChildren === false) {
- return null;
- }
-
- var nextProps = workInProgress.pendingProps;
- var nextChildren = nextProps.children;
- reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
- return workInProgress.child;
- }
-
- function updateScopeComponent(current$$1, workInProgress, renderExpirationTime) {
- var nextProps = workInProgress.pendingProps;
- var nextChildren = nextProps.children;
- reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
- return workInProgress.child;
- }
-
- function markWorkInProgressReceivedUpdate() {
- didReceiveUpdate = true;
- }
-
- function bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime) {
- cancelWorkTimer(workInProgress);
-
- if (current$$1 !== null) {
- // Reuse previous dependencies
- workInProgress.dependencies = current$$1.dependencies;
- }
-
- if (enableProfilerTimer) {
- // Don't update "base" render times for bailouts.
- stopProfilerTimerIfRunning(workInProgress);
- }
-
- var updateExpirationTime = workInProgress.expirationTime;
-
- if (updateExpirationTime !== NoWork) {
- markUnprocessedUpdateTime(updateExpirationTime);
- } // Check if the children have any pending work.
-
-
- var childExpirationTime = workInProgress.childExpirationTime;
-
- if (childExpirationTime < renderExpirationTime) {
- // The children don't have any work either. We can skip them.
- // TODO: Once we add back resuming, we should check if the children are
- // a work-in-progress set. If so, we need to transfer their effects.
- return null;
- } else {
- // This fiber doesn't have work, but its subtree does. Clone the child
- // fibers and continue.
- cloneChildFibers(current$$1, workInProgress);
- return workInProgress.child;
- }
- }
-
- function remountFiber(current$$1, oldWorkInProgress, newWorkInProgress) {
- {
- var returnFiber = oldWorkInProgress.return;
-
- if (returnFiber === null) {
- throw new Error('Cannot swap the root fiber.');
- } // Disconnect from the old current.
- // It will get deleted.
-
-
- current$$1.alternate = null;
- oldWorkInProgress.alternate = null; // Connect to the new tree.
-
- newWorkInProgress.index = oldWorkInProgress.index;
- newWorkInProgress.sibling = oldWorkInProgress.sibling;
- newWorkInProgress.return = oldWorkInProgress.return;
- newWorkInProgress.ref = oldWorkInProgress.ref; // Replace the child/sibling pointers above it.
-
- if (oldWorkInProgress === returnFiber.child) {
- returnFiber.child = newWorkInProgress;
- } else {
- var prevSibling = returnFiber.child;
-
- if (prevSibling === null) {
- throw new Error('Expected parent to have a child.');
- }
-
- while (prevSibling.sibling !== oldWorkInProgress) {
- prevSibling = prevSibling.sibling;
-
- if (prevSibling === null) {
- throw new Error('Expected to find the previous sibling.');
- }
- }
-
- prevSibling.sibling = newWorkInProgress;
- } // Delete the old fiber and place the new one.
- // Since the old fiber is disconnected, we have to schedule it manually.
-
-
- var last = returnFiber.lastEffect;
-
- if (last !== null) {
- last.nextEffect = current$$1;
- returnFiber.lastEffect = current$$1;
- } else {
- returnFiber.firstEffect = returnFiber.lastEffect = current$$1;
- }
-
- current$$1.nextEffect = null;
- current$$1.effectTag = Deletion;
- newWorkInProgress.effectTag |= Placement; // Restart work from the new fiber.
-
- return newWorkInProgress;
- }
- }
-
- function beginWork$1(current$$1, workInProgress, renderExpirationTime) {
- var updateExpirationTime = workInProgress.expirationTime;
-
- {
- if (workInProgress._debugNeedsRemount && current$$1 !== null) {
- // This will restart the begin phase with a new fiber.
- return remountFiber(current$$1, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.expirationTime));
- }
- }
-
- if (current$$1 !== null) {
- var oldProps = current$$1.memoizedProps;
- var newProps = workInProgress.pendingProps;
-
- if (oldProps !== newProps || hasContextChanged() || ( // Force a re-render if the implementation changed due to hot reload:
- workInProgress.type !== current$$1.type)) {
- // If props or context changed, mark the fiber as having performed work.
- // This may be unset if the props are determined to be equal later (memo).
- didReceiveUpdate = true;
- } else if (updateExpirationTime < renderExpirationTime) {
- didReceiveUpdate = false; // This fiber does not have any pending work. Bailout without entering
- // the begin phase. There's still some bookkeeping we that needs to be done
- // in this optimized path, mostly pushing stuff onto the stack.
-
- switch (workInProgress.tag) {
- case HostRoot:
- pushHostRootContext(workInProgress);
- resetHydrationState();
- break;
-
- case HostComponent:
- pushHostContext(workInProgress);
-
- if (workInProgress.mode & ConcurrentMode && renderExpirationTime !== Never && shouldDeprioritizeSubtree(workInProgress.type, newProps)) {
- if (enableSchedulerTracing) {
- markSpawnedWork(Never);
- } // Schedule this fiber to re-render at offscreen priority. Then bailout.
-
-
- workInProgress.expirationTime = workInProgress.childExpirationTime = Never;
- return null;
- }
-
- break;
-
- case ClassComponent:
- {
- var Component = workInProgress.type;
-
- if (isContextProvider(Component)) {
- pushContextProvider(workInProgress);
- }
-
- break;
- }
-
- case HostPortal:
- pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
- break;
-
- case ContextProvider:
- {
- var newValue = workInProgress.memoizedProps.value;
- pushProvider(workInProgress, newValue);
- break;
- }
-
- case Profiler:
- if (enableProfilerTimer) {
- // Profiler should only call onRender when one of its descendants actually rendered.
- var hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime;
-
- if (hasChildWork) {
- workInProgress.effectTag |= Update;
- }
- }
-
- break;
-
- case SuspenseComponent:
- {
- var state = workInProgress.memoizedState;
-
- if (state !== null) {
- if (enableSuspenseServerRenderer) {
- if (state.dehydrated !== null) {
- pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // We know that this component will suspend again because if it has
- // been unsuspended it has committed as a resolved Suspense component.
- // If it needs to be retried, it should have work scheduled on it.
-
- workInProgress.effectTag |= DidCapture;
- break;
- }
- } // If this boundary is currently timed out, we need to decide
- // whether to retry the primary children, or to skip over it and
- // go straight to the fallback. Check the priority of the primary
- // child fragment.
-
-
- var primaryChildFragment = workInProgress.child;
- var primaryChildExpirationTime = primaryChildFragment.childExpirationTime;
-
- if (primaryChildExpirationTime !== NoWork && primaryChildExpirationTime >= renderExpirationTime) {
- // The primary children have pending work. Use the normal path
- // to attempt to render the primary children again.
- return updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime);
- } else {
- pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // The primary children do not have pending work with sufficient
- // priority. Bailout.
-
- var child = bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
-
- if (child !== null) {
- // The fallback children have pending work. Skip over the
- // primary children and work on the fallback.
- return child.sibling;
- } else {
- return null;
- }
- }
- } else {
- pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
- }
-
- break;
- }
-
- case SuspenseListComponent:
- {
- var didSuspendBefore = (current$$1.effectTag & DidCapture) !== NoEffect;
-
- var _hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime;
-
- if (didSuspendBefore) {
- if (_hasChildWork) {
- // If something was in fallback state last time, and we have all the
- // same children then we're still in progressive loading state.
- // Something might get unblocked by state updates or retries in the
- // tree which will affect the tail. So we need to use the normal
- // path to compute the correct tail.
- return updateSuspenseListComponent(current$$1, workInProgress, renderExpirationTime);
- } // If none of the children had any work, that means that none of
- // them got retried so they'll still be blocked in the same way
- // as before. We can fast bail out.
-
-
- workInProgress.effectTag |= DidCapture;
- } // If nothing suspended before and we're rendering the same children,
- // then the tail doesn't matter. Anything new that suspends will work
- // in the "together" mode, so we can continue from the state we had.
-
-
- var renderState = workInProgress.memoizedState;
-
- if (renderState !== null) {
- // Reset to the "together" mode in case we've started a different
- // update in the past but didn't complete it.
- renderState.rendering = null;
- renderState.tail = null;
- }
-
- pushSuspenseContext(workInProgress, suspenseStackCursor.current);
-
- if (_hasChildWork) {
- break;
- } else {
- // If none of the children had any work, that means that none of
- // them got retried so they'll still be blocked in the same way
- // as before. We can fast bail out.
- return null;
- }
- }
- }
-
- return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
- } else {
- // An update was scheduled on this fiber, but there are no new props
- // nor legacy context. Set this to false. If an update queue or context
- // consumer produces a changed value, it will set this to true. Otherwise,
- // the component will assume the children have not changed and bail out.
- didReceiveUpdate = false;
- }
- } else {
- didReceiveUpdate = false;
- } // Before entering the begin phase, clear the expiration time.
-
-
- workInProgress.expirationTime = NoWork;
-
- switch (workInProgress.tag) {
- case IndeterminateComponent:
- {
- return mountIndeterminateComponent(current$$1, workInProgress, workInProgress.type, renderExpirationTime);
- }
-
- case LazyComponent:
- {
- var elementType = workInProgress.elementType;
- return mountLazyComponent(current$$1, workInProgress, elementType, updateExpirationTime, renderExpirationTime);
- }
-
- case FunctionComponent:
- {
- var _Component = workInProgress.type;
- var unresolvedProps = workInProgress.pendingProps;
- var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps);
- return updateFunctionComponent(current$$1, workInProgress, _Component, resolvedProps, renderExpirationTime);
- }
-
- case ClassComponent:
- {
- var _Component2 = workInProgress.type;
- var _unresolvedProps = workInProgress.pendingProps;
-
- var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps);
-
- return updateClassComponent(current$$1, workInProgress, _Component2, _resolvedProps, renderExpirationTime);
- }
-
- case HostRoot:
- return updateHostRoot(current$$1, workInProgress, renderExpirationTime);
-
- case HostComponent:
- return updateHostComponent(current$$1, workInProgress, renderExpirationTime);
-
- case HostText:
- return updateHostText(current$$1, workInProgress);
-
- case SuspenseComponent:
- return updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime);
-
- case HostPortal:
- return updatePortalComponent(current$$1, workInProgress, renderExpirationTime);
-
- case ForwardRef:
- {
- var type = workInProgress.type;
- var _unresolvedProps2 = workInProgress.pendingProps;
-
- var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
-
- return updateForwardRef(current$$1, workInProgress, type, _resolvedProps2, renderExpirationTime);
- }
-
- case Fragment:
- return updateFragment(current$$1, workInProgress, renderExpirationTime);
-
- case Mode:
- return updateMode(current$$1, workInProgress, renderExpirationTime);
-
- case Profiler:
- return updateProfiler(current$$1, workInProgress, renderExpirationTime);
-
- case ContextProvider:
- return updateContextProvider(current$$1, workInProgress, renderExpirationTime);
-
- case ContextConsumer:
- return updateContextConsumer(current$$1, workInProgress, renderExpirationTime);
-
- case MemoComponent:
- {
- var _type2 = workInProgress.type;
- var _unresolvedProps3 = workInProgress.pendingProps; // Resolve outer props first, then resolve inner props.
-
- var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);
-
- {
- if (workInProgress.type !== workInProgress.elementType) {
- var outerPropTypes = _type2.propTypes;
-
- if (outerPropTypes) {
- checkPropTypes(outerPropTypes, _resolvedProps3, // Resolved for outer only
- 'prop', getComponentName(_type2), getCurrentFiberStackInDev);
- }
- }
- }
-
- _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
- return updateMemoComponent(current$$1, workInProgress, _type2, _resolvedProps3, updateExpirationTime, renderExpirationTime);
- }
-
- case SimpleMemoComponent:
- {
- return updateSimpleMemoComponent(current$$1, workInProgress, workInProgress.type, workInProgress.pendingProps, updateExpirationTime, renderExpirationTime);
- }
-
- case IncompleteClassComponent:
- {
- var _Component3 = workInProgress.type;
- var _unresolvedProps4 = workInProgress.pendingProps;
-
- var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4);
-
- return mountIncompleteClassComponent(current$$1, workInProgress, _Component3, _resolvedProps4, renderExpirationTime);
- }
-
- case SuspenseListComponent:
- {
- return updateSuspenseListComponent(current$$1, workInProgress, renderExpirationTime);
- }
-
- case FundamentalComponent:
- {
- if (enableFundamentalAPI) {
- return updateFundamentalComponent$1(current$$1, workInProgress, renderExpirationTime);
- }
-
- break;
- }
-
- case ScopeComponent:
- {
- if (enableScopeAPI) {
- return updateScopeComponent(current$$1, workInProgress, renderExpirationTime);
- }
-
- break;
- }
- }
-
- {
- {
- throw Error("Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue.");
- }
- }
- }
-
- function createFundamentalStateInstance(currentFiber, props, impl, state) {
- return {
- currentFiber: currentFiber,
- impl: impl,
- instance: null,
- prevProps: null,
- props: props,
- state: state
- };
- }
-
- function isFiberSuspenseAndTimedOut(fiber) {
- return fiber.tag === SuspenseComponent && fiber.memoizedState !== null;
- }
-
- function getSuspenseFallbackChild(fiber) {
- return fiber.child.sibling.child;
- }
-
- var emptyObject$1 = {};
-
- function collectScopedNodes(node, fn, scopedNodes) {
- if (enableScopeAPI) {
- if (node.tag === HostComponent) {
- var _type = node.type,
- memoizedProps = node.memoizedProps,
- stateNode = node.stateNode;
-
- var _instance = getPublicInstance(stateNode);
-
- if (_instance !== null && fn(_type, memoizedProps || emptyObject$1, _instance) === true) {
- scopedNodes.push(_instance);
- }
- }
-
- var child = node.child;
-
- if (isFiberSuspenseAndTimedOut(node)) {
- child = getSuspenseFallbackChild(node);
- }
-
- if (child !== null) {
- collectScopedNodesFromChildren(child, fn, scopedNodes);
- }
- }
- }
-
- function collectFirstScopedNode(node, fn) {
- if (enableScopeAPI) {
- if (node.tag === HostComponent) {
- var _type2 = node.type,
- memoizedProps = node.memoizedProps,
- stateNode = node.stateNode;
-
- var _instance2 = getPublicInstance(stateNode);
-
- if (_instance2 !== null && fn(_type2, memoizedProps, _instance2) === true) {
- return _instance2;
- }
- }
-
- var child = node.child;
-
- if (isFiberSuspenseAndTimedOut(node)) {
- child = getSuspenseFallbackChild(node);
- }
-
- if (child !== null) {
- return collectFirstScopedNodeFromChildren(child, fn);
- }
- }
-
- return null;
- }
-
- function collectScopedNodesFromChildren(startingChild, fn, scopedNodes) {
- var child = startingChild;
-
- while (child !== null) {
- collectScopedNodes(child, fn, scopedNodes);
- child = child.sibling;
- }
- }
-
- function collectFirstScopedNodeFromChildren(startingChild, fn) {
- var child = startingChild;
-
- while (child !== null) {
- var scopedNode = collectFirstScopedNode(child, fn);
-
- if (scopedNode !== null) {
- return scopedNode;
- }
-
- child = child.sibling;
- }
-
- return null;
- }
-
- function collectNearestScopeMethods(node, scope, childrenScopes) {
- if (isValidScopeNode(node, scope)) {
- childrenScopes.push(node.stateNode.methods);
- } else {
- var child = node.child;
-
- if (isFiberSuspenseAndTimedOut(node)) {
- child = getSuspenseFallbackChild(node);
- }
-
- if (child !== null) {
- collectNearestChildScopeMethods(child, scope, childrenScopes);
- }
- }
- }
-
- function collectNearestChildScopeMethods(startingChild, scope, childrenScopes) {
- var child = startingChild;
-
- while (child !== null) {
- collectNearestScopeMethods(child, scope, childrenScopes);
- child = child.sibling;
- }
- }
-
- function isValidScopeNode(node, scope) {
- return node.tag === ScopeComponent && node.type === scope && node.stateNode !== null;
- }
-
- function createScopeMethods(scope, instance) {
- return {
- getChildren: function () {
- var currentFiber = instance.fiber;
- var child = currentFiber.child;
- var childrenScopes = [];
-
- if (child !== null) {
- collectNearestChildScopeMethods(child, scope, childrenScopes);
- }
-
- return childrenScopes.length === 0 ? null : childrenScopes;
- },
- getChildrenFromRoot: function () {
- var currentFiber = instance.fiber;
- var node = currentFiber;
-
- while (node !== null) {
- var parent = node.return;
-
- if (parent === null) {
- break;
- }
-
- node = parent;
-
- if (node.tag === ScopeComponent && node.type === scope) {
- break;
- }
- }
-
- var childrenScopes = [];
- collectNearestChildScopeMethods(node.child, scope, childrenScopes);
- return childrenScopes.length === 0 ? null : childrenScopes;
- },
- getParent: function () {
- var node = instance.fiber.return;
-
- while (node !== null) {
- if (node.tag === ScopeComponent && node.type === scope) {
- return node.stateNode.methods;
- }
-
- node = node.return;
- }
-
- return null;
- },
- getProps: function () {
- var currentFiber = instance.fiber;
- return currentFiber.memoizedProps;
- },
- queryAllNodes: function (fn) {
- var currentFiber = instance.fiber;
- var child = currentFiber.child;
- var scopedNodes = [];
-
- if (child !== null) {
- collectScopedNodesFromChildren(child, fn, scopedNodes);
- }
-
- return scopedNodes.length === 0 ? null : scopedNodes;
- },
- queryFirstNode: function (fn) {
- var currentFiber = instance.fiber;
- var child = currentFiber.child;
-
- if (child !== null) {
- return collectFirstScopedNodeFromChildren(child, fn);
- }
-
- return null;
- },
- containsNode: function (node) {
- var fiber = getInstanceFromNode$2(node);
-
- while (fiber !== null) {
- if (fiber.tag === ScopeComponent && fiber.type === scope && fiber.stateNode === instance) {
- return true;
- }
-
- fiber = fiber.return;
- }
-
- return false;
- }
- };
- }
-
- function markUpdate(workInProgress) {
- // Tag the fiber with an update effect. This turns a Placement into
- // a PlacementAndUpdate.
- workInProgress.effectTag |= Update;
- }
-
- function markRef$1(workInProgress) {
- workInProgress.effectTag |= Ref;
- }
-
- var appendAllChildren;
- var updateHostContainer;
- var updateHostComponent$1;
- var updateHostText$1;
-
- if (supportsMutation) {
- // Mutation mode
- appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {
- // We only have the top Fiber that was created but we need recurse down its
- // children to find all the terminal nodes.
- var node = workInProgress.child;
-
- while (node !== null) {
- if (node.tag === HostComponent || node.tag === HostText) {
- appendInitialChild(parent, node.stateNode);
- } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
- appendInitialChild(parent, node.stateNode.instance);
- } else if (node.tag === HostPortal) {// If we have a portal child, then we don't want to traverse
- // down its children. Instead, we'll get insertions from each child in
- // the portal directly.
- } else if (node.child !== null) {
- node.child.return = node;
- node = node.child;
- continue;
- }
-
- if (node === workInProgress) {
- return;
- }
-
- while (node.sibling === null) {
- if (node.return === null || node.return === workInProgress) {
- return;
- }
-
- node = node.return;
- }
-
- node.sibling.return = node.return;
- node = node.sibling;
- }
- };
-
- updateHostContainer = function (workInProgress) {// Noop
- };
-
- updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {
- // If we have an alternate, that means this is an update and we need to
- // schedule a side-effect to do the updates.
- var oldProps = current.memoizedProps;
-
- if (oldProps === newProps) {
- // In mutation mode, this is sufficient for a bailout because
- // we won't touch this node even if children changed.
- return;
- } // If we get updated because one of our children updated, we don't
- // have newProps so we'll have to reuse them.
- // TODO: Split the update API as separate for the props vs. children.
- // Even better would be if children weren't special cased at all tho.
-
-
- var instance = workInProgress.stateNode;
- var currentHostContext = getHostContext(); // TODO: Experiencing an error where oldProps is null. Suggests a host
- // component is hitting the resume path. Figure out why. Possibly
- // related to `hidden`.
-
- var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); // TODO: Type this specific to this type of component.
-
- workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there
- // is a new ref we mark this as an update. All the work is done in commitWork.
-
- if (updatePayload) {
- markUpdate(workInProgress);
- }
- };
-
- updateHostText$1 = function (current, workInProgress, oldText, newText) {
- // If the text differs, mark it as an update. All the work in done in commitWork.
- if (oldText !== newText) {
- markUpdate(workInProgress);
- }
- };
- } else if (supportsPersistence) {
- // Persistent host tree mode
- appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {
- // We only have the top Fiber that was created but we need recurse down its
- // children to find all the terminal nodes.
- var node = workInProgress.child;
-
- while (node !== null) {
- // eslint-disable-next-line no-labels
- branches: if (node.tag === HostComponent) {
- var instance = node.stateNode;
-
- if (needsVisibilityToggle && isHidden) {
- // This child is inside a timed out tree. Hide it.
- var props = node.memoizedProps;
- var type = node.type;
- instance = cloneHiddenInstance(instance, type, props, node);
- }
-
- appendInitialChild(parent, instance);
- } else if (node.tag === HostText) {
- var _instance = node.stateNode;
-
- if (needsVisibilityToggle && isHidden) {
- // This child is inside a timed out tree. Hide it.
- var text = node.memoizedProps;
- _instance = cloneHiddenTextInstance(_instance, text, node);
- }
-
- appendInitialChild(parent, _instance);
- } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
- var _instance2 = node.stateNode.instance;
-
- if (needsVisibilityToggle && isHidden) {
- // This child is inside a timed out tree. Hide it.
- var _props = node.memoizedProps;
- var _type = node.type;
- _instance2 = cloneHiddenInstance(_instance2, _type, _props, node);
- }
-
- appendInitialChild(parent, _instance2);
- } else if (node.tag === HostPortal) {// If we have a portal child, then we don't want to traverse
- // down its children. Instead, we'll get insertions from each child in
- // the portal directly.
- } else if (node.tag === SuspenseComponent) {
- if ((node.effectTag & Update) !== NoEffect) {
- // Need to toggle the visibility of the primary children.
- var newIsHidden = node.memoizedState !== null;
-
- if (newIsHidden) {
- var primaryChildParent = node.child;
-
- if (primaryChildParent !== null) {
- if (primaryChildParent.child !== null) {
- primaryChildParent.child.return = primaryChildParent;
- appendAllChildren(parent, primaryChildParent, true, newIsHidden);
- }
-
- var fallbackChildParent = primaryChildParent.sibling;
-
- if (fallbackChildParent !== null) {
- fallbackChildParent.return = node;
- node = fallbackChildParent;
- continue;
- }
- }
- }
- }
-
- if (node.child !== null) {
- // Continue traversing like normal
- node.child.return = node;
- node = node.child;
- continue;
- }
- } else if (node.child !== null) {
- node.child.return = node;
- node = node.child;
- continue;
- } // $FlowFixMe This is correct but Flow is confused by the labeled break.
-
-
- node = node;
-
- if (node === workInProgress) {
- return;
- }
-
- while (node.sibling === null) {
- if (node.return === null || node.return === workInProgress) {
- return;
- }
-
- node = node.return;
- }
-
- node.sibling.return = node.return;
- node = node.sibling;
- }
- }; // An unfortunate fork of appendAllChildren because we have two different parent types.
-
-
- var appendAllChildrenToContainer = function (containerChildSet, workInProgress, needsVisibilityToggle, isHidden) {
- // We only have the top Fiber that was created but we need recurse down its
- // children to find all the terminal nodes.
- var node = workInProgress.child;
-
- while (node !== null) {
- // eslint-disable-next-line no-labels
- branches: if (node.tag === HostComponent) {
- var instance = node.stateNode;
-
- if (needsVisibilityToggle && isHidden) {
- // This child is inside a timed out tree. Hide it.
- var props = node.memoizedProps;
- var type = node.type;
- instance = cloneHiddenInstance(instance, type, props, node);
- }
-
- appendChildToContainerChildSet(containerChildSet, instance);
- } else if (node.tag === HostText) {
- var _instance3 = node.stateNode;
-
- if (needsVisibilityToggle && isHidden) {
- // This child is inside a timed out tree. Hide it.
- var text = node.memoizedProps;
- _instance3 = cloneHiddenTextInstance(_instance3, text, node);
- }
-
- appendChildToContainerChildSet(containerChildSet, _instance3);
- } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
- var _instance4 = node.stateNode.instance;
-
- if (needsVisibilityToggle && isHidden) {
- // This child is inside a timed out tree. Hide it.
- var _props2 = node.memoizedProps;
- var _type2 = node.type;
- _instance4 = cloneHiddenInstance(_instance4, _type2, _props2, node);
- }
-
- appendChildToContainerChildSet(containerChildSet, _instance4);
- } else if (node.tag === HostPortal) {// If we have a portal child, then we don't want to traverse
- // down its children. Instead, we'll get insertions from each child in
- // the portal directly.
- } else if (node.tag === SuspenseComponent) {
- if ((node.effectTag & Update) !== NoEffect) {
- // Need to toggle the visibility of the primary children.
- var newIsHidden = node.memoizedState !== null;
-
- if (newIsHidden) {
- var primaryChildParent = node.child;
-
- if (primaryChildParent !== null) {
- if (primaryChildParent.child !== null) {
- primaryChildParent.child.return = primaryChildParent;
- appendAllChildrenToContainer(containerChildSet, primaryChildParent, true, newIsHidden);
- }
-
- var fallbackChildParent = primaryChildParent.sibling;
-
- if (fallbackChildParent !== null) {
- fallbackChildParent.return = node;
- node = fallbackChildParent;
- continue;
- }
- }
- }
- }
-
- if (node.child !== null) {
- // Continue traversing like normal
- node.child.return = node;
- node = node.child;
- continue;
- }
- } else if (node.child !== null) {
- node.child.return = node;
- node = node.child;
- continue;
- } // $FlowFixMe This is correct but Flow is confused by the labeled break.
-
-
- node = node;
-
- if (node === workInProgress) {
- return;
- }
-
- while (node.sibling === null) {
- if (node.return === null || node.return === workInProgress) {
- return;
- }
-
- node = node.return;
- }
-
- node.sibling.return = node.return;
- node = node.sibling;
- }
- };
-
- updateHostContainer = function (workInProgress) {
- var portalOrRoot = workInProgress.stateNode;
- var childrenUnchanged = workInProgress.firstEffect === null;
-
- if (childrenUnchanged) {// No changes, just reuse the existing instance.
- } else {
- var container = portalOrRoot.containerInfo;
- var newChildSet = createContainerChildSet(container); // If children might have changed, we have to add them all to the set.
-
- appendAllChildrenToContainer(newChildSet, workInProgress, false, false);
- portalOrRoot.pendingChildren = newChildSet; // Schedule an update on the container to swap out the container.
-
- markUpdate(workInProgress);
- finalizeContainerChildren(container, newChildSet);
- }
- };
-
- updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {
- var currentInstance = current.stateNode;
- var oldProps = current.memoizedProps; // If there are no effects associated with this node, then none of our children had any updates.
- // This guarantees that we can reuse all of them.
-
- var childrenUnchanged = workInProgress.firstEffect === null;
-
- if (childrenUnchanged && oldProps === newProps) {
- // No changes, just reuse the existing instance.
- // Note that this might release a previous clone.
- workInProgress.stateNode = currentInstance;
- return;
- }
-
- var recyclableInstance = workInProgress.stateNode;
- var currentHostContext = getHostContext();
- var updatePayload = null;
-
- if (oldProps !== newProps) {
- updatePayload = prepareUpdate(recyclableInstance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
- }
-
- if (childrenUnchanged && updatePayload === null) {
- // No changes, just reuse the existing instance.
- // Note that this might release a previous clone.
- workInProgress.stateNode = currentInstance;
- return;
- }
-
- var newInstance = cloneInstance(currentInstance, updatePayload, type, oldProps, newProps, workInProgress, childrenUnchanged, recyclableInstance);
-
- if (finalizeInitialChildren(newInstance, type, newProps, rootContainerInstance, currentHostContext)) {
- markUpdate(workInProgress);
- }
-
- workInProgress.stateNode = newInstance;
-
- if (childrenUnchanged) {
- // If there are no other effects in this tree, we need to flag this node as having one.
- // Even though we're not going to use it for anything.
- // Otherwise parents won't know that there are new children to propagate upwards.
- markUpdate(workInProgress);
- } else {
- // If children might have changed, we have to add them all to the set.
- appendAllChildren(newInstance, workInProgress, false, false);
- }
- };
-
- updateHostText$1 = function (current, workInProgress, oldText, newText) {
- if (oldText !== newText) {
- // If the text content differs, we'll create a new text instance for it.
- var rootContainerInstance = getRootHostContainer();
- var currentHostContext = getHostContext();
- workInProgress.stateNode = createTextInstance(newText, rootContainerInstance, currentHostContext, workInProgress); // We'll have to mark it as having an effect, even though we won't use the effect for anything.
- // This lets the parents know that at least one of their children has changed.
-
- markUpdate(workInProgress);
- }
- };
- } else {
- // No host operations
- updateHostContainer = function (workInProgress) {// Noop
- };
-
- updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {// Noop
- };
-
- updateHostText$1 = function (current, workInProgress, oldText, newText) {// Noop
- };
- }
-
- function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
- switch (renderState.tailMode) {
- case 'hidden':
- {
- // Any insertions at the end of the tail list after this point
- // should be invisible. If there are already mounted boundaries
- // anything before them are not considered for collapsing.
- // Therefore we need to go through the whole tail to find if
- // there are any.
- var tailNode = renderState.tail;
- var lastTailNode = null;
-
- while (tailNode !== null) {
- if (tailNode.alternate !== null) {
- lastTailNode = tailNode;
- }
-
- tailNode = tailNode.sibling;
- } // Next we're simply going to delete all insertions after the
- // last rendered item.
-
-
- if (lastTailNode === null) {
- // All remaining items in the tail are insertions.
- renderState.tail = null;
- } else {
- // Detach the insertion after the last node that was already
- // inserted.
- lastTailNode.sibling = null;
- }
-
- break;
- }
-
- case 'collapsed':
- {
- // Any insertions at the end of the tail list after this point
- // should be invisible. If there are already mounted boundaries
- // anything before them are not considered for collapsing.
- // Therefore we need to go through the whole tail to find if
- // there are any.
- var _tailNode = renderState.tail;
- var _lastTailNode = null;
-
- while (_tailNode !== null) {
- if (_tailNode.alternate !== null) {
- _lastTailNode = _tailNode;
- }
-
- _tailNode = _tailNode.sibling;
- } // Next we're simply going to delete all insertions after the
- // last rendered item.
-
-
- if (_lastTailNode === null) {
- // All remaining items in the tail are insertions.
- if (!hasRenderedATailFallback && renderState.tail !== null) {
- // We suspended during the head. We want to show at least one
- // row at the tail. So we'll keep on and cut off the rest.
- renderState.tail.sibling = null;
- } else {
- renderState.tail = null;
- }
- } else {
- // Detach the insertion after the last node that was already
- // inserted.
- _lastTailNode.sibling = null;
- }
-
- break;
- }
- }
- }
-
- function completeWork(current, workInProgress, renderExpirationTime) {
- var newProps = workInProgress.pendingProps;
-
- switch (workInProgress.tag) {
- case IndeterminateComponent:
- break;
-
- case LazyComponent:
- break;
-
- case SimpleMemoComponent:
- case FunctionComponent:
- break;
-
- case ClassComponent:
- {
- var Component = workInProgress.type;
-
- if (isContextProvider(Component)) {
- popContext(workInProgress);
- }
-
- break;
- }
-
- case HostRoot:
- {
- popHostContainer(workInProgress);
- popTopLevelContextObject(workInProgress);
- var fiberRoot = workInProgress.stateNode;
-
- if (fiberRoot.pendingContext) {
- fiberRoot.context = fiberRoot.pendingContext;
- fiberRoot.pendingContext = null;
- }
-
- if (current === null || current.child === null) {
- // If we hydrated, pop so that we can delete any remaining children
- // that weren't hydrated.
- var wasHydrated = popHydrationState(workInProgress);
-
- if (wasHydrated) {
- // If we hydrated, then we'll need to schedule an update for
- // the commit side-effects on the root.
- markUpdate(workInProgress);
- }
- }
-
- updateHostContainer(workInProgress);
- break;
- }
-
- case HostComponent:
- {
- popHostContext(workInProgress);
- var rootContainerInstance = getRootHostContainer();
- var type = workInProgress.type;
-
- if (current !== null && workInProgress.stateNode != null) {
- updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance);
-
- if (enableFlareAPI) {
- var prevListeners = current.memoizedProps.listeners;
- var nextListeners = newProps.listeners;
-
- if (prevListeners !== nextListeners) {
- markUpdate(workInProgress);
- }
- }
-
- if (current.ref !== workInProgress.ref) {
- markRef$1(workInProgress);
- }
- } else {
- if (!newProps) {
- if (!(workInProgress.stateNode !== null)) {
- {
- throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
- }
- } // This can happen when we abort work.
-
-
- break;
- }
-
- var currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context
- // "stack" as the parent. Then append children as we go in beginWork
- // or completeWork depending on we want to add then top->down or
- // bottom->up. Top->down is faster in IE11.
-
- var _wasHydrated = popHydrationState(workInProgress);
-
- if (_wasHydrated) {
- // TODO: Move this and createInstance step into the beginPhase
- // to consolidate.
- if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) {
- // If changes to the hydrated node needs to be applied at the
- // commit-phase we mark this as such.
- markUpdate(workInProgress);
- }
-
- if (enableFlareAPI) {
- var listeners = newProps.listeners;
-
- if (listeners != null) {
- updateEventListeners(listeners, workInProgress, rootContainerInstance);
- }
- }
- } else {
- var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress);
- appendAllChildren(instance, workInProgress, false, false); // This needs to be set before we mount Flare event listeners
-
- workInProgress.stateNode = instance;
-
- if (enableFlareAPI) {
- var _listeners = newProps.listeners;
-
- if (_listeners != null) {
- updateEventListeners(_listeners, workInProgress, rootContainerInstance);
- }
- } // Certain renderers require commit-time effects for initial mount.
- // (eg DOM renderer supports auto-focus for certain elements).
- // Make sure such renderers get scheduled for later work.
-
-
- if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance, currentHostContext)) {
- markUpdate(workInProgress);
- }
- }
-
- if (workInProgress.ref !== null) {
- // If there is a ref on a host node we need to schedule a callback
- markRef$1(workInProgress);
- }
- }
-
- break;
- }
-
- case HostText:
- {
- var newText = newProps;
-
- if (current && workInProgress.stateNode != null) {
- var oldText = current.memoizedProps; // If we have an alternate, that means this is an update and we need
- // to schedule a side-effect to do the updates.
-
- updateHostText$1(current, workInProgress, oldText, newText);
- } else {
- if (typeof newText !== 'string') {
- if (!(workInProgress.stateNode !== null)) {
- {
- throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");
- }
- } // This can happen when we abort work.
-
- }
-
- var _rootContainerInstance = getRootHostContainer();
-
- var _currentHostContext = getHostContext();
-
- var _wasHydrated2 = popHydrationState(workInProgress);
-
- if (_wasHydrated2) {
- if (prepareToHydrateHostTextInstance(workInProgress)) {
- markUpdate(workInProgress);
- }
- } else {
- workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress);
- }
- }
-
- break;
- }
-
- case ForwardRef:
- break;
-
- case SuspenseComponent:
- {
- popSuspenseContext(workInProgress);
- var nextState = workInProgress.memoizedState;
-
- if (enableSuspenseServerRenderer) {
- if (nextState !== null && nextState.dehydrated !== null) {
- if (current === null) {
- var _wasHydrated3 = popHydrationState(workInProgress);
-
- if (!_wasHydrated3) {
- {
- throw Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");
- }
- }
-
- prepareToHydrateHostSuspenseInstance(workInProgress);
-
- if (enableSchedulerTracing) {
- markSpawnedWork(Never);
- }
-
- return null;
- } else {
- // We should never have been in a hydration state if we didn't have a current.
- // However, in some of those paths, we might have reentered a hydration state
- // and then we might be inside a hydration state. In that case, we'll need to
- // exit out of it.
- resetHydrationState();
-
- if ((workInProgress.effectTag & DidCapture) === NoEffect) {
- // This boundary did not suspend so it's now hydrated and unsuspended.
- workInProgress.memoizedState = null;
- } // If nothing suspended, we need to schedule an effect to mark this boundary
- // as having hydrated so events know that they're free be invoked.
- // It's also a signal to replay events and the suspense callback.
- // If something suspended, schedule an effect to attach retry listeners.
- // So we might as well always mark this.
-
-
- workInProgress.effectTag |= Update;
- return null;
- }
- }
- }
-
- if ((workInProgress.effectTag & DidCapture) !== NoEffect) {
- // Something suspended. Re-render with the fallback children.
- workInProgress.expirationTime = renderExpirationTime; // Do not reset the effect list.
-
- return workInProgress;
- }
-
- var nextDidTimeout = nextState !== null;
- var prevDidTimeout = false;
-
- if (current === null) {
- if (workInProgress.memoizedProps.fallback !== undefined) {
- popHydrationState(workInProgress);
- }
- } else {
- var prevState = current.memoizedState;
- prevDidTimeout = prevState !== null;
-
- if (!nextDidTimeout && prevState !== null) {
- // We just switched from the fallback to the normal children.
- // Delete the fallback.
- // TODO: Would it be better to store the fallback fragment on
- // the stateNode during the begin phase?
- var currentFallbackChild = current.child.sibling;
-
- if (currentFallbackChild !== null) {
- // Deletions go at the beginning of the return fiber's effect list
- var first = workInProgress.firstEffect;
-
- if (first !== null) {
- workInProgress.firstEffect = currentFallbackChild;
- currentFallbackChild.nextEffect = first;
- } else {
- workInProgress.firstEffect = workInProgress.lastEffect = currentFallbackChild;
- currentFallbackChild.nextEffect = null;
- }
-
- currentFallbackChild.effectTag = Deletion;
- }
- }
- }
-
- if (nextDidTimeout && !prevDidTimeout) {
- // If this subtreee is running in blocking mode we can suspend,
- // otherwise we won't suspend.
- // TODO: This will still suspend a synchronous tree if anything
- // in the concurrent tree already suspended during this render.
- // This is a known bug.
- if ((workInProgress.mode & BlockingMode) !== NoMode) {
- // TODO: Move this back to throwException because this is too late
- // if this is a large tree which is common for initial loads. We
- // don't know if we should restart a render or not until we get
- // this marker, and this is too late.
- // If this render already had a ping or lower pri updates,
- // and this is the first time we know we're going to suspend we
- // should be able to immediately restart from within throwException.
- var hasInvisibleChildContext = current === null && workInProgress.memoizedProps.unstable_avoidThisFallback !== true;
-
- if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {
- // If this was in an invisible tree or a new render, then showing
- // this boundary is ok.
- renderDidSuspend();
- } else {
- // Otherwise, we're going to have to hide content so we should
- // suspend for longer if possible.
- renderDidSuspendDelayIfPossible();
- }
- }
- }
-
- if (supportsPersistence) {
- // TODO: Only schedule updates if not prevDidTimeout.
- if (nextDidTimeout) {
- // If this boundary just timed out, schedule an effect to attach a
- // retry listener to the proimse. This flag is also used to hide the
- // primary children.
- workInProgress.effectTag |= Update;
- }
- }
-
- if (supportsMutation) {
- // TODO: Only schedule updates if these values are non equal, i.e. it changed.
- if (nextDidTimeout || prevDidTimeout) {
- // If this boundary just timed out, schedule an effect to attach a
- // retry listener to the proimse. This flag is also used to hide the
- // primary children. In mutation mode, we also need the flag to
- // *unhide* children that were previously hidden, so check if the
- // is currently timed out, too.
- workInProgress.effectTag |= Update;
- }
- }
-
- if (enableSuspenseCallback && workInProgress.updateQueue !== null && workInProgress.memoizedProps.suspenseCallback != null) {
- // Always notify the callback
- workInProgress.effectTag |= Update;
- }
-
- break;
- }
-
- case Fragment:
- break;
-
- case Mode:
- break;
-
- case Profiler:
- break;
-
- case HostPortal:
- popHostContainer(workInProgress);
- updateHostContainer(workInProgress);
- break;
-
- case ContextProvider:
- // Pop provider fiber
- popProvider(workInProgress);
- break;
-
- case ContextConsumer:
- break;
-
- case MemoComponent:
- break;
-
- case IncompleteClassComponent:
- {
- // Same as class component case. I put it down here so that the tags are
- // sequential to ensure this switch is compiled to a jump table.
- var _Component = workInProgress.type;
-
- if (isContextProvider(_Component)) {
- popContext(workInProgress);
- }
-
- break;
- }
-
- case SuspenseListComponent:
- {
- popSuspenseContext(workInProgress);
- var renderState = workInProgress.memoizedState;
-
- if (renderState === null) {
- // We're running in the default, "independent" mode. We don't do anything
- // in this mode.
- break;
- }
-
- var didSuspendAlready = (workInProgress.effectTag & DidCapture) !== NoEffect;
- var renderedTail = renderState.rendering;
-
- if (renderedTail === null) {
- // We just rendered the head.
- if (!didSuspendAlready) {
- // This is the first pass. We need to figure out if anything is still
- // suspended in the rendered set.
- // If new content unsuspended, but there's still some content that
- // didn't. Then we need to do a second pass that forces everything
- // to keep showing their fallbacks.
- // We might be suspended if something in this render pass suspended, or
- // something in the previous committed pass suspended. Otherwise,
- // there's no chance so we can skip the expensive call to
- // findFirstSuspended.
- var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.effectTag & DidCapture) === NoEffect);
-
- if (!cannotBeSuspended) {
- var row = workInProgress.child;
-
- while (row !== null) {
- var suspended = findFirstSuspended(row);
-
- if (suspended !== null) {
- didSuspendAlready = true;
- workInProgress.effectTag |= DidCapture;
- cutOffTailIfNeeded(renderState, false); // If this is a newly suspended tree, it might not get committed as
- // part of the second pass. In that case nothing will subscribe to
- // its thennables. Instead, we'll transfer its thennables to the
- // SuspenseList so that it can retry if they resolve.
- // There might be multiple of these in the list but since we're
- // going to wait for all of them anyway, it doesn't really matter
- // which ones gets to ping. In theory we could get clever and keep
- // track of how many dependencies remain but it gets tricky because
- // in the meantime, we can add/remove/change items and dependencies.
- // We might bail out of the loop before finding any but that
- // doesn't matter since that means that the other boundaries that
- // we did find already has their listeners attached.
-
- var newThennables = suspended.updateQueue;
-
- if (newThennables !== null) {
- workInProgress.updateQueue = newThennables;
- workInProgress.effectTag |= Update;
- } // Rerender the whole list, but this time, we'll force fallbacks
- // to stay in place.
- // Reset the effect list before doing the second pass since that's now invalid.
-
-
- if (renderState.lastEffect === null) {
- workInProgress.firstEffect = null;
- }
-
- workInProgress.lastEffect = renderState.lastEffect; // Reset the child fibers to their original state.
-
- resetChildFibers(workInProgress, renderExpirationTime); // Set up the Suspense Context to force suspense and immediately
- // rerender the children.
-
- pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));
- return workInProgress.child;
- }
-
- row = row.sibling;
- }
- }
- } else {
- cutOffTailIfNeeded(renderState, false);
- } // Next we're going to render the tail.
-
- } else {
- // Append the rendered row to the child list.
- if (!didSuspendAlready) {
- var _suspended = findFirstSuspended(renderedTail);
-
- if (_suspended !== null) {
- workInProgress.effectTag |= DidCapture;
- didSuspendAlready = true; // Ensure we transfer the update queue to the parent so that it doesn't
- // get lost if this row ends up dropped during a second pass.
-
- var _newThennables = _suspended.updateQueue;
-
- if (_newThennables !== null) {
- workInProgress.updateQueue = _newThennables;
- workInProgress.effectTag |= Update;
- }
-
- cutOffTailIfNeeded(renderState, true); // This might have been modified.
-
- if (renderState.tail === null && renderState.tailMode === 'hidden' && !renderedTail.alternate) {
- // We need to delete the row we just rendered.
- // Reset the effect list to what it was before we rendered this
- // child. The nested children have already appended themselves.
- var lastEffect = workInProgress.lastEffect = renderState.lastEffect; // Remove any effects that were appended after this point.
-
- if (lastEffect !== null) {
- lastEffect.nextEffect = null;
- } // We're done.
-
-
- return null;
- }
- } else if (now() > renderState.tailExpiration && renderExpirationTime > Never) {
- // We have now passed our CPU deadline and we'll just give up further
- // attempts to render the main content and only render fallbacks.
- // The assumption is that this is usually faster.
- workInProgress.effectTag |= DidCapture;
- didSuspendAlready = true;
- cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this
- // to get it started back up to attempt the next item. If we can show
- // them, then they really have the same priority as this render.
- // So we'll pick it back up the very next render pass once we've had
- // an opportunity to yield for paint.
-
- var nextPriority = renderExpirationTime - 1;
- workInProgress.expirationTime = workInProgress.childExpirationTime = nextPriority;
-
- if (enableSchedulerTracing) {
- markSpawnedWork(nextPriority);
- }
- }
- }
-
- if (renderState.isBackwards) {
- // The effect list of the backwards tail will have been added
- // to the end. This breaks the guarantee that life-cycles fire in
- // sibling order but that isn't a strong guarantee promised by React.
- // Especially since these might also just pop in during future commits.
- // Append to the beginning of the list.
- renderedTail.sibling = workInProgress.child;
- workInProgress.child = renderedTail;
- } else {
- var previousSibling = renderState.last;
-
- if (previousSibling !== null) {
- previousSibling.sibling = renderedTail;
- } else {
- workInProgress.child = renderedTail;
- }
-
- renderState.last = renderedTail;
- }
- }
-
- if (renderState.tail !== null) {
- // We still have tail rows to render.
- if (renderState.tailExpiration === 0) {
- // Heuristic for how long we're willing to spend rendering rows
- // until we just give up and show what we have so far.
- var TAIL_EXPIRATION_TIMEOUT_MS = 500;
- renderState.tailExpiration = now() + TAIL_EXPIRATION_TIMEOUT_MS;
- } // Pop a row.
-
-
- var next = renderState.tail;
- renderState.rendering = next;
- renderState.tail = next.sibling;
- renderState.lastEffect = workInProgress.lastEffect;
- next.sibling = null; // Restore the context.
- // TODO: We can probably just avoid popping it instead and only
- // setting it the first time we go from not suspended to suspended.
-
- var suspenseContext = suspenseStackCursor.current;
-
- if (didSuspendAlready) {
- suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);
- } else {
- suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);
- }
-
- pushSuspenseContext(workInProgress, suspenseContext); // Do a pass over the next row.
-
- return next;
- }
-
- break;
- }
-
- case FundamentalComponent:
- {
- if (enableFundamentalAPI) {
- var fundamentalImpl = workInProgress.type.impl;
- var fundamentalInstance = workInProgress.stateNode;
-
- if (fundamentalInstance === null) {
- var getInitialState = fundamentalImpl.getInitialState;
- var fundamentalState;
-
- if (getInitialState !== undefined) {
- fundamentalState = getInitialState(newProps);
- }
-
- fundamentalInstance = workInProgress.stateNode = createFundamentalStateInstance(workInProgress, newProps, fundamentalImpl, fundamentalState || {});
-
- var _instance5 = getFundamentalComponentInstance(fundamentalInstance);
-
- fundamentalInstance.instance = _instance5;
-
- if (fundamentalImpl.reconcileChildren === false) {
- return null;
- }
-
- appendAllChildren(_instance5, workInProgress, false, false);
- mountFundamentalComponent(fundamentalInstance);
- } else {
- // We fire update in commit phase
- var prevProps = fundamentalInstance.props;
- fundamentalInstance.prevProps = prevProps;
- fundamentalInstance.props = newProps;
- fundamentalInstance.currentFiber = workInProgress;
-
- if (supportsPersistence) {
- var _instance6 = cloneFundamentalInstance(fundamentalInstance);
-
- fundamentalInstance.instance = _instance6;
- appendAllChildren(_instance6, workInProgress, false, false);
- }
-
- var shouldUpdate = shouldUpdateFundamentalComponent(fundamentalInstance);
-
- if (shouldUpdate) {
- markUpdate(workInProgress);
- }
- }
- }
-
- break;
- }
-
- case ScopeComponent:
- {
- if (enableScopeAPI) {
- if (current === null) {
- var _type3 = workInProgress.type;
- var scopeInstance = {
- fiber: workInProgress,
- methods: null
- };
- workInProgress.stateNode = scopeInstance;
- scopeInstance.methods = createScopeMethods(_type3, scopeInstance);
-
- if (enableFlareAPI) {
- var _listeners2 = newProps.listeners;
-
- if (_listeners2 != null) {
- var _rootContainerInstance2 = getRootHostContainer();
-
- updateEventListeners(_listeners2, workInProgress, _rootContainerInstance2);
- }
- }
-
- if (workInProgress.ref !== null) {
- markRef$1(workInProgress);
- markUpdate(workInProgress);
- }
- } else {
- if (enableFlareAPI) {
- var _prevListeners = current.memoizedProps.listeners;
- var _nextListeners = newProps.listeners;
-
- if (_prevListeners !== _nextListeners || workInProgress.ref !== null) {
- markUpdate(workInProgress);
- }
- } else {
- if (workInProgress.ref !== null) {
- markUpdate(workInProgress);
- }
- }
-
- if (current.ref !== workInProgress.ref) {
- markRef$1(workInProgress);
- }
- }
- }
-
- break;
- }
-
- default:
- {
- {
- throw Error("Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue.");
- }
- }
-
- }
-
- return null;
- }
-
- function unwindWork(workInProgress, renderExpirationTime) {
- switch (workInProgress.tag) {
- case ClassComponent:
- {
- var Component = workInProgress.type;
-
- if (isContextProvider(Component)) {
- popContext(workInProgress);
- }
-
- var effectTag = workInProgress.effectTag;
-
- if (effectTag & ShouldCapture) {
- workInProgress.effectTag = effectTag & ~ShouldCapture | DidCapture;
- return workInProgress;
- }
-
- return null;
- }
-
- case HostRoot:
- {
- popHostContainer(workInProgress);
- popTopLevelContextObject(workInProgress);
- var _effectTag = workInProgress.effectTag;
-
- if (!((_effectTag & DidCapture) === NoEffect)) {
- {
- throw Error("The root failed to unmount after an error. This is likely a bug in React. Please file an issue.");
- }
- }
-
- workInProgress.effectTag = _effectTag & ~ShouldCapture | DidCapture;
- return workInProgress;
- }
-
- case HostComponent:
- {
- // TODO: popHydrationState
- popHostContext(workInProgress);
- return null;
- }
-
- case SuspenseComponent:
- {
- popSuspenseContext(workInProgress);
-
- if (enableSuspenseServerRenderer) {
- var suspenseState = workInProgress.memoizedState;
-
- if (suspenseState !== null && suspenseState.dehydrated !== null) {
- if (!(workInProgress.alternate !== null)) {
- {
- throw Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");
- }
- }
-
- resetHydrationState();
- }
- }
-
- var _effectTag2 = workInProgress.effectTag;
-
- if (_effectTag2 & ShouldCapture) {
- workInProgress.effectTag = _effectTag2 & ~ShouldCapture | DidCapture; // Captured a suspense effect. Re-render the boundary.
-
- return workInProgress;
- }
-
- return null;
- }
-
- case SuspenseListComponent:
- {
- popSuspenseContext(workInProgress); // SuspenseList doesn't actually catch anything. It should've been
- // caught by a nested boundary. If not, it should bubble through.
-
- return null;
- }
-
- case HostPortal:
- popHostContainer(workInProgress);
- return null;
-
- case ContextProvider:
- popProvider(workInProgress);
- return null;
-
- default:
- return null;
- }
- }
-
- function unwindInterruptedWork(interruptedWork) {
- switch (interruptedWork.tag) {
- case ClassComponent:
- {
- var childContextTypes = interruptedWork.type.childContextTypes;
-
- if (childContextTypes !== null && childContextTypes !== undefined) {
- popContext(interruptedWork);
- }
-
- break;
- }
-
- case HostRoot:
- {
- popHostContainer(interruptedWork);
- popTopLevelContextObject(interruptedWork);
- break;
- }
-
- case HostComponent:
- {
- popHostContext(interruptedWork);
- break;
- }
-
- case HostPortal:
- popHostContainer(interruptedWork);
- break;
-
- case SuspenseComponent:
- popSuspenseContext(interruptedWork);
- break;
-
- case SuspenseListComponent:
- popSuspenseContext(interruptedWork);
- break;
-
- case ContextProvider:
- popProvider(interruptedWork);
- break;
-
- default:
- break;
- }
- }
-
- function createCapturedValue(value, source) {
- // If the value is an error, call this function immediately after it is thrown
- // so the stack is accurate.
- return {
- value: value,
- source: source,
- stack: getStackByFiberInDevAndProd(source)
- };
- }
-
- // This module is forked in different environments.
- // By default, return `true` to log errors to the console.
- // Forks can return `false` if this isn't desirable.
- function showErrorDialog(capturedError) {
- return true;
- }
-
- function logCapturedError(capturedError) {
- var logError = showErrorDialog(capturedError); // Allow injected showErrorDialog() to prevent default console.error logging.
- // This enables renderers like ReactNative to better manage redbox behavior.
-
- if (logError === false) {
- return;
- }
-
- var error = capturedError.error;
-
- {
- var componentName = capturedError.componentName,
- componentStack = capturedError.componentStack,
- errorBoundaryName = capturedError.errorBoundaryName,
- errorBoundaryFound = capturedError.errorBoundaryFound,
- willRetry = capturedError.willRetry; // Browsers support silencing uncaught errors by calling
- // `preventDefault()` in window `error` handler.
- // We record this information as an expando on the error.
-
- if (error != null && error._suppressLogging) {
- if (errorBoundaryFound && willRetry) {
- // The error is recoverable and was silenced.
- // Ignore it and don't print the stack addendum.
- // This is handy for testing error boundaries without noise.
- return;
- } // The error is fatal. Since the silencing might have
- // been accidental, we'll surface it anyway.
- // However, the browser would have silenced the original error
- // so we'll print it first, and then print the stack addendum.
-
-
- console.error(error); // For a more detailed description of this block, see:
- // https://github.com/facebook/react/pull/13384
- }
-
- var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : 'The above error occurred in one of your React components:';
- var errorBoundaryMessage; // errorBoundaryFound check is sufficient; errorBoundaryName check is to satisfy Flow.
-
- if (errorBoundaryFound && errorBoundaryName) {
- if (willRetry) {
- errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + ".");
- } else {
- errorBoundaryMessage = "This error was initially handled by the error boundary " + errorBoundaryName + ".\n" + "Recreating the tree from scratch failed so React will unmount the tree.";
- }
- } else {
- errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\n' + 'Visit https://fb.me/react-error-boundaries to learn more about error boundaries.';
- }
-
- var combinedMessage = "" + componentNameMessage + componentStack + "\n\n" + ("" + errorBoundaryMessage); // In development, we provide our own message with just the component stack.
- // We don't include the original error message and JS stack because the browser
- // has already printed it. Even if the application swallows the error, it is still
- // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils.
-
- console.error(combinedMessage);
- }
- }
-
- var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
-
- {
- didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();
- }
-
- var PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;
- function logError(boundary, errorInfo) {
- var source = errorInfo.source;
- var stack = errorInfo.stack;
-
- if (stack === null && source !== null) {
- stack = getStackByFiberInDevAndProd(source);
- }
-
- var capturedError = {
- componentName: source !== null ? getComponentName(source.type) : null,
- componentStack: stack !== null ? stack : '',
- error: errorInfo.value,
- errorBoundary: null,
- errorBoundaryName: null,
- errorBoundaryFound: false,
- willRetry: false
- };
-
- if (boundary !== null && boundary.tag === ClassComponent) {
- capturedError.errorBoundary = boundary.stateNode;
- capturedError.errorBoundaryName = getComponentName(boundary.type);
- capturedError.errorBoundaryFound = true;
- capturedError.willRetry = true;
- }
-
- try {
- logCapturedError(capturedError);
- } catch (e) {
- // This method must not throw, or React internal state will get messed up.
- // If console.error is overridden, or logCapturedError() shows a dialog that throws,
- // we want to report this error outside of the normal stack as a last resort.
- // https://github.com/facebook/react/issues/13188
- setTimeout(function () {
- throw e;
- });
- }
- }
-
- var callComponentWillUnmountWithTimer = function (current$$1, instance) {
- startPhaseTimer(current$$1, 'componentWillUnmount');
- instance.props = current$$1.memoizedProps;
- instance.state = current$$1.memoizedState;
- instance.componentWillUnmount();
- stopPhaseTimer();
- }; // Capture errors so they don't interrupt unmounting.
-
-
- function safelyCallComponentWillUnmount(current$$1, instance) {
- {
- invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current$$1, instance);
-
- if (hasCaughtError()) {
- var unmountError = clearCaughtError();
- captureCommitPhaseError(current$$1, unmountError);
- }
- }
- }
-
- function safelyDetachRef(current$$1) {
- var ref = current$$1.ref;
-
- if (ref !== null) {
- if (typeof ref === 'function') {
- {
- invokeGuardedCallback(null, ref, null, null);
-
- if (hasCaughtError()) {
- var refError = clearCaughtError();
- captureCommitPhaseError(current$$1, refError);
- }
- }
- } else {
- ref.current = null;
- }
- }
- }
-
- function safelyCallDestroy(current$$1, destroy) {
- {
- invokeGuardedCallback(null, destroy, null);
-
- if (hasCaughtError()) {
- var error = clearCaughtError();
- captureCommitPhaseError(current$$1, error);
- }
- }
- }
-
- function commitBeforeMutationLifeCycles(current$$1, finishedWork) {
- switch (finishedWork.tag) {
- case FunctionComponent:
- case ForwardRef:
- case SimpleMemoComponent:
- {
- commitHookEffectList(UnmountSnapshot, NoEffect$1, finishedWork);
- return;
- }
-
- case ClassComponent:
- {
- if (finishedWork.effectTag & Snapshot) {
- if (current$$1 !== null) {
- var prevProps = current$$1.memoizedProps;
- var prevState = current$$1.memoizedState;
- startPhaseTimer(finishedWork, 'getSnapshotBeforeUpdate');
- var instance = finishedWork.stateNode; // We could update instance props and state here,
- // but instead we rely on them being set during last render.
- // TODO: revisit this when we implement resuming.
-
- {
- if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
- !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
- !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
- }
- }
-
- var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);
-
- {
- var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;
-
- if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) {
- didWarnSet.add(finishedWork.type);
- warningWithoutStack$1(false, '%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentName(finishedWork.type));
- }
- }
-
- instance.__reactInternalSnapshotBeforeUpdate = snapshot;
- stopPhaseTimer();
- }
- }
-
- return;
- }
-
- case HostRoot:
- case HostComponent:
- case HostText:
- case HostPortal:
- case IncompleteClassComponent:
- // Nothing to do for these component types
- return;
-
- default:
- {
- {
- {
- throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
- }
- }
- }
-
- function commitHookEffectList(unmountTag, mountTag, finishedWork) {
- var updateQueue = finishedWork.updateQueue;
- var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
-
- if (lastEffect !== null) {
- var firstEffect = lastEffect.next;
- var effect = firstEffect;
-
- do {
- if ((effect.tag & unmountTag) !== NoEffect$1) {
- // Unmount
- var destroy = effect.destroy;
- effect.destroy = undefined;
-
- if (destroy !== undefined) {
- destroy();
- }
- }
-
- if ((effect.tag & mountTag) !== NoEffect$1) {
- // Mount
- var create = effect.create;
- effect.destroy = create();
-
- {
- var _destroy = effect.destroy;
-
- if (_destroy !== undefined && typeof _destroy !== 'function') {
- var addendum = void 0;
-
- if (_destroy === null) {
- addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).';
- } else if (typeof _destroy.then === 'function') {
- addendum = '\n\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:\n\n' + 'useEffect(() => {\n' + ' async function fetchData() {\n' + ' // You can await here\n' + ' const response = await MyAPI.getData(someId);\n' + ' // ...\n' + ' }\n' + ' fetchData();\n' + "}, [someId]); // Or [] if effect doesn't need props or state\n\n" + 'Learn more about data fetching with Hooks: https://fb.me/react-hooks-data-fetching';
- } else {
- addendum = ' You returned: ' + _destroy;
- }
-
- warningWithoutStack$1(false, 'An effect function must not return anything besides a function, ' + 'which is used for clean-up.%s%s', addendum, getStackByFiberInDevAndProd(finishedWork));
- }
- }
- }
-
- effect = effect.next;
- } while (effect !== firstEffect);
- }
- }
-
- function commitPassiveHookEffects(finishedWork) {
- if ((finishedWork.effectTag & Passive) !== NoEffect) {
- switch (finishedWork.tag) {
- case FunctionComponent:
- case ForwardRef:
- case SimpleMemoComponent:
- {
- commitHookEffectList(UnmountPassive, NoEffect$1, finishedWork);
- commitHookEffectList(NoEffect$1, MountPassive, finishedWork);
- break;
- }
-
- default:
- break;
- }
- }
- }
-
- function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpirationTime) {
- switch (finishedWork.tag) {
- case FunctionComponent:
- case ForwardRef:
- case SimpleMemoComponent:
- {
- commitHookEffectList(UnmountLayout, MountLayout, finishedWork);
- break;
- }
-
- case ClassComponent:
- {
- var instance = finishedWork.stateNode;
-
- if (finishedWork.effectTag & Update) {
- if (current$$1 === null) {
- startPhaseTimer(finishedWork, 'componentDidMount'); // We could update instance props and state here,
- // but instead we rely on them being set during last render.
- // TODO: revisit this when we implement resuming.
-
- {
- if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
- !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
- !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
- }
- }
-
- instance.componentDidMount();
- stopPhaseTimer();
- } else {
- var prevProps = finishedWork.elementType === finishedWork.type ? current$$1.memoizedProps : resolveDefaultProps(finishedWork.type, current$$1.memoizedProps);
- var prevState = current$$1.memoizedState;
- startPhaseTimer(finishedWork, 'componentDidUpdate'); // We could update instance props and state here,
- // but instead we rely on them being set during last render.
- // TODO: revisit this when we implement resuming.
-
- {
- if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
- !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
- !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
- }
- }
-
- instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
- stopPhaseTimer();
- }
- }
-
- var updateQueue = finishedWork.updateQueue;
-
- if (updateQueue !== null) {
- {
- if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
- !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
- !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
- }
- } // We could update instance props and state here,
- // but instead we rely on them being set during last render.
- // TODO: revisit this when we implement resuming.
-
-
- commitUpdateQueue(finishedWork, updateQueue, instance, committedExpirationTime);
- }
-
- return;
- }
-
- case HostRoot:
- {
- var _updateQueue = finishedWork.updateQueue;
-
- if (_updateQueue !== null) {
- var _instance = null;
-
- if (finishedWork.child !== null) {
- switch (finishedWork.child.tag) {
- case HostComponent:
- _instance = getPublicInstance(finishedWork.child.stateNode);
- break;
-
- case ClassComponent:
- _instance = finishedWork.child.stateNode;
- break;
- }
- }
-
- commitUpdateQueue(finishedWork, _updateQueue, _instance, committedExpirationTime);
- }
-
- return;
- }
-
- case HostComponent:
- {
- var _instance2 = finishedWork.stateNode; // Renderers may schedule work to be done after host components are mounted
- // (eg DOM renderer may schedule auto-focus for inputs and form controls).
- // These effects should only be committed when components are first mounted,
- // aka when there is no current/alternate.
-
- if (current$$1 === null && finishedWork.effectTag & Update) {
- var type = finishedWork.type;
- var props = finishedWork.memoizedProps;
- commitMount(_instance2, type, props, finishedWork);
- }
-
- return;
- }
-
- case HostText:
- {
- // We have no life-cycles associated with text.
- return;
- }
-
- case HostPortal:
- {
- // We have no life-cycles associated with portals.
- return;
- }
-
- case Profiler:
- {
- if (enableProfilerTimer) {
- var onRender = finishedWork.memoizedProps.onRender;
-
- if (typeof onRender === 'function') {
- if (enableSchedulerTracing) {
- onRender(finishedWork.memoizedProps.id, current$$1 === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime(), finishedRoot.memoizedInteractions);
- } else {
- onRender(finishedWork.memoizedProps.id, current$$1 === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime());
- }
- }
- }
-
- return;
- }
-
- case SuspenseComponent:
- {
- commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);
- return;
- }
-
- case SuspenseListComponent:
- case IncompleteClassComponent:
- case FundamentalComponent:
- case ScopeComponent:
- return;
-
- default:
- {
- {
- {
- throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
- }
- }
- }
-
- function hideOrUnhideAllChildren(finishedWork, isHidden) {
- if (supportsMutation) {
- // We only have the top Fiber that was inserted but we need to recurse down its
- // children to find all the terminal nodes.
- var node = finishedWork;
-
- while (true) {
- if (node.tag === HostComponent) {
- var instance = node.stateNode;
-
- if (isHidden) {
- hideInstance(instance);
- } else {
- unhideInstance(node.stateNode, node.memoizedProps);
- }
- } else if (node.tag === HostText) {
- var _instance3 = node.stateNode;
-
- if (isHidden) {
- hideTextInstance(_instance3);
- } else {
- unhideTextInstance(_instance3, node.memoizedProps);
- }
- } else if (node.tag === SuspenseComponent && node.memoizedState !== null && node.memoizedState.dehydrated === null) {
- // Found a nested Suspense component that timed out. Skip over the
- // primary child fragment, which should remain hidden.
- var fallbackChildFragment = node.child.sibling;
- fallbackChildFragment.return = node;
- node = fallbackChildFragment;
- continue;
- } else if (node.child !== null) {
- node.child.return = node;
- node = node.child;
- continue;
- }
-
- if (node === finishedWork) {
- return;
- }
-
- while (node.sibling === null) {
- if (node.return === null || node.return === finishedWork) {
- return;
- }
-
- node = node.return;
- }
-
- node.sibling.return = node.return;
- node = node.sibling;
- }
- }
- }
-
- function commitAttachRef(finishedWork) {
- var ref = finishedWork.ref;
-
- if (ref !== null) {
- var instance = finishedWork.stateNode;
- var instanceToUse;
-
- switch (finishedWork.tag) {
- case HostComponent:
- instanceToUse = getPublicInstance(instance);
- break;
-
- default:
- instanceToUse = instance;
- } // Moved outside to ensure DCE works with this flag
-
-
- if (enableScopeAPI && finishedWork.tag === ScopeComponent) {
- instanceToUse = instance.methods;
- }
-
- if (typeof ref === 'function') {
- ref(instanceToUse);
- } else {
- {
- if (!ref.hasOwnProperty('current')) {
- warningWithoutStack$1(false, 'Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().%s', getComponentName(finishedWork.type), getStackByFiberInDevAndProd(finishedWork));
- }
- }
-
- ref.current = instanceToUse;
- }
- }
- }
-
- function commitDetachRef(current$$1) {
- var currentRef = current$$1.ref;
-
- if (currentRef !== null) {
- if (typeof currentRef === 'function') {
- currentRef(null);
- } else {
- currentRef.current = null;
- }
- }
- } // User-originating errors (lifecycles and refs) should not interrupt
- // deletion, so don't let them throw. Host-originating errors should
- // interrupt deletion, so it's okay
-
-
- function commitUnmount(finishedRoot, current$$1, renderPriorityLevel) {
- onCommitUnmount(current$$1);
-
- switch (current$$1.tag) {
- case FunctionComponent:
- case ForwardRef:
- case MemoComponent:
- case SimpleMemoComponent:
- {
- var updateQueue = current$$1.updateQueue;
-
- if (updateQueue !== null) {
- var lastEffect = updateQueue.lastEffect;
-
- if (lastEffect !== null) {
- var firstEffect = lastEffect.next; // When the owner fiber is deleted, the destroy function of a passive
- // effect hook is called during the synchronous commit phase. This is
- // a concession to implementation complexity. Calling it in the
- // passive effect phase (like they usually are, when dependencies
- // change during an update) would require either traversing the
- // children of the deleted fiber again, or including unmount effects
- // as part of the fiber effect list.
- //
- // Because this is during the sync commit phase, we need to change
- // the priority.
- //
- // TODO: Reconsider this implementation trade off.
-
- var priorityLevel = renderPriorityLevel > NormalPriority ? NormalPriority : renderPriorityLevel;
- runWithPriority$2(priorityLevel, function () {
- var effect = firstEffect;
-
- do {
- var destroy = effect.destroy;
-
- if (destroy !== undefined) {
- safelyCallDestroy(current$$1, destroy);
- }
-
- effect = effect.next;
- } while (effect !== firstEffect);
- });
- }
- }
-
- break;
- }
-
- case ClassComponent:
- {
- safelyDetachRef(current$$1);
- var instance = current$$1.stateNode;
-
- if (typeof instance.componentWillUnmount === 'function') {
- safelyCallComponentWillUnmount(current$$1, instance);
- }
-
- return;
- }
-
- case HostComponent:
- {
- if (enableFlareAPI) {
- var dependencies = current$$1.dependencies;
-
- if (dependencies !== null) {
- var respondersMap = dependencies.responders;
-
- if (respondersMap !== null) {
- var responderInstances = Array.from(respondersMap.values());
-
- for (var i = 0, length = responderInstances.length; i < length; i++) {
- var responderInstance = responderInstances[i];
- unmountResponderInstance(responderInstance);
- }
-
- dependencies.responders = null;
- }
- }
- }
-
- safelyDetachRef(current$$1);
- return;
- }
-
- case HostPortal:
- {
- // TODO: this is recursive.
- // We are also not using this parent because
- // the portal will get pushed immediately.
- if (supportsMutation) {
- unmountHostComponents(finishedRoot, current$$1, renderPriorityLevel);
- } else if (supportsPersistence) {
- emptyPortalContainer(current$$1);
- }
-
- return;
- }
-
- case FundamentalComponent:
- {
- if (enableFundamentalAPI) {
- var fundamentalInstance = current$$1.stateNode;
-
- if (fundamentalInstance !== null) {
- unmountFundamentalComponent(fundamentalInstance);
- current$$1.stateNode = null;
- }
- }
-
- return;
- }
-
- case DehydratedFragment:
- {
- if (enableSuspenseCallback) {
- var hydrationCallbacks = finishedRoot.hydrationCallbacks;
-
- if (hydrationCallbacks !== null) {
- var onDeleted = hydrationCallbacks.onDeleted;
-
- if (onDeleted) {
- onDeleted(current$$1.stateNode);
- }
- }
- }
-
- return;
- }
-
- case ScopeComponent:
- {
- if (enableScopeAPI) {
- safelyDetachRef(current$$1);
- }
- }
- }
- }
-
- function commitNestedUnmounts(finishedRoot, root, renderPriorityLevel) {
- // While we're inside a removed host node we don't want to call
- // removeChild on the inner nodes because they're removed by the top
- // call anyway. We also want to call componentWillUnmount on all
- // composites before this host node is removed from the tree. Therefore
- // we do an inner loop while we're still inside the host node.
- var node = root;
-
- while (true) {
- commitUnmount(finishedRoot, node, renderPriorityLevel); // Visit children because they may contain more composite or host nodes.
- // Skip portals because commitUnmount() currently visits them recursively.
-
- if (node.child !== null && ( // If we use mutation we drill down into portals using commitUnmount above.
- // If we don't use mutation we drill down into portals here instead.
- !supportsMutation || node.tag !== HostPortal)) {
- node.child.return = node;
- node = node.child;
- continue;
- }
-
- if (node === root) {
- return;
- }
-
- while (node.sibling === null) {
- if (node.return === null || node.return === root) {
- return;
- }
-
- node = node.return;
- }
-
- node.sibling.return = node.return;
- node = node.sibling;
- }
- }
-
- function detachFiber(current$$1) {
- var alternate = current$$1.alternate; // Cut off the return pointers to disconnect it from the tree. Ideally, we
- // should clear the child pointer of the parent alternate to let this
- // get GC:ed but we don't know which for sure which parent is the current
- // one so we'll settle for GC:ing the subtree of this child. This child
- // itself will be GC:ed when the parent updates the next time.
-
- current$$1.return = null;
- current$$1.child = null;
- current$$1.memoizedState = null;
- current$$1.updateQueue = null;
- current$$1.dependencies = null;
- current$$1.alternate = null;
- current$$1.firstEffect = null;
- current$$1.lastEffect = null;
- current$$1.pendingProps = null;
- current$$1.memoizedProps = null;
-
- if (alternate !== null) {
- detachFiber(alternate);
- }
- }
-
- function emptyPortalContainer(current$$1) {
- if (!supportsPersistence) {
- return;
- }
-
- var portal = current$$1.stateNode;
- var containerInfo = portal.containerInfo;
- var emptyChildSet = createContainerChildSet(containerInfo);
- replaceContainerChildren(containerInfo, emptyChildSet);
- }
-
- function commitContainer(finishedWork) {
- if (!supportsPersistence) {
- return;
- }
-
- switch (finishedWork.tag) {
- case ClassComponent:
- case HostComponent:
- case HostText:
- case FundamentalComponent:
- {
- return;
- }
-
- case HostRoot:
- case HostPortal:
- {
- var portalOrRoot = finishedWork.stateNode;
- var containerInfo = portalOrRoot.containerInfo,
- pendingChildren = portalOrRoot.pendingChildren;
- replaceContainerChildren(containerInfo, pendingChildren);
- return;
- }
-
- default:
- {
- {
- {
- throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
- }
- }
- }
-
- function getHostParentFiber(fiber) {
- var parent = fiber.return;
-
- while (parent !== null) {
- if (isHostParent(parent)) {
- return parent;
- }
-
- parent = parent.return;
- }
-
- {
- {
- throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
- }
-
- function isHostParent(fiber) {
- return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
- }
-
- function getHostSibling(fiber) {
- // We're going to search forward into the tree until we find a sibling host
- // node. Unfortunately, if multiple insertions are done in a row we have to
- // search past them. This leads to exponential search for the next sibling.
- // TODO: Find a more efficient way to do this.
- var node = fiber;
-
- siblings: while (true) {
- // If we didn't find anything, let's try the next sibling.
- while (node.sibling === null) {
- if (node.return === null || isHostParent(node.return)) {
- // If we pop out of the root or hit the parent the fiber we are the
- // last sibling.
- return null;
- }
-
- node = node.return;
- }
-
- node.sibling.return = node.return;
- node = node.sibling;
-
- while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {
- // If it is not host node and, we might have a host node inside it.
- // Try to search down until we find one.
- if (node.effectTag & Placement) {
- // If we don't have a child, try the siblings instead.
- continue siblings;
- } // If we don't have a child, try the siblings instead.
- // We also skip portals because they are not part of this host tree.
-
-
- if (node.child === null || node.tag === HostPortal) {
- continue siblings;
- } else {
- node.child.return = node;
- node = node.child;
- }
- } // Check if this host node is stable or about to be placed.
-
-
- if (!(node.effectTag & Placement)) {
- // Found it!
- return node.stateNode;
- }
- }
- }
-
- function commitPlacement(finishedWork) {
- if (!supportsMutation) {
- return;
- } // Recursively insert all host nodes into the parent.
-
-
- var parentFiber = getHostParentFiber(finishedWork); // Note: these two variables *must* always be updated together.
-
- var parent;
- var isContainer;
- var parentStateNode = parentFiber.stateNode;
-
- switch (parentFiber.tag) {
- case HostComponent:
- parent = parentStateNode;
- isContainer = false;
- break;
-
- case HostRoot:
- parent = parentStateNode.containerInfo;
- isContainer = true;
- break;
-
- case HostPortal:
- parent = parentStateNode.containerInfo;
- isContainer = true;
- break;
-
- case FundamentalComponent:
- if (enableFundamentalAPI) {
- parent = parentStateNode.instance;
- isContainer = false;
- }
-
- // eslint-disable-next-line-no-fallthrough
-
- default:
- {
- {
- throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
-
- }
-
- if (parentFiber.effectTag & ContentReset) {
- // Reset the text content of the parent before doing any insertions
- resetTextContent(parent); // Clear ContentReset from the effect tag
-
- parentFiber.effectTag &= ~ContentReset;
- }
-
- var before = getHostSibling(finishedWork); // We only have the top Fiber that was inserted but we need to recurse down its
- // children to find all the terminal nodes.
-
- var node = finishedWork;
-
- while (true) {
- var isHost = node.tag === HostComponent || node.tag === HostText;
-
- if (isHost || enableFundamentalAPI && node.tag === FundamentalComponent) {
- var stateNode = isHost ? node.stateNode : node.stateNode.instance;
-
- if (before) {
- if (isContainer) {
- insertInContainerBefore(parent, stateNode, before);
- } else {
- insertBefore(parent, stateNode, before);
- }
- } else {
- if (isContainer) {
- appendChildToContainer(parent, stateNode);
- } else {
- appendChild(parent, stateNode);
- }
- }
- } else if (node.tag === HostPortal) {// If the insertion itself is a portal, then we don't want to traverse
- // down its children. Instead, we'll get insertions from each child in
- // the portal directly.
- } else if (node.child !== null) {
- node.child.return = node;
- node = node.child;
- continue;
- }
-
- if (node === finishedWork) {
- return;
- }
-
- while (node.sibling === null) {
- if (node.return === null || node.return === finishedWork) {
- return;
- }
-
- node = node.return;
- }
-
- node.sibling.return = node.return;
- node = node.sibling;
- }
- }
-
- function unmountHostComponents(finishedRoot, current$$1, renderPriorityLevel) {
- // We only have the top Fiber that was deleted but we need to recurse down its
- // children to find all the terminal nodes.
- var node = current$$1; // Each iteration, currentParent is populated with node's host parent if not
- // currentParentIsValid.
-
- var currentParentIsValid = false; // Note: these two variables *must* always be updated together.
-
- var currentParent;
- var currentParentIsContainer;
-
- while (true) {
- if (!currentParentIsValid) {
- var parent = node.return;
-
- findParent: while (true) {
- if (!(parent !== null)) {
- {
- throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
-
- var parentStateNode = parent.stateNode;
-
- switch (parent.tag) {
- case HostComponent:
- currentParent = parentStateNode;
- currentParentIsContainer = false;
- break findParent;
-
- case HostRoot:
- currentParent = parentStateNode.containerInfo;
- currentParentIsContainer = true;
- break findParent;
-
- case HostPortal:
- currentParent = parentStateNode.containerInfo;
- currentParentIsContainer = true;
- break findParent;
-
- case FundamentalComponent:
- if (enableFundamentalAPI) {
- currentParent = parentStateNode.instance;
- currentParentIsContainer = false;
- }
-
- }
-
- parent = parent.return;
- }
-
- currentParentIsValid = true;
- }
-
- if (node.tag === HostComponent || node.tag === HostText) {
- commitNestedUnmounts(finishedRoot, node, renderPriorityLevel); // After all the children have unmounted, it is now safe to remove the
- // node from the tree.
-
- if (currentParentIsContainer) {
- removeChildFromContainer(currentParent, node.stateNode);
- } else {
- removeChild(currentParent, node.stateNode);
- } // Don't visit children because we already visited them.
-
- } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
- var fundamentalNode = node.stateNode.instance;
- commitNestedUnmounts(finishedRoot, node, renderPriorityLevel); // After all the children have unmounted, it is now safe to remove the
- // node from the tree.
-
- if (currentParentIsContainer) {
- removeChildFromContainer(currentParent, fundamentalNode);
- } else {
- removeChild(currentParent, fundamentalNode);
- }
- } else if (enableSuspenseServerRenderer && node.tag === DehydratedFragment) {
- if (enableSuspenseCallback) {
- var hydrationCallbacks = finishedRoot.hydrationCallbacks;
-
- if (hydrationCallbacks !== null) {
- var onDeleted = hydrationCallbacks.onDeleted;
-
- if (onDeleted) {
- onDeleted(node.stateNode);
- }
- }
- } // Delete the dehydrated suspense boundary and all of its content.
-
-
- if (currentParentIsContainer) {
- clearSuspenseBoundaryFromContainer(currentParent, node.stateNode);
- } else {
- clearSuspenseBoundary(currentParent, node.stateNode);
- }
- } else if (node.tag === HostPortal) {
- if (node.child !== null) {
- // When we go into a portal, it becomes the parent to remove from.
- // We will reassign it back when we pop the portal on the way up.
- currentParent = node.stateNode.containerInfo;
- currentParentIsContainer = true; // Visit children because portals might contain host components.
-
- node.child.return = node;
- node = node.child;
- continue;
- }
- } else {
- commitUnmount(finishedRoot, node, renderPriorityLevel); // Visit children because we may find more host components below.
-
- if (node.child !== null) {
- node.child.return = node;
- node = node.child;
- continue;
- }
- }
-
- if (node === current$$1) {
- return;
- }
-
- while (node.sibling === null) {
- if (node.return === null || node.return === current$$1) {
- return;
- }
-
- node = node.return;
-
- if (node.tag === HostPortal) {
- // When we go out of the portal, we need to restore the parent.
- // Since we don't keep a stack of them, we will search for it.
- currentParentIsValid = false;
- }
- }
-
- node.sibling.return = node.return;
- node = node.sibling;
- }
- }
-
- function commitDeletion(finishedRoot, current$$1, renderPriorityLevel) {
- if (supportsMutation) {
- // Recursively delete all host nodes from the parent.
- // Detach refs and call componentWillUnmount() on the whole subtree.
- unmountHostComponents(finishedRoot, current$$1, renderPriorityLevel);
- } else {
- // Detach refs and call componentWillUnmount() on the whole subtree.
- commitNestedUnmounts(finishedRoot, current$$1, renderPriorityLevel);
- }
-
- detachFiber(current$$1);
- }
-
- function commitWork(current$$1, finishedWork) {
- if (!supportsMutation) {
- switch (finishedWork.tag) {
- case FunctionComponent:
- case ForwardRef:
- case MemoComponent:
- case SimpleMemoComponent:
- {
- // Note: We currently never use MountMutation, but useLayout uses
- // UnmountMutation.
- commitHookEffectList(UnmountMutation, MountMutation, finishedWork);
- return;
- }
-
- case Profiler:
- {
- return;
- }
-
- case SuspenseComponent:
- {
- commitSuspenseComponent(finishedWork);
- attachSuspenseRetryListeners(finishedWork);
- return;
- }
-
- case SuspenseListComponent:
- {
- attachSuspenseRetryListeners(finishedWork);
- return;
- }
-
- case HostRoot:
- {
- if (supportsHydration) {
- var root = finishedWork.stateNode;
-
- if (root.hydrate) {
- // We've just hydrated. No need to hydrate again.
- root.hydrate = false;
- commitHydratedContainer(root.containerInfo);
- }
- }
-
- break;
- }
- }
-
- commitContainer(finishedWork);
- return;
- }
-
- switch (finishedWork.tag) {
- case FunctionComponent:
- case ForwardRef:
- case MemoComponent:
- case SimpleMemoComponent:
- {
- // Note: We currently never use MountMutation, but useLayout uses
- // UnmountMutation.
- commitHookEffectList(UnmountMutation, MountMutation, finishedWork);
- return;
- }
-
- case ClassComponent:
- {
- return;
- }
-
- case HostComponent:
- {
- var instance = finishedWork.stateNode;
-
- if (instance != null) {
- // Commit the work prepared earlier.
- var newProps = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps
- // as the newProps. The updatePayload will contain the real change in
- // this case.
-
- var oldProps = current$$1 !== null ? current$$1.memoizedProps : newProps;
- var type = finishedWork.type; // TODO: Type the updateQueue to be specific to host components.
-
- var updatePayload = finishedWork.updateQueue;
- finishedWork.updateQueue = null;
-
- if (updatePayload !== null) {
- commitUpdate(instance, updatePayload, type, oldProps, newProps, finishedWork);
- }
-
- if (enableFlareAPI) {
- var prevListeners = oldProps.listeners;
- var nextListeners = newProps.listeners;
-
- if (prevListeners !== nextListeners) {
- updateEventListeners(nextListeners, finishedWork, null);
- }
- }
- }
-
- return;
- }
-
- case HostText:
- {
- if (!(finishedWork.stateNode !== null)) {
- {
- throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
-
- var textInstance = finishedWork.stateNode;
- var newText = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps
- // as the newProps. The updatePayload will contain the real change in
- // this case.
-
- var oldText = current$$1 !== null ? current$$1.memoizedProps : newText;
- commitTextUpdate(textInstance, oldText, newText);
- return;
- }
-
- case HostRoot:
- {
- if (supportsHydration) {
- var _root = finishedWork.stateNode;
-
- if (_root.hydrate) {
- // We've just hydrated. No need to hydrate again.
- _root.hydrate = false;
- commitHydratedContainer(_root.containerInfo);
- }
- }
-
- return;
- }
-
- case Profiler:
- {
- return;
- }
-
- case SuspenseComponent:
- {
- commitSuspenseComponent(finishedWork);
- attachSuspenseRetryListeners(finishedWork);
- return;
- }
-
- case SuspenseListComponent:
- {
- attachSuspenseRetryListeners(finishedWork);
- return;
- }
-
- case IncompleteClassComponent:
- {
- return;
- }
-
- case FundamentalComponent:
- {
- if (enableFundamentalAPI) {
- var fundamentalInstance = finishedWork.stateNode;
- updateFundamentalComponent(fundamentalInstance);
- }
-
- return;
- }
-
- case ScopeComponent:
- {
- if (enableScopeAPI) {
- var scopeInstance = finishedWork.stateNode;
- scopeInstance.fiber = finishedWork;
-
- if (enableFlareAPI) {
- var _newProps = finishedWork.memoizedProps;
-
- var _oldProps = current$$1 !== null ? current$$1.memoizedProps : _newProps;
-
- var _prevListeners = _oldProps.listeners;
- var _nextListeners = _newProps.listeners;
-
- if (_prevListeners !== _nextListeners) {
- updateEventListeners(_nextListeners, finishedWork, null);
- }
- }
- }
-
- return;
- }
-
- default:
- {
- {
- {
- throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
- }
- }
- }
-
- function commitSuspenseComponent(finishedWork) {
- var newState = finishedWork.memoizedState;
- var newDidTimeout;
- var primaryChildParent = finishedWork;
-
- if (newState === null) {
- newDidTimeout = false;
- } else {
- newDidTimeout = true;
- primaryChildParent = finishedWork.child;
- markCommitTimeOfFallback();
- }
-
- if (supportsMutation && primaryChildParent !== null) {
- hideOrUnhideAllChildren(primaryChildParent, newDidTimeout);
- }
-
- if (enableSuspenseCallback && newState !== null) {
- var suspenseCallback = finishedWork.memoizedProps.suspenseCallback;
-
- if (typeof suspenseCallback === 'function') {
- var thenables = finishedWork.updateQueue;
-
- if (thenables !== null) {
- suspenseCallback(new Set(thenables));
- }
- } else {
- if (suspenseCallback !== undefined) {
- warning$1(false, 'Unexpected type for suspenseCallback.');
- }
- }
- }
- }
-
- function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {
- if (!supportsHydration) {
- return;
- }
-
- var newState = finishedWork.memoizedState;
-
- if (newState === null) {
- var current$$1 = finishedWork.alternate;
-
- if (current$$1 !== null) {
- var prevState = current$$1.memoizedState;
-
- if (prevState !== null) {
- var suspenseInstance = prevState.dehydrated;
-
- if (suspenseInstance !== null) {
- commitHydratedSuspenseInstance(suspenseInstance);
-
- if (enableSuspenseCallback) {
- var hydrationCallbacks = finishedRoot.hydrationCallbacks;
-
- if (hydrationCallbacks !== null) {
- var onHydrated = hydrationCallbacks.onHydrated;
-
- if (onHydrated) {
- onHydrated(suspenseInstance);
- }
- }
- }
- }
- }
- }
- }
- }
-
- function attachSuspenseRetryListeners(finishedWork) {
- // If this boundary just timed out, then it will have a set of thenables.
- // For each thenable, attach a listener so that when it resolves, React
- // attempts to re-render the boundary in the primary (pre-timeout) state.
- var thenables = finishedWork.updateQueue;
-
- if (thenables !== null) {
- finishedWork.updateQueue = null;
- var retryCache = finishedWork.stateNode;
-
- if (retryCache === null) {
- retryCache = finishedWork.stateNode = new PossiblyWeakSet();
- }
-
- thenables.forEach(function (thenable) {
- // Memoize using the boundary fiber to prevent redundant listeners.
- var retry = resolveRetryThenable.bind(null, finishedWork, thenable);
-
- if (!retryCache.has(thenable)) {
- if (enableSchedulerTracing) {
- if (thenable.__reactDoNotTraceInteractions !== true) {
- retry = tracing.unstable_wrap(retry);
- }
- }
-
- retryCache.add(thenable);
- thenable.then(retry, retry);
- }
- });
- }
- }
-
- function commitResetTextContent(current$$1) {
- if (!supportsMutation) {
- return;
- }
-
- resetTextContent(current$$1.stateNode);
- }
-
- var PossiblyWeakMap$1 = typeof WeakMap === 'function' ? WeakMap : Map;
-
- function createRootErrorUpdate(fiber, errorInfo, expirationTime) {
- var update = createUpdate(expirationTime, null); // Unmount the root by rendering null.
-
- update.tag = CaptureUpdate; // Caution: React DevTools currently depends on this property
- // being called "element".
-
- update.payload = {
- element: null
- };
- var error = errorInfo.value;
-
- update.callback = function () {
- onUncaughtError(error);
- logError(fiber, errorInfo);
- };
-
- return update;
- }
-
- function createClassErrorUpdate(fiber, errorInfo, expirationTime) {
- var update = createUpdate(expirationTime, null);
- update.tag = CaptureUpdate;
- var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
-
- if (typeof getDerivedStateFromError === 'function') {
- var error = errorInfo.value;
-
- update.payload = function () {
- logError(fiber, errorInfo);
- return getDerivedStateFromError(error);
- };
- }
-
- var inst = fiber.stateNode;
-
- if (inst !== null && typeof inst.componentDidCatch === 'function') {
- update.callback = function callback() {
- {
- markFailedErrorBoundaryForHotReloading(fiber);
- }
-
- if (typeof getDerivedStateFromError !== 'function') {
- // To preserve the preexisting retry behavior of error boundaries,
- // we keep track of which ones already failed during this batch.
- // This gets reset before we yield back to the browser.
- // TODO: Warn in strict mode if getDerivedStateFromError is
- // not defined.
- markLegacyErrorBoundaryAsFailed(this); // Only log here if componentDidCatch is the only error boundary method defined
-
- logError(fiber, errorInfo);
- }
-
- var error = errorInfo.value;
- var stack = errorInfo.stack;
- this.componentDidCatch(error, {
- componentStack: stack !== null ? stack : ''
- });
-
- {
- if (typeof getDerivedStateFromError !== 'function') {
- // If componentDidCatch is the only error boundary method defined,
- // then it needs to call setState to recover from errors.
- // If no state update is scheduled then the boundary will swallow the error.
- !(fiber.expirationTime === Sync) ? warningWithoutStack$1(false, '%s: Error boundaries should implement getDerivedStateFromError(). ' + 'In that method, return a state update to display an error message or fallback UI.', getComponentName(fiber.type) || 'Unknown') : void 0;
- }
- }
- };
- } else {
- update.callback = function () {
- markFailedErrorBoundaryForHotReloading(fiber);
- };
- }
-
- return update;
- }
-
- function attachPingListener(root, renderExpirationTime, thenable) {
- // Attach a listener to the promise to "ping" the root and retry. But
- // only if one does not already exist for the current render expiration
- // time (which acts like a "thread ID" here).
- var pingCache = root.pingCache;
- var threadIDs;
-
- if (pingCache === null) {
- pingCache = root.pingCache = new PossiblyWeakMap$1();
- threadIDs = new Set();
- pingCache.set(thenable, threadIDs);
- } else {
- threadIDs = pingCache.get(thenable);
-
- if (threadIDs === undefined) {
- threadIDs = new Set();
- pingCache.set(thenable, threadIDs);
- }
- }
-
- if (!threadIDs.has(renderExpirationTime)) {
- // Memoize using the thread ID to prevent redundant listeners.
- threadIDs.add(renderExpirationTime);
- var ping = pingSuspendedRoot.bind(null, root, thenable, renderExpirationTime);
- thenable.then(ping, ping);
- }
- }
-
- function throwException(root, returnFiber, sourceFiber, value, renderExpirationTime) {
- // The source fiber did not complete.
- sourceFiber.effectTag |= Incomplete; // Its effect list is no longer valid.
-
- sourceFiber.firstEffect = sourceFiber.lastEffect = null;
-
- if (value !== null && typeof value === 'object' && typeof value.then === 'function') {
- // This is a thenable.
- var thenable = value;
- checkForWrongSuspensePriorityInDEV(sourceFiber);
- var hasInvisibleParentBoundary = hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext); // Schedule the nearest Suspense to re-render the timed out view.
-
- var _workInProgress = returnFiber;
-
- do {
- if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress, hasInvisibleParentBoundary)) {
- // Found the nearest boundary.
- // Stash the promise on the boundary fiber. If the boundary times out, we'll
- // attach another listener to flip the boundary back to its normal state.
- var thenables = _workInProgress.updateQueue;
-
- if (thenables === null) {
- var updateQueue = new Set();
- updateQueue.add(thenable);
- _workInProgress.updateQueue = updateQueue;
- } else {
- thenables.add(thenable);
- } // If the boundary is outside of blocking mode, we should *not*
- // suspend the commit. Pretend as if the suspended component rendered
- // null and keep rendering. In the commit phase, we'll schedule a
- // subsequent synchronous update to re-render the Suspense.
- //
- // Note: It doesn't matter whether the component that suspended was
- // inside a blocking mode tree. If the Suspense is outside of it, we
- // should *not* suspend the commit.
-
-
- if ((_workInProgress.mode & BlockingMode) === NoMode) {
- _workInProgress.effectTag |= DidCapture; // We're going to commit this fiber even though it didn't complete.
- // But we shouldn't call any lifecycle methods or callbacks. Remove
- // all lifecycle effect tags.
-
- sourceFiber.effectTag &= ~(LifecycleEffectMask | Incomplete);
-
- if (sourceFiber.tag === ClassComponent) {
- var currentSourceFiber = sourceFiber.alternate;
-
- if (currentSourceFiber === null) {
- // This is a new mount. Change the tag so it's not mistaken for a
- // completed class component. For example, we should not call
- // componentWillUnmount if it is deleted.
- sourceFiber.tag = IncompleteClassComponent;
- } else {
- // When we try rendering again, we should not reuse the current fiber,
- // since it's known to be in an inconsistent state. Use a force update to
- // prevent a bail out.
- var update = createUpdate(Sync, null);
- update.tag = ForceUpdate;
- enqueueUpdate(sourceFiber, update);
- }
- } // The source fiber did not complete. Mark it with Sync priority to
- // indicate that it still has pending work.
-
-
- sourceFiber.expirationTime = Sync; // Exit without suspending.
-
- return;
- } // Confirmed that the boundary is in a concurrent mode tree. Continue
- // with the normal suspend path.
- //
- // After this we'll use a set of heuristics to determine whether this
- // render pass will run to completion or restart or "suspend" the commit.
- // The actual logic for this is spread out in different places.
- //
- // This first principle is that if we're going to suspend when we complete
- // a root, then we should also restart if we get an update or ping that
- // might unsuspend it, and vice versa. The only reason to suspend is
- // because you think you might want to restart before committing. However,
- // it doesn't make sense to restart only while in the period we're suspended.
- //
- // Restarting too aggressively is also not good because it starves out any
- // intermediate loading state. So we use heuristics to determine when.
- // Suspense Heuristics
- //
- // If nothing threw a Promise or all the same fallbacks are already showing,
- // then don't suspend/restart.
- //
- // If this is an initial render of a new tree of Suspense boundaries and
- // those trigger a fallback, then don't suspend/restart. We want to ensure
- // that we can show the initial loading state as quickly as possible.
- //
- // If we hit a "Delayed" case, such as when we'd switch from content back into
- // a fallback, then we should always suspend/restart. SuspenseConfig applies to
- // this case. If none is defined, JND is used instead.
- //
- // If we're already showing a fallback and it gets "retried", allowing us to show
- // another level, but there's still an inner boundary that would show a fallback,
- // then we suspend/restart for 500ms since the last time we showed a fallback
- // anywhere in the tree. This effectively throttles progressive loading into a
- // consistent train of commits. This also gives us an opportunity to restart to
- // get to the completed state slightly earlier.
- //
- // If there's ambiguity due to batching it's resolved in preference of:
- // 1) "delayed", 2) "initial render", 3) "retry".
- //
- // We want to ensure that a "busy" state doesn't get force committed. We want to
- // ensure that new initial loading states can commit as soon as possible.
-
-
- attachPingListener(root, renderExpirationTime, thenable);
- _workInProgress.effectTag |= ShouldCapture;
- _workInProgress.expirationTime = renderExpirationTime;
- return;
- } // This boundary already captured during this render. Continue to the next
- // boundary.
-
-
- _workInProgress = _workInProgress.return;
- } while (_workInProgress !== null); // No boundary was found. Fallthrough to error mode.
- // TODO: Use invariant so the message is stripped in prod?
-
-
- value = new Error((getComponentName(sourceFiber.type) || 'A React component') + ' suspended while rendering, but no fallback UI was specified.\n' + '\n' + 'Add a <Suspense fallback=...> component higher in the tree to ' + 'provide a loading indicator or placeholder to display.' + getStackByFiberInDevAndProd(sourceFiber));
- } // We didn't find a boundary that could handle this type of exception. Start
- // over and traverse parent path again, this time treating the exception
- // as an error.
-
-
- renderDidError();
- value = createCapturedValue(value, sourceFiber);
- var workInProgress = returnFiber;
-
- do {
- switch (workInProgress.tag) {
- case HostRoot:
- {
- var _errorInfo = value;
- workInProgress.effectTag |= ShouldCapture;
- workInProgress.expirationTime = renderExpirationTime;
-
- var _update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime);
-
- enqueueCapturedUpdate(workInProgress, _update);
- return;
- }
-
- case ClassComponent:
- // Capture and retry
- var errorInfo = value;
- var ctor = workInProgress.type;
- var instance = workInProgress.stateNode;
-
- if ((workInProgress.effectTag & DidCapture) === NoEffect && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) {
- workInProgress.effectTag |= ShouldCapture;
- workInProgress.expirationTime = renderExpirationTime; // Schedule the error boundary to re-render using updated state
-
- var _update2 = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime);
-
- enqueueCapturedUpdate(workInProgress, _update2);
- return;
- }
-
- break;
-
- default:
- break;
- }
-
- workInProgress = workInProgress.return;
- } while (workInProgress !== null);
- }
-
- var ceil = Math.ceil;
- var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
- var ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner;
- var IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing;
- var NoContext =
- /* */
- 0;
- var BatchedContext =
- /* */
- 1;
- var EventContext =
- /* */
- 2;
- var DiscreteEventContext =
- /* */
- 4;
- var LegacyUnbatchedContext =
- /* */
- 8;
- var RenderContext =
- /* */
- 16;
- var CommitContext =
- /* */
- 32;
- var RootIncomplete = 0;
- var RootFatalErrored = 1;
- var RootErrored = 2;
- var RootSuspended = 3;
- var RootSuspendedWithDelay = 4;
- var RootCompleted = 5;
- // Describes where we are in the React execution stack
- var executionContext = NoContext; // The root we're working on
-
- var workInProgressRoot = null; // The fiber we're working on
-
- var workInProgress = null; // The expiration time we're rendering
-
- var renderExpirationTime = NoWork; // Whether to root completed, errored, suspended, etc.
-
- var workInProgressRootExitStatus = RootIncomplete; // A fatal error, if one is thrown
-
- var workInProgressRootFatalError = null; // Most recent event time among processed updates during this render.
- // This is conceptually a time stamp but expressed in terms of an ExpirationTime
- // because we deal mostly with expiration times in the hot path, so this avoids
- // the conversion happening in the hot path.
-
- var workInProgressRootLatestProcessedExpirationTime = Sync;
- var workInProgressRootLatestSuspenseTimeout = Sync;
- var workInProgressRootCanSuspendUsingConfig = null; // The work left over by components that were visited during this render. Only
- // includes unprocessed updates, not work in bailed out children.
-
- var workInProgressRootNextUnprocessedUpdateTime = NoWork; // If we're pinged while rendering we don't always restart immediately.
- // This flag determines if it might be worthwhile to restart if an opportunity
- // happens latere.
-
- var workInProgressRootHasPendingPing = false; // The most recent time we committed a fallback. This lets us ensure a train
- // model where we don't commit new loading states in too quick succession.
-
- var globalMostRecentFallbackTime = 0;
- var FALLBACK_THROTTLE_MS = 500;
- var nextEffect = null;
- var hasUncaughtError = false;
- var firstUncaughtError = null;
- var legacyErrorBoundariesThatAlreadyFailed = null;
- var rootDoesHavePassiveEffects = false;
- var rootWithPendingPassiveEffects = null;
- var pendingPassiveEffectsRenderPriority = NoPriority;
- var pendingPassiveEffectsExpirationTime = NoWork;
- var rootsWithPendingDiscreteUpdates = null; // Use these to prevent an infinite loop of nested updates
-
- var NESTED_UPDATE_LIMIT = 50;
- var nestedUpdateCount = 0;
- var rootWithNestedUpdates = null;
- var NESTED_PASSIVE_UPDATE_LIMIT = 50;
- var nestedPassiveUpdateCount = 0;
- var interruptedBy = null; // Marks the need to reschedule pending interactions at these expiration times
- // during the commit phase. This enables them to be traced across components
- // that spawn new work during render. E.g. hidden boundaries, suspended SSR
- // hydration or SuspenseList.
-
- var spawnedWorkDuringRender = null; // Expiration times are computed by adding to the current time (the start
- // time). However, if two updates are scheduled within the same event, we
- // should treat their start times as simultaneous, even if the actual clock
- // time has advanced between the first and second call.
- // In other words, because expiration times determine how updates are batched,
- // we want all updates of like priority that occur within the same event to
- // receive the same expiration time. Otherwise we get tearing.
-
- var currentEventTime = NoWork;
- function requestCurrentTimeForUpdate() {
- if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
- // We're inside React, so it's fine to read the actual time.
- return msToExpirationTime(now());
- } // We're not inside React, so we may be in the middle of a browser event.
-
-
- if (currentEventTime !== NoWork) {
- // Use the same start time for all updates until we enter React again.
- return currentEventTime;
- } // This is the first update since React yielded. Compute a new start time.
-
-
- currentEventTime = msToExpirationTime(now());
- return currentEventTime;
- }
- function getCurrentTime() {
- return msToExpirationTime(now());
- }
- function computeExpirationForFiber(currentTime, fiber, suspenseConfig) {
- var mode = fiber.mode;
-
- if ((mode & BlockingMode) === NoMode) {
- return Sync;
- }
-
- var priorityLevel = getCurrentPriorityLevel();
-
- if ((mode & ConcurrentMode) === NoMode) {
- return priorityLevel === ImmediatePriority ? Sync : Batched;
- }
-
- if ((executionContext & RenderContext) !== NoContext) {
- // Use whatever time we're already rendering
- // TODO: Should there be a way to opt out, like with `runWithPriority`?
- return renderExpirationTime;
- }
-
- var expirationTime;
-
- if (suspenseConfig !== null) {
- // Compute an expiration time based on the Suspense timeout.
- expirationTime = computeSuspenseExpiration(currentTime, suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION);
- } else {
- // Compute an expiration time based on the Scheduler priority.
- switch (priorityLevel) {
- case ImmediatePriority:
- expirationTime = Sync;
- break;
-
- case UserBlockingPriority$2:
- // TODO: Rename this to computeUserBlockingExpiration
- expirationTime = computeInteractiveExpiration(currentTime);
- break;
-
- case NormalPriority:
- case LowPriority:
- // TODO: Handle LowPriority
- // TODO: Rename this to... something better.
- expirationTime = computeAsyncExpiration(currentTime);
- break;
-
- case IdlePriority:
- expirationTime = Idle;
- break;
-
- default:
- {
- {
- throw Error("Expected a valid priority level");
- }
- }
-
- }
- } // If we're in the middle of rendering a tree, do not update at the same
- // expiration time that is already rendering.
- // TODO: We shouldn't have to do this if the update is on a different root.
- // Refactor computeExpirationForFiber + scheduleUpdate so we have access to
- // the root when we check for this condition.
-
-
- if (workInProgressRoot !== null && expirationTime === renderExpirationTime) {
- // This is a trick to move this update into a separate batch
- expirationTime -= 1;
- }
-
- return expirationTime;
- }
- function scheduleUpdateOnFiber(fiber, expirationTime) {
- checkForNestedUpdates();
- warnAboutInvalidUpdatesOnClassComponentsInDEV(fiber);
- var root = markUpdateTimeFromFiberToRoot(fiber, expirationTime);
-
- if (root === null) {
- warnAboutUpdateOnUnmountedFiberInDEV(fiber);
- return;
- }
-
- checkForInterruption(fiber, expirationTime);
- recordScheduleUpdate(); // TODO: computeExpirationForFiber also reads the priority. Pass the
- // priority as an argument to that function and this one.
-
- var priorityLevel = getCurrentPriorityLevel();
-
- if (expirationTime === Sync) {
- if ( // Check if we're inside unbatchedUpdates
- (executionContext & LegacyUnbatchedContext) !== NoContext && // Check if we're not already rendering
- (executionContext & (RenderContext | CommitContext)) === NoContext) {
- // Register pending interactions on the root to avoid losing traced interaction data.
- schedulePendingInteractions(root, expirationTime); // This is a legacy edge case. The initial mount of a ReactDOM.render-ed
- // root inside of batchedUpdates should be synchronous, but layout updates
- // should be deferred until the end of the batch.
-
- performSyncWorkOnRoot(root);
- } else {
- ensureRootIsScheduled(root);
- schedulePendingInteractions(root, expirationTime);
-
- if (executionContext === NoContext) {
- // Flush the synchronous work now, unless we're already working or inside
- // a batch. This is intentionally inside scheduleUpdateOnFiber instead of
- // scheduleCallbackForFiber to preserve the ability to schedule a callback
- // without immediately flushing it. We only do this for user-initiated
- // updates, to preserve historical behavior of legacy mode.
- flushSyncCallbackQueue();
- }
- }
- } else {
- ensureRootIsScheduled(root);
- schedulePendingInteractions(root, expirationTime);
- }
-
- if ((executionContext & DiscreteEventContext) !== NoContext && ( // Only updates at user-blocking priority or greater are considered
- // discrete, even inside a discrete event.
- priorityLevel === UserBlockingPriority$2 || priorityLevel === ImmediatePriority)) {
- // This is the result of a discrete event. Track the lowest priority
- // discrete update per root so we can flush them early, if needed.
- if (rootsWithPendingDiscreteUpdates === null) {
- rootsWithPendingDiscreteUpdates = new Map([[root, expirationTime]]);
- } else {
- var lastDiscreteTime = rootsWithPendingDiscreteUpdates.get(root);
-
- if (lastDiscreteTime === undefined || lastDiscreteTime > expirationTime) {
- rootsWithPendingDiscreteUpdates.set(root, expirationTime);
- }
- }
- }
- }
- var scheduleWork = scheduleUpdateOnFiber; // This is split into a separate function so we can mark a fiber with pending
- // work without treating it as a typical update that originates from an event;
- // e.g. retrying a Suspense boundary isn't an update, but it does schedule work
- // on a fiber.
-
- function markUpdateTimeFromFiberToRoot(fiber, expirationTime) {
- // Update the source fiber's expiration time
- if (fiber.expirationTime < expirationTime) {
- fiber.expirationTime = expirationTime;
- }
-
- var alternate = fiber.alternate;
-
- if (alternate !== null && alternate.expirationTime < expirationTime) {
- alternate.expirationTime = expirationTime;
- } // Walk the parent path to the root and update the child expiration time.
-
-
- var node = fiber.return;
- var root = null;
-
- if (node === null && fiber.tag === HostRoot) {
- root = fiber.stateNode;
- } else {
- while (node !== null) {
- alternate = node.alternate;
-
- if (node.childExpirationTime < expirationTime) {
- node.childExpirationTime = expirationTime;
-
- if (alternate !== null && alternate.childExpirationTime < expirationTime) {
- alternate.childExpirationTime = expirationTime;
- }
- } else if (alternate !== null && alternate.childExpirationTime < expirationTime) {
- alternate.childExpirationTime = expirationTime;
- }
-
- if (node.return === null && node.tag === HostRoot) {
- root = node.stateNode;
- break;
- }
-
- node = node.return;
- }
- }
-
- if (root !== null) {
- if (workInProgressRoot === root) {
- // Received an update to a tree that's in the middle of rendering. Mark
- // that's unprocessed work on this root.
- markUnprocessedUpdateTime(expirationTime);
-
- if (workInProgressRootExitStatus === RootSuspendedWithDelay) {
- // The root already suspended with a delay, which means this render
- // definitely won't finish. Since we have a new update, let's mark it as
- // suspended now, right before marking the incoming update. This has the
- // effect of interrupting the current render and switching to the update.
- // TODO: This happens to work when receiving an update during the render
- // phase, because of the trick inside computeExpirationForFiber to
- // subtract 1 from `renderExpirationTime` to move it into a
- // separate bucket. But we should probably model it with an exception,
- // using the same mechanism we use to force hydration of a subtree.
- // TODO: This does not account for low pri updates that were already
- // scheduled before the root started rendering. Need to track the next
- // pending expiration time (perhaps by backtracking the return path) and
- // then trigger a restart in the `renderDidSuspendDelayIfPossible` path.
- markRootSuspendedAtTime(root, renderExpirationTime);
- }
- } // Mark that the root has a pending update.
-
-
- markRootUpdatedAtTime(root, expirationTime);
- }
-
- return root;
- }
-
- function getNextRootExpirationTimeToWorkOn(root) {
- // Determines the next expiration time that the root should render, taking
- // into account levels that may be suspended, or levels that may have
- // received a ping.
- var lastExpiredTime = root.lastExpiredTime;
-
- if (lastExpiredTime !== NoWork) {
- return lastExpiredTime;
- } // "Pending" refers to any update that hasn't committed yet, including if it
- // suspended. The "suspended" range is therefore a subset.
-
-
- var firstPendingTime = root.firstPendingTime;
-
- if (!isRootSuspendedAtTime(root, firstPendingTime)) {
- // The highest priority pending time is not suspended. Let's work on that.
- return firstPendingTime;
- } // If the first pending time is suspended, check if there's a lower priority
- // pending level that we know about. Or check if we received a ping. Work
- // on whichever is higher priority.
-
-
- var lastPingedTime = root.lastPingedTime;
- var nextKnownPendingLevel = root.nextKnownPendingLevel;
- return lastPingedTime > nextKnownPendingLevel ? lastPingedTime : nextKnownPendingLevel;
- } // Use this function to schedule a task for a root. There's only one task per
- // root; if a task was already scheduled, we'll check to make sure the
- // expiration time of the existing task is the same as the expiration time of
- // the next level that the root has work on. This function is called on every
- // update, and right before exiting a task.
-
-
- function ensureRootIsScheduled(root) {
- var lastExpiredTime = root.lastExpiredTime;
-
- if (lastExpiredTime !== NoWork) {
- // Special case: Expired work should flush synchronously.
- root.callbackExpirationTime = Sync;
- root.callbackPriority = ImmediatePriority;
- root.callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));
- return;
- }
-
- var expirationTime = getNextRootExpirationTimeToWorkOn(root);
- var existingCallbackNode = root.callbackNode;
-
- if (expirationTime === NoWork) {
- // There's nothing to work on.
- if (existingCallbackNode !== null) {
- root.callbackNode = null;
- root.callbackExpirationTime = NoWork;
- root.callbackPriority = NoPriority;
- }
-
- return;
- } // TODO: If this is an update, we already read the current time. Pass the
- // time as an argument.
-
-
- var currentTime = requestCurrentTimeForUpdate();
- var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime); // If there's an existing render task, confirm it has the correct priority and
- // expiration time. Otherwise, we'll cancel it and schedule a new one.
-
- if (existingCallbackNode !== null) {
- var existingCallbackPriority = root.callbackPriority;
- var existingCallbackExpirationTime = root.callbackExpirationTime;
-
- if ( // Callback must have the exact same expiration time.
- existingCallbackExpirationTime === expirationTime && // Callback must have greater or equal priority.
- existingCallbackPriority >= priorityLevel) {
- // Existing callback is sufficient.
- return;
- } // Need to schedule a new task.
- // TODO: Instead of scheduling a new task, we should be able to change the
- // priority of the existing one.
-
-
- cancelCallback(existingCallbackNode);
- }
-
- root.callbackExpirationTime = expirationTime;
- root.callbackPriority = priorityLevel;
- var callbackNode;
-
- if (expirationTime === Sync) {
- // Sync React callbacks are scheduled on a special internal queue
- callbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));
- } else if (disableSchedulerTimeoutBasedOnReactExpirationTime) {
- callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root));
- } else {
- callbackNode = scheduleCallback(priorityLevel, performConcurrentWorkOnRoot.bind(null, root), // Compute a task timeout based on the expiration time. This also affects
- // ordering because tasks are processed in timeout order.
- {
- timeout: expirationTimeToMs(expirationTime) - now()
- });
- }
-
- root.callbackNode = callbackNode;
- } // This is the entry point for every concurrent task, i.e. anything that
- // goes through Scheduler.
-
-
- function performConcurrentWorkOnRoot(root, didTimeout) {
- // Since we know we're in a React event, we can clear the current
- // event time. The next update will compute a new event time.
- currentEventTime = NoWork;
-
- if (didTimeout) {
- // The render task took too long to complete. Mark the current time as
- // expired to synchronously render all expired work in a single batch.
- var currentTime = requestCurrentTimeForUpdate();
- markRootExpiredAtTime(root, currentTime); // This will schedule a synchronous callback.
-
- ensureRootIsScheduled(root);
- return null;
- } // Determine the next expiration time to work on, using the fields stored
- // on the root.
-
-
- var expirationTime = getNextRootExpirationTimeToWorkOn(root);
-
- if (expirationTime !== NoWork) {
- var originalCallbackNode = root.callbackNode;
-
- if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
- {
- throw Error("Should not already be working.");
- }
- }
-
- flushPassiveEffects(); // If the root or expiration time have changed, throw out the existing stack
- // and prepare a fresh one. Otherwise we'll continue where we left off.
-
- if (root !== workInProgressRoot || expirationTime !== renderExpirationTime) {
- prepareFreshStack(root, expirationTime);
- startWorkOnPendingInteractions(root, expirationTime);
- } // If we have a work-in-progress fiber, it means there's still work to do
- // in this root.
-
-
- if (workInProgress !== null) {
- var prevExecutionContext = executionContext;
- executionContext |= RenderContext;
- var prevDispatcher = pushDispatcher(root);
- var prevInteractions = pushInteractions(root);
- startWorkLoopTimer(workInProgress);
-
- do {
- try {
- workLoopConcurrent();
- break;
- } catch (thrownValue) {
- handleError(root, thrownValue);
- }
- } while (true);
-
- resetContextDependencies();
- executionContext = prevExecutionContext;
- popDispatcher(prevDispatcher);
-
- if (enableSchedulerTracing) {
- popInteractions(prevInteractions);
- }
-
- if (workInProgressRootExitStatus === RootFatalErrored) {
- var fatalError = workInProgressRootFatalError;
- stopInterruptedWorkLoopTimer();
- prepareFreshStack(root, expirationTime);
- markRootSuspendedAtTime(root, expirationTime);
- ensureRootIsScheduled(root);
- throw fatalError;
- }
-
- if (workInProgress !== null) {
- // There's still work left over. Exit without committing.
- stopInterruptedWorkLoopTimer();
- } else {
- // We now have a consistent tree. The next step is either to commit it,
- // or, if something suspended, wait to commit it after a timeout.
- stopFinishedWorkLoopTimer();
- var finishedWork = root.finishedWork = root.current.alternate;
- root.finishedExpirationTime = expirationTime;
- finishConcurrentRender(root, finishedWork, workInProgressRootExitStatus, expirationTime);
- }
-
- ensureRootIsScheduled(root);
-
- if (root.callbackNode === originalCallbackNode) {
- // The task node scheduled for this root is the same one that's
- // currently executed. Need to return a continuation.
- return performConcurrentWorkOnRoot.bind(null, root);
- }
- }
- }
-
- return null;
- }
-
- function finishConcurrentRender(root, finishedWork, exitStatus, expirationTime) {
- // Set this to null to indicate there's no in-progress render.
- workInProgressRoot = null;
-
- switch (exitStatus) {
- case RootIncomplete:
- case RootFatalErrored:
- {
- {
- {
- throw Error("Root did not complete. This is a bug in React.");
- }
- }
- }
- // Flow knows about invariant, so it complains if I add a break
- // statement, but eslint doesn't know about invariant, so it complains
- // if I do. eslint-disable-next-line no-fallthrough
-
- case RootErrored:
- {
- // If this was an async render, the error may have happened due to
- // a mutation in a concurrent event. Try rendering one more time,
- // synchronously, to see if the error goes away. If there are
- // lower priority updates, let's include those, too, in case they
- // fix the inconsistency. Render at Idle to include all updates.
- // If it was Idle or Never or some not-yet-invented time, render
- // at that time.
- markRootExpiredAtTime(root, expirationTime > Idle ? Idle : expirationTime); // We assume that this second render pass will be synchronous
- // and therefore not hit this path again.
-
- break;
- }
-
- case RootSuspended:
- {
- markRootSuspendedAtTime(root, expirationTime);
- var lastSuspendedTime = root.lastSuspendedTime;
-
- if (expirationTime === lastSuspendedTime) {
- root.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork);
- }
-
- flushSuspensePriorityWarningInDEV(); // We have an acceptable loading state. We need to figure out if we
- // should immediately commit it or wait a bit.
- // If we have processed new updates during this render, we may now
- // have a new loading state ready. We want to ensure that we commit
- // that as soon as possible.
-
- var hasNotProcessedNewUpdates = workInProgressRootLatestProcessedExpirationTime === Sync;
-
- if (hasNotProcessedNewUpdates && // do not delay if we're inside an act() scope
- !( true && flushSuspenseFallbacksInTests && IsThisRendererActing.current)) {
- // If we have not processed any new updates during this pass, then
- // this is either a retry of an existing fallback state or a
- // hidden tree. Hidden trees shouldn't be batched with other work
- // and after that's fixed it can only be a retry. We're going to
- // throttle committing retries so that we don't show too many
- // loading states too quickly.
- var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now(); // Don't bother with a very short suspense time.
-
- if (msUntilTimeout > 10) {
- if (workInProgressRootHasPendingPing) {
- var lastPingedTime = root.lastPingedTime;
-
- if (lastPingedTime === NoWork || lastPingedTime >= expirationTime) {
- // This render was pinged but we didn't get to restart
- // earlier so try restarting now instead.
- root.lastPingedTime = expirationTime;
- prepareFreshStack(root, expirationTime);
- break;
- }
- }
-
- var nextTime = getNextRootExpirationTimeToWorkOn(root);
-
- if (nextTime !== NoWork && nextTime !== expirationTime) {
- // There's additional work on this root.
- break;
- }
-
- if (lastSuspendedTime !== NoWork && lastSuspendedTime !== expirationTime) {
- // We should prefer to render the fallback of at the last
- // suspended level. Ping the last suspended level to try
- // rendering it again.
- root.lastPingedTime = lastSuspendedTime;
- break;
- } // The render is suspended, it hasn't timed out, and there's no
- // lower priority work to do. Instead of committing the fallback
- // immediately, wait for more data to arrive.
-
-
- root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), msUntilTimeout);
- break;
- }
- } // The work expired. Commit immediately.
-
-
- commitRoot(root);
- break;
- }
-
- case RootSuspendedWithDelay:
- {
- markRootSuspendedAtTime(root, expirationTime);
- var _lastSuspendedTime = root.lastSuspendedTime;
-
- if (expirationTime === _lastSuspendedTime) {
- root.nextKnownPendingLevel = getRemainingExpirationTime(finishedWork);
- }
-
- flushSuspensePriorityWarningInDEV();
-
- if ( // do not delay if we're inside an act() scope
- !( true && flushSuspenseFallbacksInTests && IsThisRendererActing.current)) {
- // We're suspended in a state that should be avoided. We'll try to
- // avoid committing it for as long as the timeouts let us.
- if (workInProgressRootHasPendingPing) {
- var _lastPingedTime = root.lastPingedTime;
-
- if (_lastPingedTime === NoWork || _lastPingedTime >= expirationTime) {
- // This render was pinged but we didn't get to restart earlier
- // so try restarting now instead.
- root.lastPingedTime = expirationTime;
- prepareFreshStack(root, expirationTime);
- break;
- }
- }
-
- var _nextTime = getNextRootExpirationTimeToWorkOn(root);
-
- if (_nextTime !== NoWork && _nextTime !== expirationTime) {
- // There's additional work on this root.
- break;
- }
-
- if (_lastSuspendedTime !== NoWork && _lastSuspendedTime !== expirationTime) {
- // We should prefer to render the fallback of at the last
- // suspended level. Ping the last suspended level to try
- // rendering it again.
- root.lastPingedTime = _lastSuspendedTime;
- break;
- }
-
- var _msUntilTimeout;
-
- if (workInProgressRootLatestSuspenseTimeout !== Sync) {
- // We have processed a suspense config whose expiration time we
- // can use as the timeout.
- _msUntilTimeout = expirationTimeToMs(workInProgressRootLatestSuspenseTimeout) - now();
- } else if (workInProgressRootLatestProcessedExpirationTime === Sync) {
- // This should never normally happen because only new updates
- // cause delayed states, so we should have processed something.
- // However, this could also happen in an offscreen tree.
- _msUntilTimeout = 0;
- } else {
- // If we don't have a suspense config, we're going to use a
- // heuristic to determine how long we can suspend.
- var eventTimeMs = inferTimeFromExpirationTime(workInProgressRootLatestProcessedExpirationTime);
- var currentTimeMs = now();
- var timeUntilExpirationMs = expirationTimeToMs(expirationTime) - currentTimeMs;
- var timeElapsed = currentTimeMs - eventTimeMs;
-
- if (timeElapsed < 0) {
- // We get this wrong some time since we estimate the time.
- timeElapsed = 0;
- }
-
- _msUntilTimeout = jnd(timeElapsed) - timeElapsed; // Clamp the timeout to the expiration time. TODO: Once the
- // event time is exact instead of inferred from expiration time
- // we don't need this.
-
- if (timeUntilExpirationMs < _msUntilTimeout) {
- _msUntilTimeout = timeUntilExpirationMs;
- }
- } // Don't bother with a very short suspense time.
-
-
- if (_msUntilTimeout > 10) {
- // The render is suspended, it hasn't timed out, and there's no
- // lower priority work to do. Instead of committing the fallback
- // immediately, wait for more data to arrive.
- root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout);
- break;
- }
- } // The work expired. Commit immediately.
-
-
- commitRoot(root);
- break;
- }
-
- case RootCompleted:
- {
- // The work completed. Ready to commit.
- if ( // do not delay if we're inside an act() scope
- !( true && flushSuspenseFallbacksInTests && IsThisRendererActing.current) && workInProgressRootLatestProcessedExpirationTime !== Sync && workInProgressRootCanSuspendUsingConfig !== null) {
- // If we have exceeded the minimum loading delay, which probably
- // means we have shown a spinner already, we might have to suspend
- // a bit longer to ensure that the spinner is shown for
- // enough time.
- var _msUntilTimeout2 = computeMsUntilSuspenseLoadingDelay(workInProgressRootLatestProcessedExpirationTime, expirationTime, workInProgressRootCanSuspendUsingConfig);
-
- if (_msUntilTimeout2 > 10) {
- markRootSuspendedAtTime(root, expirationTime);
- root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout2);
- break;
- }
- }
-
- commitRoot(root);
- break;
- }
-
- default:
- {
- {
- {
- throw Error("Unknown root exit status.");
- }
- }
- }
- }
- } // This is the entry point for synchronous tasks that don't go
- // through Scheduler
-
-
- function performSyncWorkOnRoot(root) {
- // Check if there's expired work on this root. Otherwise, render at Sync.
- var lastExpiredTime = root.lastExpiredTime;
- var expirationTime = lastExpiredTime !== NoWork ? lastExpiredTime : Sync;
-
- if (root.finishedExpirationTime === expirationTime) {
- // There's already a pending commit at this expiration time.
- // TODO: This is poorly factored. This case only exists for the
- // batch.commit() API.
- commitRoot(root);
- } else {
- if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
- {
- throw Error("Should not already be working.");
- }
- }
-
- flushPassiveEffects(); // If the root or expiration time have changed, throw out the existing stack
- // and prepare a fresh one. Otherwise we'll continue where we left off.
-
- if (root !== workInProgressRoot || expirationTime !== renderExpirationTime) {
- prepareFreshStack(root, expirationTime);
- startWorkOnPendingInteractions(root, expirationTime);
- } // If we have a work-in-progress fiber, it means there's still work to do
- // in this root.
-
-
- if (workInProgress !== null) {
- var prevExecutionContext = executionContext;
- executionContext |= RenderContext;
- var prevDispatcher = pushDispatcher(root);
- var prevInteractions = pushInteractions(root);
- startWorkLoopTimer(workInProgress);
-
- do {
- try {
- workLoopSync();
- break;
- } catch (thrownValue) {
- handleError(root, thrownValue);
- }
- } while (true);
-
- resetContextDependencies();
- executionContext = prevExecutionContext;
- popDispatcher(prevDispatcher);
-
- if (enableSchedulerTracing) {
- popInteractions(prevInteractions);
- }
-
- if (workInProgressRootExitStatus === RootFatalErrored) {
- var fatalError = workInProgressRootFatalError;
- stopInterruptedWorkLoopTimer();
- prepareFreshStack(root, expirationTime);
- markRootSuspendedAtTime(root, expirationTime);
- ensureRootIsScheduled(root);
- throw fatalError;
- }
-
- if (workInProgress !== null) {
- // This is a sync render, so we should have finished the whole tree.
- {
- {
- throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.");
- }
- }
- } else {
- // We now have a consistent tree. Because this is a sync render, we
- // will commit it even if something suspended.
- stopFinishedWorkLoopTimer();
- root.finishedWork = root.current.alternate;
- root.finishedExpirationTime = expirationTime;
- finishSyncRender(root, workInProgressRootExitStatus, expirationTime);
- } // Before exiting, make sure there's a callback scheduled for the next
- // pending level.
-
-
- ensureRootIsScheduled(root);
- }
- }
-
- return null;
- }
-
- function finishSyncRender(root, exitStatus, expirationTime) {
- // Set this to null to indicate there's no in-progress render.
- workInProgressRoot = null;
-
- {
- if (exitStatus === RootSuspended || exitStatus === RootSuspendedWithDelay) {
- flushSuspensePriorityWarningInDEV();
- }
- }
-
- commitRoot(root);
- }
-
- function flushRoot(root, expirationTime) {
- markRootExpiredAtTime(root, expirationTime);
- ensureRootIsScheduled(root);
-
- if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
- flushSyncCallbackQueue();
- }
- }
- function flushDiscreteUpdates() {
- // TODO: Should be able to flush inside batchedUpdates, but not inside `act`.
- // However, `act` uses `batchedUpdates`, so there's no way to distinguish
- // those two cases. Need to fix this before exposing flushDiscreteUpdates
- // as a public API.
- if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) {
- if ( true && (executionContext & RenderContext) !== NoContext) {
- warning$1(false, 'unstable_flushDiscreteUpdates: Cannot flush updates when React is ' + 'already rendering.');
- } // We're already rendering, so we can't synchronously flush pending work.
- // This is probably a nested event dispatch triggered by a lifecycle/effect,
- // like `el.focus()`. Exit.
-
-
- return;
- }
-
- flushPendingDiscreteUpdates(); // If the discrete updates scheduled passive effects, flush them now so that
- // they fire before the next serial event.
-
- flushPassiveEffects();
- }
-
- function syncUpdates(fn, a, b, c) {
- return runWithPriority$2(ImmediatePriority, fn.bind(null, a, b, c));
- }
-
- function flushPendingDiscreteUpdates() {
- if (rootsWithPendingDiscreteUpdates !== null) {
- // For each root with pending discrete updates, schedule a callback to
- // immediately flush them.
- var roots = rootsWithPendingDiscreteUpdates;
- rootsWithPendingDiscreteUpdates = null;
- roots.forEach(function (expirationTime, root) {
- markRootExpiredAtTime(root, expirationTime);
- ensureRootIsScheduled(root);
- }); // Now flush the immediate queue.
-
- flushSyncCallbackQueue();
- }
- }
-
- function batchedUpdates$1(fn, a) {
- var prevExecutionContext = executionContext;
- executionContext |= BatchedContext;
-
- try {
- return fn(a);
- } finally {
- executionContext = prevExecutionContext;
-
- if (executionContext === NoContext) {
- // Flush the immediate callbacks that were scheduled during this batch
- flushSyncCallbackQueue();
- }
- }
- }
- function batchedEventUpdates$1(fn, a) {
- var prevExecutionContext = executionContext;
- executionContext |= EventContext;
-
- try {
- return fn(a);
- } finally {
- executionContext = prevExecutionContext;
-
- if (executionContext === NoContext) {
- // Flush the immediate callbacks that were scheduled during this batch
- flushSyncCallbackQueue();
- }
- }
- }
- function discreteUpdates$1(fn, a, b, c) {
- var prevExecutionContext = executionContext;
- executionContext |= DiscreteEventContext;
-
- try {
- // Should this
- return runWithPriority$2(UserBlockingPriority$2, fn.bind(null, a, b, c));
- } finally {
- executionContext = prevExecutionContext;
-
- if (executionContext === NoContext) {
- // Flush the immediate callbacks that were scheduled during this batch
- flushSyncCallbackQueue();
- }
- }
- }
- function unbatchedUpdates(fn, a) {
- var prevExecutionContext = executionContext;
- executionContext &= ~BatchedContext;
- executionContext |= LegacyUnbatchedContext;
-
- try {
- return fn(a);
- } finally {
- executionContext = prevExecutionContext;
-
- if (executionContext === NoContext) {
- // Flush the immediate callbacks that were scheduled during this batch
- flushSyncCallbackQueue();
- }
- }
- }
- function flushSync(fn, a) {
- if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
- {
- {
- throw Error("flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.");
- }
- }
- }
-
- var prevExecutionContext = executionContext;
- executionContext |= BatchedContext;
-
- try {
- return runWithPriority$2(ImmediatePriority, fn.bind(null, a));
- } finally {
- executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch.
- // Note that this will happen even if batchedUpdates is higher up
- // the stack.
-
- flushSyncCallbackQueue();
- }
- }
- function flushControlled(fn) {
- var prevExecutionContext = executionContext;
- executionContext |= BatchedContext;
-
- try {
- runWithPriority$2(ImmediatePriority, fn);
- } finally {
- executionContext = prevExecutionContext;
-
- if (executionContext === NoContext) {
- // Flush the immediate callbacks that were scheduled during this batch
- flushSyncCallbackQueue();
- }
- }
- }
-
- function prepareFreshStack(root, expirationTime) {
- root.finishedWork = null;
- root.finishedExpirationTime = NoWork;
- var timeoutHandle = root.timeoutHandle;
-
- if (timeoutHandle !== noTimeout) {
- // The root previous suspended and scheduled a timeout to commit a fallback
- // state. Now that we have additional work, cancel the timeout.
- root.timeoutHandle = noTimeout; // $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above
-
- cancelTimeout(timeoutHandle);
- }
-
- if (workInProgress !== null) {
- var interruptedWork = workInProgress.return;
-
- while (interruptedWork !== null) {
- unwindInterruptedWork(interruptedWork);
- interruptedWork = interruptedWork.return;
- }
- }
-
- workInProgressRoot = root;
- workInProgress = createWorkInProgress(root.current, null, expirationTime);
- renderExpirationTime = expirationTime;
- workInProgressRootExitStatus = RootIncomplete;
- workInProgressRootFatalError = null;
- workInProgressRootLatestProcessedExpirationTime = Sync;
- workInProgressRootLatestSuspenseTimeout = Sync;
- workInProgressRootCanSuspendUsingConfig = null;
- workInProgressRootNextUnprocessedUpdateTime = NoWork;
- workInProgressRootHasPendingPing = false;
-
- if (enableSchedulerTracing) {
- spawnedWorkDuringRender = null;
- }
-
- {
- ReactStrictModeWarnings.discardPendingWarnings();
- componentsThatTriggeredHighPriSuspend = null;
- }
- }
-
- function handleError(root, thrownValue) {
- do {
- try {
- // Reset module-level state that was set during the render phase.
- resetContextDependencies();
- resetHooks();
- resetCurrentFiber();
-
- if (workInProgress === null || workInProgress.return === null) {
- // Expected to be working on a non-root fiber. This is a fatal error
- // because there's no ancestor that can handle it; the root is
- // supposed to capture all errors that weren't caught by an error
- // boundary.
- workInProgressRootExitStatus = RootFatalErrored;
- workInProgressRootFatalError = thrownValue;
- return null;
- }
-
- if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
- // Record the time spent rendering before an error was thrown. This
- // avoids inaccurate Profiler durations in the case of a
- // suspended render.
- stopProfilerTimerIfRunningAndRecordDelta(workInProgress, true);
- }
-
- throwException(root, workInProgress.return, workInProgress, thrownValue, renderExpirationTime);
- workInProgress = completeUnitOfWork(workInProgress);
- } catch (yetAnotherThrownValue) {
- // Something in the return path also threw.
- thrownValue = yetAnotherThrownValue;
- continue;
- } // Return to the normal work loop.
-
-
- return;
- } while (true);
- }
-
- function pushDispatcher(root) {
- var prevDispatcher = ReactCurrentDispatcher.current;
- ReactCurrentDispatcher.current = ContextOnlyDispatcher;
-
- if (prevDispatcher === null) {
- // The React isomorphic package does not include a default dispatcher.
- // Instead the first renderer will lazily attach one, in order to give
- // nicer error messages.
- return ContextOnlyDispatcher;
- } else {
- return prevDispatcher;
- }
- }
-
- function popDispatcher(prevDispatcher) {
- ReactCurrentDispatcher.current = prevDispatcher;
- }
-
- function pushInteractions(root) {
- if (enableSchedulerTracing) {
- var prevInteractions = tracing.__interactionsRef.current;
- tracing.__interactionsRef.current = root.memoizedInteractions;
- return prevInteractions;
- }
-
- return null;
- }
-
- function popInteractions(prevInteractions) {
- if (enableSchedulerTracing) {
- tracing.__interactionsRef.current = prevInteractions;
- }
- }
-
- function markCommitTimeOfFallback() {
- globalMostRecentFallbackTime = now();
- }
- function markRenderEventTimeAndConfig(expirationTime, suspenseConfig) {
- if (expirationTime < workInProgressRootLatestProcessedExpirationTime && expirationTime > Idle) {
- workInProgressRootLatestProcessedExpirationTime = expirationTime;
- }
-
- if (suspenseConfig !== null) {
- if (expirationTime < workInProgressRootLatestSuspenseTimeout && expirationTime > Idle) {
- workInProgressRootLatestSuspenseTimeout = expirationTime; // Most of the time we only have one config and getting wrong is not bad.
-
- workInProgressRootCanSuspendUsingConfig = suspenseConfig;
- }
- }
- }
- function markUnprocessedUpdateTime(expirationTime) {
- if (expirationTime > workInProgressRootNextUnprocessedUpdateTime) {
- workInProgressRootNextUnprocessedUpdateTime = expirationTime;
- }
- }
- function renderDidSuspend() {
- if (workInProgressRootExitStatus === RootIncomplete) {
- workInProgressRootExitStatus = RootSuspended;
- }
- }
- function renderDidSuspendDelayIfPossible() {
- if (workInProgressRootExitStatus === RootIncomplete || workInProgressRootExitStatus === RootSuspended) {
- workInProgressRootExitStatus = RootSuspendedWithDelay;
- } // Check if there's a lower priority update somewhere else in the tree.
-
-
- if (workInProgressRootNextUnprocessedUpdateTime !== NoWork && workInProgressRoot !== null) {
- // Mark the current render as suspended, and then mark that there's a
- // pending update.
- // TODO: This should immediately interrupt the current render, instead
- // of waiting until the next time we yield.
- markRootSuspendedAtTime(workInProgressRoot, renderExpirationTime);
- markRootUpdatedAtTime(workInProgressRoot, workInProgressRootNextUnprocessedUpdateTime);
- }
- }
- function renderDidError() {
- if (workInProgressRootExitStatus !== RootCompleted) {
- workInProgressRootExitStatus = RootErrored;
- }
- } // Called during render to determine if anything has suspended.
- // Returns false if we're not sure.
-
- function renderHasNotSuspendedYet() {
- // If something errored or completed, we can't really be sure,
- // so those are false.
- return workInProgressRootExitStatus === RootIncomplete;
- }
-
- function inferTimeFromExpirationTime(expirationTime) {
- // We don't know exactly when the update was scheduled, but we can infer an
- // approximate start time from the expiration time.
- var earliestExpirationTimeMs = expirationTimeToMs(expirationTime);
- return earliestExpirationTimeMs - LOW_PRIORITY_EXPIRATION;
- }
-
- function inferTimeFromExpirationTimeWithSuspenseConfig(expirationTime, suspenseConfig) {
- // We don't know exactly when the update was scheduled, but we can infer an
- // approximate start time from the expiration time by subtracting the timeout
- // that was added to the event time.
- var earliestExpirationTimeMs = expirationTimeToMs(expirationTime);
- return earliestExpirationTimeMs - (suspenseConfig.timeoutMs | 0 || LOW_PRIORITY_EXPIRATION);
- } // The work loop is an extremely hot path. Tell Closure not to inline it.
-
- /** @noinline */
-
-
- function workLoopSync() {
- // Already timed out, so perform work without checking if we need to yield.
- while (workInProgress !== null) {
- workInProgress = performUnitOfWork(workInProgress);
- }
- }
- /** @noinline */
-
-
- function workLoopConcurrent() {
- // Perform work until Scheduler asks us to yield
- while (workInProgress !== null && !shouldYield()) {
- workInProgress = performUnitOfWork(workInProgress);
- }
- }
-
- function performUnitOfWork(unitOfWork) {
- // The current, flushed, state of this fiber is the alternate. Ideally
- // nothing should rely on this, but relying on it here means that we don't
- // need an additional field on the work in progress.
- var current$$1 = unitOfWork.alternate;
- startWorkTimer(unitOfWork);
- setCurrentFiber(unitOfWork);
- var next;
-
- if (enableProfilerTimer && (unitOfWork.mode & ProfileMode) !== NoMode) {
- startProfilerTimer(unitOfWork);
- next = beginWork$$1(current$$1, unitOfWork, renderExpirationTime);
- stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);
- } else {
- next = beginWork$$1(current$$1, unitOfWork, renderExpirationTime);
- }
-
- resetCurrentFiber();
- unitOfWork.memoizedProps = unitOfWork.pendingProps;
-
- if (next === null) {
- // If this doesn't spawn new work, complete the current work.
- next = completeUnitOfWork(unitOfWork);
- }
-
- ReactCurrentOwner$2.current = null;
- return next;
- }
-
- function completeUnitOfWork(unitOfWork) {
- // Attempt to complete the current unit of work, then move to the next
- // sibling. If there are no more siblings, return to the parent fiber.
- workInProgress = unitOfWork;
-
- do {
- // The current, flushed, state of this fiber is the alternate. Ideally
- // nothing should rely on this, but relying on it here means that we don't
- // need an additional field on the work in progress.
- var current$$1 = workInProgress.alternate;
- var returnFiber = workInProgress.return; // Check if the work completed or if something threw.
-
- if ((workInProgress.effectTag & Incomplete) === NoEffect) {
- setCurrentFiber(workInProgress);
- var next = void 0;
-
- if (!enableProfilerTimer || (workInProgress.mode & ProfileMode) === NoMode) {
- next = completeWork(current$$1, workInProgress, renderExpirationTime);
- } else {
- startProfilerTimer(workInProgress);
- next = completeWork(current$$1, workInProgress, renderExpirationTime); // Update render duration assuming we didn't error.
-
- stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false);
- }
-
- stopWorkTimer(workInProgress);
- resetCurrentFiber();
- resetChildExpirationTime(workInProgress);
-
- if (next !== null) {
- // Completing this fiber spawned new work. Work on that next.
- return next;
- }
-
- if (returnFiber !== null && // Do not append effects to parents if a sibling failed to complete
- (returnFiber.effectTag & Incomplete) === NoEffect) {
- // Append all the effects of the subtree and this fiber onto the effect
- // list of the parent. The completion order of the children affects the
- // side-effect order.
- if (returnFiber.firstEffect === null) {
- returnFiber.firstEffect = workInProgress.firstEffect;
- }
-
- if (workInProgress.lastEffect !== null) {
- if (returnFiber.lastEffect !== null) {
- returnFiber.lastEffect.nextEffect = workInProgress.firstEffect;
- }
-
- returnFiber.lastEffect = workInProgress.lastEffect;
- } // If this fiber had side-effects, we append it AFTER the children's
- // side-effects. We can perform certain side-effects earlier if needed,
- // by doing multiple passes over the effect list. We don't want to
- // schedule our own side-effect on our own list because if end up
- // reusing children we'll schedule this effect onto itself since we're
- // at the end.
-
-
- var effectTag = workInProgress.effectTag; // Skip both NoWork and PerformedWork tags when creating the effect
- // list. PerformedWork effect is read by React DevTools but shouldn't be
- // committed.
-
- if (effectTag > PerformedWork) {
- if (returnFiber.lastEffect !== null) {
- returnFiber.lastEffect.nextEffect = workInProgress;
- } else {
- returnFiber.firstEffect = workInProgress;
- }
-
- returnFiber.lastEffect = workInProgress;
- }
- }
- } else {
- // This fiber did not complete because something threw. Pop values off
- // the stack without entering the complete phase. If this is a boundary,
- // capture values if possible.
- var _next = unwindWork(workInProgress, renderExpirationTime); // Because this fiber did not complete, don't reset its expiration time.
-
-
- if (enableProfilerTimer && (workInProgress.mode & ProfileMode) !== NoMode) {
- // Record the render duration for the fiber that errored.
- stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false); // Include the time spent working on failed children before continuing.
-
- var actualDuration = workInProgress.actualDuration;
- var child = workInProgress.child;
-
- while (child !== null) {
- actualDuration += child.actualDuration;
- child = child.sibling;
- }
-
- workInProgress.actualDuration = actualDuration;
- }
-
- if (_next !== null) {
- // If completing this work spawned new work, do that next. We'll come
- // back here again.
- // Since we're restarting, remove anything that is not a host effect
- // from the effect tag.
- // TODO: The name stopFailedWorkTimer is misleading because Suspense
- // also captures and restarts.
- stopFailedWorkTimer(workInProgress);
- _next.effectTag &= HostEffectMask;
- return _next;
- }
-
- stopWorkTimer(workInProgress);
-
- if (returnFiber !== null) {
- // Mark the parent fiber as incomplete and clear its effect list.
- returnFiber.firstEffect = returnFiber.lastEffect = null;
- returnFiber.effectTag |= Incomplete;
- }
- }
-
- var siblingFiber = workInProgress.sibling;
-
- if (siblingFiber !== null) {
- // If there is more work to do in this returnFiber, do that next.
- return siblingFiber;
- } // Otherwise, return to the parent
-
-
- workInProgress = returnFiber;
- } while (workInProgress !== null); // We've reached the root.
-
-
- if (workInProgressRootExitStatus === RootIncomplete) {
- workInProgressRootExitStatus = RootCompleted;
- }
-
- return null;
- }
-
- function getRemainingExpirationTime(fiber) {
- var updateExpirationTime = fiber.expirationTime;
- var childExpirationTime = fiber.childExpirationTime;
- return updateExpirationTime > childExpirationTime ? updateExpirationTime : childExpirationTime;
- }
-
- function resetChildExpirationTime(completedWork) {
- if (renderExpirationTime !== Never && completedWork.childExpirationTime === Never) {
- // The children of this component are hidden. Don't bubble their
- // expiration times.
- return;
- }
-
- var newChildExpirationTime = NoWork; // Bubble up the earliest expiration time.
-
- if (enableProfilerTimer && (completedWork.mode & ProfileMode) !== NoMode) {
- // In profiling mode, resetChildExpirationTime is also used to reset
- // profiler durations.
- var actualDuration = completedWork.actualDuration;
- var treeBaseDuration = completedWork.selfBaseDuration; // When a fiber is cloned, its actualDuration is reset to 0. This value will
- // only be updated if work is done on the fiber (i.e. it doesn't bailout).
- // When work is done, it should bubble to the parent's actualDuration. If
- // the fiber has not been cloned though, (meaning no work was done), then
- // this value will reflect the amount of time spent working on a previous
- // render. In that case it should not bubble. We determine whether it was
- // cloned by comparing the child pointer.
-
- var shouldBubbleActualDurations = completedWork.alternate === null || completedWork.child !== completedWork.alternate.child;
- var child = completedWork.child;
-
- while (child !== null) {
- var childUpdateExpirationTime = child.expirationTime;
- var childChildExpirationTime = child.childExpirationTime;
-
- if (childUpdateExpirationTime > newChildExpirationTime) {
- newChildExpirationTime = childUpdateExpirationTime;
- }
-
- if (childChildExpirationTime > newChildExpirationTime) {
- newChildExpirationTime = childChildExpirationTime;
- }
-
- if (shouldBubbleActualDurations) {
- actualDuration += child.actualDuration;
- }
-
- treeBaseDuration += child.treeBaseDuration;
- child = child.sibling;
- }
-
- completedWork.actualDuration = actualDuration;
- completedWork.treeBaseDuration = treeBaseDuration;
- } else {
- var _child = completedWork.child;
-
- while (_child !== null) {
- var _childUpdateExpirationTime = _child.expirationTime;
- var _childChildExpirationTime = _child.childExpirationTime;
-
- if (_childUpdateExpirationTime > newChildExpirationTime) {
- newChildExpirationTime = _childUpdateExpirationTime;
- }
-
- if (_childChildExpirationTime > newChildExpirationTime) {
- newChildExpirationTime = _childChildExpirationTime;
- }
-
- _child = _child.sibling;
- }
- }
-
- completedWork.childExpirationTime = newChildExpirationTime;
- }
-
- function commitRoot(root) {
- var renderPriorityLevel = getCurrentPriorityLevel();
- runWithPriority$2(ImmediatePriority, commitRootImpl.bind(null, root, renderPriorityLevel));
- return null;
- }
-
- function commitRootImpl(root, renderPriorityLevel) {
- do {
- // `flushPassiveEffects` will call `flushSyncUpdateQueue` at the end, which
- // means `flushPassiveEffects` will sometimes result in additional
- // passive effects. So we need to keep flushing in a loop until there are
- // no more pending effects.
- // TODO: Might be better if `flushPassiveEffects` did not automatically
- // flush synchronous work at the end, to avoid factoring hazards like this.
- flushPassiveEffects();
- } while (rootWithPendingPassiveEffects !== null);
-
- flushRenderPhaseStrictModeWarningsInDEV();
-
- if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
- {
- throw Error("Should not already be working.");
- }
- }
-
- var finishedWork = root.finishedWork;
- var expirationTime = root.finishedExpirationTime;
-
- if (finishedWork === null) {
- return null;
- }
-
- root.finishedWork = null;
- root.finishedExpirationTime = NoWork;
-
- if (!(finishedWork !== root.current)) {
- {
- throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");
- }
- } // commitRoot never returns a continuation; it always finishes synchronously.
- // So we can clear these now to allow a new callback to be scheduled.
-
-
- root.callbackNode = null;
- root.callbackExpirationTime = NoWork;
- root.callbackPriority = NoPriority;
- root.nextKnownPendingLevel = NoWork;
- startCommitTimer(); // Update the first and last pending times on this root. The new first
- // pending time is whatever is left on the root fiber.
-
- var remainingExpirationTimeBeforeCommit = getRemainingExpirationTime(finishedWork);
- markRootFinishedAtTime(root, expirationTime, remainingExpirationTimeBeforeCommit);
-
- if (root === workInProgressRoot) {
- // We can reset these now that they are finished.
- workInProgressRoot = null;
- workInProgress = null;
- renderExpirationTime = NoWork;
- } else {} // This indicates that the last root we worked on is not the same one that
- // we're committing now. This most commonly happens when a suspended root
- // times out.
- // Get the list of effects.
-
-
- var firstEffect;
-
- if (finishedWork.effectTag > PerformedWork) {
- // A fiber's effect list consists only of its children, not itself. So if
- // the root has an effect, we need to add it to the end of the list. The
- // resulting list is the set that would belong to the root's parent, if it
- // had one; that is, all the effects in the tree including the root.
- if (finishedWork.lastEffect !== null) {
- finishedWork.lastEffect.nextEffect = finishedWork;
- firstEffect = finishedWork.firstEffect;
- } else {
- firstEffect = finishedWork;
- }
- } else {
- // There is no effect on the root.
- firstEffect = finishedWork.firstEffect;
- }
-
- if (firstEffect !== null) {
- var prevExecutionContext = executionContext;
- executionContext |= CommitContext;
- var prevInteractions = pushInteractions(root); // Reset this to null before calling lifecycles
-
- ReactCurrentOwner$2.current = null; // The commit phase is broken into several sub-phases. We do a separate pass
- // of the effect list for each phase: all mutation effects come before all
- // layout effects, and so on.
- // The first phase a "before mutation" phase. We use this phase to read the
- // state of the host tree right before we mutate it. This is where
- // getSnapshotBeforeUpdate is called.
-
- startCommitSnapshotEffectsTimer();
- prepareForCommit(root.containerInfo);
- nextEffect = firstEffect;
-
- do {
- {
- invokeGuardedCallback(null, commitBeforeMutationEffects, null);
-
- if (hasCaughtError()) {
- if (!(nextEffect !== null)) {
- {
- throw Error("Should be working on an effect.");
- }
- }
-
- var error = clearCaughtError();
- captureCommitPhaseError(nextEffect, error);
- nextEffect = nextEffect.nextEffect;
- }
- }
- } while (nextEffect !== null);
-
- stopCommitSnapshotEffectsTimer();
-
- if (enableProfilerTimer) {
- // Mark the current commit time to be shared by all Profilers in this
- // batch. This enables them to be grouped later.
- recordCommitTime();
- } // The next phase is the mutation phase, where we mutate the host tree.
-
-
- startCommitHostEffectsTimer();
- nextEffect = firstEffect;
-
- do {
- {
- invokeGuardedCallback(null, commitMutationEffects, null, root, renderPriorityLevel);
-
- if (hasCaughtError()) {
- if (!(nextEffect !== null)) {
- {
- throw Error("Should be working on an effect.");
- }
- }
-
- var _error = clearCaughtError();
-
- captureCommitPhaseError(nextEffect, _error);
- nextEffect = nextEffect.nextEffect;
- }
- }
- } while (nextEffect !== null);
-
- stopCommitHostEffectsTimer();
- resetAfterCommit(root.containerInfo); // The work-in-progress tree is now the current tree. This must come after
- // the mutation phase, so that the previous tree is still current during
- // componentWillUnmount, but before the layout phase, so that the finished
- // work is current during componentDidMount/Update.
-
- root.current = finishedWork; // The next phase is the layout phase, where we call effects that read
- // the host tree after it's been mutated. The idiomatic use case for this is
- // layout, but class component lifecycles also fire here for legacy reasons.
-
- startCommitLifeCyclesTimer();
- nextEffect = firstEffect;
-
- do {
- {
- invokeGuardedCallback(null, commitLayoutEffects, null, root, expirationTime);
-
- if (hasCaughtError()) {
- if (!(nextEffect !== null)) {
- {
- throw Error("Should be working on an effect.");
- }
- }
-
- var _error2 = clearCaughtError();
-
- captureCommitPhaseError(nextEffect, _error2);
- nextEffect = nextEffect.nextEffect;
- }
- }
- } while (nextEffect !== null);
-
- stopCommitLifeCyclesTimer();
- nextEffect = null; // Tell Scheduler to yield at the end of the frame, so the browser has an
- // opportunity to paint.
-
- requestPaint();
-
- if (enableSchedulerTracing) {
- popInteractions(prevInteractions);
- }
-
- executionContext = prevExecutionContext;
- } else {
- // No effects.
- root.current = finishedWork; // Measure these anyway so the flamegraph explicitly shows that there were
- // no effects.
- // TODO: Maybe there's a better way to report this.
-
- startCommitSnapshotEffectsTimer();
- stopCommitSnapshotEffectsTimer();
-
- if (enableProfilerTimer) {
- recordCommitTime();
- }
-
- startCommitHostEffectsTimer();
- stopCommitHostEffectsTimer();
- startCommitLifeCyclesTimer();
- stopCommitLifeCyclesTimer();
- }
-
- stopCommitTimer();
- var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;
-
- if (rootDoesHavePassiveEffects) {
- // This commit has passive effects. Stash a reference to them. But don't
- // schedule a callback until after flushing layout work.
- rootDoesHavePassiveEffects = false;
- rootWithPendingPassiveEffects = root;
- pendingPassiveEffectsExpirationTime = expirationTime;
- pendingPassiveEffectsRenderPriority = renderPriorityLevel;
- } else {
- // We are done with the effect chain at this point so let's clear the
- // nextEffect pointers to assist with GC. If we have passive effects, we'll
- // clear this in flushPassiveEffects.
- nextEffect = firstEffect;
-
- while (nextEffect !== null) {
- var nextNextEffect = nextEffect.nextEffect;
- nextEffect.nextEffect = null;
- nextEffect = nextNextEffect;
- }
- } // Check if there's remaining work on this root
-
-
- var remainingExpirationTime = root.firstPendingTime;
-
- if (remainingExpirationTime !== NoWork) {
- if (enableSchedulerTracing) {
- if (spawnedWorkDuringRender !== null) {
- var expirationTimes = spawnedWorkDuringRender;
- spawnedWorkDuringRender = null;
-
- for (var i = 0; i < expirationTimes.length; i++) {
- scheduleInteractions(root, expirationTimes[i], root.memoizedInteractions);
- }
- }
-
- schedulePendingInteractions(root, remainingExpirationTime);
- }
- } else {
- // If there's no remaining work, we can clear the set of already failed
- // error boundaries.
- legacyErrorBoundariesThatAlreadyFailed = null;
- }
-
- if (enableSchedulerTracing) {
- if (!rootDidHavePassiveEffects) {
- // If there are no passive effects, then we can complete the pending interactions.
- // Otherwise, we'll wait until after the passive effects are flushed.
- // Wait to do this until after remaining work has been scheduled,
- // so that we don't prematurely signal complete for interactions when there's e.g. hidden work.
- finishPendingInteractions(root, expirationTime);
- }
- }
-
- if (remainingExpirationTime === Sync) {
- // Count the number of times the root synchronously re-renders without
- // finishing. If there are too many, it indicates an infinite update loop.
- if (root === rootWithNestedUpdates) {
- nestedUpdateCount++;
- } else {
- nestedUpdateCount = 0;
- rootWithNestedUpdates = root;
- }
- } else {
- nestedUpdateCount = 0;
- }
-
- onCommitRoot(finishedWork.stateNode, expirationTime); // Always call this before exiting `commitRoot`, to ensure that any
- // additional work on this root is scheduled.
-
- ensureRootIsScheduled(root);
-
- if (hasUncaughtError) {
- hasUncaughtError = false;
- var _error3 = firstUncaughtError;
- firstUncaughtError = null;
- throw _error3;
- }
-
- if ((executionContext & LegacyUnbatchedContext) !== NoContext) {
- // This is a legacy edge case. We just committed the initial mount of
- // a ReactDOM.render-ed root inside of batchedUpdates. The commit fired
- // synchronously, but layout updates should be deferred until the end
- // of the batch.
- return null;
- } // If layout work was scheduled, flush it now.
-
-
- flushSyncCallbackQueue();
- return null;
- }
-
- function commitBeforeMutationEffects() {
- while (nextEffect !== null) {
- var effectTag = nextEffect.effectTag;
-
- if ((effectTag & Snapshot) !== NoEffect) {
- setCurrentFiber(nextEffect);
- recordEffect();
- var current$$1 = nextEffect.alternate;
- commitBeforeMutationLifeCycles(current$$1, nextEffect);
- resetCurrentFiber();
- }
-
- if ((effectTag & Passive) !== NoEffect) {
- // If there are passive effects, schedule a callback to flush at
- // the earliest opportunity.
- if (!rootDoesHavePassiveEffects) {
- rootDoesHavePassiveEffects = true;
- scheduleCallback(NormalPriority, function () {
- flushPassiveEffects();
- return null;
- });
- }
- }
-
- nextEffect = nextEffect.nextEffect;
- }
- }
-
- function commitMutationEffects(root, renderPriorityLevel) {
- // TODO: Should probably move the bulk of this function to commitWork.
- while (nextEffect !== null) {
- setCurrentFiber(nextEffect);
- var effectTag = nextEffect.effectTag;
-
- if (effectTag & ContentReset) {
- commitResetTextContent(nextEffect);
- }
-
- if (effectTag & Ref) {
- var current$$1 = nextEffect.alternate;
-
- if (current$$1 !== null) {
- commitDetachRef(current$$1);
- }
- } // The following switch statement is only concerned about placement,
- // updates, and deletions. To avoid needing to add a case for every possible
- // bitmap value, we remove the secondary effects from the effect tag and
- // switch on that value.
-
-
- var primaryEffectTag = effectTag & (Placement | Update | Deletion | Hydrating);
-
- switch (primaryEffectTag) {
- case Placement:
- {
- commitPlacement(nextEffect); // Clear the "placement" from effect tag so that we know that this is
- // inserted, before any life-cycles like componentDidMount gets called.
- // TODO: findDOMNode doesn't rely on this any more but isMounted does
- // and isMounted is deprecated anyway so we should be able to kill this.
-
- nextEffect.effectTag &= ~Placement;
- break;
- }
-
- case PlacementAndUpdate:
- {
- // Placement
- commitPlacement(nextEffect); // Clear the "placement" from effect tag so that we know that this is
- // inserted, before any life-cycles like componentDidMount gets called.
-
- nextEffect.effectTag &= ~Placement; // Update
-
- var _current = nextEffect.alternate;
- commitWork(_current, nextEffect);
- break;
- }
-
- case Hydrating:
- {
- nextEffect.effectTag &= ~Hydrating;
- break;
- }
-
- case HydratingAndUpdate:
- {
- nextEffect.effectTag &= ~Hydrating; // Update
-
- var _current2 = nextEffect.alternate;
- commitWork(_current2, nextEffect);
- break;
- }
-
- case Update:
- {
- var _current3 = nextEffect.alternate;
- commitWork(_current3, nextEffect);
- break;
- }
-
- case Deletion:
- {
- commitDeletion(root, nextEffect, renderPriorityLevel);
- break;
- }
- } // TODO: Only record a mutation effect if primaryEffectTag is non-zero.
-
-
- recordEffect();
- resetCurrentFiber();
- nextEffect = nextEffect.nextEffect;
- }
- }
-
- function commitLayoutEffects(root, committedExpirationTime) {
- // TODO: Should probably move the bulk of this function to commitWork.
- while (nextEffect !== null) {
- setCurrentFiber(nextEffect);
- var effectTag = nextEffect.effectTag;
-
- if (effectTag & (Update | Callback)) {
- recordEffect();
- var current$$1 = nextEffect.alternate;
- commitLifeCycles(root, current$$1, nextEffect, committedExpirationTime);
- }
-
- if (effectTag & Ref) {
- recordEffect();
- commitAttachRef(nextEffect);
- }
-
- resetCurrentFiber();
- nextEffect = nextEffect.nextEffect;
- }
- }
-
- function flushPassiveEffects() {
- if (pendingPassiveEffectsRenderPriority !== NoPriority) {
- var priorityLevel = pendingPassiveEffectsRenderPriority > NormalPriority ? NormalPriority : pendingPassiveEffectsRenderPriority;
- pendingPassiveEffectsRenderPriority = NoPriority;
- return runWithPriority$2(priorityLevel, flushPassiveEffectsImpl);
- }
- }
-
- function flushPassiveEffectsImpl() {
- if (rootWithPendingPassiveEffects === null) {
- return false;
- }
-
- var root = rootWithPendingPassiveEffects;
- var expirationTime = pendingPassiveEffectsExpirationTime;
- rootWithPendingPassiveEffects = null;
- pendingPassiveEffectsExpirationTime = NoWork;
-
- if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {
- {
- throw Error("Cannot flush passive effects while already rendering.");
- }
- }
-
- var prevExecutionContext = executionContext;
- executionContext |= CommitContext;
- var prevInteractions = pushInteractions(root); // Note: This currently assumes there are no passive effects on the root
- // fiber, because the root is not part of its own effect list. This could
- // change in the future.
-
- var effect = root.current.firstEffect;
-
- while (effect !== null) {
- {
- setCurrentFiber(effect);
- invokeGuardedCallback(null, commitPassiveHookEffects, null, effect);
-
- if (hasCaughtError()) {
- if (!(effect !== null)) {
- {
- throw Error("Should be working on an effect.");
- }
- }
-
- var error = clearCaughtError();
- captureCommitPhaseError(effect, error);
- }
-
- resetCurrentFiber();
- }
-
- var nextNextEffect = effect.nextEffect; // Remove nextEffect pointer to assist GC
-
- effect.nextEffect = null;
- effect = nextNextEffect;
- }
-
- if (enableSchedulerTracing) {
- popInteractions(prevInteractions);
- finishPendingInteractions(root, expirationTime);
- }
-
- executionContext = prevExecutionContext;
- flushSyncCallbackQueue(); // If additional passive effects were scheduled, increment a counter. If this
- // exceeds the limit, we'll fire a warning.
-
- nestedPassiveUpdateCount = rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1;
- return true;
- }
-
- function isAlreadyFailedLegacyErrorBoundary(instance) {
- return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);
- }
- function markLegacyErrorBoundaryAsFailed(instance) {
- if (legacyErrorBoundariesThatAlreadyFailed === null) {
- legacyErrorBoundariesThatAlreadyFailed = new Set([instance]);
- } else {
- legacyErrorBoundariesThatAlreadyFailed.add(instance);
- }
- }
-
- function prepareToThrowUncaughtError(error) {
- if (!hasUncaughtError) {
- hasUncaughtError = true;
- firstUncaughtError = error;
- }
- }
-
- var onUncaughtError = prepareToThrowUncaughtError;
-
- function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {
- var errorInfo = createCapturedValue(error, sourceFiber);
- var update = createRootErrorUpdate(rootFiber, errorInfo, Sync);
- enqueueUpdate(rootFiber, update);
- var root = markUpdateTimeFromFiberToRoot(rootFiber, Sync);
-
- if (root !== null) {
- ensureRootIsScheduled(root);
- schedulePendingInteractions(root, Sync);
- }
- }
-
- function captureCommitPhaseError(sourceFiber, error) {
- if (sourceFiber.tag === HostRoot) {
- // Error was thrown at the root. There is no parent, so the root
- // itself should capture it.
- captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);
- return;
- }
-
- var fiber = sourceFiber.return;
-
- while (fiber !== null) {
- if (fiber.tag === HostRoot) {
- captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error);
- return;
- } else if (fiber.tag === ClassComponent) {
- var ctor = fiber.type;
- var instance = fiber.stateNode;
-
- if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {
- var errorInfo = createCapturedValue(error, sourceFiber);
- var update = createClassErrorUpdate(fiber, errorInfo, // TODO: This is always sync
- Sync);
- enqueueUpdate(fiber, update);
- var root = markUpdateTimeFromFiberToRoot(fiber, Sync);
-
- if (root !== null) {
- ensureRootIsScheduled(root);
- schedulePendingInteractions(root, Sync);
- }
-
- return;
- }
- }
-
- fiber = fiber.return;
- }
- }
- function pingSuspendedRoot(root, thenable, suspendedTime) {
- var pingCache = root.pingCache;
-
- if (pingCache !== null) {
- // The thenable resolved, so we no longer need to memoize, because it will
- // never be thrown again.
- pingCache.delete(thenable);
- }
-
- if (workInProgressRoot === root && renderExpirationTime === suspendedTime) {
- // Received a ping at the same priority level at which we're currently
- // rendering. We might want to restart this render. This should mirror
- // the logic of whether or not a root suspends once it completes.
- // TODO: If we're rendering sync either due to Sync, Batched or expired,
- // we should probably never restart.
- // If we're suspended with delay, we'll always suspend so we can always
- // restart. If we're suspended without any updates, it might be a retry.
- // If it's early in the retry we can restart. We can't know for sure
- // whether we'll eventually process an update during this render pass,
- // but it's somewhat unlikely that we get to a ping before that, since
- // getting to the root most update is usually very fast.
- if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && workInProgressRootLatestProcessedExpirationTime === Sync && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
- // Restart from the root. Don't need to schedule a ping because
- // we're already working on this tree.
- prepareFreshStack(root, renderExpirationTime);
- } else {
- // Even though we can't restart right now, we might get an
- // opportunity later. So we mark this render as having a ping.
- workInProgressRootHasPendingPing = true;
- }
-
- return;
- }
-
- if (!isRootSuspendedAtTime(root, suspendedTime)) {
- // The root is no longer suspended at this time.
- return;
- }
-
- var lastPingedTime = root.lastPingedTime;
-
- if (lastPingedTime !== NoWork && lastPingedTime < suspendedTime) {
- // There's already a lower priority ping scheduled.
- return;
- } // Mark the time at which this ping was scheduled.
-
-
- root.lastPingedTime = suspendedTime;
-
- if (root.finishedExpirationTime === suspendedTime) {
- // If there's a pending fallback waiting to commit, throw it away.
- root.finishedExpirationTime = NoWork;
- root.finishedWork = null;
- }
-
- ensureRootIsScheduled(root);
- schedulePendingInteractions(root, suspendedTime);
- }
-
- function retryTimedOutBoundary(boundaryFiber, retryTime) {
- // The boundary fiber (a Suspense component or SuspenseList component)
- // previously was rendered in its fallback state. One of the promises that
- // suspended it has resolved, which means at least part of the tree was
- // likely unblocked. Try rendering again, at a new expiration time.
- if (retryTime === NoWork) {
- var suspenseConfig = null; // Retries don't carry over the already committed update.
-
- var currentTime = requestCurrentTimeForUpdate();
- retryTime = computeExpirationForFiber(currentTime, boundaryFiber, suspenseConfig);
- } // TODO: Special case idle priority?
-
-
- var root = markUpdateTimeFromFiberToRoot(boundaryFiber, retryTime);
-
- if (root !== null) {
- ensureRootIsScheduled(root);
- schedulePendingInteractions(root, retryTime);
- }
- }
-
- function retryDehydratedSuspenseBoundary(boundaryFiber) {
- var suspenseState = boundaryFiber.memoizedState;
- var retryTime = NoWork;
-
- if (suspenseState !== null) {
- retryTime = suspenseState.retryTime;
- }
-
- retryTimedOutBoundary(boundaryFiber, retryTime);
- }
- function resolveRetryThenable(boundaryFiber, thenable) {
- var retryTime = NoWork; // Default
-
- var retryCache;
-
- if (enableSuspenseServerRenderer) {
- switch (boundaryFiber.tag) {
- case SuspenseComponent:
- retryCache = boundaryFiber.stateNode;
- var suspenseState = boundaryFiber.memoizedState;
-
- if (suspenseState !== null) {
- retryTime = suspenseState.retryTime;
- }
-
- break;
-
- case SuspenseListComponent:
- retryCache = boundaryFiber.stateNode;
- break;
-
- default:
- {
- {
- throw Error("Pinged unknown suspense boundary type. This is probably a bug in React.");
- }
- }
-
- }
- } else {
- retryCache = boundaryFiber.stateNode;
- }
-
- if (retryCache !== null) {
- // The thenable resolved, so we no longer need to memoize, because it will
- // never be thrown again.
- retryCache.delete(thenable);
- }
-
- retryTimedOutBoundary(boundaryFiber, retryTime);
- } // Computes the next Just Noticeable Difference (JND) boundary.
- // The theory is that a person can't tell the difference between small differences in time.
- // Therefore, if we wait a bit longer than necessary that won't translate to a noticeable
- // difference in the experience. However, waiting for longer might mean that we can avoid
- // showing an intermediate loading state. The longer we have already waited, the harder it
- // is to tell small differences in time. Therefore, the longer we've already waited,
- // the longer we can wait additionally. At some point we have to give up though.
- // We pick a train model where the next boundary commits at a consistent schedule.
- // These particular numbers are vague estimates. We expect to adjust them based on research.
-
- function jnd(timeElapsed) {
- return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960;
- }
-
- function computeMsUntilSuspenseLoadingDelay(mostRecentEventTime, committedExpirationTime, suspenseConfig) {
- var busyMinDurationMs = suspenseConfig.busyMinDurationMs | 0;
-
- if (busyMinDurationMs <= 0) {
- return 0;
- }
-
- var busyDelayMs = suspenseConfig.busyDelayMs | 0; // Compute the time until this render pass would expire.
-
- var currentTimeMs = now();
- var eventTimeMs = inferTimeFromExpirationTimeWithSuspenseConfig(mostRecentEventTime, suspenseConfig);
- var timeElapsed = currentTimeMs - eventTimeMs;
-
- if (timeElapsed <= busyDelayMs) {
- // If we haven't yet waited longer than the initial delay, we don't
- // have to wait any additional time.
- return 0;
- }
-
- var msUntilTimeout = busyDelayMs + busyMinDurationMs - timeElapsed; // This is the value that is passed to `setTimeout`.
-
- return msUntilTimeout;
- }
-
- function checkForNestedUpdates() {
- if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
- nestedUpdateCount = 0;
- rootWithNestedUpdates = null;
-
- {
- {
- throw Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");
- }
- }
- }
-
- {
- if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) {
- nestedPassiveUpdateCount = 0;
- warning$1(false, 'Maximum update depth exceeded. This can happen when a component ' + "calls setState inside useEffect, but useEffect either doesn't " + 'have a dependency array, or one of the dependencies changes on ' + 'every render.');
- }
- }
- }
-
- function flushRenderPhaseStrictModeWarningsInDEV() {
- {
- ReactStrictModeWarnings.flushLegacyContextWarning();
-
- if (warnAboutDeprecatedLifecycles) {
- ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
- }
- }
- }
-
- function stopFinishedWorkLoopTimer() {
- var didCompleteRoot = true;
- stopWorkLoopTimer(interruptedBy, didCompleteRoot);
- interruptedBy = null;
- }
-
- function stopInterruptedWorkLoopTimer() {
- // TODO: Track which fiber caused the interruption.
- var didCompleteRoot = false;
- stopWorkLoopTimer(interruptedBy, didCompleteRoot);
- interruptedBy = null;
- }
-
- function checkForInterruption(fiberThatReceivedUpdate, updateExpirationTime) {
- if (enableUserTimingAPI && workInProgressRoot !== null && updateExpirationTime > renderExpirationTime) {
- interruptedBy = fiberThatReceivedUpdate;
- }
- }
-
- var didWarnStateUpdateForUnmountedComponent = null;
-
- function warnAboutUpdateOnUnmountedFiberInDEV(fiber) {
- {
- var tag = fiber.tag;
-
- if (tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent) {
- // Only warn for user-defined components, not internal ones like Suspense.
- return;
- } // We show the whole stack but dedupe on the top component's name because
- // the problematic code almost always lies inside that component.
-
-
- var componentName = getComponentName(fiber.type) || 'ReactComponent';
-
- if (didWarnStateUpdateForUnmountedComponent !== null) {
- if (didWarnStateUpdateForUnmountedComponent.has(componentName)) {
- return;
- }
-
- didWarnStateUpdateForUnmountedComponent.add(componentName);
- } else {
- didWarnStateUpdateForUnmountedComponent = new Set([componentName]);
- }
-
- warningWithoutStack$1(false, "Can't perform a React state update on an unmounted component. This " + 'is a no-op, but it indicates a memory leak in your application. To ' + 'fix, cancel all subscriptions and asynchronous tasks in %s.%s', tag === ClassComponent ? 'the componentWillUnmount method' : 'a useEffect cleanup function', getStackByFiberInDevAndProd(fiber));
- }
- }
-
- var beginWork$$1;
-
- if ( true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
- var dummyFiber = null;
-
- beginWork$$1 = function (current$$1, unitOfWork, expirationTime) {
- // If a component throws an error, we replay it again in a synchronously
- // dispatched event, so that the debugger will treat it as an uncaught
- // error See ReactErrorUtils for more information.
- // Before entering the begin phase, copy the work-in-progress onto a dummy
- // fiber. If beginWork throws, we'll use this to reset the state.
- var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);
-
- try {
- return beginWork$1(current$$1, unitOfWork, expirationTime);
- } catch (originalError) {
- if (originalError !== null && typeof originalError === 'object' && typeof originalError.then === 'function') {
- // Don't replay promises. Treat everything else like an error.
- throw originalError;
- } // Keep this code in sync with handleError; any changes here must have
- // corresponding changes there.
-
-
- resetContextDependencies();
- resetHooks(); // Don't reset current debug fiber, since we're about to work on the
- // same fiber again.
- // Unwind the failed stack frame
-
- unwindInterruptedWork(unitOfWork); // Restore the original properties of the fiber.
-
- assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);
-
- if (enableProfilerTimer && unitOfWork.mode & ProfileMode) {
- // Reset the profiler timer.
- startProfilerTimer(unitOfWork);
- } // Run beginWork again.
-
-
- invokeGuardedCallback(null, beginWork$1, null, current$$1, unitOfWork, expirationTime);
-
- if (hasCaughtError()) {
- var replayError = clearCaughtError(); // `invokeGuardedCallback` sometimes sets an expando `_suppressLogging`.
- // Rethrow this error instead of the original one.
-
- throw replayError;
- } else {
- // This branch is reachable if the render phase is impure.
- throw originalError;
- }
- }
- };
- } else {
- beginWork$$1 = beginWork$1;
- }
-
- var didWarnAboutUpdateInRender = false;
- var didWarnAboutUpdateInGetChildContext = false;
-
- function warnAboutInvalidUpdatesOnClassComponentsInDEV(fiber) {
- {
- if (fiber.tag === ClassComponent) {
- switch (phase) {
- case 'getChildContext':
- if (didWarnAboutUpdateInGetChildContext) {
- return;
- }
-
- warningWithoutStack$1(false, 'setState(...): Cannot call setState() inside getChildContext()');
- didWarnAboutUpdateInGetChildContext = true;
- break;
-
- case 'render':
- if (didWarnAboutUpdateInRender) {
- return;
- }
-
- warningWithoutStack$1(false, 'Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure function of ' + 'props and state.');
- didWarnAboutUpdateInRender = true;
- break;
- }
- }
- }
- } // a 'shared' variable that changes when act() opens/closes in tests.
-
-
- var IsThisRendererActing = {
- current: false
- };
- function warnIfNotScopedWithMatchingAct(fiber) {
- {
- if (warnsIfNotActing === true && IsSomeRendererActing.current === true && IsThisRendererActing.current !== true) {
- warningWithoutStack$1(false, "It looks like you're using the wrong act() around your test interactions.\n" + 'Be sure to use the matching version of act() corresponding to your renderer:\n\n' + '// for react-dom:\n' + "import {act} from 'react-dom/test-utils';\n" + '// ...\n' + 'act(() => ...);\n\n' + '// for react-test-renderer:\n' + "import TestRenderer from 'react-test-renderer';\n" + 'const {act} = TestRenderer;\n' + '// ...\n' + 'act(() => ...);' + '%s', getStackByFiberInDevAndProd(fiber));
- }
- }
- }
- function warnIfNotCurrentlyActingEffectsInDEV(fiber) {
- {
- if (warnsIfNotActing === true && (fiber.mode & StrictMode) !== NoMode && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
- warningWithoutStack$1(false, 'An update to %s ran an effect, but was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\n\n' + 'act(() => {\n' + ' /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));
- }
- }
- }
-
- function warnIfNotCurrentlyActingUpdatesInDEV(fiber) {
- {
- if (warnsIfNotActing === true && executionContext === NoContext && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {
- warningWithoutStack$1(false, 'An update to %s inside a test was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\n\n' + 'act(() => {\n' + ' /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));
- }
- }
- }
-
- var warnIfNotCurrentlyActingUpdatesInDev = warnIfNotCurrentlyActingUpdatesInDEV; // In tests, we want to enforce a mocked scheduler.
-
- var didWarnAboutUnmockedScheduler = false; // TODO Before we release concurrent mode, revisit this and decide whether a mocked
- // scheduler is the actual recommendation. The alternative could be a testing build,
- // a new lib, or whatever; we dunno just yet. This message is for early adopters
- // to get their tests right.
-
- function warnIfUnmockedScheduler(fiber) {
- {
- if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {
- if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {
- didWarnAboutUnmockedScheduler = true;
- warningWithoutStack$1(false, 'In Concurrent or Sync modes, the "scheduler" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \n' + "jest.mock('scheduler', () => require('scheduler/unstable_mock'));\n\n" + 'For more info, visit https://fb.me/react-mock-scheduler');
- } else if (warnAboutUnmockedScheduler === true) {
- didWarnAboutUnmockedScheduler = true;
- warningWithoutStack$1(false, 'Starting from React v17, the "scheduler" module will need to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \n' + "jest.mock('scheduler', () => require('scheduler/unstable_mock'));\n\n" + 'For more info, visit https://fb.me/react-mock-scheduler');
- }
- }
- }
- }
- var componentsThatTriggeredHighPriSuspend = null;
- function checkForWrongSuspensePriorityInDEV(sourceFiber) {
- {
- var currentPriorityLevel = getCurrentPriorityLevel();
-
- if ((sourceFiber.mode & ConcurrentMode) !== NoEffect && (currentPriorityLevel === UserBlockingPriority$2 || currentPriorityLevel === ImmediatePriority)) {
- var workInProgressNode = sourceFiber;
-
- while (workInProgressNode !== null) {
- // Add the component that triggered the suspense
- var current$$1 = workInProgressNode.alternate;
-
- if (current$$1 !== null) {
- // TODO: warn component that triggers the high priority
- // suspend is the HostRoot
- switch (workInProgressNode.tag) {
- case ClassComponent:
- // Loop through the component's update queue and see whether the component
- // has triggered any high priority updates
- var updateQueue = current$$1.updateQueue;
-
- if (updateQueue !== null) {
- var update = updateQueue.firstUpdate;
-
- while (update !== null) {
- var priorityLevel = update.priority;
-
- if (priorityLevel === UserBlockingPriority$2 || priorityLevel === ImmediatePriority) {
- if (componentsThatTriggeredHighPriSuspend === null) {
- componentsThatTriggeredHighPriSuspend = new Set([getComponentName(workInProgressNode.type)]);
- } else {
- componentsThatTriggeredHighPriSuspend.add(getComponentName(workInProgressNode.type));
- }
-
- break;
- }
-
- update = update.next;
- }
- }
-
- break;
-
- case FunctionComponent:
- case ForwardRef:
- case SimpleMemoComponent:
- if (workInProgressNode.memoizedState !== null && workInProgressNode.memoizedState.baseUpdate !== null) {
- var _update = workInProgressNode.memoizedState.baseUpdate; // Loop through the functional component's memoized state to see whether
- // the component has triggered any high pri updates
-
- while (_update !== null) {
- var priority = _update.priority;
-
- if (priority === UserBlockingPriority$2 || priority === ImmediatePriority) {
- if (componentsThatTriggeredHighPriSuspend === null) {
- componentsThatTriggeredHighPriSuspend = new Set([getComponentName(workInProgressNode.type)]);
- } else {
- componentsThatTriggeredHighPriSuspend.add(getComponentName(workInProgressNode.type));
- }
-
- break;
- }
-
- if (_update.next === workInProgressNode.memoizedState.baseUpdate) {
- break;
- }
-
- _update = _update.next;
- }
- }
-
- break;
-
- default:
- break;
- }
- }
-
- workInProgressNode = workInProgressNode.return;
- }
- }
- }
- }
-
- function flushSuspensePriorityWarningInDEV() {
- {
- if (componentsThatTriggeredHighPriSuspend !== null) {
- var componentNames = [];
- componentsThatTriggeredHighPriSuspend.forEach(function (name) {
- return componentNames.push(name);
- });
- componentsThatTriggeredHighPriSuspend = null;
-
- if (componentNames.length > 0) {
- warningWithoutStack$1(false, '%s triggered a user-blocking update that suspended.' + '\n\n' + 'The fix is to split the update into multiple parts: a user-blocking ' + 'update to provide immediate feedback, and another update that ' + 'triggers the bulk of the changes.' + '\n\n' + 'Refer to the documentation for useTransition to learn how ' + 'to implement this pattern.', // TODO: Add link to React docs with more information, once it exists
- componentNames.sort().join(', '));
- }
- }
- }
- }
-
- function computeThreadID(root, expirationTime) {
- // Interaction threads are unique per root and expiration time.
- return expirationTime * 1000 + root.interactionThreadID;
- }
-
- function markSpawnedWork(expirationTime) {
- if (!enableSchedulerTracing) {
- return;
- }
-
- if (spawnedWorkDuringRender === null) {
- spawnedWorkDuringRender = [expirationTime];
- } else {
- spawnedWorkDuringRender.push(expirationTime);
- }
- }
-
- function scheduleInteractions(root, expirationTime, interactions) {
- if (!enableSchedulerTracing) {
- return;
- }
-
- if (interactions.size > 0) {
- var pendingInteractionMap = root.pendingInteractionMap;
- var pendingInteractions = pendingInteractionMap.get(expirationTime);
-
- if (pendingInteractions != null) {
- interactions.forEach(function (interaction) {
- if (!pendingInteractions.has(interaction)) {
- // Update the pending async work count for previously unscheduled interaction.
- interaction.__count++;
- }
-
- pendingInteractions.add(interaction);
- });
- } else {
- pendingInteractionMap.set(expirationTime, new Set(interactions)); // Update the pending async work count for the current interactions.
-
- interactions.forEach(function (interaction) {
- interaction.__count++;
- });
- }
-
- var subscriber = tracing.__subscriberRef.current;
-
- if (subscriber !== null) {
- var threadID = computeThreadID(root, expirationTime);
- subscriber.onWorkScheduled(interactions, threadID);
- }
- }
- }
-
- function schedulePendingInteractions(root, expirationTime) {
- // This is called when work is scheduled on a root.
- // It associates the current interactions with the newly-scheduled expiration.
- // They will be restored when that expiration is later committed.
- if (!enableSchedulerTracing) {
- return;
- }
-
- scheduleInteractions(root, expirationTime, tracing.__interactionsRef.current);
- }
-
- function startWorkOnPendingInteractions(root, expirationTime) {
- // This is called when new work is started on a root.
- if (!enableSchedulerTracing) {
- return;
- } // Determine which interactions this batch of work currently includes, So that
- // we can accurately attribute time spent working on it, And so that cascading
- // work triggered during the render phase will be associated with it.
-
-
- var interactions = new Set();
- root.pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {
- if (scheduledExpirationTime >= expirationTime) {
- scheduledInteractions.forEach(function (interaction) {
- return interactions.add(interaction);
- });
- }
- }); // Store the current set of interactions on the FiberRoot for a few reasons:
- // We can re-use it in hot functions like performConcurrentWorkOnRoot()
- // without having to recalculate it. We will also use it in commitWork() to
- // pass to any Profiler onRender() hooks. This also provides DevTools with a
- // way to access it when the onCommitRoot() hook is called.
-
- root.memoizedInteractions = interactions;
-
- if (interactions.size > 0) {
- var subscriber = tracing.__subscriberRef.current;
-
- if (subscriber !== null) {
- var threadID = computeThreadID(root, expirationTime);
-
- try {
- subscriber.onWorkStarted(interactions, threadID);
- } catch (error) {
- // If the subscriber throws, rethrow it in a separate task
- scheduleCallback(ImmediatePriority, function () {
- throw error;
- });
- }
- }
- }
- }
-
- function finishPendingInteractions(root, committedExpirationTime) {
- if (!enableSchedulerTracing) {
- return;
- }
-
- var earliestRemainingTimeAfterCommit = root.firstPendingTime;
- var subscriber;
-
- try {
- subscriber = tracing.__subscriberRef.current;
-
- if (subscriber !== null && root.memoizedInteractions.size > 0) {
- var threadID = computeThreadID(root, committedExpirationTime);
- subscriber.onWorkStopped(root.memoizedInteractions, threadID);
- }
- } catch (error) {
- // If the subscriber throws, rethrow it in a separate task
- scheduleCallback(ImmediatePriority, function () {
- throw error;
- });
- } finally {
- // Clear completed interactions from the pending Map.
- // Unless the render was suspended or cascading work was scheduled,
- // In which case– leave pending interactions until the subsequent render.
- var pendingInteractionMap = root.pendingInteractionMap;
- pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {
- // Only decrement the pending interaction count if we're done.
- // If there's still work at the current priority,
- // That indicates that we are waiting for suspense data.
- if (scheduledExpirationTime > earliestRemainingTimeAfterCommit) {
- pendingInteractionMap.delete(scheduledExpirationTime);
- scheduledInteractions.forEach(function (interaction) {
- interaction.__count--;
-
- if (subscriber !== null && interaction.__count === 0) {
- try {
- subscriber.onInteractionScheduledWorkCompleted(interaction);
- } catch (error) {
- // If the subscriber throws, rethrow it in a separate task
- scheduleCallback(ImmediatePriority, function () {
- throw error;
- });
- }
- }
- });
- }
- });
- }
- }
-
- var onCommitFiberRoot = null;
- var onCommitFiberUnmount = null;
- var hasLoggedError = false;
- var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined';
- function injectInternals(internals) {
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
- // No DevTools
- return false;
- }
-
- var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
-
- if (hook.isDisabled) {
- // This isn't a real property on the hook, but it can be set to opt out
- // of DevTools integration and associated warnings and logs.
- // https://github.com/facebook/react/issues/3877
- return true;
- }
-
- if (!hook.supportsFiber) {
- {
- warningWithoutStack$1(false, 'The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://fb.me/react-devtools');
- } // DevTools exists, even though it doesn't support Fiber.
-
-
- return true;
- }
-
- try {
- var rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks.
-
- onCommitFiberRoot = function (root, expirationTime) {
- try {
- var didError = (root.current.effectTag & DidCapture) === DidCapture;
-
- if (enableProfilerTimer) {
- var currentTime = getCurrentTime();
- var priorityLevel = inferPriorityFromExpirationTime(currentTime, expirationTime);
- hook.onCommitFiberRoot(rendererID, root, priorityLevel, didError);
- } else {
- hook.onCommitFiberRoot(rendererID, root, undefined, didError);
- }
- } catch (err) {
- if ( true && !hasLoggedError) {
- hasLoggedError = true;
- warningWithoutStack$1(false, 'React DevTools encountered an error: %s', err);
- }
- }
- };
-
- onCommitFiberUnmount = function (fiber) {
- try {
- hook.onCommitFiberUnmount(rendererID, fiber);
- } catch (err) {
- if ( true && !hasLoggedError) {
- hasLoggedError = true;
- warningWithoutStack$1(false, 'React DevTools encountered an error: %s', err);
- }
- }
- };
- } catch (err) {
- // Catch all errors because it is unsafe to throw during initialization.
- {
- warningWithoutStack$1(false, 'React DevTools encountered an error: %s.', err);
- }
- } // DevTools exists
-
-
- return true;
- }
- function onCommitRoot(root, expirationTime) {
- if (typeof onCommitFiberRoot === 'function') {
- onCommitFiberRoot(root, expirationTime);
- }
- }
- function onCommitUnmount(fiber) {
- if (typeof onCommitFiberUnmount === 'function') {
- onCommitFiberUnmount(fiber);
- }
- }
-
- var hasBadMapPolyfill;
-
- {
- hasBadMapPolyfill = false;
-
- try {
- var nonExtensibleObject = Object.preventExtensions({});
- var testMap = new Map([[nonExtensibleObject, null]]);
- var testSet = new Set([nonExtensibleObject]); // This is necessary for Rollup to not consider these unused.
- // https://github.com/rollup/rollup/issues/1771
- // TODO: we can remove these if Rollup fixes the bug.
-
- testMap.set(0, 0);
- testSet.add(0);
- } catch (e) {
- // TODO: Consider warning about bad polyfills
- hasBadMapPolyfill = true;
- }
- }
-
- var debugCounter = 1;
-
- function FiberNode(tag, pendingProps, key, mode) {
- // Instance
- this.tag = tag;
- this.key = key;
- this.elementType = null;
- this.type = null;
- this.stateNode = null; // Fiber
-
- this.return = null;
- this.child = null;
- this.sibling = null;
- this.index = 0;
- this.ref = null;
- this.pendingProps = pendingProps;
- this.memoizedProps = null;
- this.updateQueue = null;
- this.memoizedState = null;
- this.dependencies = null;
- this.mode = mode; // Effects
-
- this.effectTag = NoEffect;
- this.nextEffect = null;
- this.firstEffect = null;
- this.lastEffect = null;
- this.expirationTime = NoWork;
- this.childExpirationTime = NoWork;
- this.alternate = null;
-
- if (enableProfilerTimer) {
- // Note: The following is done to avoid a v8 performance cliff.
- //
- // Initializing the fields below to smis and later updating them with
- // double values will cause Fibers to end up having separate shapes.
- // This behavior/bug has something to do with Object.preventExtension().
- // Fortunately this only impacts DEV builds.
- // Unfortunately it makes React unusably slow for some applications.
- // To work around this, initialize the fields below with doubles.
- //
- // Learn more about this here:
- // https://github.com/facebook/react/issues/14365
- // https://bugs.chromium.org/p/v8/issues/detail?id=8538
- this.actualDuration = Number.NaN;
- this.actualStartTime = Number.NaN;
- this.selfBaseDuration = Number.NaN;
- this.treeBaseDuration = Number.NaN; // It's okay to replace the initial doubles with smis after initialization.
- // This won't trigger the performance cliff mentioned above,
- // and it simplifies other profiler code (including DevTools).
-
- this.actualDuration = 0;
- this.actualStartTime = -1;
- this.selfBaseDuration = 0;
- this.treeBaseDuration = 0;
- } // This is normally DEV-only except www when it adds listeners.
- // TODO: remove the User Timing integration in favor of Root Events.
-
-
- if (enableUserTimingAPI) {
- this._debugID = debugCounter++;
- this._debugIsCurrentlyTiming = false;
- }
-
- {
- this._debugSource = null;
- this._debugOwner = null;
- this._debugNeedsRemount = false;
- this._debugHookTypes = null;
-
- if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
- Object.preventExtensions(this);
- }
- }
- } // This is a constructor function, rather than a POJO constructor, still
- // please ensure we do the following:
- // 1) Nobody should add any instance methods on this. Instance methods can be
- // more difficult to predict when they get optimized and they are almost
- // never inlined properly in static compilers.
- // 2) Nobody should rely on `instanceof Fiber` for type testing. We should
- // always know when it is a fiber.
- // 3) We might want to experiment with using numeric keys since they are easier
- // to optimize in a non-JIT environment.
- // 4) We can easily go from a constructor to a createFiber object literal if that
- // is faster.
- // 5) It should be easy to port this to a C struct and keep a C implementation
- // compatible.
-
-
- var createFiber = function (tag, pendingProps, key, mode) {
- // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors
- return new FiberNode(tag, pendingProps, key, mode);
- };
-
- function shouldConstruct(Component) {
- var prototype = Component.prototype;
- return !!(prototype && prototype.isReactComponent);
- }
-
- function isSimpleFunctionComponent(type) {
- return typeof type === 'function' && !shouldConstruct(type) && type.defaultProps === undefined;
- }
- function resolveLazyComponentTag(Component) {
- if (typeof Component === 'function') {
- return shouldConstruct(Component) ? ClassComponent : FunctionComponent;
- } else if (Component !== undefined && Component !== null) {
- var $$typeof = Component.$$typeof;
-
- if ($$typeof === REACT_FORWARD_REF_TYPE) {
- return ForwardRef;
- }
-
- if ($$typeof === REACT_MEMO_TYPE) {
- return MemoComponent;
- }
- }
-
- return IndeterminateComponent;
- } // This is used to create an alternate fiber to do work on.
-
- function createWorkInProgress(current, pendingProps, expirationTime) {
- var workInProgress = current.alternate;
-
- if (workInProgress === null) {
- // We use a double buffering pooling technique because we know that we'll
- // only ever need at most two versions of a tree. We pool the "other" unused
- // node that we're free to reuse. This is lazily created to avoid allocating
- // extra objects for things that are never updated. It also allow us to
- // reclaim the extra memory if needed.
- workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode);
- workInProgress.elementType = current.elementType;
- workInProgress.type = current.type;
- workInProgress.stateNode = current.stateNode;
-
- {
- // DEV-only fields
- workInProgress._debugID = current._debugID;
- workInProgress._debugSource = current._debugSource;
- workInProgress._debugOwner = current._debugOwner;
- workInProgress._debugHookTypes = current._debugHookTypes;
- }
-
- workInProgress.alternate = current;
- current.alternate = workInProgress;
- } else {
- workInProgress.pendingProps = pendingProps; // We already have an alternate.
- // Reset the effect tag.
-
- workInProgress.effectTag = NoEffect; // The effect list is no longer valid.
-
- workInProgress.nextEffect = null;
- workInProgress.firstEffect = null;
- workInProgress.lastEffect = null;
-
- if (enableProfilerTimer) {
- // We intentionally reset, rather than copy, actualDuration & actualStartTime.
- // This prevents time from endlessly accumulating in new commits.
- // This has the downside of resetting values for different priority renders,
- // But works for yielding (the common case) and should support resuming.
- workInProgress.actualDuration = 0;
- workInProgress.actualStartTime = -1;
- }
- }
-
- workInProgress.childExpirationTime = current.childExpirationTime;
- workInProgress.expirationTime = current.expirationTime;
- workInProgress.child = current.child;
- workInProgress.memoizedProps = current.memoizedProps;
- workInProgress.memoizedState = current.memoizedState;
- workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so
- // it cannot be shared with the current fiber.
-
- var currentDependencies = current.dependencies;
- workInProgress.dependencies = currentDependencies === null ? null : {
- expirationTime: currentDependencies.expirationTime,
- firstContext: currentDependencies.firstContext,
- responders: currentDependencies.responders
- }; // These will be overridden during the parent's reconciliation
-
- workInProgress.sibling = current.sibling;
- workInProgress.index = current.index;
- workInProgress.ref = current.ref;
-
- if (enableProfilerTimer) {
- workInProgress.selfBaseDuration = current.selfBaseDuration;
- workInProgress.treeBaseDuration = current.treeBaseDuration;
- }
-
- {
- workInProgress._debugNeedsRemount = current._debugNeedsRemount;
-
- switch (workInProgress.tag) {
- case IndeterminateComponent:
- case FunctionComponent:
- case SimpleMemoComponent:
- workInProgress.type = resolveFunctionForHotReloading(current.type);
- break;
-
- case ClassComponent:
- workInProgress.type = resolveClassForHotReloading(current.type);
- break;
-
- case ForwardRef:
- workInProgress.type = resolveForwardRefForHotReloading(current.type);
- break;
-
- default:
- break;
- }
- }
-
- return workInProgress;
- } // Used to reuse a Fiber for a second pass.
-
- function resetWorkInProgress(workInProgress, renderExpirationTime) {
- // This resets the Fiber to what createFiber or createWorkInProgress would
- // have set the values to before during the first pass. Ideally this wouldn't
- // be necessary but unfortunately many code paths reads from the workInProgress
- // when they should be reading from current and writing to workInProgress.
- // We assume pendingProps, index, key, ref, return are still untouched to
- // avoid doing another reconciliation.
- // Reset the effect tag but keep any Placement tags, since that's something
- // that child fiber is setting, not the reconciliation.
- workInProgress.effectTag &= Placement; // The effect list is no longer valid.
-
- workInProgress.nextEffect = null;
- workInProgress.firstEffect = null;
- workInProgress.lastEffect = null;
- var current = workInProgress.alternate;
-
- if (current === null) {
- // Reset to createFiber's initial values.
- workInProgress.childExpirationTime = NoWork;
- workInProgress.expirationTime = renderExpirationTime;
- workInProgress.child = null;
- workInProgress.memoizedProps = null;
- workInProgress.memoizedState = null;
- workInProgress.updateQueue = null;
- workInProgress.dependencies = null;
-
- if (enableProfilerTimer) {
- // Note: We don't reset the actualTime counts. It's useful to accumulate
- // actual time across multiple render passes.
- workInProgress.selfBaseDuration = 0;
- workInProgress.treeBaseDuration = 0;
- }
- } else {
- // Reset to the cloned values that createWorkInProgress would've.
- workInProgress.childExpirationTime = current.childExpirationTime;
- workInProgress.expirationTime = current.expirationTime;
- workInProgress.child = current.child;
- workInProgress.memoizedProps = current.memoizedProps;
- workInProgress.memoizedState = current.memoizedState;
- workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so
- // it cannot be shared with the current fiber.
-
- var currentDependencies = current.dependencies;
- workInProgress.dependencies = currentDependencies === null ? null : {
- expirationTime: currentDependencies.expirationTime,
- firstContext: currentDependencies.firstContext,
- responders: currentDependencies.responders
- };
-
- if (enableProfilerTimer) {
- // Note: We don't reset the actualTime counts. It's useful to accumulate
- // actual time across multiple render passes.
- workInProgress.selfBaseDuration = current.selfBaseDuration;
- workInProgress.treeBaseDuration = current.treeBaseDuration;
- }
- }
-
- return workInProgress;
- }
- function createHostRootFiber(tag) {
- var mode;
-
- if (tag === ConcurrentRoot) {
- mode = ConcurrentMode | BlockingMode | StrictMode;
- } else if (tag === BlockingRoot) {
- mode = BlockingMode | StrictMode;
- } else {
- mode = NoMode;
- }
-
- if (enableProfilerTimer && isDevToolsPresent) {
- // Always collect profile timings when DevTools are present.
- // This enables DevTools to start capturing timing at any point–
- // Without some nodes in the tree having empty base times.
- mode |= ProfileMode;
- }
-
- return createFiber(HostRoot, null, null, mode);
- }
- function createFiberFromTypeAndProps(type, // React$ElementType
- key, pendingProps, owner, mode, expirationTime) {
- var fiber;
- var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy.
-
- var resolvedType = type;
-
- if (typeof type === 'function') {
- if (shouldConstruct(type)) {
- fiberTag = ClassComponent;
-
- {
- resolvedType = resolveClassForHotReloading(resolvedType);
- }
- } else {
- {
- resolvedType = resolveFunctionForHotReloading(resolvedType);
- }
- }
- } else if (typeof type === 'string') {
- fiberTag = HostComponent;
- } else {
- getTag: switch (type) {
- case REACT_FRAGMENT_TYPE:
- return createFiberFromFragment(pendingProps.children, mode, expirationTime, key);
-
- case REACT_CONCURRENT_MODE_TYPE:
- fiberTag = Mode;
- mode |= ConcurrentMode | BlockingMode | StrictMode;
- break;
-
- case REACT_STRICT_MODE_TYPE:
- fiberTag = Mode;
- mode |= StrictMode;
- break;
-
- case REACT_PROFILER_TYPE:
- return createFiberFromProfiler(pendingProps, mode, expirationTime, key);
-
- case REACT_SUSPENSE_TYPE:
- return createFiberFromSuspense(pendingProps, mode, expirationTime, key);
-
- case REACT_SUSPENSE_LIST_TYPE:
- return createFiberFromSuspenseList(pendingProps, mode, expirationTime, key);
-
- default:
- {
- if (typeof type === 'object' && type !== null) {
- switch (type.$$typeof) {
- case REACT_PROVIDER_TYPE:
- fiberTag = ContextProvider;
- break getTag;
-
- case REACT_CONTEXT_TYPE:
- // This is a consumer
- fiberTag = ContextConsumer;
- break getTag;
-
- case REACT_FORWARD_REF_TYPE:
- fiberTag = ForwardRef;
-
- {
- resolvedType = resolveForwardRefForHotReloading(resolvedType);
- }
-
- break getTag;
-
- case REACT_MEMO_TYPE:
- fiberTag = MemoComponent;
- break getTag;
-
- case REACT_LAZY_TYPE:
- fiberTag = LazyComponent;
- resolvedType = null;
- break getTag;
-
- case REACT_FUNDAMENTAL_TYPE:
- if (enableFundamentalAPI) {
- return createFiberFromFundamental(type, pendingProps, mode, expirationTime, key);
- }
-
- break;
-
- case REACT_SCOPE_TYPE:
- if (enableScopeAPI) {
- return createFiberFromScope(type, pendingProps, mode, expirationTime, key);
- }
-
- }
- }
-
- var info = '';
-
- {
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
- info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and " + 'named imports.';
- }
-
- var ownerName = owner ? getComponentName(owner.type) : null;
-
- if (ownerName) {
- info += '\n\nCheck the render method of `' + ownerName + '`.';
- }
- }
-
- {
- {
- throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (type == null ? type : typeof type) + "." + info);
- }
- }
- }
- }
- }
-
- fiber = createFiber(fiberTag, pendingProps, key, mode);
- fiber.elementType = type;
- fiber.type = resolvedType;
- fiber.expirationTime = expirationTime;
- return fiber;
- }
- function createFiberFromElement(element, mode, expirationTime) {
- var owner = null;
-
- {
- owner = element._owner;
- }
-
- var type = element.type;
- var key = element.key;
- var pendingProps = element.props;
- var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, expirationTime);
-
- {
- fiber._debugSource = element._source;
- fiber._debugOwner = element._owner;
- }
-
- return fiber;
- }
- function createFiberFromFragment(elements, mode, expirationTime, key) {
- var fiber = createFiber(Fragment, elements, key, mode);
- fiber.expirationTime = expirationTime;
- return fiber;
- }
- function createFiberFromFundamental(fundamentalComponent, pendingProps, mode, expirationTime, key) {
- var fiber = createFiber(FundamentalComponent, pendingProps, key, mode);
- fiber.elementType = fundamentalComponent;
- fiber.type = fundamentalComponent;
- fiber.expirationTime = expirationTime;
- return fiber;
- }
-
- function createFiberFromScope(scope, pendingProps, mode, expirationTime, key) {
- var fiber = createFiber(ScopeComponent, pendingProps, key, mode);
- fiber.type = scope;
- fiber.elementType = scope;
- fiber.expirationTime = expirationTime;
- return fiber;
- }
-
- function createFiberFromProfiler(pendingProps, mode, expirationTime, key) {
- {
- if (typeof pendingProps.id !== 'string' || typeof pendingProps.onRender !== 'function') {
- warningWithoutStack$1(false, 'Profiler must specify an "id" string and "onRender" function as props');
- }
- }
-
- var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode); // TODO: The Profiler fiber shouldn't have a type. It has a tag.
-
- fiber.elementType = REACT_PROFILER_TYPE;
- fiber.type = REACT_PROFILER_TYPE;
- fiber.expirationTime = expirationTime;
- return fiber;
- }
-
- function createFiberFromSuspense(pendingProps, mode, expirationTime, key) {
- var fiber = createFiber(SuspenseComponent, pendingProps, key, mode); // TODO: The SuspenseComponent fiber shouldn't have a type. It has a tag.
- // This needs to be fixed in getComponentName so that it relies on the tag
- // instead.
-
- fiber.type = REACT_SUSPENSE_TYPE;
- fiber.elementType = REACT_SUSPENSE_TYPE;
- fiber.expirationTime = expirationTime;
- return fiber;
- }
- function createFiberFromSuspenseList(pendingProps, mode, expirationTime, key) {
- var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);
-
- {
- // TODO: The SuspenseListComponent fiber shouldn't have a type. It has a tag.
- // This needs to be fixed in getComponentName so that it relies on the tag
- // instead.
- fiber.type = REACT_SUSPENSE_LIST_TYPE;
- }
-
- fiber.elementType = REACT_SUSPENSE_LIST_TYPE;
- fiber.expirationTime = expirationTime;
- return fiber;
- }
- function createFiberFromText(content, mode, expirationTime) {
- var fiber = createFiber(HostText, content, null, mode);
- fiber.expirationTime = expirationTime;
- return fiber;
- }
- function createFiberFromHostInstanceForDeletion() {
- var fiber = createFiber(HostComponent, null, null, NoMode); // TODO: These should not need a type.
-
- fiber.elementType = 'DELETED';
- fiber.type = 'DELETED';
- return fiber;
- }
- function createFiberFromDehydratedFragment(dehydratedNode) {
- var fiber = createFiber(DehydratedFragment, null, null, NoMode);
- fiber.stateNode = dehydratedNode;
- return fiber;
- }
- function createFiberFromPortal(portal, mode, expirationTime) {
- var pendingProps = portal.children !== null ? portal.children : [];
- var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);
- fiber.expirationTime = expirationTime;
- fiber.stateNode = {
- containerInfo: portal.containerInfo,
- pendingChildren: null,
- // Used by persistent updates
- implementation: portal.implementation
- };
- return fiber;
- } // Used for stashing WIP properties to replay failed work in DEV.
-
- function assignFiberPropertiesInDEV(target, source) {
- if (target === null) {
- // This Fiber's initial properties will always be overwritten.
- // We only use a Fiber to ensure the same hidden class so DEV isn't slow.
- target = createFiber(IndeterminateComponent, null, null, NoMode);
- } // This is intentionally written as a list of all properties.
- // We tried to use Object.assign() instead but this is called in
- // the hottest path, and Object.assign() was too slow:
- // https://github.com/facebook/react/issues/12502
- // This code is DEV-only so size is not a concern.
-
-
- target.tag = source.tag;
- target.key = source.key;
- target.elementType = source.elementType;
- target.type = source.type;
- target.stateNode = source.stateNode;
- target.return = source.return;
- target.child = source.child;
- target.sibling = source.sibling;
- target.index = source.index;
- target.ref = source.ref;
- target.pendingProps = source.pendingProps;
- target.memoizedProps = source.memoizedProps;
- target.updateQueue = source.updateQueue;
- target.memoizedState = source.memoizedState;
- target.dependencies = source.dependencies;
- target.mode = source.mode;
- target.effectTag = source.effectTag;
- target.nextEffect = source.nextEffect;
- target.firstEffect = source.firstEffect;
- target.lastEffect = source.lastEffect;
- target.expirationTime = source.expirationTime;
- target.childExpirationTime = source.childExpirationTime;
- target.alternate = source.alternate;
-
- if (enableProfilerTimer) {
- target.actualDuration = source.actualDuration;
- target.actualStartTime = source.actualStartTime;
- target.selfBaseDuration = source.selfBaseDuration;
- target.treeBaseDuration = source.treeBaseDuration;
- }
-
- target._debugID = source._debugID;
- target._debugSource = source._debugSource;
- target._debugOwner = source._debugOwner;
- target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming;
- target._debugNeedsRemount = source._debugNeedsRemount;
- target._debugHookTypes = source._debugHookTypes;
- return target;
- }
-
- function FiberRootNode(containerInfo, tag, hydrate) {
- this.tag = tag;
- this.current = null;
- this.containerInfo = containerInfo;
- this.pendingChildren = null;
- this.pingCache = null;
- this.finishedExpirationTime = NoWork;
- this.finishedWork = null;
- this.timeoutHandle = noTimeout;
- this.context = null;
- this.pendingContext = null;
- this.hydrate = hydrate;
- this.callbackNode = null;
- this.callbackPriority = NoPriority;
- this.firstPendingTime = NoWork;
- this.firstSuspendedTime = NoWork;
- this.lastSuspendedTime = NoWork;
- this.nextKnownPendingLevel = NoWork;
- this.lastPingedTime = NoWork;
- this.lastExpiredTime = NoWork;
-
- if (enableSchedulerTracing) {
- this.interactionThreadID = tracing.unstable_getThreadID();
- this.memoizedInteractions = new Set();
- this.pendingInteractionMap = new Map();
- }
-
- if (enableSuspenseCallback) {
- this.hydrationCallbacks = null;
- }
- }
-
- function createFiberRoot(containerInfo, tag, hydrate, hydrationCallbacks) {
- var root = new FiberRootNode(containerInfo, tag, hydrate);
-
- if (enableSuspenseCallback) {
- root.hydrationCallbacks = hydrationCallbacks;
- } // Cyclic construction. This cheats the type system right now because
- // stateNode is any.
-
-
- var uninitializedFiber = createHostRootFiber(tag);
- root.current = uninitializedFiber;
- uninitializedFiber.stateNode = root;
- return root;
- }
- function isRootSuspendedAtTime(root, expirationTime) {
- var firstSuspendedTime = root.firstSuspendedTime;
- var lastSuspendedTime = root.lastSuspendedTime;
- return firstSuspendedTime !== NoWork && firstSuspendedTime >= expirationTime && lastSuspendedTime <= expirationTime;
- }
- function markRootSuspendedAtTime(root, expirationTime) {
- var firstSuspendedTime = root.firstSuspendedTime;
- var lastSuspendedTime = root.lastSuspendedTime;
-
- if (firstSuspendedTime < expirationTime) {
- root.firstSuspendedTime = expirationTime;
- }
-
- if (lastSuspendedTime > expirationTime || firstSuspendedTime === NoWork) {
- root.lastSuspendedTime = expirationTime;
- }
-
- if (expirationTime <= root.lastPingedTime) {
- root.lastPingedTime = NoWork;
- }
-
- if (expirationTime <= root.lastExpiredTime) {
- root.lastExpiredTime = NoWork;
- }
- }
- function markRootUpdatedAtTime(root, expirationTime) {
- // Update the range of pending times
- var firstPendingTime = root.firstPendingTime;
-
- if (expirationTime > firstPendingTime) {
- root.firstPendingTime = expirationTime;
- } // Update the range of suspended times. Treat everything lower priority or
- // equal to this update as unsuspended.
-
-
- var firstSuspendedTime = root.firstSuspendedTime;
-
- if (firstSuspendedTime !== NoWork) {
- if (expirationTime >= firstSuspendedTime) {
- // The entire suspended range is now unsuspended.
- root.firstSuspendedTime = root.lastSuspendedTime = root.nextKnownPendingLevel = NoWork;
- } else if (expirationTime >= root.lastSuspendedTime) {
- root.lastSuspendedTime = expirationTime + 1;
- } // This is a pending level. Check if it's higher priority than the next
- // known pending level.
-
-
- if (expirationTime > root.nextKnownPendingLevel) {
- root.nextKnownPendingLevel = expirationTime;
- }
- }
- }
- function markRootFinishedAtTime(root, finishedExpirationTime, remainingExpirationTime) {
- // Update the range of pending times
- root.firstPendingTime = remainingExpirationTime; // Update the range of suspended times. Treat everything higher priority or
- // equal to this update as unsuspended.
-
- if (finishedExpirationTime <= root.lastSuspendedTime) {
- // The entire suspended range is now unsuspended.
- root.firstSuspendedTime = root.lastSuspendedTime = root.nextKnownPendingLevel = NoWork;
- } else if (finishedExpirationTime <= root.firstSuspendedTime) {
- // Part of the suspended range is now unsuspended. Narrow the range to
- // include everything between the unsuspended time (non-inclusive) and the
- // last suspended time.
- root.firstSuspendedTime = finishedExpirationTime - 1;
- }
-
- if (finishedExpirationTime <= root.lastPingedTime) {
- // Clear the pinged time
- root.lastPingedTime = NoWork;
- }
-
- if (finishedExpirationTime <= root.lastExpiredTime) {
- // Clear the expired time
- root.lastExpiredTime = NoWork;
- }
- }
- function markRootExpiredAtTime(root, expirationTime) {
- var lastExpiredTime = root.lastExpiredTime;
-
- if (lastExpiredTime === NoWork || lastExpiredTime > expirationTime) {
- root.lastExpiredTime = expirationTime;
- }
- }
-
- // This lets us hook into Fiber to debug what it's doing.
- // See https://github.com/facebook/react/pull/8033.
- // This is not part of the public API, not even for React DevTools.
- // You may only inject a debugTool if you work on React Fiber itself.
- var ReactFiberInstrumentation = {
- debugTool: null
- };
- var ReactFiberInstrumentation_1 = ReactFiberInstrumentation;
-
- var didWarnAboutNestedUpdates;
- var didWarnAboutFindNodeInStrictMode;
-
- {
- didWarnAboutNestedUpdates = false;
- didWarnAboutFindNodeInStrictMode = {};
- }
-
- function getContextForSubtree(parentComponent) {
- if (!parentComponent) {
- return emptyContextObject;
- }
-
- var fiber = get(parentComponent);
- var parentContext = findCurrentUnmaskedContext(fiber);
-
- if (fiber.tag === ClassComponent) {
- var Component = fiber.type;
-
- if (isContextProvider(Component)) {
- return processChildContext(fiber, Component, parentContext);
- }
- }
-
- return parentContext;
- }
-
- function findHostInstance(component) {
- var fiber = get(component);
-
- if (fiber === undefined) {
- if (typeof component.render === 'function') {
- {
- {
- throw Error("Unable to find node on an unmounted component.");
- }
- }
- } else {
- {
- {
- throw Error("Argument appears to not be a ReactComponent. Keys: " + Object.keys(component));
- }
- }
- }
- }
-
- var hostFiber = findCurrentHostFiber(fiber);
-
- if (hostFiber === null) {
- return null;
- }
-
- return hostFiber.stateNode;
- }
-
- function findHostInstanceWithWarning(component, methodName) {
- {
- var fiber = get(component);
-
- if (fiber === undefined) {
- if (typeof component.render === 'function') {
- {
- {
- throw Error("Unable to find node on an unmounted component.");
- }
- }
- } else {
- {
- {
- throw Error("Argument appears to not be a ReactComponent. Keys: " + Object.keys(component));
- }
- }
- }
- }
-
- var hostFiber = findCurrentHostFiber(fiber);
-
- if (hostFiber === null) {
- return null;
- }
-
- if (hostFiber.mode & StrictMode) {
- var componentName = getComponentName(fiber.type) || 'Component';
-
- if (!didWarnAboutFindNodeInStrictMode[componentName]) {
- didWarnAboutFindNodeInStrictMode[componentName] = true;
-
- if (fiber.mode & StrictMode) {
- warningWithoutStack$1(false, '%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which is inside StrictMode. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-find-node%s', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));
- } else {
- warningWithoutStack$1(false, '%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which renders StrictMode children. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-find-node%s', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));
- }
- }
- }
-
- return hostFiber.stateNode;
- }
-
- return findHostInstance(component);
- }
-
- function createContainer(containerInfo, tag, hydrate, hydrationCallbacks) {
- return createFiberRoot(containerInfo, tag, hydrate, hydrationCallbacks);
- }
- function updateContainer(element, container, parentComponent, callback) {
- var current$$1 = container.current;
- var currentTime = requestCurrentTimeForUpdate();
-
- {
- // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
- if ('undefined' !== typeof jest) {
- warnIfUnmockedScheduler(current$$1);
- warnIfNotScopedWithMatchingAct(current$$1);
- }
- }
-
- var suspenseConfig = requestCurrentSuspenseConfig();
- var expirationTime = computeExpirationForFiber(currentTime, current$$1, suspenseConfig);
-
- {
- if (ReactFiberInstrumentation_1.debugTool) {
- if (current$$1.alternate === null) {
- ReactFiberInstrumentation_1.debugTool.onMountContainer(container);
- } else if (element === null) {
- ReactFiberInstrumentation_1.debugTool.onUnmountContainer(container);
- } else {
- ReactFiberInstrumentation_1.debugTool.onUpdateContainer(container);
- }
- }
- }
-
- var context = getContextForSubtree(parentComponent);
-
- if (container.context === null) {
- container.context = context;
- } else {
- container.pendingContext = context;
- }
-
- {
- if (phase === 'render' && current !== null && !didWarnAboutNestedUpdates) {
- didWarnAboutNestedUpdates = true;
- warningWithoutStack$1(false, 'Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + 'Check the render method of %s.', getComponentName(current.type) || 'Unknown');
- }
- }
-
- var update = createUpdate(expirationTime, suspenseConfig); // Caution: React DevTools currently depends on this property
- // being called "element".
-
- update.payload = {
- element: element
- };
- callback = callback === undefined ? null : callback;
-
- if (callback !== null) {
- !(typeof callback === 'function') ? warningWithoutStack$1(false, 'render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback) : void 0;
- update.callback = callback;
- }
-
- enqueueUpdate(current$$1, update);
- scheduleWork(current$$1, expirationTime);
- return expirationTime;
- }
- function getPublicRootInstance(container) {
- var containerFiber = container.current;
-
- if (!containerFiber.child) {
- return null;
- }
-
- switch (containerFiber.child.tag) {
- case HostComponent:
- return getPublicInstance(containerFiber.child.stateNode);
-
- default:
- return containerFiber.child.stateNode;
- }
- }
- function attemptSynchronousHydration$1(fiber) {
- switch (fiber.tag) {
- case HostRoot:
- var root = fiber.stateNode;
-
- if (root.hydrate) {
- // Flush the first scheduled "update".
- flushRoot(root, root.firstPendingTime);
- }
-
- break;
-
- case SuspenseComponent:
- flushSync(function () {
- return scheduleWork(fiber, Sync);
- }); // If we're still blocked after this, we need to increase
- // the priority of any promises resolving within this
- // boundary so that they next attempt also has higher pri.
-
- var retryExpTime = computeInteractiveExpiration(requestCurrentTimeForUpdate());
- markRetryTimeIfNotHydrated(fiber, retryExpTime);
- break;
- }
- }
-
- function markRetryTimeImpl(fiber, retryTime) {
- var suspenseState = fiber.memoizedState;
-
- if (suspenseState !== null && suspenseState.dehydrated !== null) {
- if (suspenseState.retryTime < retryTime) {
- suspenseState.retryTime = retryTime;
- }
- }
- } // Increases the priority of thennables when they resolve within this boundary.
-
-
- function markRetryTimeIfNotHydrated(fiber, retryTime) {
- markRetryTimeImpl(fiber, retryTime);
- var alternate = fiber.alternate;
-
- if (alternate) {
- markRetryTimeImpl(alternate, retryTime);
- }
- }
-
- function attemptUserBlockingHydration$1(fiber) {
- if (fiber.tag !== SuspenseComponent) {
- // We ignore HostRoots here because we can't increase
- // their priority and they should not suspend on I/O,
- // since you have to wrap anything that might suspend in
- // Suspense.
- return;
- }
-
- var expTime = computeInteractiveExpiration(requestCurrentTimeForUpdate());
- scheduleWork(fiber, expTime);
- markRetryTimeIfNotHydrated(fiber, expTime);
- }
- function attemptContinuousHydration$1(fiber) {
- if (fiber.tag !== SuspenseComponent) {
- // We ignore HostRoots here because we can't increase
- // their priority and they should not suspend on I/O,
- // since you have to wrap anything that might suspend in
- // Suspense.
- return;
- }
-
- var expTime = computeContinuousHydrationExpiration(requestCurrentTimeForUpdate());
- scheduleWork(fiber, expTime);
- markRetryTimeIfNotHydrated(fiber, expTime);
- }
- function attemptHydrationAtCurrentPriority$1(fiber) {
- if (fiber.tag !== SuspenseComponent) {
- // We ignore HostRoots here because we can't increase
- // their priority other than synchronously flush it.
- return;
- }
-
- var currentTime = requestCurrentTimeForUpdate();
- var expTime = computeExpirationForFiber(currentTime, fiber, null);
- scheduleWork(fiber, expTime);
- markRetryTimeIfNotHydrated(fiber, expTime);
- }
- function findHostInstanceWithNoPortals(fiber) {
- var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
-
- if (hostFiber === null) {
- return null;
- }
-
- if (hostFiber.tag === FundamentalComponent) {
- return hostFiber.stateNode.instance;
- }
-
- return hostFiber.stateNode;
- }
-
- var shouldSuspendImpl = function (fiber) {
- return false;
- };
-
- function shouldSuspend(fiber) {
- return shouldSuspendImpl(fiber);
- }
- var overrideHookState = null;
- var overrideProps = null;
- var scheduleUpdate = null;
- var setSuspenseHandler = null;
-
- {
- var copyWithSetImpl = function (obj, path, idx, value) {
- if (idx >= path.length) {
- return value;
- }
-
- var key = path[idx];
- var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj); // $FlowFixMe number or string is fine here
-
- updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value);
- return updated;
- };
-
- var copyWithSet = function (obj, path, value) {
- return copyWithSetImpl(obj, path, 0, value);
- }; // Support DevTools editable values for useState and useReducer.
-
-
- overrideHookState = function (fiber, id, path, value) {
- // For now, the "id" of stateful hooks is just the stateful hook index.
- // This may change in the future with e.g. nested hooks.
- var currentHook = fiber.memoizedState;
-
- while (currentHook !== null && id > 0) {
- currentHook = currentHook.next;
- id--;
- }
-
- if (currentHook !== null) {
- var newState = copyWithSet(currentHook.memoizedState, path, value);
- currentHook.memoizedState = newState;
- currentHook.baseState = newState; // We aren't actually adding an update to the queue,
- // because there is no update we can add for useReducer hooks that won't trigger an error.
- // (There's no appropriate action type for DevTools overrides.)
- // As a result though, React will see the scheduled update as a noop and bailout.
- // Shallow cloning props works as a workaround for now to bypass the bailout check.
-
- fiber.memoizedProps = _assign({}, fiber.memoizedProps);
- scheduleWork(fiber, Sync);
- }
- }; // Support DevTools props for function components, forwardRef, memo, host components, etc.
-
-
- overrideProps = function (fiber, path, value) {
- fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);
-
- if (fiber.alternate) {
- fiber.alternate.pendingProps = fiber.pendingProps;
- }
-
- scheduleWork(fiber, Sync);
- };
-
- scheduleUpdate = function (fiber) {
- scheduleWork(fiber, Sync);
- };
-
- setSuspenseHandler = function (newShouldSuspendImpl) {
- shouldSuspendImpl = newShouldSuspendImpl;
- };
- }
-
- function injectIntoDevTools(devToolsConfig) {
- var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
- var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
- return injectInternals(_assign({}, devToolsConfig, {
- overrideHookState: overrideHookState,
- overrideProps: overrideProps,
- setSuspenseHandler: setSuspenseHandler,
- scheduleUpdate: scheduleUpdate,
- currentDispatcherRef: ReactCurrentDispatcher,
- findHostInstanceByFiber: function (fiber) {
- var hostFiber = findCurrentHostFiber(fiber);
-
- if (hostFiber === null) {
- return null;
- }
-
- return hostFiber.stateNode;
- },
- findFiberByHostInstance: function (instance) {
- if (!findFiberByHostInstance) {
- // Might not be implemented by the renderer.
- return null;
- }
-
- return findFiberByHostInstance(instance);
- },
- // React Refresh
- findHostInstancesForRefresh: findHostInstancesForRefresh,
- scheduleRefresh: scheduleRefresh,
- scheduleRoot: scheduleRoot,
- setRefreshHandler: setRefreshHandler,
- // Enables DevTools to append owner stacks to error messages in DEV mode.
- getCurrentFiber: function () {
- return current;
- }
- }));
- }
-
- // This file intentionally does *not* have the Flow annotation.
- // Don't add it. See `./inline-typed.js` for an explanation.
-
- // TODO: This type is shared between the reconciler and ReactDOM, but will
- // eventually be lifted out to the renderer.
- function ReactDOMRoot(container, options) {
- this._internalRoot = createRootImpl(container, ConcurrentRoot, options);
- }
-
- function ReactDOMBlockingRoot(container, tag, options) {
- this._internalRoot = createRootImpl(container, tag, options);
- }
-
- ReactDOMRoot.prototype.render = ReactDOMBlockingRoot.prototype.render = function (children, callback) {
- var root = this._internalRoot;
- var cb = callback === undefined ? null : callback;
-
- {
- warnOnInvalidCallback(cb, 'render');
- }
-
- updateContainer(children, root, null, cb);
- };
-
- ReactDOMRoot.prototype.unmount = ReactDOMBlockingRoot.prototype.unmount = function (callback) {
- var root = this._internalRoot;
- var cb = callback === undefined ? null : callback;
-
- {
- warnOnInvalidCallback(cb, 'render');
- }
-
- var container = root.containerInfo;
- updateContainer(null, root, null, function () {
- unmarkContainerAsRoot(container);
-
- if (cb !== null) {
- cb();
- }
- });
- };
-
- function createRootImpl(container, tag, options) {
- // Tag is either LegacyRoot or Concurrent Root
- var hydrate = options != null && options.hydrate === true;
- var hydrationCallbacks = options != null && options.hydrationOptions || null;
- var root = createContainer(container, tag, hydrate, hydrationCallbacks);
- markContainerAsRoot(root.current, container);
-
- if (hydrate && tag !== LegacyRoot) {
- var doc = container.nodeType === DOCUMENT_NODE ? container : container.ownerDocument;
- eagerlyTrapReplayableEvents(doc);
- }
-
- return root;
- }
-
- function createRoot(container, options) {
- if (!isValidContainer(container)) {
- {
- throw Error("createRoot(...): Target container is not a DOM element.");
- }
- }
-
- warnIfReactDOMContainerInDEV(container);
- return new ReactDOMRoot(container, options);
- }
- function createBlockingRoot(container, options) {
- if (!isValidContainer(container)) {
- {
- throw Error("createRoot(...): Target container is not a DOM element.");
- }
- }
-
- warnIfReactDOMContainerInDEV(container);
- return new ReactDOMBlockingRoot(container, BlockingRoot, options);
- }
- function createLegacyRoot(container, options) {
- return new ReactDOMBlockingRoot(container, LegacyRoot, options);
- }
- function isValidContainer(node) {
- return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable '));
- }
- function warnOnInvalidCallback(callback, callerName) {
- {
- !(callback === null || typeof callback === 'function') ? warningWithoutStack$1(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback) : void 0;
- }
- }
-
- function warnIfReactDOMContainerInDEV(container) {
- {
- if (isContainerMarkedAsRoot(container)) {
- if (container._reactRootContainer) {
- warningWithoutStack$1(false, 'You are calling ReactDOM.createRoot() on a container that was previously ' + 'passed to ReactDOM.render(). This is not supported.');
- } else {
- warningWithoutStack$1(false, 'You are calling ReactDOM.createRoot() on a container that ' + 'has already been passed to createRoot() before. Instead, call ' + 'root.render() on the existing root instead if you want to update it.');
- }
- }
- }
- }
-
- var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
- var topLevelUpdateWarnings;
- var warnedAboutHydrateAPI = false;
-
- {
- topLevelUpdateWarnings = function (container) {
- if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
- var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current);
-
- if (hostInstance) {
- !(hostInstance.parentNode === container) ? warningWithoutStack$1(false, 'render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.') : void 0;
- }
- }
-
- var isRootRenderedBySomeReact = !!container._reactRootContainer;
- var rootEl = getReactRootElementInContainer(container);
- var hasNonRootReactChild = !!(rootEl && getInstanceFromNode$1(rootEl));
- !(!hasNonRootReactChild || isRootRenderedBySomeReact) ? warningWithoutStack$1(false, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0;
- !(container.nodeType !== ELEMENT_NODE || !container.tagName || container.tagName.toUpperCase() !== 'BODY') ? warningWithoutStack$1(false, 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0;
- };
- }
-
- function getReactRootElementInContainer(container) {
- if (!container) {
- return null;
- }
-
- if (container.nodeType === DOCUMENT_NODE) {
- return container.documentElement;
- } else {
- return container.firstChild;
- }
- }
-
- function shouldHydrateDueToLegacyHeuristic(container) {
- var rootElement = getReactRootElementInContainer(container);
- return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));
- }
-
- function legacyCreateRootFromDOMContainer(container, forceHydrate) {
- var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container); // First clear any existing content.
-
- if (!shouldHydrate) {
- var warned = false;
- var rootSibling;
-
- while (rootSibling = container.lastChild) {
- {
- if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {
- warned = true;
- warningWithoutStack$1(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.');
- }
- }
-
- container.removeChild(rootSibling);
- }
- }
-
- {
- if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {
- warnedAboutHydrateAPI = true;
- lowPriorityWarningWithoutStack$1(false, 'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + 'will stop working in React v17. Replace the ReactDOM.render() call ' + 'with ReactDOM.hydrate() if you want React to attach to the server HTML.');
- }
- }
-
- return createLegacyRoot(container, shouldHydrate ? {
- hydrate: true
- } : undefined);
- }
-
- function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
- {
- topLevelUpdateWarnings(container);
- warnOnInvalidCallback(callback === undefined ? null : callback, 'render');
- } // TODO: Without `any` type, Flow says "Property cannot be accessed on any
- // member of intersection type." Whyyyyyy.
-
-
- var root = container._reactRootContainer;
- var fiberRoot;
-
- if (!root) {
- // Initial mount
- root = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate);
- fiberRoot = root._internalRoot;
-
- if (typeof callback === 'function') {
- var originalCallback = callback;
-
- callback = function () {
- var instance = getPublicRootInstance(fiberRoot);
- originalCallback.call(instance);
- };
- } // Initial mount should not be batched.
-
-
- unbatchedUpdates(function () {
- updateContainer(children, fiberRoot, parentComponent, callback);
- });
- } else {
- fiberRoot = root._internalRoot;
-
- if (typeof callback === 'function') {
- var _originalCallback = callback;
-
- callback = function () {
- var instance = getPublicRootInstance(fiberRoot);
-
- _originalCallback.call(instance);
- };
- } // Update
-
-
- updateContainer(children, fiberRoot, parentComponent, callback);
- }
-
- return getPublicRootInstance(fiberRoot);
- }
-
- function findDOMNode(componentOrElement) {
- {
- var owner = ReactCurrentOwner$1.current;
-
- if (owner !== null && owner.stateNode !== null) {
- var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;
- !warnedAboutRefsInRender ? warningWithoutStack$1(false, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(owner.type) || 'A component') : void 0;
- owner.stateNode._warnedAboutRefsInRender = true;
- }
- }
-
- if (componentOrElement == null) {
- return null;
- }
-
- if (componentOrElement.nodeType === ELEMENT_NODE) {
- return componentOrElement;
- }
-
- {
- return findHostInstanceWithWarning(componentOrElement, 'findDOMNode');
- }
-
- return findHostInstance(componentOrElement);
- }
- function hydrate(element, container, callback) {
- if (!isValidContainer(container)) {
- {
- throw Error("Target container is not a DOM element.");
- }
- }
-
- {
- var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;
-
- if (isModernRoot) {
- warningWithoutStack$1(false, 'You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call createRoot(container, {hydrate: true}).render(element)?');
- }
- } // TODO: throw or warn if we couldn't hydrate?
-
-
- return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
- }
- function render(element, container, callback) {
- if (!isValidContainer(container)) {
- {
- throw Error("Target container is not a DOM element.");
- }
- }
-
- {
- var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;
-
- if (isModernRoot) {
- warningWithoutStack$1(false, 'You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call root.render(element)?');
- }
- }
-
- return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
- }
- function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {
- if (!isValidContainer(containerNode)) {
- {
- throw Error("Target container is not a DOM element.");
- }
- }
-
- if (!(parentComponent != null && has(parentComponent))) {
- {
- throw Error("parentComponent must be a valid React Component");
- }
- }
-
- return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
- }
- function unmountComponentAtNode(container) {
- if (!isValidContainer(container)) {
- {
- throw Error("unmountComponentAtNode(...): Target container is not a DOM element.");
- }
- }
-
- {
- var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;
-
- if (isModernRoot) {
- warningWithoutStack$1(false, 'You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?');
- }
- }
-
- if (container._reactRootContainer) {
- {
- var rootEl = getReactRootElementInContainer(container);
- var renderedByDifferentReact = rootEl && !getInstanceFromNode$1(rootEl);
- !!renderedByDifferentReact ? warningWithoutStack$1(false, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.') : void 0;
- } // Unmount should not be batched.
-
-
- unbatchedUpdates(function () {
- legacyRenderSubtreeIntoContainer(null, null, container, false, function () {
- container._reactRootContainer = null;
- unmarkContainerAsRoot(container);
- });
- }); // If you call unmountComponentAtNode twice in quick succession, you'll
- // get `true` twice. That's probably fine?
-
- return true;
- } else {
- {
- var _rootEl = getReactRootElementInContainer(container);
-
- var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode$1(_rootEl)); // Check if the container itself is a React root node.
-
- var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;
- !!hasNonRootReactChild ? warningWithoutStack$1(false, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0;
- }
-
- return false;
- }
- }
-
- function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
- implementation) {
- var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
- return {
- // This tag allow us to uniquely identify this as a React Portal
- $$typeof: REACT_PORTAL_TYPE,
- key: key == null ? null : '' + key,
- children: children,
- containerInfo: containerInfo,
- implementation: implementation
- };
- }
-
- // TODO: this is special because it gets imported during build.
-
- var ReactVersion = '16.12.0';
-
- setAttemptSynchronousHydration(attemptSynchronousHydration$1);
- setAttemptUserBlockingHydration(attemptUserBlockingHydration$1);
- setAttemptContinuousHydration(attemptContinuousHydration$1);
- setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);
- var didWarnAboutUnstableCreatePortal = false;
-
- {
- if (typeof Map !== 'function' || // $FlowIssue Flow incorrectly thinks Map has no prototype
- Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' || // $FlowIssue Flow incorrectly thinks Set has no prototype
- Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') {
- warningWithoutStack$1(false, 'React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
- }
- }
-
- setRestoreImplementation(restoreControlledState$$1);
- setBatchingImplementation(batchedUpdates$1, discreteUpdates$1, flushDiscreteUpdates, batchedEventUpdates$1);
-
- function createPortal$$1(children, container) {
- var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
-
- if (!isValidContainer(container)) {
- {
- throw Error("Target container is not a DOM element.");
- }
- } // TODO: pass ReactDOM portal implementation as third argument
-
-
- return createPortal$1(children, container, null, key);
- }
-
- var ReactDOM = {
- createPortal: createPortal$$1,
- // Legacy
- findDOMNode: findDOMNode,
- hydrate: hydrate,
- render: render,
- unstable_renderSubtreeIntoContainer: unstable_renderSubtreeIntoContainer,
- unmountComponentAtNode: unmountComponentAtNode,
- // Temporary alias since we already shipped React 16 RC with it.
- // TODO: remove in React 17.
- unstable_createPortal: function () {
- if (!didWarnAboutUnstableCreatePortal) {
- didWarnAboutUnstableCreatePortal = true;
- lowPriorityWarningWithoutStack$1(false, 'The ReactDOM.unstable_createPortal() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactDOM.createPortal() instead. It has the exact same API, ' + 'but without the "unstable_" prefix.');
- }
-
- return createPortal$$1.apply(void 0, arguments);
- },
- unstable_batchedUpdates: batchedUpdates$1,
- flushSync: flushSync,
- __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
- // Keep in sync with ReactDOMUnstableNativeDependencies.js
- // ReactTestUtils.js, and ReactTestUtilsAct.js. This is an array for better minification.
- Events: [getInstanceFromNode$1, getNodeFromInstance$1, getFiberCurrentPropsFromNode$1, injection.injectEventPluginsByName, eventNameDispatchConfigs, accumulateTwoPhaseDispatches, accumulateDirectDispatches, enqueueStateRestore, restoreStateIfNeeded, dispatchEvent, runEventsInBatch, flushPassiveEffects, IsThisRendererActing]
- }
- };
-
- if (exposeConcurrentModeAPIs) {
- ReactDOM.createRoot = createRoot;
- ReactDOM.createBlockingRoot = createBlockingRoot;
- ReactDOM.unstable_discreteUpdates = discreteUpdates$1;
- ReactDOM.unstable_flushDiscreteUpdates = flushDiscreteUpdates;
- ReactDOM.unstable_flushControlled = flushControlled;
-
- ReactDOM.unstable_scheduleHydration = function (target) {
- if (target) {
- queueExplicitHydrationTarget(target);
- }
- };
- }
-
- var foundDevTools = injectIntoDevTools({
- findFiberByHostInstance: getClosestInstanceFromNode,
- bundleType: 1,
- version: ReactVersion,
- rendererPackageName: 'react-dom'
- });
-
- {
- if (!foundDevTools && canUseDOM && window.top === window.self) {
- // If we're in Chrome or Firefox, provide a download link if not installed.
- if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
- var protocol = window.location.protocol; // Don't warn in exotic cases like chrome-extension://.
-
- if (/^(https?|file):$/.test(protocol)) {
- console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://fb.me/react-devtools' + (protocol === 'file:' ? '\nYou might need to use a local HTTP server (instead of file://): ' + 'https://fb.me/react-devtools-faq' : ''), 'font-weight:bold');
- }
- }
- }
- }
-
-
-
- var ReactDOM$2 = Object.freeze({
- default: ReactDOM
- });
-
- var ReactDOM$3 = ( ReactDOM$2 && ReactDOM ) || ReactDOM$2;
-
- // TODO: decide on the top-level export form.
- // This is hacky but makes it work with both Rollup and Jest.
-
-
- var reactDom = ReactDOM$3.default || ReactDOM$3;
-
- module.exports = reactDom;
- })();
- }
-
-
- /***/ }),
-
- /***/ "./node_modules/react-dom/index.js":
- /*!*****************************************!*\
- !*** ./node_modules/react-dom/index.js ***!
- \*****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- function checkDCE() {
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
- if (
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
- ) {
- return;
- }
- if (true) {
- // This branch is unreachable because this function is only called
- // in production, but the condition is true only in development.
- // Therefore if the branch is still here, dead code elimination wasn't
- // properly applied.
- // Don't change the message. React DevTools relies on it. Also make sure
- // this message doesn't occur elsewhere in this function, or it will cause
- // a false positive.
- throw new Error('^_^');
- }
- try {
- // Verify that the code above has been dead code eliminated (DCE'd).
- __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
- } catch (err) {
- // DevTools shouldn't crash React, no matter what.
- // We should still report in case we break this code.
- console.error(err);
- }
- }
-
- if (false) {} else {
- module.exports = __webpack_require__(/*! ./cjs/react-dom.development.js */ "./node_modules/react-dom/cjs/react-dom.development.js");
- }
-
-
- /***/ }),
-
- /***/ "./node_modules/react-is/cjs/react-is.development.js":
- /*!***********************************************************!*\
- !*** ./node_modules/react-is/cjs/react-is.development.js ***!
- \***********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
- /** @license React v16.12.0
- * react-is.development.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-
-
-
-
- if (true) {
- (function() {
- 'use strict';
-
- Object.defineProperty(exports, '__esModule', { value: true });
-
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
- // nor polyfill, then a plain number is used for performance.
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
- // (unstable) APIs that have been removed. Can we remove the symbols?
-
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
-
- function isValidElementType(type) {
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE);
- }
-
- /**
- * Forked from fbjs/warning:
- * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
- *
- * Only change is we use console.warn instead of console.error,
- * and do nothing when 'console' is not supported.
- * This really simplifies the code.
- * ---
- * Similar to invariant but only logs a warning if the condition is not met.
- * This can be used to log issues in development environments in critical
- * paths. Removing the logging code for production environments will keep the
- * same logic and follow the same code paths.
- */
- var lowPriorityWarningWithoutStack = function () {};
-
- {
- var printWarning = function (format) {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- var argIndex = 0;
- var message = 'Warning: ' + format.replace(/%s/g, function () {
- return args[argIndex++];
- });
-
- if (typeof console !== 'undefined') {
- console.warn(message);
- }
-
- try {
- // --- Welcome to debugging React ---
- // This error was thrown as a convenience so that you can use this stack
- // to find the callsite that caused this warning to fire.
- throw new Error(message);
- } catch (x) {}
- };
-
- lowPriorityWarningWithoutStack = function (condition, format) {
- if (format === undefined) {
- throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
- }
-
- if (!condition) {
- for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
- args[_key2 - 2] = arguments[_key2];
- }
-
- printWarning.apply(void 0, [format].concat(args));
- }
- };
- }
-
- var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
-
- function typeOf(object) {
- if (typeof object === 'object' && object !== null) {
- var $$typeof = object.$$typeof;
-
- switch ($$typeof) {
- case REACT_ELEMENT_TYPE:
- var type = object.type;
-
- switch (type) {
- case REACT_ASYNC_MODE_TYPE:
- case REACT_CONCURRENT_MODE_TYPE:
- case REACT_FRAGMENT_TYPE:
- case REACT_PROFILER_TYPE:
- case REACT_STRICT_MODE_TYPE:
- case REACT_SUSPENSE_TYPE:
- return type;
-
- default:
- var $$typeofType = type && type.$$typeof;
-
- switch ($$typeofType) {
- case REACT_CONTEXT_TYPE:
- case REACT_FORWARD_REF_TYPE:
- case REACT_LAZY_TYPE:
- case REACT_MEMO_TYPE:
- case REACT_PROVIDER_TYPE:
- return $$typeofType;
-
- default:
- return $$typeof;
- }
-
- }
-
- case REACT_PORTAL_TYPE:
- return $$typeof;
- }
- }
-
- return undefined;
- } // AsyncMode is deprecated along with isAsyncMode
-
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
- var ContextConsumer = REACT_CONTEXT_TYPE;
- var ContextProvider = REACT_PROVIDER_TYPE;
- var Element = REACT_ELEMENT_TYPE;
- var ForwardRef = REACT_FORWARD_REF_TYPE;
- var Fragment = REACT_FRAGMENT_TYPE;
- var Lazy = REACT_LAZY_TYPE;
- var Memo = REACT_MEMO_TYPE;
- var Portal = REACT_PORTAL_TYPE;
- var Profiler = REACT_PROFILER_TYPE;
- var StrictMode = REACT_STRICT_MODE_TYPE;
- var Suspense = REACT_SUSPENSE_TYPE;
- var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
-
- function isAsyncMode(object) {
- {
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
- hasWarnedAboutDeprecatedIsAsyncMode = true;
- lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
- }
- }
-
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
- }
- function isConcurrentMode(object) {
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
- }
- function isContextConsumer(object) {
- return typeOf(object) === REACT_CONTEXT_TYPE;
- }
- function isContextProvider(object) {
- return typeOf(object) === REACT_PROVIDER_TYPE;
- }
- function isElement(object) {
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
- }
- function isForwardRef(object) {
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
- }
- function isFragment(object) {
- return typeOf(object) === REACT_FRAGMENT_TYPE;
- }
- function isLazy(object) {
- return typeOf(object) === REACT_LAZY_TYPE;
- }
- function isMemo(object) {
- return typeOf(object) === REACT_MEMO_TYPE;
- }
- function isPortal(object) {
- return typeOf(object) === REACT_PORTAL_TYPE;
- }
- function isProfiler(object) {
- return typeOf(object) === REACT_PROFILER_TYPE;
- }
- function isStrictMode(object) {
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
- }
- function isSuspense(object) {
- return typeOf(object) === REACT_SUSPENSE_TYPE;
- }
-
- exports.typeOf = typeOf;
- exports.AsyncMode = AsyncMode;
- exports.ConcurrentMode = ConcurrentMode;
- exports.ContextConsumer = ContextConsumer;
- exports.ContextProvider = ContextProvider;
- exports.Element = Element;
- exports.ForwardRef = ForwardRef;
- exports.Fragment = Fragment;
- exports.Lazy = Lazy;
- exports.Memo = Memo;
- exports.Portal = Portal;
- exports.Profiler = Profiler;
- exports.StrictMode = StrictMode;
- exports.Suspense = Suspense;
- exports.isValidElementType = isValidElementType;
- exports.isAsyncMode = isAsyncMode;
- exports.isConcurrentMode = isConcurrentMode;
- exports.isContextConsumer = isContextConsumer;
- exports.isContextProvider = isContextProvider;
- exports.isElement = isElement;
- exports.isForwardRef = isForwardRef;
- exports.isFragment = isFragment;
- exports.isLazy = isLazy;
- exports.isMemo = isMemo;
- exports.isPortal = isPortal;
- exports.isProfiler = isProfiler;
- exports.isStrictMode = isStrictMode;
- exports.isSuspense = isSuspense;
- })();
- }
-
-
- /***/ }),
-
- /***/ "./node_modules/react-is/index.js":
- /*!****************************************!*\
- !*** ./node_modules/react-is/index.js ***!
- \****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- if (false) {} else {
- module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "./node_modules/react-is/cjs/react-is.development.js");
- }
-
-
- /***/ }),
-
- /***/ "./node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js":
- /*!****************************************************************************!*\
- !*** ./node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js ***!
- \****************************************************************************/
- /*! exports provided: polyfill */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "polyfill", function() { return polyfill; });
- /**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
- function componentWillMount() {
- // Call this.constructor.gDSFP to support sub-classes.
- var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
- if (state !== null && state !== undefined) {
- this.setState(state);
- }
- }
-
- function componentWillReceiveProps(nextProps) {
- // Call this.constructor.gDSFP to support sub-classes.
- // Use the setState() updater to ensure state isn't stale in certain edge cases.
- function updater(prevState) {
- var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
- return state !== null && state !== undefined ? state : null;
- }
- // Binding "this" is important for shallow renderer support.
- this.setState(updater.bind(this));
- }
-
- function componentWillUpdate(nextProps, nextState) {
- try {
- var prevProps = this.props;
- var prevState = this.state;
- this.props = nextProps;
- this.state = nextState;
- this.__reactInternalSnapshotFlag = true;
- this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(
- prevProps,
- prevState
- );
- } finally {
- this.props = prevProps;
- this.state = prevState;
- }
- }
-
- // React may warn about cWM/cWRP/cWU methods being deprecated.
- // Add a flag to suppress these warnings for this special case.
- componentWillMount.__suppressDeprecationWarning = true;
- componentWillReceiveProps.__suppressDeprecationWarning = true;
- componentWillUpdate.__suppressDeprecationWarning = true;
-
- function polyfill(Component) {
- var prototype = Component.prototype;
-
- if (!prototype || !prototype.isReactComponent) {
- throw new Error('Can only polyfill class components');
- }
-
- if (
- typeof Component.getDerivedStateFromProps !== 'function' &&
- typeof prototype.getSnapshotBeforeUpdate !== 'function'
- ) {
- return Component;
- }
-
- // If new component APIs are defined, "unsafe" lifecycles won't be called.
- // Error if any of these lifecycles are present,
- // Because they would work differently between older and newer (16.3+) versions of React.
- var foundWillMountName = null;
- var foundWillReceivePropsName = null;
- var foundWillUpdateName = null;
- if (typeof prototype.componentWillMount === 'function') {
- foundWillMountName = 'componentWillMount';
- } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
- foundWillMountName = 'UNSAFE_componentWillMount';
- }
- if (typeof prototype.componentWillReceiveProps === 'function') {
- foundWillReceivePropsName = 'componentWillReceiveProps';
- } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
- foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
- }
- if (typeof prototype.componentWillUpdate === 'function') {
- foundWillUpdateName = 'componentWillUpdate';
- } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
- foundWillUpdateName = 'UNSAFE_componentWillUpdate';
- }
- if (
- foundWillMountName !== null ||
- foundWillReceivePropsName !== null ||
- foundWillUpdateName !== null
- ) {
- var componentName = Component.displayName || Component.name;
- var newApiName =
- typeof Component.getDerivedStateFromProps === 'function'
- ? 'getDerivedStateFromProps()'
- : 'getSnapshotBeforeUpdate()';
-
- throw Error(
- 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' +
- componentName +
- ' uses ' +
- newApiName +
- ' but also contains the following legacy lifecycles:' +
- (foundWillMountName !== null ? '\n ' + foundWillMountName : '') +
- (foundWillReceivePropsName !== null
- ? '\n ' + foundWillReceivePropsName
- : '') +
- (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') +
- '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' +
- 'https://fb.me/react-async-component-lifecycle-hooks'
- );
- }
-
- // React <= 16.2 does not support static getDerivedStateFromProps.
- // As a workaround, use cWM and cWRP to invoke the new static lifecycle.
- // Newer versions of React will ignore these lifecycles if gDSFP exists.
- if (typeof Component.getDerivedStateFromProps === 'function') {
- prototype.componentWillMount = componentWillMount;
- prototype.componentWillReceiveProps = componentWillReceiveProps;
- }
-
- // React <= 16.2 does not support getSnapshotBeforeUpdate.
- // As a workaround, use cWU to invoke the new lifecycle.
- // Newer versions of React will ignore that lifecycle if gSBU exists.
- if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
- if (typeof prototype.componentDidUpdate !== 'function') {
- throw new Error(
- 'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'
- );
- }
-
- prototype.componentWillUpdate = componentWillUpdate;
-
- var componentDidUpdate = prototype.componentDidUpdate;
-
- prototype.componentDidUpdate = function componentDidUpdatePolyfill(
- prevProps,
- prevState,
- maybeSnapshot
- ) {
- // 16.3+ will not execute our will-update method;
- // It will pass a snapshot value to did-update though.
- // Older versions will require our polyfilled will-update value.
- // We need to handle both cases, but can't just check for the presence of "maybeSnapshot",
- // Because for <= 15.x versions this might be a "prevContext" object.
- // We also can't just check "__reactInternalSnapshot",
- // Because get-snapshot might return a falsy value.
- // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.
- var snapshot = this.__reactInternalSnapshotFlag
- ? this.__reactInternalSnapshot
- : maybeSnapshot;
-
- componentDidUpdate.call(this, prevProps, prevState, snapshot);
- };
- }
-
- return Component;
- }
-
-
-
-
- /***/ }),
-
- /***/ "./node_modules/react-overlays/Dropdown.js":
- /*!*************************************************!*\
- !*** ./node_modules/react-overlays/Dropdown.js ***!
- \*************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _matches = _interopRequireDefault(__webpack_require__(/*! dom-helpers/query/matches */ "./node_modules/dom-helpers/query/matches.js"));
-
- var _querySelectorAll = _interopRequireDefault(__webpack_require__(/*! dom-helpers/query/querySelectorAll */ "./node_modules/dom-helpers/query/querySelectorAll.js"));
-
- var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
-
- var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"));
-
- var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"));
-
- var _uncontrollable = _interopRequireDefault(__webpack_require__(/*! uncontrollable */ "./node_modules/react-overlays/node_modules/uncontrollable/esm/index.js"));
-
- var Popper = _interopRequireWildcard(__webpack_require__(/*! react-popper */ "./node_modules/react-popper/lib/esm/index.js"));
-
- var _DropdownContext = _interopRequireDefault(__webpack_require__(/*! ./DropdownContext */ "./node_modules/react-overlays/DropdownContext.js"));
-
- var _DropdownMenu = _interopRequireDefault(__webpack_require__(/*! ./DropdownMenu */ "./node_modules/react-overlays/DropdownMenu.js"));
-
- var _DropdownToggle = _interopRequireDefault(__webpack_require__(/*! ./DropdownToggle */ "./node_modules/react-overlays/DropdownToggle.js"));
-
- 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)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
-
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
-
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
-
- var propTypes = {
- /**
- * A render prop that returns the root dropdown element. The `props`
- * argument should spread through to an element containing _both_ the
- * menu and toggle in order to handle keyboard events for focus management.
- *
- * @type {Function ({
- * props: {
- * onKeyDown: (SyntheticEvent) => void,
- * },
- * }) => React.Element}
- */
- children: _propTypes.default.func.isRequired,
-
- /**
- * Determines the direction and location of the Menu in relation to it's Toggle.
- */
- drop: _propTypes.default.oneOf(['up', 'left', 'right', 'down']),
-
- /**
- * Controls the focus behavior for when the Dropdown is opened. Set to
- * `true` to always focus the first menu item, `keyboard` to focus only when
- * navigating via the keyboard, or `false` to disable completely
- *
- * The Default behavior is `false` **unless** the Menu has a `role="menu"`
- * where it will default to `keyboard` to match the recommended [ARIA Authoring practices](https://www.w3.org/TR/wai-aria-practices-1.1/#menubutton).
- */
- focusFirstItemOnShow: _propTypes.default.oneOf([false, true, 'keyboard']),
-
- /**
- * A css slector string that will return __focusable__ menu items.
- * Selectors should be relative to the menu component:
- * e.g. ` > li:not('.disabled')`
- */
- itemSelector: _propTypes.default.string.isRequired,
-
- /**
- * Align the menu to the 'end' side of the placement side of the Dropdown toggle. The default placement is `top-start` or `bottom-start`.
- */
- alignEnd: _propTypes.default.bool,
-
- /**
- * Whether or not the Dropdown is visible.
- *
- * @controllable onToggle
- */
- show: _propTypes.default.bool,
-
- /**
- * A callback fired when the Dropdown wishes to change visibility. Called with the requested
- * `show` value, the DOM event, and the source that fired it: `'click'`,`'keydown'`,`'rootClose'`, or `'select'`.
- *
- * ```js
- * function(
- * isOpen: boolean,
- * event: SyntheticEvent,
- * ): void
- * ```
- *
- * @controllable show
- */
- onToggle: _propTypes.default.func
- };
- var defaultProps = {
- itemSelector: '* > *'
- };
- /**
- * `Dropdown` is set of structural components for building, accessible dropdown menus with close-on-click,
- * keyboard navigation, and correct focus handling. As with all the react-overlay's
- * components its BYOS (bring your own styles). Dropdown is primarily
- * built from three base components, you should compose to build your Dropdowns.
- *
- * - `Dropdown`, which wraps the menu and toggle, and handles keyboard navigation
- * - `Dropdown.Toggle` generally a button that triggers the menu opening
- * - `Dropdown.Menu` The overlaid, menu, positioned to the toggle with PopperJs
- */
-
- var Dropdown =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(Dropdown, _React$Component);
-
- Dropdown.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
- var drop = _ref.drop,
- alignEnd = _ref.alignEnd,
- show = _ref.show;
- var lastShow = prevState.context.show;
- return {
- lastShow: lastShow,
- context: _extends({}, prevState.context, {
- drop: drop,
- show: show,
- alignEnd: alignEnd
- })
- };
- };
-
- function Dropdown(props, context) {
- var _this;
-
- _this = _React$Component.call(this, props, context) || this;
-
- _this.handleClick = function (event) {
- _this.toggleOpen(event);
- };
-
- _this.handleKeyDown = function (event) {
- var key = event.key,
- target = event.target; // Second only to https://github.com/twbs/bootstrap/blob/8cfbf6933b8a0146ac3fbc369f19e520bd1ebdac/js/src/dropdown.js#L400
- // in inscrutability
-
- var isInput = /input|textarea/i.test(target.tagName);
-
- if (isInput && (key === ' ' || key !== 'Escape' && _this.menu.contains(target))) {
- return;
- }
-
- _this._lastSourceEvent = event.type;
-
- switch (key) {
- case 'ArrowUp':
- {
- var next = _this.getNextFocusedChild(target, -1);
-
- if (next && next.focus) next.focus();
- event.preventDefault();
- return;
- }
-
- case 'ArrowDown':
- event.preventDefault();
-
- if (!_this.props.show) {
- _this.toggleOpen(event);
- } else {
- var _next = _this.getNextFocusedChild(target, 1);
-
- if (_next && _next.focus) _next.focus();
- }
-
- return;
-
- case 'Escape':
- case 'Tab':
- _this.props.onToggle(false, event);
-
- break;
-
- default:
- }
- };
-
- _this._focusInDropdown = false;
- _this.menu = null;
- _this.state = {
- context: {
- close: _this.handleClose,
- toggle: _this.handleClick,
- menuRef: function menuRef(r) {
- _this.menu = r;
- },
- toggleRef: function toggleRef(r) {
- var toggleNode = r && _reactDom.default.findDOMNode(r);
-
- _this.setState(function (_ref2) {
- var context = _ref2.context;
- return {
- context: _extends({}, context, {
- toggleNode: toggleNode
- })
- };
- });
- }
- }
- };
- return _this;
- }
-
- var _proto = Dropdown.prototype;
-
- _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
- var show = this.props.show;
- var prevOpen = prevProps.show;
-
- if (show && !prevOpen) {
- this.maybeFocusFirst();
- }
-
- this._lastSourceEvent = null;
-
- if (!show && prevOpen) {
- // if focus hasn't already moved from the menu let's return it
- // to the toggle
- if (this._focusInDropdown) {
- this._focusInDropdown = false;
- this.focus();
- }
- }
- };
-
- _proto.getNextFocusedChild = function getNextFocusedChild(current, offset) {
- if (!this.menu) return null;
- var itemSelector = this.props.itemSelector;
- var items = (0, _querySelectorAll.default)(this.menu, itemSelector);
- var index = items.indexOf(current) + offset;
- index = Math.max(0, Math.min(index, items.length));
- return items[index];
- };
-
- _proto.hasMenuRole = function hasMenuRole() {
- return this.menu && (0, _matches.default)(this.menu, '[role=menu]');
- };
-
- _proto.focus = function focus() {
- var toggleNode = this.state.context.toggleNode;
-
- if (toggleNode && toggleNode.focus) {
- toggleNode.focus();
- }
- };
-
- _proto.maybeFocusFirst = function maybeFocusFirst() {
- var type = this._lastSourceEvent;
- var focusFirstItemOnShow = this.props.focusFirstItemOnShow;
-
- if (focusFirstItemOnShow == null) {
- focusFirstItemOnShow = this.hasMenuRole() ? 'keyboard' : false;
- }
-
- if (focusFirstItemOnShow === false || focusFirstItemOnShow === 'keyboard' && !/^key.+$/.test(type)) {
- return;
- }
-
- var itemSelector = this.props.itemSelector;
- var first = (0, _querySelectorAll.default)(this.menu, itemSelector)[0];
- if (first && first.focus) first.focus();
- };
-
- _proto.toggleOpen = function toggleOpen(event) {
- var show = !this.props.show;
- this.props.onToggle(show, event);
- };
-
- _proto.render = function render() {
- var _this$props = this.props,
- children = _this$props.children,
- props = _objectWithoutPropertiesLoose(_this$props, ["children"]);
-
- delete props.onToggle;
-
- if (this.menu && this.state.lastShow && !this.props.show) {
- this._focusInDropdown = this.menu.contains(document.activeElement);
- }
-
- return _react.default.createElement(_DropdownContext.default.Provider, {
- value: this.state.context
- }, _react.default.createElement(Popper.Manager, null, children({
- props: {
- onKeyDown: this.handleKeyDown
- }
- })));
- };
-
- return Dropdown;
- }(_react.default.Component);
-
- Dropdown.displayName = 'ReactOverlaysDropdown';
- Dropdown.propTypes = propTypes;
- Dropdown.defaultProps = defaultProps;
- var UncontrolledDropdown = (0, _uncontrollable.default)(Dropdown, {
- show: 'onToggle'
- });
- UncontrolledDropdown.Menu = _DropdownMenu.default;
- UncontrolledDropdown.Toggle = _DropdownToggle.default;
- var _default = UncontrolledDropdown;
- exports.default = _default;
- module.exports = exports.default;
-
- /***/ }),
-
- /***/ "./node_modules/react-overlays/DropdownContext.js":
- /*!********************************************************!*\
- !*** ./node_modules/react-overlays/DropdownContext.js ***!
- \********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- var DropdownContext = _react.default.createContext({
- menuRef: function menuRef() {},
- toggleRef: function toggleRef() {},
- onToggle: function onToggle() {},
- toggleNode: undefined,
- alignEnd: null,
- show: null,
- drop: null
- });
-
- var _default = DropdownContext;
- exports.default = _default;
- module.exports = exports.default;
-
- /***/ }),
-
- /***/ "./node_modules/react-overlays/DropdownMenu.js":
- /*!*****************************************************!*\
- !*** ./node_modules/react-overlays/DropdownMenu.js ***!
- \*****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"));
-
- var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
-
- var _reactPopper = __webpack_require__(/*! react-popper */ "./node_modules/react-popper/lib/esm/index.js");
-
- var _DropdownContext = _interopRequireDefault(__webpack_require__(/*! ./DropdownContext */ "./node_modules/react-overlays/DropdownContext.js"));
-
- var _RootCloseWrapper = _interopRequireDefault(__webpack_require__(/*! ./RootCloseWrapper */ "./node_modules/react-overlays/RootCloseWrapper.js"));
-
- var _mapContextToProps = _interopRequireDefault(__webpack_require__(/*! react-context-toolbox/mapContextToProps */ "./node_modules/react-context-toolbox/mapContextToProps.js"));
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
-
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
-
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
-
- var DropdownMenu =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(DropdownMenu, _React$Component);
-
- function DropdownMenu() {
- var _this;
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
- _this.state = {
- toggleId: null
- };
- _this.popperIsInitialized = false;
-
- _this.handleClose = function (e) {
- if (!_this.props.onToggle) return;
-
- _this.props.onToggle(false, e);
- };
-
- return _this;
- }
-
- var _proto = DropdownMenu.prototype;
-
- _proto.getSnapshotBeforeUpdate = function getSnapshotBeforeUpdate(prevProps) {
- // If, to the best we can tell, this update won't reinitialize popper,
- // manually schedule an update
- var shouldUpdatePopper = !prevProps.show && this.props.show && this.popperIsInitialized && // a new reference node will already trigger this internally
- prevProps.toggleNode === this.props.toggleNode;
-
- if (this.props.show && this.props.usePopper && !this.popperIsInitialized) {
- this.popperIsInitialized = true;
- }
-
- return !!shouldUpdatePopper;
- };
-
- _proto.componentDidUpdate = function componentDidUpdate(_, __, shouldUpdatePopper) {
- if (shouldUpdatePopper && this.scheduleUpdate) {
- this.scheduleUpdate();
- }
- };
-
- _proto.render = function render() {
- var _this2 = this;
-
- var _this$props = this.props,
- show = _this$props.show,
- flip = _this$props.flip,
- menuRef = _this$props.menuRef,
- alignEnd = _this$props.alignEnd,
- drop = _this$props.drop,
- usePopper = _this$props.usePopper,
- toggleNode = _this$props.toggleNode,
- rootCloseEvent = _this$props.rootCloseEvent,
- _this$props$popperCon = _this$props.popperConfig,
- popperConfig = _this$props$popperCon === void 0 ? {} : _this$props$popperCon;
- var placement = alignEnd ? 'bottom-end' : 'bottom-start';
- if (drop === 'up') placement = alignEnd ? 'top-end' : 'top-start';
- if (drop === 'right') placement = alignEnd ? 'right-end' : 'right-start';
- if (drop === 'left') placement = alignEnd ? 'left-end' : 'left-start';
- var menu = null;
- var menuProps = {
- ref: menuRef,
- 'aria-labelledby': toggleNode && toggleNode.id
- };
- var childArgs = {
- show: show,
- alignEnd: alignEnd,
- close: this.handleClose
- };
-
- if (!usePopper) {
- menu = this.props.children(_extends({}, childArgs, {
- props: menuProps
- }));
- } else if (this.popperIsInitialized || show) {
- // Add it this way, so it doesn't override someones usage
- // with react-poppers <Reference>
- if (toggleNode) popperConfig.referenceElement = toggleNode;
- menu = _react.default.createElement(_reactPopper.Popper, _extends({}, popperConfig, {
- innerRef: menuRef,
- placement: placement,
- eventsEnabled: !!show,
- modifiers: _extends({
- flip: {
- enabled: !!flip
- }
- }, popperConfig.modifiers)
- }), function (_ref) {
- var ref = _ref.ref,
- style = _ref.style,
- popper = _objectWithoutPropertiesLoose(_ref, ["ref", "style"]);
-
- _this2.scheduleUpdate = popper.scheduleUpdate;
- return _this2.props.children(_extends({}, popper, childArgs, {
- props: _extends({}, menuProps, {
- ref: ref,
- style: style
- })
- }));
- });
- }
-
- return menu && _react.default.createElement(_RootCloseWrapper.default, {
- disabled: !show,
- event: rootCloseEvent,
- onRootClose: this.handleClose
- }, menu);
- };
-
- return DropdownMenu;
- }(_react.default.Component);
-
- DropdownMenu.displayName = 'ReactOverlaysDropdownMenu';
- DropdownMenu.propTypes = {
- /**
- * A render prop that returns a Menu element. The `props`
- * argument should spread through to **a component that can accept a ref**.
- *
- * @type {Function ({
- * show: boolean,
- * alignEnd: boolean,
- * close: (?SyntheticEvent) => void,
- * placement: Placement,
- * outOfBoundaries: ?boolean,
- * scheduleUpdate: () => void,
- * props: {
- * ref: (?HTMLElement) => void,
- * style: { [string]: string | number },
- * aria-labelledby: ?string
- * },
- * arrowProps: {
- * ref: (?HTMLElement) => void,
- * style: { [string]: string | number },
- * },
- * }) => React.Element}
- */
- children: _propTypes.default.func.isRequired,
-
- /**
- * Controls the visible state of the menu, generally this is
- * provided by the parent `Dropdown` component,
- * but may also be specified as a prop directly.
- */
- show: _propTypes.default.bool,
-
- /**
- * Aligns the dropdown menu to the 'end' of it's placement position.
- * Generally this is provided by the parent `Dropdown` component,
- * but may also be specified as a prop directly.
- */
- alignEnd: _propTypes.default.bool,
-
- /**
- * Enables the Popper.js `flip` modifier, allowing the Dropdown to
- * automatically adjust it's placement in case of overlap with the viewport or toggle.
- * Refer to the [flip docs](https://popper.js.org/popper-documentation.html#modifiers..flip.enabled) for more info
- */
- flip: _propTypes.default.bool,
- usePopper: _propTypes.default.oneOf([true, false]),
-
- /**
- * A set of popper options and props passed directly to react-popper's Popper component.
- */
- popperConfig: _propTypes.default.object,
-
- /**
- * Override the default event used by RootCloseWrapper.
- */
- rootCloseEvent: _propTypes.default.string,
-
- /** @private */
- onToggle: _propTypes.default.func,
-
- /** @private */
- menuRef: _propTypes.default.func,
-
- /** @private */
- drop: _propTypes.default.string,
-
- /** @private */
- toggleNode: _propTypes.default.any
- };
- DropdownMenu.defaultProps = {
- usePopper: true
- };
- var DecoratedDropdownMenu = (0, _mapContextToProps.default)(_DropdownContext.default, function (_ref2, props) {
- var show = _ref2.show,
- alignEnd = _ref2.alignEnd,
- toggle = _ref2.toggle,
- drop = _ref2.drop,
- menuRef = _ref2.menuRef,
- toggleNode = _ref2.toggleNode;
- return {
- drop: drop,
- menuRef: menuRef,
- toggleNode: toggleNode,
- onToggle: toggle,
- show: show == null ? props.show : show,
- alignEnd: alignEnd == null ? props.alignEnd : alignEnd
- };
- }, DropdownMenu);
- var _default = DecoratedDropdownMenu;
- exports.default = _default;
- module.exports = exports.default;
-
- /***/ }),
-
- /***/ "./node_modules/react-overlays/DropdownToggle.js":
- /*!*******************************************************!*\
- !*** ./node_modules/react-overlays/DropdownToggle.js ***!
- \*******************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"));
-
- var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
-
- var _DropdownContext = _interopRequireDefault(__webpack_require__(/*! ./DropdownContext */ "./node_modules/react-overlays/DropdownContext.js"));
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- var propTypes = {
- /**
- * A render prop that returns a Toggle element. The `props`
- * argument should spread through to **a component that can accept a ref**. Use
- * the `onToggle` argument to toggle the menu open or closed
- *
- * @type {Function ({
- * show: boolean,
- * toggle: (show: boolean) => void,
- * props: {
- * ref: (?HTMLElement) => void,
- * aria-haspopup: true
- * aria-expanded: boolean
- * },
- * }) => React.Element}
- */
- children: _propTypes.default.func.isRequired
- };
-
- function DropdownToggle(_ref) {
- var children = _ref.children;
- return _react.default.createElement(_DropdownContext.default.Consumer, null, function (_ref2) {
- var show = _ref2.show,
- toggle = _ref2.toggle,
- toggleRef = _ref2.toggleRef;
- return children({
- show: show,
- toggle: toggle,
- props: {
- ref: toggleRef,
- 'aria-haspopup': true,
- 'aria-expanded': !!show
- }
- });
- });
- }
-
- DropdownToggle.displayName = 'ReactOverlaysDropdownToggle';
- DropdownToggle.propTypes = propTypes;
- var _default = DropdownToggle;
- exports.default = _default;
- module.exports = exports.default;
-
- /***/ }),
-
- /***/ "./node_modules/react-overlays/Modal.js":
- /*!**********************************************!*\
- !*** ./node_modules/react-overlays/Modal.js ***!
- \**********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _activeElement = _interopRequireDefault(__webpack_require__(/*! dom-helpers/activeElement */ "./node_modules/dom-helpers/activeElement.js"));
-
- var _contains = _interopRequireDefault(__webpack_require__(/*! dom-helpers/query/contains */ "./node_modules/dom-helpers/query/contains.js"));
-
- var _inDOM = _interopRequireDefault(__webpack_require__(/*! dom-helpers/util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"));
-
- var _listen = _interopRequireDefault(__webpack_require__(/*! dom-helpers/events/listen */ "./node_modules/dom-helpers/events/listen.js"));
-
- var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"));
-
- var _componentOrElement = _interopRequireDefault(__webpack_require__(/*! prop-types-extra/lib/componentOrElement */ "./node_modules/prop-types-extra/lib/componentOrElement.js"));
-
- var _elementType = _interopRequireDefault(__webpack_require__(/*! prop-types-extra/lib/elementType */ "./node_modules/prop-types-extra/lib/elementType.js"));
-
- var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
-
- var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"));
-
- var _ModalManager = _interopRequireDefault(__webpack_require__(/*! ./ModalManager */ "./node_modules/react-overlays/ModalManager.js"));
-
- var _Portal = _interopRequireDefault(__webpack_require__(/*! ./Portal */ "./node_modules/react-overlays/Portal.js"));
-
- var _getContainer = _interopRequireDefault(__webpack_require__(/*! ./utils/getContainer */ "./node_modules/react-overlays/utils/getContainer.js"));
-
- var _ownerDocument = _interopRequireDefault(__webpack_require__(/*! ./utils/ownerDocument */ "./node_modules/react-overlays/utils/ownerDocument.js"));
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
-
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
-
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
-
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- var modalManager = new _ModalManager.default();
-
- function omitProps(props, propTypes) {
- var keys = Object.keys(props);
- var newProps = {};
- keys.map(function (prop) {
- if (!Object.prototype.hasOwnProperty.call(propTypes, prop)) {
- newProps[prop] = props[prop];
- }
- });
- return newProps;
- }
- /**
- * Love them or hate them, `<Modal />` provides a solid foundation for creating dialogs, lightboxes, or whatever else.
- * The Modal component renders its `children` node in front of a backdrop component.
- *
- * The Modal offers a few helpful features over using just a `<Portal/>` component and some styles:
- *
- * - Manages dialog stacking when one-at-a-time just isn't enough.
- * - Creates a backdrop, for disabling interaction below the modal.
- * - It properly manages focus; moving to the modal content, and keeping it there until the modal is closed.
- * - It disables scrolling of the page content while open.
- * - Adds the appropriate ARIA roles are automatically.
- * - Easily pluggable animations via a `<Transition/>` component.
- *
- * Note that, in the same way the backdrop element prevents users from clicking or interacting
- * with the page content underneath the Modal, Screen readers also need to be signaled to not to
- * interact with page content while the Modal is open. To do this, we use a common technique of applying
- * the `aria-hidden='true'` attribute to the non-Modal elements in the Modal `container`. This means that for
- * a Modal to be truly modal, it should have a `container` that is _outside_ your app's
- * React hierarchy (such as the default: document.body).
- */
-
-
- var Modal =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(Modal, _React$Component);
-
- function Modal() {
- var _this;
-
- for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
- _args[_key] = arguments[_key];
- }
-
- _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;
- _this.state = {
- exited: !_this.props.show
- };
-
- _this.onPortalRendered = function () {
- if (_this.props.onShow) {
- _this.props.onShow();
- } // autofocus after onShow, to not trigger a focus event for previous
- // modals before this one is shown.
-
-
- _this.autoFocus();
- };
-
- _this.onShow = function () {
- var doc = (0, _ownerDocument.default)(_assertThisInitialized(_assertThisInitialized(_this)));
- var container = (0, _getContainer.default)(_this.props.container, doc.body);
-
- _this.props.manager.add(_assertThisInitialized(_assertThisInitialized(_this)), container, _this.props.containerClassName);
-
- _this.removeKeydownListener = (0, _listen.default)(doc, 'keydown', _this.handleDocumentKeyDown);
- _this.removeFocusListener = (0, _listen.default)(doc, 'focus', // the timeout is necessary b/c this will run before the new modal is mounted
- // and so steals focus from it
- function () {
- return setTimeout(_this.enforceFocus);
- }, true);
- };
-
- _this.onHide = function () {
- _this.props.manager.remove(_assertThisInitialized(_assertThisInitialized(_this)));
-
- _this.removeKeydownListener();
-
- _this.removeFocusListener();
-
- if (_this.props.restoreFocus) {
- _this.restoreLastFocus();
- }
- };
-
- _this.setDialogRef = function (ref) {
- _this.dialog = ref;
- };
-
- _this.setBackdropRef = function (ref) {
- _this.backdrop = ref && _reactDom.default.findDOMNode(ref);
- };
-
- _this.handleHidden = function () {
- _this.setState({
- exited: true
- });
-
- _this.onHide();
-
- if (_this.props.onExited) {
- var _this$props;
-
- (_this$props = _this.props).onExited.apply(_this$props, arguments);
- }
- };
-
- _this.handleBackdropClick = function (e) {
- if (e.target !== e.currentTarget) {
- return;
- }
-
- if (_this.props.onBackdropClick) {
- _this.props.onBackdropClick(e);
- }
-
- if (_this.props.backdrop === true) {
- _this.props.onHide();
- }
- };
-
- _this.handleDocumentKeyDown = function (e) {
- if (_this.props.keyboard && e.keyCode === 27 && _this.isTopModal()) {
- if (_this.props.onEscapeKeyDown) {
- _this.props.onEscapeKeyDown(e);
- }
-
- _this.props.onHide();
- }
- };
-
- _this.enforceFocus = function () {
- if (!_this.props.enforceFocus || !_this._isMounted || !_this.isTopModal()) {
- return;
- }
-
- var currentActiveElement = (0, _activeElement.default)((0, _ownerDocument.default)(_assertThisInitialized(_assertThisInitialized(_this))));
-
- if (_this.dialog && !(0, _contains.default)(_this.dialog, currentActiveElement)) {
- _this.dialog.focus();
- }
- };
-
- _this.renderBackdrop = function () {
- var _this$props2 = _this.props,
- renderBackdrop = _this$props2.renderBackdrop,
- Transition = _this$props2.backdropTransition;
- var backdrop = renderBackdrop({
- ref: _this.setBackdropRef,
- onClick: _this.handleBackdropClick
- });
-
- if (Transition) {
- backdrop = _react.default.createElement(Transition, {
- appear: true,
- in: _this.props.show
- }, backdrop);
- }
-
- return backdrop;
- };
-
- return _this;
- }
-
- Modal.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps) {
- if (nextProps.show) {
- return {
- exited: false
- };
- } else if (!nextProps.transition) {
- // Otherwise let handleHidden take care of marking exited.
- return {
- exited: true
- };
- }
-
- return null;
- };
-
- var _proto = Modal.prototype;
-
- _proto.getSnapshotBeforeUpdate = function getSnapshotBeforeUpdate(prevProps) {
- if (_inDOM.default && !prevProps.show && this.props.show) {
- this.lastFocus = (0, _activeElement.default)();
- }
-
- return null;
- };
-
- _proto.componentDidMount = function componentDidMount() {
- this._isMounted = true;
-
- if (this.props.show) {
- this.onShow();
- }
- };
-
- _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
- var transition = this.props.transition;
-
- if (prevProps.show && !this.props.show && !transition) {
- // Otherwise handleHidden will call this.
- this.onHide();
- } else if (!prevProps.show && this.props.show) {
- this.onShow();
- }
- };
-
- _proto.componentWillUnmount = function componentWillUnmount() {
- var _this$props3 = this.props,
- show = _this$props3.show,
- transition = _this$props3.transition;
- this._isMounted = false;
-
- if (show || transition && !this.state.exited) {
- this.onHide();
- }
- };
-
- _proto.autoFocus = function autoFocus() {
- if (!this.props.autoFocus) return;
- var currentActiveElement = (0, _activeElement.default)((0, _ownerDocument.default)(this));
-
- if (this.dialog && !(0, _contains.default)(this.dialog, currentActiveElement)) {
- this.lastFocus = currentActiveElement;
- this.dialog.focus();
- }
- };
-
- _proto.restoreLastFocus = function restoreLastFocus() {
- // Support: <=IE11 doesn't support `focus()` on svg elements (RB: #917)
- if (this.lastFocus && this.lastFocus.focus) {
- this.lastFocus.focus();
- this.lastFocus = null;
- }
- };
-
- _proto.isTopModal = function isTopModal() {
- return this.props.manager.isTopModal(this);
- };
-
- _proto.render = function render() {
- var _this$props4 = this.props,
- show = _this$props4.show,
- container = _this$props4.container,
- children = _this$props4.children,
- renderDialog = _this$props4.renderDialog,
- _this$props4$role = _this$props4.role,
- role = _this$props4$role === void 0 ? 'dialog' : _this$props4$role,
- Transition = _this$props4.transition,
- backdrop = _this$props4.backdrop,
- className = _this$props4.className,
- style = _this$props4.style,
- onExit = _this$props4.onExit,
- onExiting = _this$props4.onExiting,
- onEnter = _this$props4.onEnter,
- onEntering = _this$props4.onEntering,
- onEntered = _this$props4.onEntered,
- props = _objectWithoutPropertiesLoose(_this$props4, ["show", "container", "children", "renderDialog", "role", "transition", "backdrop", "className", "style", "onExit", "onExiting", "onEnter", "onEntering", "onEntered"]);
-
- if (!(show || Transition && !this.state.exited)) {
- return null;
- }
-
- var dialogProps = _extends({
- role: role,
- ref: this.setDialogRef,
- // apparently only works on the dialog role element
- 'aria-modal': role === 'dialog' ? true : undefined
- }, omitProps(props, Modal.propTypes), {
- style: style,
- className: className,
- tabIndex: '-1'
- });
-
- var dialog = renderDialog ? renderDialog(dialogProps) : _react.default.createElement("div", dialogProps, _react.default.cloneElement(children, {
- role: 'document'
- }));
-
- if (Transition) {
- dialog = _react.default.createElement(Transition, {
- appear: true,
- unmountOnExit: true,
- in: show,
- onExit: onExit,
- onExiting: onExiting,
- onExited: this.handleHidden,
- onEnter: onEnter,
- onEntering: onEntering,
- onEntered: onEntered
- }, dialog);
- }
-
- return _react.default.createElement(_Portal.default, {
- container: container,
- onRendered: this.onPortalRendered
- }, _react.default.createElement(_react.default.Fragment, null, backdrop && this.renderBackdrop(), dialog));
- };
-
- return Modal;
- }(_react.default.Component);
-
- Modal.propTypes = {
- /**
- * Set the visibility of the Modal
- */
- show: _propTypes.default.bool,
-
- /**
- * A Node, Component instance, or function that returns either. The Modal is appended to it's container element.
- *
- * For the sake of assistive technologies, the container should usually be the document body, so that the rest of the
- * page content can be placed behind a virtual backdrop as well as a visual one.
- */
- container: _propTypes.default.oneOfType([_componentOrElement.default, _propTypes.default.func]),
-
- /**
- * A callback fired when the Modal is opening.
- */
- onShow: _propTypes.default.func,
-
- /**
- * A callback fired when either the backdrop is clicked, or the escape key is pressed.
- *
- * The `onHide` callback only signals intent from the Modal,
- * you must actually set the `show` prop to `false` for the Modal to close.
- */
- onHide: _propTypes.default.func,
-
- /**
- * Include a backdrop component.
- */
- backdrop: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.oneOf(['static'])]),
-
- /**
- * A function that returns the dialog component. Useful for custom
- * rendering. **Note:** the component should make sure to apply the provided ref.
- *
- * ```js
- * renderDialog={props => <MyDialog {...props} />}
- * ```
- */
- renderDialog: _propTypes.default.func,
-
- /**
- * A function that returns a backdrop component. Useful for custom
- * backdrop rendering.
- *
- * ```js
- * renderBackdrop={props => <MyBackdrop {...props} />}
- * ```
- */
- renderBackdrop: _propTypes.default.func,
-
- /**
- * A callback fired when the escape key, if specified in `keyboard`, is pressed.
- */
- onEscapeKeyDown: _propTypes.default.func,
-
- /**
- * A callback fired when the backdrop, if specified, is clicked.
- */
- onBackdropClick: _propTypes.default.func,
-
- /**
- * A css class or set of classes applied to the modal container when the modal is open,
- * and removed when it is closed.
- */
- containerClassName: _propTypes.default.string,
-
- /**
- * Close the modal when escape key is pressed
- */
- keyboard: _propTypes.default.bool,
-
- /**
- * A `react-transition-group@2.0.0` `<Transition/>` component used
- * to control animations for the dialog component.
- */
- transition: _elementType.default,
-
- /**
- * A `react-transition-group@2.0.0` `<Transition/>` component used
- * to control animations for the backdrop components.
- */
- backdropTransition: _elementType.default,
-
- /**
- * When `true` The modal will automatically shift focus to itself when it opens, and
- * replace it to the last focused element when it closes. This also
- * works correctly with any Modal children that have the `autoFocus` prop.
- *
- * Generally this should never be set to `false` as it makes the Modal less
- * accessible to assistive technologies, like screen readers.
- */
- autoFocus: _propTypes.default.bool,
-
- /**
- * When `true` The modal will prevent focus from leaving the Modal while open.
- *
- * Generally this should never be set to `false` as it makes the Modal less
- * accessible to assistive technologies, like screen readers.
- */
- enforceFocus: _propTypes.default.bool,
-
- /**
- * When `true` The modal will restore focus to previously focused element once
- * modal is hidden
- */
- restoreFocus: _propTypes.default.bool,
-
- /**
- * Callback fired before the Modal transitions in
- */
- onEnter: _propTypes.default.func,
-
- /**
- * Callback fired as the Modal begins to transition in
- */
- onEntering: _propTypes.default.func,
-
- /**
- * Callback fired after the Modal finishes transitioning in
- */
- onEntered: _propTypes.default.func,
-
- /**
- * Callback fired right before the Modal transitions out
- */
- onExit: _propTypes.default.func,
-
- /**
- * Callback fired as the Modal begins to transition out
- */
- onExiting: _propTypes.default.func,
-
- /**
- * Callback fired after the Modal finishes transitioning out
- */
- onExited: _propTypes.default.func,
-
- /**
- * A ModalManager instance used to track and manage the state of open
- * Modals. Useful when customizing how modals interact within a container
- */
- manager: _propTypes.default.object.isRequired
- };
- Modal.defaultProps = {
- show: false,
- role: 'dialog',
- backdrop: true,
- keyboard: true,
- autoFocus: true,
- enforceFocus: true,
- restoreFocus: true,
- onHide: function onHide() {},
- manager: modalManager,
- renderBackdrop: function renderBackdrop(props) {
- return _react.default.createElement("div", props);
- }
- };
- Modal.Manager = _ModalManager.default;
- var _default = Modal;
- exports.default = _default;
- module.exports = exports.default;
-
- /***/ }),
-
- /***/ "./node_modules/react-overlays/ModalManager.js":
- /*!*****************************************************!*\
- !*** ./node_modules/react-overlays/ModalManager.js ***!
- \*****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _class = _interopRequireDefault(__webpack_require__(/*! dom-helpers/class */ "./node_modules/dom-helpers/class/index.js"));
-
- var _style = _interopRequireDefault(__webpack_require__(/*! dom-helpers/style */ "./node_modules/dom-helpers/style/index.js"));
-
- var _scrollbarSize = _interopRequireDefault(__webpack_require__(/*! dom-helpers/util/scrollbarSize */ "./node_modules/dom-helpers/util/scrollbarSize.js"));
-
- var _isOverflowing = _interopRequireDefault(__webpack_require__(/*! ./utils/isOverflowing */ "./node_modules/react-overlays/utils/isOverflowing.js"));
-
- var _manageAriaHidden = __webpack_require__(/*! ./utils/manageAriaHidden */ "./node_modules/react-overlays/utils/manageAriaHidden.js");
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function findIndexOf(arr, cb) {
- var idx = -1;
- arr.some(function (d, i) {
- if (cb(d, i)) {
- idx = i;
- return true;
- }
- });
- return idx;
- }
- /**
- * Proper state managment for containers and the modals in those containers.
- *
- * @internal Used by the Modal to ensure proper styling of containers.
- */
-
-
- var ModalManager =
- /*#__PURE__*/
- function () {
- function ModalManager(_temp) {
- var _ref = _temp === void 0 ? {} : _temp,
- _ref$hideSiblingNodes = _ref.hideSiblingNodes,
- hideSiblingNodes = _ref$hideSiblingNodes === void 0 ? true : _ref$hideSiblingNodes,
- _ref$handleContainerO = _ref.handleContainerOverflow,
- handleContainerOverflow = _ref$handleContainerO === void 0 ? true : _ref$handleContainerO;
-
- this.hideSiblingNodes = hideSiblingNodes;
- this.handleContainerOverflow = handleContainerOverflow;
- this.modals = [];
- this.containers = [];
- this.data = [];
- this.scrollbarSize = (0, _scrollbarSize.default)();
- }
-
- var _proto = ModalManager.prototype;
-
- _proto.isContainerOverflowing = function isContainerOverflowing(modal) {
- var data = this.data[this.containerIndexFromModal(modal)];
- return data && data.overflowing;
- };
-
- _proto.containerIndexFromModal = function containerIndexFromModal(modal) {
- return findIndexOf(this.data, function (d) {
- return d.modals.indexOf(modal) !== -1;
- });
- };
-
- _proto.setContainerStyle = function setContainerStyle(containerState, container) {
- var style = {
- overflow: 'hidden' // we are only interested in the actual `style` here
- // becasue we will override it
-
- };
- containerState.style = {
- overflow: container.style.overflow,
- paddingRight: container.style.paddingRight
- };
-
- if (containerState.overflowing) {
- // use computed style, here to get the real padding
- // to add our scrollbar width
- style.paddingRight = parseInt((0, _style.default)(container, 'paddingRight') || 0, 10) + this.scrollbarSize + "px";
- }
-
- (0, _style.default)(container, style);
- };
-
- _proto.removeContainerStyle = function removeContainerStyle(containerState, container) {
- var style = containerState.style;
- Object.keys(style).forEach(function (key) {
- container.style[key] = style[key];
- });
- };
-
- _proto.add = function add(modal, container, className) {
- var modalIdx = this.modals.indexOf(modal);
- var containerIdx = this.containers.indexOf(container);
-
- if (modalIdx !== -1) {
- return modalIdx;
- }
-
- modalIdx = this.modals.length;
- this.modals.push(modal);
-
- if (this.hideSiblingNodes) {
- (0, _manageAriaHidden.hideSiblings)(container, modal);
- }
-
- if (containerIdx !== -1) {
- this.data[containerIdx].modals.push(modal);
- return modalIdx;
- }
-
- var data = {
- modals: [modal],
- //right now only the first modal of a container will have its classes applied
- classes: className ? className.split(/\s+/) : [],
- overflowing: (0, _isOverflowing.default)(container)
- };
-
- if (this.handleContainerOverflow) {
- this.setContainerStyle(data, container);
- }
-
- data.classes.forEach(_class.default.addClass.bind(null, container));
- this.containers.push(container);
- this.data.push(data);
- return modalIdx;
- };
-
- _proto.remove = function remove(modal) {
- var modalIdx = this.modals.indexOf(modal);
-
- if (modalIdx === -1) {
- return;
- }
-
- var containerIdx = this.containerIndexFromModal(modal);
- var data = this.data[containerIdx];
- var container = this.containers[containerIdx];
- data.modals.splice(data.modals.indexOf(modal), 1);
- this.modals.splice(modalIdx, 1); // if that was the last modal in a container,
- // clean up the container
-
- if (data.modals.length === 0) {
- data.classes.forEach(_class.default.removeClass.bind(null, container));
-
- if (this.handleContainerOverflow) {
- this.removeContainerStyle(data, container);
- }
-
- if (this.hideSiblingNodes) {
- (0, _manageAriaHidden.showSiblings)(container, modal);
- }
-
- this.containers.splice(containerIdx, 1);
- this.data.splice(containerIdx, 1);
- } else if (this.hideSiblingNodes) {
- //otherwise make sure the next top modal is visible to a SR
- var _data$modals = data.modals[data.modals.length - 1],
- backdrop = _data$modals.backdrop,
- dialog = _data$modals.dialog;
- (0, _manageAriaHidden.ariaHidden)(false, dialog);
- (0, _manageAriaHidden.ariaHidden)(false, backdrop);
- }
- };
-
- _proto.isTopModal = function isTopModal(modal) {
- return !!this.modals.length && this.modals[this.modals.length - 1] === modal;
- };
-
- return ModalManager;
- }();
-
- var _default = ModalManager;
- exports.default = _default;
- module.exports = exports.default;
-
- /***/ }),
-
- /***/ "./node_modules/react-overlays/Overlay.js":
- /*!************************************************!*\
- !*** ./node_modules/react-overlays/Overlay.js ***!
- \************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"));
-
- var _elementType = _interopRequireDefault(__webpack_require__(/*! prop-types-extra/lib/elementType */ "./node_modules/prop-types-extra/lib/elementType.js"));
-
- var _componentOrElement = _interopRequireDefault(__webpack_require__(/*! prop-types-extra/lib/componentOrElement */ "./node_modules/prop-types-extra/lib/componentOrElement.js"));
-
- var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
-
- var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"));
-
- var _Portal = _interopRequireDefault(__webpack_require__(/*! ./Portal */ "./node_modules/react-overlays/Portal.js"));
-
- var _RootCloseWrapper = _interopRequireDefault(__webpack_require__(/*! ./RootCloseWrapper */ "./node_modules/react-overlays/RootCloseWrapper.js"));
-
- var _reactPopper = __webpack_require__(/*! react-popper */ "./node_modules/react-popper/lib/esm/index.js");
-
- var _forwardRef = _interopRequireDefault(__webpack_require__(/*! react-context-toolbox/forwardRef */ "./node_modules/react-context-toolbox/forwardRef.js"));
-
- var _WaitForContainer = _interopRequireDefault(__webpack_require__(/*! ./WaitForContainer */ "./node_modules/react-overlays/WaitForContainer.js"));
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
-
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
-
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
-
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- /**
- * Built on top of `<Position/>` and `<Portal/>`, the overlay component is
- * great for custom tooltip overlays.
- */
- var Overlay =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(Overlay, _React$Component);
-
- function Overlay(props, context) {
- var _this;
-
- _this = _React$Component.call(this, props, context) || this;
-
- _this.handleHidden = function () {
- _this.setState({
- exited: true
- });
-
- if (_this.props.onExited) {
- var _this$props;
-
- (_this$props = _this.props).onExited.apply(_this$props, arguments);
- }
- };
-
- _this.state = {
- exited: !props.show
- };
- _this.onHiddenListener = _this.handleHidden.bind(_assertThisInitialized(_assertThisInitialized(_this)));
- _this._lastTarget = null;
- return _this;
- }
-
- Overlay.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps) {
- if (nextProps.show) {
- return {
- exited: false
- };
- } else if (!nextProps.transition) {
- // Otherwise let handleHidden take care of marking exited.
- return {
- exited: true
- };
- }
-
- return null;
- };
-
- var _proto = Overlay.prototype;
-
- _proto.componentDidMount = function componentDidMount() {
- this.setState({
- target: this.getTarget()
- });
- };
-
- _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
- if (this.props === prevProps) return;
- var target = this.getTarget();
-
- if (target !== this.state.target) {
- this.setState({
- target: target
- });
- }
- };
-
- _proto.getTarget = function getTarget() {
- var target = this.props.target;
- target = typeof target === 'function' ? target() : target;
- return target && _reactDom.default.findDOMNode(target) || null;
- };
-
- _proto.render = function render() {
- var _this2 = this;
-
- var _this$props2 = this.props,
- _0 = _this$props2.target,
- container = _this$props2.container,
- containerPadding = _this$props2.containerPadding,
- placement = _this$props2.placement,
- rootClose = _this$props2.rootClose,
- children = _this$props2.children,
- flip = _this$props2.flip,
- _this$props2$popperCo = _this$props2.popperConfig,
- popperConfig = _this$props2$popperCo === void 0 ? {} : _this$props2$popperCo,
- Transition = _this$props2.transition,
- props = _objectWithoutPropertiesLoose(_this$props2, ["target", "container", "containerPadding", "placement", "rootClose", "children", "flip", "popperConfig", "transition"]);
-
- var target = this.state.target; // Don't un-render the overlay while it's transitioning out.
-
- var mountOverlay = props.show || Transition && !this.state.exited;
-
- if (!mountOverlay) {
- // Don't bother showing anything if we don't have to.
- return null;
- }
-
- var child = children;
- var _popperConfig$modifie = popperConfig.modifiers,
- modifiers = _popperConfig$modifie === void 0 ? {} : _popperConfig$modifie;
-
- var popperProps = _extends({}, popperConfig, {
- placement: placement,
- referenceElement: target,
- enableEvents: props.show,
- modifiers: _extends({}, modifiers, {
- preventOverflow: _extends({
- padding: containerPadding || 5
- }, modifiers.preventOverflow),
- flip: _extends({
- enabled: !!flip
- }, modifiers.preventOverflow)
- })
- });
-
- child = _react.default.createElement(_reactPopper.Popper, popperProps, function (_ref) {
- var arrowProps = _ref.arrowProps,
- style = _ref.style,
- ref = _ref.ref,
- popper = _objectWithoutPropertiesLoose(_ref, ["arrowProps", "style", "ref"]);
-
- _this2.popper = popper;
-
- var innerChild = _this2.props.children(_extends({}, popper, {
- // popper doesn't set the initial placement
- placement: popper.placement || placement,
- show: props.show,
- arrowProps: arrowProps,
- props: {
- ref: ref,
- style: style
- }
- }));
-
- if (Transition) {
- var onExit = props.onExit,
- onExiting = props.onExiting,
- onEnter = props.onEnter,
- onEntering = props.onEntering,
- onEntered = props.onEntered;
- innerChild = _react.default.createElement(Transition, {
- in: props.show,
- appear: true,
- onExit: onExit,
- onExiting: onExiting,
- onExited: _this2.onHiddenListener,
- onEnter: onEnter,
- onEntering: onEntering,
- onEntered: onEntered
- }, innerChild);
- }
-
- return innerChild;
- });
-
- if (rootClose) {
- child = _react.default.createElement(_RootCloseWrapper.default, {
- onRootClose: props.onHide,
- event: props.rootCloseEvent,
- disabled: props.rootCloseDisabled
- }, child);
- }
-
- return _react.default.createElement(_Portal.default, {
- container: container
- }, child);
- };
-
- return Overlay;
- }(_react.default.Component);
-
- Overlay.propTypes = _extends({}, _Portal.default.propTypes, {
- /**
- * Set the visibility of the Overlay
- */
- show: _propTypes.default.bool,
-
- /** Specify where the overlay element is positioned in relation to the target element */
- placement: _propTypes.default.oneOf(_reactPopper.placements),
-
- /**
- * A Node, Component instance, or function that returns either. The `container` will have the Portal children
- * appended to it.
- */
- container: _propTypes.default.oneOfType([_componentOrElement.default, _propTypes.default.func]),
-
- /**
- * Enables the Popper.js `flip` modifier, allowing the Overlay to
- * automatically adjust it's placement in case of overlap with the viewport or toggle.
- * Refer to the [flip docs](https://popper.js.org/popper-documentation.html#modifiers..flip.enabled) for more info
- */
- flip: _propTypes.default.bool,
-
- /**
- * A render prop that returns an element to overlay and position. See
- * the [react-popper documentation](https://github.com/FezVrasta/react-popper#children) for more info.
- *
- * @type {Function ({
- * show: boolean,
- * placement: Placement,
- * outOfBoundaries: ?boolean,
- * scheduleUpdate: () => void,
- * props: {
- * ref: (?HTMLElement) => void,
- * style: { [string]: string | number },
- * aria-labelledby: ?string
- * },
- * arrowProps: {
- * ref: (?HTMLElement) => void,
- * style: { [string]: string | number },
- * },
- * }) => React.Element}
- */
- children: _propTypes.default.func.isRequired,
-
- /**
- * A set of popper options and props passed directly to react-popper's Popper component.
- */
- popperConfig: _propTypes.default.object,
-
- /**
- * Specify whether the overlay should trigger `onHide` when the user clicks outside the overlay
- */
- rootClose: _propTypes.default.bool,
-
- /**
- * Specify event for toggling overlay
- */
- rootCloseEvent: _RootCloseWrapper.default.propTypes.event,
-
- /**
- * Specify disabled for disable RootCloseWrapper
- */
- rootCloseDisabled: _RootCloseWrapper.default.propTypes.disabled,
-
- /**
- * A Callback fired by the Overlay when it wishes to be hidden.
- *
- * __required__ when `rootClose` is `true`.
- *
- * @type func
- */
- onHide: function onHide(props) {
- var propType = _propTypes.default.func;
-
- if (props.rootClose) {
- propType = propType.isRequired;
- }
-
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- return propType.apply(void 0, [props].concat(args));
- },
-
- /**
- * A `react-transition-group@2.0.0` `<Transition/>` component
- * used to animate the overlay as it changes visibility.
- */
- transition: _elementType.default,
-
- /**
- * Callback fired before the Overlay transitions in
- */
- onEnter: _propTypes.default.func,
-
- /**
- * Callback fired as the Overlay begins to transition in
- */
- onEntering: _propTypes.default.func,
-
- /**
- * Callback fired after the Overlay finishes transitioning in
- */
- onEntered: _propTypes.default.func,
-
- /**
- * Callback fired right before the Overlay transitions out
- */
- onExit: _propTypes.default.func,
-
- /**
- * Callback fired as the Overlay begins to transition out
- */
- onExiting: _propTypes.default.func,
-
- /**
- * Callback fired after the Overlay finishes transitioning out
- */
- onExited: _propTypes.default.func
- });
-
- var _default = (0, _forwardRef.default)(function (props, ref) {
- return (// eslint-disable-next-line react/prop-types
- _react.default.createElement(_WaitForContainer.default, {
- container: props.container
- }, function (container) {
- return _react.default.createElement(Overlay, _extends({}, props, {
- ref: ref,
- container: container
- }));
- })
- );
- }, {
- displayName: 'withContainer(Overlay)'
- });
-
- exports.default = _default;
- module.exports = exports.default;
-
- /***/ }),
-
- /***/ "./node_modules/react-overlays/Portal.js":
- /*!***********************************************!*\
- !*** ./node_modules/react-overlays/Portal.js ***!
- \***********************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"));
-
- var _componentOrElement = _interopRequireDefault(__webpack_require__(/*! prop-types-extra/lib/componentOrElement */ "./node_modules/prop-types-extra/lib/componentOrElement.js"));
-
- var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
-
- var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"));
-
- var _WaitForContainer = _interopRequireDefault(__webpack_require__(/*! ./WaitForContainer */ "./node_modules/react-overlays/WaitForContainer.js"));
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
-
- /**
- * The `<Portal/>` component renders its children into a new "subtree" outside of current component hierarchy.
- * You can think of it as a declarative `appendChild()`, or jQuery's `$.fn.appendTo()`.
- * The children of `<Portal/>` component will be appended to the `container` specified.
- */
- var Portal =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(Portal, _React$Component);
-
- function Portal() {
- return _React$Component.apply(this, arguments) || this;
- }
-
- var _proto = Portal.prototype;
-
- _proto.render = function render() {
- var _this = this;
-
- return this.props.children ? _react.default.createElement(_WaitForContainer.default, {
- container: this.props.container,
- onContainerResolved: this.props.onRendered
- }, function (container) {
- return _reactDom.default.createPortal(_this.props.children, container);
- }) : null;
- };
-
- return Portal;
- }(_react.default.Component);
-
- Portal.displayName = 'Portal';
- Portal.propTypes = {
- /**
- * A Node, Component instance, or function that returns either. The `container` will have the Portal children
- * appended to it.
- */
- container: _propTypes.default.oneOfType([_componentOrElement.default, _propTypes.default.func]),
- onRendered: _propTypes.default.func
- };
- var _default = Portal;
- exports.default = _default;
- module.exports = exports.default;
-
- /***/ }),
-
- /***/ "./node_modules/react-overlays/RootCloseWrapper.js":
- /*!*********************************************************!*\
- !*** ./node_modules/react-overlays/RootCloseWrapper.js ***!
- \*********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _contains = _interopRequireDefault(__webpack_require__(/*! dom-helpers/query/contains */ "./node_modules/dom-helpers/query/contains.js"));
-
- var _listen = _interopRequireDefault(__webpack_require__(/*! dom-helpers/events/listen */ "./node_modules/dom-helpers/events/listen.js"));
-
- var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"));
-
- var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
-
- var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"));
-
- var _ownerDocument = _interopRequireDefault(__webpack_require__(/*! ./utils/ownerDocument */ "./node_modules/react-overlays/utils/ownerDocument.js"));
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
-
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- var escapeKeyCode = 27;
-
- var noop = function noop() {};
-
- function isLeftClickEvent(event) {
- return event.button === 0;
- }
-
- function isModifiedEvent(event) {
- return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
- }
- /**
- * The `<RootCloseWrapper/>` component registers your callback on the document
- * when rendered. Powers the `<Overlay/>` component. This is used achieve modal
- * style behavior where your callback is triggered when the user tries to
- * interact with the rest of the document or hits the `esc` key.
- */
-
-
- var RootCloseWrapper =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(RootCloseWrapper, _React$Component);
-
- function RootCloseWrapper(props, context) {
- var _this;
-
- _this = _React$Component.call(this, props, context) || this;
-
- _this.addEventListeners = function () {
- var event = _this.props.event;
- var doc = (0, _ownerDocument.default)(_assertThisInitialized(_assertThisInitialized(_this))); // Use capture for this listener so it fires before React's listener, to
- // avoid false positives in the contains() check below if the target DOM
- // element is removed in the React mouse callback.
-
- _this.removeMouseCaptureListener = (0, _listen.default)(doc, event, _this.handleMouseCapture, true);
- _this.removeMouseListener = (0, _listen.default)(doc, event, _this.handleMouse);
- _this.removeKeyupListener = (0, _listen.default)(doc, 'keyup', _this.handleKeyUp);
-
- if ('ontouchstart' in doc.documentElement) {
- _this.mobileSafariHackListeners = [].slice.call(document.body.children).map(function (el) {
- return (0, _listen.default)(el, 'mousemove', noop);
- });
- }
- };
-
- _this.removeEventListeners = function () {
- if (_this.removeMouseCaptureListener) _this.removeMouseCaptureListener();
- if (_this.removeMouseListener) _this.removeMouseListener();
- if (_this.removeKeyupListener) _this.removeKeyupListener();
- if (_this.mobileSafariHackListeners) _this.mobileSafariHackListeners.forEach(function (remove) {
- return remove();
- });
- };
-
- _this.handleMouseCapture = function (e) {
- _this.preventMouseRootClose = isModifiedEvent(e) || !isLeftClickEvent(e) || (0, _contains.default)(_reactDom.default.findDOMNode(_assertThisInitialized(_assertThisInitialized(_this))), e.target);
- };
-
- _this.handleMouse = function (e) {
- if (!_this.preventMouseRootClose && _this.props.onRootClose) {
- _this.props.onRootClose(e);
- }
- };
-
- _this.handleKeyUp = function (e) {
- if (e.keyCode === escapeKeyCode && _this.props.onRootClose) {
- _this.props.onRootClose(e);
- }
- };
-
- _this.preventMouseRootClose = false;
- return _this;
- }
-
- var _proto = RootCloseWrapper.prototype;
-
- _proto.componentDidMount = function componentDidMount() {
- if (!this.props.disabled) {
- this.addEventListeners();
- }
- };
-
- _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
- if (!this.props.disabled && prevProps.disabled) {
- this.addEventListeners();
- } else if (this.props.disabled && !prevProps.disabled) {
- this.removeEventListeners();
- }
- };
-
- _proto.componentWillUnmount = function componentWillUnmount() {
- if (!this.props.disabled) {
- this.removeEventListeners();
- }
- };
-
- _proto.render = function render() {
- return this.props.children;
- };
-
- return RootCloseWrapper;
- }(_react.default.Component);
-
- RootCloseWrapper.displayName = 'RootCloseWrapper';
- RootCloseWrapper.propTypes = {
- /**
- * Callback fired after click or mousedown. Also triggers when user hits `esc`.
- */
- onRootClose: _propTypes.default.func,
-
- /**
- * Children to render.
- */
- children: _propTypes.default.element,
-
- /**
- * Disable the the RootCloseWrapper, preventing it from triggering `onRootClose`.
- */
- disabled: _propTypes.default.bool,
-
- /**
- * Choose which document mouse event to bind to.
- */
- event: _propTypes.default.oneOf(['click', 'mousedown'])
- };
- RootCloseWrapper.defaultProps = {
- event: 'click'
- };
- var _default = RootCloseWrapper;
- exports.default = _default;
- module.exports = exports.default;
-
- /***/ }),
-
- /***/ "./node_modules/react-overlays/WaitForContainer.js":
- /*!*********************************************************!*\
- !*** ./node_modules/react-overlays/WaitForContainer.js ***!
- \*********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = void 0;
-
- var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"));
-
- var _componentOrElement = _interopRequireDefault(__webpack_require__(/*! prop-types-extra/lib/componentOrElement */ "./node_modules/prop-types-extra/lib/componentOrElement.js"));
-
- var _inDOM = _interopRequireDefault(__webpack_require__(/*! dom-helpers/util/inDOM */ "./node_modules/dom-helpers/util/inDOM.js"));
-
- var _ownerDocument = _interopRequireDefault(__webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js"));
-
- var _react = _interopRequireDefault(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
-
- var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"));
-
- var _getContainer = _interopRequireDefault(__webpack_require__(/*! ./utils/getContainer */ "./node_modules/react-overlays/utils/getContainer.js"));
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
-
- var propTypes = {
- /**
- * A Node, Component instance, or function that returns either. The `container` will have the Portal children
- * appended to it.
- */
- container: _propTypes.default.oneOfType([_componentOrElement.default, _propTypes.default.func]),
- onContainerResolved: _propTypes.default.func
- };
-
- var WaitForContainer =
- /*#__PURE__*/
- function (_React$Component) {
- _inheritsLoose(WaitForContainer, _React$Component);
-
- function WaitForContainer() {
- var _this;
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
- if (!_inDOM.default) return _assertThisInitialized(_this);
- var container = _this.props.container;
- if (typeof container === 'function') container = container();
-
- if (container && !_reactDom.default.findDOMNode(container)) {
- // The container is a React component that has not yet been rendered.
- // Don't set the container node yet.
- return _assertThisInitialized(_this);
- }
-
- _this.setContainer(container);
-
- return _this;
- }
-
- var _proto = WaitForContainer.prototype;
-
- _proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) {
- if (nextProps.container !== this.props.container) {
- this.setContainer(nextProps.container);
- }
- };
-
- _proto.componentDidMount = function componentDidMount() {
- if (!this._container) {
- this.setContainer(this.props.container);
- this.forceUpdate(this.props.onContainerResolved);
- } else if (this.props.onContainerResolved) {
- this.props.onContainerResolved();
- }
- };
-
- _proto.componentWillUnmount = function componentWillUnmount() {
- this._container = null;
- };
-
- _proto.setContainer = function setContainer(container) {
- this._container = (0, _getContainer.default)(container, (0, _ownerDocument.default)().body);
- };
-
- _proto.render = function render() {
- return this._container ? this.props.children(this._container) : null;
- };
-
- return WaitForContainer;
- }(_react.default.Component);
-
- WaitForContainer.propTypes = propTypes;
- var _default = WaitForContainer;
- exports.default = _default;
- module.exports = exports.default;
-
- /***/ }),
-
- /***/ "./node_modules/react-overlays/node_modules/uncontrollable/esm/hook.js":
- /*!*****************************************************************************!*\
- !*** ./node_modules/react-overlays/node_modules/uncontrollable/esm/hook.js ***!
- \*****************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return useUncontrolled; });
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/react-overlays/node_modules/uncontrollable/esm/utils.js");
-
-
-
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
-
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
-
-
-
- function useUncontrolled(props, config) {
- return Object.keys(config).reduce(function (result, fieldName) {
- var _extends2;
-
- var defaultValue = result[_utils__WEBPACK_IMPORTED_MODULE_3__["defaultKey"](fieldName)],
- propsValue = result[fieldName],
- rest = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(result, [_utils__WEBPACK_IMPORTED_MODULE_3__["defaultKey"](fieldName), fieldName].map(_toPropertyKey));
-
- var handlerName = config[fieldName];
- var prevProps = Object(react__WEBPACK_IMPORTED_MODULE_2__["useRef"])({});
-
- var _useState = Object(react__WEBPACK_IMPORTED_MODULE_2__["useState"])(defaultValue),
- stateValue = _useState[0],
- setState = _useState[1];
-
- var isProp = _utils__WEBPACK_IMPORTED_MODULE_3__["isProp"](props, fieldName);
- var wasProp = _utils__WEBPACK_IMPORTED_MODULE_3__["isProp"](prevProps.current, fieldName);
- prevProps.current = props;
- /**
- * If a prop switches from controlled to Uncontrolled
- * reset its value to the defaultValue
- */
-
- if (!isProp && wasProp) {
- setState(defaultValue);
- }
-
- var propsHandler = props[handlerName];
- var handler = Object(react__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (value) {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- if (propsHandler) propsHandler.apply(void 0, [value].concat(args));
- setState(value);
- }, [setState, propsHandler]);
- return Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, rest, (_extends2 = {}, _extends2[fieldName] = isProp ? propsValue : stateValue, _extends2[handlerName] = handler, _extends2));
- }, props);
- }
-
- /***/ }),
-
- /***/ "./node_modules/react-overlays/node_modules/uncontrollable/esm/index.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/react-overlays/node_modules/uncontrollable/esm/index.js ***!
- \******************************************************************************/
- /*! exports provided: useUncontrolled, uncontrollable, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uncontrollable", function() { return uncontrollable; });
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! invariant */ "./node_modules/invariant/browser.js");
- /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./node_modules/react-overlays/node_modules/uncontrollable/esm/utils.js");
- /* harmony import */ var _hook_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./hook.js */ "./node_modules/react-overlays/node_modules/uncontrollable/esm/hook.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useUncontrolled", function() { return _hook_js__WEBPACK_IMPORTED_MODULE_6__["default"]; });
-
-
-
-
-
-
-
-
- function uncontrollable(Component, controlledValues, methods) {
- if (methods === void 0) {
- methods = [];
- }
-
- var displayName = Component.displayName || Component.name || 'Component';
- var canAcceptRef = _utils__WEBPACK_IMPORTED_MODULE_5__["canAcceptRef"](Component);
- var controlledProps = Object.keys(controlledValues);
- var PROPS_TO_OMIT = controlledProps.map(_utils__WEBPACK_IMPORTED_MODULE_5__["defaultKey"]);
- !(canAcceptRef || !methods.length) ? true ? invariant__WEBPACK_IMPORTED_MODULE_4___default()(false, '[uncontrollable] stateless function components cannot pass through methods ' + 'because they have no associated instances. Check component: ' + displayName + ', ' + 'attempting to pass through methods: ' + methods.join(', ')) : undefined : void 0;
-
- var UncontrolledComponent =
- /*#__PURE__*/
- function (_React$Component) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(UncontrolledComponent, _React$Component);
-
- function UncontrolledComponent() {
- var _this;
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
- _this.handlers = Object.create(null);
- controlledProps.forEach(function (propName) {
- var handlerName = controlledValues[propName];
-
- var handleChange = function handleChange(value) {
- if (_this.props[handlerName]) {
- var _this$props;
-
- _this._notifying = true;
-
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
- args[_key2 - 1] = arguments[_key2];
- }
-
- (_this$props = _this.props)[handlerName].apply(_this$props, [value].concat(args));
-
- _this._notifying = false;
- }
-
- _this._values[propName] = value;
- if (!_this.unmounted) _this.forceUpdate();
- };
-
- _this.handlers[handlerName] = handleChange;
- });
- if (methods.length) _this.attachRef = function (ref) {
- _this.inner = ref;
- };
- return _this;
- }
-
- var _proto = UncontrolledComponent.prototype;
-
- _proto.shouldComponentUpdate = function shouldComponentUpdate() {
- //let the forceUpdate trigger the update
- return !this._notifying;
- };
-
- _proto.componentWillMount = function componentWillMount() {
- var _this2 = this;
-
- var props = this.props;
- this._values = Object.create(null);
- controlledProps.forEach(function (key) {
- _this2._values[key] = props[_utils__WEBPACK_IMPORTED_MODULE_5__["defaultKey"](key)];
- });
- };
-
- _proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
- var _this3 = this;
-
- var props = this.props;
- controlledProps.forEach(function (key) {
- /**
- * If a prop switches from controlled to Uncontrolled
- * reset its value to the defaultValue
- */
- if (!_utils__WEBPACK_IMPORTED_MODULE_5__["isProp"](nextProps, key) && _utils__WEBPACK_IMPORTED_MODULE_5__["isProp"](props, key)) {
- _this3._values[key] = nextProps[_utils__WEBPACK_IMPORTED_MODULE_5__["defaultKey"](key)];
- }
- });
- };
-
- _proto.componentWillUnmount = function componentWillUnmount() {
- this.unmounted = true;
- };
-
- _proto.render = function render() {
- var _this4 = this;
-
- var _this$props2 = this.props,
- innerRef = _this$props2.innerRef,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_this$props2, ["innerRef"]);
-
- PROPS_TO_OMIT.forEach(function (prop) {
- delete props[prop];
- });
- var newProps = {};
- controlledProps.forEach(function (propName) {
- var propValue = _this4.props[propName];
- newProps[propName] = propValue !== undefined ? propValue : _this4._values[propName];
- });
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, newProps, this.handlers, {
- ref: innerRef || this.attachRef
- }));
- };
-
- return UncontrolledComponent;
- }(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component);
-
- UncontrolledComponent.displayName = "Uncontrolled(" + displayName + ")";
- UncontrolledComponent.propTypes = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
- innerRef: function innerRef() {}
- }, _utils__WEBPACK_IMPORTED_MODULE_5__["uncontrolledPropTypes"](controlledValues, displayName));
- methods.forEach(function (method) {
- UncontrolledComponent.prototype[method] = function $proxiedMethod() {
- var _this$inner;
-
- return (_this$inner = this.inner)[method].apply(_this$inner, arguments);
- };
- });
- var WrappedComponent = UncontrolledComponent;
-
- if (react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef) {
- WrappedComponent = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (props, ref) {
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(UncontrolledComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, props, {
- innerRef: ref
- }));
- });
- WrappedComponent.propTypes = UncontrolledComponent.propTypes;
- }
-
- WrappedComponent.ControlledComponent = Component;
- /**
- * useful when wrapping a Component and you want to control
- * everything
- */
-
- WrappedComponent.deferControlTo = function (newComponent, additions, nextMethods) {
- if (additions === void 0) {
- additions = {};
- }
-
- return uncontrollable(newComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, controlledValues, additions), nextMethods);
- };
-
- return WrappedComponent;
- }
- /* harmony default export */ __webpack_exports__["default"] = (uncontrollable);
-
- /***/ }),
-
- /***/ "./node_modules/react-overlays/node_modules/uncontrollable/esm/utils.js":
- /*!******************************************************************************!*\
- !*** ./node_modules/react-overlays/node_modules/uncontrollable/esm/utils.js ***!
- \******************************************************************************/
- /*! exports provided: uncontrolledPropTypes, isProp, defaultKey, canAcceptRef */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uncontrolledPropTypes", function() { return uncontrolledPropTypes; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isProp", function() { return isProp; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultKey", function() { return defaultKey; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canAcceptRef", function() { return canAcceptRef; });
- /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "./node_modules/invariant/browser.js");
- /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
-
-
- var noop = function noop() {};
-
- function readOnlyPropType(handler, name) {
- return function (props, propName) {
- if (props[propName] !== undefined) {
- if (!props[handler]) {
- return new Error("You have provided a `" + propName + "` prop to `" + name + "` " + ("without an `" + handler + "` handler prop. This will render a read-only field. ") + ("If the field should be mutable use `" + defaultKey(propName) + "`. ") + ("Otherwise, set `" + handler + "`."));
- }
- }
- };
- }
-
- function uncontrolledPropTypes(controlledValues, displayName) {
- var propTypes = {};
- Object.keys(controlledValues).forEach(function (prop) {
- // add default propTypes for folks that use runtime checks
- propTypes[defaultKey(prop)] = noop;
-
- if (true) {
- var handler = controlledValues[prop];
- !(typeof handler === 'string' && handler.trim().length) ? true ? invariant__WEBPACK_IMPORTED_MODULE_0___default()(false, 'Uncontrollable - [%s]: the prop `%s` needs a valid handler key name in order to make it uncontrollable', displayName, prop) : undefined : void 0;
- propTypes[prop] = readOnlyPropType(handler, displayName);
- }
- });
- return propTypes;
- }
- function isProp(props, prop) {
- return props[prop] !== undefined;
- }
- function defaultKey(key) {
- return 'default' + key.charAt(0).toUpperCase() + key.substr(1);
- }
- /**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- */
-
- function canAcceptRef(component) {
- return !!component && (typeof component !== 'function' || component.prototype && component.prototype.isReactComponent);
- }
-
- /***/ }),
-
- /***/ "./node_modules/react-overlays/utils/getContainer.js":
- /*!***********************************************************!*\
- !*** ./node_modules/react-overlays/utils/getContainer.js ***!
- \***********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = getContainer;
-
- var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"));
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function getContainer(container, defaultContainer) {
- if (container == null) return defaultContainer;
- container = typeof container === 'function' ? container() : container;
- return _reactDom.default.findDOMNode(container) || null;
- }
-
- module.exports = exports.default;
-
- /***/ }),
-
- /***/ "./node_modules/react-overlays/utils/isOverflowing.js":
- /*!************************************************************!*\
- !*** ./node_modules/react-overlays/utils/isOverflowing.js ***!
- \************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = isOverflowing;
-
- var _isWindow = _interopRequireDefault(__webpack_require__(/*! dom-helpers/query/isWindow */ "./node_modules/dom-helpers/query/isWindow.js"));
-
- var _ownerDocument = _interopRequireDefault(__webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js"));
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function isBody(node) {
- return node && node.tagName.toLowerCase() === 'body';
- }
-
- function bodyIsOverflowing(node) {
- var doc = (0, _ownerDocument.default)(node);
- var win = (0, _isWindow.default)(doc);
- return doc.body.clientWidth < win.innerWidth;
- }
-
- function isOverflowing(container) {
- var win = (0, _isWindow.default)(container);
- return win || isBody(container) ? bodyIsOverflowing(container) : container.scrollHeight > container.clientHeight;
- }
-
- module.exports = exports.default;
-
- /***/ }),
-
- /***/ "./node_modules/react-overlays/utils/manageAriaHidden.js":
- /*!***************************************************************!*\
- !*** ./node_modules/react-overlays/utils/manageAriaHidden.js ***!
- \***************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.ariaHidden = ariaHidden;
- exports.hideSiblings = hideSiblings;
- exports.showSiblings = showSiblings;
- var BLACKLIST = ['template', 'script', 'style'];
-
- var isHidable = function isHidable(_ref) {
- var nodeType = _ref.nodeType,
- tagName = _ref.tagName;
- return nodeType === 1 && BLACKLIST.indexOf(tagName.toLowerCase()) === -1;
- };
-
- var siblings = function siblings(container, exclude, cb) {
- exclude = [].concat(exclude);
- [].forEach.call(container.children, function (node) {
- if (exclude.indexOf(node) === -1 && isHidable(node)) {
- cb(node);
- }
- });
- };
-
- function ariaHidden(show, node) {
- if (!node) return;
-
- if (show) {
- node.setAttribute('aria-hidden', 'true');
- } else {
- node.removeAttribute('aria-hidden');
- }
- }
-
- function hideSiblings(container, _ref2) {
- var root = _ref2.root,
- backdrop = _ref2.backdrop;
- siblings(container, [root, backdrop], function (node) {
- return ariaHidden(true, node);
- });
- }
-
- function showSiblings(container, _ref3) {
- var root = _ref3.root,
- backdrop = _ref3.backdrop;
- siblings(container, [root, backdrop], function (node) {
- return ariaHidden(false, node);
- });
- }
-
- /***/ }),
-
- /***/ "./node_modules/react-overlays/utils/ownerDocument.js":
- /*!************************************************************!*\
- !*** ./node_modules/react-overlays/utils/ownerDocument.js ***!
- \************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- exports.__esModule = true;
- exports.default = _default;
-
- var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js"));
-
- var _ownerDocument = _interopRequireDefault(__webpack_require__(/*! dom-helpers/ownerDocument */ "./node_modules/dom-helpers/ownerDocument.js"));
-
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
- function _default(componentOrElement) {
- return (0, _ownerDocument.default)(_reactDom.default.findDOMNode(componentOrElement));
- }
-
- module.exports = exports.default;
-
- /***/ }),
-
- /***/ "./node_modules/react-popper/lib/esm/Manager.js":
- /*!******************************************************!*\
- !*** ./node_modules/react-popper/lib/esm/Manager.js ***!
- \******************************************************/
- /*! exports provided: ManagerReferenceNodeContext, ManagerReferenceNodeSetterContext, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ManagerReferenceNodeContext", function() { return ManagerReferenceNodeContext; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ManagerReferenceNodeSetterContext", function() { return ManagerReferenceNodeSetterContext; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Manager; });
- /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
- /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inheritsLoose */ "./node_modules/@babel/runtime/helpers/inheritsLoose.js");
- /* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var create_react_context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! create-react-context */ "./node_modules/create-react-context/lib/index.js");
- /* harmony import */ var create_react_context__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(create_react_context__WEBPACK_IMPORTED_MODULE_4__);
-
-
-
-
-
- var ManagerReferenceNodeContext = create_react_context__WEBPACK_IMPORTED_MODULE_4___default()();
- var ManagerReferenceNodeSetterContext = create_react_context__WEBPACK_IMPORTED_MODULE_4___default()();
-
- var Manager =
- /*#__PURE__*/
- function (_React$Component) {
- _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_1___default()(Manager, _React$Component);
-
- function Manager() {
- var _this;
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_0___default()(_this), "referenceNode", void 0);
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_0___default()(_this), "setReferenceNode", function (newReferenceNode) {
- if (newReferenceNode && _this.referenceNode !== newReferenceNode) {
- _this.referenceNode = newReferenceNode;
-
- _this.forceUpdate();
- }
- });
-
- return _this;
- }
-
- var _proto = Manager.prototype;
-
- _proto.componentWillUnmount = function componentWillUnmount() {
- this.referenceNode = null;
- };
-
- _proto.render = function render() {
- return react__WEBPACK_IMPORTED_MODULE_3__["createElement"](ManagerReferenceNodeContext.Provider, {
- value: this.referenceNode
- }, react__WEBPACK_IMPORTED_MODULE_3__["createElement"](ManagerReferenceNodeSetterContext.Provider, {
- value: this.setReferenceNode
- }, this.props.children));
- };
-
- return Manager;
- }(react__WEBPACK_IMPORTED_MODULE_3__["Component"]);
-
-
-
- /***/ }),
-
- /***/ "./node_modules/react-popper/lib/esm/Popper.js":
- /*!*****************************************************!*\
- !*** ./node_modules/react-popper/lib/esm/Popper.js ***!
- \*****************************************************/
- /*! exports provided: InnerPopper, placements, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InnerPopper", function() { return InnerPopper; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "placements", function() { return placements; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Popper; });
- /* harmony import */ var _babel_runtime_helpers_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js");
- /* harmony import */ var _babel_runtime_helpers_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/@babel/runtime/helpers/extends.js");
- /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
- /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/inheritsLoose */ "./node_modules/@babel/runtime/helpers/inheritsLoose.js");
- /* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var popper_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js");
- /* harmony import */ var _Manager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Manager */ "./node_modules/react-popper/lib/esm/Manager.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils */ "./node_modules/react-popper/lib/esm/utils.js");
-
-
-
-
-
-
-
-
-
- var initialStyle = {
- position: 'absolute',
- top: 0,
- left: 0,
- opacity: 0,
- pointerEvents: 'none'
- };
- var initialArrowStyle = {};
- var InnerPopper =
- /*#__PURE__*/
- function (_React$Component) {
- _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_3___default()(InnerPopper, _React$Component);
-
- function InnerPopper() {
- var _this;
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "state", {
- data: undefined,
- placement: undefined
- });
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "popperInstance", void 0);
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "popperNode", null);
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "arrowNode", null);
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "setPopperNode", function (popperNode) {
- if (!popperNode || _this.popperNode === popperNode) return;
- Object(_utils__WEBPACK_IMPORTED_MODULE_8__["setRef"])(_this.props.innerRef, popperNode);
- _this.popperNode = popperNode;
-
- _this.updatePopperInstance();
- });
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "setArrowNode", function (arrowNode) {
- _this.arrowNode = arrowNode;
- });
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "updateStateModifier", {
- enabled: true,
- order: 900,
- fn: function fn(data) {
- var placement = data.placement;
-
- _this.setState({
- data: data,
- placement: placement
- });
-
- return data;
- }
- });
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "getOptions", function () {
- return {
- placement: _this.props.placement,
- eventsEnabled: _this.props.eventsEnabled,
- positionFixed: _this.props.positionFixed,
- modifiers: _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, _this.props.modifiers, {
- arrow: _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({}, _this.props.modifiers && _this.props.modifiers.arrow, {
- enabled: !!_this.arrowNode,
- element: _this.arrowNode
- }),
- applyStyle: {
- enabled: false
- },
- updateStateModifier: _this.updateStateModifier
- })
- };
- });
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "getPopperStyle", function () {
- return !_this.popperNode || !_this.state.data ? initialStyle : _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({
- position: _this.state.data.offsets.popper.position
- }, _this.state.data.styles);
- });
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "getPopperPlacement", function () {
- return !_this.state.data ? undefined : _this.state.placement;
- });
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "getArrowStyle", function () {
- return !_this.arrowNode || !_this.state.data ? initialArrowStyle : _this.state.data.arrowStyles;
- });
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "getOutOfBoundariesState", function () {
- return _this.state.data ? _this.state.data.hide : undefined;
- });
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "destroyPopperInstance", function () {
- if (!_this.popperInstance) return;
-
- _this.popperInstance.destroy();
-
- _this.popperInstance = null;
- });
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "updatePopperInstance", function () {
- _this.destroyPopperInstance();
-
- var _assertThisInitialize = _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this),
- popperNode = _assertThisInitialize.popperNode;
-
- var referenceElement = _this.props.referenceElement;
- if (!referenceElement || !popperNode) return;
- _this.popperInstance = new popper_js__WEBPACK_IMPORTED_MODULE_6__["default"](referenceElement, popperNode, _this.getOptions());
- });
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this), "scheduleUpdate", function () {
- if (_this.popperInstance) {
- _this.popperInstance.scheduleUpdate();
- }
- });
-
- return _this;
- }
-
- var _proto = InnerPopper.prototype;
-
- _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {
- // If the Popper.js options have changed, update the instance (destroy + create)
- if (this.props.placement !== prevProps.placement || this.props.referenceElement !== prevProps.referenceElement || this.props.positionFixed !== prevProps.positionFixed || this.props.modifiers !== prevProps.modifiers) {
- // develop only check that modifiers isn't being updated needlessly
- if (true) {
- if (this.props.modifiers !== prevProps.modifiers && this.props.modifiers != null && prevProps.modifiers != null && Object(_utils__WEBPACK_IMPORTED_MODULE_8__["shallowEqual"])(this.props.modifiers, prevProps.modifiers)) {
- console.warn("'modifiers' prop reference updated even though all values appear the same.\nConsider memoizing the 'modifiers' object to avoid needless rendering.");
- }
- }
-
- this.updatePopperInstance();
- } else if (this.props.eventsEnabled !== prevProps.eventsEnabled && this.popperInstance) {
- this.props.eventsEnabled ? this.popperInstance.enableEventListeners() : this.popperInstance.disableEventListeners();
- } // A placement difference in state means popper determined a new placement
- // apart from the props value. By the time the popper element is rendered with
- // the new position Popper has already measured it, if the place change triggers
- // a size change it will result in a misaligned popper. So we schedule an update to be sure.
-
-
- if (prevState.placement !== this.state.placement) {
- this.scheduleUpdate();
- }
- };
-
- _proto.componentWillUnmount = function componentWillUnmount() {
- Object(_utils__WEBPACK_IMPORTED_MODULE_8__["setRef"])(this.props.innerRef, null);
- this.destroyPopperInstance();
- };
-
- _proto.render = function render() {
- return Object(_utils__WEBPACK_IMPORTED_MODULE_8__["unwrapArray"])(this.props.children)({
- ref: this.setPopperNode,
- style: this.getPopperStyle(),
- placement: this.getPopperPlacement(),
- outOfBoundaries: this.getOutOfBoundariesState(),
- scheduleUpdate: this.scheduleUpdate,
- arrowProps: {
- ref: this.setArrowNode,
- style: this.getArrowStyle()
- }
- });
- };
-
- return InnerPopper;
- }(react__WEBPACK_IMPORTED_MODULE_5__["Component"]);
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_4___default()(InnerPopper, "defaultProps", {
- placement: 'bottom',
- eventsEnabled: true,
- referenceElement: undefined,
- positionFixed: false
- });
-
- var placements = popper_js__WEBPACK_IMPORTED_MODULE_6__["default"].placements;
-
- function Popper(_ref) {
- var referenceElement = _ref.referenceElement,
- props = _babel_runtime_helpers_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0___default()(_ref, ["referenceElement"]);
-
- return react__WEBPACK_IMPORTED_MODULE_5__["createElement"](_Manager__WEBPACK_IMPORTED_MODULE_7__["ManagerReferenceNodeContext"].Consumer, null, function (referenceNode) {
- return react__WEBPACK_IMPORTED_MODULE_5__["createElement"](InnerPopper, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_1___default()({
- referenceElement: referenceElement !== undefined ? referenceElement : referenceNode
- }, props));
- });
- }
-
- /***/ }),
-
- /***/ "./node_modules/react-popper/lib/esm/Reference.js":
- /*!********************************************************!*\
- !*** ./node_modules/react-popper/lib/esm/Reference.js ***!
- \********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return Reference; });
- /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/@babel/runtime/helpers/extends.js");
- /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
- /* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inheritsLoose */ "./node_modules/@babel/runtime/helpers/inheritsLoose.js");
- /* harmony import */ var _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! warning */ "./node_modules/warning/warning.js");
- /* harmony import */ var warning__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(warning__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var _Manager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Manager */ "./node_modules/react-popper/lib/esm/Manager.js");
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils */ "./node_modules/react-popper/lib/esm/utils.js");
-
-
-
-
-
-
-
-
-
- var InnerReference =
- /*#__PURE__*/
- function (_React$Component) {
- _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_2___default()(InnerReference, _React$Component);
-
- function InnerReference() {
- var _this;
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
-
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3___default()(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default()(_this), "refHandler", function (node) {
- Object(_utils__WEBPACK_IMPORTED_MODULE_7__["setRef"])(_this.props.innerRef, node);
- Object(_utils__WEBPACK_IMPORTED_MODULE_7__["safeInvoke"])(_this.props.setReferenceNode, node);
- });
-
- return _this;
- }
-
- var _proto = InnerReference.prototype;
-
- _proto.componentWillUnmount = function componentWillUnmount() {
- Object(_utils__WEBPACK_IMPORTED_MODULE_7__["setRef"])(this.props.innerRef, null);
- };
-
- _proto.render = function render() {
- warning__WEBPACK_IMPORTED_MODULE_5___default()(Boolean(this.props.setReferenceNode), '`Reference` should not be used outside of a `Manager` component.');
- return Object(_utils__WEBPACK_IMPORTED_MODULE_7__["unwrapArray"])(this.props.children)({
- ref: this.refHandler
- });
- };
-
- return InnerReference;
- }(react__WEBPACK_IMPORTED_MODULE_4__["Component"]);
-
- function Reference(props) {
- return react__WEBPACK_IMPORTED_MODULE_4__["createElement"](_Manager__WEBPACK_IMPORTED_MODULE_6__["ManagerReferenceNodeSetterContext"].Consumer, null, function (setReferenceNode) {
- return react__WEBPACK_IMPORTED_MODULE_4__["createElement"](InnerReference, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({
- setReferenceNode: setReferenceNode
- }, props));
- });
- }
-
- /***/ }),
-
- /***/ "./node_modules/react-popper/lib/esm/index.js":
- /*!****************************************************!*\
- !*** ./node_modules/react-popper/lib/esm/index.js ***!
- \****************************************************/
- /*! exports provided: Popper, placements, Manager, Reference */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _Popper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Popper */ "./node_modules/react-popper/lib/esm/Popper.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Popper", function() { return _Popper__WEBPACK_IMPORTED_MODULE_0__["default"]; });
-
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "placements", function() { return _Popper__WEBPACK_IMPORTED_MODULE_0__["placements"]; });
-
- /* harmony import */ var _Manager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Manager */ "./node_modules/react-popper/lib/esm/Manager.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Manager", function() { return _Manager__WEBPACK_IMPORTED_MODULE_1__["default"]; });
-
- /* harmony import */ var _Reference__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Reference */ "./node_modules/react-popper/lib/esm/Reference.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Reference", function() { return _Reference__WEBPACK_IMPORTED_MODULE_2__["default"]; });
-
- // Public components
-
-
-
- // Public types
-
- /***/ }),
-
- /***/ "./node_modules/react-popper/lib/esm/utils.js":
- /*!****************************************************!*\
- !*** ./node_modules/react-popper/lib/esm/utils.js ***!
- \****************************************************/
- /*! exports provided: unwrapArray, safeInvoke, shallowEqual, setRef */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unwrapArray", function() { return unwrapArray; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "safeInvoke", function() { return safeInvoke; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "shallowEqual", function() { return shallowEqual; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setRef", function() { return setRef; });
- /**
- * Takes an argument and if it's an array, returns the first item in the array,
- * otherwise returns the argument. Used for Preact compatibility.
- */
- var unwrapArray = function unwrapArray(arg) {
- return Array.isArray(arg) ? arg[0] : arg;
- };
- /**
- * Takes a maybe-undefined function and arbitrary args and invokes the function
- * only if it is defined.
- */
-
- var safeInvoke = function safeInvoke(fn) {
- if (typeof fn === "function") {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- return fn.apply(void 0, args);
- }
- };
- /**
- * Does a shallow equality check of two objects by comparing the reference
- * equality of each value.
- */
-
- var shallowEqual = function shallowEqual(objA, objB) {
- var aKeys = Object.keys(objA);
- var bKeys = Object.keys(objB);
-
- if (bKeys.length !== aKeys.length) {
- return false;
- }
-
- for (var i = 0; i < bKeys.length; i++) {
- var key = aKeys[i];
-
- if (objA[key] !== objB[key]) {
- return false;
- }
- }
-
- return true;
- };
- /**
- * Sets a ref using either a ref callback or a ref object
- */
-
- var setRef = function setRef(ref, node) {
- // if its a function call it
- if (typeof ref === "function") {
- return safeInvoke(ref, node);
- } // otherwise we should treat it as a ref object
- else if (ref != null) {
- ref.current = node;
- }
- };
-
- /***/ }),
-
- /***/ "./node_modules/react-spinners/ClipLoader.js":
- /*!***************************************************!*\
- !*** ./node_modules/react-spinners/ClipLoader.js ***!
- \***************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
- return cooked;
- };
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- var __importStar = (this && this.__importStar) || function (mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
- result["default"] = mod;
- return result;
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- /** @jsx jsx */
- var React = __importStar(__webpack_require__(/*! react */ "./node_modules/react/index.js"));
- var core_1 = __webpack_require__(/*! @emotion/core */ "./node_modules/@emotion/core/dist/core.browser.esm.js");
- var proptypes_1 = __webpack_require__(/*! ./helpers/proptypes */ "./node_modules/react-spinners/helpers/proptypes.js");
- var clip = core_1.keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n 0% {transform: rotate(0deg) scale(1)}\n 50% {transform: rotate(180deg) scale(0.8)}\n 100% {transform: rotate(360deg) scale(1)}\n"], ["\n 0% {transform: rotate(0deg) scale(1)}\n 50% {transform: rotate(180deg) scale(0.8)}\n 100% {transform: rotate(360deg) scale(1)}\n"])));
- var Loader = /** @class */ (function (_super) {
- __extends(Loader, _super);
- function Loader() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.style = function () {
- var _a = _this.props, size = _a.size, sizeUnit = _a.sizeUnit, color = _a.color;
- return core_1.css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: transparent !important;\n width: ", ";\n height: ", ";\n border-radius: 100%;\n border: 2px solid;\n border-color: ", ";\n border-bottom-color: transparent;\n display: inline-block;\n animation: ", " 0.75s 0s infinite linear;\n animation-fill-mode: both;\n "], ["\n background: transparent !important;\n width: ", ";\n height: ", ";\n border-radius: 100%;\n border: 2px solid;\n border-color: ", ";\n border-bottom-color: transparent;\n display: inline-block;\n animation: ", " 0.75s 0s infinite linear;\n animation-fill-mode: both;\n "])), "" + size + sizeUnit, "" + size + sizeUnit, color, clip);
- };
- return _this;
- }
- Loader.prototype.render = function () {
- var _a = this.props, loading = _a.loading, css = _a.css;
- return loading ? core_1.jsx("div", { css: [this.style(), css] }) : null;
- };
- Loader.defaultProps = proptypes_1.sizeDefaults(35);
- return Loader;
- }(React.PureComponent));
- exports.default = Loader;
- var templateObject_1, templateObject_2;
-
-
- /***/ }),
-
- /***/ "./node_modules/react-spinners/helpers/proptypes.js":
- /*!**********************************************************!*\
- !*** ./node_modules/react-spinners/helpers/proptypes.js ***!
- \**********************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
- var _a;
- Object.defineProperty(exports, "__esModule", { value: true });
- /*
- * List of string constants to represent different props
- */
- var LOADING = "loading";
- var COLOR = "color";
- var CSS = "css";
- var SIZE = "size";
- var SIZE_UNIT = "sizeUnit";
- var WIDTH = "width";
- var WIDTH_UNIT = "widthUnit";
- var HEIGHT = "height";
- var HEIGHT_UNIT = "heightUnit";
- var RADIUS = "radius";
- var RADIUS_UNIT = "radiusUnit";
- var MARGIN = "margin";
- var commonValues = (_a = {},
- _a[LOADING] = true,
- _a[COLOR] = "#000000",
- _a[CSS] = {},
- _a);
- var heightWidthValues = function (height, width) {
- var _a;
- return (_a = {},
- _a[HEIGHT] = height,
- _a[HEIGHT_UNIT] = "px",
- _a[WIDTH] = width,
- _a[WIDTH_UNIT] = "px",
- _a);
- };
- var sizeValues = function (sizeValue) {
- var _a;
- return (_a = {},
- _a[SIZE] = sizeValue,
- _a[SIZE_UNIT] = "px",
- _a);
- };
- exports.sizeDefaults = function (sizeValue) {
- return Object.assign({}, commonValues, sizeValues(sizeValue));
- };
- exports.sizeMarginDefaults = function (sizeValue) {
- var _a;
- return Object.assign({}, exports.sizeDefaults(sizeValue), (_a = {},
- _a[MARGIN] = "2px",
- _a));
- };
- exports.heightWidthDefaults = function (height, width) {
- return Object.assign({}, commonValues, heightWidthValues(height, width));
- };
- exports.heightWidthRadiusDefaults = function (height, width, radius) {
- var _a;
- if (radius === void 0) { radius = 2; }
- return Object.assign({}, exports.heightWidthDefaults(height, width), (_a = {},
- _a[RADIUS] = radius,
- _a[RADIUS_UNIT] = "px",
- _a[MARGIN] = "2px",
- _a));
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/react-transition-group/esm/Transition.js":
- /*!***************************************************************!*\
- !*** ./node_modules/react-transition-group/esm/Transition.js ***!
- \***************************************************************/
- /*! exports provided: UNMOUNTED, EXITED, ENTERING, ENTERED, EXITING, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UNMOUNTED", function() { return UNMOUNTED; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXITED", function() { return EXITED; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ENTERING", function() { return ENTERING; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ENTERED", function() { return ENTERED; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "EXITING", function() { return EXITING; });
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./config */ "./node_modules/react-transition-group/esm/config.js");
- /* harmony import */ var _utils_PropTypes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/PropTypes */ "./node_modules/react-transition-group/esm/utils/PropTypes.js");
- /* harmony import */ var _TransitionGroupContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./TransitionGroupContext */ "./node_modules/react-transition-group/esm/TransitionGroupContext.js");
-
-
-
-
-
-
-
-
- var UNMOUNTED = 'unmounted';
- var EXITED = 'exited';
- var ENTERING = 'entering';
- var ENTERED = 'entered';
- var EXITING = 'exiting';
- /**
- * The Transition component lets you describe a transition from one component
- * state to another _over time_ with a simple declarative API. Most commonly
- * it's used to animate the mounting and unmounting of a component, but can also
- * be used to describe in-place transition states as well.
- *
- * ---
- *
- * **Note**: `Transition` is a platform-agnostic base component. If you're using
- * transitions in CSS, you'll probably want to use
- * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
- * instead. It inherits all the features of `Transition`, but contains
- * additional features necessary to play nice with CSS transitions (hence the
- * name of the component).
- *
- * ---
- *
- * By default the `Transition` component does not alter the behavior of the
- * component it renders, it only tracks "enter" and "exit" states for the
- * components. It's up to you to give meaning and effect to those states. For
- * example we can add styles to a component when it enters or exits:
- *
- * ```jsx
- * import { Transition } from 'react-transition-group';
- *
- * const duration = 300;
- *
- * const defaultStyle = {
- * transition: `opacity ${duration}ms ease-in-out`,
- * opacity: 0,
- * }
- *
- * const transitionStyles = {
- * entering: { opacity: 1 },
- * entered: { opacity: 1 },
- * exiting: { opacity: 0 },
- * exited: { opacity: 0 },
- * };
- *
- * const Fade = ({ in: inProp }) => (
- * <Transition in={inProp} timeout={duration}>
- * {state => (
- * <div style={{
- * ...defaultStyle,
- * ...transitionStyles[state]
- * }}>
- * I'm a fade Transition!
- * </div>
- * )}
- * </Transition>
- * );
- * ```
- *
- * There are 4 main states a Transition can be in:
- * - `'entering'`
- * - `'entered'`
- * - `'exiting'`
- * - `'exited'`
- *
- * Transition state is toggled via the `in` prop. When `true` the component
- * begins the "Enter" stage. During this stage, the component will shift from
- * its current transition state, to `'entering'` for the duration of the
- * transition and then to the `'entered'` stage once it's complete. Let's take
- * the following example (we'll use the
- * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
- *
- * ```jsx
- * function App() {
- * const [inProp, setInProp] = useState(false);
- * return (
- * <div>
- * <Transition in={inProp} timeout={500}>
- * {state => (
- * // ...
- * )}
- * </Transition>
- * <button onClick={() => setInProp(true)}>
- * Click to Enter
- * </button>
- * </div>
- * );
- * }
- * ```
- *
- * When the button is clicked the component will shift to the `'entering'` state
- * and stay there for 500ms (the value of `timeout`) before it finally switches
- * to `'entered'`.
- *
- * When `in` is `false` the same thing happens except the state moves from
- * `'exiting'` to `'exited'`.
- */
-
- var Transition =
- /*#__PURE__*/
- function (_React$Component) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(Transition, _React$Component);
-
- function Transition(props, context) {
- var _this;
-
- _this = _React$Component.call(this, props, context) || this;
- var parentGroup = context; // In the context of a TransitionGroup all enters are really appears
-
- var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
- var initialStatus;
- _this.appearStatus = null;
-
- if (props.in) {
- if (appear) {
- initialStatus = EXITED;
- _this.appearStatus = ENTERING;
- } else {
- initialStatus = ENTERED;
- }
- } else {
- if (props.unmountOnExit || props.mountOnEnter) {
- initialStatus = UNMOUNTED;
- } else {
- initialStatus = EXITED;
- }
- }
-
- _this.state = {
- status: initialStatus
- };
- _this.nextCallback = null;
- return _this;
- }
-
- Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
- var nextIn = _ref.in;
-
- if (nextIn && prevState.status === UNMOUNTED) {
- return {
- status: EXITED
- };
- }
-
- return null;
- }; // getSnapshotBeforeUpdate(prevProps) {
- // let nextStatus = null
- // if (prevProps !== this.props) {
- // const { status } = this.state
- // if (this.props.in) {
- // if (status !== ENTERING && status !== ENTERED) {
- // nextStatus = ENTERING
- // }
- // } else {
- // if (status === ENTERING || status === ENTERED) {
- // nextStatus = EXITING
- // }
- // }
- // }
- // return { nextStatus }
- // }
-
-
- var _proto = Transition.prototype;
-
- _proto.componentDidMount = function componentDidMount() {
- this.updateStatus(true, this.appearStatus);
- };
-
- _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
- var nextStatus = null;
-
- if (prevProps !== this.props) {
- var status = this.state.status;
-
- if (this.props.in) {
- if (status !== ENTERING && status !== ENTERED) {
- nextStatus = ENTERING;
- }
- } else {
- if (status === ENTERING || status === ENTERED) {
- nextStatus = EXITING;
- }
- }
- }
-
- this.updateStatus(false, nextStatus);
- };
-
- _proto.componentWillUnmount = function componentWillUnmount() {
- this.cancelNextCallback();
- };
-
- _proto.getTimeouts = function getTimeouts() {
- var timeout = this.props.timeout;
- var exit, enter, appear;
- exit = enter = appear = timeout;
-
- if (timeout != null && typeof timeout !== 'number') {
- exit = timeout.exit;
- enter = timeout.enter; // TODO: remove fallback for next major
-
- appear = timeout.appear !== undefined ? timeout.appear : enter;
- }
-
- return {
- exit: exit,
- enter: enter,
- appear: appear
- };
- };
-
- _proto.updateStatus = function updateStatus(mounting, nextStatus) {
- if (mounting === void 0) {
- mounting = false;
- }
-
- if (nextStatus !== null) {
- // nextStatus will always be ENTERING or EXITING.
- this.cancelNextCallback();
- var node = react_dom__WEBPACK_IMPORTED_MODULE_4___default.a.findDOMNode(this);
-
- if (nextStatus === ENTERING) {
- this.performEnter(node, mounting);
- } else {
- this.performExit(node);
- }
- } else if (this.props.unmountOnExit && this.state.status === EXITED) {
- this.setState({
- status: UNMOUNTED
- });
- }
- };
-
- _proto.performEnter = function performEnter(node, mounting) {
- var _this2 = this;
-
- var enter = this.props.enter;
- var appearing = this.context ? this.context.isMounting : mounting;
- var timeouts = this.getTimeouts();
- var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
- // if we are mounting and running this it means appear _must_ be set
-
- if (!mounting && !enter || _config__WEBPACK_IMPORTED_MODULE_5__["default"].disabled) {
- this.safeSetState({
- status: ENTERED
- }, function () {
- _this2.props.onEntered(node);
- });
- return;
- }
-
- this.props.onEnter(node, appearing);
- this.safeSetState({
- status: ENTERING
- }, function () {
- _this2.props.onEntering(node, appearing);
-
- _this2.onTransitionEnd(node, enterTimeout, function () {
- _this2.safeSetState({
- status: ENTERED
- }, function () {
- _this2.props.onEntered(node, appearing);
- });
- });
- });
- };
-
- _proto.performExit = function performExit(node) {
- var _this3 = this;
-
- var exit = this.props.exit;
- var timeouts = this.getTimeouts(); // no exit animation skip right to EXITED
-
- if (!exit || _config__WEBPACK_IMPORTED_MODULE_5__["default"].disabled) {
- this.safeSetState({
- status: EXITED
- }, function () {
- _this3.props.onExited(node);
- });
- return;
- }
-
- this.props.onExit(node);
- this.safeSetState({
- status: EXITING
- }, function () {
- _this3.props.onExiting(node);
-
- _this3.onTransitionEnd(node, timeouts.exit, function () {
- _this3.safeSetState({
- status: EXITED
- }, function () {
- _this3.props.onExited(node);
- });
- });
- });
- };
-
- _proto.cancelNextCallback = function cancelNextCallback() {
- if (this.nextCallback !== null) {
- this.nextCallback.cancel();
- this.nextCallback = null;
- }
- };
-
- _proto.safeSetState = function safeSetState(nextState, callback) {
- // This shouldn't be necessary, but there are weird race conditions with
- // setState callbacks and unmounting in testing, so always make sure that
- // we can cancel any pending setState callbacks after we unmount.
- callback = this.setNextCallback(callback);
- this.setState(nextState, callback);
- };
-
- _proto.setNextCallback = function setNextCallback(callback) {
- var _this4 = this;
-
- var active = true;
-
- this.nextCallback = function (event) {
- if (active) {
- active = false;
- _this4.nextCallback = null;
- callback(event);
- }
- };
-
- this.nextCallback.cancel = function () {
- active = false;
- };
-
- return this.nextCallback;
- };
-
- _proto.onTransitionEnd = function onTransitionEnd(node, timeout, handler) {
- this.setNextCallback(handler);
- var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
-
- if (!node || doesNotHaveTimeoutOrListener) {
- setTimeout(this.nextCallback, 0);
- return;
- }
-
- if (this.props.addEndListener) {
- this.props.addEndListener(node, this.nextCallback);
- }
-
- if (timeout != null) {
- setTimeout(this.nextCallback, timeout);
- }
- };
-
- _proto.render = function render() {
- var status = this.state.status;
-
- if (status === UNMOUNTED) {
- return null;
- }
-
- var _this$props = this.props,
- children = _this$props.children,
- childProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(_this$props, ["children"]); // filter props for Transtition
-
-
- delete childProps.in;
- delete childProps.mountOnEnter;
- delete childProps.unmountOnExit;
- delete childProps.appear;
- delete childProps.enter;
- delete childProps.exit;
- delete childProps.timeout;
- delete childProps.addEndListener;
- delete childProps.onEnter;
- delete childProps.onEntering;
- delete childProps.onEntered;
- delete childProps.onExit;
- delete childProps.onExiting;
- delete childProps.onExited;
-
- if (typeof children === 'function') {
- // allows for nested Transitions
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_TransitionGroupContext__WEBPACK_IMPORTED_MODULE_7__["default"].Provider, {
- value: null
- }, children(status, childProps));
- }
-
- var child = react__WEBPACK_IMPORTED_MODULE_3___default.a.Children.only(children);
- return (// allows for nested Transitions
- react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(_TransitionGroupContext__WEBPACK_IMPORTED_MODULE_7__["default"].Provider, {
- value: null
- }, react__WEBPACK_IMPORTED_MODULE_3___default.a.cloneElement(child, childProps))
- );
- };
-
- return Transition;
- }(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component);
-
- Transition.contextType = _TransitionGroupContext__WEBPACK_IMPORTED_MODULE_7__["default"];
- Transition.propTypes = true ? {
- /**
- * A `function` child can be used instead of a React element. This function is
- * called with the current transition status (`'entering'`, `'entered'`,
- * `'exiting'`, `'exited'`), which can be used to apply context
- * specific props to a component.
- *
- * ```jsx
- * <Transition in={this.state.in} timeout={150}>
- * {state => (
- * <MyComponent className={`fade fade-${state}`} />
- * )}
- * </Transition>
- * ```
- */
- children: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func.isRequired, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.element.isRequired]).isRequired,
-
- /**
- * Show the component; triggers the enter or exit states
- */
- in: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
-
- /**
- * By default the child component is mounted immediately along with
- * the parent `Transition` component. If you want to "lazy mount" the component on the
- * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
- * mounted, even on "exited", unless you also specify `unmountOnExit`.
- */
- mountOnEnter: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
-
- /**
- * By default the child component stays mounted after it reaches the `'exited'` state.
- * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
- */
- unmountOnExit: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
-
- /**
- * Normally a component is not transitioned if it is shown when the
- * `<Transition>` component mounts. If you want to transition on the first
- * mount set `appear` to `true`, and the component will transition in as soon
- * as the `<Transition>` mounts.
- *
- * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
- * > only adds an additional enter transition. However, in the
- * > `<CSSTransition>` component that first enter transition does result in
- * > additional `.appear-*` classes, that way you can choose to style it
- * > differently.
- */
- appear: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
-
- /**
- * Enable or disable enter transitions.
- */
- enter: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
-
- /**
- * Enable or disable exit transitions.
- */
- exit: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
-
- /**
- * The duration of the transition, in milliseconds.
- * Required unless `addEndListener` is provided.
- *
- * You may specify a single timeout for all transitions:
- *
- * ```jsx
- * timeout={500}
- * ```
- *
- * or individually:
- *
- * ```jsx
- * timeout={{
- * appear: 500,
- * enter: 300,
- * exit: 500,
- * }}
- * ```
- *
- * - `appear` defaults to the value of `enter`
- * - `enter` defaults to `0`
- * - `exit` defaults to `0`
- *
- * @type {number | { enter?: number, exit?: number, appear?: number }}
- */
- timeout: function timeout(props) {
- var pt = _utils_PropTypes__WEBPACK_IMPORTED_MODULE_6__["timeoutsShape"];
- if (!props.addEndListener) pt = pt.isRequired;
-
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- return pt.apply(void 0, [props].concat(args));
- },
-
- /**
- * Add a custom transition end trigger. Called with the transitioning
- * DOM node and a `done` callback. Allows for more fine grained transition end
- * logic. **Note:** Timeouts are still used as a fallback if provided.
- *
- * ```jsx
- * addEndListener={(node, done) => {
- * // use the css transitionend event to mark the finish of a transition
- * node.addEventListener('transitionend', done, false);
- * }}
- * ```
- */
- addEndListener: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,
-
- /**
- * Callback fired before the "entering" status is applied. An extra parameter
- * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
- *
- * @type Function(node: HtmlElement, isAppearing: bool) -> void
- */
- onEnter: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,
-
- /**
- * Callback fired after the "entering" status is applied. An extra parameter
- * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
- *
- * @type Function(node: HtmlElement, isAppearing: bool)
- */
- onEntering: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,
-
- /**
- * Callback fired after the "entered" status is applied. An extra parameter
- * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
- *
- * @type Function(node: HtmlElement, isAppearing: bool) -> void
- */
- onEntered: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,
-
- /**
- * Callback fired before the "exiting" status is applied.
- *
- * @type Function(node: HtmlElement) -> void
- */
- onExit: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,
-
- /**
- * Callback fired after the "exiting" status is applied.
- *
- * @type Function(node: HtmlElement) -> void
- */
- onExiting: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func,
-
- /**
- * Callback fired after the "exited" status is applied.
- *
- * @type Function(node: HtmlElement) -> void
- */
- onExited: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.func // Name the function so it is clearer in the documentation
-
- } : undefined;
-
- function noop() {}
-
- Transition.defaultProps = {
- in: false,
- mountOnEnter: false,
- unmountOnExit: false,
- appear: false,
- enter: true,
- exit: true,
- onEnter: noop,
- onEntering: noop,
- onEntered: noop,
- onExit: noop,
- onExiting: noop,
- onExited: noop
- };
- Transition.UNMOUNTED = 0;
- Transition.EXITED = 1;
- Transition.ENTERING = 2;
- Transition.ENTERED = 3;
- Transition.EXITING = 4;
- /* harmony default export */ __webpack_exports__["default"] = (Transition);
-
- /***/ }),
-
- /***/ "./node_modules/react-transition-group/esm/TransitionGroupContext.js":
- /*!***************************************************************************!*\
- !*** ./node_modules/react-transition-group/esm/TransitionGroupContext.js ***!
- \***************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
-
- /* harmony default export */ __webpack_exports__["default"] = (react__WEBPACK_IMPORTED_MODULE_0___default.a.createContext(null));
-
- /***/ }),
-
- /***/ "./node_modules/react-transition-group/esm/config.js":
- /*!***********************************************************!*\
- !*** ./node_modules/react-transition-group/esm/config.js ***!
- \***********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony default export */ __webpack_exports__["default"] = ({
- disabled: false
- });
-
- /***/ }),
-
- /***/ "./node_modules/react-transition-group/esm/utils/PropTypes.js":
- /*!********************************************************************!*\
- !*** ./node_modules/react-transition-group/esm/utils/PropTypes.js ***!
- \********************************************************************/
- /*! exports provided: timeoutsShape, classNamesShape */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "timeoutsShape", function() { return timeoutsShape; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "classNamesShape", function() { return classNamesShape; });
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js");
- /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__);
-
- var timeoutsShape = true ? prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number, prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({
- enter: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number,
- exit: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number,
- appear: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.number
- }).isRequired]) : undefined;
- var classNamesShape = true ? prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({
- enter: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,
- exit: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,
- active: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string
- }), prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.shape({
- enter: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,
- enterDone: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,
- enterActive: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,
- exit: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,
- exitDone: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string,
- exitActive: prop_types__WEBPACK_IMPORTED_MODULE_0___default.a.string
- })]) : undefined;
-
- /***/ }),
-
- /***/ "./node_modules/react/cjs/react.development.js":
- /*!*****************************************************!*\
- !*** ./node_modules/react/cjs/react.development.js ***!
- \*****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
- /** @license React v16.12.0
- * react.development.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-
-
-
-
- if (true) {
- (function() {
- 'use strict';
-
- var _assign = __webpack_require__(/*! object-assign */ "./node_modules/object-assign/index.js");
- var checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ "./node_modules/prop-types/checkPropTypes.js");
-
- // TODO: this is special because it gets imported during build.
-
- var ReactVersion = '16.12.0';
-
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
- // nor polyfill, then a plain number is used for performance.
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
- // (unstable) APIs that have been removed. Can we remove the symbols?
-
-
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
- var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
- function getIteratorFn(maybeIterable) {
- if (maybeIterable === null || typeof maybeIterable !== 'object') {
- return null;
- }
-
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
-
- if (typeof maybeIterator === 'function') {
- return maybeIterator;
- }
-
- return null;
- }
-
- // Do not require this module directly! Use normal `invariant` calls with
- // template literal strings. The messages will be replaced with error codes
- // during build.
-
- /**
- * Use invariant() to assert state which your program assumes to be true.
- *
- * Provide sprintf-style format (only %s is supported) and arguments
- * to provide information about what broke and what you were
- * expecting.
- *
- * The invariant message will be stripped in production, but the invariant
- * will remain to ensure logic does not differ in production.
- */
-
- /**
- * Forked from fbjs/warning:
- * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
- *
- * Only change is we use console.warn instead of console.error,
- * and do nothing when 'console' is not supported.
- * This really simplifies the code.
- * ---
- * Similar to invariant but only logs a warning if the condition is not met.
- * This can be used to log issues in development environments in critical
- * paths. Removing the logging code for production environments will keep the
- * same logic and follow the same code paths.
- */
- var lowPriorityWarningWithoutStack = function () {};
-
- {
- var printWarning = function (format) {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- var argIndex = 0;
- var message = 'Warning: ' + format.replace(/%s/g, function () {
- return args[argIndex++];
- });
-
- if (typeof console !== 'undefined') {
- console.warn(message);
- }
-
- try {
- // --- Welcome to debugging React ---
- // This error was thrown as a convenience so that you can use this stack
- // to find the callsite that caused this warning to fire.
- throw new Error(message);
- } catch (x) {}
- };
-
- lowPriorityWarningWithoutStack = function (condition, format) {
- if (format === undefined) {
- throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
- }
-
- if (!condition) {
- for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
- args[_key2 - 2] = arguments[_key2];
- }
-
- printWarning.apply(void 0, [format].concat(args));
- }
- };
- }
-
- var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
-
- /**
- * Similar to invariant but only logs a warning if the condition is not met.
- * This can be used to log issues in development environments in critical
- * paths. Removing the logging code for production environments will keep the
- * same logic and follow the same code paths.
- */
- var warningWithoutStack = function () {};
-
- {
- warningWithoutStack = function (condition, format) {
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
- args[_key - 2] = arguments[_key];
- }
-
- if (format === undefined) {
- throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
- }
-
- if (args.length > 8) {
- // Check before the condition to catch violations early.
- throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
- }
-
- if (condition) {
- return;
- }
-
- if (typeof console !== 'undefined') {
- var argsWithFormat = args.map(function (item) {
- return '' + item;
- });
- argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
- // breaks IE9: https://github.com/facebook/react/issues/13610
-
- Function.prototype.apply.call(console.error, console, argsWithFormat);
- }
-
- try {
- // --- Welcome to debugging React ---
- // This error was thrown as a convenience so that you can use this stack
- // to find the callsite that caused this warning to fire.
- var argIndex = 0;
- var message = 'Warning: ' + format.replace(/%s/g, function () {
- return args[argIndex++];
- });
- throw new Error(message);
- } catch (x) {}
- };
- }
-
- var warningWithoutStack$1 = warningWithoutStack;
-
- var didWarnStateUpdateForUnmountedComponent = {};
-
- function warnNoop(publicInstance, callerName) {
- {
- var _constructor = publicInstance.constructor;
- var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
- var warningKey = componentName + "." + callerName;
-
- if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
- return;
- }
-
- warningWithoutStack$1(false, "Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
- didWarnStateUpdateForUnmountedComponent[warningKey] = true;
- }
- }
- /**
- * This is the abstract API for an update queue.
- */
-
-
- var ReactNoopUpdateQueue = {
- /**
- * Checks whether or not this composite component is mounted.
- * @param {ReactClass} publicInstance The instance we want to test.
- * @return {boolean} True if mounted, false otherwise.
- * @protected
- * @final
- */
- isMounted: function (publicInstance) {
- return false;
- },
-
- /**
- * Forces an update. This should only be invoked when it is known with
- * certainty that we are **not** in a DOM transaction.
- *
- * You may want to call this when you know that some deeper aspect of the
- * component's state has changed but `setState` was not called.
- *
- * This will not invoke `shouldComponentUpdate`, but it will invoke
- * `componentWillUpdate` and `componentDidUpdate`.
- *
- * @param {ReactClass} publicInstance The instance that should rerender.
- * @param {?function} callback Called after component is updated.
- * @param {?string} callerName name of the calling function in the public API.
- * @internal
- */
- enqueueForceUpdate: function (publicInstance, callback, callerName) {
- warnNoop(publicInstance, 'forceUpdate');
- },
-
- /**
- * Replaces all of the state. Always use this or `setState` to mutate state.
- * You should treat `this.state` as immutable.
- *
- * There is no guarantee that `this.state` will be immediately updated, so
- * accessing `this.state` after calling this method may return the old value.
- *
- * @param {ReactClass} publicInstance The instance that should rerender.
- * @param {object} completeState Next state.
- * @param {?function} callback Called after component is updated.
- * @param {?string} callerName name of the calling function in the public API.
- * @internal
- */
- enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
- warnNoop(publicInstance, 'replaceState');
- },
-
- /**
- * Sets a subset of the state. This only exists because _pendingState is
- * internal. This provides a merging strategy that is not available to deep
- * properties which is confusing. TODO: Expose pendingState or don't use it
- * during the merge.
- *
- * @param {ReactClass} publicInstance The instance that should rerender.
- * @param {object} partialState Next partial state to be merged with state.
- * @param {?function} callback Called after component is updated.
- * @param {?string} Name of the calling function in the public API.
- * @internal
- */
- enqueueSetState: function (publicInstance, partialState, callback, callerName) {
- warnNoop(publicInstance, 'setState');
- }
- };
-
- var emptyObject = {};
-
- {
- Object.freeze(emptyObject);
- }
- /**
- * Base class helpers for the updating state of a component.
- */
-
-
- function Component(props, context, updater) {
- this.props = props;
- this.context = context; // If a component has string refs, we will assign a different object later.
-
- this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
- // renderer.
-
- this.updater = updater || ReactNoopUpdateQueue;
- }
-
- Component.prototype.isReactComponent = {};
- /**
- * Sets a subset of the state. Always use this to mutate
- * state. You should treat `this.state` as immutable.
- *
- * There is no guarantee that `this.state` will be immediately updated, so
- * accessing `this.state` after calling this method may return the old value.
- *
- * There is no guarantee that calls to `setState` will run synchronously,
- * as they may eventually be batched together. You can provide an optional
- * callback that will be executed when the call to setState is actually
- * completed.
- *
- * When a function is provided to setState, it will be called at some point in
- * the future (not synchronously). It will be called with the up to date
- * component arguments (state, props, context). These values can be different
- * from this.* because your function may be called after receiveProps but before
- * shouldComponentUpdate, and this new state, props, and context will not yet be
- * assigned to this.
- *
- * @param {object|function} partialState Next partial state or function to
- * produce next partial state to be merged with current state.
- * @param {?function} callback Called after state is updated.
- * @final
- * @protected
- */
-
- Component.prototype.setState = function (partialState, callback) {
- if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
- {
- throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
- }
- }
-
- this.updater.enqueueSetState(this, partialState, callback, 'setState');
- };
- /**
- * Forces an update. This should only be invoked when it is known with
- * certainty that we are **not** in a DOM transaction.
- *
- * You may want to call this when you know that some deeper aspect of the
- * component's state has changed but `setState` was not called.
- *
- * This will not invoke `shouldComponentUpdate`, but it will invoke
- * `componentWillUpdate` and `componentDidUpdate`.
- *
- * @param {?function} callback Called after update is complete.
- * @final
- * @protected
- */
-
-
- Component.prototype.forceUpdate = function (callback) {
- this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
- };
- /**
- * Deprecated APIs. These APIs used to exist on classic React classes but since
- * we would like to deprecate them, we're not going to move them over to this
- * modern base class. Instead, we define a getter that warns if it's accessed.
- */
-
-
- {
- var deprecatedAPIs = {
- isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
- replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
- };
-
- var defineDeprecationWarning = function (methodName, info) {
- Object.defineProperty(Component.prototype, methodName, {
- get: function () {
- lowPriorityWarningWithoutStack$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
- return undefined;
- }
- });
- };
-
- for (var fnName in deprecatedAPIs) {
- if (deprecatedAPIs.hasOwnProperty(fnName)) {
- defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
- }
- }
- }
-
- function ComponentDummy() {}
-
- ComponentDummy.prototype = Component.prototype;
- /**
- * Convenience component with default shallow equality check for sCU.
- */
-
- function PureComponent(props, context, updater) {
- this.props = props;
- this.context = context; // If a component has string refs, we will assign a different object later.
-
- this.refs = emptyObject;
- this.updater = updater || ReactNoopUpdateQueue;
- }
-
- var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
- pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
-
- _assign(pureComponentPrototype, Component.prototype);
-
- pureComponentPrototype.isPureReactComponent = true;
-
- // an immutable object with a single mutable value
- function createRef() {
- var refObject = {
- current: null
- };
-
- {
- Object.seal(refObject);
- }
-
- return refObject;
- }
-
- /**
- * Keeps track of the current dispatcher.
- */
- var ReactCurrentDispatcher = {
- /**
- * @internal
- * @type {ReactComponent}
- */
- current: null
- };
-
- /**
- * Keeps track of the current batch's configuration such as how long an update
- * should suspend for if it needs to.
- */
- var ReactCurrentBatchConfig = {
- suspense: null
- };
-
- /**
- * Keeps track of the current owner.
- *
- * The current owner is the component who should own any components that are
- * currently being constructed.
- */
- var ReactCurrentOwner = {
- /**
- * @internal
- * @type {ReactComponent}
- */
- current: null
- };
-
- var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
- var describeComponentFrame = function (name, source, ownerName) {
- var sourceInfo = '';
-
- if (source) {
- var path = source.fileName;
- var fileName = path.replace(BEFORE_SLASH_RE, '');
-
- {
- // In DEV, include code for a common special case:
- // prefer "folder/index.js" instead of just "index.js".
- if (/^index\./.test(fileName)) {
- var match = path.match(BEFORE_SLASH_RE);
-
- if (match) {
- var pathBeforeSlash = match[1];
-
- if (pathBeforeSlash) {
- var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
- fileName = folderName + '/' + fileName;
- }
- }
- }
- }
-
- sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
- } else if (ownerName) {
- sourceInfo = ' (created by ' + ownerName + ')';
- }
-
- return '\n in ' + (name || 'Unknown') + sourceInfo;
- };
-
- var Resolved = 1;
-
- function refineResolvedLazyComponent(lazyComponent) {
- return lazyComponent._status === Resolved ? lazyComponent._result : null;
- }
-
- function getWrappedName(outerType, innerType, wrapperName) {
- var functionName = innerType.displayName || innerType.name || '';
- return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
- }
-
- function getComponentName(type) {
- if (type == null) {
- // Host root, text node or just invalid type.
- return null;
- }
-
- {
- if (typeof type.tag === 'number') {
- warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
- }
- }
-
- if (typeof type === 'function') {
- return type.displayName || type.name || null;
- }
-
- if (typeof type === 'string') {
- return type;
- }
-
- switch (type) {
- case REACT_FRAGMENT_TYPE:
- return 'Fragment';
-
- case REACT_PORTAL_TYPE:
- return 'Portal';
-
- case REACT_PROFILER_TYPE:
- return "Profiler";
-
- case REACT_STRICT_MODE_TYPE:
- return 'StrictMode';
-
- case REACT_SUSPENSE_TYPE:
- return 'Suspense';
-
- case REACT_SUSPENSE_LIST_TYPE:
- return 'SuspenseList';
- }
-
- if (typeof type === 'object') {
- switch (type.$$typeof) {
- case REACT_CONTEXT_TYPE:
- return 'Context.Consumer';
-
- case REACT_PROVIDER_TYPE:
- return 'Context.Provider';
-
- case REACT_FORWARD_REF_TYPE:
- return getWrappedName(type, type.render, 'ForwardRef');
-
- case REACT_MEMO_TYPE:
- return getComponentName(type.type);
-
- case REACT_LAZY_TYPE:
- {
- var thenable = type;
- var resolvedThenable = refineResolvedLazyComponent(thenable);
-
- if (resolvedThenable) {
- return getComponentName(resolvedThenable);
- }
-
- break;
- }
- }
- }
-
- return null;
- }
-
- var ReactDebugCurrentFrame = {};
- var currentlyValidatingElement = null;
- function setCurrentlyValidatingElement(element) {
- {
- currentlyValidatingElement = element;
- }
- }
-
- {
- // Stack implementation injected by the current renderer.
- ReactDebugCurrentFrame.getCurrentStack = null;
-
- ReactDebugCurrentFrame.getStackAddendum = function () {
- var stack = ''; // Add an extra top frame while an element is being validated
-
- if (currentlyValidatingElement) {
- var name = getComponentName(currentlyValidatingElement.type);
- var owner = currentlyValidatingElement._owner;
- stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
- } // Delegate to the injected renderer-specific implementation
-
-
- var impl = ReactDebugCurrentFrame.getCurrentStack;
-
- if (impl) {
- stack += impl() || '';
- }
-
- return stack;
- };
- }
-
- /**
- * Used by act() to track whether you're inside an act() scope.
- */
- var IsSomeRendererActing = {
- current: false
- };
-
- var ReactSharedInternals = {
- ReactCurrentDispatcher: ReactCurrentDispatcher,
- ReactCurrentBatchConfig: ReactCurrentBatchConfig,
- ReactCurrentOwner: ReactCurrentOwner,
- IsSomeRendererActing: IsSomeRendererActing,
- // Used by renderers to avoid bundling object-assign twice in UMD bundles:
- assign: _assign
- };
-
- {
- _assign(ReactSharedInternals, {
- // These should not be included in production.
- ReactDebugCurrentFrame: ReactDebugCurrentFrame,
- // Shim for React DOM 16.0.0 which still destructured (but not used) this.
- // TODO: remove in React 17.0.
- ReactComponentTreeHook: {}
- });
- }
-
- /**
- * Similar to invariant but only logs a warning if the condition is not met.
- * This can be used to log issues in development environments in critical
- * paths. Removing the logging code for production environments will keep the
- * same logic and follow the same code paths.
- */
-
- var warning = warningWithoutStack$1;
-
- {
- warning = function (condition, format) {
- if (condition) {
- return;
- }
-
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
- var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args
-
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
- args[_key - 2] = arguments[_key];
- }
-
- warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack]));
- };
- }
-
- var warning$1 = warning;
-
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var RESERVED_PROPS = {
- key: true,
- ref: true,
- __self: true,
- __source: true
- };
- var specialPropKeyWarningShown;
- var specialPropRefWarningShown;
-
- function hasValidRef(config) {
- {
- if (hasOwnProperty.call(config, 'ref')) {
- var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
-
- if (getter && getter.isReactWarning) {
- return false;
- }
- }
- }
-
- return config.ref !== undefined;
- }
-
- function hasValidKey(config) {
- {
- if (hasOwnProperty.call(config, 'key')) {
- var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
-
- if (getter && getter.isReactWarning) {
- return false;
- }
- }
- }
-
- return config.key !== undefined;
- }
-
- function defineKeyPropWarningGetter(props, displayName) {
- var warnAboutAccessingKey = function () {
- if (!specialPropKeyWarningShown) {
- specialPropKeyWarningShown = true;
- warningWithoutStack$1(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
- }
- };
-
- warnAboutAccessingKey.isReactWarning = true;
- Object.defineProperty(props, 'key', {
- get: warnAboutAccessingKey,
- configurable: true
- });
- }
-
- function defineRefPropWarningGetter(props, displayName) {
- var warnAboutAccessingRef = function () {
- if (!specialPropRefWarningShown) {
- specialPropRefWarningShown = true;
- warningWithoutStack$1(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
- }
- };
-
- warnAboutAccessingRef.isReactWarning = true;
- Object.defineProperty(props, 'ref', {
- get: warnAboutAccessingRef,
- configurable: true
- });
- }
- /**
- * Factory method to create a new React element. This no longer adheres to
- * the class pattern, so do not use new to call it. Also, instanceof check
- * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
- * if something is a React Element.
- *
- * @param {*} type
- * @param {*} props
- * @param {*} key
- * @param {string|object} ref
- * @param {*} owner
- * @param {*} self A *temporary* helper to detect places where `this` is
- * different from the `owner` when React.createElement is called, so that we
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
- * functions, and as long as `this` and owner are the same, there will be no
- * change in behavior.
- * @param {*} source An annotation object (added by a transpiler or otherwise)
- * indicating filename, line number, and/or other information.
- * @internal
- */
-
-
- var ReactElement = function (type, key, ref, self, source, owner, props) {
- var element = {
- // This tag allows us to uniquely identify this as a React Element
- $$typeof: REACT_ELEMENT_TYPE,
- // Built-in properties that belong on the element
- type: type,
- key: key,
- ref: ref,
- props: props,
- // Record the component responsible for creating this element.
- _owner: owner
- };
-
- {
- // The validation flag is currently mutative. We put it on
- // an external backing store so that we can freeze the whole object.
- // This can be replaced with a WeakMap once they are implemented in
- // commonly used development environments.
- element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
- // the validation flag non-enumerable (where possible, which should
- // include every environment we run tests in), so the test framework
- // ignores it.
-
- Object.defineProperty(element._store, 'validated', {
- configurable: false,
- enumerable: false,
- writable: true,
- value: false
- }); // self and source are DEV only properties.
-
- Object.defineProperty(element, '_self', {
- configurable: false,
- enumerable: false,
- writable: false,
- value: self
- }); // Two elements created in two different places should be considered
- // equal for testing purposes and therefore we hide it from enumeration.
-
- Object.defineProperty(element, '_source', {
- configurable: false,
- enumerable: false,
- writable: false,
- value: source
- });
-
- if (Object.freeze) {
- Object.freeze(element.props);
- Object.freeze(element);
- }
- }
-
- return element;
- };
- /**
- * https://github.com/reactjs/rfcs/pull/107
- * @param {*} type
- * @param {object} props
- * @param {string} key
- */
-
-
-
- /**
- * https://github.com/reactjs/rfcs/pull/107
- * @param {*} type
- * @param {object} props
- * @param {string} key
- */
-
- function jsxDEV(type, config, maybeKey, source, self) {
- var propName; // Reserved names are extracted
-
- var props = {};
- var key = null;
- var ref = null; // Currently, key can be spread in as a prop. This causes a potential
- // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
- // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
- // but as an intermediary step, we will use jsxDEV for everything except
- // <div {...props} key="Hi" />, because we aren't currently able to tell if
- // key is explicitly declared to be undefined or not.
-
- if (maybeKey !== undefined) {
- key = '' + maybeKey;
- }
-
- if (hasValidKey(config)) {
- key = '' + config.key;
- }
-
- if (hasValidRef(config)) {
- ref = config.ref;
- } // Remaining properties are added to a new props object
-
-
- for (propName in config) {
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
- props[propName] = config[propName];
- }
- } // Resolve default props
-
-
- if (type && type.defaultProps) {
- var defaultProps = type.defaultProps;
-
- for (propName in defaultProps) {
- if (props[propName] === undefined) {
- props[propName] = defaultProps[propName];
- }
- }
- }
-
- if (key || ref) {
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
-
- if (key) {
- defineKeyPropWarningGetter(props, displayName);
- }
-
- if (ref) {
- defineRefPropWarningGetter(props, displayName);
- }
- }
-
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
- }
- /**
- * Create and return a new ReactElement of the given type.
- * See https://reactjs.org/docs/react-api.html#createelement
- */
-
- function createElement(type, config, children) {
- var propName; // Reserved names are extracted
-
- var props = {};
- var key = null;
- var ref = null;
- var self = null;
- var source = null;
-
- if (config != null) {
- if (hasValidRef(config)) {
- ref = config.ref;
- }
-
- if (hasValidKey(config)) {
- key = '' + config.key;
- }
-
- self = config.__self === undefined ? null : config.__self;
- source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
-
- for (propName in config) {
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
- props[propName] = config[propName];
- }
- }
- } // Children can be more than one argument, and those are transferred onto
- // the newly allocated props object.
-
-
- var childrenLength = arguments.length - 2;
-
- if (childrenLength === 1) {
- props.children = children;
- } else if (childrenLength > 1) {
- var childArray = Array(childrenLength);
-
- for (var i = 0; i < childrenLength; i++) {
- childArray[i] = arguments[i + 2];
- }
-
- {
- if (Object.freeze) {
- Object.freeze(childArray);
- }
- }
-
- props.children = childArray;
- } // Resolve default props
-
-
- if (type && type.defaultProps) {
- var defaultProps = type.defaultProps;
-
- for (propName in defaultProps) {
- if (props[propName] === undefined) {
- props[propName] = defaultProps[propName];
- }
- }
- }
-
- {
- if (key || ref) {
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
-
- if (key) {
- defineKeyPropWarningGetter(props, displayName);
- }
-
- if (ref) {
- defineRefPropWarningGetter(props, displayName);
- }
- }
- }
-
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
- }
- /**
- * Return a function that produces ReactElements of a given type.
- * See https://reactjs.org/docs/react-api.html#createfactory
- */
-
-
- function cloneAndReplaceKey(oldElement, newKey) {
- var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
- return newElement;
- }
- /**
- * Clone and return a new ReactElement using element as the starting point.
- * See https://reactjs.org/docs/react-api.html#cloneelement
- */
-
- function cloneElement(element, config, children) {
- if (!!(element === null || element === undefined)) {
- {
- throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
- }
- }
-
- var propName; // Original props are copied
-
- var props = _assign({}, element.props); // Reserved names are extracted
-
-
- var key = element.key;
- var ref = element.ref; // Self is preserved since the owner is preserved.
-
- var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
- // transpiler, and the original source is probably a better indicator of the
- // true owner.
-
- var source = element._source; // Owner will be preserved, unless ref is overridden
-
- var owner = element._owner;
-
- if (config != null) {
- if (hasValidRef(config)) {
- // Silently steal the ref from the parent.
- ref = config.ref;
- owner = ReactCurrentOwner.current;
- }
-
- if (hasValidKey(config)) {
- key = '' + config.key;
- } // Remaining properties override existing props
-
-
- var defaultProps;
-
- if (element.type && element.type.defaultProps) {
- defaultProps = element.type.defaultProps;
- }
-
- for (propName in config) {
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
- if (config[propName] === undefined && defaultProps !== undefined) {
- // Resolve default props
- props[propName] = defaultProps[propName];
- } else {
- props[propName] = config[propName];
- }
- }
- }
- } // Children can be more than one argument, and those are transferred onto
- // the newly allocated props object.
-
-
- var childrenLength = arguments.length - 2;
-
- if (childrenLength === 1) {
- props.children = children;
- } else if (childrenLength > 1) {
- var childArray = Array(childrenLength);
-
- for (var i = 0; i < childrenLength; i++) {
- childArray[i] = arguments[i + 2];
- }
-
- props.children = childArray;
- }
-
- return ReactElement(element.type, key, ref, self, source, owner, props);
- }
- /**
- * Verifies the object is a ReactElement.
- * See https://reactjs.org/docs/react-api.html#isvalidelement
- * @param {?object} object
- * @return {boolean} True if `object` is a ReactElement.
- * @final
- */
-
- function isValidElement(object) {
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
- }
-
- var SEPARATOR = '.';
- var SUBSEPARATOR = ':';
- /**
- * Escape and wrap key so it is safe to use as a reactid
- *
- * @param {string} key to be escaped.
- * @return {string} the escaped key.
- */
-
- function escape(key) {
- var escapeRegex = /[=:]/g;
- var escaperLookup = {
- '=': '=0',
- ':': '=2'
- };
- var escapedString = ('' + key).replace(escapeRegex, function (match) {
- return escaperLookup[match];
- });
- return '$' + escapedString;
- }
- /**
- * TODO: Test that a single child and an array with one item have the same key
- * pattern.
- */
-
-
- var didWarnAboutMaps = false;
- var userProvidedKeyEscapeRegex = /\/+/g;
-
- function escapeUserProvidedKey(text) {
- return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
- }
-
- var POOL_SIZE = 10;
- var traverseContextPool = [];
-
- function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
- if (traverseContextPool.length) {
- var traverseContext = traverseContextPool.pop();
- traverseContext.result = mapResult;
- traverseContext.keyPrefix = keyPrefix;
- traverseContext.func = mapFunction;
- traverseContext.context = mapContext;
- traverseContext.count = 0;
- return traverseContext;
- } else {
- return {
- result: mapResult,
- keyPrefix: keyPrefix,
- func: mapFunction,
- context: mapContext,
- count: 0
- };
- }
- }
-
- function releaseTraverseContext(traverseContext) {
- traverseContext.result = null;
- traverseContext.keyPrefix = null;
- traverseContext.func = null;
- traverseContext.context = null;
- traverseContext.count = 0;
-
- if (traverseContextPool.length < POOL_SIZE) {
- traverseContextPool.push(traverseContext);
- }
- }
- /**
- * @param {?*} children Children tree container.
- * @param {!string} nameSoFar Name of the key path so far.
- * @param {!function} callback Callback to invoke with each child found.
- * @param {?*} traverseContext Used to pass information throughout the traversal
- * process.
- * @return {!number} The number of children in this subtree.
- */
-
-
- function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
- var type = typeof children;
-
- if (type === 'undefined' || type === 'boolean') {
- // All of the above are perceived as null.
- children = null;
- }
-
- var invokeCallback = false;
-
- if (children === null) {
- invokeCallback = true;
- } else {
- switch (type) {
- case 'string':
- case 'number':
- invokeCallback = true;
- break;
-
- case 'object':
- switch (children.$$typeof) {
- case REACT_ELEMENT_TYPE:
- case REACT_PORTAL_TYPE:
- invokeCallback = true;
- }
-
- }
- }
-
- if (invokeCallback) {
- callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array
- // so that it's consistent if the number of children grows.
- nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
- return 1;
- }
-
- var child;
- var nextName;
- var subtreeCount = 0; // Count of children found in the current subtree.
-
- var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
-
- if (Array.isArray(children)) {
- for (var i = 0; i < children.length; i++) {
- child = children[i];
- nextName = nextNamePrefix + getComponentKey(child, i);
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
- }
- } else {
- var iteratorFn = getIteratorFn(children);
-
- if (typeof iteratorFn === 'function') {
- {
- // Warn about using Maps as children
- if (iteratorFn === children.entries) {
- !didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0;
- didWarnAboutMaps = true;
- }
- }
-
- var iterator = iteratorFn.call(children);
- var step;
- var ii = 0;
-
- while (!(step = iterator.next()).done) {
- child = step.value;
- nextName = nextNamePrefix + getComponentKey(child, ii++);
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
- }
- } else if (type === 'object') {
- var addendum = '';
-
- {
- addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
- }
-
- var childrenString = '' + children;
-
- {
- {
- throw Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ")." + addendum);
- }
- }
- }
- }
-
- return subtreeCount;
- }
- /**
- * Traverses children that are typically specified as `props.children`, but
- * might also be specified through attributes:
- *
- * - `traverseAllChildren(this.props.children, ...)`
- * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
- *
- * The `traverseContext` is an optional argument that is passed through the
- * entire traversal. It can be used to store accumulations or anything else that
- * the callback might find relevant.
- *
- * @param {?*} children Children tree object.
- * @param {!function} callback To invoke upon traversing each child.
- * @param {?*} traverseContext Context for traversal.
- * @return {!number} The number of children in this subtree.
- */
-
-
- function traverseAllChildren(children, callback, traverseContext) {
- if (children == null) {
- return 0;
- }
-
- return traverseAllChildrenImpl(children, '', callback, traverseContext);
- }
- /**
- * Generate a key string that identifies a component within a set.
- *
- * @param {*} component A component that could contain a manual key.
- * @param {number} index Index that is used if a manual key is not provided.
- * @return {string}
- */
-
-
- function getComponentKey(component, index) {
- // Do some typechecking here since we call this blindly. We want to ensure
- // that we don't block potential future ES APIs.
- if (typeof component === 'object' && component !== null && component.key != null) {
- // Explicit key
- return escape(component.key);
- } // Implicit key determined by the index in the set
-
-
- return index.toString(36);
- }
-
- function forEachSingleChild(bookKeeping, child, name) {
- var func = bookKeeping.func,
- context = bookKeeping.context;
- func.call(context, child, bookKeeping.count++);
- }
- /**
- * Iterates through children that are typically specified as `props.children`.
- *
- * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
- *
- * The provided forEachFunc(child, index) will be called for each
- * leaf child.
- *
- * @param {?*} children Children tree container.
- * @param {function(*, int)} forEachFunc
- * @param {*} forEachContext Context for forEachContext.
- */
-
-
- function forEachChildren(children, forEachFunc, forEachContext) {
- if (children == null) {
- return children;
- }
-
- var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
- traverseAllChildren(children, forEachSingleChild, traverseContext);
- releaseTraverseContext(traverseContext);
- }
-
- function mapSingleChildIntoContext(bookKeeping, child, childKey) {
- var result = bookKeeping.result,
- keyPrefix = bookKeeping.keyPrefix,
- func = bookKeeping.func,
- context = bookKeeping.context;
- var mappedChild = func.call(context, child, bookKeeping.count++);
-
- if (Array.isArray(mappedChild)) {
- mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
- return c;
- });
- } else if (mappedChild != null) {
- if (isValidElement(mappedChild)) {
- mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
- // traverseAllChildren used to do for objects as children
- keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
- }
-
- result.push(mappedChild);
- }
- }
-
- function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
- var escapedPrefix = '';
-
- if (prefix != null) {
- escapedPrefix = escapeUserProvidedKey(prefix) + '/';
- }
-
- var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
- traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
- releaseTraverseContext(traverseContext);
- }
- /**
- * Maps children that are typically specified as `props.children`.
- *
- * See https://reactjs.org/docs/react-api.html#reactchildrenmap
- *
- * The provided mapFunction(child, key, index) will be called for each
- * leaf child.
- *
- * @param {?*} children Children tree container.
- * @param {function(*, int)} func The map function.
- * @param {*} context Context for mapFunction.
- * @return {object} Object containing the ordered map of results.
- */
-
-
- function mapChildren(children, func, context) {
- if (children == null) {
- return children;
- }
-
- var result = [];
- mapIntoWithKeyPrefixInternal(children, result, null, func, context);
- return result;
- }
- /**
- * Count the number of children that are typically specified as
- * `props.children`.
- *
- * See https://reactjs.org/docs/react-api.html#reactchildrencount
- *
- * @param {?*} children Children tree container.
- * @return {number} The number of children.
- */
-
-
- function countChildren(children) {
- return traverseAllChildren(children, function () {
- return null;
- }, null);
- }
- /**
- * Flatten a children object (typically specified as `props.children`) and
- * return an array with appropriately re-keyed children.
- *
- * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
- */
-
-
- function toArray(children) {
- var result = [];
- mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
- return child;
- });
- return result;
- }
- /**
- * Returns the first child in a collection of children and verifies that there
- * is only one child in the collection.
- *
- * See https://reactjs.org/docs/react-api.html#reactchildrenonly
- *
- * The current implementation of this function assumes that a single child gets
- * passed without a wrapper, but the purpose of this helper function is to
- * abstract away the particular structure of children.
- *
- * @param {?object} children Child collection structure.
- * @return {ReactElement} The first and only `ReactElement` contained in the
- * structure.
- */
-
-
- function onlyChild(children) {
- if (!isValidElement(children)) {
- {
- throw Error("React.Children.only expected to receive a single React element child.");
- }
- }
-
- return children;
- }
-
- function createContext(defaultValue, calculateChangedBits) {
- if (calculateChangedBits === undefined) {
- calculateChangedBits = null;
- } else {
- {
- !(calculateChangedBits === null || typeof calculateChangedBits === 'function') ? warningWithoutStack$1(false, 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits) : void 0;
- }
- }
-
- var context = {
- $$typeof: REACT_CONTEXT_TYPE,
- _calculateChangedBits: calculateChangedBits,
- // As a workaround to support multiple concurrent renderers, we categorize
- // some renderers as primary and others as secondary. We only expect
- // there to be two concurrent renderers at most: React Native (primary) and
- // Fabric (secondary); React DOM (primary) and React ART (secondary).
- // Secondary renderers store their context values on separate fields.
- _currentValue: defaultValue,
- _currentValue2: defaultValue,
- // Used to track how many concurrent renderers this context currently
- // supports within in a single renderer. Such as parallel server rendering.
- _threadCount: 0,
- // These are circular
- Provider: null,
- Consumer: null
- };
- context.Provider = {
- $$typeof: REACT_PROVIDER_TYPE,
- _context: context
- };
- var hasWarnedAboutUsingNestedContextConsumers = false;
- var hasWarnedAboutUsingConsumerProvider = false;
-
- {
- // A separate object, but proxies back to the original context object for
- // backwards compatibility. It has a different $$typeof, so we can properly
- // warn for the incorrect usage of Context as a Consumer.
- var Consumer = {
- $$typeof: REACT_CONTEXT_TYPE,
- _context: context,
- _calculateChangedBits: context._calculateChangedBits
- }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
-
- Object.defineProperties(Consumer, {
- Provider: {
- get: function () {
- if (!hasWarnedAboutUsingConsumerProvider) {
- hasWarnedAboutUsingConsumerProvider = true;
- warning$1(false, 'Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
- }
-
- return context.Provider;
- },
- set: function (_Provider) {
- context.Provider = _Provider;
- }
- },
- _currentValue: {
- get: function () {
- return context._currentValue;
- },
- set: function (_currentValue) {
- context._currentValue = _currentValue;
- }
- },
- _currentValue2: {
- get: function () {
- return context._currentValue2;
- },
- set: function (_currentValue2) {
- context._currentValue2 = _currentValue2;
- }
- },
- _threadCount: {
- get: function () {
- return context._threadCount;
- },
- set: function (_threadCount) {
- context._threadCount = _threadCount;
- }
- },
- Consumer: {
- get: function () {
- if (!hasWarnedAboutUsingNestedContextConsumers) {
- hasWarnedAboutUsingNestedContextConsumers = true;
- warning$1(false, 'Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
- }
-
- return context.Consumer;
- }
- }
- }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
-
- context.Consumer = Consumer;
- }
-
- {
- context._currentRenderer = null;
- context._currentRenderer2 = null;
- }
-
- return context;
- }
-
- function lazy(ctor) {
- var lazyType = {
- $$typeof: REACT_LAZY_TYPE,
- _ctor: ctor,
- // React uses these fields to store the result.
- _status: -1,
- _result: null
- };
-
- {
- // In production, this would just set it on the object.
- var defaultProps;
- var propTypes;
- Object.defineProperties(lazyType, {
- defaultProps: {
- configurable: true,
- get: function () {
- return defaultProps;
- },
- set: function (newDefaultProps) {
- warning$1(false, 'React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
- defaultProps = newDefaultProps; // Match production behavior more closely:
-
- Object.defineProperty(lazyType, 'defaultProps', {
- enumerable: true
- });
- }
- },
- propTypes: {
- configurable: true,
- get: function () {
- return propTypes;
- },
- set: function (newPropTypes) {
- warning$1(false, 'React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
- propTypes = newPropTypes; // Match production behavior more closely:
-
- Object.defineProperty(lazyType, 'propTypes', {
- enumerable: true
- });
- }
- }
- });
- }
-
- return lazyType;
- }
-
- function forwardRef(render) {
- {
- if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
- warningWithoutStack$1(false, 'forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
- } else if (typeof render !== 'function') {
- warningWithoutStack$1(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
- } else {
- !( // Do not warn for 0 arguments because it could be due to usage of the 'arguments' object
- render.length === 0 || render.length === 2) ? warningWithoutStack$1(false, 'forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.') : void 0;
- }
-
- if (render != null) {
- !(render.defaultProps == null && render.propTypes == null) ? warningWithoutStack$1(false, 'forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?') : void 0;
- }
- }
-
- return {
- $$typeof: REACT_FORWARD_REF_TYPE,
- render: render
- };
- }
-
- function isValidElementType(type) {
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE);
- }
-
- function memo(type, compare) {
- {
- if (!isValidElementType(type)) {
- warningWithoutStack$1(false, 'memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
- }
- }
-
- return {
- $$typeof: REACT_MEMO_TYPE,
- type: type,
- compare: compare === undefined ? null : compare
- };
- }
-
- function resolveDispatcher() {
- var dispatcher = ReactCurrentDispatcher.current;
-
- if (!(dispatcher !== null)) {
- {
- throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");
- }
- }
-
- return dispatcher;
- }
-
- function useContext(Context, unstable_observedBits) {
- var dispatcher = resolveDispatcher();
-
- {
- !(unstable_observedBits === undefined) ? warning$1(false, 'useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '') : void 0; // TODO: add a more generic warning for invalid values.
-
- if (Context._context !== undefined) {
- var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
- // and nobody should be using this in existing code.
-
- if (realContext.Consumer === Context) {
- warning$1(false, 'Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
- } else if (realContext.Provider === Context) {
- warning$1(false, 'Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
- }
- }
- }
-
- return dispatcher.useContext(Context, unstable_observedBits);
- }
- function useState(initialState) {
- var dispatcher = resolveDispatcher();
- return dispatcher.useState(initialState);
- }
- function useReducer(reducer, initialArg, init) {
- var dispatcher = resolveDispatcher();
- return dispatcher.useReducer(reducer, initialArg, init);
- }
- function useRef(initialValue) {
- var dispatcher = resolveDispatcher();
- return dispatcher.useRef(initialValue);
- }
- function useEffect(create, inputs) {
- var dispatcher = resolveDispatcher();
- return dispatcher.useEffect(create, inputs);
- }
- function useLayoutEffect(create, inputs) {
- var dispatcher = resolveDispatcher();
- return dispatcher.useLayoutEffect(create, inputs);
- }
- function useCallback(callback, inputs) {
- var dispatcher = resolveDispatcher();
- return dispatcher.useCallback(callback, inputs);
- }
- function useMemo(create, inputs) {
- var dispatcher = resolveDispatcher();
- return dispatcher.useMemo(create, inputs);
- }
- function useImperativeHandle(ref, create, inputs) {
- var dispatcher = resolveDispatcher();
- return dispatcher.useImperativeHandle(ref, create, inputs);
- }
- function useDebugValue(value, formatterFn) {
- {
- var dispatcher = resolveDispatcher();
- return dispatcher.useDebugValue(value, formatterFn);
- }
- }
- var emptyObject$1 = {};
- function useResponder(responder, listenerProps) {
- var dispatcher = resolveDispatcher();
-
- {
- if (responder == null || responder.$$typeof !== REACT_RESPONDER_TYPE) {
- warning$1(false, 'useResponder: invalid first argument. Expected an event responder, but instead got %s', responder);
- return;
- }
- }
-
- return dispatcher.useResponder(responder, listenerProps || emptyObject$1);
- }
- function useTransition(config) {
- var dispatcher = resolveDispatcher();
- return dispatcher.useTransition(config);
- }
- function useDeferredValue(value, config) {
- var dispatcher = resolveDispatcher();
- return dispatcher.useDeferredValue(value, config);
- }
-
- function withSuspenseConfig(scope, config) {
- var previousConfig = ReactCurrentBatchConfig.suspense;
- ReactCurrentBatchConfig.suspense = config === undefined ? null : config;
-
- try {
- scope();
- } finally {
- ReactCurrentBatchConfig.suspense = previousConfig;
- }
- }
-
- /**
- * ReactElementValidator provides a wrapper around a element factory
- * which validates the props passed to the element. This is intended to be
- * used only in DEV and could be replaced by a static type checker for languages
- * that support it.
- */
- var propTypesMisspellWarningShown;
-
- {
- propTypesMisspellWarningShown = false;
- }
-
- var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
-
- function getDeclarationErrorAddendum() {
- if (ReactCurrentOwner.current) {
- var name = getComponentName(ReactCurrentOwner.current.type);
-
- if (name) {
- return '\n\nCheck the render method of `' + name + '`.';
- }
- }
-
- return '';
- }
-
- function getSourceInfoErrorAddendum(source) {
- if (source !== undefined) {
- var fileName = source.fileName.replace(/^.*[\\\/]/, '');
- var lineNumber = source.lineNumber;
- return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
- }
-
- return '';
- }
-
- function getSourceInfoErrorAddendumForProps(elementProps) {
- if (elementProps !== null && elementProps !== undefined) {
- return getSourceInfoErrorAddendum(elementProps.__source);
- }
-
- return '';
- }
- /**
- * Warn if there's no key explicitly set on dynamic arrays of children or
- * object keys are not valid. This allows us to keep track of children between
- * updates.
- */
-
-
- var ownerHasKeyUseWarning = {};
-
- function getCurrentComponentErrorInfo(parentType) {
- var info = getDeclarationErrorAddendum();
-
- if (!info) {
- var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
-
- if (parentName) {
- info = "\n\nCheck the top-level render call using <" + parentName + ">.";
- }
- }
-
- return info;
- }
- /**
- * Warn if the element doesn't have an explicit key assigned to it.
- * This element is in an array. The array could grow and shrink or be
- * reordered. All children that haven't already been validated are required to
- * have a "key" property assigned to it. Error statuses are cached so a warning
- * will only be shown once.
- *
- * @internal
- * @param {ReactElement} element Element that requires a key.
- * @param {*} parentType element's parent's type.
- */
-
-
- function validateExplicitKey(element, parentType) {
- if (!element._store || element._store.validated || element.key != null) {
- return;
- }
-
- element._store.validated = true;
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
-
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
- return;
- }
-
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
- // property, it may be the creator of the child that's responsible for
- // assigning it a key.
-
- var childOwner = '';
-
- if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
- // Give the component that originally created this child.
- childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
- }
-
- setCurrentlyValidatingElement(element);
-
- {
- warning$1(false, 'Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
- }
-
- setCurrentlyValidatingElement(null);
- }
- /**
- * Ensure that every element either is passed in a static location, in an
- * array with an explicit keys property defined, or in an object literal
- * with valid key property.
- *
- * @internal
- * @param {ReactNode} node Statically passed child of any type.
- * @param {*} parentType node's parent's type.
- */
-
-
- function validateChildKeys(node, parentType) {
- if (typeof node !== 'object') {
- return;
- }
-
- if (Array.isArray(node)) {
- for (var i = 0; i < node.length; i++) {
- var child = node[i];
-
- if (isValidElement(child)) {
- validateExplicitKey(child, parentType);
- }
- }
- } else if (isValidElement(node)) {
- // This element was passed in a valid location.
- if (node._store) {
- node._store.validated = true;
- }
- } else if (node) {
- var iteratorFn = getIteratorFn(node);
-
- if (typeof iteratorFn === 'function') {
- // Entry iterators used to provide implicit keys,
- // but now we print a separate warning for them later.
- if (iteratorFn !== node.entries) {
- var iterator = iteratorFn.call(node);
- var step;
-
- while (!(step = iterator.next()).done) {
- if (isValidElement(step.value)) {
- validateExplicitKey(step.value, parentType);
- }
- }
- }
- }
- }
- }
- /**
- * Given an element, validate that its props follow the propTypes definition,
- * provided by the type.
- *
- * @param {ReactElement} element
- */
-
-
- function validatePropTypes(element) {
- var type = element.type;
-
- if (type === null || type === undefined || typeof type === 'string') {
- return;
- }
-
- var name = getComponentName(type);
- var propTypes;
-
- if (typeof type === 'function') {
- propTypes = type.propTypes;
- } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
- // Inner props are checked in the reconciler.
- type.$$typeof === REACT_MEMO_TYPE)) {
- propTypes = type.propTypes;
- } else {
- return;
- }
-
- if (propTypes) {
- setCurrentlyValidatingElement(element);
- checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
- setCurrentlyValidatingElement(null);
- } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
- propTypesMisspellWarningShown = true;
- warningWithoutStack$1(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
- }
-
- if (typeof type.getDefaultProps === 'function') {
- !type.getDefaultProps.isReactClassApproved ? warningWithoutStack$1(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
- }
- }
- /**
- * Given a fragment, validate that it can only be provided with fragment props
- * @param {ReactElement} fragment
- */
-
-
- function validateFragmentProps(fragment) {
- setCurrentlyValidatingElement(fragment);
- var keys = Object.keys(fragment.props);
-
- for (var i = 0; i < keys.length; i++) {
- var key = keys[i];
-
- if (key !== 'children' && key !== 'key') {
- warning$1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
- break;
- }
- }
-
- if (fragment.ref !== null) {
- warning$1(false, 'Invalid attribute `ref` supplied to `React.Fragment`.');
- }
-
- setCurrentlyValidatingElement(null);
- }
-
- function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
- var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
- // succeed and there will likely be errors in render.
-
- if (!validType) {
- var info = '';
-
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
- info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
- }
-
- var sourceInfo = getSourceInfoErrorAddendum(source);
-
- if (sourceInfo) {
- info += sourceInfo;
- } else {
- info += getDeclarationErrorAddendum();
- }
-
- var typeString;
-
- if (type === null) {
- typeString = 'null';
- } else if (Array.isArray(type)) {
- typeString = 'array';
- } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
- typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
- info = ' Did you accidentally export a JSX literal instead of a component?';
- } else {
- typeString = typeof type;
- }
-
- warning$1(false, 'React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
- }
-
- var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
- // TODO: Drop this when these are no longer allowed as the type argument.
-
- if (element == null) {
- return element;
- } // Skip key warning if the type isn't valid since our key validation logic
- // doesn't expect a non-string/function type and can throw confusing errors.
- // We don't want exception behavior to differ between dev and prod.
- // (Rendering will throw with a helpful message and as soon as the type is
- // fixed, the key warnings will appear.)
-
-
- if (validType) {
- var children = props.children;
-
- if (children !== undefined) {
- if (isStaticChildren) {
- if (Array.isArray(children)) {
- for (var i = 0; i < children.length; i++) {
- validateChildKeys(children[i], type);
- }
-
- if (Object.freeze) {
- Object.freeze(children);
- }
- } else {
- warning$1(false, 'React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
- }
- } else {
- validateChildKeys(children, type);
- }
- }
- }
-
- if (hasOwnProperty$1.call(props, 'key')) {
- warning$1(false, 'React.jsx: Spreading a key to JSX is a deprecated pattern. ' + 'Explicitly pass a key after spreading props in your JSX call. ' + 'E.g. <ComponentName {...props} key={key} />');
- }
-
- if (type === REACT_FRAGMENT_TYPE) {
- validateFragmentProps(element);
- } else {
- validatePropTypes(element);
- }
-
- return element;
- } // These two functions exist to still get child warnings in dev
- // even with the prod transform. This means that jsxDEV is purely
- // opt-in behavior for better messages but that we won't stop
- // giving you warnings if you use production apis.
-
- function jsxWithValidationStatic(type, props, key) {
- return jsxWithValidation(type, props, key, true);
- }
- function jsxWithValidationDynamic(type, props, key) {
- return jsxWithValidation(type, props, key, false);
- }
- function createElementWithValidation(type, props, children) {
- var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
- // succeed and there will likely be errors in render.
-
- if (!validType) {
- var info = '';
-
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
- info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
- }
-
- var sourceInfo = getSourceInfoErrorAddendumForProps(props);
-
- if (sourceInfo) {
- info += sourceInfo;
- } else {
- info += getDeclarationErrorAddendum();
- }
-
- var typeString;
-
- if (type === null) {
- typeString = 'null';
- } else if (Array.isArray(type)) {
- typeString = 'array';
- } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
- typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
- info = ' Did you accidentally export a JSX literal instead of a component?';
- } else {
- typeString = typeof type;
- }
-
- warning$1(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
- }
-
- var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
- // TODO: Drop this when these are no longer allowed as the type argument.
-
- if (element == null) {
- return element;
- } // Skip key warning if the type isn't valid since our key validation logic
- // doesn't expect a non-string/function type and can throw confusing errors.
- // We don't want exception behavior to differ between dev and prod.
- // (Rendering will throw with a helpful message and as soon as the type is
- // fixed, the key warnings will appear.)
-
-
- if (validType) {
- for (var i = 2; i < arguments.length; i++) {
- validateChildKeys(arguments[i], type);
- }
- }
-
- if (type === REACT_FRAGMENT_TYPE) {
- validateFragmentProps(element);
- } else {
- validatePropTypes(element);
- }
-
- return element;
- }
- function createFactoryWithValidation(type) {
- var validatedFactory = createElementWithValidation.bind(null, type);
- validatedFactory.type = type; // Legacy hook: remove it
-
- {
- Object.defineProperty(validatedFactory, 'type', {
- enumerable: false,
- get: function () {
- lowPriorityWarningWithoutStack$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
- Object.defineProperty(this, 'type', {
- value: type
- });
- return type;
- }
- });
- }
-
- return validatedFactory;
- }
- function cloneElementWithValidation(element, props, children) {
- var newElement = cloneElement.apply(this, arguments);
-
- for (var i = 2; i < arguments.length; i++) {
- validateChildKeys(arguments[i], newElement.type);
- }
-
- validatePropTypes(newElement);
- return newElement;
- }
-
- var hasBadMapPolyfill;
-
- {
- hasBadMapPolyfill = false;
-
- try {
- var frozenObject = Object.freeze({});
- var testMap = new Map([[frozenObject, null]]);
- var testSet = new Set([frozenObject]); // This is necessary for Rollup to not consider these unused.
- // https://github.com/rollup/rollup/issues/1771
- // TODO: we can remove these if Rollup fixes the bug.
-
- testMap.set(0, 0);
- testSet.add(0);
- } catch (e) {
- // TODO: Consider warning about bad polyfills
- hasBadMapPolyfill = true;
- }
- }
-
- function createFundamentalComponent(impl) {
- // We use responder as a Map key later on. When we have a bad
- // polyfill, then we can't use it as a key as the polyfill tries
- // to add a property to the object.
- if ( true && !hasBadMapPolyfill) {
- Object.freeze(impl);
- }
-
- var fundamantalComponent = {
- $$typeof: REACT_FUNDAMENTAL_TYPE,
- impl: impl
- };
-
- {
- Object.freeze(fundamantalComponent);
- }
-
- return fundamantalComponent;
- }
-
- function createEventResponder(displayName, responderConfig) {
- var getInitialState = responderConfig.getInitialState,
- onEvent = responderConfig.onEvent,
- onMount = responderConfig.onMount,
- onUnmount = responderConfig.onUnmount,
- onRootEvent = responderConfig.onRootEvent,
- rootEventTypes = responderConfig.rootEventTypes,
- targetEventTypes = responderConfig.targetEventTypes,
- targetPortalPropagation = responderConfig.targetPortalPropagation;
- var eventResponder = {
- $$typeof: REACT_RESPONDER_TYPE,
- displayName: displayName,
- getInitialState: getInitialState || null,
- onEvent: onEvent || null,
- onMount: onMount || null,
- onRootEvent: onRootEvent || null,
- onUnmount: onUnmount || null,
- rootEventTypes: rootEventTypes || null,
- targetEventTypes: targetEventTypes || null,
- targetPortalPropagation: targetPortalPropagation || false
- }; // We use responder as a Map key later on. When we have a bad
- // polyfill, then we can't use it as a key as the polyfill tries
- // to add a property to the object.
-
- if ( true && !hasBadMapPolyfill) {
- Object.freeze(eventResponder);
- }
-
- return eventResponder;
- }
-
- function createScope() {
- var scopeComponent = {
- $$typeof: REACT_SCOPE_TYPE
- };
-
- {
- Object.freeze(scopeComponent);
- }
-
- return scopeComponent;
- }
-
- // Helps identify side effects in render-phase lifecycle hooks and setState
- // reducers by double invoking them in Strict Mode.
-
- // To preserve the "Pause on caught exceptions" behavior of the debugger, we
- // replay the begin phase of a failed component inside invokeGuardedCallback.
-
- // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
-
- // Gather advanced timing metrics for Profiler subtrees.
-
- // Trace which interactions trigger each commit.
-
- // SSR experiments
-
-
- // Only used in www builds.
-
- // Only used in www builds.
-
- // Disable javascript: URL strings in href for XSS protection.
-
- // React Fire: prevent the value and checked attributes from syncing
- // with their related DOM properties
-
- // These APIs will no longer be "unstable" in the upcoming 16.7 release,
- // Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
-
- var exposeConcurrentModeAPIs = false;
- // Experimental React Flare event system and event components support.
-
- var enableFlareAPI = false; // Experimental Host Component support.
-
- var enableFundamentalAPI = false; // Experimental Scope support.
-
- var enableScopeAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
-
- var enableJSXTransformAPI = false; // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
- // Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version
-
- // For tests, we flush suspense fallbacks in an act scope;
- // *except* in some of our own tests, where we test incremental loading states.
-
- // Add a callback property to suspense to notify which promises are currently
- // in the update queue. This allows reporting and tracing of what is causing
- // the user to see a loading state.
- // Also allows hydration callbacks to fire when a dehydrated boundary gets
- // hydrated or deleted.
-
- // Part of the simplification of React.createElement so we can eventually move
- // from React.createElement to React.jsx
- // https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
-
-
-
-
-
- // Flag to turn event.target and event.currentTarget in ReactNative from a reactTag to a component instance
-
- var React = {
- Children: {
- map: mapChildren,
- forEach: forEachChildren,
- count: countChildren,
- toArray: toArray,
- only: onlyChild
- },
- createRef: createRef,
- Component: Component,
- PureComponent: PureComponent,
- createContext: createContext,
- forwardRef: forwardRef,
- lazy: lazy,
- memo: memo,
- useCallback: useCallback,
- useContext: useContext,
- useEffect: useEffect,
- useImperativeHandle: useImperativeHandle,
- useDebugValue: useDebugValue,
- useLayoutEffect: useLayoutEffect,
- useMemo: useMemo,
- useReducer: useReducer,
- useRef: useRef,
- useState: useState,
- Fragment: REACT_FRAGMENT_TYPE,
- Profiler: REACT_PROFILER_TYPE,
- StrictMode: REACT_STRICT_MODE_TYPE,
- Suspense: REACT_SUSPENSE_TYPE,
- createElement: createElementWithValidation,
- cloneElement: cloneElementWithValidation,
- createFactory: createFactoryWithValidation,
- isValidElement: isValidElement,
- version: ReactVersion,
- __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
- };
-
- if (exposeConcurrentModeAPIs) {
- React.useTransition = useTransition;
- React.useDeferredValue = useDeferredValue;
- React.SuspenseList = REACT_SUSPENSE_LIST_TYPE;
- React.unstable_withSuspenseConfig = withSuspenseConfig;
- }
-
- if (enableFlareAPI) {
- React.unstable_useResponder = useResponder;
- React.unstable_createResponder = createEventResponder;
- }
-
- if (enableFundamentalAPI) {
- React.unstable_createFundamental = createFundamentalComponent;
- }
-
- if (enableScopeAPI) {
- React.unstable_createScope = createScope;
- } // Note: some APIs are added with feature flags.
- // Make sure that stable builds for open source
- // don't modify the React object to avoid deopts.
- // Also let's not expose their names in stable builds.
-
-
- if (enableJSXTransformAPI) {
- {
- React.jsxDEV = jsxWithValidation;
- React.jsx = jsxWithValidationDynamic;
- React.jsxs = jsxWithValidationStatic;
- }
- }
-
-
-
- var React$2 = Object.freeze({
- default: React
- });
-
- var React$3 = ( React$2 && React ) || React$2;
-
- // TODO: decide on the top-level export form.
- // This is hacky but makes it work with both Rollup and Jest.
-
-
- var react = React$3.default || React$3;
-
- module.exports = react;
- })();
- }
-
-
- /***/ }),
-
- /***/ "./node_modules/react/index.js":
- /*!*************************************!*\
- !*** ./node_modules/react/index.js ***!
- \*************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- if (false) {} else {
- module.exports = __webpack_require__(/*! ./cjs/react.development.js */ "./node_modules/react/cjs/react.development.js");
- }
-
-
- /***/ }),
-
- /***/ "./node_modules/scheduler/cjs/scheduler-tracing.development.js":
- /*!*********************************************************************!*\
- !*** ./node_modules/scheduler/cjs/scheduler-tracing.development.js ***!
- \*********************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
- /** @license React v0.18.0
- * scheduler-tracing.development.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-
-
-
-
- if (true) {
- (function() {
- 'use strict';
-
- Object.defineProperty(exports, '__esModule', { value: true });
-
- // Helps identify side effects in render-phase lifecycle hooks and setState
- // reducers by double invoking them in Strict Mode.
-
- // To preserve the "Pause on caught exceptions" behavior of the debugger, we
- // replay the begin phase of a failed component inside invokeGuardedCallback.
-
- // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
-
- // Gather advanced timing metrics for Profiler subtrees.
-
- // Trace which interactions trigger each commit.
-
- var enableSchedulerTracing = true; // SSR experiments
-
-
- // Only used in www builds.
-
- // Only used in www builds.
-
- // Disable javascript: URL strings in href for XSS protection.
-
- // React Fire: prevent the value and checked attributes from syncing
- // with their related DOM properties
-
- // These APIs will no longer be "unstable" in the upcoming 16.7 release,
- // Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
-
-
- // Experimental React Flare event system and event components support.
-
- // Experimental Host Component support.
-
- // Experimental Scope support.
-
- // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
-
- // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
- // Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version
-
- // For tests, we flush suspense fallbacks in an act scope;
- // *except* in some of our own tests, where we test incremental loading states.
-
- // Add a callback property to suspense to notify which promises are currently
- // in the update queue. This allows reporting and tracing of what is causing
- // the user to see a loading state.
- // Also allows hydration callbacks to fire when a dehydrated boundary gets
- // hydrated or deleted.
-
- // Part of the simplification of React.createElement so we can eventually move
- // from React.createElement to React.jsx
- // https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
-
-
-
-
-
- // Flag to turn event.target and event.currentTarget in ReactNative from a reactTag to a component instance
-
- var DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs.
-
- var interactionIDCounter = 0;
- var threadIDCounter = 0; // Set of currently traced interactions.
- // Interactions "stack"–
- // Meaning that newly traced interactions are appended to the previously active set.
- // When an interaction goes out of scope, the previous set (if any) is restored.
-
- exports.__interactionsRef = null; // Listener(s) to notify when interactions begin and end.
-
- exports.__subscriberRef = null;
-
- if (enableSchedulerTracing) {
- exports.__interactionsRef = {
- current: new Set()
- };
- exports.__subscriberRef = {
- current: null
- };
- }
-
- function unstable_clear(callback) {
- if (!enableSchedulerTracing) {
- return callback();
- }
-
- var prevInteractions = exports.__interactionsRef.current;
- exports.__interactionsRef.current = new Set();
-
- try {
- return callback();
- } finally {
- exports.__interactionsRef.current = prevInteractions;
- }
- }
- function unstable_getCurrent() {
- if (!enableSchedulerTracing) {
- return null;
- } else {
- return exports.__interactionsRef.current;
- }
- }
- function unstable_getThreadID() {
- return ++threadIDCounter;
- }
- function unstable_trace(name, timestamp, callback) {
- var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID;
-
- if (!enableSchedulerTracing) {
- return callback();
- }
-
- var interaction = {
- __count: 1,
- id: interactionIDCounter++,
- name: name,
- timestamp: timestamp
- };
- var prevInteractions = exports.__interactionsRef.current; // Traced interactions should stack/accumulate.
- // To do that, clone the current interactions.
- // The previous set will be restored upon completion.
-
- var interactions = new Set(prevInteractions);
- interactions.add(interaction);
- exports.__interactionsRef.current = interactions;
- var subscriber = exports.__subscriberRef.current;
- var returnValue;
-
- try {
- if (subscriber !== null) {
- subscriber.onInteractionTraced(interaction);
- }
- } finally {
- try {
- if (subscriber !== null) {
- subscriber.onWorkStarted(interactions, threadID);
- }
- } finally {
- try {
- returnValue = callback();
- } finally {
- exports.__interactionsRef.current = prevInteractions;
-
- try {
- if (subscriber !== null) {
- subscriber.onWorkStopped(interactions, threadID);
- }
- } finally {
- interaction.__count--; // If no async work was scheduled for this interaction,
- // Notify subscribers that it's completed.
-
- if (subscriber !== null && interaction.__count === 0) {
- subscriber.onInteractionScheduledWorkCompleted(interaction);
- }
- }
- }
- }
- }
-
- return returnValue;
- }
- function unstable_wrap(callback) {
- var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID;
-
- if (!enableSchedulerTracing) {
- return callback;
- }
-
- var wrappedInteractions = exports.__interactionsRef.current;
- var subscriber = exports.__subscriberRef.current;
-
- if (subscriber !== null) {
- subscriber.onWorkScheduled(wrappedInteractions, threadID);
- } // Update the pending async work count for the current interactions.
- // Update after calling subscribers in case of error.
-
-
- wrappedInteractions.forEach(function (interaction) {
- interaction.__count++;
- });
- var hasRun = false;
-
- function wrapped() {
- var prevInteractions = exports.__interactionsRef.current;
- exports.__interactionsRef.current = wrappedInteractions;
- subscriber = exports.__subscriberRef.current;
-
- try {
- var returnValue;
-
- try {
- if (subscriber !== null) {
- subscriber.onWorkStarted(wrappedInteractions, threadID);
- }
- } finally {
- try {
- returnValue = callback.apply(undefined, arguments);
- } finally {
- exports.__interactionsRef.current = prevInteractions;
-
- if (subscriber !== null) {
- subscriber.onWorkStopped(wrappedInteractions, threadID);
- }
- }
- }
-
- return returnValue;
- } finally {
- if (!hasRun) {
- // We only expect a wrapped function to be executed once,
- // But in the event that it's executed more than once–
- // Only decrement the outstanding interaction counts once.
- hasRun = true; // Update pending async counts for all wrapped interactions.
- // If this was the last scheduled async work for any of them,
- // Mark them as completed.
-
- wrappedInteractions.forEach(function (interaction) {
- interaction.__count--;
-
- if (subscriber !== null && interaction.__count === 0) {
- subscriber.onInteractionScheduledWorkCompleted(interaction);
- }
- });
- }
- }
- }
-
- wrapped.cancel = function cancel() {
- subscriber = exports.__subscriberRef.current;
-
- try {
- if (subscriber !== null) {
- subscriber.onWorkCanceled(wrappedInteractions, threadID);
- }
- } finally {
- // Update pending async counts for all wrapped interactions.
- // If this was the last scheduled async work for any of them,
- // Mark them as completed.
- wrappedInteractions.forEach(function (interaction) {
- interaction.__count--;
-
- if (subscriber && interaction.__count === 0) {
- subscriber.onInteractionScheduledWorkCompleted(interaction);
- }
- });
- }
- };
-
- return wrapped;
- }
-
- var subscribers = null;
-
- if (enableSchedulerTracing) {
- subscribers = new Set();
- }
-
- function unstable_subscribe(subscriber) {
- if (enableSchedulerTracing) {
- subscribers.add(subscriber);
-
- if (subscribers.size === 1) {
- exports.__subscriberRef.current = {
- onInteractionScheduledWorkCompleted: onInteractionScheduledWorkCompleted,
- onInteractionTraced: onInteractionTraced,
- onWorkCanceled: onWorkCanceled,
- onWorkScheduled: onWorkScheduled,
- onWorkStarted: onWorkStarted,
- onWorkStopped: onWorkStopped
- };
- }
- }
- }
- function unstable_unsubscribe(subscriber) {
- if (enableSchedulerTracing) {
- subscribers.delete(subscriber);
-
- if (subscribers.size === 0) {
- exports.__subscriberRef.current = null;
- }
- }
- }
-
- function onInteractionTraced(interaction) {
- var didCatchError = false;
- var caughtError = null;
- subscribers.forEach(function (subscriber) {
- try {
- subscriber.onInteractionTraced(interaction);
- } catch (error) {
- if (!didCatchError) {
- didCatchError = true;
- caughtError = error;
- }
- }
- });
-
- if (didCatchError) {
- throw caughtError;
- }
- }
-
- function onInteractionScheduledWorkCompleted(interaction) {
- var didCatchError = false;
- var caughtError = null;
- subscribers.forEach(function (subscriber) {
- try {
- subscriber.onInteractionScheduledWorkCompleted(interaction);
- } catch (error) {
- if (!didCatchError) {
- didCatchError = true;
- caughtError = error;
- }
- }
- });
-
- if (didCatchError) {
- throw caughtError;
- }
- }
-
- function onWorkScheduled(interactions, threadID) {
- var didCatchError = false;
- var caughtError = null;
- subscribers.forEach(function (subscriber) {
- try {
- subscriber.onWorkScheduled(interactions, threadID);
- } catch (error) {
- if (!didCatchError) {
- didCatchError = true;
- caughtError = error;
- }
- }
- });
-
- if (didCatchError) {
- throw caughtError;
- }
- }
-
- function onWorkStarted(interactions, threadID) {
- var didCatchError = false;
- var caughtError = null;
- subscribers.forEach(function (subscriber) {
- try {
- subscriber.onWorkStarted(interactions, threadID);
- } catch (error) {
- if (!didCatchError) {
- didCatchError = true;
- caughtError = error;
- }
- }
- });
-
- if (didCatchError) {
- throw caughtError;
- }
- }
-
- function onWorkStopped(interactions, threadID) {
- var didCatchError = false;
- var caughtError = null;
- subscribers.forEach(function (subscriber) {
- try {
- subscriber.onWorkStopped(interactions, threadID);
- } catch (error) {
- if (!didCatchError) {
- didCatchError = true;
- caughtError = error;
- }
- }
- });
-
- if (didCatchError) {
- throw caughtError;
- }
- }
-
- function onWorkCanceled(interactions, threadID) {
- var didCatchError = false;
- var caughtError = null;
- subscribers.forEach(function (subscriber) {
- try {
- subscriber.onWorkCanceled(interactions, threadID);
- } catch (error) {
- if (!didCatchError) {
- didCatchError = true;
- caughtError = error;
- }
- }
- });
-
- if (didCatchError) {
- throw caughtError;
- }
- }
-
- exports.unstable_clear = unstable_clear;
- exports.unstable_getCurrent = unstable_getCurrent;
- exports.unstable_getThreadID = unstable_getThreadID;
- exports.unstable_trace = unstable_trace;
- exports.unstable_wrap = unstable_wrap;
- exports.unstable_subscribe = unstable_subscribe;
- exports.unstable_unsubscribe = unstable_unsubscribe;
- })();
- }
-
-
- /***/ }),
-
- /***/ "./node_modules/scheduler/cjs/scheduler.development.js":
- /*!*************************************************************!*\
- !*** ./node_modules/scheduler/cjs/scheduler.development.js ***!
- \*************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
- /** @license React v0.18.0
- * scheduler.development.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-
-
-
-
- if (true) {
- (function() {
- 'use strict';
-
- Object.defineProperty(exports, '__esModule', { value: true });
-
- var enableSchedulerDebugging = false;
- var enableIsInputPending = false;
- var enableProfiling = true;
-
- var requestHostCallback;
-
- var requestHostTimeout;
- var cancelHostTimeout;
- var shouldYieldToHost;
- var requestPaint;
-
-
-
- if ( // If Scheduler runs in a non-DOM environment, it falls back to a naive
- // implementation using setTimeout.
- typeof window === 'undefined' || // Check if MessageChannel is supported, too.
- typeof MessageChannel !== 'function') {
- // If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore,
- // fallback to a naive implementation.
- var _callback = null;
- var _timeoutID = null;
-
- var _flushCallback = function () {
- if (_callback !== null) {
- try {
- var currentTime = exports.unstable_now();
- var hasRemainingTime = true;
-
- _callback(hasRemainingTime, currentTime);
-
- _callback = null;
- } catch (e) {
- setTimeout(_flushCallback, 0);
- throw e;
- }
- }
- };
-
- var initialTime = Date.now();
-
- exports.unstable_now = function () {
- return Date.now() - initialTime;
- };
-
- requestHostCallback = function (cb) {
- if (_callback !== null) {
- // Protect against re-entrancy.
- setTimeout(requestHostCallback, 0, cb);
- } else {
- _callback = cb;
- setTimeout(_flushCallback, 0);
- }
- };
-
- requestHostTimeout = function (cb, ms) {
- _timeoutID = setTimeout(cb, ms);
- };
-
- cancelHostTimeout = function () {
- clearTimeout(_timeoutID);
- };
-
- shouldYieldToHost = function () {
- return false;
- };
-
- requestPaint = exports.unstable_forceFrameRate = function () {};
- } else {
- // Capture local references to native APIs, in case a polyfill overrides them.
- var performance = window.performance;
- var _Date = window.Date;
- var _setTimeout = window.setTimeout;
- var _clearTimeout = window.clearTimeout;
-
- if (typeof console !== 'undefined') {
- // TODO: Scheduler no longer requires these methods to be polyfilled. But
- // maybe we want to continue warning if they don't exist, to preserve the
- // option to rely on it in the future?
- var requestAnimationFrame = window.requestAnimationFrame;
- var cancelAnimationFrame = window.cancelAnimationFrame; // TODO: Remove fb.me link
-
- if (typeof requestAnimationFrame !== 'function') {
- console.error("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
- }
-
- if (typeof cancelAnimationFrame !== 'function') {
- console.error("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
- }
- }
-
- if (typeof performance === 'object' && typeof performance.now === 'function') {
- exports.unstable_now = function () {
- return performance.now();
- };
- } else {
- var _initialTime = _Date.now();
-
- exports.unstable_now = function () {
- return _Date.now() - _initialTime;
- };
- }
-
- var isMessageLoopRunning = false;
- var scheduledHostCallback = null;
- var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main
- // thread, like user events. By default, it yields multiple times per frame.
- // It does not attempt to align with frame boundaries, since most tasks don't
- // need to be frame aligned; for those that do, use requestAnimationFrame.
-
- var yieldInterval = 5;
- var deadline = 0; // TODO: Make this configurable
- // TODO: Adjust this based on priority?
-
- var maxYieldInterval = 300;
- var needsPaint = false;
-
- if (enableIsInputPending && navigator !== undefined && navigator.scheduling !== undefined && navigator.scheduling.isInputPending !== undefined) {
- var scheduling = navigator.scheduling;
-
- shouldYieldToHost = function () {
- var currentTime = exports.unstable_now();
-
- if (currentTime >= deadline) {
- // There's no time left. We may want to yield control of the main
- // thread, so the browser can perform high priority tasks. The main ones
- // are painting and user input. If there's a pending paint or a pending
- // input, then we should yield. But if there's neither, then we can
- // yield less often while remaining responsive. We'll eventually yield
- // regardless, since there could be a pending paint that wasn't
- // accompanied by a call to `requestPaint`, or other main thread tasks
- // like network events.
- if (needsPaint || scheduling.isInputPending()) {
- // There is either a pending paint or a pending input.
- return true;
- } // There's no pending input. Only yield if we've reached the max
- // yield interval.
-
-
- return currentTime >= maxYieldInterval;
- } else {
- // There's still time left in the frame.
- return false;
- }
- };
-
- requestPaint = function () {
- needsPaint = true;
- };
- } else {
- // `isInputPending` is not available. Since we have no way of knowing if
- // there's pending input, always yield at the end of the frame.
- shouldYieldToHost = function () {
- return exports.unstable_now() >= deadline;
- }; // Since we yield every frame regardless, `requestPaint` has no effect.
-
-
- requestPaint = function () {};
- }
-
- exports.unstable_forceFrameRate = function (fps) {
- if (fps < 0 || fps > 125) {
- console.error('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing framerates higher than 125 fps is not unsupported');
- return;
- }
-
- if (fps > 0) {
- yieldInterval = Math.floor(1000 / fps);
- } else {
- // reset the framerate
- yieldInterval = 5;
- }
- };
-
- var performWorkUntilDeadline = function () {
- if (scheduledHostCallback !== null) {
- var currentTime = exports.unstable_now(); // Yield after `yieldInterval` ms, regardless of where we are in the vsync
- // cycle. This means there's always time remaining at the beginning of
- // the message event.
-
- deadline = currentTime + yieldInterval;
- var hasTimeRemaining = true;
-
- try {
- var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
-
- if (!hasMoreWork) {
- isMessageLoopRunning = false;
- scheduledHostCallback = null;
- } else {
- // If there's more work, schedule the next message event at the end
- // of the preceding one.
- port.postMessage(null);
- }
- } catch (error) {
- // If a scheduler task throws, exit the current browser task so the
- // error can be observed.
- port.postMessage(null);
- throw error;
- }
- } else {
- isMessageLoopRunning = false;
- } // Yielding to the browser will give it a chance to paint, so we can
- // reset this.
-
-
- needsPaint = false;
- };
-
- var channel = new MessageChannel();
- var port = channel.port2;
- channel.port1.onmessage = performWorkUntilDeadline;
-
- requestHostCallback = function (callback) {
- scheduledHostCallback = callback;
-
- if (!isMessageLoopRunning) {
- isMessageLoopRunning = true;
- port.postMessage(null);
- }
- };
-
- requestHostTimeout = function (callback, ms) {
- taskTimeoutID = _setTimeout(function () {
- callback(exports.unstable_now());
- }, ms);
- };
-
- cancelHostTimeout = function () {
- _clearTimeout(taskTimeoutID);
-
- taskTimeoutID = -1;
- };
- }
-
- function push(heap, node) {
- var index = heap.length;
- heap.push(node);
- siftUp(heap, node, index);
- }
- function peek(heap) {
- var first = heap[0];
- return first === undefined ? null : first;
- }
- function pop(heap) {
- var first = heap[0];
-
- if (first !== undefined) {
- var last = heap.pop();
-
- if (last !== first) {
- heap[0] = last;
- siftDown(heap, last, 0);
- }
-
- return first;
- } else {
- return null;
- }
- }
-
- function siftUp(heap, node, i) {
- var index = i;
-
- while (true) {
- var parentIndex = Math.floor((index - 1) / 2);
- var parent = heap[parentIndex];
-
- if (parent !== undefined && compare(parent, node) > 0) {
- // The parent is larger. Swap positions.
- heap[parentIndex] = node;
- heap[index] = parent;
- index = parentIndex;
- } else {
- // The parent is smaller. Exit.
- return;
- }
- }
- }
-
- function siftDown(heap, node, i) {
- var index = i;
- var length = heap.length;
-
- while (index < length) {
- var leftIndex = (index + 1) * 2 - 1;
- var left = heap[leftIndex];
- var rightIndex = leftIndex + 1;
- var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.
-
- if (left !== undefined && compare(left, node) < 0) {
- if (right !== undefined && compare(right, left) < 0) {
- heap[index] = right;
- heap[rightIndex] = node;
- index = rightIndex;
- } else {
- heap[index] = left;
- heap[leftIndex] = node;
- index = leftIndex;
- }
- } else if (right !== undefined && compare(right, node) < 0) {
- heap[index] = right;
- heap[rightIndex] = node;
- index = rightIndex;
- } else {
- // Neither child is smaller. Exit.
- return;
- }
- }
- }
-
- function compare(a, b) {
- // Compare sort index first, then task id.
- var diff = a.sortIndex - b.sortIndex;
- return diff !== 0 ? diff : a.id - b.id;
- }
-
- // TODO: Use symbols?
- var NoPriority = 0;
- var ImmediatePriority = 1;
- var UserBlockingPriority = 2;
- var NormalPriority = 3;
- var LowPriority = 4;
- var IdlePriority = 5;
-
- var runIdCounter = 0;
- var mainThreadIdCounter = 0;
- var profilingStateSize = 4;
- var sharedProfilingBuffer = enableProfiling ? // $FlowFixMe Flow doesn't know about SharedArrayBuffer
- typeof SharedArrayBuffer === 'function' ? new SharedArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : // $FlowFixMe Flow doesn't know about ArrayBuffer
- typeof ArrayBuffer === 'function' ? new ArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : null // Don't crash the init path on IE9
- : null;
- var profilingState = enableProfiling && sharedProfilingBuffer !== null ? new Int32Array(sharedProfilingBuffer) : []; // We can't read this but it helps save bytes for null checks
-
- var PRIORITY = 0;
- var CURRENT_TASK_ID = 1;
- var CURRENT_RUN_ID = 2;
- var QUEUE_SIZE = 3;
-
- if (enableProfiling) {
- profilingState[PRIORITY] = NoPriority; // This is maintained with a counter, because the size of the priority queue
- // array might include canceled tasks.
-
- profilingState[QUEUE_SIZE] = 0;
- profilingState[CURRENT_TASK_ID] = 0;
- } // Bytes per element is 4
-
-
- var INITIAL_EVENT_LOG_SIZE = 131072;
- var MAX_EVENT_LOG_SIZE = 524288; // Equivalent to 2 megabytes
-
- var eventLogSize = 0;
- var eventLogBuffer = null;
- var eventLog = null;
- var eventLogIndex = 0;
- var TaskStartEvent = 1;
- var TaskCompleteEvent = 2;
- var TaskErrorEvent = 3;
- var TaskCancelEvent = 4;
- var TaskRunEvent = 5;
- var TaskYieldEvent = 6;
- var SchedulerSuspendEvent = 7;
- var SchedulerResumeEvent = 8;
-
- function logEvent(entries) {
- if (eventLog !== null) {
- var offset = eventLogIndex;
- eventLogIndex += entries.length;
-
- if (eventLogIndex + 1 > eventLogSize) {
- eventLogSize *= 2;
-
- if (eventLogSize > MAX_EVENT_LOG_SIZE) {
- console.error("Scheduler Profiling: Event log exceeded maximum size. Don't " + 'forget to call `stopLoggingProfilingEvents()`.');
- stopLoggingProfilingEvents();
- return;
- }
-
- var newEventLog = new Int32Array(eventLogSize * 4);
- newEventLog.set(eventLog);
- eventLogBuffer = newEventLog.buffer;
- eventLog = newEventLog;
- }
-
- eventLog.set(entries, offset);
- }
- }
-
- function startLoggingProfilingEvents() {
- eventLogSize = INITIAL_EVENT_LOG_SIZE;
- eventLogBuffer = new ArrayBuffer(eventLogSize * 4);
- eventLog = new Int32Array(eventLogBuffer);
- eventLogIndex = 0;
- }
- function stopLoggingProfilingEvents() {
- var buffer = eventLogBuffer;
- eventLogSize = 0;
- eventLogBuffer = null;
- eventLog = null;
- eventLogIndex = 0;
- return buffer;
- }
- function markTaskStart(task, ms) {
- if (enableProfiling) {
- profilingState[QUEUE_SIZE]++;
-
- if (eventLog !== null) {
- // performance.now returns a float, representing milliseconds. When the
- // event is logged, it's coerced to an int. Convert to microseconds to
- // maintain extra degrees of precision.
- logEvent([TaskStartEvent, ms * 1000, task.id, task.priorityLevel]);
- }
- }
- }
- function markTaskCompleted(task, ms) {
- if (enableProfiling) {
- profilingState[PRIORITY] = NoPriority;
- profilingState[CURRENT_TASK_ID] = 0;
- profilingState[QUEUE_SIZE]--;
-
- if (eventLog !== null) {
- logEvent([TaskCompleteEvent, ms * 1000, task.id]);
- }
- }
- }
- function markTaskCanceled(task, ms) {
- if (enableProfiling) {
- profilingState[QUEUE_SIZE]--;
-
- if (eventLog !== null) {
- logEvent([TaskCancelEvent, ms * 1000, task.id]);
- }
- }
- }
- function markTaskErrored(task, ms) {
- if (enableProfiling) {
- profilingState[PRIORITY] = NoPriority;
- profilingState[CURRENT_TASK_ID] = 0;
- profilingState[QUEUE_SIZE]--;
-
- if (eventLog !== null) {
- logEvent([TaskErrorEvent, ms * 1000, task.id]);
- }
- }
- }
- function markTaskRun(task, ms) {
- if (enableProfiling) {
- runIdCounter++;
- profilingState[PRIORITY] = task.priorityLevel;
- profilingState[CURRENT_TASK_ID] = task.id;
- profilingState[CURRENT_RUN_ID] = runIdCounter;
-
- if (eventLog !== null) {
- logEvent([TaskRunEvent, ms * 1000, task.id, runIdCounter]);
- }
- }
- }
- function markTaskYield(task, ms) {
- if (enableProfiling) {
- profilingState[PRIORITY] = NoPriority;
- profilingState[CURRENT_TASK_ID] = 0;
- profilingState[CURRENT_RUN_ID] = 0;
-
- if (eventLog !== null) {
- logEvent([TaskYieldEvent, ms * 1000, task.id, runIdCounter]);
- }
- }
- }
- function markSchedulerSuspended(ms) {
- if (enableProfiling) {
- mainThreadIdCounter++;
-
- if (eventLog !== null) {
- logEvent([SchedulerSuspendEvent, ms * 1000, mainThreadIdCounter]);
- }
- }
- }
- function markSchedulerUnsuspended(ms) {
- if (enableProfiling) {
- if (eventLog !== null) {
- logEvent([SchedulerResumeEvent, ms * 1000, mainThreadIdCounter]);
- }
- }
- }
-
- /* eslint-disable no-var */
- // Math.pow(2, 30) - 1
- // 0b111111111111111111111111111111
-
- var maxSigned31BitInt = 1073741823; // Times out immediately
-
- var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out
-
- var USER_BLOCKING_PRIORITY = 250;
- var NORMAL_PRIORITY_TIMEOUT = 5000;
- var LOW_PRIORITY_TIMEOUT = 10000; // Never times out
-
- var IDLE_PRIORITY = maxSigned31BitInt; // Tasks are stored on a min heap
-
- var taskQueue = [];
- var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.
-
- var taskIdCounter = 1; // Pausing the scheduler is useful for debugging.
-
- var isSchedulerPaused = false;
- var currentTask = null;
- var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrancy.
-
- var isPerformingWork = false;
- var isHostCallbackScheduled = false;
- var isHostTimeoutScheduled = false;
-
- function advanceTimers(currentTime) {
- // Check for tasks that are no longer delayed and add them to the queue.
- var timer = peek(timerQueue);
-
- while (timer !== null) {
- if (timer.callback === null) {
- // Timer was cancelled.
- pop(timerQueue);
- } else if (timer.startTime <= currentTime) {
- // Timer fired. Transfer to the task queue.
- pop(timerQueue);
- timer.sortIndex = timer.expirationTime;
- push(taskQueue, timer);
-
- if (enableProfiling) {
- markTaskStart(timer, currentTime);
- timer.isQueued = true;
- }
- } else {
- // Remaining timers are pending.
- return;
- }
-
- timer = peek(timerQueue);
- }
- }
-
- function handleTimeout(currentTime) {
- isHostTimeoutScheduled = false;
- advanceTimers(currentTime);
-
- if (!isHostCallbackScheduled) {
- if (peek(taskQueue) !== null) {
- isHostCallbackScheduled = true;
- requestHostCallback(flushWork);
- } else {
- var firstTimer = peek(timerQueue);
-
- if (firstTimer !== null) {
- requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
- }
- }
- }
- }
-
- function flushWork(hasTimeRemaining, initialTime) {
- if (enableProfiling) {
- markSchedulerUnsuspended(initialTime);
- } // We'll need a host callback the next time work is scheduled.
-
-
- isHostCallbackScheduled = false;
-
- if (isHostTimeoutScheduled) {
- // We scheduled a timeout but it's no longer needed. Cancel it.
- isHostTimeoutScheduled = false;
- cancelHostTimeout();
- }
-
- isPerformingWork = true;
- var previousPriorityLevel = currentPriorityLevel;
-
- try {
- if (enableProfiling) {
- try {
- return workLoop(hasTimeRemaining, initialTime);
- } catch (error) {
- if (currentTask !== null) {
- var currentTime = exports.unstable_now();
- markTaskErrored(currentTask, currentTime);
- currentTask.isQueued = false;
- }
-
- throw error;
- }
- } else {
- // No catch in prod codepath.
- return workLoop(hasTimeRemaining, initialTime);
- }
- } finally {
- currentTask = null;
- currentPriorityLevel = previousPriorityLevel;
- isPerformingWork = false;
-
- if (enableProfiling) {
- var _currentTime = exports.unstable_now();
-
- markSchedulerSuspended(_currentTime);
- }
- }
- }
-
- function workLoop(hasTimeRemaining, initialTime) {
- var currentTime = initialTime;
- advanceTimers(currentTime);
- currentTask = peek(taskQueue);
-
- while (currentTask !== null && !(enableSchedulerDebugging && isSchedulerPaused)) {
- if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
- // This currentTask hasn't expired, and we've reached the deadline.
- break;
- }
-
- var callback = currentTask.callback;
-
- if (callback !== null) {
- currentTask.callback = null;
- currentPriorityLevel = currentTask.priorityLevel;
- var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
- markTaskRun(currentTask, currentTime);
- var continuationCallback = callback(didUserCallbackTimeout);
- currentTime = exports.unstable_now();
-
- if (typeof continuationCallback === 'function') {
- currentTask.callback = continuationCallback;
- markTaskYield(currentTask, currentTime);
- } else {
- if (enableProfiling) {
- markTaskCompleted(currentTask, currentTime);
- currentTask.isQueued = false;
- }
-
- if (currentTask === peek(taskQueue)) {
- pop(taskQueue);
- }
- }
-
- advanceTimers(currentTime);
- } else {
- pop(taskQueue);
- }
-
- currentTask = peek(taskQueue);
- } // Return whether there's additional work
-
-
- if (currentTask !== null) {
- return true;
- } else {
- var firstTimer = peek(timerQueue);
-
- if (firstTimer !== null) {
- requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
- }
-
- return false;
- }
- }
-
- function unstable_runWithPriority(priorityLevel, eventHandler) {
- switch (priorityLevel) {
- case ImmediatePriority:
- case UserBlockingPriority:
- case NormalPriority:
- case LowPriority:
- case IdlePriority:
- break;
-
- default:
- priorityLevel = NormalPriority;
- }
-
- var previousPriorityLevel = currentPriorityLevel;
- currentPriorityLevel = priorityLevel;
-
- try {
- return eventHandler();
- } finally {
- currentPriorityLevel = previousPriorityLevel;
- }
- }
-
- function unstable_next(eventHandler) {
- var priorityLevel;
-
- switch (currentPriorityLevel) {
- case ImmediatePriority:
- case UserBlockingPriority:
- case NormalPriority:
- // Shift down to normal priority
- priorityLevel = NormalPriority;
- break;
-
- default:
- // Anything lower than normal priority should remain at the current level.
- priorityLevel = currentPriorityLevel;
- break;
- }
-
- var previousPriorityLevel = currentPriorityLevel;
- currentPriorityLevel = priorityLevel;
-
- try {
- return eventHandler();
- } finally {
- currentPriorityLevel = previousPriorityLevel;
- }
- }
-
- function unstable_wrapCallback(callback) {
- var parentPriorityLevel = currentPriorityLevel;
- return function () {
- // This is a fork of runWithPriority, inlined for performance.
- var previousPriorityLevel = currentPriorityLevel;
- currentPriorityLevel = parentPriorityLevel;
-
- try {
- return callback.apply(this, arguments);
- } finally {
- currentPriorityLevel = previousPriorityLevel;
- }
- };
- }
-
- function timeoutForPriorityLevel(priorityLevel) {
- switch (priorityLevel) {
- case ImmediatePriority:
- return IMMEDIATE_PRIORITY_TIMEOUT;
-
- case UserBlockingPriority:
- return USER_BLOCKING_PRIORITY;
-
- case IdlePriority:
- return IDLE_PRIORITY;
-
- case LowPriority:
- return LOW_PRIORITY_TIMEOUT;
-
- case NormalPriority:
- default:
- return NORMAL_PRIORITY_TIMEOUT;
- }
- }
-
- function unstable_scheduleCallback(priorityLevel, callback, options) {
- var currentTime = exports.unstable_now();
- var startTime;
- var timeout;
-
- if (typeof options === 'object' && options !== null) {
- var delay = options.delay;
-
- if (typeof delay === 'number' && delay > 0) {
- startTime = currentTime + delay;
- } else {
- startTime = currentTime;
- }
-
- timeout = typeof options.timeout === 'number' ? options.timeout : timeoutForPriorityLevel(priorityLevel);
- } else {
- timeout = timeoutForPriorityLevel(priorityLevel);
- startTime = currentTime;
- }
-
- var expirationTime = startTime + timeout;
- var newTask = {
- id: taskIdCounter++,
- callback: callback,
- priorityLevel: priorityLevel,
- startTime: startTime,
- expirationTime: expirationTime,
- sortIndex: -1
- };
-
- if (enableProfiling) {
- newTask.isQueued = false;
- }
-
- if (startTime > currentTime) {
- // This is a delayed task.
- newTask.sortIndex = startTime;
- push(timerQueue, newTask);
-
- if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
- // All tasks are delayed, and this is the task with the earliest delay.
- if (isHostTimeoutScheduled) {
- // Cancel an existing timeout.
- cancelHostTimeout();
- } else {
- isHostTimeoutScheduled = true;
- } // Schedule a timeout.
-
-
- requestHostTimeout(handleTimeout, startTime - currentTime);
- }
- } else {
- newTask.sortIndex = expirationTime;
- push(taskQueue, newTask);
-
- if (enableProfiling) {
- markTaskStart(newTask, currentTime);
- newTask.isQueued = true;
- } // Schedule a host callback, if needed. If we're already performing work,
- // wait until the next time we yield.
-
-
- if (!isHostCallbackScheduled && !isPerformingWork) {
- isHostCallbackScheduled = true;
- requestHostCallback(flushWork);
- }
- }
-
- return newTask;
- }
-
- function unstable_pauseExecution() {
- isSchedulerPaused = true;
- }
-
- function unstable_continueExecution() {
- isSchedulerPaused = false;
-
- if (!isHostCallbackScheduled && !isPerformingWork) {
- isHostCallbackScheduled = true;
- requestHostCallback(flushWork);
- }
- }
-
- function unstable_getFirstCallbackNode() {
- return peek(taskQueue);
- }
-
- function unstable_cancelCallback(task) {
- if (enableProfiling) {
- if (task.isQueued) {
- var currentTime = exports.unstable_now();
- markTaskCanceled(task, currentTime);
- task.isQueued = false;
- }
- } // Null out the callback to indicate the task has been canceled. (Can't
- // remove from the queue because you can't remove arbitrary nodes from an
- // array based heap, only the first one.)
-
-
- task.callback = null;
- }
-
- function unstable_getCurrentPriorityLevel() {
- return currentPriorityLevel;
- }
-
- function unstable_shouldYield() {
- var currentTime = exports.unstable_now();
- advanceTimers(currentTime);
- var firstTask = peek(taskQueue);
- return firstTask !== currentTask && currentTask !== null && firstTask !== null && firstTask.callback !== null && firstTask.startTime <= currentTime && firstTask.expirationTime < currentTask.expirationTime || shouldYieldToHost();
- }
-
- var unstable_requestPaint = requestPaint;
- var unstable_Profiling = enableProfiling ? {
- startLoggingProfilingEvents: startLoggingProfilingEvents,
- stopLoggingProfilingEvents: stopLoggingProfilingEvents,
- sharedProfilingBuffer: sharedProfilingBuffer
- } : null;
-
- exports.unstable_ImmediatePriority = ImmediatePriority;
- exports.unstable_UserBlockingPriority = UserBlockingPriority;
- exports.unstable_NormalPriority = NormalPriority;
- exports.unstable_IdlePriority = IdlePriority;
- exports.unstable_LowPriority = LowPriority;
- exports.unstable_runWithPriority = unstable_runWithPriority;
- exports.unstable_next = unstable_next;
- exports.unstable_scheduleCallback = unstable_scheduleCallback;
- exports.unstable_cancelCallback = unstable_cancelCallback;
- exports.unstable_wrapCallback = unstable_wrapCallback;
- exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
- exports.unstable_shouldYield = unstable_shouldYield;
- exports.unstable_requestPaint = unstable_requestPaint;
- exports.unstable_continueExecution = unstable_continueExecution;
- exports.unstable_pauseExecution = unstable_pauseExecution;
- exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
- exports.unstable_Profiling = unstable_Profiling;
- })();
- }
-
-
- /***/ }),
-
- /***/ "./node_modules/scheduler/index.js":
- /*!*****************************************!*\
- !*** ./node_modules/scheduler/index.js ***!
- \*****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- if (false) {} else {
- module.exports = __webpack_require__(/*! ./cjs/scheduler.development.js */ "./node_modules/scheduler/cjs/scheduler.development.js");
- }
-
-
- /***/ }),
-
- /***/ "./node_modules/scheduler/tracing.js":
- /*!*******************************************!*\
- !*** ./node_modules/scheduler/tracing.js ***!
- \*******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
-
-
- if (false) {} else {
- module.exports = __webpack_require__(/*! ./cjs/scheduler-tracing.development.js */ "./node_modules/scheduler/cjs/scheduler-tracing.development.js");
- }
-
-
- /***/ }),
-
- /***/ "./node_modules/uncontrollable/esm/hook.js":
- /*!*************************************************!*\
- !*** ./node_modules/uncontrollable/esm/hook.js ***!
- \*************************************************/
- /*! exports provided: useUncontrolledProp, default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "useUncontrolledProp", function() { return useUncontrolledProp; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return useUncontrolled; });
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./node_modules/uncontrollable/esm/utils.js");
-
-
-
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
-
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
-
-
-
-
- function useUncontrolledProp(propValue, defaultValue, handler) {
- var wasPropRef = Object(react__WEBPACK_IMPORTED_MODULE_2__["useRef"])(propValue !== undefined);
-
- var _useState = Object(react__WEBPACK_IMPORTED_MODULE_2__["useState"])(defaultValue),
- stateValue = _useState[0],
- setState = _useState[1];
-
- var isProp = propValue !== undefined;
- var wasProp = wasPropRef.current;
- wasPropRef.current = isProp;
- /**
- * If a prop switches from controlled to Uncontrolled
- * reset its value to the defaultValue
- */
-
- if (!isProp && wasProp && stateValue !== defaultValue) {
- setState(defaultValue);
- }
-
- return [isProp ? propValue : stateValue, Object(react__WEBPACK_IMPORTED_MODULE_2__["useCallback"])(function (value) {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- if (handler) handler.apply(void 0, [value].concat(args));
- setState(value);
- }, [handler])];
- }
-
-
- function useUncontrolled(props, config) {
- return Object.keys(config).reduce(function (result, fieldName) {
- var _extends2;
-
- var _ref = result,
- defaultValue = _ref[_utils__WEBPACK_IMPORTED_MODULE_3__["defaultKey"](fieldName)],
- propsValue = _ref[fieldName],
- rest = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(_ref, [_utils__WEBPACK_IMPORTED_MODULE_3__["defaultKey"](fieldName), fieldName].map(_toPropertyKey));
-
- var handlerName = config[fieldName];
-
- var _useUncontrolledProp = useUncontrolledProp(propsValue, defaultValue, props[handlerName]),
- value = _useUncontrolledProp[0],
- handler = _useUncontrolledProp[1];
-
- return Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, rest, (_extends2 = {}, _extends2[fieldName] = value, _extends2[handlerName] = handler, _extends2));
- }, props);
- }
-
- /***/ }),
-
- /***/ "./node_modules/uncontrollable/esm/index.js":
- /*!**************************************************!*\
- !*** ./node_modules/uncontrollable/esm/index.js ***!
- \**************************************************/
- /*! exports provided: useUncontrolled, useUncontrolledProp, uncontrollable */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony import */ var _hook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hook */ "./node_modules/uncontrollable/esm/hook.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useUncontrolled", function() { return _hook__WEBPACK_IMPORTED_MODULE_0__["default"]; });
-
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useUncontrolledProp", function() { return _hook__WEBPACK_IMPORTED_MODULE_0__["useUncontrolledProp"]; });
-
- /* harmony import */ var _uncontrollable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uncontrollable */ "./node_modules/uncontrollable/esm/uncontrollable.js");
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "uncontrollable", function() { return _uncontrollable__WEBPACK_IMPORTED_MODULE_1__["default"]; });
-
-
-
-
- /***/ }),
-
- /***/ "./node_modules/uncontrollable/esm/uncontrollable.js":
- /*!***********************************************************!*\
- !*** ./node_modules/uncontrollable/esm/uncontrollable.js ***!
- \***********************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return uncontrollable; });
- /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
- /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js");
- /* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var react_lifecycles_compat__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-lifecycles-compat */ "./node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js");
- /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! invariant */ "./node_modules/invariant/browser.js");
- /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils */ "./node_modules/uncontrollable/esm/utils.js");
-
-
-
-
-
-
-
- function uncontrollable(Component, controlledValues, methods) {
- if (methods === void 0) {
- methods = [];
- }
-
- var displayName = Component.displayName || Component.name || 'Component';
- var canAcceptRef = _utils__WEBPACK_IMPORTED_MODULE_6__["canAcceptRef"](Component);
- var controlledProps = Object.keys(controlledValues);
- var PROPS_TO_OMIT = controlledProps.map(_utils__WEBPACK_IMPORTED_MODULE_6__["defaultKey"]);
- !(canAcceptRef || !methods.length) ? true ? invariant__WEBPACK_IMPORTED_MODULE_5___default()(false, '[uncontrollable] stateless function components cannot pass through methods ' + 'because they have no associated instances. Check component: ' + displayName + ', ' + 'attempting to pass through methods: ' + methods.join(', ')) : undefined : void 0;
-
- var UncontrolledComponent =
- /*#__PURE__*/
- function (_React$Component) {
- Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_2__["default"])(UncontrolledComponent, _React$Component);
-
- function UncontrolledComponent() {
- var _this;
-
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
- args[_key] = arguments[_key];
- }
-
- _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
- _this.handlers = Object.create(null);
- controlledProps.forEach(function (propName) {
- var handlerName = controlledValues[propName];
-
- var handleChange = function handleChange(value) {
- if (_this.props[handlerName]) {
- var _this$props;
-
- _this._notifying = true;
-
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
- args[_key2 - 1] = arguments[_key2];
- }
-
- (_this$props = _this.props)[handlerName].apply(_this$props, [value].concat(args));
-
- _this._notifying = false;
- }
-
- if (!_this.unmounted) _this.setState(function (_ref) {
- var _extends2;
-
- var values = _ref.values;
- return {
- values: Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])(Object.create(null), values, (_extends2 = {}, _extends2[propName] = value, _extends2))
- };
- });
- };
-
- _this.handlers[handlerName] = handleChange;
- });
- if (methods.length) _this.attachRef = function (ref) {
- _this.inner = ref;
- };
- var values = Object.create(null);
- controlledProps.forEach(function (key) {
- values[key] = _this.props[_utils__WEBPACK_IMPORTED_MODULE_6__["defaultKey"](key)];
- });
- _this.state = {
- values: values,
- prevProps: {}
- };
- return _this;
- }
-
- var _proto = UncontrolledComponent.prototype;
-
- _proto.shouldComponentUpdate = function shouldComponentUpdate() {
- //let setState trigger the update
- return !this._notifying;
- };
-
- UncontrolledComponent.getDerivedStateFromProps = function getDerivedStateFromProps(props, _ref2) {
- var values = _ref2.values,
- prevProps = _ref2.prevProps;
- var nextState = {
- values: Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])(Object.create(null), values),
- prevProps: {}
- };
- controlledProps.forEach(function (key) {
- /**
- * If a prop switches from controlled to Uncontrolled
- * reset its value to the defaultValue
- */
- nextState.prevProps[key] = props[key];
-
- if (!_utils__WEBPACK_IMPORTED_MODULE_6__["isProp"](props, key) && _utils__WEBPACK_IMPORTED_MODULE_6__["isProp"](prevProps, key)) {
- nextState.values[key] = props[_utils__WEBPACK_IMPORTED_MODULE_6__["defaultKey"](key)];
- }
- });
- return nextState;
- };
-
- _proto.componentWillUnmount = function componentWillUnmount() {
- this.unmounted = true;
- };
-
- _proto.render = function render() {
- var _this2 = this;
-
- var _this$props2 = this.props,
- innerRef = _this$props2.innerRef,
- props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(_this$props2, ["innerRef"]);
-
- PROPS_TO_OMIT.forEach(function (prop) {
- delete props[prop];
- });
- var newProps = {};
- controlledProps.forEach(function (propName) {
- var propValue = _this2.props[propName];
- newProps[propName] = propValue !== undefined ? propValue : _this2.state.values[propName];
- });
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(Component, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, props, newProps, this.handlers, {
- ref: innerRef || this.attachRef
- }));
- };
-
- return UncontrolledComponent;
- }(react__WEBPACK_IMPORTED_MODULE_3___default.a.Component);
-
- Object(react_lifecycles_compat__WEBPACK_IMPORTED_MODULE_4__["polyfill"])(UncontrolledComponent);
- UncontrolledComponent.displayName = "Uncontrolled(" + displayName + ")";
- UncontrolledComponent.propTypes = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({
- innerRef: function innerRef() {}
- }, _utils__WEBPACK_IMPORTED_MODULE_6__["uncontrolledPropTypes"](controlledValues, displayName));
- methods.forEach(function (method) {
- UncontrolledComponent.prototype[method] = function $proxiedMethod() {
- var _this$inner;
-
- return (_this$inner = this.inner)[method].apply(_this$inner, arguments);
- };
- });
- var WrappedComponent = UncontrolledComponent;
-
- if (react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef) {
- WrappedComponent = react__WEBPACK_IMPORTED_MODULE_3___default.a.forwardRef(function (props, ref) {
- return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(UncontrolledComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, props, {
- innerRef: ref
- }));
- });
- WrappedComponent.propTypes = UncontrolledComponent.propTypes;
- }
-
- WrappedComponent.ControlledComponent = Component;
- /**
- * useful when wrapping a Component and you want to control
- * everything
- */
-
- WrappedComponent.deferControlTo = function (newComponent, additions, nextMethods) {
- if (additions === void 0) {
- additions = {};
- }
-
- return uncontrollable(newComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, controlledValues, additions), nextMethods);
- };
-
- return WrappedComponent;
- }
-
- /***/ }),
-
- /***/ "./node_modules/uncontrollable/esm/utils.js":
- /*!**************************************************!*\
- !*** ./node_modules/uncontrollable/esm/utils.js ***!
- \**************************************************/
- /*! exports provided: uncontrolledPropTypes, isProp, defaultKey, canAcceptRef */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "uncontrolledPropTypes", function() { return uncontrolledPropTypes; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isProp", function() { return isProp; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultKey", function() { return defaultKey; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "canAcceptRef", function() { return canAcceptRef; });
- /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "./node_modules/invariant/browser.js");
- /* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
-
-
- var noop = function noop() {};
-
- function readOnlyPropType(handler, name) {
- return function (props, propName) {
- if (props[propName] !== undefined) {
- if (!props[handler]) {
- return new Error("You have provided a `" + propName + "` prop to `" + name + "` " + ("without an `" + handler + "` handler prop. This will render a read-only field. ") + ("If the field should be mutable use `" + defaultKey(propName) + "`. ") + ("Otherwise, set `" + handler + "`."));
- }
- }
- };
- }
-
- function uncontrolledPropTypes(controlledValues, displayName) {
- var propTypes = {};
- Object.keys(controlledValues).forEach(function (prop) {
- // add default propTypes for folks that use runtime checks
- propTypes[defaultKey(prop)] = noop;
-
- if (true) {
- var handler = controlledValues[prop];
- !(typeof handler === 'string' && handler.trim().length) ? true ? invariant__WEBPACK_IMPORTED_MODULE_0___default()(false, 'Uncontrollable - [%s]: the prop `%s` needs a valid handler key name in order to make it uncontrollable', displayName, prop) : undefined : void 0;
- propTypes[prop] = readOnlyPropType(handler, displayName);
- }
- });
- return propTypes;
- }
- function isProp(props, prop) {
- return props[prop] !== undefined;
- }
- function defaultKey(key) {
- return 'default' + key.charAt(0).toUpperCase() + key.substr(1);
- }
- /**
- * Copyright (c) 2013-present, Facebook, Inc.
- * All rights reserved.
- *
- * This source code is licensed under the BSD-style license found in the
- * LICENSE file in the root directory of this source tree. An additional grant
- * of patent rights can be found in the PATENTS file in the same directory.
- */
-
- function canAcceptRef(component) {
- return !!component && (typeof component !== 'function' || component.prototype && component.prototype.isReactComponent);
- }
-
- /***/ }),
-
- /***/ "./node_modules/warning/warning.js":
- /*!*****************************************!*\
- !*** ./node_modules/warning/warning.js ***!
- \*****************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- "use strict";
- /**
- * Copyright (c) 2014-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-
-
- /**
- * Similar to invariant but only logs a warning if the condition is not met.
- * This can be used to log issues in development environments in critical
- * paths. Removing the logging code for production environments will keep the
- * same logic and follow the same code paths.
- */
-
- var __DEV__ = "development" !== 'production';
-
- var warning = function() {};
-
- if (__DEV__) {
- var printWarning = function printWarning(format, args) {
- var len = arguments.length;
- args = new Array(len > 1 ? len - 1 : 0);
- for (var key = 1; key < len; key++) {
- args[key - 1] = arguments[key];
- }
- var argIndex = 0;
- var message = 'Warning: ' +
- format.replace(/%s/g, function() {
- return args[argIndex++];
- });
- if (typeof console !== 'undefined') {
- console.error(message);
- }
- try {
- // --- Welcome to debugging React ---
- // This error was thrown as a convenience so that you can use this stack
- // to find the callsite that caused this warning to fire.
- throw new Error(message);
- } catch (x) {}
- }
-
- warning = function(condition, format, args) {
- var len = arguments.length;
- args = new Array(len > 2 ? len - 2 : 0);
- for (var key = 2; key < len; key++) {
- args[key - 2] = arguments[key];
- }
- if (format === undefined) {
- throw new Error(
- '`warning(condition, format, ...args)` requires a warning ' +
- 'message argument'
- );
- }
- if (!condition) {
- printWarning.apply(null, [format].concat(args));
- }
- };
- }
-
- module.exports = warning;
-
-
- /***/ }),
-
- /***/ "./node_modules/webpack/buildin/global.js":
- /*!***********************************!*\
- !*** (webpack)/buildin/global.js ***!
- \***********************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- var g;
-
- // This works in non-strict mode
- g = (function() {
- return this;
- })();
-
- try {
- // This works if eval is allowed (see CSP)
- g = g || new Function("return this")();
- } catch (e) {
- // This works if the window reference is available
- if (typeof window === "object") g = window;
- }
-
- // g can still be undefined, but nothing to do about it...
- // We return undefined, instead of nothing here, so it's
- // easier to handle this case. if(!global) { ...}
-
- module.exports = g;
-
-
- /***/ }),
-
- /***/ "./node_modules/webpack/buildin/module.js":
- /*!***********************************!*\
- !*** (webpack)/buildin/module.js ***!
- \***********************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = function(module) {
- if (!module.webpackPolyfill) {
- module.deprecate = function() {};
- module.paths = [];
- // module.parent = undefined by default
- if (!module.children) module.children = [];
- Object.defineProperty(module, "loaded", {
- enumerable: true,
- get: function() {
- return module.l;
- }
- });
- Object.defineProperty(module, "id", {
- enumerable: true,
- get: function() {
- return module.i;
- }
- });
- module.webpackPolyfill = 1;
- }
- return module;
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/xlsx/dist/cpexcel.js":
- /*!*******************************************!*\
- !*** ./node_modules/xlsx/dist/cpexcel.js ***!
- \*******************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function(Buffer) {/* cpexcel.js (C) 2013-present SheetJS -- http://sheetjs.com */
- /*jshint -W100 */
- var cptable = {version:"1.14.0"};
- cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[620] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖܢ٥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[737] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[850] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´±‗¾¶§÷¸°¨·¹³²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[852] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´˝˛ˇ˘§÷¸°¨˙űŘř■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[857] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´±�¾¶§÷¸°¨·¹³²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[861] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[865] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[866] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[874] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[895] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ČüéďäĎŤčěĚĹÍľǪÄÁÉžŽôöÓůÚýÖÜŠĽÝŘťáíóúňŇŮÔšřŕŔ¼§«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[932] = (function(){ var d = [], e = {}, D = [], j;
- D[0] = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~���������������������������������。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゙゚��������������������������������".split("");
- for(j = 0; j != D[0].length; ++j) if(D[0][j].charCodeAt(0) !== 0xFFFD) { e[D[0][j]] = 0 + j; d[0 + j] = D[0][j];}
- D[129] = "���������������������������������������������������������������� 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈〉《》「」『』【】+-±×�÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓�����������∈∋⊆⊇⊂⊃∪∩��������∧∨¬⇒⇔∀∃�����������∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬�������ʼn♯♭♪†‡¶����◯���".split("");
- for(j = 0; j != D[129].length; ++j) if(D[129][j].charCodeAt(0) !== 0xFFFD) { e[D[129][j]] = 33024 + j; d[33024 + j] = D[129][j];}
- D[130] = "�������������������������������������������������������������������������������0123456789�������ABCDEFGHIJKLMNOPQRSTUVWXYZ�������abcdefghijklmnopqrstuvwxyz����ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをん��������������".split("");
- for(j = 0; j != D[130].length; ++j) if(D[130][j].charCodeAt(0) !== 0xFFFD) { e[D[130][j]] = 33280 + j; d[33280 + j] = D[130][j];}
- D[131] = "����������������������������������������������������������������ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミ�ムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶ��������ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ��������αβγδεζηθικλμνξοπρστυφχψω�����������������������������������������".split("");
- for(j = 0; j != D[131].length; ++j) if(D[131][j].charCodeAt(0) !== 0xFFFD) { e[D[131][j]] = 33536 + j; d[33536 + j] = D[131][j];}
- D[132] = "����������������������������������������������������������������АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ���������������абвгдеёжзийклмн�опрстуфхцчшщъыьэюя�������������─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂�����������������������������������������������������������������".split("");
- for(j = 0; j != D[132].length; ++j) if(D[132][j].charCodeAt(0) !== 0xFFFD) { e[D[132][j]] = 33792 + j; d[33792 + j] = D[132][j];}
- D[135] = "����������������������������������������������������������������①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮⑯⑰⑱⑲⑳ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ�㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡��������㍻�〝〟№㏍℡㊤㊥㊦㊧㊨㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪���������������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[135].length; ++j) if(D[135][j].charCodeAt(0) !== 0xFFFD) { e[D[135][j]] = 34560 + j; d[34560 + j] = D[135][j];}
- D[136] = "���������������������������������������������������������������������������������������������������������������������������������������������������������������亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭���".split("");
- for(j = 0; j != D[136].length; ++j) if(D[136][j].charCodeAt(0) !== 0xFFFD) { e[D[136][j]] = 34816 + j; d[34816 + j] = D[136][j];}
- D[137] = "����������������������������������������������������������������院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円�園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改���".split("");
- for(j = 0; j != D[137].length; ++j) if(D[137][j].charCodeAt(0) !== 0xFFFD) { e[D[137][j]] = 35072 + j; d[35072 + j] = D[137][j];}
- D[138] = "����������������������������������������������������������������魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫�橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄���".split("");
- for(j = 0; j != D[138].length; ++j) if(D[138][j].charCodeAt(0) !== 0xFFFD) { e[D[138][j]] = 35328 + j; d[35328 + j] = D[138][j];}
- D[139] = "����������������������������������������������������������������機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救�朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈���".split("");
- for(j = 0; j != D[139].length; ++j) if(D[139][j].charCodeAt(0) !== 0xFFFD) { e[D[139][j]] = 35584 + j; d[35584 + j] = D[139][j];}
- D[140] = "����������������������������������������������������������������掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨�劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向���".split("");
- for(j = 0; j != D[140].length; ++j) if(D[140][j].charCodeAt(0) !== 0xFFFD) { e[D[140][j]] = 35840 + j; d[35840 + j] = D[140][j];}
- D[141] = "����������������������������������������������������������������后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降�項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷���".split("");
- for(j = 0; j != D[141].length; ++j) if(D[141][j].charCodeAt(0) !== 0xFFFD) { e[D[141][j]] = 36096 + j; d[36096 + j] = D[141][j];}
- D[142] = "����������������������������������������������������������������察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止�死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周���".split("");
- for(j = 0; j != D[142].length; ++j) if(D[142][j].charCodeAt(0) !== 0xFFFD) { e[D[142][j]] = 36352 + j; d[36352 + j] = D[142][j];}
- D[143] = "����������������������������������������������������������������宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳�準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾���".split("");
- for(j = 0; j != D[143].length; ++j) if(D[143][j].charCodeAt(0) !== 0xFFFD) { e[D[143][j]] = 36608 + j; d[36608 + j] = D[143][j];}
- D[144] = "����������������������������������������������������������������拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨�逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線���".split("");
- for(j = 0; j != D[144].length; ++j) if(D[144][j].charCodeAt(0) !== 0xFFFD) { e[D[144][j]] = 36864 + j; d[36864 + j] = D[144][j];}
- D[145] = "����������������������������������������������������������������繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻�操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只���".split("");
- for(j = 0; j != D[145].length; ++j) if(D[145][j].charCodeAt(0) !== 0xFFFD) { e[D[145][j]] = 37120 + j; d[37120 + j] = D[145][j];}
- D[146] = "����������������������������������������������������������������叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄�逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓���".split("");
- for(j = 0; j != D[146].length; ++j) if(D[146][j].charCodeAt(0) !== 0xFFFD) { e[D[146][j]] = 37376 + j; d[37376 + j] = D[146][j];}
- D[147] = "����������������������������������������������������������������邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬�凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入���".split("");
- for(j = 0; j != D[147].length; ++j) if(D[147][j].charCodeAt(0) !== 0xFFFD) { e[D[147][j]] = 37632 + j; d[37632 + j] = D[147][j];}
- D[148] = "����������������������������������������������������������������如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅�楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美���".split("");
- for(j = 0; j != D[148].length; ++j) if(D[148][j].charCodeAt(0) !== 0xFFFD) { e[D[148][j]] = 37888 + j; d[37888 + j] = D[148][j];}
- D[149] = "����������������������������������������������������������������鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷�斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋���".split("");
- for(j = 0; j != D[149].length; ++j) if(D[149][j].charCodeAt(0) !== 0xFFFD) { e[D[149][j]] = 38144 + j; d[38144 + j] = D[149][j];}
- D[150] = "����������������������������������������������������������������法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆�摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒���".split("");
- for(j = 0; j != D[150].length; ++j) if(D[150][j].charCodeAt(0) !== 0xFFFD) { e[D[150][j]] = 38400 + j; d[38400 + j] = D[150][j];}
- D[151] = "����������������������������������������������������������������諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲�沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯���".split("");
- for(j = 0; j != D[151].length; ++j) if(D[151][j].charCodeAt(0) !== 0xFFFD) { e[D[151][j]] = 38656 + j; d[38656 + j] = D[151][j];}
- D[152] = "����������������������������������������������������������������蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕��������������������������������������������弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲���".split("");
- for(j = 0; j != D[152].length; ++j) if(D[152][j].charCodeAt(0) !== 0xFFFD) { e[D[152][j]] = 38912 + j; d[38912 + j] = D[152][j];}
- D[153] = "����������������������������������������������������������������僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭�凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨���".split("");
- for(j = 0; j != D[153].length; ++j) if(D[153][j].charCodeAt(0) !== 0xFFFD) { e[D[153][j]] = 39168 + j; d[39168 + j] = D[153][j];}
- D[154] = "����������������������������������������������������������������咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸�噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩���".split("");
- for(j = 0; j != D[154].length; ++j) if(D[154][j].charCodeAt(0) !== 0xFFFD) { e[D[154][j]] = 39424 + j; d[39424 + j] = D[154][j];}
- D[155] = "����������������������������������������������������������������奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀�它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏���".split("");
- for(j = 0; j != D[155].length; ++j) if(D[155][j].charCodeAt(0) !== 0xFFFD) { e[D[155][j]] = 39680 + j; d[39680 + j] = D[155][j];}
- D[156] = "����������������������������������������������������������������廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠�怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛���".split("");
- for(j = 0; j != D[156].length; ++j) if(D[156][j].charCodeAt(0) !== 0xFFFD) { e[D[156][j]] = 39936 + j; d[39936 + j] = D[156][j];}
- D[157] = "����������������������������������������������������������������戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫�捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼���".split("");
- for(j = 0; j != D[157].length; ++j) if(D[157][j].charCodeAt(0) !== 0xFFFD) { e[D[157][j]] = 40192 + j; d[40192 + j] = D[157][j];}
- D[158] = "����������������������������������������������������������������曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎�梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣���".split("");
- for(j = 0; j != D[158].length; ++j) if(D[158][j].charCodeAt(0) !== 0xFFFD) { e[D[158][j]] = 40448 + j; d[40448 + j] = D[158][j];}
- D[159] = "����������������������������������������������������������������檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯�麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌���".split("");
- for(j = 0; j != D[159].length; ++j) if(D[159][j].charCodeAt(0) !== 0xFFFD) { e[D[159][j]] = 40704 + j; d[40704 + j] = D[159][j];}
- D[224] = "����������������������������������������������������������������漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝�烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱���".split("");
- for(j = 0; j != D[224].length; ++j) if(D[224][j].charCodeAt(0) !== 0xFFFD) { e[D[224][j]] = 57344 + j; d[57344 + j] = D[224][j];}
- D[225] = "����������������������������������������������������������������瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿�痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬���".split("");
- for(j = 0; j != D[225].length; ++j) if(D[225][j].charCodeAt(0) !== 0xFFFD) { e[D[225][j]] = 57600 + j; d[57600 + j] = D[225][j];}
- D[226] = "����������������������������������������������������������������磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰�窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆���".split("");
- for(j = 0; j != D[226].length; ++j) if(D[226][j].charCodeAt(0) !== 0xFFFD) { e[D[226][j]] = 57856 + j; d[57856 + j] = D[226][j];}
- D[227] = "����������������������������������������������������������������紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷�縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋���".split("");
- for(j = 0; j != D[227].length; ++j) if(D[227][j].charCodeAt(0) !== 0xFFFD) { e[D[227][j]] = 58112 + j; d[58112 + j] = D[227][j];}
- D[228] = "����������������������������������������������������������������隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤�艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈���".split("");
- for(j = 0; j != D[228].length; ++j) if(D[228][j].charCodeAt(0) !== 0xFFFD) { e[D[228][j]] = 58368 + j; d[58368 + j] = D[228][j];}
- D[229] = "����������������������������������������������������������������蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬�蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞���".split("");
- for(j = 0; j != D[229].length; ++j) if(D[229][j].charCodeAt(0) !== 0xFFFD) { e[D[229][j]] = 58624 + j; d[58624 + j] = D[229][j];}
- D[230] = "����������������������������������������������������������������襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧�諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊���".split("");
- for(j = 0; j != D[230].length; ++j) if(D[230][j].charCodeAt(0) !== 0xFFFD) { e[D[230][j]] = 58880 + j; d[58880 + j] = D[230][j];}
- D[231] = "����������������������������������������������������������������蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜�轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮���".split("");
- for(j = 0; j != D[231].length; ++j) if(D[231][j].charCodeAt(0) !== 0xFFFD) { e[D[231][j]] = 59136 + j; d[59136 + j] = D[231][j];}
- D[232] = "����������������������������������������������������������������錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙�閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰���".split("");
- for(j = 0; j != D[232].length; ++j) if(D[232][j].charCodeAt(0) !== 0xFFFD) { e[D[232][j]] = 59392 + j; d[59392 + j] = D[232][j];}
- D[233] = "����������������������������������������������������������������顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃�騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈���".split("");
- for(j = 0; j != D[233].length; ++j) if(D[233][j].charCodeAt(0) !== 0xFFFD) { e[D[233][j]] = 59648 + j; d[59648 + j] = D[233][j];}
- D[234] = "����������������������������������������������������������������鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯�黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙�������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[234].length; ++j) if(D[234][j].charCodeAt(0) !== 0xFFFD) { e[D[234][j]] = 59904 + j; d[59904 + j] = D[234][j];}
- D[237] = "����������������������������������������������������������������纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏�塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱���".split("");
- for(j = 0; j != D[237].length; ++j) if(D[237][j].charCodeAt(0) !== 0xFFFD) { e[D[237][j]] = 60672 + j; d[60672 + j] = D[237][j];}
- D[238] = "����������������������������������������������������������������犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙�蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑��ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹ¬¦'"���".split("");
- for(j = 0; j != D[238].length; ++j) if(D[238][j].charCodeAt(0) !== 0xFFFD) { e[D[238][j]] = 60928 + j; d[60928 + j] = D[238][j];}
- D[250] = "����������������������������������������������������������������ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊�兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯���".split("");
- for(j = 0; j != D[250].length; ++j) if(D[250][j].charCodeAt(0) !== 0xFFFD) { e[D[250][j]] = 64000 + j; d[64000 + j] = D[250][j];}
- D[251] = "����������������������������������������������������������������涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神�祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙���".split("");
- for(j = 0; j != D[251].length; ++j) if(D[251][j].charCodeAt(0) !== 0xFFFD) { e[D[251][j]] = 64256 + j; d[64256 + j] = D[251][j];}
- D[252] = "����������������������������������������������������������������髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[252].length; ++j) if(D[252][j].charCodeAt(0) !== 0xFFFD) { e[D[252][j]] = 64512 + j; d[64512 + j] = D[252][j];}
- return {"enc": e, "dec": d }; })();
- cptable[936] = (function(){ var d = [], e = {}, D = [], j;
- D[0] = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�������������������������������������������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[0].length; ++j) if(D[0][j].charCodeAt(0) !== 0xFFFD) { e[D[0][j]] = 0 + j; d[0 + j] = D[0][j];}
- D[129] = "����������������������������������������������������������������丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪乫乬乭乮乯乲乴乵乶乷乸乹乺乻乼乽乿亀亁亂亃亄亅亇亊�亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂伃伄伅伆伇伈伋伌伒伓伔伕伖伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾伿佀佁佂佄佅佇佈佉佊佋佌佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢�".split("");
- for(j = 0; j != D[129].length; ++j) if(D[129][j].charCodeAt(0) !== 0xFFFD) { e[D[129][j]] = 33024 + j; d[33024 + j] = D[129][j];}
- D[130] = "����������������������������������������������������������������侤侫侭侰侱侲侳侴侶侷侸侹侺侻侼侽侾俀俁係俆俇俈俉俋俌俍俒俓俔俕俖俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿倀倁倂倃倄倅倆倇倈倉倊�個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯倰倱倲倳倴倵倶倷倸倹倻倽倿偀偁偂偄偅偆偉偊偋偍偐偑偒偓偔偖偗偘偙偛偝偞偟偠偡偢偣偤偦偧偨偩偪偫偭偮偯偰偱偲偳側偵偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎傏傐傑傒傓傔傕傖傗傘備傚傛傜傝傞傟傠傡傢傤傦傪傫傭傮傯傰傱傳傴債傶傷傸傹傼�".split("");
- for(j = 0; j != D[130].length; ++j) if(D[130][j].charCodeAt(0) !== 0xFFFD) { e[D[130][j]] = 33280 + j; d[33280 + j] = D[130][j];}
- D[131] = "����������������������������������������������������������������傽傾傿僀僁僂僃僄僅僆僇僈僉僊僋僌働僎僐僑僒僓僔僕僗僘僙僛僜僝僞僟僠僡僢僣僤僥僨僩僪僫僯僰僱僲僴僶僷僸價僺僼僽僾僿儀儁儂儃億儅儈�儉儊儌儍儎儏儐儑儓儔儕儖儗儘儙儚儛儜儝儞償儠儢儣儤儥儦儧儨儩優儫儬儭儮儯儰儱儲儳儴儵儶儷儸儹儺儻儼儽儾兂兇兊兌兎兏児兒兓兗兘兙兛兝兞兟兠兡兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦冧冨冩冪冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒凓凔凕凖凗�".split("");
- for(j = 0; j != D[131].length; ++j) if(D[131][j].charCodeAt(0) !== 0xFFFD) { e[D[131][j]] = 33536 + j; d[33536 + j] = D[131][j];}
- D[132] = "����������������������������������������������������������������凘凙凚凜凞凟凢凣凥処凧凨凩凪凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄剅剆則剈剉剋剎剏剒剓剕剗剘�剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳剴創剶剷剸剹剺剻剼剾劀劃劄劅劆劇劉劊劋劌劍劎劏劑劒劔劕劖劗劘劙劚劜劤劥劦劧劮劯劰労劵劶劷劸効劺劻劼劽勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務勚勛勜勝勞勠勡勢勣勥勦勧勨勩勪勫勬勭勮勯勱勲勳勴勵勶勷勸勻勼勽匁匂匃匄匇匉匊匋匌匎�".split("");
- for(j = 0; j != D[132].length; ++j) if(D[132][j].charCodeAt(0) !== 0xFFFD) { e[D[132][j]] = 33792 + j; d[33792 + j] = D[132][j];}
- D[133] = "����������������������������������������������������������������匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯匰匱匲匳匴匵匶匷匸匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏�厐厑厒厓厔厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯厰厱厲厳厴厵厷厸厹厺厼厽厾叀參叄叅叆叇収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝呞呟呠呡呣呥呧呩呪呫呬呭呮呯呰呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡�".split("");
- for(j = 0; j != D[133].length; ++j) if(D[133][j].charCodeAt(0) !== 0xFFFD) { e[D[133][j]] = 34048 + j; d[34048 + j] = D[133][j];}
- D[134] = "����������������������������������������������������������������咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠員哢哣哤哫哬哯哰哱哴哵哶哷哸哹哻哾唀唂唃唄唅唈唊唋唌唍唎唒唓唕唖唗唘唙唚唜唝唞唟唡唥唦�唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋啌啍啎問啑啒啓啔啗啘啙啚啛啝啞啟啠啢啣啨啩啫啯啰啱啲啳啴啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠喡喢喣喤喥喦喨喩喪喫喬喭單喯喰喲喴営喸喺喼喿嗀嗁嗂嗃嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗嗘嗙嗚嗛嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸嗹嗺嗻嗼嗿嘂嘃嘄嘅�".split("");
- for(j = 0; j != D[134].length; ++j) if(D[134][j].charCodeAt(0) !== 0xFFFD) { e[D[134][j]] = 34304 + j; d[34304 + j] = D[134][j];}
- D[135] = "����������������������������������������������������������������嘆嘇嘊嘋嘍嘐嘑嘒嘓嘔嘕嘖嘗嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀噁噂噃噄噅噆噇噈噉噊噋噏噐噑噒噓噕噖噚噛噝噞噟噠噡�噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽噾噿嚀嚁嚂嚃嚄嚇嚈嚉嚊嚋嚌嚍嚐嚑嚒嚔嚕嚖嚗嚘嚙嚚嚛嚜嚝嚞嚟嚠嚡嚢嚤嚥嚦嚧嚨嚩嚪嚫嚬嚭嚮嚰嚱嚲嚳嚴嚵嚶嚸嚹嚺嚻嚽嚾嚿囀囁囂囃囄囅囆囇囈囉囋囌囍囎囏囐囑囒囓囕囖囘囙囜団囥囦囧囨囩囪囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國圌圍圎圏圐圑�".split("");
- for(j = 0; j != D[135].length; ++j) if(D[135][j].charCodeAt(0) !== 0xFFFD) { e[D[135][j]] = 34560 + j; d[34560 + j] = D[135][j];}
- D[136] = "����������������������������������������������������������������園圓圔圕圖圗團圙圚圛圝圞圠圡圢圤圥圦圧圫圱圲圴圵圶圷圸圼圽圿坁坃坄坅坆坈坉坋坒坓坔坕坖坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀�垁垇垈垉垊垍垎垏垐垑垔垕垖垗垘垙垚垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹垺垻垼垽垾垿埀埁埄埅埆埇埈埉埊埌埍埐埑埓埖埗埛埜埞埡埢埣埥埦埧埨埩埪埫埬埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥堦堧堨堩堫堬堭堮堯報堲堳場堶堷堸堹堺堻堼堽�".split("");
- for(j = 0; j != D[136].length; ++j) if(D[136][j].charCodeAt(0) !== 0xFFFD) { e[D[136][j]] = 34816 + j; d[34816 + j] = D[136][j];}
- D[137] = "����������������������������������������������������������������堾堿塀塁塂塃塅塆塇塈塉塊塋塎塏塐塒塓塕塖塗塙塚塛塜塝塟塠塡塢塣塤塦塧塨塩塪塭塮塯塰塱塲塳塴塵塶塷塸塹塺塻塼塽塿墂墄墆墇墈墊墋墌�墍墎墏墐墑墔墕墖増墘墛墜墝墠墡墢墣墤墥墦墧墪墫墬墭墮墯墰墱墲墳墴墵墶墷墸墹墺墻墽墾墿壀壂壃壄壆壇壈壉壊壋壌壍壎壏壐壒壓壔壖壗壘壙壚壛壜壝壞壟壠壡壢壣壥壦壧壨壩壪壭壯壱売壴壵壷壸壺壻壼壽壾壿夀夁夃夅夆夈変夊夋夌夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻�".split("");
- for(j = 0; j != D[137].length; ++j) if(D[137][j].charCodeAt(0) !== 0xFFFD) { e[D[137][j]] = 35072 + j; d[35072 + j] = D[137][j];}
- D[138] = "����������������������������������������������������������������夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛奜奝奞奟奡奣奤奦奧奨奩奪奫奬奭奮奯奰奱奲奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦�妧妬妭妰妱妳妴妵妶妷妸妺妼妽妿姀姁姂姃姄姅姇姈姉姌姍姎姏姕姖姙姛姞姟姠姡姢姤姦姧姩姪姫姭姮姯姰姱姲姳姴姵姶姷姸姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪娫娬娭娮娯娰娳娵娷娸娹娺娻娽娾娿婁婂婃婄婅婇婈婋婌婍婎婏婐婑婒婓婔婖婗婘婙婛婜婝婞婟婠�".split("");
- for(j = 0; j != D[138].length; ++j) if(D[138][j].charCodeAt(0) !== 0xFFFD) { e[D[138][j]] = 35328 + j; d[35328 + j] = D[138][j];}
- D[139] = "����������������������������������������������������������������婡婣婤婥婦婨婩婫婬婭婮婯婰婱婲婳婸婹婻婼婽婾媀媁媂媃媄媅媆媇媈媉媊媋媌媍媎媏媐媑媓媔媕媖媗媘媙媜媝媞媟媠媡媢媣媤媥媦媧媨媩媫媬�媭媮媯媰媱媴媶媷媹媺媻媼媽媿嫀嫃嫄嫅嫆嫇嫈嫊嫋嫍嫎嫏嫐嫑嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬嫭嫮嫯嫰嫲嫳嫴嫵嫶嫷嫸嫹嫺嫻嫼嫽嫾嫿嬀嬁嬂嬃嬄嬅嬆嬇嬈嬊嬋嬌嬍嬎嬏嬐嬑嬒嬓嬔嬕嬘嬙嬚嬛嬜嬝嬞嬟嬠嬡嬢嬣嬤嬥嬦嬧嬨嬩嬪嬫嬬嬭嬮嬯嬰嬱嬳嬵嬶嬸嬹嬺嬻嬼嬽嬾嬿孁孂孃孄孅孆孇�".split("");
- for(j = 0; j != D[139].length; ++j) if(D[139][j].charCodeAt(0) !== 0xFFFD) { e[D[139][j]] = 35584 + j; d[35584 + j] = D[139][j];}
- D[140] = "����������������������������������������������������������������孈孉孊孋孌孍孎孏孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏�寑寔寕寖寗寘寙寚寛寜寠寢寣實寧審寪寫寬寭寯寱寲寳寴寵寶寷寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧屨屩屪屫屬屭屰屲屳屴屵屶屷屸屻屼屽屾岀岃岄岅岆岇岉岊岋岎岏岒岓岕岝岞岟岠岡岤岥岦岧岨�".split("");
- for(j = 0; j != D[140].length; ++j) if(D[140][j].charCodeAt(0) !== 0xFFFD) { e[D[140][j]] = 35840 + j; d[35840 + j] = D[140][j];}
- D[141] = "����������������������������������������������������������������岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅峆峇峈峉峊峌峍峎峏峐峑峓峔峕峖峗峘峚峛峜峝峞峟峠峢峣峧峩峫峬峮峯峱峲峳峴峵島峷峸峹峺峼峽峾峿崀�崁崄崅崈崉崊崋崌崍崏崐崑崒崓崕崗崘崙崚崜崝崟崠崡崢崣崥崨崪崫崬崯崰崱崲崳崵崶崷崸崹崺崻崼崿嵀嵁嵂嵃嵄嵅嵆嵈嵉嵍嵎嵏嵐嵑嵒嵓嵔嵕嵖嵗嵙嵚嵜嵞嵟嵠嵡嵢嵣嵤嵥嵦嵧嵨嵪嵭嵮嵰嵱嵲嵳嵵嵶嵷嵸嵹嵺嵻嵼嵽嵾嵿嶀嶁嶃嶄嶅嶆嶇嶈嶉嶊嶋嶌嶍嶎嶏嶐嶑嶒嶓嶔嶕嶖嶗嶘嶚嶛嶜嶞嶟嶠�".split("");
- for(j = 0; j != D[141].length; ++j) if(D[141][j].charCodeAt(0) !== 0xFFFD) { e[D[141][j]] = 36096 + j; d[36096 + j] = D[141][j];}
- D[142] = "����������������������������������������������������������������嶡嶢嶣嶤嶥嶦嶧嶨嶩嶪嶫嶬嶭嶮嶯嶰嶱嶲嶳嶴嶵嶶嶸嶹嶺嶻嶼嶽嶾嶿巀巁巂巃巄巆巇巈巉巊巋巌巎巏巐巑巒巓巔巕巖巗巘巙巚巜巟巠巣巤巪巬巭�巰巵巶巸巹巺巻巼巿帀帄帇帉帊帋帍帎帒帓帗帞帟帠帡帢帣帤帥帨帩帪師帬帯帰帲帳帴帵帶帹帺帾帿幀幁幃幆幇幈幉幊幋幍幎幏幐幑幒幓幖幗幘幙幚幜幝幟幠幣幤幥幦幧幨幩幪幫幬幭幮幯幰幱幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨庩庪庫庬庮庯庰庱庲庴庺庻庼庽庿廀廁廂廃廄廅�".split("");
- for(j = 0; j != D[142].length; ++j) if(D[142][j].charCodeAt(0) !== 0xFFFD) { e[D[142][j]] = 36352 + j; d[36352 + j] = D[142][j];}
- D[143] = "����������������������������������������������������������������廆廇廈廋廌廍廎廏廐廔廕廗廘廙廚廜廝廞廟廠廡廢廣廤廥廦廧廩廫廬廭廮廯廰廱廲廳廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤�弨弫弬弮弰弲弳弴張弶強弸弻弽弾弿彁彂彃彄彅彆彇彈彉彊彋彌彍彎彏彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢徣徤徥徦徧復徫徬徯徰徱徲徳徴徶徸徹徺徻徾徿忀忁忂忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇�".split("");
- for(j = 0; j != D[143].length; ++j) if(D[143][j].charCodeAt(0) !== 0xFFFD) { e[D[143][j]] = 36608 + j; d[36608 + j] = D[143][j];}
- D[144] = "����������������������������������������������������������������怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰怱怲怳怴怶怷怸怹怺怽怾恀恄恅恆恇恈恉恊恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀�悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽悾悿惀惁惂惃惄惇惈惉惌惍惎惏惐惒惓惔惖惗惙惛惞惡惢惣惤惥惪惱惲惵惷惸惻惼惽惾惿愂愃愄愅愇愊愋愌愐愑愒愓愔愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬愭愮愯愰愱愲愳愴愵愶愷愸愹愺愻愼愽愾慀慁慂慃慄慅慆�".split("");
- for(j = 0; j != D[144].length; ++j) if(D[144][j].charCodeAt(0) !== 0xFFFD) { e[D[144][j]] = 36864 + j; d[36864 + j] = D[144][j];}
- D[145] = "����������������������������������������������������������������慇慉態慍慏慐慒慓慔慖慗慘慙慚慛慜慞慟慠慡慣慤慥慦慩慪慫慬慭慮慯慱慲慳慴慶慸慹慺慻慼慽慾慿憀憁憂憃憄憅憆憇憈憉憊憌憍憏憐憑憒憓憕�憖憗憘憙憚憛憜憞憟憠憡憢憣憤憥憦憪憫憭憮憯憰憱憲憳憴憵憶憸憹憺憻憼憽憿懀懁懃懄懅懆懇應懌懍懎懏懐懓懕懖懗懘懙懚懛懜懝懞懟懠懡懢懣懤懥懧懨懩懪懫懬懭懮懯懰懱懲懳懴懶懷懸懹懺懻懼懽懾戀戁戂戃戄戅戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸戹戺戻戼扂扄扅扆扊�".split("");
- for(j = 0; j != D[145].length; ++j) if(D[145][j].charCodeAt(0) !== 0xFFFD) { e[D[145][j]] = 37120 + j; d[37120 + j] = D[145][j];}
- D[146] = "����������������������������������������������������������������扏扐払扖扗扙扚扜扝扞扟扠扡扢扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋抌抍抎抏抐抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁�拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳挴挵挶挷挸挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖捗捘捙捚捛捜捝捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙掚掛掜掝掞掟採掤掦掫掯掱掲掵掶掹掻掽掿揀�".split("");
- for(j = 0; j != D[146].length; ++j) if(D[146][j].charCodeAt(0) !== 0xFFFD) { e[D[146][j]] = 37376 + j; d[37376 + j] = D[146][j];}
- D[147] = "����������������������������������������������������������������揁揂揃揅揇揈揊揋揌揑揓揔揕揗揘揙揚換揜揝揟揢揤揥揦揧揨揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆搇搈搉搊損搎搑搒搕搖搗搘搙搚搝搟搢搣搤�搥搧搨搩搫搮搯搰搱搲搳搵搶搷搸搹搻搼搾摀摂摃摉摋摌摍摎摏摐摑摓摕摖摗摙摚摛摜摝摟摠摡摢摣摤摥摦摨摪摫摬摮摯摰摱摲摳摴摵摶摷摻摼摽摾摿撀撁撃撆撈撉撊撋撌撍撎撏撐撓撔撗撘撚撛撜撝撟撠撡撢撣撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆擇擈擉擊擋擌擏擑擓擔擕擖擙據�".split("");
- for(j = 0; j != D[147].length; ++j) if(D[147][j].charCodeAt(0) !== 0xFFFD) { e[D[147][j]] = 37632 + j; d[37632 + j] = D[147][j];}
- D[148] = "����������������������������������������������������������������擛擜擝擟擠擡擣擥擧擨擩擪擫擬擭擮擯擰擱擲擳擴擵擶擷擸擹擺擻擼擽擾擿攁攂攃攄攅攆攇攈攊攋攌攍攎攏攐攑攓攔攕攖攗攙攚攛攜攝攞攟攠攡�攢攣攤攦攧攨攩攪攬攭攰攱攲攳攷攺攼攽敀敁敂敃敄敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數敹敺敻敼敽敾敿斀斁斂斃斄斅斆斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱斲斳斴斵斶斷斸斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘旙旚旛旜旝旞旟旡旣旤旪旫�".split("");
- for(j = 0; j != D[148].length; ++j) if(D[148][j].charCodeAt(0) !== 0xFFFD) { e[D[148][j]] = 37888 + j; d[37888 + j] = D[148][j];}
- D[149] = "����������������������������������������������������������������旲旳旴旵旸旹旻旼旽旾旿昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷昸昹昺昻昽昿晀時晄晅晆晇晈晉晊晍晎晐晑晘�晙晛晜晝晞晠晢晣晥晧晩晪晫晬晭晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘暙暚暛暜暞暟暠暡暢暣暤暥暦暩暪暫暬暭暯暰暱暲暳暵暶暷暸暺暻暼暽暿曀曁曂曃曄曅曆曇曈曉曊曋曌曍曎曏曐曑曒曓曔曕曖曗曘曚曞曟曠曡曢曣曤曥曧曨曪曫曬曭曮曯曱曵曶書曺曻曽朁朂會�".split("");
- for(j = 0; j != D[149].length; ++j) if(D[149][j].charCodeAt(0) !== 0xFFFD) { e[D[149][j]] = 38144 + j; d[38144 + j] = D[149][j];}
- D[150] = "����������������������������������������������������������������朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠朡朢朣朤朥朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗杘杙杚杛杝杢杣杤杦杧杫杬杮東杴杶�杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹枺枻枼枽枾枿柀柂柅柆柇柈柉柊柋柌柍柎柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵柶柷柸柹柺査柼柾栁栂栃栄栆栍栐栒栔栕栘栙栚栛栜栞栟栠栢栣栤栥栦栧栨栫栬栭栮栯栰栱栴栵栶栺栻栿桇桋桍桏桒桖桗桘桙桚桛�".split("");
- for(j = 0; j != D[150].length; ++j) if(D[150][j].charCodeAt(0) !== 0xFFFD) { e[D[150][j]] = 38400 + j; d[38400 + j] = D[150][j];}
- D[151] = "����������������������������������������������������������������桜桝桞桟桪桬桭桮桯桰桱桲桳桵桸桹桺桻桼桽桾桿梀梂梄梇梈梉梊梋梌梍梎梐梑梒梔梕梖梘梙梚梛梜條梞梟梠梡梣梤梥梩梪梫梬梮梱梲梴梶梷梸�梹梺梻梼梽梾梿棁棃棄棅棆棇棈棊棌棎棏棐棑棓棔棖棗棙棛棜棝棞棟棡棢棤棥棦棧棨棩棪棫棬棭棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆椇椈椉椊椌椏椑椓椔椕椖椗椘椙椚椛検椝椞椡椢椣椥椦椧椨椩椪椫椬椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃楄楅楆楇楈楉楊楋楌楍楎楏楐楑楒楓楕楖楘楙楛楜楟�".split("");
- for(j = 0; j != D[151].length; ++j) if(D[151][j].charCodeAt(0) !== 0xFFFD) { e[D[151][j]] = 38656 + j; d[38656 + j] = D[151][j];}
- D[152] = "����������������������������������������������������������������楡楢楤楥楧楨楩楪楬業楯楰楲楳楴極楶楺楻楽楾楿榁榃榅榊榋榌榎榏榐榑榒榓榖榗榙榚榝榞榟榠榡榢榣榤榥榦榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽�榾榿槀槂槃槄槅槆槇槈槉構槍槏槑槒槓槕槖槗様槙槚槜槝槞槡槢槣槤槥槦槧槨槩槪槫槬槮槯槰槱槳槴槵槶槷槸槹槺槻槼槾樀樁樂樃樄樅樆樇樈樉樋樌樍樎樏樐樑樒樓樔樕樖標樚樛樜樝樞樠樢樣樤樥樦樧権樫樬樭樮樰樲樳樴樶樷樸樹樺樻樼樿橀橁橂橃橅橆橈橉橊橋橌橍橎橏橑橒橓橔橕橖橗橚�".split("");
- for(j = 0; j != D[152].length; ++j) if(D[152][j].charCodeAt(0) !== 0xFFFD) { e[D[152][j]] = 38912 + j; d[38912 + j] = D[152][j];}
- D[153] = "����������������������������������������������������������������橜橝橞機橠橢橣橤橦橧橨橩橪橫橬橭橮橯橰橲橳橴橵橶橷橸橺橻橽橾橿檁檂檃檅檆檇檈檉檊檋檌檍檏檒檓檔檕檖檘檙檚檛檜檝檞檟檡檢檣檤檥檦�檧檨檪檭檮檯檰檱檲檳檴檵檶檷檸檹檺檻檼檽檾檿櫀櫁櫂櫃櫄櫅櫆櫇櫈櫉櫊櫋櫌櫍櫎櫏櫐櫑櫒櫓櫔櫕櫖櫗櫘櫙櫚櫛櫜櫝櫞櫟櫠櫡櫢櫣櫤櫥櫦櫧櫨櫩櫪櫫櫬櫭櫮櫯櫰櫱櫲櫳櫴櫵櫶櫷櫸櫹櫺櫻櫼櫽櫾櫿欀欁欂欃欄欅欆欇欈欉權欋欌欍欎欏欐欑欒欓欔欕欖欗欘欙欚欛欜欝欞欟欥欦欨欩欪欫欬欭欮�".split("");
- for(j = 0; j != D[153].length; ++j) if(D[153][j].charCodeAt(0) !== 0xFFFD) { e[D[153][j]] = 39168 + j; d[39168 + j] = D[153][j];}
- D[154] = "����������������������������������������������������������������欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍歎歏歐歑歒歓歔歕歖歗歘歚歛歜歝歞歟歠歡歨歩歫歬歭歮歯歰歱歲歳歴歵歶歷歸歺歽歾歿殀殅殈�殌殎殏殐殑殔殕殗殘殙殜殝殞殟殠殢殣殤殥殦殧殨殩殫殬殭殮殯殰殱殲殶殸殹殺殻殼殽殾毀毃毄毆毇毈毉毊毌毎毐毑毘毚毜毝毞毟毠毢毣毤毥毦毧毨毩毬毭毮毰毱毲毴毶毷毸毺毻毼毾毿氀氁氂氃氄氈氉氊氋氌氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋汌汍汎汏汑汒汓汖汘�".split("");
- for(j = 0; j != D[154].length; ++j) if(D[154][j].charCodeAt(0) !== 0xFFFD) { e[D[154][j]] = 39424 + j; d[39424 + j] = D[154][j];}
- D[155] = "����������������������������������������������������������������汙汚汢汣汥汦汧汫汬汭汮汯汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘�泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟洠洡洢洣洤洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽浾浿涀涁涃涄涆涇涊涋涍涏涐涒涖涗涘涙涚涜涢涥涬涭涰涱涳涴涶涷涹涺涻涼涽涾淁淂淃淈淉淊�".split("");
- for(j = 0; j != D[155].length; ++j) if(D[155][j].charCodeAt(0) !== 0xFFFD) { e[D[155][j]] = 39680 + j; d[39680 + j] = D[155][j];}
- D[156] = "����������������������������������������������������������������淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽淾淿渀渁渂渃渄渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵�渶渷渹渻渼渽渾渿湀湁湂湅湆湇湈湉湊湋湌湏湐湑湒湕湗湙湚湜湝湞湠湡湢湣湤湥湦湧湨湩湪湬湭湯湰湱湲湳湴湵湶湷湸湹湺湻湼湽満溁溂溄溇溈溊溋溌溍溎溑溒溓溔溕準溗溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪滫滬滭滮滯�".split("");
- for(j = 0; j != D[156].length; ++j) if(D[156][j].charCodeAt(0) !== 0xFFFD) { e[D[156][j]] = 39936 + j; d[39936 + j] = D[156][j];}
- D[157] = "����������������������������������������������������������������滰滱滲滳滵滶滷滸滺滻滼滽滾滿漀漁漃漄漅漇漈漊漋漌漍漎漐漑漒漖漗漘漙漚漛漜漝漞漟漡漢漣漥漦漧漨漬漮漰漲漴漵漷漸漹漺漻漼漽漿潀潁潂�潃潄潅潈潉潊潌潎潏潐潑潒潓潔潕潖潗潙潚潛潝潟潠潡潣潤潥潧潨潩潪潫潬潯潰潱潳潵潶潷潹潻潽潾潿澀澁澂澃澅澆澇澊澋澏澐澑澒澓澔澕澖澗澘澙澚澛澝澞澟澠澢澣澤澥澦澨澩澪澫澬澭澮澯澰澱澲澴澵澷澸澺澻澼澽澾澿濁濃濄濅濆濇濈濊濋濌濍濎濏濐濓濔濕濖濗濘濙濚濛濜濝濟濢濣濤濥�".split("");
- for(j = 0; j != D[157].length; ++j) if(D[157][j].charCodeAt(0) !== 0xFFFD) { e[D[157][j]] = 40192 + j; d[40192 + j] = D[157][j];}
- D[158] = "����������������������������������������������������������������濦濧濨濩濪濫濬濭濰濱濲濳濴濵濶濷濸濹濺濻濼濽濾濿瀀瀁瀂瀃瀄瀅瀆瀇瀈瀉瀊瀋瀌瀍瀎瀏瀐瀒瀓瀔瀕瀖瀗瀘瀙瀜瀝瀞瀟瀠瀡瀢瀤瀥瀦瀧瀨瀩瀪�瀫瀬瀭瀮瀯瀰瀱瀲瀳瀴瀶瀷瀸瀺瀻瀼瀽瀾瀿灀灁灂灃灄灅灆灇灈灉灊灋灍灎灐灑灒灓灔灕灖灗灘灙灚灛灜灝灟灠灡灢灣灤灥灦灧灨灩灪灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞炟炠炡炢炣炤炥炦炧炨炩炪炰炲炴炵炶為炾炿烄烅烆烇烉烋烌烍烎烏烐烑烒烓烔烕烖烗烚�".split("");
- for(j = 0; j != D[158].length; ++j) if(D[158][j].charCodeAt(0) !== 0xFFFD) { e[D[158][j]] = 40448 + j; d[40448 + j] = D[158][j];}
- D[159] = "����������������������������������������������������������������烜烝烞烠烡烢烣烥烪烮烰烱烲烳烴烵烶烸烺烻烼烾烿焀焁焂焃焄焅焆焇焈焋焌焍焎焏焑焒焔焗焛焜焝焞焟焠無焢焣焤焥焧焨焩焪焫焬焭焮焲焳焴�焵焷焸焹焺焻焼焽焾焿煀煁煂煃煄煆煇煈煉煋煍煏煐煑煒煓煔煕煖煗煘煙煚煛煝煟煠煡煢煣煥煩煪煫煬煭煯煰煱煴煵煶煷煹煻煼煾煿熀熁熂熃熅熆熇熈熉熋熌熍熎熐熑熒熓熕熖熗熚熛熜熝熞熡熢熣熤熥熦熧熩熪熫熭熮熯熰熱熲熴熶熷熸熺熻熼熽熾熿燀燁燂燄燅燆燇燈燉燊燋燌燍燏燐燑燒燓�".split("");
- for(j = 0; j != D[159].length; ++j) if(D[159][j].charCodeAt(0) !== 0xFFFD) { e[D[159][j]] = 40704 + j; d[40704 + j] = D[159][j];}
- D[160] = "����������������������������������������������������������������燖燗燘燙燚燛燜燝燞營燡燢燣燤燦燨燩燪燫燬燭燯燰燱燲燳燴燵燶燷燸燺燻燼燽燾燿爀爁爂爃爄爅爇爈爉爊爋爌爍爎爏爐爑爒爓爔爕爖爗爘爙爚�爛爜爞爟爠爡爢爣爤爥爦爧爩爫爭爮爯爲爳爴爺爼爾牀牁牂牃牄牅牆牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅犆犇犈犉犌犎犐犑犓犔犕犖犗犘犙犚犛犜犝犞犠犡犢犣犤犥犦犧犨犩犪犫犮犱犲犳犵犺犻犼犽犾犿狀狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛�".split("");
- for(j = 0; j != D[160].length; ++j) if(D[160][j].charCodeAt(0) !== 0xFFFD) { e[D[160][j]] = 40960 + j; d[40960 + j] = D[160][j];}
- D[161] = "����������������������������������������������������������������������������������������������������������������������������������������������������������������� 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈〉《》「」『』〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓�".split("");
- for(j = 0; j != D[161].length; ++j) if(D[161][j].charCodeAt(0) !== 0xFFFD) { e[D[161][j]] = 41216 + j; d[41216 + j] = D[161][j];}
- D[162] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹ������⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂⒃⒄⒅⒆⒇①②③④⑤⑥⑦⑧⑨⑩��㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩��ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ���".split("");
- for(j = 0; j != D[162].length; ++j) if(D[162][j].charCodeAt(0) !== 0xFFFD) { e[D[162][j]] = 41472 + j; d[41472 + j] = D[162][j];}
- D[163] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������!"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|} ̄�".split("");
- for(j = 0; j != D[163].length; ++j) if(D[163][j].charCodeAt(0) !== 0xFFFD) { e[D[163][j]] = 41728 + j; d[41728 + j] = D[163][j];}
- D[164] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをん������������".split("");
- for(j = 0; j != D[164].length; ++j) if(D[164][j].charCodeAt(0) !== 0xFFFD) { e[D[164][j]] = 41984 + j; d[41984 + j] = D[164][j];}
- D[165] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶ���������".split("");
- for(j = 0; j != D[165].length; ++j) if(D[165][j].charCodeAt(0) !== 0xFFFD) { e[D[165][j]] = 42240 + j; d[42240 + j] = D[165][j];}
- D[166] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ��������αβγδεζηθικλμνξοπρστυφχψω�������︵︶︹︺︿﹀︽︾﹁﹂﹃﹄��︻︼︷︸︱�︳︴����������".split("");
- for(j = 0; j != D[166].length; ++j) if(D[166][j].charCodeAt(0) !== 0xFFFD) { e[D[166][j]] = 42496 + j; d[42496 + j] = D[166][j];}
- D[167] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ���������������абвгдеёжзийклмнопрстуфхцчшщъыьэюя��������������".split("");
- for(j = 0; j != D[167].length; ++j) if(D[167][j].charCodeAt(0) !== 0xFFFD) { e[D[167][j]] = 42752 + j; d[42752 + j] = D[167][j];}
- D[168] = "����������������������������������������������������������������ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═║╒╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡╢╣╤╥╦╧╨╩╪╫╬╭╮╯╰╱╲╳▁▂▃▄▅▆▇�█▉▊▋▌▍▎▏▓▔▕▼▽◢◣◤◥☉⊕〒〝〞�����������āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ�ńň�ɡ����ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦㄧㄨㄩ����������������������".split("");
- for(j = 0; j != D[168].length; ++j) if(D[168][j].charCodeAt(0) !== 0xFFFD) { e[D[168][j]] = 43008 + j; d[43008 + j] = D[168][j];}
- D[169] = "����������������������������������������������������������������〡〢〣〤〥〦〧〨〩㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦�℡㈱�‐���ー゛゜ヽヾ〆ゝゞ﹉﹊﹋﹌﹍﹎﹏﹐﹑﹒﹔﹕﹖﹗﹙﹚﹛﹜﹝﹞﹟﹠﹡�﹢﹣﹤﹥﹦﹨﹩﹪﹫�������������〇�������������─━│┃┄┅┆┇┈┉┊┋┌┍┎┏┐┑┒┓└┕┖┗┘┙┚┛├┝┞┟┠┡┢┣┤┥┦┧┨┩┪┫┬┭┮┯┰┱┲┳┴┵┶┷┸┹┺┻┼┽┾┿╀╁╂╃╄╅╆╇╈╉╊╋����������������".split("");
- for(j = 0; j != D[169].length; ++j) if(D[169][j].charCodeAt(0) !== 0xFFFD) { e[D[169][j]] = 43264 + j; d[43264 + j] = D[169][j];}
- D[170] = "����������������������������������������������������������������狜狝狟狢狣狤狥狦狧狪狫狵狶狹狽狾狿猀猂猄猅猆猇猈猉猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀獁獂獃獄獅獆獇獈�獉獊獋獌獎獏獑獓獔獕獖獘獙獚獛獜獝獞獟獡獢獣獤獥獦獧獨獩獪獫獮獰獱�����������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[170].length; ++j) if(D[170][j].charCodeAt(0) !== 0xFFFD) { e[D[170][j]] = 43520 + j; d[43520 + j] = D[170][j];}
- D[171] = "����������������������������������������������������������������獲獳獴獵獶獷獸獹獺獻獼獽獿玀玁玂玃玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣玤玥玦玧玨玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃珄珅珆珇�珋珌珎珒珓珔珕珖珗珘珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳珴珵珶珷�����������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[171].length; ++j) if(D[171][j].charCodeAt(0) !== 0xFFFD) { e[D[171][j]] = 43776 + j; d[43776 + j] = D[171][j];}
- D[172] = "����������������������������������������������������������������珸珹珺珻珼珽現珿琀琁琂琄琇琈琋琌琍琎琑琒琓琔琕琖琗琘琙琜琝琞琟琠琡琣琤琧琩琫琭琯琱琲琷琸琹琺琻琽琾琿瑀瑂瑃瑄瑅瑆瑇瑈瑉瑊瑋瑌瑍�瑎瑏瑐瑑瑒瑓瑔瑖瑘瑝瑠瑡瑢瑣瑤瑥瑦瑧瑨瑩瑪瑫瑬瑮瑯瑱瑲瑳瑴瑵瑸瑹瑺�����������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[172].length; ++j) if(D[172][j].charCodeAt(0) !== 0xFFFD) { e[D[172][j]] = 44032 + j; d[44032 + j] = D[172][j];}
- D[173] = "����������������������������������������������������������������瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑璒璓璔璕璖璗璘璙璚璛璝璟璠璡璢璣璤璥璦璪璫璬璭璮璯環璱璲璳璴璵璶璷璸璹璻璼璽璾璿瓀瓁瓂瓃瓄瓅瓆瓇�瓈瓉瓊瓋瓌瓍瓎瓏瓐瓑瓓瓔瓕瓖瓗瓘瓙瓚瓛瓝瓟瓡瓥瓧瓨瓩瓪瓫瓬瓭瓰瓱瓲�����������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[173].length; ++j) if(D[173][j].charCodeAt(0) !== 0xFFFD) { e[D[173][j]] = 44288 + j; d[44288 + j] = D[173][j];}
- D[174] = "����������������������������������������������������������������瓳瓵瓸瓹瓺瓻瓼瓽瓾甀甁甂甃甅甆甇甈甉甊甋甌甎甐甒甔甕甖甗甛甝甞甠甡產産甤甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘�畝畞畟畠畡畢畣畤畧畨畩畫畬畭畮畯異畱畳畵當畷畺畻畼畽畾疀疁疂疄疅疇�����������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[174].length; ++j) if(D[174][j].charCodeAt(0) !== 0xFFFD) { e[D[174][j]] = 44544 + j; d[44544 + j] = D[174][j];}
- D[175] = "����������������������������������������������������������������疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦疧疨疩疪疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇�瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄�����������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[175].length; ++j) if(D[175][j].charCodeAt(0) !== 0xFFFD) { e[D[175][j]] = 44800 + j; d[44800 + j] = D[175][j];}
- D[176] = "����������������������������������������������������������������癅癆癇癈癉癊癋癎癏癐癑癒癓癕癗癘癙癚癛癝癟癠癡癢癤癥癦癧癨癩癪癬癭癮癰癱癲癳癴癵癶癷癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛�皜皝皞皟皠皡皢皣皥皦皧皨皩皪皫皬皭皯皰皳皵皶皷皸皹皺皻皼皽皾盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥�".split("");
- for(j = 0; j != D[176].length; ++j) if(D[176][j].charCodeAt(0) !== 0xFFFD) { e[D[176][j]] = 45056 + j; d[45056 + j] = D[176][j];}
- D[177] = "����������������������������������������������������������������盄盇盉盋盌盓盕盙盚盜盝盞盠盡盢監盤盦盧盨盩盪盫盬盭盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎眏眐眑眒眓眔眕眖眗眘眛眜眝眞眡眣眤眥眧眪眫�眬眮眰眱眲眳眴眹眻眽眾眿睂睄睅睆睈睉睊睋睌睍睎睏睒睓睔睕睖睗睘睙睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳�".split("");
- for(j = 0; j != D[177].length; ++j) if(D[177][j].charCodeAt(0) !== 0xFFFD) { e[D[177][j]] = 45312 + j; d[45312 + j] = D[177][j];}
- D[178] = "����������������������������������������������������������������睝睞睟睠睤睧睩睪睭睮睯睰睱睲睳睴睵睶睷睸睺睻睼瞁瞂瞃瞆瞇瞈瞉瞊瞋瞏瞐瞓瞔瞕瞖瞗瞘瞙瞚瞛瞜瞝瞞瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶瞷瞸瞹瞺�瞼瞾矀矁矂矃矄矅矆矇矈矉矊矋矌矎矏矐矑矒矓矔矕矖矘矙矚矝矞矟矠矡矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖�".split("");
- for(j = 0; j != D[178].length; ++j) if(D[178][j].charCodeAt(0) !== 0xFFFD) { e[D[178][j]] = 45568 + j; d[45568 + j] = D[178][j];}
- D[179] = "����������������������������������������������������������������矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃砄砅砆砇砈砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚�硛硜硞硟硠硡硢硣硤硥硦硧硨硩硯硰硱硲硳硴硵硶硸硹硺硻硽硾硿碀碁碂碃场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚�".split("");
- for(j = 0; j != D[179].length; ++j) if(D[179][j].charCodeAt(0) !== 0xFFFD) { e[D[179][j]] = 45824 + j; d[45824 + j] = D[179][j];}
- D[180] = "����������������������������������������������������������������碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨碩碪碫碬碭碮碯碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚磛磜磝磞磟磠磡磢磣�磤磥磦磧磩磪磫磭磮磯磰磱磳磵磶磸磹磻磼磽磾磿礀礂礃礄礆礇礈礉礊礋礌础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮�".split("");
- for(j = 0; j != D[180].length; ++j) if(D[180][j].charCodeAt(0) !== 0xFFFD) { e[D[180][j]] = 46080 + j; d[46080 + j] = D[180][j];}
- D[181] = "����������������������������������������������������������������礍礎礏礐礑礒礔礕礖礗礘礙礚礛礜礝礟礠礡礢礣礥礦礧礨礩礪礫礬礭礮礯礰礱礲礳礵礶礷礸礹礽礿祂祃祄祅祇祊祋祌祍祎祏祐祑祒祔祕祘祙祡祣�祤祦祩祪祫祬祮祰祱祲祳祴祵祶祹祻祼祽祾祿禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠�".split("");
- for(j = 0; j != D[181].length; ++j) if(D[181][j].charCodeAt(0) !== 0xFFFD) { e[D[181][j]] = 46336 + j; d[46336 + j] = D[181][j];}
- D[182] = "����������������������������������������������������������������禓禔禕禖禗禘禙禛禜禝禞禟禠禡禢禣禤禥禦禨禩禪禫禬禭禮禯禰禱禲禴禵禶禷禸禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙秚秛秜秝秞秠秡秢秥秨秪�秬秮秱秲秳秴秵秶秷秹秺秼秾秿稁稄稅稇稈稉稊稌稏稐稑稒稓稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二�".split("");
- for(j = 0; j != D[182].length; ++j) if(D[182][j].charCodeAt(0) !== 0xFFFD) { e[D[182][j]] = 46592 + j; d[46592 + j] = D[182][j];}
- D[183] = "����������������������������������������������������������������稝稟稡稢稤稥稦稧稨稩稪稫稬稭種稯稰稱稲稴稵稶稸稺稾穀穁穂穃穄穅穇穈穉穊穋穌積穎穏穐穒穓穔穕穖穘穙穚穛穜穝穞穟穠穡穢穣穤穥穦穧穨�穩穪穫穬穭穮穯穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服�".split("");
- for(j = 0; j != D[183].length; ++j) if(D[183][j].charCodeAt(0) !== 0xFFFD) { e[D[183][j]] = 46848 + j; d[46848 + j] = D[183][j];}
- D[184] = "����������������������������������������������������������������窣窤窧窩窪窫窮窯窰窱窲窴窵窶窷窸窹窺窻窼窽窾竀竁竂竃竄竅竆竇竈竉竊竌竍竎竏竐竑竒竓竔竕竗竘竚竛竜竝竡竢竤竧竨竩竪竫竬竮竰竱竲竳�竴竵競竷竸竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹�".split("");
- for(j = 0; j != D[184].length; ++j) if(D[184][j].charCodeAt(0) !== 0xFFFD) { e[D[184][j]] = 47104 + j; d[47104 + j] = D[184][j];}
- D[185] = "����������������������������������������������������������������笯笰笲笴笵笶笷笹笻笽笿筀筁筂筃筄筆筈筊筍筎筓筕筗筙筜筞筟筡筣筤筥筦筧筨筩筪筫筬筭筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆箇箈箉箊箋箌箎箏�箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹箺箻箼箽箾箿節篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈�".split("");
- for(j = 0; j != D[185].length; ++j) if(D[185][j].charCodeAt(0) !== 0xFFFD) { e[D[185][j]] = 47360 + j; d[47360 + j] = D[185][j];}
- D[186] = "����������������������������������������������������������������篅篈築篊篋篍篎篏篐篒篔篕篖篗篘篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲篳篴篵篶篸篹篺篻篽篿簀簁簂簃簄簅簆簈簉簊簍簎簐簑簒簓簔簕簗簘簙�簚簛簜簝簞簠簡簢簣簤簥簨簩簫簬簭簮簯簰簱簲簳簴簵簶簷簹簺簻簼簽簾籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖�".split("");
- for(j = 0; j != D[186].length; ++j) if(D[186][j].charCodeAt(0) !== 0xFFFD) { e[D[186][j]] = 47616 + j; d[47616 + j] = D[186][j];}
- D[187] = "����������������������������������������������������������������籃籄籅籆籇籈籉籊籋籌籎籏籐籑籒籓籔籕籖籗籘籙籚籛籜籝籞籟籠籡籢籣籤籥籦籧籨籩籪籫籬籭籮籯籰籱籲籵籶籷籸籹籺籾籿粀粁粂粃粄粅粆粇�粈粊粋粌粍粎粏粐粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴粵粶粷粸粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕�".split("");
- for(j = 0; j != D[187].length; ++j) if(D[187][j].charCodeAt(0) !== 0xFFFD) { e[D[187][j]] = 47872 + j; d[47872 + j] = D[187][j];}
- D[188] = "����������������������������������������������������������������粿糀糂糃糄糆糉糋糎糏糐糑糒糓糔糘糚糛糝糞糡糢糣糤糥糦糧糩糪糫糬糭糮糰糱糲糳糴糵糶糷糹糺糼糽糾糿紀紁紂紃約紅紆紇紈紉紋紌納紎紏紐�紑紒紓純紕紖紗紘紙級紛紜紝紞紟紡紣紤紥紦紨紩紪紬紭紮細紱紲紳紴紵紶肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件�".split("");
- for(j = 0; j != D[188].length; ++j) if(D[188][j].charCodeAt(0) !== 0xFFFD) { e[D[188][j]] = 48128 + j; d[48128 + j] = D[188][j];}
- D[189] = "����������������������������������������������������������������紷紸紹紺紻紼紽紾紿絀絁終絃組絅絆絇絈絉絊絋経絍絎絏結絑絒絓絔絕絖絗絘絙絚絛絜絝絞絟絠絡絢絣絤絥給絧絨絩絪絫絬絭絯絰統絲絳絴絵絶�絸絹絺絻絼絽絾絿綀綁綂綃綄綅綆綇綈綉綊綋綌綍綎綏綐綑綒經綔綕綖綗綘健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸�".split("");
- for(j = 0; j != D[189].length; ++j) if(D[189][j].charCodeAt(0) !== 0xFFFD) { e[D[189][j]] = 48384 + j; d[48384 + j] = D[189][j];}
- D[190] = "����������������������������������������������������������������継続綛綜綝綞綟綠綡綢綣綤綥綧綨綩綪綫綬維綯綰綱網綳綴綵綶綷綸綹綺綻綼綽綾綿緀緁緂緃緄緅緆緇緈緉緊緋緌緍緎総緐緑緒緓緔緕緖緗緘緙�線緛緜緝緞緟締緡緢緣緤緥緦緧編緩緪緫緬緭緮緯緰緱緲緳練緵緶緷緸緹緺尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻�".split("");
- for(j = 0; j != D[190].length; ++j) if(D[190][j].charCodeAt(0) !== 0xFFFD) { e[D[190][j]] = 48640 + j; d[48640 + j] = D[190][j];}
- D[191] = "����������������������������������������������������������������緻緼緽緾緿縀縁縂縃縄縅縆縇縈縉縊縋縌縍縎縏縐縑縒縓縔縕縖縗縘縙縚縛縜縝縞縟縠縡縢縣縤縥縦縧縨縩縪縫縬縭縮縯縰縱縲縳縴縵縶縷縸縹�縺縼總績縿繀繂繃繄繅繆繈繉繊繋繌繍繎繏繐繑繒繓織繕繖繗繘繙繚繛繜繝俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀�".split("");
- for(j = 0; j != D[191].length; ++j) if(D[191][j].charCodeAt(0) !== 0xFFFD) { e[D[191][j]] = 48896 + j; d[48896 + j] = D[191][j];}
- D[192] = "����������������������������������������������������������������繞繟繠繡繢繣繤繥繦繧繨繩繪繫繬繭繮繯繰繱繲繳繴繵繶繷繸繹繺繻繼繽繾繿纀纁纃纄纅纆纇纈纉纊纋續纍纎纏纐纑纒纓纔纕纖纗纘纙纚纜纝纞�纮纴纻纼绖绤绬绹缊缐缞缷缹缻缼缽缾缿罀罁罃罆罇罈罉罊罋罌罍罎罏罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐�".split("");
- for(j = 0; j != D[192].length; ++j) if(D[192][j].charCodeAt(0) !== 0xFFFD) { e[D[192][j]] = 49152 + j; d[49152 + j] = D[192][j];}
- D[193] = "����������������������������������������������������������������罖罙罛罜罝罞罠罣罤罥罦罧罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂羃羄羅羆羇羈羉羋羍羏羐羑羒羓羕羖羗羘羙羛羜羠羢羣羥羦羨義羪羫羬羭羮羱�羳羴羵羶羷羺羻羾翀翂翃翄翆翇翈翉翋翍翏翐翑習翓翖翗翙翚翛翜翝翞翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿�".split("");
- for(j = 0; j != D[193].length; ++j) if(D[193][j].charCodeAt(0) !== 0xFFFD) { e[D[193][j]] = 49408 + j; d[49408 + j] = D[193][j];}
- D[194] = "����������������������������������������������������������������翤翧翨翪翫翬翭翯翲翴翵翶翷翸翹翺翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫耬耭耮耯耰耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗�聙聛聜聝聞聟聠聡聢聣聤聥聦聧聨聫聬聭聮聯聰聲聳聴聵聶職聸聹聺聻聼聽隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫�".split("");
- for(j = 0; j != D[194].length; ++j) if(D[194][j].charCodeAt(0) !== 0xFFFD) { e[D[194][j]] = 49664 + j; d[49664 + j] = D[194][j];}
- D[195] = "����������������������������������������������������������������聾肁肂肅肈肊肍肎肏肐肑肒肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇胈胉胊胋胏胐胑胒胓胔胕胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋�脌脕脗脙脛脜脝脟脠脡脢脣脤脥脦脧脨脩脪脫脭脮脰脳脴脵脷脹脺脻脼脽脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸�".split("");
- for(j = 0; j != D[195].length; ++j) if(D[195][j].charCodeAt(0) !== 0xFFFD) { e[D[195][j]] = 49920 + j; d[49920 + j] = D[195][j];}
- D[196] = "����������������������������������������������������������������腀腁腂腃腄腅腇腉腍腎腏腒腖腗腘腛腜腝腞腟腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃膄膅膆膇膉膋膌膍膎膐膒膓膔膕膖膗膙膚膞膟膠膡膢膤膥�膧膩膫膬膭膮膯膰膱膲膴膵膶膷膸膹膼膽膾膿臄臅臇臈臉臋臍臎臏臐臑臒臓摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁�".split("");
- for(j = 0; j != D[196].length; ++j) if(D[196][j].charCodeAt(0) !== 0xFFFD) { e[D[196][j]] = 50176 + j; d[50176 + j] = D[196][j];}
- D[197] = "����������������������������������������������������������������臔臕臖臗臘臙臚臛臜臝臞臟臠臡臢臤臥臦臨臩臫臮臯臰臱臲臵臶臷臸臹臺臽臿舃與興舉舊舋舎舏舑舓舕舖舗舘舙舚舝舠舤舥舦舧舩舮舲舺舼舽舿�艀艁艂艃艅艆艈艊艌艍艎艐艑艒艓艔艕艖艗艙艛艜艝艞艠艡艢艣艤艥艦艧艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗�".split("");
- for(j = 0; j != D[197].length; ++j) if(D[197][j].charCodeAt(0) !== 0xFFFD) { e[D[197][j]] = 50432 + j; d[50432 + j] = D[197][j];}
- D[198] = "����������������������������������������������������������������艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸�苺苼苽苾苿茀茊茋茍茐茒茓茖茘茙茝茞茟茠茡茢茣茤茥茦茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐�".split("");
- for(j = 0; j != D[198].length; ++j) if(D[198][j].charCodeAt(0) !== 0xFFFD) { e[D[198][j]] = 50688 + j; d[50688 + j] = D[198][j];}
- D[199] = "����������������������������������������������������������������茾茿荁荂荄荅荈荊荋荌荍荎荓荕荖荗荘荙荝荢荰荱荲荳荴荵荶荹荺荾荿莀莁莂莃莄莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡莢莣莤莥莦莧莬莭莮�莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠�".split("");
- for(j = 0; j != D[199].length; ++j) if(D[199][j].charCodeAt(0) !== 0xFFFD) { e[D[199][j]] = 50944 + j; d[50944 + j] = D[199][j];}
- D[200] = "����������������������������������������������������������������菮華菳菴菵菶菷菺菻菼菾菿萀萂萅萇萈萉萊萐萒萓萔萕萖萗萙萚萛萞萟萠萡萢萣萩萪萫萬萭萮萯萰萲萳萴萵萶萷萹萺萻萾萿葀葁葂葃葄葅葇葈葉�葊葋葌葍葎葏葐葒葓葔葕葖葘葝葞葟葠葢葤葥葦葧葨葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁�".split("");
- for(j = 0; j != D[200].length; ++j) if(D[200][j].charCodeAt(0) !== 0xFFFD) { e[D[200][j]] = 51200 + j; d[51200 + j] = D[200][j];}
- D[201] = "����������������������������������������������������������������葽葾葿蒀蒁蒃蒄蒅蒆蒊蒍蒏蒐蒑蒒蒓蒔蒕蒖蒘蒚蒛蒝蒞蒟蒠蒢蒣蒤蒥蒦蒧蒨蒩蒪蒫蒬蒭蒮蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗�蓘蓙蓚蓛蓜蓞蓡蓢蓤蓧蓨蓩蓪蓫蓭蓮蓯蓱蓲蓳蓴蓵蓶蓷蓸蓹蓺蓻蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳�".split("");
- for(j = 0; j != D[201].length; ++j) if(D[201][j].charCodeAt(0) !== 0xFFFD) { e[D[201][j]] = 51456 + j; d[51456 + j] = D[201][j];}
- D[202] = "����������������������������������������������������������������蔃蔄蔅蔆蔇蔈蔉蔊蔋蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢蔣蔤蔥蔦蔧蔨蔩蔪蔭蔮蔯蔰蔱蔲蔳蔴蔵蔶蔾蔿蕀蕁蕂蕄蕅蕆蕇蕋蕌蕍蕎蕏蕐蕑蕒蕓蕔蕕�蕗蕘蕚蕛蕜蕝蕟蕠蕡蕢蕣蕥蕦蕧蕩蕪蕫蕬蕭蕮蕯蕰蕱蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱�".split("");
- for(j = 0; j != D[202].length; ++j) if(D[202][j].charCodeAt(0) !== 0xFFFD) { e[D[202][j]] = 51712 + j; d[51712 + j] = D[202][j];}
- D[203] = "����������������������������������������������������������������薂薃薆薈薉薊薋薌薍薎薐薑薒薓薔薕薖薗薘薙薚薝薞薟薠薡薢薣薥薦薧薩薫薬薭薱薲薳薴薵薶薸薺薻薼薽薾薿藀藂藃藄藅藆藇藈藊藋藌藍藎藑藒�藔藖藗藘藙藚藛藝藞藟藠藡藢藣藥藦藧藨藪藫藬藭藮藯藰藱藲藳藴藵藶藷藸恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔�".split("");
- for(j = 0; j != D[203].length; ++j) if(D[203][j].charCodeAt(0) !== 0xFFFD) { e[D[203][j]] = 51968 + j; d[51968 + j] = D[203][j];}
- D[204] = "����������������������������������������������������������������藹藺藼藽藾蘀蘁蘂蘃蘄蘆蘇蘈蘉蘊蘋蘌蘍蘎蘏蘐蘒蘓蘔蘕蘗蘘蘙蘚蘛蘜蘝蘞蘟蘠蘡蘢蘣蘤蘥蘦蘨蘪蘫蘬蘭蘮蘯蘰蘱蘲蘳蘴蘵蘶蘷蘹蘺蘻蘽蘾蘿虀�虁虂虃虄虅虆虇虈虉虊虋虌虒虓處虖虗虘虙虛虜虝號虠虡虣虤虥虦虧虨虩虪獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃�".split("");
- for(j = 0; j != D[204].length; ++j) if(D[204][j].charCodeAt(0) !== 0xFFFD) { e[D[204][j]] = 52224 + j; d[52224 + j] = D[204][j];}
- D[205] = "����������������������������������������������������������������虭虯虰虲虳虴虵虶虷虸蚃蚄蚅蚆蚇蚈蚉蚎蚏蚐蚑蚒蚔蚖蚗蚘蚙蚚蚛蚞蚟蚠蚡蚢蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻蚼蚽蚾蚿蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜�蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威�".split("");
- for(j = 0; j != D[205].length; ++j) if(D[205][j].charCodeAt(0) !== 0xFFFD) { e[D[205][j]] = 52480 + j; d[52480 + j] = D[205][j];}
- D[206] = "����������������������������������������������������������������蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀蝁蝂蝃蝄蝅蝆蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚蝛蝜蝝蝞蝟蝡蝢蝦蝧蝨蝩蝪蝫蝬蝭蝯蝱蝲蝳蝵�蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎螏螐螑螒螔螕螖螘螙螚螛螜螝螞螠螡螢螣螤巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺�".split("");
- for(j = 0; j != D[206].length; ++j) if(D[206][j].charCodeAt(0) !== 0xFFFD) { e[D[206][j]] = 52736 + j; d[52736 + j] = D[206][j];}
- D[207] = "����������������������������������������������������������������螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁蟂蟃蟄蟅蟇蟈蟉蟌蟍蟎蟏蟐蟔蟕蟖蟗蟘蟙蟚蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯蟰蟱蟲蟳蟴蟵蟶蟷蟸�蟺蟻蟼蟽蟿蠀蠁蠂蠄蠅蠆蠇蠈蠉蠋蠌蠍蠎蠏蠐蠑蠒蠔蠗蠘蠙蠚蠜蠝蠞蠟蠠蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓�".split("");
- for(j = 0; j != D[207].length; ++j) if(D[207][j].charCodeAt(0) !== 0xFFFD) { e[D[207][j]] = 52992 + j; d[52992 + j] = D[207][j];}
- D[208] = "����������������������������������������������������������������蠤蠥蠦蠧蠨蠩蠪蠫蠬蠭蠮蠯蠰蠱蠳蠴蠵蠶蠷蠸蠺蠻蠽蠾蠿衁衂衃衆衇衈衉衊衋衎衏衐衑衒術衕衖衘衚衛衜衝衞衟衠衦衧衪衭衯衱衳衴衵衶衸衹衺�衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗袘袙袚袛袝袞袟袠袡袣袥袦袧袨袩袪小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄�".split("");
- for(j = 0; j != D[208].length; ++j) if(D[208][j].charCodeAt(0) !== 0xFFFD) { e[D[208][j]] = 53248 + j; d[53248 + j] = D[208][j];}
- D[209] = "����������������������������������������������������������������袬袮袯袰袲袳袴袵袶袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚裛補裝裞裠裡裦裧裩裪裫裬裭裮裯裲裵裶裷裺裻製裿褀褁褃褄褅褆複褈�褉褋褌褍褎褏褑褔褕褖褗褘褜褝褞褟褠褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶�".split("");
- for(j = 0; j != D[209].length; ++j) if(D[209][j].charCodeAt(0) !== 0xFFFD) { e[D[209][j]] = 53504 + j; d[53504 + j] = D[209][j];}
- D[210] = "����������������������������������������������������������������褸褹褺褻褼褽褾褿襀襂襃襅襆襇襈襉襊襋襌襍襎襏襐襑襒襓襔襕襖襗襘襙襚襛襜襝襠襡襢襣襤襥襧襨襩襪襫襬襭襮襯襰襱襲襳襴襵襶襷襸襹襺襼�襽襾覀覂覄覅覇覈覉覊見覌覍覎規覐覑覒覓覔覕視覗覘覙覚覛覜覝覞覟覠覡摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐�".split("");
- for(j = 0; j != D[210].length; ++j) if(D[210][j].charCodeAt(0) !== 0xFFFD) { e[D[210][j]] = 53760 + j; d[53760 + j] = D[210][j];}
- D[211] = "����������������������������������������������������������������覢覣覤覥覦覧覨覩親覫覬覭覮覯覰覱覲観覴覵覶覷覸覹覺覻覼覽覾覿觀觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴觵觶觷觸觹觺�觻觼觽觾觿訁訂訃訄訅訆計訉訊訋訌訍討訏訐訑訒訓訔訕訖託記訙訚訛訜訝印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉�".split("");
- for(j = 0; j != D[211].length; ++j) if(D[211][j].charCodeAt(0) !== 0xFFFD) { e[D[211][j]] = 54016 + j; d[54016 + j] = D[211][j];}
- D[212] = "����������������������������������������������������������������訞訟訠訡訢訣訤訥訦訧訨訩訪訫訬設訮訯訰許訲訳訴訵訶訷訸訹診註証訽訿詀詁詂詃詄詅詆詇詉詊詋詌詍詎詏詐詑詒詓詔評詖詗詘詙詚詛詜詝詞�詟詠詡詢詣詤詥試詧詨詩詪詫詬詭詮詯詰話該詳詴詵詶詷詸詺詻詼詽詾詿誀浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧�".split("");
- for(j = 0; j != D[212].length; ++j) if(D[212][j].charCodeAt(0) !== 0xFFFD) { e[D[212][j]] = 54272 + j; d[54272 + j] = D[212][j];}
- D[213] = "����������������������������������������������������������������誁誂誃誄誅誆誇誈誋誌認誎誏誐誑誒誔誕誖誗誘誙誚誛誜誝語誟誠誡誢誣誤誥誦誧誨誩說誫説読誮誯誰誱課誳誴誵誶誷誸誹誺誻誼誽誾調諀諁諂�諃諄諅諆談諈諉諊請諌諍諎諏諐諑諒諓諔諕論諗諘諙諚諛諜諝諞諟諠諡諢諣铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政�".split("");
- for(j = 0; j != D[213].length; ++j) if(D[213][j].charCodeAt(0) !== 0xFFFD) { e[D[213][j]] = 54528 + j; d[54528 + j] = D[213][j];}
- D[214] = "����������������������������������������������������������������諤諥諦諧諨諩諪諫諬諭諮諯諰諱諲諳諴諵諶諷諸諹諺諻諼諽諾諿謀謁謂謃謄謅謆謈謉謊謋謌謍謎謏謐謑謒謓謔謕謖謗謘謙謚講謜謝謞謟謠謡謢謣�謤謥謧謨謩謪謫謬謭謮謯謰謱謲謳謴謵謶謷謸謹謺謻謼謽謾謿譀譁譂譃譄譅帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑�".split("");
- for(j = 0; j != D[214].length; ++j) if(D[214][j].charCodeAt(0) !== 0xFFFD) { e[D[214][j]] = 54784 + j; d[54784 + j] = D[214][j];}
- D[215] = "����������������������������������������������������������������譆譇譈證譊譋譌譍譎譏譐譑譒譓譔譕譖譗識譙譚譛譜譝譞譟譠譡譢譣譤譥譧譨譩譪譫譭譮譯議譱譲譳譴譵譶護譸譹譺譻譼譽譾譿讀讁讂讃讄讅讆�讇讈讉變讋讌讍讎讏讐讑讒讓讔讕讖讗讘讙讚讛讜讝讞讟讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座������".split("");
- for(j = 0; j != D[215].length; ++j) if(D[215][j].charCodeAt(0) !== 0xFFFD) { e[D[215][j]] = 55040 + j; d[55040 + j] = D[215][j];}
- D[216] = "����������������������������������������������������������������谸谹谺谻谼谽谾谿豀豂豃豄豅豈豊豋豍豎豏豐豑豒豓豔豖豗豘豙豛豜豝豞豟豠豣豤豥豦豧豨豩豬豭豮豯豰豱豲豴豵豶豷豻豼豽豾豿貀貁貃貄貆貇�貈貋貍貎貏貐貑貒貓貕貖貗貙貚貛貜貝貞貟負財貢貣貤貥貦貧貨販貪貫責貭亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝�".split("");
- for(j = 0; j != D[216].length; ++j) if(D[216][j].charCodeAt(0) !== 0xFFFD) { e[D[216][j]] = 55296 + j; d[55296 + j] = D[216][j];}
- D[217] = "����������������������������������������������������������������貮貯貰貱貲貳貴貵貶買貸貹貺費貼貽貾貿賀賁賂賃賄賅賆資賈賉賊賋賌賍賎賏賐賑賒賓賔賕賖賗賘賙賚賛賜賝賞賟賠賡賢賣賤賥賦賧賨賩質賫賬�賭賮賯賰賱賲賳賴賵賶賷賸賹賺賻購賽賾賿贀贁贂贃贄贅贆贇贈贉贊贋贌贍佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼�".split("");
- for(j = 0; j != D[217].length; ++j) if(D[217][j].charCodeAt(0) !== 0xFFFD) { e[D[217][j]] = 55552 + j; d[55552 + j] = D[217][j];}
- D[218] = "����������������������������������������������������������������贎贏贐贑贒贓贔贕贖贗贘贙贚贛贜贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸赹赺赻赼赽赾赿趀趂趃趆趇趈趉趌趍趎趏趐趒趓趕趖趗趘趙趚趛趜趝趞趠趡�趢趤趥趦趧趨趩趪趫趬趭趮趯趰趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺�".split("");
- for(j = 0; j != D[218].length; ++j) if(D[218][j].charCodeAt(0) !== 0xFFFD) { e[D[218][j]] = 55808 + j; d[55808 + j] = D[218][j];}
- D[219] = "����������������������������������������������������������������跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾跿踀踁踂踃踄踆踇踈踋踍踎踐踑踒踓踕踖踗踘踙踚踛踜踠踡踤踥踦踧踨踫踭踰踲踳踴踶踷踸踻踼踾�踿蹃蹅蹆蹌蹍蹎蹏蹐蹓蹔蹕蹖蹗蹘蹚蹛蹜蹝蹞蹟蹠蹡蹢蹣蹤蹥蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝�".split("");
- for(j = 0; j != D[219].length; ++j) if(D[219][j].charCodeAt(0) !== 0xFFFD) { e[D[219][j]] = 56064 + j; d[56064 + j] = D[219][j];}
- D[220] = "����������������������������������������������������������������蹳蹵蹷蹸蹹蹺蹻蹽蹾躀躂躃躄躆躈躉躊躋躌躍躎躑躒躓躕躖躗躘躙躚躛躝躟躠躡躢躣躤躥躦躧躨躩躪躭躮躰躱躳躴躵躶躷躸躹躻躼躽躾躿軀軁軂�軃軄軅軆軇軈軉車軋軌軍軏軐軑軒軓軔軕軖軗軘軙軚軛軜軝軞軟軠軡転軣軤堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥�".split("");
- for(j = 0; j != D[220].length; ++j) if(D[220][j].charCodeAt(0) !== 0xFFFD) { e[D[220][j]] = 56320 + j; d[56320 + j] = D[220][j];}
- D[221] = "����������������������������������������������������������������軥軦軧軨軩軪軫軬軭軮軯軰軱軲軳軴軵軶軷軸軹軺軻軼軽軾軿輀輁輂較輄輅輆輇輈載輊輋輌輍輎輏輐輑輒輓輔輕輖輗輘輙輚輛輜輝輞輟輠輡輢輣�輤輥輦輧輨輩輪輫輬輭輮輯輰輱輲輳輴輵輶輷輸輹輺輻輼輽輾輿轀轁轂轃轄荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺�".split("");
- for(j = 0; j != D[221].length; ++j) if(D[221][j].charCodeAt(0) !== 0xFFFD) { e[D[221][j]] = 56576 + j; d[56576 + j] = D[221][j];}
- D[222] = "����������������������������������������������������������������轅轆轇轈轉轊轋轌轍轎轏轐轑轒轓轔轕轖轗轘轙轚轛轜轝轞轟轠轡轢轣轤轥轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆�迉迊迋迌迍迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖�".split("");
- for(j = 0; j != D[222].length; ++j) if(D[222][j].charCodeAt(0) !== 0xFFFD) { e[D[222][j]] = 56832 + j; d[56832 + j] = D[222][j];}
- D[223] = "����������������������������������������������������������������這逜連逤逥逧逨逩逪逫逬逰週進逳逴逷逹逺逽逿遀遃遅遆遈遉遊運遌過達違遖遙遚遜遝遞遟遠遡遤遦遧適遪遫遬遯遰遱遲遳遶遷選遹遺遻遼遾邁�還邅邆邇邉邊邌邍邎邏邐邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼�".split("");
- for(j = 0; j != D[223].length; ++j) if(D[223][j].charCodeAt(0) !== 0xFFFD) { e[D[223][j]] = 57088 + j; d[57088 + j] = D[223][j];}
- D[224] = "����������������������������������������������������������������郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅鄆鄇鄈鄉鄊鄋鄌鄍鄎鄏鄐鄑鄒鄓鄔鄕鄖鄗鄘鄚鄛鄜�鄝鄟鄠鄡鄤鄥鄦鄧鄨鄩鄪鄫鄬鄭鄮鄰鄲鄳鄴鄵鄶鄷鄸鄺鄻鄼鄽鄾鄿酀酁酂酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼�".split("");
- for(j = 0; j != D[224].length; ++j) if(D[224][j].charCodeAt(0) !== 0xFFFD) { e[D[224][j]] = 57344 + j; d[57344 + j] = D[224][j];}
- D[225] = "����������������������������������������������������������������酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀醁醂醃醄醆醈醊醎醏醓醔醕醖醗醘醙醜醝醞醟醠醡醤醥醦醧醨醩醫醬醰醱醲醳醶醷醸醹醻�醼醽醾醿釀釁釂釃釄釅釆釈釋釐釒釓釔釕釖釗釘釙釚釛針釞釟釠釡釢釣釤釥帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺�".split("");
- for(j = 0; j != D[225].length; ++j) if(D[225][j].charCodeAt(0) !== 0xFFFD) { e[D[225][j]] = 57600 + j; d[57600 + j] = D[225][j];}
- D[226] = "����������������������������������������������������������������釦釧釨釩釪釫釬釭釮釯釰釱釲釳釴釵釶釷釸釹釺釻釼釽釾釿鈀鈁鈂鈃鈄鈅鈆鈇鈈鈉鈊鈋鈌鈍鈎鈏鈐鈑鈒鈓鈔鈕鈖鈗鈘鈙鈚鈛鈜鈝鈞鈟鈠鈡鈢鈣鈤�鈥鈦鈧鈨鈩鈪鈫鈬鈭鈮鈯鈰鈱鈲鈳鈴鈵鈶鈷鈸鈹鈺鈻鈼鈽鈾鈿鉀鉁鉂鉃鉄鉅狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧饨饩饪饫饬饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂�".split("");
- for(j = 0; j != D[226].length; ++j) if(D[226][j].charCodeAt(0) !== 0xFFFD) { e[D[226][j]] = 57856 + j; d[57856 + j] = D[226][j];}
- D[227] = "����������������������������������������������������������������鉆鉇鉈鉉鉊鉋鉌鉍鉎鉏鉐鉑鉒鉓鉔鉕鉖鉗鉘鉙鉚鉛鉜鉝鉞鉟鉠鉡鉢鉣鉤鉥鉦鉧鉨鉩鉪鉫鉬鉭鉮鉯鉰鉱鉲鉳鉵鉶鉷鉸鉹鉺鉻鉼鉽鉾鉿銀銁銂銃銄銅�銆銇銈銉銊銋銌銍銏銐銑銒銓銔銕銖銗銘銙銚銛銜銝銞銟銠銡銢銣銤銥銦銧恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾�".split("");
- for(j = 0; j != D[227].length; ++j) if(D[227][j].charCodeAt(0) !== 0xFFFD) { e[D[227][j]] = 58112 + j; d[58112 + j] = D[227][j];}
- D[228] = "����������������������������������������������������������������銨銩銪銫銬銭銯銰銱銲銳銴銵銶銷銸銹銺銻銼銽銾銿鋀鋁鋂鋃鋄鋅鋆鋇鋉鋊鋋鋌鋍鋎鋏鋐鋑鋒鋓鋔鋕鋖鋗鋘鋙鋚鋛鋜鋝鋞鋟鋠鋡鋢鋣鋤鋥鋦鋧鋨�鋩鋪鋫鋬鋭鋮鋯鋰鋱鋲鋳鋴鋵鋶鋷鋸鋹鋺鋻鋼鋽鋾鋿錀錁錂錃錄錅錆錇錈錉洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑�".split("");
- for(j = 0; j != D[228].length; ++j) if(D[228][j].charCodeAt(0) !== 0xFFFD) { e[D[228][j]] = 58368 + j; d[58368 + j] = D[228][j];}
- D[229] = "����������������������������������������������������������������錊錋錌錍錎錏錐錑錒錓錔錕錖錗錘錙錚錛錜錝錞錟錠錡錢錣錤錥錦錧錨錩錪錫錬錭錮錯錰錱録錳錴錵錶錷錸錹錺錻錼錽錿鍀鍁鍂鍃鍄鍅鍆鍇鍈鍉�鍊鍋鍌鍍鍎鍏鍐鍑鍒鍓鍔鍕鍖鍗鍘鍙鍚鍛鍜鍝鍞鍟鍠鍡鍢鍣鍤鍥鍦鍧鍨鍩鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣�".split("");
- for(j = 0; j != D[229].length; ++j) if(D[229][j].charCodeAt(0) !== 0xFFFD) { e[D[229][j]] = 58624 + j; d[58624 + j] = D[229][j];}
- D[230] = "����������������������������������������������������������������鍬鍭鍮鍯鍰鍱鍲鍳鍴鍵鍶鍷鍸鍹鍺鍻鍼鍽鍾鍿鎀鎁鎂鎃鎄鎅鎆鎇鎈鎉鎊鎋鎌鎍鎎鎐鎑鎒鎓鎔鎕鎖鎗鎘鎙鎚鎛鎜鎝鎞鎟鎠鎡鎢鎣鎤鎥鎦鎧鎨鎩鎪鎫�鎬鎭鎮鎯鎰鎱鎲鎳鎴鎵鎶鎷鎸鎹鎺鎻鎼鎽鎾鎿鏀鏁鏂鏃鏄鏅鏆鏇鏈鏉鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩�".split("");
- for(j = 0; j != D[230].length; ++j) if(D[230][j].charCodeAt(0) !== 0xFFFD) { e[D[230][j]] = 58880 + j; d[58880 + j] = D[230][j];}
- D[231] = "����������������������������������������������������������������鏎鏏鏐鏑鏒鏓鏔鏕鏗鏘鏙鏚鏛鏜鏝鏞鏟鏠鏡鏢鏣鏤鏥鏦鏧鏨鏩鏪鏫鏬鏭鏮鏯鏰鏱鏲鏳鏴鏵鏶鏷鏸鏹鏺鏻鏼鏽鏾鏿鐀鐁鐂鐃鐄鐅鐆鐇鐈鐉鐊鐋鐌鐍�鐎鐏鐐鐑鐒鐓鐔鐕鐖鐗鐘鐙鐚鐛鐜鐝鐞鐟鐠鐡鐢鐣鐤鐥鐦鐧鐨鐩鐪鐫鐬鐭鐮纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡缢缣缤缥缦缧缪缫缬缭缯缰缱缲缳缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬�".split("");
- for(j = 0; j != D[231].length; ++j) if(D[231][j].charCodeAt(0) !== 0xFFFD) { e[D[231][j]] = 59136 + j; d[59136 + j] = D[231][j];}
- D[232] = "����������������������������������������������������������������鐯鐰鐱鐲鐳鐴鐵鐶鐷鐸鐹鐺鐻鐼鐽鐿鑀鑁鑂鑃鑄鑅鑆鑇鑈鑉鑊鑋鑌鑍鑎鑏鑐鑑鑒鑓鑔鑕鑖鑗鑘鑙鑚鑛鑜鑝鑞鑟鑠鑡鑢鑣鑤鑥鑦鑧鑨鑩鑪鑬鑭鑮鑯�鑰鑱鑲鑳鑴鑵鑶鑷鑸鑹鑺鑻鑼鑽鑾鑿钀钁钂钃钄钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹�".split("");
- for(j = 0; j != D[232].length; ++j) if(D[232][j].charCodeAt(0) !== 0xFFFD) { e[D[232][j]] = 59392 + j; d[59392 + j] = D[232][j];}
- D[233] = "����������������������������������������������������������������锧锳锽镃镈镋镕镚镠镮镴镵長镸镹镺镻镼镽镾門閁閂閃閄閅閆閇閈閉閊開閌閍閎閏閐閑閒間閔閕閖閗閘閙閚閛閜閝閞閟閠閡関閣閤閥閦閧閨閩閪�閫閬閭閮閯閰閱閲閳閴閵閶閷閸閹閺閻閼閽閾閿闀闁闂闃闄闅闆闇闈闉闊闋椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋�".split("");
- for(j = 0; j != D[233].length; ++j) if(D[233][j].charCodeAt(0) !== 0xFFFD) { e[D[233][j]] = 59648 + j; d[59648 + j] = D[233][j];}
- D[234] = "����������������������������������������������������������������闌闍闎闏闐闑闒闓闔闕闖闗闘闙闚闛關闝闞闟闠闡闢闣闤闥闦闧闬闿阇阓阘阛阞阠阣阤阥阦阧阨阩阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗�陘陙陚陜陝陞陠陣陥陦陫陭陮陯陰陱陳陸陹険陻陼陽陾陿隀隁隂隃隄隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰�".split("");
- for(j = 0; j != D[234].length; ++j) if(D[234][j].charCodeAt(0) !== 0xFFFD) { e[D[234][j]] = 59904 + j; d[59904 + j] = D[234][j];}
- D[235] = "����������������������������������������������������������������隌階隑隒隓隕隖隚際隝隞隟隠隡隢隣隤隥隦隨隩險隫隬隭隮隯隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖雗雘雙雚雛雜雝雞雟雡離難雤雥雦雧雫�雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗霘霙霚霛霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻�".split("");
- for(j = 0; j != D[235].length; ++j) if(D[235][j].charCodeAt(0) !== 0xFFFD) { e[D[235][j]] = 60160 + j; d[60160 + j] = D[235][j];}
- D[236] = "����������������������������������������������������������������霡霢霣霤霥霦霧霨霩霫霬霮霯霱霳霴霵霶霷霺霻霼霽霿靀靁靂靃靄靅靆靇靈靉靊靋靌靍靎靏靐靑靔靕靗靘靚靜靝靟靣靤靦靧靨靪靫靬靭靮靯靰靱�靲靵靷靸靹靺靻靽靾靿鞀鞁鞂鞃鞄鞆鞇鞈鞉鞊鞌鞎鞏鞐鞓鞕鞖鞗鞙鞚鞛鞜鞝臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐�".split("");
- for(j = 0; j != D[236].length; ++j) if(D[236][j].charCodeAt(0) !== 0xFFFD) { e[D[236][j]] = 60416 + j; d[60416 + j] = D[236][j];}
- D[237] = "����������������������������������������������������������������鞞鞟鞡鞢鞤鞥鞦鞧鞨鞩鞪鞬鞮鞰鞱鞳鞵鞶鞷鞸鞹鞺鞻鞼鞽鞾鞿韀韁韂韃韄韅韆韇韈韉韊韋韌韍韎韏韐韑韒韓韔韕韖韗韘韙韚韛韜韝韞韟韠韡韢韣�韤韥韨韮韯韰韱韲韴韷韸韹韺韻韼韽韾響頀頁頂頃頄項順頇須頉頊頋頌頍頎怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨�".split("");
- for(j = 0; j != D[237].length; ++j) if(D[237][j].charCodeAt(0) !== 0xFFFD) { e[D[237][j]] = 60672 + j; d[60672 + j] = D[237][j];}
- D[238] = "����������������������������������������������������������������頏預頑頒頓頔頕頖頗領頙頚頛頜頝頞頟頠頡頢頣頤頥頦頧頨頩頪頫頬頭頮頯頰頱頲頳頴頵頶頷頸頹頺頻頼頽頾頿顀顁顂顃顄顅顆顇顈顉顊顋題額�顎顏顐顑顒顓顔顕顖顗願顙顚顛顜顝類顟顠顡顢顣顤顥顦顧顨顩顪顫顬顭顮睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶钷钸钹钺钼钽钿铄铈铉铊铋铌铍铎铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪�".split("");
- for(j = 0; j != D[238].length; ++j) if(D[238][j].charCodeAt(0) !== 0xFFFD) { e[D[238][j]] = 60928 + j; d[60928 + j] = D[238][j];}
- D[239] = "����������������������������������������������������������������顯顰顱顲顳顴颋颎颒颕颙颣風颩颪颫颬颭颮颯颰颱颲颳颴颵颶颷颸颹颺颻颼颽颾颿飀飁飂飃飄飅飆飇飈飉飊飋飌飍飏飐飔飖飗飛飜飝飠飡飢飣飤�飥飦飩飪飫飬飭飮飯飰飱飲飳飴飵飶飷飸飹飺飻飼飽飾飿餀餁餂餃餄餅餆餇铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒锓锔锕锖锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤镥镦镧镨镩镪镫镬镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔�".split("");
- for(j = 0; j != D[239].length; ++j) if(D[239][j].charCodeAt(0) !== 0xFFFD) { e[D[239][j]] = 61184 + j; d[61184 + j] = D[239][j];}
- D[240] = "����������������������������������������������������������������餈餉養餋餌餎餏餑餒餓餔餕餖餗餘餙餚餛餜餝餞餟餠餡餢餣餤餥餦餧館餩餪餫餬餭餯餰餱餲餳餴餵餶餷餸餹餺餻餼餽餾餿饀饁饂饃饄饅饆饇饈饉�饊饋饌饍饎饏饐饑饒饓饖饗饘饙饚饛饜饝饞饟饠饡饢饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨鸩鸪鸫鸬鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦鹧鹨鹩鹪鹫鹬鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙�".split("");
- for(j = 0; j != D[240].length; ++j) if(D[240][j].charCodeAt(0) !== 0xFFFD) { e[D[240][j]] = 61440 + j; d[61440 + j] = D[240][j];}
- D[241] = "����������������������������������������������������������������馌馎馚馛馜馝馞馟馠馡馢馣馤馦馧馩馪馫馬馭馮馯馰馱馲馳馴馵馶馷馸馹馺馻馼馽馾馿駀駁駂駃駄駅駆駇駈駉駊駋駌駍駎駏駐駑駒駓駔駕駖駗駘�駙駚駛駜駝駞駟駠駡駢駣駤駥駦駧駨駩駪駫駬駭駮駯駰駱駲駳駴駵駶駷駸駹瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃�".split("");
- for(j = 0; j != D[241].length; ++j) if(D[241][j].charCodeAt(0) !== 0xFFFD) { e[D[241][j]] = 61696 + j; d[61696 + j] = D[241][j];}
- D[242] = "����������������������������������������������������������������駺駻駼駽駾駿騀騁騂騃騄騅騆騇騈騉騊騋騌騍騎騏騐騑騒験騔騕騖騗騘騙騚騛騜騝騞騟騠騡騢騣騤騥騦騧騨騩騪騫騬騭騮騯騰騱騲騳騴騵騶騷騸�騹騺騻騼騽騾騿驀驁驂驃驄驅驆驇驈驉驊驋驌驍驎驏驐驑驒驓驔驕驖驗驘驙颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒�".split("");
- for(j = 0; j != D[242].length; ++j) if(D[242][j].charCodeAt(0) !== 0xFFFD) { e[D[242][j]] = 61952 + j; d[61952 + j] = D[242][j];}
- D[243] = "����������������������������������������������������������������驚驛驜驝驞驟驠驡驢驣驤驥驦驧驨驩驪驫驲骃骉骍骎骔骕骙骦骩骪骫骬骭骮骯骲骳骴骵骹骻骽骾骿髃髄髆髇髈髉髊髍髎髏髐髒體髕髖髗髙髚髛髜�髝髞髠髢髣髤髥髧髨髩髪髬髮髰髱髲髳髴髵髶髷髸髺髼髽髾髿鬀鬁鬂鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋�".split("");
- for(j = 0; j != D[243].length; ++j) if(D[243][j].charCodeAt(0) !== 0xFFFD) { e[D[243][j]] = 62208 + j; d[62208 + j] = D[243][j];}
- D[244] = "����������������������������������������������������������������鬇鬉鬊鬋鬌鬍鬎鬐鬑鬒鬔鬕鬖鬗鬘鬙鬚鬛鬜鬝鬞鬠鬡鬢鬤鬥鬦鬧鬨鬩鬪鬫鬬鬭鬮鬰鬱鬳鬴鬵鬶鬷鬸鬹鬺鬽鬾鬿魀魆魊魋魌魎魐魒魓魕魖魗魘魙魚�魛魜魝魞魟魠魡魢魣魤魥魦魧魨魩魪魫魬魭魮魯魰魱魲魳魴魵魶魷魸魹魺魻簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤�".split("");
- for(j = 0; j != D[244].length; ++j) if(D[244][j].charCodeAt(0) !== 0xFFFD) { e[D[244][j]] = 62464 + j; d[62464 + j] = D[244][j];}
- D[245] = "����������������������������������������������������������������魼魽魾魿鮀鮁鮂鮃鮄鮅鮆鮇鮈鮉鮊鮋鮌鮍鮎鮏鮐鮑鮒鮓鮔鮕鮖鮗鮘鮙鮚鮛鮜鮝鮞鮟鮠鮡鮢鮣鮤鮥鮦鮧鮨鮩鮪鮫鮬鮭鮮鮯鮰鮱鮲鮳鮴鮵鮶鮷鮸鮹鮺�鮻鮼鮽鮾鮿鯀鯁鯂鯃鯄鯅鯆鯇鯈鯉鯊鯋鯌鯍鯎鯏鯐鯑鯒鯓鯔鯕鯖鯗鯘鯙鯚鯛酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜�".split("");
- for(j = 0; j != D[245].length; ++j) if(D[245][j].charCodeAt(0) !== 0xFFFD) { e[D[245][j]] = 62720 + j; d[62720 + j] = D[245][j];}
- D[246] = "����������������������������������������������������������������鯜鯝鯞鯟鯠鯡鯢鯣鯤鯥鯦鯧鯨鯩鯪鯫鯬鯭鯮鯯鯰鯱鯲鯳鯴鯵鯶鯷鯸鯹鯺鯻鯼鯽鯾鯿鰀鰁鰂鰃鰄鰅鰆鰇鰈鰉鰊鰋鰌鰍鰎鰏鰐鰑鰒鰓鰔鰕鰖鰗鰘鰙鰚�鰛鰜鰝鰞鰟鰠鰡鰢鰣鰤鰥鰦鰧鰨鰩鰪鰫鰬鰭鰮鰯鰰鰱鰲鰳鰴鰵鰶鰷鰸鰹鰺鰻觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅龆龇龈龉龊龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞鲟鲠鲡鲢鲣鲥鲦鲧鲨鲩鲫鲭鲮鲰鲱鲲鲳鲴鲵鲶鲷鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋�".split("");
- for(j = 0; j != D[246].length; ++j) if(D[246][j].charCodeAt(0) !== 0xFFFD) { e[D[246][j]] = 62976 + j; d[62976 + j] = D[246][j];}
- D[247] = "����������������������������������������������������������������鰼鰽鰾鰿鱀鱁鱂鱃鱄鱅鱆鱇鱈鱉鱊鱋鱌鱍鱎鱏鱐鱑鱒鱓鱔鱕鱖鱗鱘鱙鱚鱛鱜鱝鱞鱟鱠鱡鱢鱣鱤鱥鱦鱧鱨鱩鱪鱫鱬鱭鱮鱯鱰鱱鱲鱳鱴鱵鱶鱷鱸鱹鱺�鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾鲿鳀鳁鳂鳈鳉鳑鳒鳚鳛鳠鳡鳌鳍鳎鳏鳐鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄�".split("");
- for(j = 0; j != D[247].length; ++j) if(D[247][j].charCodeAt(0) !== 0xFFFD) { e[D[247][j]] = 63232 + j; d[63232 + j] = D[247][j];}
- D[248] = "����������������������������������������������������������������鳣鳤鳥鳦鳧鳨鳩鳪鳫鳬鳭鳮鳯鳰鳱鳲鳳鳴鳵鳶鳷鳸鳹鳺鳻鳼鳽鳾鳿鴀鴁鴂鴃鴄鴅鴆鴇鴈鴉鴊鴋鴌鴍鴎鴏鴐鴑鴒鴓鴔鴕鴖鴗鴘鴙鴚鴛鴜鴝鴞鴟鴠鴡�鴢鴣鴤鴥鴦鴧鴨鴩鴪鴫鴬鴭鴮鴯鴰鴱鴲鴳鴴鴵鴶鴷鴸鴹鴺鴻鴼鴽鴾鴿鵀鵁鵂�����������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[248].length; ++j) if(D[248][j].charCodeAt(0) !== 0xFFFD) { e[D[248][j]] = 63488 + j; d[63488 + j] = D[248][j];}
- D[249] = "����������������������������������������������������������������鵃鵄鵅鵆鵇鵈鵉鵊鵋鵌鵍鵎鵏鵐鵑鵒鵓鵔鵕鵖鵗鵘鵙鵚鵛鵜鵝鵞鵟鵠鵡鵢鵣鵤鵥鵦鵧鵨鵩鵪鵫鵬鵭鵮鵯鵰鵱鵲鵳鵴鵵鵶鵷鵸鵹鵺鵻鵼鵽鵾鵿鶀鶁�鶂鶃鶄鶅鶆鶇鶈鶉鶊鶋鶌鶍鶎鶏鶐鶑鶒鶓鶔鶕鶖鶗鶘鶙鶚鶛鶜鶝鶞鶟鶠鶡鶢�����������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[249].length; ++j) if(D[249][j].charCodeAt(0) !== 0xFFFD) { e[D[249][j]] = 63744 + j; d[63744 + j] = D[249][j];}
- D[250] = "����������������������������������������������������������������鶣鶤鶥鶦鶧鶨鶩鶪鶫鶬鶭鶮鶯鶰鶱鶲鶳鶴鶵鶶鶷鶸鶹鶺鶻鶼鶽鶾鶿鷀鷁鷂鷃鷄鷅鷆鷇鷈鷉鷊鷋鷌鷍鷎鷏鷐鷑鷒鷓鷔鷕鷖鷗鷘鷙鷚鷛鷜鷝鷞鷟鷠鷡�鷢鷣鷤鷥鷦鷧鷨鷩鷪鷫鷬鷭鷮鷯鷰鷱鷲鷳鷴鷵鷶鷷鷸鷹鷺鷻鷼鷽鷾鷿鸀鸁鸂�����������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[250].length; ++j) if(D[250][j].charCodeAt(0) !== 0xFFFD) { e[D[250][j]] = 64000 + j; d[64000 + j] = D[250][j];}
- D[251] = "����������������������������������������������������������������鸃鸄鸅鸆鸇鸈鸉鸊鸋鸌鸍鸎鸏鸐鸑鸒鸓鸔鸕鸖鸗鸘鸙鸚鸛鸜鸝鸞鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴鹵鹶鹷鹸鹹鹺鹻鹼鹽麀�麁麃麄麅麆麉麊麌麍麎麏麐麑麔麕麖麗麘麙麚麛麜麞麠麡麢麣麤麥麧麨麩麪�����������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[251].length; ++j) if(D[251][j].charCodeAt(0) !== 0xFFFD) { e[D[251][j]] = 64256 + j; d[64256 + j] = D[251][j];}
- D[252] = "����������������������������������������������������������������麫麬麭麮麯麰麱麲麳麵麶麷麹麺麼麿黀黁黂黃黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰黱黲黳黴黵黶黷黸黺黽黿鼀鼁鼂鼃鼄鼅�鼆鼇鼈鼉鼊鼌鼏鼑鼒鼔鼕鼖鼘鼚鼛鼜鼝鼞鼟鼡鼣鼤鼥鼦鼧鼨鼩鼪鼫鼭鼮鼰鼱�����������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[252].length; ++j) if(D[252][j].charCodeAt(0) !== 0xFFFD) { e[D[252][j]] = 64512 + j; d[64512 + j] = D[252][j];}
- D[253] = "����������������������������������������������������������������鼲鼳鼴鼵鼶鼸鼺鼼鼿齀齁齂齃齅齆齇齈齉齊齋齌齍齎齏齒齓齔齕齖齗齘齙齚齛齜齝齞齟齠齡齢齣齤齥齦齧齨齩齪齫齬齭齮齯齰齱齲齳齴齵齶齷齸�齹齺齻齼齽齾龁龂龍龎龏龐龑龒龓龔龕龖龗龘龜龝龞龡龢龣龤龥郎凉秊裏隣�����������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[253].length; ++j) if(D[253][j].charCodeAt(0) !== 0xFFFD) { e[D[253][j]] = 64768 + j; d[64768 + j] = D[253][j];}
- D[254] = "����������������������������������������������������������������兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[254].length; ++j) if(D[254][j].charCodeAt(0) !== 0xFFFD) { e[D[254][j]] = 65024 + j; d[65024 + j] = D[254][j];}
- return {"enc": e, "dec": d }; })();
- cptable[949] = (function(){ var d = [], e = {}, D = [], j;
- D[0] = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[0].length; ++j) if(D[0][j].charCodeAt(0) !== 0xFFFD) { e[D[0][j]] = 0 + j; d[0 + j] = D[0][j];}
- D[129] = "�����������������������������������������������������������������갂갃갅갆갋갌갍갎갏갘갞갟갡갢갣갥갦갧갨갩갪갫갮갲갳갴������갵갶갷갺갻갽갾갿걁걂걃걄걅걆걇걈걉걊걌걎걏걐걑걒걓걕������걖걗걙걚걛걝걞걟걠걡걢걣걤걥걦걧걨걩걪걫걬걭걮걯걲걳걵걶걹걻걼걽걾걿겂겇겈겍겎겏겑겒겓겕겖겗겘겙겚겛겞겢겣겤겥겦겧겫겭겮겱겲겳겴겵겶겷겺겾겿곀곂곃곅곆곇곉곊곋곍곎곏곐곑곒곓곔곖곘곙곚곛곜곝곞곟곢곣곥곦곩곫곭곮곲곴곷곸곹곺곻곾곿괁괂괃괅괇괈괉괊괋괎괐괒괓�".split("");
- for(j = 0; j != D[129].length; ++j) if(D[129][j].charCodeAt(0) !== 0xFFFD) { e[D[129][j]] = 33024 + j; d[33024 + j] = D[129][j];}
- D[130] = "�����������������������������������������������������������������괔괕괖괗괙괚괛괝괞괟괡괢괣괤괥괦괧괨괪괫괮괯괰괱괲괳������괶괷괹괺괻괽괾괿굀굁굂굃굆굈굊굋굌굍굎굏굑굒굓굕굖굗������굙굚굛굜굝굞굟굠굢굤굥굦굧굨굩굪굫굮굯굱굲굷굸굹굺굾궀궃궄궅궆궇궊궋궍궎궏궑궒궓궔궕궖궗궘궙궚궛궞궟궠궡궢궣궥궦궧궨궩궪궫궬궭궮궯궰궱궲궳궴궵궶궸궹궺궻궼궽궾궿귂귃귅귆귇귉귊귋귌귍귎귏귒귔귕귖귗귘귙귚귛귝귞귟귡귢귣귥귦귧귨귩귪귫귬귭귮귯귰귱귲귳귴귵귶귷�".split("");
- for(j = 0; j != D[130].length; ++j) if(D[130][j].charCodeAt(0) !== 0xFFFD) { e[D[130][j]] = 33280 + j; d[33280 + j] = D[130][j];}
- D[131] = "�����������������������������������������������������������������귺귻귽귾긂긃긄긅긆긇긊긌긎긏긐긑긒긓긕긖긗긘긙긚긛긜������긝긞긟긠긡긢긣긤긥긦긧긨긩긪긫긬긭긮긯긲긳긵긶긹긻긼������긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗깘깙깚깛깞깢깣깤깦깧깪깫깭깮깯깱깲깳깴깵깶깷깺깾깿꺀꺁꺂꺃꺆꺇꺈꺉꺊꺋꺍꺎꺏꺐꺑꺒꺓꺔꺕꺖꺗꺘꺙꺚꺛꺜꺝꺞꺟꺠꺡꺢꺣꺤꺥꺦꺧꺨꺩꺪꺫꺬꺭꺮꺯꺰꺱꺲꺳꺴꺵꺶꺷꺸꺹꺺꺻꺿껁껂껃껅껆껇껈껉껊껋껎껒껓껔껕껖껗껚껛껝껞껟껠껡껢껣껤껥�".split("");
- for(j = 0; j != D[131].length; ++j) if(D[131][j].charCodeAt(0) !== 0xFFFD) { e[D[131][j]] = 33536 + j; d[33536 + j] = D[131][j];}
- D[132] = "�����������������������������������������������������������������껦껧껩껪껬껮껯껰껱껲껳껵껶껷껹껺껻껽껾껿꼀꼁꼂꼃꼄꼅������꼆꼉꼊꼋꼌꼎꼏꼑꼒꼓꼔꼕꼖꼗꼘꼙꼚꼛꼜꼝꼞꼟꼠꼡꼢꼣������꼤꼥꼦꼧꼨꼩꼪꼫꼮꼯꼱꼳꼵꼶꼷꼸꼹꼺꼻꼾꽀꽄꽅꽆꽇꽊꽋꽌꽍꽎꽏꽑꽒꽓꽔꽕꽖꽗꽘꽙꽚꽛꽞꽟꽠꽡꽢꽣꽦꽧꽨꽩꽪꽫꽬꽭꽮꽯꽰꽱꽲꽳꽴꽵꽶꽷꽸꽺꽻꽼꽽꽾꽿꾁꾂꾃꾅꾆꾇꾉꾊꾋꾌꾍꾎꾏꾒꾓꾔꾖꾗꾘꾙꾚꾛꾝꾞꾟꾠꾡꾢꾣꾤꾥꾦꾧꾨꾩꾪꾫꾬꾭꾮꾯꾰꾱꾲꾳꾴꾵꾶꾷꾺꾻꾽꾾�".split("");
- for(j = 0; j != D[132].length; ++j) if(D[132][j].charCodeAt(0) !== 0xFFFD) { e[D[132][j]] = 33792 + j; d[33792 + j] = D[132][j];}
- D[133] = "�����������������������������������������������������������������꾿꿁꿂꿃꿄꿅꿆꿊꿌꿏꿐꿑꿒꿓꿕꿖꿗꿘꿙꿚꿛꿝꿞꿟꿠꿡������꿢꿣꿤꿥꿦꿧꿪꿫꿬꿭꿮꿯꿲꿳꿵꿶꿷꿹꿺꿻꿼꿽꿾꿿뀂뀃������뀅뀆뀇뀈뀉뀊뀋뀍뀎뀏뀑뀒뀓뀕뀖뀗뀘뀙뀚뀛뀞뀟뀠뀡뀢뀣뀤뀥뀦뀧뀩뀪뀫뀬뀭뀮뀯뀰뀱뀲뀳뀴뀵뀶뀷뀸뀹뀺뀻뀼뀽뀾뀿끀끁끂끃끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞끟끠끡끢끣끤끥끦끧끨끩끪끫끬끭끮끯끰끱끲끳끴끵끶끷끸끹끺끻끾끿낁낂낃낅낆낇낈낉낊낋낎낐낒낓낔낕낖낗낛낝낞낣낤�".split("");
- for(j = 0; j != D[133].length; ++j) if(D[133][j].charCodeAt(0) !== 0xFFFD) { e[D[133][j]] = 34048 + j; d[34048 + j] = D[133][j];}
- D[134] = "�����������������������������������������������������������������낥낦낧낪낰낲낶낷낹낺낻낽낾낿냀냁냂냃냆냊냋냌냍냎냏냒������냓냕냖냗냙냚냛냜냝냞냟냡냢냣냤냦냧냨냩냪냫냬냭냮냯냰������냱냲냳냴냵냶냷냸냹냺냻냼냽냾냿넀넁넂넃넄넅넆넇넊넍넎넏넑넔넕넖넗넚넞넟넠넡넢넦넧넩넪넫넭넮넯넰넱넲넳넶넺넻넼넽넾넿녂녃녅녆녇녉녊녋녌녍녎녏녒녓녖녗녙녚녛녝녞녟녡녢녣녤녥녦녧녨녩녪녫녬녭녮녯녰녱녲녳녴녵녶녷녺녻녽녾녿놁놃놄놅놆놇놊놌놎놏놐놑놕놖놗놙놚놛놝�".split("");
- for(j = 0; j != D[134].length; ++j) if(D[134][j].charCodeAt(0) !== 0xFFFD) { e[D[134][j]] = 34304 + j; d[34304 + j] = D[134][j];}
- D[135] = "�����������������������������������������������������������������놞놟놠놡놢놣놤놥놦놧놩놪놫놬놭놮놯놰놱놲놳놴놵놶놷놸������놹놺놻놼놽놾놿뇀뇁뇂뇃뇄뇅뇆뇇뇈뇉뇊뇋뇍뇎뇏뇑뇒뇓뇕������뇖뇗뇘뇙뇚뇛뇞뇠뇡뇢뇣뇤뇥뇦뇧뇪뇫뇭뇮뇯뇱뇲뇳뇴뇵뇶뇷뇸뇺뇼뇾뇿눀눁눂눃눆눇눉눊눍눎눏눐눑눒눓눖눘눚눛눜눝눞눟눡눢눣눤눥눦눧눨눩눪눫눬눭눮눯눰눱눲눳눵눶눷눸눹눺눻눽눾눿뉀뉁뉂뉃뉄뉅뉆뉇뉈뉉뉊뉋뉌뉍뉎뉏뉐뉑뉒뉓뉔뉕뉖뉗뉙뉚뉛뉝뉞뉟뉡뉢뉣뉤뉥뉦뉧뉪뉫뉬뉭뉮�".split("");
- for(j = 0; j != D[135].length; ++j) if(D[135][j].charCodeAt(0) !== 0xFFFD) { e[D[135][j]] = 34560 + j; d[34560 + j] = D[135][j];}
- D[136] = "�����������������������������������������������������������������뉯뉰뉱뉲뉳뉶뉷뉸뉹뉺뉻뉽뉾뉿늀늁늂늃늆늇늈늊늋늌늍늎������늏늒늓늕늖늗늛늜늝늞늟늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷������늸늹늺늻늼늽늾늿닀닁닂닃닄닅닆닇닊닋닍닎닏닑닓닔닕닖닗닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉댊댋댌댍댎댏댒댖댗댘댙댚댛댝댞댟댠댡댢댣댤댥댦댧댨댩댪댫댬댭댮댯댰댱댲댳댴댵댶댷댸댹댺댻댼댽댾댿덀덁덂덃덄덅덆덇덈덉덊덋덌덍덎덏덐덑덒덓덗덙덚덝덠덡덢덣�".split("");
- for(j = 0; j != D[136].length; ++j) if(D[136][j].charCodeAt(0) !== 0xFFFD) { e[D[136][j]] = 34816 + j; d[34816 + j] = D[136][j];}
- D[137] = "�����������������������������������������������������������������덦덨덪덬덭덯덲덳덵덶덷덹덺덻덼덽덾덿뎂뎆뎇뎈뎉뎊뎋뎍������뎎뎏뎑뎒뎓뎕뎖뎗뎘뎙뎚뎛뎜뎝뎞뎟뎢뎣뎤뎥뎦뎧뎩뎪뎫뎭������뎮뎯뎰뎱뎲뎳뎴뎵뎶뎷뎸뎹뎺뎻뎼뎽뎾뎿돀돁돂돃돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩돪돫돬돭돮돯돰돱돲돳돴돵돶돷돸돹돺돻돽돾돿됀됁됂됃됄됅됆됇됈됉됊됋됌됍됎됏됑됒됓됔됕됖됗됙됚됛됝됞됟됡됢됣됤됥됦됧됪됬됭됮됯됰됱됲됳됵됶됷됸됹됺됻됼됽됾됿둀둁둂둃둄�".split("");
- for(j = 0; j != D[137].length; ++j) if(D[137][j].charCodeAt(0) !== 0xFFFD) { e[D[137][j]] = 35072 + j; d[35072 + j] = D[137][j];}
- D[138] = "�����������������������������������������������������������������둅둆둇둈둉둊둋둌둍둎둏둒둓둕둖둗둙둚둛둜둝둞둟둢둤둦������둧둨둩둪둫둭둮둯둰둱둲둳둴둵둶둷둸둹둺둻둼둽둾둿뒁뒂������뒃뒄뒅뒆뒇뒉뒊뒋뒌뒍뒎뒏뒐뒑뒒뒓뒔뒕뒖뒗뒘뒙뒚뒛뒜뒞뒟뒠뒡뒢뒣뒥뒦뒧뒩뒪뒫뒭뒮뒯뒰뒱뒲뒳뒴뒶뒸뒺뒻뒼뒽뒾뒿듁듂듃듅듆듇듉듊듋듌듍듎듏듑듒듓듔듖듗듘듙듚듛듞듟듡듢듥듧듨듩듪듫듮듰듲듳듴듵듶듷듹듺듻듼듽듾듿딀딁딂딃딄딅딆딇딈딉딊딋딌딍딎딏딐딑딒딓딖딗딙딚딝�".split("");
- for(j = 0; j != D[138].length; ++j) if(D[138][j].charCodeAt(0) !== 0xFFFD) { e[D[138][j]] = 35328 + j; d[35328 + j] = D[138][j];}
- D[139] = "�����������������������������������������������������������������딞딟딠딡딢딣딦딫딬딭딮딯딲딳딵딶딷딹딺딻딼딽딾딿땂땆������땇땈땉땊땎땏땑땒땓땕땖땗땘땙땚땛땞땢땣땤땥땦땧땨땩땪������땫땬땭땮땯땰땱땲땳땴땵땶땷땸땹땺땻땼땽땾땿떀떁떂떃떄떅떆떇떈떉떊떋떌떍떎떏떐떑떒떓떔떕떖떗떘떙떚떛떜떝떞떟떢떣떥떦떧떩떬떭떮떯떲떶떷떸떹떺떾떿뗁뗂뗃뗅뗆뗇뗈뗉뗊뗋뗎뗒뗓뗔뗕뗖뗗뗙뗚뗛뗜뗝뗞뗟뗠뗡뗢뗣뗤뗥뗦뗧뗨뗩뗪뗫뗭뗮뗯뗰뗱뗲뗳뗴뗵뗶뗷뗸뗹뗺뗻뗼뗽뗾뗿�".split("");
- for(j = 0; j != D[139].length; ++j) if(D[139][j].charCodeAt(0) !== 0xFFFD) { e[D[139][j]] = 35584 + j; d[35584 + j] = D[139][j];}
- D[140] = "�����������������������������������������������������������������똀똁똂똃똄똅똆똇똈똉똊똋똌똍똎똏똒똓똕똖똗똙똚똛똜똝������똞똟똠똡똢똣똤똦똧똨똩똪똫똭똮똯똰똱똲똳똵똶똷똸똹똺������똻똼똽똾똿뙀뙁뙂뙃뙄뙅뙆뙇뙉뙊뙋뙌뙍뙎뙏뙐뙑뙒뙓뙔뙕뙖뙗뙘뙙뙚뙛뙜뙝뙞뙟뙠뙡뙢뙣뙥뙦뙧뙩뙪뙫뙬뙭뙮뙯뙰뙱뙲뙳뙴뙵뙶뙷뙸뙹뙺뙻뙼뙽뙾뙿뚀뚁뚂뚃뚄뚅뚆뚇뚈뚉뚊뚋뚌뚍뚎뚏뚐뚑뚒뚓뚔뚕뚖뚗뚘뚙뚚뚛뚞뚟뚡뚢뚣뚥뚦뚧뚨뚩뚪뚭뚮뚯뚰뚲뚳뚴뚵뚶뚷뚸뚹뚺뚻뚼뚽뚾뚿뛀뛁뛂�".split("");
- for(j = 0; j != D[140].length; ++j) if(D[140][j].charCodeAt(0) !== 0xFFFD) { e[D[140][j]] = 35840 + j; d[35840 + j] = D[140][j];}
- D[141] = "�����������������������������������������������������������������뛃뛄뛅뛆뛇뛈뛉뛊뛋뛌뛍뛎뛏뛐뛑뛒뛓뛕뛖뛗뛘뛙뛚뛛뛜뛝������뛞뛟뛠뛡뛢뛣뛤뛥뛦뛧뛨뛩뛪뛫뛬뛭뛮뛯뛱뛲뛳뛵뛶뛷뛹뛺������뛻뛼뛽뛾뛿뜂뜃뜄뜆뜇뜈뜉뜊뜋뜌뜍뜎뜏뜐뜑뜒뜓뜔뜕뜖뜗뜘뜙뜚뜛뜜뜝뜞뜟뜠뜡뜢뜣뜤뜥뜦뜧뜪뜫뜭뜮뜱뜲뜳뜴뜵뜶뜷뜺뜼뜽뜾뜿띀띁띂띃띅띆띇띉띊띋띍띎띏띐띑띒띓띖띗띘띙띚띛띜띝띞띟띡띢띣띥띦띧띩띪띫띬띭띮띯띲띴띶띷띸띹띺띻띾띿랁랂랃랅랆랇랈랉랊랋랎랓랔랕랚랛랝랞�".split("");
- for(j = 0; j != D[141].length; ++j) if(D[141][j].charCodeAt(0) !== 0xFFFD) { e[D[141][j]] = 36096 + j; d[36096 + j] = D[141][j];}
- D[142] = "�����������������������������������������������������������������랟랡랢랣랤랥랦랧랪랮랯랰랱랲랳랶랷랹랺랻랼랽랾랿럀럁������럂럃럄럅럆럈럊럋럌럍럎럏럐럑럒럓럔럕럖럗럘럙럚럛럜럝������럞럟럠럡럢럣럤럥럦럧럨럩럪럫럮럯럱럲럳럵럶럷럸럹럺럻럾렂렃렄렅렆렊렋렍렎렏렑렒렓렔렕렖렗렚렜렞렟렠렡렢렣렦렧렩렪렫렭렮렯렰렱렲렳렶렺렻렼렽렾렿롁롂롃롅롆롇롈롉롊롋롌롍롎롏롐롒롔롕롖롗롘롙롚롛롞롟롡롢롣롥롦롧롨롩롪롫롮롰롲롳롴롵롶롷롹롺롻롽롾롿뢀뢁뢂뢃뢄�".split("");
- for(j = 0; j != D[142].length; ++j) if(D[142][j].charCodeAt(0) !== 0xFFFD) { e[D[142][j]] = 36352 + j; d[36352 + j] = D[142][j];}
- D[143] = "�����������������������������������������������������������������뢅뢆뢇뢈뢉뢊뢋뢌뢎뢏뢐뢑뢒뢓뢔뢕뢖뢗뢘뢙뢚뢛뢜뢝뢞뢟������뢠뢡뢢뢣뢤뢥뢦뢧뢩뢪뢫뢬뢭뢮뢯뢱뢲뢳뢵뢶뢷뢹뢺뢻뢼뢽������뢾뢿룂룄룆룇룈룉룊룋룍룎룏룑룒룓룕룖룗룘룙룚룛룜룞룠룢룣룤룥룦룧룪룫룭룮룯룱룲룳룴룵룶룷룺룼룾룿뤀뤁뤂뤃뤅뤆뤇뤈뤉뤊뤋뤌뤍뤎뤏뤐뤑뤒뤓뤔뤕뤖뤗뤙뤚뤛뤜뤝뤞뤟뤡뤢뤣뤤뤥뤦뤧뤨뤩뤪뤫뤬뤭뤮뤯뤰뤱뤲뤳뤴뤵뤶뤷뤸뤹뤺뤻뤾뤿륁륂륃륅륆륇륈륉륊륋륍륎륐륒륓륔륕륖륗�".split("");
- for(j = 0; j != D[143].length; ++j) if(D[143][j].charCodeAt(0) !== 0xFFFD) { e[D[143][j]] = 36608 + j; d[36608 + j] = D[143][j];}
- D[144] = "�����������������������������������������������������������������륚륛륝륞륟륡륢륣륤륥륦륧륪륬륮륯륰륱륲륳륶륷륹륺륻륽������륾륿릀릁릂릃릆릈릋릌릏릐릑릒릓릔릕릖릗릘릙릚릛릜릝릞������릟릠릡릢릣릤릥릦릧릨릩릪릫릮릯릱릲릳릵릶릷릸릹릺릻릾맀맂맃맄맅맆맇맊맋맍맓맔맕맖맗맚맜맟맠맢맦맧맩맪맫맭맮맯맰맱맲맳맶맻맼맽맾맿먂먃먄먅먆먇먉먊먋먌먍먎먏먐먑먒먓먔먖먗먘먙먚먛먜먝먞먟먠먡먢먣먤먥먦먧먨먩먪먫먬먭먮먯먰먱먲먳먴먵먶먷먺먻먽먾먿멁멃멄멅멆�".split("");
- for(j = 0; j != D[144].length; ++j) if(D[144][j].charCodeAt(0) !== 0xFFFD) { e[D[144][j]] = 36864 + j; d[36864 + j] = D[144][j];}
- D[145] = "�����������������������������������������������������������������멇멊멌멏멐멑멒멖멗멙멚멛멝멞멟멠멡멢멣멦멪멫멬멭멮멯������멲멳멵멶멷멹멺멻멼멽멾멿몀몁몂몆몈몉몊몋몍몎몏몐몑몒������몓몔몕몖몗몘몙몚몛몜몝몞몟몠몡몢몣몤몥몦몧몪몭몮몯몱몳몴몵몶몷몺몼몾몿뫀뫁뫂뫃뫅뫆뫇뫉뫊뫋뫌뫍뫎뫏뫐뫑뫒뫓뫔뫕뫖뫗뫚뫛뫜뫝뫞뫟뫠뫡뫢뫣뫤뫥뫦뫧뫨뫩뫪뫫뫬뫭뫮뫯뫰뫱뫲뫳뫴뫵뫶뫷뫸뫹뫺뫻뫽뫾뫿묁묂묃묅묆묇묈묉묊묋묌묎묐묒묓묔묕묖묗묙묚묛묝묞묟묡묢묣묤묥묦묧�".split("");
- for(j = 0; j != D[145].length; ++j) if(D[145][j].charCodeAt(0) !== 0xFFFD) { e[D[145][j]] = 37120 + j; d[37120 + j] = D[145][j];}
- D[146] = "�����������������������������������������������������������������묨묪묬묭묮묯묰묱묲묳묷묹묺묿뭀뭁뭂뭃뭆뭈뭊뭋뭌뭎뭑뭒������뭓뭕뭖뭗뭙뭚뭛뭜뭝뭞뭟뭠뭢뭤뭥뭦뭧뭨뭩뭪뭫뭭뭮뭯뭰뭱������뭲뭳뭴뭵뭶뭷뭸뭹뭺뭻뭼뭽뭾뭿뮀뮁뮂뮃뮄뮅뮆뮇뮉뮊뮋뮍뮎뮏뮑뮒뮓뮔뮕뮖뮗뮘뮙뮚뮛뮜뮝뮞뮟뮠뮡뮢뮣뮥뮦뮧뮩뮪뮫뮭뮮뮯뮰뮱뮲뮳뮵뮶뮸뮹뮺뮻뮼뮽뮾뮿믁믂믃믅믆믇믉믊믋믌믍믎믏믑믒믔믕믖믗믘믙믚믛믜믝믞믟믠믡믢믣믤믥믦믧믨믩믪믫믬믭믮믯믰믱믲믳믴믵믶믷믺믻믽믾밁�".split("");
- for(j = 0; j != D[146].length; ++j) if(D[146][j].charCodeAt(0) !== 0xFFFD) { e[D[146][j]] = 37376 + j; d[37376 + j] = D[146][j];}
- D[147] = "�����������������������������������������������������������������밃밄밅밆밇밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵������밶밷밹밺밻밼밽밾밿뱂뱆뱇뱈뱊뱋뱎뱏뱑뱒뱓뱔뱕뱖뱗뱘뱙������뱚뱛뱜뱞뱟뱠뱡뱢뱣뱤뱥뱦뱧뱨뱩뱪뱫뱬뱭뱮뱯뱰뱱뱲뱳뱴뱵뱶뱷뱸뱹뱺뱻뱼뱽뱾뱿벀벁벂벃벆벇벉벊벍벏벐벑벒벓벖벘벛벜벝벞벟벢벣벥벦벩벪벫벬벭벮벯벲벶벷벸벹벺벻벾벿볁볂볃볅볆볇볈볉볊볋볌볎볒볓볔볖볗볙볚볛볝볞볟볠볡볢볣볤볥볦볧볨볩볪볫볬볭볮볯볰볱볲볳볷볹볺볻볽�".split("");
- for(j = 0; j != D[147].length; ++j) if(D[147][j].charCodeAt(0) !== 0xFFFD) { e[D[147][j]] = 37632 + j; d[37632 + j] = D[147][j];}
- D[148] = "�����������������������������������������������������������������볾볿봀봁봂봃봆봈봊봋봌봍봎봏봑봒봓봕봖봗봘봙봚봛봜봝������봞봟봠봡봢봣봥봦봧봨봩봪봫봭봮봯봰봱봲봳봴봵봶봷봸봹������봺봻봼봽봾봿뵁뵂뵃뵄뵅뵆뵇뵊뵋뵍뵎뵏뵑뵒뵓뵔뵕뵖뵗뵚뵛뵜뵝뵞뵟뵠뵡뵢뵣뵥뵦뵧뵩뵪뵫뵬뵭뵮뵯뵰뵱뵲뵳뵴뵵뵶뵷뵸뵹뵺뵻뵼뵽뵾뵿붂붃붅붆붋붌붍붎붏붒붔붖붗붘붛붝붞붟붠붡붢붣붥붦붧붨붩붪붫붬붭붮붯붱붲붳붴붵붶붷붹붺붻붼붽붾붿뷀뷁뷂뷃뷄뷅뷆뷇뷈뷉뷊뷋뷌뷍뷎뷏뷐뷑�".split("");
- for(j = 0; j != D[148].length; ++j) if(D[148][j].charCodeAt(0) !== 0xFFFD) { e[D[148][j]] = 37888 + j; d[37888 + j] = D[148][j];}
- D[149] = "�����������������������������������������������������������������뷒뷓뷖뷗뷙뷚뷛뷝뷞뷟뷠뷡뷢뷣뷤뷥뷦뷧뷨뷪뷫뷬뷭뷮뷯뷱������뷲뷳뷵뷶뷷뷹뷺뷻뷼뷽뷾뷿븁븂븄븆븇븈븉븊븋븎븏븑븒븓������븕븖븗븘븙븚븛븞븠븡븢븣븤븥븦븧븨븩븪븫븬븭븮븯븰븱븲븳븴븵븶븷븸븹븺븻븼븽븾븿빀빁빂빃빆빇빉빊빋빍빏빐빑빒빓빖빘빜빝빞빟빢빣빥빦빧빩빫빬빭빮빯빲빶빷빸빹빺빾빿뺁뺂뺃뺅뺆뺇뺈뺉뺊뺋뺎뺒뺓뺔뺕뺖뺗뺚뺛뺜뺝뺞뺟뺠뺡뺢뺣뺤뺥뺦뺧뺩뺪뺫뺬뺭뺮뺯뺰뺱뺲뺳뺴뺵뺶뺷�".split("");
- for(j = 0; j != D[149].length; ++j) if(D[149][j].charCodeAt(0) !== 0xFFFD) { e[D[149][j]] = 38144 + j; d[38144 + j] = D[149][j];}
- D[150] = "�����������������������������������������������������������������뺸뺹뺺뺻뺼뺽뺾뺿뻀뻁뻂뻃뻄뻅뻆뻇뻈뻉뻊뻋뻌뻍뻎뻏뻒뻓������뻕뻖뻙뻚뻛뻜뻝뻞뻟뻡뻢뻦뻧뻨뻩뻪뻫뻭뻮뻯뻰뻱뻲뻳뻴뻵������뻶뻷뻸뻹뻺뻻뻼뻽뻾뻿뼀뼂뼃뼄뼅뼆뼇뼊뼋뼌뼍뼎뼏뼐뼑뼒뼓뼔뼕뼖뼗뼚뼞뼟뼠뼡뼢뼣뼤뼥뼦뼧뼨뼩뼪뼫뼬뼭뼮뼯뼰뼱뼲뼳뼴뼵뼶뼷뼸뼹뼺뼻뼼뼽뼾뼿뽂뽃뽅뽆뽇뽉뽊뽋뽌뽍뽎뽏뽒뽓뽔뽖뽗뽘뽙뽚뽛뽜뽝뽞뽟뽠뽡뽢뽣뽤뽥뽦뽧뽨뽩뽪뽫뽬뽭뽮뽯뽰뽱뽲뽳뽴뽵뽶뽷뽸뽹뽺뽻뽼뽽뽾뽿뾀뾁뾂�".split("");
- for(j = 0; j != D[150].length; ++j) if(D[150][j].charCodeAt(0) !== 0xFFFD) { e[D[150][j]] = 38400 + j; d[38400 + j] = D[150][j];}
- D[151] = "�����������������������������������������������������������������뾃뾄뾅뾆뾇뾈뾉뾊뾋뾌뾍뾎뾏뾐뾑뾒뾓뾕뾖뾗뾘뾙뾚뾛뾜뾝������뾞뾟뾠뾡뾢뾣뾤뾥뾦뾧뾨뾩뾪뾫뾬뾭뾮뾯뾱뾲뾳뾴뾵뾶뾷뾸������뾹뾺뾻뾼뾽뾾뾿뿀뿁뿂뿃뿄뿆뿇뿈뿉뿊뿋뿎뿏뿑뿒뿓뿕뿖뿗뿘뿙뿚뿛뿝뿞뿠뿢뿣뿤뿥뿦뿧뿨뿩뿪뿫뿬뿭뿮뿯뿰뿱뿲뿳뿴뿵뿶뿷뿸뿹뿺뿻뿼뿽뿾뿿쀀쀁쀂쀃쀄쀅쀆쀇쀈쀉쀊쀋쀌쀍쀎쀏쀐쀑쀒쀓쀔쀕쀖쀗쀘쀙쀚쀛쀜쀝쀞쀟쀠쀡쀢쀣쀤쀥쀦쀧쀨쀩쀪쀫쀬쀭쀮쀯쀰쀱쀲쀳쀴쀵쀶쀷쀸쀹쀺쀻쀽쀾쀿�".split("");
- for(j = 0; j != D[151].length; ++j) if(D[151][j].charCodeAt(0) !== 0xFFFD) { e[D[151][j]] = 38656 + j; d[38656 + j] = D[151][j];}
- D[152] = "�����������������������������������������������������������������쁀쁁쁂쁃쁄쁅쁆쁇쁈쁉쁊쁋쁌쁍쁎쁏쁐쁒쁓쁔쁕쁖쁗쁙쁚쁛������쁝쁞쁟쁡쁢쁣쁤쁥쁦쁧쁪쁫쁬쁭쁮쁯쁰쁱쁲쁳쁴쁵쁶쁷쁸쁹������쁺쁻쁼쁽쁾쁿삀삁삂삃삄삅삆삇삈삉삊삋삌삍삎삏삒삓삕삖삗삙삚삛삜삝삞삟삢삤삦삧삨삩삪삫삮삱삲삷삸삹삺삻삾샂샃샄샆샇샊샋샍샎샏샑샒샓샔샕샖샗샚샞샟샠샡샢샣샦샧샩샪샫샭샮샯샰샱샲샳샶샸샺샻샼샽샾샿섁섂섃섅섆섇섉섊섋섌섍섎섏섑섒섓섔섖섗섘섙섚섛섡섢섥섨섩섪섫섮�".split("");
- for(j = 0; j != D[152].length; ++j) if(D[152][j].charCodeAt(0) !== 0xFFFD) { e[D[152][j]] = 38912 + j; d[38912 + j] = D[152][j];}
- D[153] = "�����������������������������������������������������������������섲섳섴섵섷섺섻섽섾섿셁셂셃셄셅셆셇셊셎셏셐셑셒셓셖셗������셙셚셛셝셞셟셠셡셢셣셦셪셫셬셭셮셯셱셲셳셵셶셷셹셺셻������셼셽셾셿솀솁솂솃솄솆솇솈솉솊솋솏솑솒솓솕솗솘솙솚솛솞솠솢솣솤솦솧솪솫솭솮솯솱솲솳솴솵솶솷솸솹솺솻솼솾솿쇀쇁쇂쇃쇅쇆쇇쇉쇊쇋쇍쇎쇏쇐쇑쇒쇓쇕쇖쇙쇚쇛쇜쇝쇞쇟쇡쇢쇣쇥쇦쇧쇩쇪쇫쇬쇭쇮쇯쇲쇴쇵쇶쇷쇸쇹쇺쇻쇾쇿숁숂숃숅숆숇숈숉숊숋숎숐숒숓숔숕숖숗숚숛숝숞숡숢숣�".split("");
- for(j = 0; j != D[153].length; ++j) if(D[153][j].charCodeAt(0) !== 0xFFFD) { e[D[153][j]] = 39168 + j; d[39168 + j] = D[153][j];}
- D[154] = "�����������������������������������������������������������������숤숥숦숧숪숬숮숰숳숵숶숷숸숹숺숻숼숽숾숿쉀쉁쉂쉃쉄쉅������쉆쉇쉉쉊쉋쉌쉍쉎쉏쉒쉓쉕쉖쉗쉙쉚쉛쉜쉝쉞쉟쉡쉢쉣쉤쉦������쉧쉨쉩쉪쉫쉮쉯쉱쉲쉳쉵쉶쉷쉸쉹쉺쉻쉾슀슂슃슄슅슆슇슊슋슌슍슎슏슑슒슓슔슕슖슗슙슚슜슞슟슠슡슢슣슦슧슩슪슫슮슯슰슱슲슳슶슸슺슻슼슽슾슿싀싁싂싃싄싅싆싇싈싉싊싋싌싍싎싏싐싑싒싓싔싕싖싗싘싙싚싛싞싟싡싢싥싦싧싨싩싪싮싰싲싳싴싵싷싺싽싾싿쌁쌂쌃쌄쌅쌆쌇쌊쌋쌎쌏�".split("");
- for(j = 0; j != D[154].length; ++j) if(D[154][j].charCodeAt(0) !== 0xFFFD) { e[D[154][j]] = 39424 + j; d[39424 + j] = D[154][j];}
- D[155] = "�����������������������������������������������������������������쌐쌑쌒쌖쌗쌙쌚쌛쌝쌞쌟쌠쌡쌢쌣쌦쌧쌪쌫쌬쌭쌮쌯쌰쌱쌲������쌳쌴쌵쌶쌷쌸쌹쌺쌻쌼쌽쌾쌿썀썁썂썃썄썆썇썈썉썊썋썌썍������썎썏썐썑썒썓썔썕썖썗썘썙썚썛썜썝썞썟썠썡썢썣썤썥썦썧썪썫썭썮썯썱썳썴썵썶썷썺썻썾썿쎀쎁쎂쎃쎅쎆쎇쎉쎊쎋쎍쎎쎏쎐쎑쎒쎓쎔쎕쎖쎗쎘쎙쎚쎛쎜쎝쎞쎟쎠쎡쎢쎣쎤쎥쎦쎧쎨쎩쎪쎫쎬쎭쎮쎯쎰쎱쎲쎳쎴쎵쎶쎷쎸쎹쎺쎻쎼쎽쎾쎿쏁쏂쏃쏄쏅쏆쏇쏈쏉쏊쏋쏌쏍쏎쏏쏐쏑쏒쏓쏔쏕쏖쏗쏚�".split("");
- for(j = 0; j != D[155].length; ++j) if(D[155][j].charCodeAt(0) !== 0xFFFD) { e[D[155][j]] = 39680 + j; d[39680 + j] = D[155][j];}
- D[156] = "�����������������������������������������������������������������쏛쏝쏞쏡쏣쏤쏥쏦쏧쏪쏫쏬쏮쏯쏰쏱쏲쏳쏶쏷쏹쏺쏻쏼쏽쏾������쏿쐀쐁쐂쐃쐄쐅쐆쐇쐉쐊쐋쐌쐍쐎쐏쐑쐒쐓쐔쐕쐖쐗쐘쐙쐚������쐛쐜쐝쐞쐟쐠쐡쐢쐣쐥쐦쐧쐨쐩쐪쐫쐭쐮쐯쐱쐲쐳쐵쐶쐷쐸쐹쐺쐻쐾쐿쑀쑁쑂쑃쑄쑅쑆쑇쑉쑊쑋쑌쑍쑎쑏쑐쑑쑒쑓쑔쑕쑖쑗쑘쑙쑚쑛쑜쑝쑞쑟쑠쑡쑢쑣쑦쑧쑩쑪쑫쑭쑮쑯쑰쑱쑲쑳쑶쑷쑸쑺쑻쑼쑽쑾쑿쒁쒂쒃쒄쒅쒆쒇쒈쒉쒊쒋쒌쒍쒎쒏쒐쒑쒒쒓쒕쒖쒗쒘쒙쒚쒛쒝쒞쒟쒠쒡쒢쒣쒤쒥쒦쒧쒨쒩�".split("");
- for(j = 0; j != D[156].length; ++j) if(D[156][j].charCodeAt(0) !== 0xFFFD) { e[D[156][j]] = 39936 + j; d[39936 + j] = D[156][j];}
- D[157] = "�����������������������������������������������������������������쒪쒫쒬쒭쒮쒯쒰쒱쒲쒳쒴쒵쒶쒷쒹쒺쒻쒽쒾쒿쓀쓁쓂쓃쓄쓅������쓆쓇쓈쓉쓊쓋쓌쓍쓎쓏쓐쓑쓒쓓쓔쓕쓖쓗쓘쓙쓚쓛쓜쓝쓞쓟������쓠쓡쓢쓣쓤쓥쓦쓧쓨쓪쓫쓬쓭쓮쓯쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂씃씄씅씆씇씈씉씊씋씍씎씏씑씒씓씕씖씗씘씙씚씛씝씞씟씠씡씢씣씤씥씦씧씪씫씭씮씯씱씲씳씴씵씶씷씺씼씾씿앀앁앂앃앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩앪앫앬앭앮앯앲앶앷앸앹앺앻앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔�".split("");
- for(j = 0; j != D[157].length; ++j) if(D[157][j].charCodeAt(0) !== 0xFFFD) { e[D[157][j]] = 40192 + j; d[40192 + j] = D[157][j];}
- D[158] = "�����������������������������������������������������������������얖얙얚얛얝얞얟얡얢얣얤얥얦얧얨얪얫얬얭얮얯얰얱얲얳얶������얷얺얿엀엁엂엃엋엍엏엒엓엕엖엗엙엚엛엜엝엞엟엢엤엦엧������엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑옒옓옔옕옖옗옚옝옞옟옠옡옢옣옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉왊왋왌왍왎왏왒왖왗왘왙왚왛왞왟왡왢왣왤왥왦왧왨왩왪왫왭왮왰왲왳왴왵왶왷왺왻왽왾왿욁욂욃욄욅욆욇욊욌욎욏욐욑욒욓욖욗욙욚욛욝욞욟욠욡욢욣욦�".split("");
- for(j = 0; j != D[158].length; ++j) if(D[158][j].charCodeAt(0) !== 0xFFFD) { e[D[158][j]] = 40448 + j; d[40448 + j] = D[158][j];}
- D[159] = "�����������������������������������������������������������������욨욪욫욬욭욮욯욲욳욵욶욷욻욼욽욾욿웂웄웆웇웈웉웊웋웎������웏웑웒웓웕웖웗웘웙웚웛웞웟웢웣웤웥웦웧웪웫웭웮웯웱웲������웳웴웵웶웷웺웻웼웾웿윀윁윂윃윆윇윉윊윋윍윎윏윐윑윒윓윖윘윚윛윜윝윞윟윢윣윥윦윧윩윪윫윬윭윮윯윲윴윶윸윹윺윻윾윿읁읂읃읅읆읇읈읉읋읎읐읙읚읛읝읞읟읡읢읣읤읥읦읧읩읪읬읭읮읯읰읱읲읳읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛잜잝잞잟잢잧잨잩잪잫잮잯잱잲잳잵잶잷�".split("");
- for(j = 0; j != D[159].length; ++j) if(D[159][j].charCodeAt(0) !== 0xFFFD) { e[D[159][j]] = 40704 + j; d[40704 + j] = D[159][j];}
- D[160] = "�����������������������������������������������������������������잸잹잺잻잾쟂쟃쟄쟅쟆쟇쟊쟋쟍쟏쟑쟒쟓쟔쟕쟖쟗쟙쟚쟛쟜������쟞쟟쟠쟡쟢쟣쟥쟦쟧쟩쟪쟫쟭쟮쟯쟰쟱쟲쟳쟴쟵쟶쟷쟸쟹쟺������쟻쟼쟽쟾쟿젂젃젅젆젇젉젋젌젍젎젏젒젔젗젘젙젚젛젞젟젡젢젣젥젦젧젨젩젪젫젮젰젲젳젴젵젶젷젹젺젻젽젾젿졁졂졃졄졅졆졇졊졋졎졏졐졑졒졓졕졖졗졘졙졚졛졜졝졞졟졠졡졢졣졤졥졦졧졨졩졪졫졬졭졮졯졲졳졵졶졷졹졻졼졽졾졿좂좄좈좉좊좎좏좐좑좒좓좕좖좗좘좙좚좛좜좞좠좢좣좤�".split("");
- for(j = 0; j != D[160].length; ++j) if(D[160][j].charCodeAt(0) !== 0xFFFD) { e[D[160][j]] = 40960 + j; d[40960 + j] = D[160][j];}
- D[161] = "�����������������������������������������������������������������좥좦좧좩좪좫좬좭좮좯좰좱좲좳좴좵좶좷좸좹좺좻좾좿죀죁������죂죃죅죆죇죉죊죋죍죎죏죐죑죒죓죖죘죚죛죜죝죞죟죢죣죥������죦죧죨죩죪죫죬죭죮죯죰죱죲죳죴죶죷죸죹죺죻죾죿줁줂줃줇줈줉줊줋줎 、。·‥…¨〃―∥\∼‘’“”〔〕〈〉《》「」『』【】±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬�".split("");
- for(j = 0; j != D[161].length; ++j) if(D[161][j].charCodeAt(0) !== 0xFFFD) { e[D[161][j]] = 41216 + j; d[41216 + j] = D[161][j];}
- D[162] = "�����������������������������������������������������������������줐줒줓줔줕줖줗줙줚줛줜줝줞줟줠줡줢줣줤줥줦줧줨줩줪줫������줭줮줯줰줱줲줳줵줶줷줸줹줺줻줼줽줾줿쥀쥁쥂쥃쥄쥅쥆쥇������쥈쥉쥊쥋쥌쥍쥎쥏쥒쥓쥕쥖쥗쥙쥚쥛쥜쥝쥞쥟쥢쥤쥥쥦쥧쥨쥩쥪쥫쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®������������������������".split("");
- for(j = 0; j != D[162].length; ++j) if(D[162][j].charCodeAt(0) !== 0xFFFD) { e[D[162][j]] = 41472 + j; d[41472 + j] = D[162][j];}
- D[163] = "�����������������������������������������������������������������쥱쥲쥳쥵쥶쥷쥸쥹쥺쥻쥽쥾쥿즀즁즂즃즄즅즆즇즊즋즍즎즏������즑즒즓즔즕즖즗즚즜즞즟즠즡즢즣즤즥즦즧즨즩즪즫즬즭즮������즯즰즱즲즳즴즵즶즷즸즹즺즻즼즽즾즿짂짃짅짆짉짋짌짍짎짏짒짔짗짘짛!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[₩]^_`abcdefghijklmnopqrstuvwxyz{|} ̄�".split("");
- for(j = 0; j != D[163].length; ++j) if(D[163][j].charCodeAt(0) !== 0xFFFD) { e[D[163][j]] = 41728 + j; d[41728 + j] = D[163][j];}
- D[164] = "�����������������������������������������������������������������짞짟짡짣짥짦짨짩짪짫짮짲짳짴짵짶짷짺짻짽짾짿쨁쨂쨃쨄������쨅쨆쨇쨊쨎쨏쨐쨑쨒쨓쨕쨖쨗쨙쨚쨛쨜쨝쨞쨟쨠쨡쨢쨣쨤쨥������쨦쨧쨨쨪쨫쨬쨭쨮쨯쨰쨱쨲쨳쨴쨵쨶쨷쨸쨹쨺쨻쨼쨽쨾쨿쩀쩁쩂쩃쩄쩅쩆ㄱㄲㄳㄴㄵㄶㄷㄸㄹㄺㄻㄼㄽㄾㄿㅀㅁㅂㅃㅄㅅㅆㅇㅈㅉㅊㅋㅌㅍㅎㅏㅐㅑㅒㅓㅔㅕㅖㅗㅘㅙㅚㅛㅜㅝㅞㅟㅠㅡㅢㅣㅤㅥㅦㅧㅨㅩㅪㅫㅬㅭㅮㅯㅰㅱㅲㅳㅴㅵㅶㅷㅸㅹㅺㅻㅼㅽㅾㅿㆀㆁㆂㆃㆄㆅㆆㆇㆈㆉㆊㆋㆌㆍㆎ�".split("");
- for(j = 0; j != D[164].length; ++j) if(D[164][j].charCodeAt(0) !== 0xFFFD) { e[D[164][j]] = 41984 + j; d[41984 + j] = D[164][j];}
- D[165] = "�����������������������������������������������������������������쩇쩈쩉쩊쩋쩎쩏쩑쩒쩓쩕쩖쩗쩘쩙쩚쩛쩞쩢쩣쩤쩥쩦쩧쩩쩪������쩫쩬쩭쩮쩯쩰쩱쩲쩳쩴쩵쩶쩷쩸쩹쩺쩻쩼쩾쩿쪀쪁쪂쪃쪅쪆������쪇쪈쪉쪊쪋쪌쪍쪎쪏쪐쪑쪒쪓쪔쪕쪖쪗쪙쪚쪛쪜쪝쪞쪟쪠쪡쪢쪣쪤쪥쪦쪧ⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹ�����ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ�������ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ��������αβγδεζηθικλμνξοπρστυφχψω�������".split("");
- for(j = 0; j != D[165].length; ++j) if(D[165][j].charCodeAt(0) !== 0xFFFD) { e[D[165][j]] = 42240 + j; d[42240 + j] = D[165][j];}
- D[166] = "�����������������������������������������������������������������쪨쪩쪪쪫쪬쪭쪮쪯쪰쪱쪲쪳쪴쪵쪶쪷쪸쪹쪺쪻쪾쪿쫁쫂쫃쫅������쫆쫇쫈쫉쫊쫋쫎쫐쫒쫔쫕쫖쫗쫚쫛쫜쫝쫞쫟쫡쫢쫣쫤쫥쫦쫧������쫨쫩쫪쫫쫭쫮쫯쫰쫱쫲쫳쫵쫶쫷쫸쫹쫺쫻쫼쫽쫾쫿쬀쬁쬂쬃쬄쬅쬆쬇쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃╄╅╆╇╈╉╊���������������������������".split("");
- for(j = 0; j != D[166].length; ++j) if(D[166][j].charCodeAt(0) !== 0xFFFD) { e[D[166][j]] = 42496 + j; d[42496 + j] = D[166][j];}
- D[167] = "�����������������������������������������������������������������쬋쬌쬍쬎쬏쬑쬒쬓쬕쬖쬗쬙쬚쬛쬜쬝쬞쬟쬢쬣쬤쬥쬦쬧쬨쬩������쬪쬫쬬쬭쬮쬯쬰쬱쬲쬳쬴쬵쬶쬷쬸쬹쬺쬻쬼쬽쬾쬿쭀쭂쭃쭄������쭅쭆쭇쭊쭋쭍쭎쭏쭑쭒쭓쭔쭕쭖쭗쭚쭛쭜쭞쭟쭠쭡쭢쭣쭥쭦쭧쭨쭩쭪쭫쭬㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙㎚㎛㎜㎝㎞㎟㎠㎡㎢㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰㎱㎲㎳㎴㎵㎶㎷㎸㎹㎀㎁㎂㎃㎄㎺㎻㎼㎽㎾㎿㎐㎑㎒㎓㎔Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆����������������".split("");
- for(j = 0; j != D[167].length; ++j) if(D[167][j].charCodeAt(0) !== 0xFFFD) { e[D[167][j]] = 42752 + j; d[42752 + j] = D[167][j];}
- D[168] = "�����������������������������������������������������������������쭭쭮쭯쭰쭱쭲쭳쭴쭵쭶쭷쭺쭻쭼쭽쭾쭿쮀쮁쮂쮃쮄쮅쮆쮇쮈������쮉쮊쮋쮌쮍쮎쮏쮐쮑쮒쮓쮔쮕쮖쮗쮘쮙쮚쮛쮝쮞쮟쮠쮡쮢쮣������쮤쮥쮦쮧쮨쮩쮪쮫쮬쮭쮮쮯쮰쮱쮲쮳쮴쮵쮶쮷쮹쮺쮻쮼쮽쮾쮿쯀쯁쯂쯃쯄ÆÐªĦ�IJ�ĿŁØŒºÞŦŊ�㉠㉡㉢㉣㉤㉥㉦㉧㉨㉩㉪㉫㉬㉭㉮㉯㉰㉱㉲㉳㉴㉵㉶㉷㉸㉹㉺㉻ⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩ①②③④⑤⑥⑦⑧⑨⑩⑪⑫⑬⑭⑮½⅓⅔¼¾⅛⅜⅝⅞�".split("");
- for(j = 0; j != D[168].length; ++j) if(D[168][j].charCodeAt(0) !== 0xFFFD) { e[D[168][j]] = 43008 + j; d[43008 + j] = D[168][j];}
- D[169] = "�����������������������������������������������������������������쯅쯆쯇쯈쯉쯊쯋쯌쯍쯎쯏쯐쯑쯒쯓쯕쯖쯗쯘쯙쯚쯛쯜쯝쯞쯟������쯠쯡쯢쯣쯥쯦쯨쯪쯫쯬쯭쯮쯯쯰쯱쯲쯳쯴쯵쯶쯷쯸쯹쯺쯻쯼������쯽쯾쯿찀찁찂찃찄찅찆찇찈찉찊찋찎찏찑찒찓찕찖찗찘찙찚찛찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀㈁㈂㈃㈄㈅㈆㈇㈈㈉㈊㈋㈌㈍㈎㈏㈐㈑㈒㈓㈔㈕㈖㈗㈘㈙㈚㈛⒜⒝⒞⒟⒠⒡⒢⒣⒤⒥⒦⒧⒨⒩⒪⒫⒬⒭⒮⒯⒰⒱⒲⒳⒴⒵⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂¹²³⁴ⁿ₁₂₃₄�".split("");
- for(j = 0; j != D[169].length; ++j) if(D[169][j].charCodeAt(0) !== 0xFFFD) { e[D[169][j]] = 43264 + j; d[43264 + j] = D[169][j];}
- D[170] = "�����������������������������������������������������������������찥찦찪찫찭찯찱찲찳찴찵찶찷찺찿챀챁챂챃챆챇챉챊챋챍챎������챏챐챑챒챓챖챚챛챜챝챞챟챡챢챣챥챧챩챪챫챬챭챮챯챱챲������챳챴챶챷챸챹챺챻챼챽챾챿첀첁첂첃첄첅첆첇첈첉첊첋첌첍첎첏첐첑첒첓ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをん������������".split("");
- for(j = 0; j != D[170].length; ++j) if(D[170][j].charCodeAt(0) !== 0xFFFD) { e[D[170][j]] = 43520 + j; d[43520 + j] = D[170][j];}
- D[171] = "�����������������������������������������������������������������첔첕첖첗첚첛첝첞첟첡첢첣첤첥첦첧첪첮첯첰첱첲첳첶첷첹������첺첻첽첾첿쳀쳁쳂쳃쳆쳈쳊쳋쳌쳍쳎쳏쳑쳒쳓쳕쳖쳗쳘쳙쳚������쳛쳜쳝쳞쳟쳠쳡쳢쳣쳥쳦쳧쳨쳩쳪쳫쳭쳮쳯쳱쳲쳳쳴쳵쳶쳷쳸쳹쳺쳻쳼쳽ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶ���������".split("");
- for(j = 0; j != D[171].length; ++j) if(D[171][j].charCodeAt(0) !== 0xFFFD) { e[D[171][j]] = 43776 + j; d[43776 + j] = D[171][j];}
- D[172] = "�����������������������������������������������������������������쳾쳿촀촂촃촄촅촆촇촊촋촍촎촏촑촒촓촔촕촖촗촚촜촞촟촠������촡촢촣촥촦촧촩촪촫촭촮촯촰촱촲촳촴촵촶촷촸촺촻촼촽촾������촿쵀쵁쵂쵃쵄쵅쵆쵇쵈쵉쵊쵋쵌쵍쵎쵏쵐쵑쵒쵓쵔쵕쵖쵗쵘쵙쵚쵛쵝쵞쵟АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ���������������абвгдеёжзийклмнопрстуфхцчшщъыьэюя��������������".split("");
- for(j = 0; j != D[172].length; ++j) if(D[172][j].charCodeAt(0) !== 0xFFFD) { e[D[172][j]] = 44032 + j; d[44032 + j] = D[172][j];}
- D[173] = "�����������������������������������������������������������������쵡쵢쵣쵥쵦쵧쵨쵩쵪쵫쵮쵰쵲쵳쵴쵵쵶쵷쵹쵺쵻쵼쵽쵾쵿춀������춁춂춃춄춅춆춇춉춊춋춌춍춎춏춐춑춒춓춖춗춙춚춛춝춞춟������춠춡춢춣춦춨춪춫춬춭춮춯춱춲춳춴춵춶춷춸춹춺춻춼춽춾춿췀췁췂췃췅�����������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[173].length; ++j) if(D[173][j].charCodeAt(0) !== 0xFFFD) { e[D[173][j]] = 44288 + j; d[44288 + j] = D[173][j];}
- D[174] = "�����������������������������������������������������������������췆췇췈췉췊췋췍췎췏췑췒췓췔췕췖췗췘췙췚췛췜췝췞췟췠췡������췢췣췤췥췦췧췩췪췫췭췮췯췱췲췳췴췵췶췷췺췼췾췿츀츁츂������츃츅츆츇츉츊츋츍츎츏츐츑츒츓츕츖츗츘츚츛츜츝츞츟츢츣츥츦츧츩츪츫�����������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[174].length; ++j) if(D[174][j].charCodeAt(0) !== 0xFFFD) { e[D[174][j]] = 44544 + j; d[44544 + j] = D[174][j];}
- D[175] = "�����������������������������������������������������������������츬츭츮츯츲츴츶츷츸츹츺츻츼츽츾츿칀칁칂칃칄칅칆칇칈칉������칊칋칌칍칎칏칐칑칒칓칔칕칖칗칚칛칝칞칢칣칤칥칦칧칪칬������칮칯칰칱칲칳칶칷칹칺칻칽칾칿캀캁캂캃캆캈캊캋캌캍캎캏캒캓캕캖캗캙�����������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[175].length; ++j) if(D[175][j].charCodeAt(0) !== 0xFFFD) { e[D[175][j]] = 44800 + j; d[44800 + j] = D[175][j];}
- D[176] = "�����������������������������������������������������������������캚캛캜캝캞캟캢캦캧캨캩캪캫캮캯캰캱캲캳캴캵캶캷캸캹캺������캻캼캽캾캿컀컂컃컄컅컆컇컈컉컊컋컌컍컎컏컐컑컒컓컔컕������컖컗컘컙컚컛컜컝컞컟컠컡컢컣컦컧컩컪컭컮컯컰컱컲컳컶컺컻컼컽컾컿가각간갇갈갉갊감갑값갓갔강갖갗같갚갛개객갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆�".split("");
- for(j = 0; j != D[176].length; ++j) if(D[176][j].charCodeAt(0) !== 0xFFFD) { e[D[176][j]] = 45056 + j; d[45056 + j] = D[176][j];}
- D[177] = "�����������������������������������������������������������������켂켃켅켆켇켉켊켋켌켍켎켏켒켔켖켗켘켙켚켛켝켞켟켡켢켣������켥켦켧켨켩켪켫켮켲켳켴켵켶켷켹켺켻켼켽켾켿콀콁콂콃콄������콅콆콇콈콉콊콋콌콍콎콏콐콑콒콓콖콗콙콚콛콝콞콟콠콡콢콣콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸�".split("");
- for(j = 0; j != D[177].length; ++j) if(D[177][j].charCodeAt(0) !== 0xFFFD) { e[D[177][j]] = 45312 + j; d[45312 + j] = D[177][j];}
- D[178] = "�����������������������������������������������������������������콭콮콯콲콳콵콶콷콹콺콻콼콽콾콿쾁쾂쾃쾄쾆쾇쾈쾉쾊쾋쾍������쾎쾏쾐쾑쾒쾓쾔쾕쾖쾗쾘쾙쾚쾛쾜쾝쾞쾟쾠쾢쾣쾤쾥쾦쾧쾩������쾪쾫쾬쾭쾮쾯쾱쾲쾳쾴쾵쾶쾷쾸쾹쾺쾻쾼쾽쾾쾿쿀쿁쿂쿃쿅쿆쿇쿈쿉쿊쿋깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙�".split("");
- for(j = 0; j != D[178].length; ++j) if(D[178][j].charCodeAt(0) !== 0xFFFD) { e[D[178][j]] = 45568 + j; d[45568 + j] = D[178][j];}
- D[179] = "�����������������������������������������������������������������쿌쿍쿎쿏쿐쿑쿒쿓쿔쿕쿖쿗쿘쿙쿚쿛쿜쿝쿞쿟쿢쿣쿥쿦쿧쿩������쿪쿫쿬쿭쿮쿯쿲쿴쿶쿷쿸쿹쿺쿻쿽쿾쿿퀁퀂퀃퀅퀆퀇퀈퀉퀊������퀋퀌퀍퀎퀏퀐퀒퀓퀔퀕퀖퀗퀙퀚퀛퀜퀝퀞퀟퀠퀡퀢퀣퀤퀥퀦퀧퀨퀩퀪퀫퀬끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫났낭낮낯낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝�".split("");
- for(j = 0; j != D[179].length; ++j) if(D[179][j].charCodeAt(0) !== 0xFFFD) { e[D[179][j]] = 45824 + j; d[45824 + j] = D[179][j];}
- D[180] = "�����������������������������������������������������������������퀮퀯퀰퀱퀲퀳퀶퀷퀹퀺퀻퀽퀾퀿큀큁큂큃큆큈큊큋큌큍큎큏������큑큒큓큕큖큗큙큚큛큜큝큞큟큡큢큣큤큥큦큧큨큩큪큫큮큯������큱큲큳큵큶큷큸큹큺큻큾큿킀킂킃킄킅킆킇킈킉킊킋킌킍킎킏킐킑킒킓킔뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫달닭닮닯닳담답닷닸당닺닻닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥�".split("");
- for(j = 0; j != D[180].length; ++j) if(D[180][j].charCodeAt(0) !== 0xFFFD) { e[D[180][j]] = 46080 + j; d[46080 + j] = D[180][j];}
- D[181] = "�����������������������������������������������������������������킕킖킗킘킙킚킛킜킝킞킟킠킡킢킣킦킧킩킪킫킭킮킯킰킱킲������킳킶킸킺킻킼킽킾킿탂탃탅탆탇탊탋탌탍탎탏탒탖탗탘탙탚������탛탞탟탡탢탣탥탦탧탨탩탪탫탮탲탳탴탵탶탷탹탺탻탼탽탾탿턀턁턂턃턄덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸�".split("");
- for(j = 0; j != D[181].length; ++j) if(D[181][j].charCodeAt(0) !== 0xFFFD) { e[D[181][j]] = 46336 + j; d[46336 + j] = D[181][j];}
- D[182] = "�����������������������������������������������������������������턅턆턇턈턉턊턋턌턎턏턐턑턒턓턔턕턖턗턘턙턚턛턜턝턞턟������턠턡턢턣턤턥턦턧턨턩턪턫턬턭턮턯턲턳턵턶턷턹턻턼턽턾������턿텂텆텇텈텉텊텋텎텏텑텒텓텕텖텗텘텙텚텛텞텠텢텣텤텥텦텧텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗�".split("");
- for(j = 0; j != D[182].length; ++j) if(D[182][j].charCodeAt(0) !== 0xFFFD) { e[D[182][j]] = 46592 + j; d[46592 + j] = D[182][j];}
- D[183] = "�����������������������������������������������������������������텮텯텰텱텲텳텴텵텶텷텸텹텺텻텽텾텿톀톁톂톃톅톆톇톉톊������톋톌톍톎톏톐톑톒톓톔톕톖톗톘톙톚톛톜톝톞톟톢톣톥톦톧������톩톪톫톬톭톮톯톲톴톶톷톸톹톻톽톾톿퇁퇂퇃퇄퇅퇆퇇퇈퇉퇊퇋퇌퇍퇎퇏래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩�".split("");
- for(j = 0; j != D[183].length; ++j) if(D[183][j].charCodeAt(0) !== 0xFFFD) { e[D[183][j]] = 46848 + j; d[46848 + j] = D[183][j];}
- D[184] = "�����������������������������������������������������������������퇐퇑퇒퇓퇔퇕퇖퇗퇙퇚퇛퇜퇝퇞퇟퇠퇡퇢퇣퇤퇥퇦퇧퇨퇩퇪������퇫퇬퇭퇮퇯퇰퇱퇲퇳퇵퇶퇷퇹퇺퇻퇼퇽퇾퇿툀툁툂툃툄툅툆������툈툊툋툌툍툎툏툑툒툓툔툕툖툗툘툙툚툛툜툝툞툟툠툡툢툣툤툥툦툧툨툩륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많맏말맑맒맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼�".split("");
- for(j = 0; j != D[184].length; ++j) if(D[184][j].charCodeAt(0) !== 0xFFFD) { e[D[184][j]] = 47104 + j; d[47104 + j] = D[184][j];}
- D[185] = "�����������������������������������������������������������������툪툫툮툯툱툲툳툵툶툷툸툹툺툻툾퉀퉂퉃퉄퉅퉆퉇퉉퉊퉋퉌������퉍퉎퉏퉐퉑퉒퉓퉔퉕퉖퉗퉘퉙퉚퉛퉝퉞퉟퉠퉡퉢퉣퉥퉦퉧퉨������퉩퉪퉫퉬퉭퉮퉯퉰퉱퉲퉳퉴퉵퉶퉷퉸퉹퉺퉻퉼퉽퉾퉿튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바박밖밗반받발밝밞밟밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗�".split("");
- for(j = 0; j != D[185].length; ++j) if(D[185][j].charCodeAt(0) !== 0xFFFD) { e[D[185][j]] = 47360 + j; d[47360 + j] = D[185][j];}
- D[186] = "�����������������������������������������������������������������튍튎튏튒튓튔튖튗튘튙튚튛튝튞튟튡튢튣튥튦튧튨튩튪튫튭������튮튯튰튲튳튴튵튶튷튺튻튽튾틁틃틄틅틆틇틊틌틍틎틏틐틑������틒틓틕틖틗틙틚틛틝틞틟틠틡틢틣틦틧틨틩틪틫틬틭틮틯틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤�".split("");
- for(j = 0; j != D[186].length; ++j) if(D[186][j].charCodeAt(0) !== 0xFFFD) { e[D[186][j]] = 47616 + j; d[47616 + j] = D[186][j];}
- D[187] = "�����������������������������������������������������������������틻틼틽틾틿팂팄팆팇팈팉팊팋팏팑팒팓팕팗팘팙팚팛팞팢팣������팤팦팧팪팫팭팮팯팱팲팳팴팵팶팷팺팾팿퍀퍁퍂퍃퍆퍇퍈퍉������퍊퍋퍌퍍퍎퍏퍐퍑퍒퍓퍔퍕퍖퍗퍘퍙퍚퍛퍜퍝퍞퍟퍠퍡퍢퍣퍤퍥퍦퍧퍨퍩빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤�".split("");
- for(j = 0; j != D[187].length; ++j) if(D[187][j].charCodeAt(0) !== 0xFFFD) { e[D[187][j]] = 47872 + j; d[47872 + j] = D[187][j];}
- D[188] = "�����������������������������������������������������������������퍪퍫퍬퍭퍮퍯퍰퍱퍲퍳퍴퍵퍶퍷퍸퍹퍺퍻퍾퍿펁펂펃펅펆펇������펈펉펊펋펎펒펓펔펕펖펗펚펛펝펞펟펡펢펣펤펥펦펧펪펬펮������펯펰펱펲펳펵펶펷펹펺펻펽펾펿폀폁폂폃폆폇폊폋폌폍폎폏폑폒폓폔폕폖샥샨샬샴샵샷샹섀섄섈섐섕서석섞섟선섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭�".split("");
- for(j = 0; j != D[188].length; ++j) if(D[188][j].charCodeAt(0) !== 0xFFFD) { e[D[188][j]] = 48128 + j; d[48128 + j] = D[188][j];}
- D[189] = "�����������������������������������������������������������������폗폙폚폛폜폝폞폟폠폢폤폥폦폧폨폩폪폫폮폯폱폲폳폵폶폷������폸폹폺폻폾퐀퐂퐃퐄퐅퐆퐇퐉퐊퐋퐌퐍퐎퐏퐐퐑퐒퐓퐔퐕퐖������퐗퐘퐙퐚퐛퐜퐞퐟퐠퐡퐢퐣퐤퐥퐦퐧퐨퐩퐪퐫퐬퐭퐮퐯퐰퐱퐲퐳퐴퐵퐶퐷숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰�".split("");
- for(j = 0; j != D[189].length; ++j) if(D[189][j].charCodeAt(0) !== 0xFFFD) { e[D[189][j]] = 48384 + j; d[48384 + j] = D[189][j];}
- D[190] = "�����������������������������������������������������������������퐸퐹퐺퐻퐼퐽퐾퐿푁푂푃푅푆푇푈푉푊푋푌푍푎푏푐푑푒푓������푔푕푖푗푘푙푚푛푝푞푟푡푢푣푥푦푧푨푩푪푫푬푮푰푱푲������푳푴푵푶푷푺푻푽푾풁풃풄풅풆풇풊풌풎풏풐풑풒풓풕풖풗풘풙풚풛풜풝쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄업없엇었엉엊엌엎�".split("");
- for(j = 0; j != D[190].length; ++j) if(D[190][j].charCodeAt(0) !== 0xFFFD) { e[D[190][j]] = 48640 + j; d[48640 + j] = D[190][j];}
- D[191] = "�����������������������������������������������������������������풞풟풠풡풢풣풤풥풦풧풨풪풫풬풭풮풯풰풱풲풳풴풵풶풷풸������풹풺풻풼풽풾풿퓀퓁퓂퓃퓄퓅퓆퓇퓈퓉퓊퓋퓍퓎퓏퓑퓒퓓퓕������퓖퓗퓘퓙퓚퓛퓝퓞퓠퓡퓢퓣퓤퓥퓦퓧퓩퓪퓫퓭퓮퓯퓱퓲퓳퓴퓵퓶퓷퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염엽엾엿였영옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨�".split("");
- for(j = 0; j != D[191].length; ++j) if(D[191][j].charCodeAt(0) !== 0xFFFD) { e[D[191][j]] = 48896 + j; d[48896 + j] = D[191][j];}
- D[192] = "�����������������������������������������������������������������퓾퓿픀픁픂픃픅픆픇픉픊픋픍픎픏픐픑픒픓픖픘픙픚픛픜픝������픞픟픠픡픢픣픤픥픦픧픨픩픪픫픬픭픮픯픰픱픲픳픴픵픶픷������픸픹픺픻픾픿핁핂핃핅핆핇핈핉핊핋핎핐핒핓핔핕핖핗핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응읒읓읔읕읖읗의읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊�".split("");
- for(j = 0; j != D[192].length; ++j) if(D[192][j].charCodeAt(0) !== 0xFFFD) { e[D[192][j]] = 49152 + j; d[49152 + j] = D[192][j];}
- D[193] = "�����������������������������������������������������������������핤핦핧핪핬핮핯핰핱핲핳핶핷핹핺핻핽핾핿햀햁햂햃햆햊햋������햌햍햎햏햑햒햓햔햕햖햗햘햙햚햛햜햝햞햟햠햡햢햣햤햦햧������햨햩햪햫햬햭햮햯햰햱햲햳햴햵햶햷햸햹햺햻햼햽햾햿헀헁헂헃헄헅헆헇점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓�".split("");
- for(j = 0; j != D[193].length; ++j) if(D[193][j].charCodeAt(0) !== 0xFFFD) { e[D[193][j]] = 49408 + j; d[49408 + j] = D[193][j];}
- D[194] = "�����������������������������������������������������������������헊헋헍헎헏헑헓헔헕헖헗헚헜헞헟헠헡헢헣헦헧헩헪헫헭헮������헯헰헱헲헳헶헸헺헻헼헽헾헿혂혃혅혆혇혉혊혋혌혍혎혏혒������혖혗혘혙혚혛혝혞혟혡혢혣혥혦혧혨혩혪혫혬혮혯혰혱혲혳혴혵혶혷혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻�".split("");
- for(j = 0; j != D[194].length; ++j) if(D[194][j].charCodeAt(0) !== 0xFFFD) { e[D[194][j]] = 49664 + j; d[49664 + j] = D[194][j];}
- D[195] = "�����������������������������������������������������������������혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝홞홟홠홡������홢홣홤홥홦홨홪홫홬홭홮홯홲홳홵홶홷홸홹홺홻홼홽홾홿횀������횁횂횄횆횇횈횉횊횋횎횏횑횒횓횕횖횗횘횙횚횛횜횞횠횢횣횤횥횦횧횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층�".split("");
- for(j = 0; j != D[195].length; ++j) if(D[195][j].charCodeAt(0) !== 0xFFFD) { e[D[195][j]] = 49920 + j; d[49920 + j] = D[195][j];}
- D[196] = "�����������������������������������������������������������������횫횭횮횯횱횲횳횴횵횶횷횸횺횼횽횾횿훀훁훂훃훆훇훉훊훋������훍훎훏훐훒훓훕훖훘훚훛훜훝훞훟훡훢훣훥훦훧훩훪훫훬훭������훮훯훱훲훳훴훶훷훸훹훺훻훾훿휁휂휃휅휆휇휈휉휊휋휌휍휎휏휐휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼�".split("");
- for(j = 0; j != D[196].length; ++j) if(D[196][j].charCodeAt(0) !== 0xFFFD) { e[D[196][j]] = 50176 + j; d[50176 + j] = D[196][j];}
- D[197] = "�����������������������������������������������������������������휕휖휗휚휛휝휞휟휡휢휣휤휥휦휧휪휬휮휯휰휱휲휳휶휷휹������휺휻휽휾휿흀흁흂흃흅흆흈흊흋흌흍흎흏흒흓흕흚흛흜흝흞������흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵흶흷흸흹흺흻흾흿힀힂힃힄힅힆힇힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜�".split("");
- for(j = 0; j != D[197].length; ++j) if(D[197][j].charCodeAt(0) !== 0xFFFD) { e[D[197][j]] = 50432 + j; d[50432 + j] = D[197][j];}
- D[198] = "�����������������������������������������������������������������힍힎힏힑힒힓힔힕힖힗힚힜힞힟힠힡힢힣������������������������������������������������������������������������������퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁�".split("");
- for(j = 0; j != D[198].length; ++j) if(D[198][j].charCodeAt(0) !== 0xFFFD) { e[D[198][j]] = 50688 + j; d[50688 + j] = D[198][j];}
- D[199] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠�".split("");
- for(j = 0; j != D[199].length; ++j) if(D[199][j].charCodeAt(0) !== 0xFFFD) { e[D[199][j]] = 50944 + j; d[50944 + j] = D[199][j];}
- D[200] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝�".split("");
- for(j = 0; j != D[200].length; ++j) if(D[200][j].charCodeAt(0) !== 0xFFFD) { e[D[200][j]] = 51200 + j; d[51200 + j] = D[200][j];}
- D[202] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕�".split("");
- for(j = 0; j != D[202].length; ++j) if(D[202][j].charCodeAt(0) !== 0xFFFD) { e[D[202][j]] = 51712 + j; d[51712 + j] = D[202][j];}
- D[203] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢�".split("");
- for(j = 0; j != D[203].length; ++j) if(D[203][j].charCodeAt(0) !== 0xFFFD) { e[D[203][j]] = 51968 + j; d[51968 + j] = D[203][j];}
- D[204] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械�".split("");
- for(j = 0; j != D[204].length; ++j) if(D[204][j].charCodeAt(0) !== 0xFFFD) { e[D[204][j]] = 52224 + j; d[52224 + j] = D[204][j];}
- D[205] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜�".split("");
- for(j = 0; j != D[205].length; ++j) if(D[205][j].charCodeAt(0) !== 0xFFFD) { e[D[205][j]] = 52480 + j; d[52480 + j] = D[205][j];}
- D[206] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾�".split("");
- for(j = 0; j != D[206].length; ++j) if(D[206][j].charCodeAt(0) !== 0xFFFD) { e[D[206][j]] = 52736 + j; d[52736 + j] = D[206][j];}
- D[207] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴�".split("");
- for(j = 0; j != D[207].length; ++j) if(D[207][j].charCodeAt(0) !== 0xFFFD) { e[D[207][j]] = 52992 + j; d[52992 + j] = D[207][j];}
- D[208] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣�".split("");
- for(j = 0; j != D[208].length; ++j) if(D[208][j].charCodeAt(0) !== 0xFFFD) { e[D[208][j]] = 53248 + j; d[53248 + j] = D[208][j];}
- D[209] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩羅蘿螺裸邏那樂洛烙珞落諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉�".split("");
- for(j = 0; j != D[209].length; ++j) if(D[209][j].charCodeAt(0) !== 0xFFFD) { e[D[209][j]] = 53504 + j; d[53504 + j] = D[209][j];}
- D[210] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������納臘蠟衲囊娘廊朗浪狼郎乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧老蘆虜路露駑魯鷺碌祿綠菉錄鹿論壟弄濃籠聾膿農惱牢磊腦賂雷尿壘屢樓淚漏累縷陋嫩訥杻紐勒肋凜凌稜綾能菱陵尼泥匿溺多茶�".split("");
- for(j = 0; j != D[210].length; ++j) if(D[210][j].charCodeAt(0) !== 0xFFFD) { e[D[210][j]] = 53760 + j; d[53760 + j] = D[210][j];}
- D[211] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃�".split("");
- for(j = 0; j != D[211].length; ++j) if(D[211][j].charCodeAt(0) !== 0xFFFD) { e[D[211][j]] = 54016 + j; d[54016 + j] = D[211][j];}
- D[212] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅�".split("");
- for(j = 0; j != D[212].length; ++j) if(D[212][j].charCodeAt(0) !== 0xFFFD) { e[D[212][j]] = 54272 + j; d[54272 + j] = D[212][j];}
- D[213] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣�".split("");
- for(j = 0; j != D[213].length; ++j) if(D[213][j].charCodeAt(0) !== 0xFFFD) { e[D[213][j]] = 54528 + j; d[54528 + j] = D[213][j];}
- D[214] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼�".split("");
- for(j = 0; j != D[214].length; ++j) if(D[214][j].charCodeAt(0) !== 0xFFFD) { e[D[214][j]] = 54784 + j; d[54784 + j] = D[214][j];}
- D[215] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬�".split("");
- for(j = 0; j != D[215].length; ++j) if(D[215][j].charCodeAt(0) !== 0xFFFD) { e[D[215][j]] = 55040 + j; d[55040 + j] = D[215][j];}
- D[216] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅�".split("");
- for(j = 0; j != D[216].length; ++j) if(D[216][j].charCodeAt(0) !== 0xFFFD) { e[D[216][j]] = 55296 + j; d[55296 + j] = D[216][j];}
- D[217] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文�".split("");
- for(j = 0; j != D[217].length; ++j) if(D[217][j].charCodeAt(0) !== 0xFFFD) { e[D[217][j]] = 55552 + j; d[55552 + j] = D[217][j];}
- D[218] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑�".split("");
- for(j = 0; j != D[218].length; ++j) if(D[218][j].charCodeAt(0) !== 0xFFFD) { e[D[218][j]] = 55808 + j; d[55808 + j] = D[218][j];}
- D[219] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖�".split("");
- for(j = 0; j != D[219].length; ++j) if(D[219][j].charCodeAt(0) !== 0xFFFD) { e[D[219][j]] = 56064 + j; d[56064 + j] = D[219][j];}
- D[220] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦�".split("");
- for(j = 0; j != D[220].length; ++j) if(D[220][j].charCodeAt(0) !== 0xFFFD) { e[D[220][j]] = 56320 + j; d[56320 + j] = D[220][j];}
- D[221] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥�".split("");
- for(j = 0; j != D[221].length; ++j) if(D[221][j].charCodeAt(0) !== 0xFFFD) { e[D[221][j]] = 56576 + j; d[56576 + j] = D[221][j];}
- D[222] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索�".split("");
- for(j = 0; j != D[222].length; ++j) if(D[222][j].charCodeAt(0) !== 0xFFFD) { e[D[222][j]] = 56832 + j; d[56832 + j] = D[222][j];}
- D[223] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署�".split("");
- for(j = 0; j != D[223].length; ++j) if(D[223][j].charCodeAt(0) !== 0xFFFD) { e[D[223][j]] = 57088 + j; d[57088 + j] = D[223][j];}
- D[224] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬�".split("");
- for(j = 0; j != D[224].length; ++j) if(D[224][j].charCodeAt(0) !== 0xFFFD) { e[D[224][j]] = 57344 + j; d[57344 + j] = D[224][j];}
- D[225] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁�".split("");
- for(j = 0; j != D[225].length; ++j) if(D[225][j].charCodeAt(0) !== 0xFFFD) { e[D[225][j]] = 57600 + j; d[57600 + j] = D[225][j];}
- D[226] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧�".split("");
- for(j = 0; j != D[226].length; ++j) if(D[226][j].charCodeAt(0) !== 0xFFFD) { e[D[226][j]] = 57856 + j; d[57856 + j] = D[226][j];}
- D[227] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁�".split("");
- for(j = 0; j != D[227].length; ++j) if(D[227][j].charCodeAt(0) !== 0xFFFD) { e[D[227][j]] = 58112 + j; d[58112 + j] = D[227][j];}
- D[228] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額�".split("");
- for(j = 0; j != D[228].length; ++j) if(D[228][j].charCodeAt(0) !== 0xFFFD) { e[D[228][j]] = 58368 + j; d[58368 + j] = D[228][j];}
- D[229] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬�".split("");
- for(j = 0; j != D[229].length; ++j) if(D[229][j].charCodeAt(0) !== 0xFFFD) { e[D[229][j]] = 58624 + j; d[58624 + j] = D[229][j];}
- D[230] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒�".split("");
- for(j = 0; j != D[230].length; ++j) if(D[230][j].charCodeAt(0) !== 0xFFFD) { e[D[230][j]] = 58880 + j; d[58880 + j] = D[230][j];}
- D[231] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳�".split("");
- for(j = 0; j != D[231].length; ++j) if(D[231][j].charCodeAt(0) !== 0xFFFD) { e[D[231][j]] = 59136 + j; d[59136 + j] = D[231][j];}
- D[232] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療�".split("");
- for(j = 0; j != D[232].length; ++j) if(D[232][j].charCodeAt(0) !== 0xFFFD) { e[D[232][j]] = 59392 + j; d[59392 + j] = D[232][j];}
- D[233] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓�".split("");
- for(j = 0; j != D[233].length; ++j) if(D[233][j].charCodeAt(0) !== 0xFFFD) { e[D[233][j]] = 59648 + j; d[59648 + j] = D[233][j];}
- D[234] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜�".split("");
- for(j = 0; j != D[234].length; ++j) if(D[234][j].charCodeAt(0) !== 0xFFFD) { e[D[234][j]] = 59904 + j; d[59904 + j] = D[234][j];}
- D[235] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼�".split("");
- for(j = 0; j != D[235].length; ++j) if(D[235][j].charCodeAt(0) !== 0xFFFD) { e[D[235][j]] = 60160 + j; d[60160 + j] = D[235][j];}
- D[236] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄�".split("");
- for(j = 0; j != D[236].length; ++j) if(D[236][j].charCodeAt(0) !== 0xFFFD) { e[D[236][j]] = 60416 + j; d[60416 + j] = D[236][j];}
- D[237] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長�".split("");
- for(j = 0; j != D[237].length; ++j) if(D[237][j].charCodeAt(0) !== 0xFFFD) { e[D[237][j]] = 60672 + j; d[60672 + j] = D[237][j];}
- D[238] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱�".split("");
- for(j = 0; j != D[238].length; ++j) if(D[238][j].charCodeAt(0) !== 0xFFFD) { e[D[238][j]] = 60928 + j; d[60928 + j] = D[238][j];}
- D[239] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖�".split("");
- for(j = 0; j != D[239].length; ++j) if(D[239][j].charCodeAt(0) !== 0xFFFD) { e[D[239][j]] = 61184 + j; d[61184 + j] = D[239][j];}
- D[240] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫�".split("");
- for(j = 0; j != D[240].length; ++j) if(D[240][j].charCodeAt(0) !== 0xFFFD) { e[D[240][j]] = 61440 + j; d[61440 + j] = D[240][j];}
- D[241] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只�".split("");
- for(j = 0; j != D[241].length; ++j) if(D[241][j].charCodeAt(0) !== 0xFFFD) { e[D[241][j]] = 61696 + j; d[61696 + j] = D[241][j];}
- D[242] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯�".split("");
- for(j = 0; j != D[242].length; ++j) if(D[242][j].charCodeAt(0) !== 0xFFFD) { e[D[242][j]] = 61952 + j; d[61952 + j] = D[242][j];}
- D[243] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策�".split("");
- for(j = 0; j != D[243].length; ++j) if(D[243][j].charCodeAt(0) !== 0xFFFD) { e[D[243][j]] = 62208 + j; d[62208 + j] = D[243][j];}
- D[244] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢�".split("");
- for(j = 0; j != D[244].length; ++j) if(D[244][j].charCodeAt(0) !== 0xFFFD) { e[D[244][j]] = 62464 + j; d[62464 + j] = D[244][j];}
- D[245] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃�".split("");
- for(j = 0; j != D[245].length; ++j) if(D[245][j].charCodeAt(0) !== 0xFFFD) { e[D[245][j]] = 62720 + j; d[62720 + j] = D[245][j];}
- D[246] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託�".split("");
- for(j = 0; j != D[246].length; ++j) if(D[246][j].charCodeAt(0) !== 0xFFFD) { e[D[246][j]] = 62976 + j; d[62976 + j] = D[246][j];}
- D[247] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑�".split("");
- for(j = 0; j != D[247].length; ++j) if(D[247][j].charCodeAt(0) !== 0xFFFD) { e[D[247][j]] = 63232 + j; d[63232 + j] = D[247][j];}
- D[248] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃�".split("");
- for(j = 0; j != D[248].length; ++j) if(D[248][j].charCodeAt(0) !== 0xFFFD) { e[D[248][j]] = 63488 + j; d[63488 + j] = D[248][j];}
- D[249] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航�".split("");
- for(j = 0; j != D[249].length; ++j) if(D[249][j].charCodeAt(0) !== 0xFFFD) { e[D[249][j]] = 63744 + j; d[63744 + j] = D[249][j];}
- D[250] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型�".split("");
- for(j = 0; j != D[250].length; ++j) if(D[250][j].charCodeAt(0) !== 0xFFFD) { e[D[250][j]] = 64000 + j; d[64000 + j] = D[250][j];}
- D[251] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵�".split("");
- for(j = 0; j != D[251].length; ++j) if(D[251][j].charCodeAt(0) !== 0xFFFD) { e[D[251][j]] = 64256 + j; d[64256 + j] = D[251][j];}
- D[252] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆�".split("");
- for(j = 0; j != D[252].length; ++j) if(D[252][j].charCodeAt(0) !== 0xFFFD) { e[D[252][j]] = 64512 + j; d[64512 + j] = D[252][j];}
- D[253] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰�".split("");
- for(j = 0; j != D[253].length; ++j) if(D[253][j].charCodeAt(0) !== 0xFFFD) { e[D[253][j]] = 64768 + j; d[64768 + j] = D[253][j];}
- return {"enc": e, "dec": d }; })();
- cptable[950] = (function(){ var d = [], e = {}, D = [], j;
- D[0] = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[0].length; ++j) if(D[0][j].charCodeAt(0) !== 0xFFFD) { e[D[0][j]] = 0 + j; d[0 + j] = D[0][j];}
- D[161] = "���������������������������������������������������������������� ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚����������������������������������﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢﹣﹤﹥﹦~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/�".split("");
- for(j = 0; j != D[161].length; ++j) if(D[161][j].charCodeAt(0) !== 0xFFFD) { e[D[161][j]] = 41216 + j; d[41216 + j] = D[161][j];}
- D[162] = "����������������������������������������������������������������\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁▂▃▄▅▆▇█▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭����������������������������������╮╰╯═╞╪╡◢◣◥◤╱╲╳0123456789ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ〡〢〣〤〥〦〧〨〩十卄卅ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv�".split("");
- for(j = 0; j != D[162].length; ++j) if(D[162][j].charCodeAt(0) !== 0xFFFD) { e[D[162][j]] = 41472 + j; d[41472 + j] = D[162][j];}
- D[163] = "����������������������������������������������������������������wxyzΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρστυφχψωㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏ����������������������������������ㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦㄧㄨㄩ˙ˉˊˇˋ���������������������������������€������������������������������".split("");
- for(j = 0; j != D[163].length; ++j) if(D[163][j].charCodeAt(0) !== 0xFFFD) { e[D[163][j]] = 41728 + j; d[41728 + j] = D[163][j];}
- D[164] = "����������������������������������������������������������������一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才����������������������������������丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙�".split("");
- for(j = 0; j != D[164].length; ++j) if(D[164][j].charCodeAt(0) !== 0xFFFD) { e[D[164][j]] = 41984 + j; d[41984 + j] = D[164][j];}
- D[165] = "����������������������������������������������������������������世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外����������������������������������央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全�".split("");
- for(j = 0; j != D[165].length; ++j) if(D[165][j].charCodeAt(0) !== 0xFFFD) { e[D[165][j]] = 42240 + j; d[42240 + j] = D[165][j];}
- D[166] = "����������������������������������������������������������������共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年����������������������������������式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣�".split("");
- for(j = 0; j != D[166].length; ++j) if(D[166][j].charCodeAt(0) !== 0xFFFD) { e[D[166][j]] = 42496 + j; d[42496 + j] = D[166][j];}
- D[167] = "����������������������������������������������������������������作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍����������������������������������均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠�".split("");
- for(j = 0; j != D[167].length; ++j) if(D[167][j].charCodeAt(0) !== 0xFFFD) { e[D[167][j]] = 42752 + j; d[42752 + j] = D[167][j];}
- D[168] = "����������������������������������������������������������������杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒����������������������������������芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵�".split("");
- for(j = 0; j != D[168].length; ++j) if(D[168][j].charCodeAt(0) !== 0xFFFD) { e[D[168][j]] = 43008 + j; d[43008 + j] = D[168][j];}
- D[169] = "����������������������������������������������������������������咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居����������������������������������屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊�".split("");
- for(j = 0; j != D[169].length; ++j) if(D[169][j].charCodeAt(0) !== 0xFFFD) { e[D[169][j]] = 43264 + j; d[43264 + j] = D[169][j];}
- D[170] = "����������������������������������������������������������������昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠����������������������������������炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附�".split("");
- for(j = 0; j != D[170].length; ++j) if(D[170][j].charCodeAt(0) !== 0xFFFD) { e[D[170][j]] = 43520 + j; d[43520 + j] = D[170][j];}
- D[171] = "����������������������������������������������������������������陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品����������������������������������哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷�".split("");
- for(j = 0; j != D[171].length; ++j) if(D[171][j].charCodeAt(0) !== 0xFFFD) { e[D[171][j]] = 43776 + j; d[43776 + j] = D[171][j];}
- D[172] = "����������������������������������������������������������������拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗����������������������������������活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄�".split("");
- for(j = 0; j != D[172].length; ++j) if(D[172][j].charCodeAt(0) !== 0xFFFD) { e[D[172][j]] = 44032 + j; d[44032 + j] = D[172][j];}
- D[173] = "����������������������������������������������������������������耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥����������������������������������迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪�".split("");
- for(j = 0; j != D[173].length; ++j) if(D[173][j].charCodeAt(0) !== 0xFFFD) { e[D[173][j]] = 44288 + j; d[44288 + j] = D[173][j];}
- D[174] = "����������������������������������������������������������������哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙����������������������������������恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓�".split("");
- for(j = 0; j != D[174].length; ++j) if(D[174][j].charCodeAt(0) !== 0xFFFD) { e[D[174][j]] = 44544 + j; d[44544 + j] = D[174][j];}
- D[175] = "����������������������������������������������������������������浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷����������������������������������砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃�".split("");
- for(j = 0; j != D[175].length; ++j) if(D[175][j].charCodeAt(0) !== 0xFFFD) { e[D[175][j]] = 44800 + j; d[44800 + j] = D[175][j];}
- D[176] = "����������������������������������������������������������������虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡����������������������������������陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀�".split("");
- for(j = 0; j != D[176].length; ++j) if(D[176][j].charCodeAt(0) !== 0xFFFD) { e[D[176][j]] = 45056 + j; d[45056 + j] = D[176][j];}
- D[177] = "����������������������������������������������������������������娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽����������������������������������情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺�".split("");
- for(j = 0; j != D[177].length; ++j) if(D[177][j].charCodeAt(0) !== 0xFFFD) { e[D[177][j]] = 45312 + j; d[45312 + j] = D[177][j];}
- D[178] = "����������������������������������������������������������������毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶����������������������������������瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼�".split("");
- for(j = 0; j != D[178].length; ++j) if(D[178][j].charCodeAt(0) !== 0xFFFD) { e[D[178][j]] = 45568 + j; d[45568 + j] = D[178][j];}
- D[179] = "����������������������������������������������������������������莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途����������������������������������部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠�".split("");
- for(j = 0; j != D[179].length; ++j) if(D[179][j].charCodeAt(0) !== 0xFFFD) { e[D[179][j]] = 45824 + j; d[45824 + j] = D[179][j];}
- D[180] = "����������������������������������������������������������������婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍����������������������������������插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋�".split("");
- for(j = 0; j != D[180].length; ++j) if(D[180][j].charCodeAt(0) !== 0xFFFD) { e[D[180][j]] = 46080 + j; d[46080 + j] = D[180][j];}
- D[181] = "����������������������������������������������������������������溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘����������������������������������窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁�".split("");
- for(j = 0; j != D[181].length; ++j) if(D[181][j].charCodeAt(0) !== 0xFFFD) { e[D[181][j]] = 46336 + j; d[46336 + j] = D[181][j];}
- D[182] = "����������������������������������������������������������������詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑����������������������������������間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼�".split("");
- for(j = 0; j != D[182].length; ++j) if(D[182][j].charCodeAt(0) !== 0xFFFD) { e[D[182][j]] = 46592 + j; d[46592 + j] = D[182][j];}
- D[183] = "����������������������������������������������������������������媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業����������������������������������楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督�".split("");
- for(j = 0; j != D[183].length; ++j) if(D[183][j].charCodeAt(0) !== 0xFFFD) { e[D[183][j]] = 46848 + j; d[46848 + j] = D[183][j];}
- D[184] = "����������������������������������������������������������������睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫����������������������������������腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊�".split("");
- for(j = 0; j != D[184].length; ++j) if(D[184][j].charCodeAt(0) !== 0xFFFD) { e[D[184][j]] = 47104 + j; d[47104 + j] = D[184][j];}
- D[185] = "����������������������������������������������������������������辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴����������������������������������飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇�".split("");
- for(j = 0; j != D[185].length; ++j) if(D[185][j].charCodeAt(0) !== 0xFFFD) { e[D[185][j]] = 47360 + j; d[47360 + j] = D[185][j];}
- D[186] = "����������������������������������������������������������������愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢����������������������������������滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬�".split("");
- for(j = 0; j != D[186].length; ++j) if(D[186][j].charCodeAt(0) !== 0xFFFD) { e[D[186][j]] = 47616 + j; d[47616 + j] = D[186][j];}
- D[187] = "����������������������������������������������������������������罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤����������������������������������說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜�".split("");
- for(j = 0; j != D[187].length; ++j) if(D[187][j].charCodeAt(0) !== 0xFFFD) { e[D[187][j]] = 47872 + j; d[47872 + j] = D[187][j];}
- D[188] = "����������������������������������������������������������������劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂����������������������������������慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃�".split("");
- for(j = 0; j != D[188].length; ++j) if(D[188][j].charCodeAt(0) !== 0xFFFD) { e[D[188][j]] = 48128 + j; d[48128 + j] = D[188][j];}
- D[189] = "����������������������������������������������������������������瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯����������������������������������翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞�".split("");
- for(j = 0; j != D[189].length; ++j) if(D[189][j].charCodeAt(0) !== 0xFFFD) { e[D[189][j]] = 48384 + j; d[48384 + j] = D[189][j];}
- D[190] = "����������������������������������������������������������������輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉����������������������������������鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡�".split("");
- for(j = 0; j != D[190].length; ++j) if(D[190][j].charCodeAt(0) !== 0xFFFD) { e[D[190][j]] = 48640 + j; d[48640 + j] = D[190][j];}
- D[191] = "����������������������������������������������������������������濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊����������������������������������縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚�".split("");
- for(j = 0; j != D[191].length; ++j) if(D[191][j].charCodeAt(0) !== 0xFFFD) { e[D[191][j]] = 48896 + j; d[48896 + j] = D[191][j];}
- D[192] = "����������������������������������������������������������������錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇����������������������������������嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬�".split("");
- for(j = 0; j != D[192].length; ++j) if(D[192][j].charCodeAt(0) !== 0xFFFD) { e[D[192][j]] = 49152 + j; d[49152 + j] = D[192][j];}
- D[193] = "����������������������������������������������������������������瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪����������������������������������薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁�".split("");
- for(j = 0; j != D[193].length; ++j) if(D[193][j].charCodeAt(0) !== 0xFFFD) { e[D[193][j]] = 49408 + j; d[49408 + j] = D[193][j];}
- D[194] = "����������������������������������������������������������������駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘����������������������������������癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦�".split("");
- for(j = 0; j != D[194].length; ++j) if(D[194][j].charCodeAt(0) !== 0xFFFD) { e[D[194][j]] = 49664 + j; d[49664 + j] = D[194][j];}
- D[195] = "����������������������������������������������������������������鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸����������������������������������獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類�".split("");
- for(j = 0; j != D[195].length; ++j) if(D[195][j].charCodeAt(0) !== 0xFFFD) { e[D[195][j]] = 49920 + j; d[49920 + j] = D[195][j];}
- D[196] = "����������������������������������������������������������������願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼����������������������������������纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴�".split("");
- for(j = 0; j != D[196].length; ++j) if(D[196][j].charCodeAt(0) !== 0xFFFD) { e[D[196][j]] = 50176 + j; d[50176 + j] = D[196][j];}
- D[197] = "����������������������������������������������������������������護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬����������������������������������禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒�".split("");
- for(j = 0; j != D[197].length; ++j) if(D[197][j].charCodeAt(0) !== 0xFFFD) { e[D[197][j]] = 50432 + j; d[50432 + j] = D[197][j];}
- D[198] = "����������������������������������������������������������������讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲���������������������������������������������������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[198].length; ++j) if(D[198][j].charCodeAt(0) !== 0xFFFD) { e[D[198][j]] = 50688 + j; d[50688 + j] = D[198][j];}
- D[201] = "����������������������������������������������������������������乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕����������������������������������氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋�".split("");
- for(j = 0; j != D[201].length; ++j) if(D[201][j].charCodeAt(0) !== 0xFFFD) { e[D[201][j]] = 51456 + j; d[51456 + j] = D[201][j];}
- D[202] = "����������������������������������������������������������������汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘����������������������������������吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇�".split("");
- for(j = 0; j != D[202].length; ++j) if(D[202][j].charCodeAt(0) !== 0xFFFD) { e[D[202][j]] = 51712 + j; d[51712 + j] = D[202][j];}
- D[203] = "����������������������������������������������������������������杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓����������������������������������芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢�".split("");
- for(j = 0; j != D[203].length; ++j) if(D[203][j].charCodeAt(0) !== 0xFFFD) { e[D[203][j]] = 51968 + j; d[51968 + j] = D[203][j];}
- D[204] = "����������������������������������������������������������������坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋����������������������������������怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲�".split("");
- for(j = 0; j != D[204].length; ++j) if(D[204][j].charCodeAt(0) !== 0xFFFD) { e[D[204][j]] = 52224 + j; d[52224 + j] = D[204][j];}
- D[205] = "����������������������������������������������������������������泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺����������������������������������矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏�".split("");
- for(j = 0; j != D[205].length; ++j) if(D[205][j].charCodeAt(0) !== 0xFFFD) { e[D[205][j]] = 52480 + j; d[52480 + j] = D[205][j];}
- D[206] = "����������������������������������������������������������������哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛����������������������������������峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺�".split("");
- for(j = 0; j != D[206].length; ++j) if(D[206][j].charCodeAt(0) !== 0xFFFD) { e[D[206][j]] = 52736 + j; d[52736 + j] = D[206][j];}
- D[207] = "����������������������������������������������������������������柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂����������������������������������洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀�".split("");
- for(j = 0; j != D[207].length; ++j) if(D[207][j].charCodeAt(0) !== 0xFFFD) { e[D[207][j]] = 52992 + j; d[52992 + j] = D[207][j];}
- D[208] = "����������������������������������������������������������������穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪����������������������������������苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱�".split("");
- for(j = 0; j != D[208].length; ++j) if(D[208][j].charCodeAt(0) !== 0xFFFD) { e[D[208][j]] = 53248 + j; d[53248 + j] = D[208][j];}
- D[209] = "����������������������������������������������������������������唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧����������������������������������恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤�".split("");
- for(j = 0; j != D[209].length; ++j) if(D[209][j].charCodeAt(0) !== 0xFFFD) { e[D[209][j]] = 53504 + j; d[53504 + j] = D[209][j];}
- D[210] = "����������������������������������������������������������������毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸����������������������������������牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐�".split("");
- for(j = 0; j != D[210].length; ++j) if(D[210][j].charCodeAt(0) !== 0xFFFD) { e[D[210][j]] = 53760 + j; d[53760 + j] = D[210][j];}
- D[211] = "����������������������������������������������������������������笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢����������������������������������荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐�".split("");
- for(j = 0; j != D[211].length; ++j) if(D[211][j].charCodeAt(0) !== 0xFFFD) { e[D[211][j]] = 54016 + j; d[54016 + j] = D[211][j];}
- D[212] = "����������������������������������������������������������������酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅����������������������������������唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏�".split("");
- for(j = 0; j != D[212].length; ++j) if(D[212][j].charCodeAt(0) !== 0xFFFD) { e[D[212][j]] = 54272 + j; d[54272 + j] = D[212][j];}
- D[213] = "����������������������������������������������������������������崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟����������������������������������捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉�".split("");
- for(j = 0; j != D[213].length; ++j) if(D[213][j].charCodeAt(0) !== 0xFFFD) { e[D[213][j]] = 54528 + j; d[54528 + j] = D[213][j];}
- D[214] = "����������������������������������������������������������������淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏����������������������������������痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟�".split("");
- for(j = 0; j != D[214].length; ++j) if(D[214][j].charCodeAt(0) !== 0xFFFD) { e[D[214][j]] = 54784 + j; d[54784 + j] = D[214][j];}
- D[215] = "����������������������������������������������������������������耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷����������������������������������蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪�".split("");
- for(j = 0; j != D[215].length; ++j) if(D[215][j].charCodeAt(0) !== 0xFFFD) { e[D[215][j]] = 55040 + j; d[55040 + j] = D[215][j];}
- D[216] = "����������������������������������������������������������������釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷����������������������������������堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔�".split("");
- for(j = 0; j != D[216].length; ++j) if(D[216][j].charCodeAt(0) !== 0xFFFD) { e[D[216][j]] = 55296 + j; d[55296 + j] = D[216][j];}
- D[217] = "����������������������������������������������������������������惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒����������������������������������晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞�".split("");
- for(j = 0; j != D[217].length; ++j) if(D[217][j].charCodeAt(0) !== 0xFFFD) { e[D[217][j]] = 55552 + j; d[55552 + j] = D[217][j];}
- D[218] = "����������������������������������������������������������������湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖����������������������������������琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥�".split("");
- for(j = 0; j != D[218].length; ++j) if(D[218][j].charCodeAt(0) !== 0xFFFD) { e[D[218][j]] = 55808 + j; d[55808 + j] = D[218][j];}
- D[219] = "����������������������������������������������������������������罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳����������������������������������菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺�".split("");
- for(j = 0; j != D[219].length; ++j) if(D[219][j].charCodeAt(0) !== 0xFFFD) { e[D[219][j]] = 56064 + j; d[56064 + j] = D[219][j];}
- D[220] = "����������������������������������������������������������������軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈����������������������������������隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆�".split("");
- for(j = 0; j != D[220].length; ++j) if(D[220][j].charCodeAt(0) !== 0xFFFD) { e[D[220][j]] = 56320 + j; d[56320 + j] = D[220][j];}
- D[221] = "����������������������������������������������������������������媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤����������������������������������搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼�".split("");
- for(j = 0; j != D[221].length; ++j) if(D[221][j].charCodeAt(0) !== 0xFFFD) { e[D[221][j]] = 56576 + j; d[56576 + j] = D[221][j];}
- D[222] = "����������������������������������������������������������������毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓����������������������������������煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓�".split("");
- for(j = 0; j != D[222].length; ++j) if(D[222][j].charCodeAt(0) !== 0xFFFD) { e[D[222][j]] = 56832 + j; d[56832 + j] = D[222][j];}
- D[223] = "����������������������������������������������������������������稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯����������������������������������腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤�".split("");
- for(j = 0; j != D[223].length; ++j) if(D[223][j].charCodeAt(0) !== 0xFFFD) { e[D[223][j]] = 57088 + j; d[57088 + j] = D[223][j];}
- D[224] = "����������������������������������������������������������������觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿����������������������������������遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠�".split("");
- for(j = 0; j != D[224].length; ++j) if(D[224][j].charCodeAt(0) !== 0xFFFD) { e[D[224][j]] = 57344 + j; d[57344 + j] = D[224][j];}
- D[225] = "����������������������������������������������������������������凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠����������������������������������寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉�".split("");
- for(j = 0; j != D[225].length; ++j) if(D[225][j].charCodeAt(0) !== 0xFFFD) { e[D[225][j]] = 57600 + j; d[57600 + j] = D[225][j];}
- D[226] = "����������������������������������������������������������������榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊����������������������������������漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓�".split("");
- for(j = 0; j != D[226].length; ++j) if(D[226][j].charCodeAt(0) !== 0xFFFD) { e[D[226][j]] = 57856 + j; d[57856 + j] = D[226][j];}
- D[227] = "����������������������������������������������������������������禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞����������������������������������耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻�".split("");
- for(j = 0; j != D[227].length; ++j) if(D[227][j].charCodeAt(0) !== 0xFFFD) { e[D[227][j]] = 58112 + j; d[58112 + j] = D[227][j];}
- D[228] = "����������������������������������������������������������������裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍����������������������������������銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘�".split("");
- for(j = 0; j != D[228].length; ++j) if(D[228][j].charCodeAt(0) !== 0xFFFD) { e[D[228][j]] = 58368 + j; d[58368 + j] = D[228][j];}
- D[229] = "����������������������������������������������������������������噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉����������������������������������憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒�".split("");
- for(j = 0; j != D[229].length; ++j) if(D[229][j].charCodeAt(0) !== 0xFFFD) { e[D[229][j]] = 58624 + j; d[58624 + j] = D[229][j];}
- D[230] = "����������������������������������������������������������������澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙����������������������������������獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟�".split("");
- for(j = 0; j != D[230].length; ++j) if(D[230][j].charCodeAt(0) !== 0xFFFD) { e[D[230][j]] = 58880 + j; d[58880 + j] = D[230][j];}
- D[231] = "����������������������������������������������������������������膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢����������������������������������蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧�".split("");
- for(j = 0; j != D[231].length; ++j) if(D[231][j].charCodeAt(0) !== 0xFFFD) { e[D[231][j]] = 59136 + j; d[59136 + j] = D[231][j];}
- D[232] = "����������������������������������������������������������������踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓����������������������������������銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮�".split("");
- for(j = 0; j != D[232].length; ++j) if(D[232][j].charCodeAt(0) !== 0xFFFD) { e[D[232][j]] = 59392 + j; d[59392 + j] = D[232][j];}
- D[233] = "����������������������������������������������������������������噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺����������������������������������憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸�".split("");
- for(j = 0; j != D[233].length; ++j) if(D[233][j].charCodeAt(0) !== 0xFFFD) { e[D[233][j]] = 59648 + j; d[59648 + j] = D[233][j];}
- D[234] = "����������������������������������������������������������������澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙����������������������������������瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘�".split("");
- for(j = 0; j != D[234].length; ++j) if(D[234][j].charCodeAt(0) !== 0xFFFD) { e[D[234][j]] = 59904 + j; d[59904 + j] = D[234][j];}
- D[235] = "����������������������������������������������������������������蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠����������������������������������諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌�".split("");
- for(j = 0; j != D[235].length; ++j) if(D[235][j].charCodeAt(0) !== 0xFFFD) { e[D[235][j]] = 60160 + j; d[60160 + j] = D[235][j];}
- D[236] = "����������������������������������������������������������������錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕����������������������������������魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎�".split("");
- for(j = 0; j != D[236].length; ++j) if(D[236][j].charCodeAt(0) !== 0xFFFD) { e[D[236][j]] = 60416 + j; d[60416 + j] = D[236][j];}
- D[237] = "����������������������������������������������������������������檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶����������������������������������瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞�".split("");
- for(j = 0; j != D[237].length; ++j) if(D[237][j].charCodeAt(0) !== 0xFFFD) { e[D[237][j]] = 60672 + j; d[60672 + j] = D[237][j];}
- D[238] = "����������������������������������������������������������������蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞����������������������������������謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜�".split("");
- for(j = 0; j != D[238].length; ++j) if(D[238][j].charCodeAt(0) !== 0xFFFD) { e[D[238][j]] = 60928 + j; d[60928 + j] = D[238][j];}
- D[239] = "����������������������������������������������������������������鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰����������������������������������鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶�".split("");
- for(j = 0; j != D[239].length; ++j) if(D[239][j].charCodeAt(0) !== 0xFFFD) { e[D[239][j]] = 61184 + j; d[61184 + j] = D[239][j];}
- D[240] = "����������������������������������������������������������������璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒����������������������������������臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧�".split("");
- for(j = 0; j != D[240].length; ++j) if(D[240][j].charCodeAt(0) !== 0xFFFD) { e[D[240][j]] = 61440 + j; d[61440 + j] = D[240][j];}
- D[241] = "����������������������������������������������������������������蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪����������������������������������鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰�".split("");
- for(j = 0; j != D[241].length; ++j) if(D[241][j].charCodeAt(0) !== 0xFFFD) { e[D[241][j]] = 61696 + j; d[61696 + j] = D[241][j];}
- D[242] = "����������������������������������������������������������������徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛����������������������������������礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕�".split("");
- for(j = 0; j != D[242].length; ++j) if(D[242][j].charCodeAt(0) !== 0xFFFD) { e[D[242][j]] = 61952 + j; d[61952 + j] = D[242][j];}
- D[243] = "����������������������������������������������������������������譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦����������������������������������鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲�".split("");
- for(j = 0; j != D[243].length; ++j) if(D[243][j].charCodeAt(0) !== 0xFFFD) { e[D[243][j]] = 62208 + j; d[62208 + j] = D[243][j];}
- D[244] = "����������������������������������������������������������������嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩����������������������������������禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿�".split("");
- for(j = 0; j != D[244].length; ++j) if(D[244][j].charCodeAt(0) !== 0xFFFD) { e[D[244][j]] = 62464 + j; d[62464 + j] = D[244][j];}
- D[245] = "����������������������������������������������������������������鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛����������������������������������鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥�".split("");
- for(j = 0; j != D[245].length; ++j) if(D[245][j].charCodeAt(0) !== 0xFFFD) { e[D[245][j]] = 62720 + j; d[62720 + j] = D[245][j];}
- D[246] = "����������������������������������������������������������������蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺����������������������������������騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚�".split("");
- for(j = 0; j != D[246].length; ++j) if(D[246][j].charCodeAt(0) !== 0xFFFD) { e[D[246][j]] = 62976 + j; d[62976 + j] = D[246][j];}
- D[247] = "����������������������������������������������������������������糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊����������������������������������驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾�".split("");
- for(j = 0; j != D[247].length; ++j) if(D[247][j].charCodeAt(0) !== 0xFFFD) { e[D[247][j]] = 63232 + j; d[63232 + j] = D[247][j];}
- D[248] = "����������������������������������������������������������������讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏����������������������������������齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚�".split("");
- for(j = 0; j != D[248].length; ++j) if(D[248][j].charCodeAt(0) !== 0xFFFD) { e[D[248][j]] = 63488 + j; d[63488 + j] = D[248][j];}
- D[249] = "����������������������������������������������������������������纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊����������������������������������龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓�".split("");
- for(j = 0; j != D[249].length; ++j) if(D[249][j].charCodeAt(0) !== 0xFFFD) { e[D[249][j]] = 63744 + j; d[63744 + j] = D[249][j];}
- return {"enc": e, "dec": d }; })();
- cptable[1250] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[1251] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[1252] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[1253] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[1254] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[1255] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹ�ֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת���", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[1256] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œں ،¢£¤¥¦§¨©ھ«¬®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûüے", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[1257] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[1258] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[10000] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[10006] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[10007] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[10008] = (function(){ var d = [], e = {}, D = [], j;
- D[0] = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~���������������������������������������������������������������������������������������".split("");
- for(j = 0; j != D[0].length; ++j) if(D[0][j].charCodeAt(0) !== 0xFFFD) { e[D[0][j]] = 0 + j; d[0 + j] = D[0][j];}
- D[161] = "����������������������������������������������������������������������������������������������������������������������������������������������������������������� 、。・ˉˇ¨〃々―~�…‘’“”〔〕〈〉《》「」『』〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓�".split("");
- for(j = 0; j != D[161].length; ++j) if(D[161][j].charCodeAt(0) !== 0xFFFD) { e[D[161][j]] = 41216 + j; d[41216 + j] = D[161][j];}
- D[162] = "���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂⒃⒄⒅⒆⒇①②③④⑤⑥⑦⑧⑨⑩��㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩��ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ���".split("");
- for(j = 0; j != D[162].length; ++j) if(D[162][j].charCodeAt(0) !== 0xFFFD) { e[D[162][j]] = 41472 + j; d[41472 + j] = D[162][j];}
- D[163] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������!"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|} ̄�".split("");
- for(j = 0; j != D[163].length; ++j) if(D[163][j].charCodeAt(0) !== 0xFFFD) { e[D[163][j]] = 41728 + j; d[41728 + j] = D[163][j];}
- D[164] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをん������������".split("");
- for(j = 0; j != D[164].length; ++j) if(D[164][j].charCodeAt(0) !== 0xFFFD) { e[D[164][j]] = 41984 + j; d[41984 + j] = D[164][j];}
- D[165] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶ���������".split("");
- for(j = 0; j != D[165].length; ++j) if(D[165][j].charCodeAt(0) !== 0xFFFD) { e[D[165][j]] = 42240 + j; d[42240 + j] = D[165][j];}
- D[166] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ��������αβγδεζηθικλμνξοπρστυφχψω���������������������������������������".split("");
- for(j = 0; j != D[166].length; ++j) if(D[166][j].charCodeAt(0) !== 0xFFFD) { e[D[166][j]] = 42496 + j; d[42496 + j] = D[166][j];}
- D[167] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ���������������абвгдеёжзийклмнопрстуфхцчшщъыьэюя��������������".split("");
- for(j = 0; j != D[167].length; ++j) if(D[167][j].charCodeAt(0) !== 0xFFFD) { e[D[167][j]] = 42752 + j; d[42752 + j] = D[167][j];}
- D[168] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüê����������ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦㄧㄨㄩ����������������������".split("");
- for(j = 0; j != D[168].length; ++j) if(D[168][j].charCodeAt(0) !== 0xFFFD) { e[D[168][j]] = 43008 + j; d[43008 + j] = D[168][j];}
- D[169] = "��������������������������������������������������������������������������������������������������������������������������������������������������������������������─━│┃┄┅┆┇┈┉┊┋┌┍┎┏┐┑┒┓└┕┖┗┘┙┚┛├┝┞┟┠┡┢┣┤┥┦┧┨┩┪┫┬┭┮┯┰┱┲┳┴┵┶┷┸┹┺┻┼┽┾┿╀╁╂╃╄╅╆╇╈╉╊╋����������������".split("");
- for(j = 0; j != D[169].length; ++j) if(D[169][j].charCodeAt(0) !== 0xFFFD) { e[D[169][j]] = 43264 + j; d[43264 + j] = D[169][j];}
- D[176] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥�".split("");
- for(j = 0; j != D[176].length; ++j) if(D[176][j].charCodeAt(0) !== 0xFFFD) { e[D[176][j]] = 45056 + j; d[45056 + j] = D[176][j];}
- D[177] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳�".split("");
- for(j = 0; j != D[177].length; ++j) if(D[177][j].charCodeAt(0) !== 0xFFFD) { e[D[177][j]] = 45312 + j; d[45312 + j] = D[177][j];}
- D[178] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖�".split("");
- for(j = 0; j != D[178].length; ++j) if(D[178][j].charCodeAt(0) !== 0xFFFD) { e[D[178][j]] = 45568 + j; d[45568 + j] = D[178][j];}
- D[179] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚�".split("");
- for(j = 0; j != D[179].length; ++j) if(D[179][j].charCodeAt(0) !== 0xFFFD) { e[D[179][j]] = 45824 + j; d[45824 + j] = D[179][j];}
- D[180] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮�".split("");
- for(j = 0; j != D[180].length; ++j) if(D[180][j].charCodeAt(0) !== 0xFFFD) { e[D[180][j]] = 46080 + j; d[46080 + j] = D[180][j];}
- D[181] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠�".split("");
- for(j = 0; j != D[181].length; ++j) if(D[181][j].charCodeAt(0) !== 0xFFFD) { e[D[181][j]] = 46336 + j; d[46336 + j] = D[181][j];}
- D[182] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二�".split("");
- for(j = 0; j != D[182].length; ++j) if(D[182][j].charCodeAt(0) !== 0xFFFD) { e[D[182][j]] = 46592 + j; d[46592 + j] = D[182][j];}
- D[183] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服�".split("");
- for(j = 0; j != D[183].length; ++j) if(D[183][j].charCodeAt(0) !== 0xFFFD) { e[D[183][j]] = 46848 + j; d[46848 + j] = D[183][j];}
- D[184] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹�".split("");
- for(j = 0; j != D[184].length; ++j) if(D[184][j].charCodeAt(0) !== 0xFFFD) { e[D[184][j]] = 47104 + j; d[47104 + j] = D[184][j];}
- D[185] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈�".split("");
- for(j = 0; j != D[185].length; ++j) if(D[185][j].charCodeAt(0) !== 0xFFFD) { e[D[185][j]] = 47360 + j; d[47360 + j] = D[185][j];}
- D[186] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖�".split("");
- for(j = 0; j != D[186].length; ++j) if(D[186][j].charCodeAt(0) !== 0xFFFD) { e[D[186][j]] = 47616 + j; d[47616 + j] = D[186][j];}
- D[187] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕�".split("");
- for(j = 0; j != D[187].length; ++j) if(D[187][j].charCodeAt(0) !== 0xFFFD) { e[D[187][j]] = 47872 + j; d[47872 + j] = D[187][j];}
- D[188] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件�".split("");
- for(j = 0; j != D[188].length; ++j) if(D[188][j].charCodeAt(0) !== 0xFFFD) { e[D[188][j]] = 48128 + j; d[48128 + j] = D[188][j];}
- D[189] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸�".split("");
- for(j = 0; j != D[189].length; ++j) if(D[189][j].charCodeAt(0) !== 0xFFFD) { e[D[189][j]] = 48384 + j; d[48384 + j] = D[189][j];}
- D[190] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻�".split("");
- for(j = 0; j != D[190].length; ++j) if(D[190][j].charCodeAt(0) !== 0xFFFD) { e[D[190][j]] = 48640 + j; d[48640 + j] = D[190][j];}
- D[191] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀�".split("");
- for(j = 0; j != D[191].length; ++j) if(D[191][j].charCodeAt(0) !== 0xFFFD) { e[D[191][j]] = 48896 + j; d[48896 + j] = D[191][j];}
- D[192] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐�".split("");
- for(j = 0; j != D[192].length; ++j) if(D[192][j].charCodeAt(0) !== 0xFFFD) { e[D[192][j]] = 49152 + j; d[49152 + j] = D[192][j];}
- D[193] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿�".split("");
- for(j = 0; j != D[193].length; ++j) if(D[193][j].charCodeAt(0) !== 0xFFFD) { e[D[193][j]] = 49408 + j; d[49408 + j] = D[193][j];}
- D[194] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫�".split("");
- for(j = 0; j != D[194].length; ++j) if(D[194][j].charCodeAt(0) !== 0xFFFD) { e[D[194][j]] = 49664 + j; d[49664 + j] = D[194][j];}
- D[195] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸�".split("");
- for(j = 0; j != D[195].length; ++j) if(D[195][j].charCodeAt(0) !== 0xFFFD) { e[D[195][j]] = 49920 + j; d[49920 + j] = D[195][j];}
- D[196] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁�".split("");
- for(j = 0; j != D[196].length; ++j) if(D[196][j].charCodeAt(0) !== 0xFFFD) { e[D[196][j]] = 50176 + j; d[50176 + j] = D[196][j];}
- D[197] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗�".split("");
- for(j = 0; j != D[197].length; ++j) if(D[197][j].charCodeAt(0) !== 0xFFFD) { e[D[197][j]] = 50432 + j; d[50432 + j] = D[197][j];}
- D[198] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐�".split("");
- for(j = 0; j != D[198].length; ++j) if(D[198][j].charCodeAt(0) !== 0xFFFD) { e[D[198][j]] = 50688 + j; d[50688 + j] = D[198][j];}
- D[199] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠�".split("");
- for(j = 0; j != D[199].length; ++j) if(D[199][j].charCodeAt(0) !== 0xFFFD) { e[D[199][j]] = 50944 + j; d[50944 + j] = D[199][j];}
- D[200] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁�".split("");
- for(j = 0; j != D[200].length; ++j) if(D[200][j].charCodeAt(0) !== 0xFFFD) { e[D[200][j]] = 51200 + j; d[51200 + j] = D[200][j];}
- D[201] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳�".split("");
- for(j = 0; j != D[201].length; ++j) if(D[201][j].charCodeAt(0) !== 0xFFFD) { e[D[201][j]] = 51456 + j; d[51456 + j] = D[201][j];}
- D[202] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱�".split("");
- for(j = 0; j != D[202].length; ++j) if(D[202][j].charCodeAt(0) !== 0xFFFD) { e[D[202][j]] = 51712 + j; d[51712 + j] = D[202][j];}
- D[203] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔�".split("");
- for(j = 0; j != D[203].length; ++j) if(D[203][j].charCodeAt(0) !== 0xFFFD) { e[D[203][j]] = 51968 + j; d[51968 + j] = D[203][j];}
- D[204] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃�".split("");
- for(j = 0; j != D[204].length; ++j) if(D[204][j].charCodeAt(0) !== 0xFFFD) { e[D[204][j]] = 52224 + j; d[52224 + j] = D[204][j];}
- D[205] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威�".split("");
- for(j = 0; j != D[205].length; ++j) if(D[205][j].charCodeAt(0) !== 0xFFFD) { e[D[205][j]] = 52480 + j; d[52480 + j] = D[205][j];}
- D[206] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺�".split("");
- for(j = 0; j != D[206].length; ++j) if(D[206][j].charCodeAt(0) !== 0xFFFD) { e[D[206][j]] = 52736 + j; d[52736 + j] = D[206][j];}
- D[207] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓�".split("");
- for(j = 0; j != D[207].length; ++j) if(D[207][j].charCodeAt(0) !== 0xFFFD) { e[D[207][j]] = 52992 + j; d[52992 + j] = D[207][j];}
- D[208] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄�".split("");
- for(j = 0; j != D[208].length; ++j) if(D[208][j].charCodeAt(0) !== 0xFFFD) { e[D[208][j]] = 53248 + j; d[53248 + j] = D[208][j];}
- D[209] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶�".split("");
- for(j = 0; j != D[209].length; ++j) if(D[209][j].charCodeAt(0) !== 0xFFFD) { e[D[209][j]] = 53504 + j; d[53504 + j] = D[209][j];}
- D[210] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐�".split("");
- for(j = 0; j != D[210].length; ++j) if(D[210][j].charCodeAt(0) !== 0xFFFD) { e[D[210][j]] = 53760 + j; d[53760 + j] = D[210][j];}
- D[211] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉�".split("");
- for(j = 0; j != D[211].length; ++j) if(D[211][j].charCodeAt(0) !== 0xFFFD) { e[D[211][j]] = 54016 + j; d[54016 + j] = D[211][j];}
- D[212] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧�".split("");
- for(j = 0; j != D[212].length; ++j) if(D[212][j].charCodeAt(0) !== 0xFFFD) { e[D[212][j]] = 54272 + j; d[54272 + j] = D[212][j];}
- D[213] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政�".split("");
- for(j = 0; j != D[213].length; ++j) if(D[213][j].charCodeAt(0) !== 0xFFFD) { e[D[213][j]] = 54528 + j; d[54528 + j] = D[213][j];}
- D[214] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑�".split("");
- for(j = 0; j != D[214].length; ++j) if(D[214][j].charCodeAt(0) !== 0xFFFD) { e[D[214][j]] = 54784 + j; d[54784 + j] = D[214][j];}
- D[215] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座������".split("");
- for(j = 0; j != D[215].length; ++j) if(D[215][j].charCodeAt(0) !== 0xFFFD) { e[D[215][j]] = 55040 + j; d[55040 + j] = D[215][j];}
- D[216] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝�".split("");
- for(j = 0; j != D[216].length; ++j) if(D[216][j].charCodeAt(0) !== 0xFFFD) { e[D[216][j]] = 55296 + j; d[55296 + j] = D[216][j];}
- D[217] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼�".split("");
- for(j = 0; j != D[217].length; ++j) if(D[217][j].charCodeAt(0) !== 0xFFFD) { e[D[217][j]] = 55552 + j; d[55552 + j] = D[217][j];}
- D[218] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺�".split("");
- for(j = 0; j != D[218].length; ++j) if(D[218][j].charCodeAt(0) !== 0xFFFD) { e[D[218][j]] = 55808 + j; d[55808 + j] = D[218][j];}
- D[219] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝�".split("");
- for(j = 0; j != D[219].length; ++j) if(D[219][j].charCodeAt(0) !== 0xFFFD) { e[D[219][j]] = 56064 + j; d[56064 + j] = D[219][j];}
- D[220] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥�".split("");
- for(j = 0; j != D[220].length; ++j) if(D[220][j].charCodeAt(0) !== 0xFFFD) { e[D[220][j]] = 56320 + j; d[56320 + j] = D[220][j];}
- D[221] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺�".split("");
- for(j = 0; j != D[221].length; ++j) if(D[221][j].charCodeAt(0) !== 0xFFFD) { e[D[221][j]] = 56576 + j; d[56576 + j] = D[221][j];}
- D[222] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖�".split("");
- for(j = 0; j != D[222].length; ++j) if(D[222][j].charCodeAt(0) !== 0xFFFD) { e[D[222][j]] = 56832 + j; d[56832 + j] = D[222][j];}
- D[223] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼�".split("");
- for(j = 0; j != D[223].length; ++j) if(D[223][j].charCodeAt(0) !== 0xFFFD) { e[D[223][j]] = 57088 + j; d[57088 + j] = D[223][j];}
- D[224] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼�".split("");
- for(j = 0; j != D[224].length; ++j) if(D[224][j].charCodeAt(0) !== 0xFFFD) { e[D[224][j]] = 57344 + j; d[57344 + j] = D[224][j];}
- D[225] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺�".split("");
- for(j = 0; j != D[225].length; ++j) if(D[225][j].charCodeAt(0) !== 0xFFFD) { e[D[225][j]] = 57600 + j; d[57600 + j] = D[225][j];}
- D[226] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧饨饩饪饫饬饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂�".split("");
- for(j = 0; j != D[226].length; ++j) if(D[226][j].charCodeAt(0) !== 0xFFFD) { e[D[226][j]] = 57856 + j; d[57856 + j] = D[226][j];}
- D[227] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾�".split("");
- for(j = 0; j != D[227].length; ++j) if(D[227][j].charCodeAt(0) !== 0xFFFD) { e[D[227][j]] = 58112 + j; d[58112 + j] = D[227][j];}
- D[228] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑�".split("");
- for(j = 0; j != D[228].length; ++j) if(D[228][j].charCodeAt(0) !== 0xFFFD) { e[D[228][j]] = 58368 + j; d[58368 + j] = D[228][j];}
- D[229] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣�".split("");
- for(j = 0; j != D[229].length; ++j) if(D[229][j].charCodeAt(0) !== 0xFFFD) { e[D[229][j]] = 58624 + j; d[58624 + j] = D[229][j];}
- D[230] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩�".split("");
- for(j = 0; j != D[230].length; ++j) if(D[230][j].charCodeAt(0) !== 0xFFFD) { e[D[230][j]] = 58880 + j; d[58880 + j] = D[230][j];}
- D[231] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡缢缣缤缥缦缧缪缫缬缭缯缰缱缲缳缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬�".split("");
- for(j = 0; j != D[231].length; ++j) if(D[231][j].charCodeAt(0) !== 0xFFFD) { e[D[231][j]] = 59136 + j; d[59136 + j] = D[231][j];}
- D[232] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹�".split("");
- for(j = 0; j != D[232].length; ++j) if(D[232][j].charCodeAt(0) !== 0xFFFD) { e[D[232][j]] = 59392 + j; d[59392 + j] = D[232][j];}
- D[233] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋�".split("");
- for(j = 0; j != D[233].length; ++j) if(D[233][j].charCodeAt(0) !== 0xFFFD) { e[D[233][j]] = 59648 + j; d[59648 + j] = D[233][j];}
- D[234] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰�".split("");
- for(j = 0; j != D[234].length; ++j) if(D[234][j].charCodeAt(0) !== 0xFFFD) { e[D[234][j]] = 59904 + j; d[59904 + j] = D[234][j];}
- D[235] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻�".split("");
- for(j = 0; j != D[235].length; ++j) if(D[235][j].charCodeAt(0) !== 0xFFFD) { e[D[235][j]] = 60160 + j; d[60160 + j] = D[235][j];}
- D[236] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐�".split("");
- for(j = 0; j != D[236].length; ++j) if(D[236][j].charCodeAt(0) !== 0xFFFD) { e[D[236][j]] = 60416 + j; d[60416 + j] = D[236][j];}
- D[237] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨�".split("");
- for(j = 0; j != D[237].length; ++j) if(D[237][j].charCodeAt(0) !== 0xFFFD) { e[D[237][j]] = 60672 + j; d[60672 + j] = D[237][j];}
- D[238] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶钷钸钹钺钼钽钿铄铈铉铊铋铌铍铎铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪�".split("");
- for(j = 0; j != D[238].length; ++j) if(D[238][j].charCodeAt(0) !== 0xFFFD) { e[D[238][j]] = 60928 + j; d[60928 + j] = D[238][j];}
- D[239] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒锓锔锕锖锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤镥镦镧镨镩镪镫镬镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔�".split("");
- for(j = 0; j != D[239].length; ++j) if(D[239][j].charCodeAt(0) !== 0xFFFD) { e[D[239][j]] = 61184 + j; d[61184 + j] = D[239][j];}
- D[240] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨鸩鸪鸫鸬鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦鹧鹨鹩鹪鹫鹬鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙�".split("");
- for(j = 0; j != D[240].length; ++j) if(D[240][j].charCodeAt(0) !== 0xFFFD) { e[D[240][j]] = 61440 + j; d[61440 + j] = D[240][j];}
- D[241] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃�".split("");
- for(j = 0; j != D[241].length; ++j) if(D[241][j].charCodeAt(0) !== 0xFFFD) { e[D[241][j]] = 61696 + j; d[61696 + j] = D[241][j];}
- D[242] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒�".split("");
- for(j = 0; j != D[242].length; ++j) if(D[242][j].charCodeAt(0) !== 0xFFFD) { e[D[242][j]] = 61952 + j; d[61952 + j] = D[242][j];}
- D[243] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋�".split("");
- for(j = 0; j != D[243].length; ++j) if(D[243][j].charCodeAt(0) !== 0xFFFD) { e[D[243][j]] = 62208 + j; d[62208 + j] = D[243][j];}
- D[244] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤�".split("");
- for(j = 0; j != D[244].length; ++j) if(D[244][j].charCodeAt(0) !== 0xFFFD) { e[D[244][j]] = 62464 + j; d[62464 + j] = D[244][j];}
- D[245] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜�".split("");
- for(j = 0; j != D[245].length; ++j) if(D[245][j].charCodeAt(0) !== 0xFFFD) { e[D[245][j]] = 62720 + j; d[62720 + j] = D[245][j];}
- D[246] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅龆龇龈龉龊龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞鲟鲠鲡鲢鲣鲥鲦鲧鲨鲩鲫鲭鲮鲰鲱鲲鲳鲴鲵鲶鲷鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋�".split("");
- for(j = 0; j != D[246].length; ++j) if(D[246][j].charCodeAt(0) !== 0xFFFD) { e[D[246][j]] = 62976 + j; d[62976 + j] = D[246][j];}
- D[247] = "�����������������������������������������������������������������������������������������������������������������������������������������������������������������鳌鳍鳎鳏鳐鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄�".split("");
- for(j = 0; j != D[247].length; ++j) if(D[247][j].charCodeAt(0) !== 0xFFFD) { e[D[247][j]] = 63232 + j; d[63232 + j] = D[247][j];}
- return {"enc": e, "dec": d }; })();
- cptable[10029] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[10079] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- cptable[10081] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
- // eslint-disable-next-line no-undef
- if ( true && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = cptable;
- /* cputils.js (C) 2013-present SheetJS -- http://sheetjs.com */
- /* vim: set ft=javascript: */
- /*jshint newcap: false */
- (function(root, factory) {
- /*jshint ignore:start */
- /*eslint-disable */
- "use strict";
- if(typeof cptable === "undefined") {
- if(true){
- var cpt = cptable;
- if ( true && module.exports && typeof DO_NOT_EXPORT_CODEPAGE === 'undefined') module.exports = factory(cpt);
- else root.cptable = factory(cpt);
- } else {}
- } else cptable = factory(cptable);
- /*eslint-enable */
- /*jshint ignore:end */
- }(this, function(cpt){
- "use strict";
- /*global module, Buffer */
- var magic = {
- "1200":"utf16le",
- "1201":"utf16be",
- "12000":"utf32le",
- "12001":"utf32be",
- "16969":"utf64le",
- "20127":"ascii",
- "65000":"utf7",
- "65001":"utf8"
- };
-
- var sbcs_cache = [874,1250,1251,1252,1253,1254,1255,1256,10000];
- var dbcs_cache = [932,936,949,950];
- var magic_cache = [65001];
- var magic_decode = {};
- var magic_encode = {};
- var cpdcache = {};
- var cpecache = {};
-
- var sfcc = function sfcc(x) { return String.fromCharCode(x); };
- var cca = function cca(x) { return x.charCodeAt(0); };
-
- var has_buf = (typeof Buffer !== 'undefined');
- var Buffer_from = function(){};
- if(has_buf) {
- var nbfs = !Buffer.from;
- if(!nbfs) try { Buffer.from("foo", "utf8"); } catch(e) { nbfs = true; }
- Buffer_from = nbfs ? function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); } : Buffer.from.bind(Buffer);
- // $FlowIgnore
- if(!Buffer.allocUnsafe) Buffer.allocUnsafe = function(n) { return new Buffer(n); };
-
- var mdl = 1024, mdb = Buffer.allocUnsafe(mdl);
- var make_EE = function make_EE(E){
- var EE = Buffer.allocUnsafe(65536);
- for(var i = 0; i < 65536;++i) EE[i] = 0;
- var keys = Object.keys(E), len = keys.length;
- for(var ee = 0, e = keys[ee]; ee < len; ++ee) {
- if(!(e = keys[ee])) continue;
- EE[e.charCodeAt(0)] = E[e];
- }
- return EE;
- };
- var sbcs_encode = function make_sbcs_encode(cp) {
- var EE = make_EE(cpt[cp].enc);
- return function sbcs_e(data, ofmt) {
- var len = data.length;
- var out, i=0, j=0, D=0, w=0;
- if(typeof data === 'string') {
- out = Buffer.allocUnsafe(len);
- for(i = 0; i < len; ++i) out[i] = EE[data.charCodeAt(i)];
- } else if(Buffer.isBuffer(data)) {
- out = Buffer.allocUnsafe(2*len);
- j = 0;
- for(i = 0; i < len; ++i) {
- D = data[i];
- if(D < 128) out[j++] = EE[D];
- else if(D < 224) { out[j++] = EE[((D&31)<<6)+(data[i+1]&63)]; ++i; }
- else if(D < 240) { out[j++] = EE[((D&15)<<12)+((data[i+1]&63)<<6)+(data[i+2]&63)]; i+=2; }
- else {
- w = ((D&7)<<18)+((data[i+1]&63)<<12)+((data[i+2]&63)<<6)+(data[i+3]&63); i+=3;
- if(w < 65536) out[j++] = EE[w];
- else { w -= 65536; out[j++] = EE[0xD800 + ((w>>10)&1023)]; out[j++] = EE[0xDC00 + (w&1023)]; }
- }
- }
- out = out.slice(0,j);
- } else {
- out = Buffer.allocUnsafe(len);
- for(i = 0; i < len; ++i) out[i] = EE[data[i].charCodeAt(0)];
- }
- if(!ofmt || ofmt === 'buf') return out;
- if(ofmt !== 'arr') return out.toString('binary');
- return [].slice.call(out);
- };
- };
- var sbcs_decode = function make_sbcs_decode(cp) {
- var D = cpt[cp].dec;
- var DD = Buffer.allocUnsafe(131072), d=0, c="";
- for(d=0;d<D.length;++d) {
- if(!(c=D[d])) continue;
- var w = c.charCodeAt(0);
- DD[2*d] = w&255; DD[2*d+1] = w>>8;
- }
- return function sbcs_d(data) {
- var len = data.length, i=0, j=0;
- if(2 * len > mdl) { mdl = 2 * len; mdb = Buffer.allocUnsafe(mdl); }
- if(Buffer.isBuffer(data)) {
- for(i = 0; i < len; i++) {
- j = 2*data[i];
- mdb[2*i] = DD[j]; mdb[2*i+1] = DD[j+1];
- }
- } else if(typeof data === "string") {
- for(i = 0; i < len; i++) {
- j = 2*data.charCodeAt(i);
- mdb[2*i] = DD[j]; mdb[2*i+1] = DD[j+1];
- }
- } else {
- for(i = 0; i < len; i++) {
- j = 2*data[i];
- mdb[2*i] = DD[j]; mdb[2*i+1] = DD[j+1];
- }
- }
- return mdb.slice(0, 2 * len).toString('ucs2');
- };
- };
- var dbcs_encode = function make_dbcs_encode(cp) {
- var E = cpt[cp].enc;
- var EE = Buffer.allocUnsafe(131072);
- for(var i = 0; i < 131072; ++i) EE[i] = 0;
- var keys = Object.keys(E);
- for(var ee = 0, e = keys[ee]; ee < keys.length; ++ee) {
- if(!(e = keys[ee])) continue;
- var f = e.charCodeAt(0);
- EE[2*f] = E[e] & 255; EE[2*f+1] = E[e]>>8;
- }
- return function dbcs_e(data, ofmt) {
- var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, jj=0, k=0, D=0;
- if(typeof data === 'string') {
- for(i = k = 0; i < len; ++i) {
- j = data.charCodeAt(i)*2;
- out[k++] = EE[j+1] || EE[j]; if(EE[j+1] > 0) out[k++] = EE[j];
- }
- out = out.slice(0,k);
- } else if(Buffer.isBuffer(data)) {
- for(i = k = 0; i < len; ++i) {
- D = data[i];
- if(D < 128) j = D;
- else if(D < 224) { j = ((D&31)<<6)+(data[i+1]&63); ++i; }
- else if(D < 240) { j = ((D&15)<<12)+((data[i+1]&63)<<6)+(data[i+2]&63); i+=2; }
- else { j = ((D&7)<<18)+((data[i+1]&63)<<12)+((data[i+2]&63)<<6)+(data[i+3]&63); i+=3; }
- if(j<65536) { j*=2; out[k++] = EE[j+1] || EE[j]; if(EE[j+1] > 0) out[k++] = EE[j]; }
- else { jj = j-65536;
- j=2*(0xD800 + ((jj>>10)&1023)); out[k++] = EE[j+1] || EE[j]; if(EE[j+1] > 0) out[k++] = EE[j];
- j=2*(0xDC00 + (jj&1023)); out[k++] = EE[j+1] || EE[j]; if(EE[j+1] > 0) out[k++] = EE[j];
- }
- }
- out = out.slice(0,k);
- } else {
- for(i = k = 0; i < len; i++) {
- j = data[i].charCodeAt(0)*2;
- out[k++] = EE[j+1] || EE[j]; if(EE[j+1] > 0) out[k++] = EE[j];
- }
- }
- if(!ofmt || ofmt === 'buf') return out;
- if(ofmt !== 'arr') return out.toString('binary');
- return [].slice.call(out);
- };
- };
- var dbcs_decode = function make_dbcs_decode(cp) {
- var D = cpt[cp].dec;
- var DD = Buffer.allocUnsafe(131072), d=0, c, w=0, j=0, i=0;
- for(i = 0; i < 65536; ++i) { DD[2*i] = 0xFF; DD[2*i+1] = 0xFD;}
- for(d = 0; d < D.length; ++d) {
- if(!(c=D[d])) continue;
- w = c.charCodeAt(0);
- j = 2*d;
- DD[j] = w&255; DD[j+1] = w>>8;
- }
- return function dbcs_d(data) {
- var len = data.length, out = Buffer.allocUnsafe(2*len), i=0, j=0, k=0;
- if(Buffer.isBuffer(data)) {
- for(i = 0; i < len; i++) {
- j = 2*data[i];
- if(DD[j]===0xFF && DD[j+1]===0xFD) { j=2*((data[i]<<8)+data[i+1]); ++i; }
- out[k++] = DD[j]; out[k++] = DD[j+1];
- }
- } else if(typeof data === "string") {
- for(i = 0; i < len; i++) {
- j = 2*data.charCodeAt(i);
- if(DD[j]===0xFF && DD[j+1]===0xFD) { j=2*((data.charCodeAt(i)<<8)+data.charCodeAt(i+1)); ++i; }
- out[k++] = DD[j]; out[k++] = DD[j+1];
- }
- } else {
- for(i = 0; i < len; i++) {
- j = 2*data[i];
- if(DD[j]===0xFF && DD[j+1]===0xFD) { j=2*((data[i]<<8)+data[i+1]); ++i; }
- out[k++] = DD[j]; out[k++] = DD[j+1];
- }
- }
- return out.slice(0,k).toString('ucs2');
- };
- };
- magic_decode[65001] = function utf8_d(data) {
- if(typeof data === "string") return utf8_d(data.split("").map(cca));
- var len = data.length, w = 0, ww = 0;
- if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
- var i = 0;
- if(len >= 3 && data[0] == 0xEF) if(data[1] == 0xBB && data[2] == 0xBF) i = 3;
- for(var j = 1, k = 0, D = 0; i < len; i+=j) {
- j = 1; D = data[i];
- if(D < 128) w = D;
- else if(D < 224) { w=(D&31)*64+(data[i+1]&63); j=2; }
- else if(D < 240) { w=((D&15)<<12)+(data[i+1]&63)*64+(data[i+2]&63); j=3; }
- else { w=(D&7)*262144+((data[i+1]&63)<<12)+(data[i+2]&63)*64+(data[i+3]&63); j=4; }
- if(w < 65536) { mdb[k++] = w&255; mdb[k++] = w>>8; }
- else {
- w -= 65536; ww = 0xD800 + ((w>>10)&1023); w = 0xDC00 + (w&1023);
- mdb[k++] = ww&255; mdb[k++] = ww>>>8; mdb[k++] = w&255; mdb[k++] = (w>>>8)&255;
- }
- }
- return mdb.slice(0,k).toString('ucs2');
- };
- magic_encode[65001] = function utf8_e(data, ofmt) {
- if(has_buf && Buffer.isBuffer(data)) {
- if(!ofmt || ofmt === 'buf') return data;
- if(ofmt !== 'arr') return data.toString('binary');
- return [].slice.call(data);
- }
- var len = data.length, w = 0, ww = 0, j = 0;
- var direct = typeof data === "string";
- if(4 * len > mdl) { mdl = 4 * len; mdb = Buffer.allocUnsafe(mdl); }
- for(var i = 0; i < len; ++i) {
- w = direct ? data.charCodeAt(i) : data[i].charCodeAt(0);
- if(w <= 0x007F) mdb[j++] = w;
- else if(w <= 0x07FF) {
- mdb[j++] = 192 + (w >> 6);
- mdb[j++] = 128 + (w&63);
- } else if(w >= 0xD800 && w <= 0xDFFF) {
- w -= 0xD800; ++i;
- ww = (direct ? data.charCodeAt(i) : data[i].charCodeAt(0)) - 0xDC00 + (w << 10);
- mdb[j++] = 240 + ((ww>>>18) & 0x07);
- mdb[j++] = 144 + ((ww>>>12) & 0x3F);
- mdb[j++] = 128 + ((ww>>>6) & 0x3F);
- mdb[j++] = 128 + (ww & 0x3F);
- } else {
- mdb[j++] = 224 + (w >> 12);
- mdb[j++] = 128 + ((w >> 6)&63);
- mdb[j++] = 128 + (w&63);
- }
- }
- if(!ofmt || ofmt === 'buf') return mdb.slice(0,j);
- if(ofmt !== 'arr') return mdb.slice(0,j).toString('binary');
- return [].slice.call(mdb, 0, j);
- };
- }
-
- var encache = function encache() {
- if(has_buf) {
- if(cpdcache[sbcs_cache[0]]) return;
- var i=0, s=0;
- for(i = 0; i < sbcs_cache.length; ++i) {
- s = sbcs_cache[i];
- if(cpt[s]) {
- cpdcache[s] = sbcs_decode(s);
- cpecache[s] = sbcs_encode(s);
- }
- }
- for(i = 0; i < dbcs_cache.length; ++i) {
- s = dbcs_cache[i];
- if(cpt[s]) {
- cpdcache[s] = dbcs_decode(s);
- cpecache[s] = dbcs_encode(s);
- }
- }
- for(i = 0; i < magic_cache.length; ++i) {
- s = magic_cache[i];
- if(magic_decode[s]) cpdcache[s] = magic_decode[s];
- if(magic_encode[s]) cpecache[s] = magic_encode[s];
- }
- }
- };
- var null_enc = function(data, ofmt) { void ofmt; return ""; };
- var cp_decache = function cp_decache(cp) { delete cpdcache[cp]; delete cpecache[cp]; };
- var decache = function decache() {
- if(has_buf) {
- if(!cpdcache[sbcs_cache[0]]) return;
- sbcs_cache.forEach(cp_decache);
- dbcs_cache.forEach(cp_decache);
- magic_cache.forEach(cp_decache);
- }
- last_enc = null_enc; last_cp = 0;
- };
- var cache = {
- encache: encache,
- decache: decache,
- sbcs: sbcs_cache,
- dbcs: dbcs_cache
- };
-
- encache();
-
- var BM = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- var SetD = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'(),-./:?";
- var last_enc = null_enc, last_cp = 0;
- var encode = function encode(cp, data, ofmt) {
- if(cp === last_cp && last_enc) { return last_enc(data, ofmt); }
- if(cpecache[cp]) { last_enc = cpecache[last_cp=cp]; return last_enc(data, ofmt); }
- if(has_buf && Buffer.isBuffer(data)) data = data.toString('utf8');
- var len = data.length;
- var out = has_buf ? Buffer.allocUnsafe(4*len) : [], w=0, i=0, j = 0, ww=0;
- var C = cpt[cp], E, M = "";
- var isstr = typeof data === 'string';
- if(C && (E=C.enc)) for(i = 0; i < len; ++i, ++j) {
- w = E[isstr? data.charAt(i) : data[i]];
- if(w > 255) {
- out[j] = w>>8;
- out[++j] = w&255;
- } else out[j] = w&255;
- }
- else if((M=magic[cp])) switch(M) {
- case "utf8":
- if(has_buf && isstr) { out = Buffer_from(data, M); j = out.length; break; }
- for(i = 0; i < len; ++i, ++j) {
- w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
- if(w <= 0x007F) out[j] = w;
- else if(w <= 0x07FF) {
- out[j] = 192 + (w >> 6);
- out[++j] = 128 + (w&63);
- } else if(w >= 0xD800 && w <= 0xDFFF) {
- w -= 0xD800;
- ww = (isstr ? data.charCodeAt(++i) : data[++i].charCodeAt(0)) - 0xDC00 + (w << 10);
- out[j] = 240 + ((ww>>>18) & 0x07);
- out[++j] = 144 + ((ww>>>12) & 0x3F);
- out[++j] = 128 + ((ww>>>6) & 0x3F);
- out[++j] = 128 + (ww & 0x3F);
- } else {
- out[j] = 224 + (w >> 12);
- out[++j] = 128 + ((w >> 6)&63);
- out[++j] = 128 + (w&63);
- }
- }
- break;
- case "ascii":
- if(has_buf && typeof data === "string") { out = Buffer_from(data, M); j = out.length; break; }
- for(i = 0; i < len; ++i, ++j) {
- w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
- if(w <= 0x007F) out[j] = w;
- else throw new Error("bad ascii " + w);
- }
- break;
- case "utf16le":
- if(has_buf && typeof data === "string") { out = Buffer_from(data, M); j = out.length; break; }
- for(i = 0; i < len; ++i) {
- w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
- out[j++] = w&255;
- out[j++] = w>>8;
- }
- break;
- case "utf16be":
- for(i = 0; i < len; ++i) {
- w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
- out[j++] = w>>8;
- out[j++] = w&255;
- }
- break;
- case "utf32le":
- for(i = 0; i < len; ++i) {
- w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
- if(w >= 0xD800 && w <= 0xDFFF) w = 0x10000 + ((w - 0xD800) << 10) + (data[++i].charCodeAt(0) - 0xDC00);
- out[j++] = w&255; w >>= 8;
- out[j++] = w&255; w >>= 8;
- out[j++] = w&255; w >>= 8;
- out[j++] = w&255;
- }
- break;
- case "utf32be":
- for(i = 0; i < len; ++i) {
- w = isstr ? data.charCodeAt(i) : data[i].charCodeAt(0);
- if(w >= 0xD800 && w <= 0xDFFF) w = 0x10000 + ((w - 0xD800) << 10) + (data[++i].charCodeAt(0) - 0xDC00);
- out[j+3] = w&255; w >>= 8;
- out[j+2] = w&255; w >>= 8;
- out[j+1] = w&255; w >>= 8;
- out[j] = w&255;
- j+=4;
- }
- break;
- case "utf7":
- for(i = 0; i < len; i++) {
- var c = isstr ? data.charAt(i) : data[i].charAt(0);
- if(c === "+") { out[j++] = 0x2b; out[j++] = 0x2d; continue; }
- if(SetD.indexOf(c) > -1) { out[j++] = c.charCodeAt(0); continue; }
- var tt = encode(1201, c);
- out[j++] = 0x2b;
- out[j++] = BM.charCodeAt(tt[0]>>2);
- out[j++] = BM.charCodeAt(((tt[0]&0x03)<<4) + ((tt[1]||0)>>4));
- out[j++] = BM.charCodeAt(((tt[1]&0x0F)<<2) + ((tt[2]||0)>>6));
- out[j++] = 0x2d;
- }
- break;
- default: throw new Error("Unsupported magic: " + cp + " " + magic[cp]);
- }
- else throw new Error("Unrecognized CP: " + cp);
- out = out.slice(0,j);
- if(!has_buf) return (ofmt == 'str') ? (out).map(sfcc).join("") : out;
- if(!ofmt || ofmt === 'buf') return out;
- if(ofmt !== 'arr') return out.toString('binary');
- return [].slice.call(out);
- };
- var decode = function decode(cp, data) {
- var F; if((F=cpdcache[cp])) return F(data);
- if(typeof data === "string") return decode(cp, data.split("").map(cca));
- var len = data.length, out = new Array(len), s="", w=0, i=0, j=1, k=0, ww=0;
- var C = cpt[cp], D, M="";
- if(C && (D=C.dec)) {
- for(i = 0; i < len; i+=j) {
- j = 2;
- s = D[(data[i]<<8)+ data[i+1]];
- if(!s) {
- j = 1;
- s = D[data[i]];
- }
- if(!s) throw new Error('Unrecognized code: ' + data[i] + ' ' + data[i+j-1] + ' ' + i + ' ' + j + ' ' + D[data[i]]);
- out[k++] = s;
- }
- }
- else if((M=magic[cp])) switch(M) {
- case "utf8":
- if(len >= 3 && data[0] == 0xEF) if(data[1] == 0xBB && data[2] == 0xBF) i = 3;
- for(; i < len; i+=j) {
- j = 1;
- if(data[i] < 128) w = data[i];
- else if(data[i] < 224) { w=(data[i]&31)*64+(data[i+1]&63); j=2; }
- else if(data[i] < 240) { w=((data[i]&15)<<12)+(data[i+1]&63)*64+(data[i+2]&63); j=3; }
- else { w=(data[i]&7)*262144+((data[i+1]&63)<<12)+(data[i+2]&63)*64+(data[i+3]&63); j=4; }
- if(w < 65536) { out[k++] = String.fromCharCode(w); }
- else {
- w -= 65536; ww = 0xD800 + ((w>>10)&1023); w = 0xDC00 + (w&1023);
- out[k++] = String.fromCharCode(ww); out[k++] = String.fromCharCode(w);
- }
- }
- break;
- case "ascii":
- if(has_buf && Buffer.isBuffer(data)) return data.toString(M);
- for(i = 0; i < len; i++) out[i] = String.fromCharCode(data[i]);
- k = len; break;
- case "utf16le":
- if(len >= 2 && data[0] == 0xFF) if(data[1] == 0xFE) i = 2;
- if(has_buf && Buffer.isBuffer(data)) return data.toString(M);
- j = 2;
- for(; i+1 < len; i+=j) {
- out[k++] = String.fromCharCode((data[i+1]<<8) + data[i]);
- }
- break;
- case "utf16be":
- if(len >= 2 && data[0] == 0xFE) if(data[1] == 0xFF) i = 2;
- j = 2;
- for(; i+1 < len; i+=j) {
- out[k++] = String.fromCharCode((data[i]<<8) + data[i+1]);
- }
- break;
- case "utf32le":
- if(len >= 4 && data[0] == 0xFF) if(data[1] == 0xFE && data[2] === 0 && data[3] === 0) i = 4;
- j = 4;
- for(; i < len; i+=j) {
- w = (data[i+3]<<24) + (data[i+2]<<16) + (data[i+1]<<8) + (data[i]);
- if(w > 0xFFFF) {
- w -= 0x10000;
- out[k++] = String.fromCharCode(0xD800 + ((w >> 10) & 0x3FF));
- out[k++] = String.fromCharCode(0xDC00 + (w & 0x3FF));
- }
- else out[k++] = String.fromCharCode(w);
- }
- break;
- case "utf32be":
- if(len >= 4 && data[3] == 0xFF) if(data[2] == 0xFE && data[1] === 0 && data[0] === 0) i = 4;
- j = 4;
- for(; i < len; i+=j) {
- w = (data[i]<<24) + (data[i+1]<<16) + (data[i+2]<<8) + (data[i+3]);
- if(w > 0xFFFF) {
- w -= 0x10000;
- out[k++] = String.fromCharCode(0xD800 + ((w >> 10) & 0x3FF));
- out[k++] = String.fromCharCode(0xDC00 + (w & 0x3FF));
- }
- else out[k++] = String.fromCharCode(w);
- }
- break;
- case "utf7":
- if(len >= 4 && data[0] == 0x2B && data[1] == 0x2F && data[2] == 0x76) {
- if(len >= 5 && data[3] == 0x38 && data[4] == 0x2D) i = 5;
- else if(data[3] == 0x38 || data[3] == 0x39 || data[3] == 0x2B || data[3] == 0x2F) i = 4;
- }
- for(; i < len; i+=j) {
- if(data[i] !== 0x2b) { j=1; out[k++] = String.fromCharCode(data[i]); continue; }
- j=1;
- if(data[i+1] === 0x2d) { j = 2; out[k++] = "+"; continue; }
- // eslint-disable-next-line no-useless-escape
- while(String.fromCharCode(data[i+j]).match(/[A-Za-z0-9+\/]/)) j++;
- var dash = 0;
- if(data[i+j] === 0x2d) { ++j; dash=1; }
- var tt = [];
- var o64 = "";
- var c1=0, c2=0, c3=0;
- var e1=0, e2=0, e3=0, e4=0;
- for(var l = 1; l < j - dash;) {
- e1 = BM.indexOf(String.fromCharCode(data[i+l++]));
- e2 = BM.indexOf(String.fromCharCode(data[i+l++]));
- c1 = e1 << 2 | e2 >> 4;
- tt.push(c1);
- e3 = BM.indexOf(String.fromCharCode(data[i+l++]));
- if(e3 === -1) break;
- c2 = (e2 & 15) << 4 | e3 >> 2;
- tt.push(c2);
- e4 = BM.indexOf(String.fromCharCode(data[i+l++]));
- if(e4 === -1) break;
- c3 = (e3 & 3) << 6 | e4;
- if(e4 < 64) tt.push(c3);
- }
- o64 = decode(1201, tt);
- for(l = 0; l < o64.length; ++l) out[k++] = o64.charAt(l);
- }
- break;
- default: throw new Error("Unsupported magic: " + cp + " " + magic[cp]);
- }
- else throw new Error("Unrecognized CP: " + cp);
- return out.slice(0,k).join("");
- };
- var hascp = function hascp(cp) { return !!(cpt[cp] || magic[cp]); };
- cpt.utils = { decode: decode, encode: encode, hascp: hascp, magic: magic, cache:cache };
- return cpt;
- }));
-
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ "./node_modules/buffer/index.js").Buffer))
-
- /***/ }),
-
- /***/ "./node_modules/xlsx/jszip.js":
- /*!************************************!*\
- !*** ./node_modules/xlsx/jszip.js ***!
- \************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function(Buffer, global) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var require;var require;/*
-
- JSZip - A Javascript class for generating and reading zip files
- <http://stuartk.com/jszip>
-
- (c) 2009-2014 Stuart Knightley <stuart [at] stuartk.com>
- Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
-
- JSZip uses the library pako released under the MIT license :
- https://github.com/nodeca/pako/blob/master/LICENSE
-
- Note: since JSZip 3 removed critical functionality, this version assigns to the
- `JSZipSync` variable. Another JSZip version can be loaded in parallel.
- */
- (function(e){
- if( true&&"undefined"==typeof DO_NOT_EXPORT_JSZIP)module.exports=e();
- else if( true&&"undefined"==typeof DO_NOT_EXPORT_JSZIP){JSZipSync=e();!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (e),
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
- (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));}
- else{
- var f;
- "undefined"!=typeof window?f=window:
- "undefined"!=typeof global?f=global:
- "undefined"!=typeof $ && $.global?f=$.global:
- "undefined"!=typeof self&&(f=self),f.JSZipSync=e()
- }
- }(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return require(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
- 'use strict';
- // private property
- var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
-
-
- // public method for encoding
- exports.encode = function(input, utf8) {
- var output = "";
- var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
- var i = 0;
-
- while (i < input.length) {
-
- chr1 = input.charCodeAt(i++);
- chr2 = input.charCodeAt(i++);
- chr3 = input.charCodeAt(i++);
-
- enc1 = chr1 >> 2;
- enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
- enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
- enc4 = chr3 & 63;
-
- if (isNaN(chr2)) {
- enc3 = enc4 = 64;
- }
- else if (isNaN(chr3)) {
- enc4 = 64;
- }
-
- output = output + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4);
-
- }
-
- return output;
- };
-
- // public method for decoding
- exports.decode = function(input, utf8) {
- var output = "";
- var chr1, chr2, chr3;
- var enc1, enc2, enc3, enc4;
- var i = 0;
-
- input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
-
- while (i < input.length) {
-
- enc1 = _keyStr.indexOf(input.charAt(i++));
- enc2 = _keyStr.indexOf(input.charAt(i++));
- enc3 = _keyStr.indexOf(input.charAt(i++));
- enc4 = _keyStr.indexOf(input.charAt(i++));
-
- chr1 = (enc1 << 2) | (enc2 >> 4);
- chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
- chr3 = ((enc3 & 3) << 6) | enc4;
-
- output = output + String.fromCharCode(chr1);
-
- if (enc3 != 64) {
- output = output + String.fromCharCode(chr2);
- }
- if (enc4 != 64) {
- output = output + String.fromCharCode(chr3);
- }
-
- }
-
- return output;
-
- };
-
- },{}],2:[function(_dereq_,module,exports){
- 'use strict';
- function CompressedObject() {
- this.compressedSize = 0;
- this.uncompressedSize = 0;
- this.crc32 = 0;
- this.compressionMethod = null;
- this.compressedContent = null;
- }
-
- CompressedObject.prototype = {
- /**
- * Return the decompressed content in an unspecified format.
- * The format will depend on the decompressor.
- * @return {Object} the decompressed content.
- */
- getContent: function() {
- return null; // see implementation
- },
- /**
- * Return the compressed content in an unspecified format.
- * The format will depend on the compressed conten source.
- * @return {Object} the compressed content.
- */
- getCompressedContent: function() {
- return null; // see implementation
- }
- };
- module.exports = CompressedObject;
-
- },{}],3:[function(_dereq_,module,exports){
- 'use strict';
- exports.STORE = {
- magic: "\x00\x00",
- compress: function(content) {
- return content; // no compression
- },
- uncompress: function(content) {
- return content; // no compression
- },
- compressInputType: null,
- uncompressInputType: null
- };
- exports.DEFLATE = _dereq_('./flate');
-
- },{"./flate":8}],4:[function(_dereq_,module,exports){
- 'use strict';
-
- var utils = _dereq_('./utils');
-
- var table = [
- 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
- 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
- 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
- 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
- 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
- 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
- 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
- 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
- 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
- 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
- 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
- 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
- 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
- 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
- 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
- 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
- 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
- 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
- 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
- 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
- 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
- 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
- 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
- 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
- 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
- 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
- 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
- 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
- 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
- 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
- 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
- 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
- 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
- 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
- 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
- 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
- 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
- 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
- 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
- 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
- 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
- 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
- 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
- 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
- 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
- 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
- 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
- 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
- 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
- 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
- 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
- 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
- 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
- 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
- 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
- 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
- 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
- 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
- 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
- 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
- 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
- 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
- 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
- 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
- ];
-
- /**
- *
- * Javascript crc32
- * http://www.webtoolkit.info/
- *
- */
- module.exports = function crc32(input, crc) {
- if (typeof input === "undefined" || !input.length) {
- return 0;
- }
-
- var isArray = utils.getTypeOf(input) !== "string";
-
- if (typeof(crc) == "undefined") {
- crc = 0;
- }
- var x = 0;
- var y = 0;
- var b = 0;
-
- crc = crc ^ (-1);
- for (var i = 0, iTop = input.length; i < iTop; i++) {
- b = isArray ? input[i] : input.charCodeAt(i);
- y = (crc ^ b) & 0xFF;
- x = table[y];
- crc = (crc >>> 8) ^ x;
- }
-
- return crc ^ (-1);
- };
- // vim: set shiftwidth=4 softtabstop=4:
-
- },{"./utils":21}],5:[function(_dereq_,module,exports){
- 'use strict';
- var utils = _dereq_('./utils');
-
- function DataReader(data) {
- this.data = null; // type : see implementation
- this.length = 0;
- this.index = 0;
- }
- DataReader.prototype = {
- /**
- * Check that the offset will not go too far.
- * @param {string} offset the additional offset to check.
- * @throws {Error} an Error if the offset is out of bounds.
- */
- checkOffset: function(offset) {
- this.checkIndex(this.index + offset);
- },
- /**
- * Check that the specifed index will not be too far.
- * @param {string} newIndex the index to check.
- * @throws {Error} an Error if the index is out of bounds.
- */
- checkIndex: function(newIndex) {
- if (this.length < newIndex || newIndex < 0) {
- throw new Error("End of data reached (data length = " + this.length + ", asked index = " + (newIndex) + "). Corrupted zip ?");
- }
- },
- /**
- * Change the index.
- * @param {number} newIndex The new index.
- * @throws {Error} if the new index is out of the data.
- */
- setIndex: function(newIndex) {
- this.checkIndex(newIndex);
- this.index = newIndex;
- },
- /**
- * Skip the next n bytes.
- * @param {number} n the number of bytes to skip.
- * @throws {Error} if the new index is out of the data.
- */
- skip: function(n) {
- this.setIndex(this.index + n);
- },
- /**
- * Get the byte at the specified index.
- * @param {number} i the index to use.
- * @return {number} a byte.
- */
- byteAt: function(i) {
- // see implementations
- },
- /**
- * Get the next number with a given byte size.
- * @param {number} size the number of bytes to read.
- * @return {number} the corresponding number.
- */
- readInt: function(size) {
- var result = 0,
- i;
- this.checkOffset(size);
- for (i = this.index + size - 1; i >= this.index; i--) {
- result = (result << 8) + this.byteAt(i);
- }
- this.index += size;
- return result;
- },
- /**
- * Get the next string with a given byte size.
- * @param {number} size the number of bytes to read.
- * @return {string} the corresponding string.
- */
- readString: function(size) {
- return utils.transformTo("string", this.readData(size));
- },
- /**
- * Get raw data without conversion, <size> bytes.
- * @param {number} size the number of bytes to read.
- * @return {Object} the raw data, implementation specific.
- */
- readData: function(size) {
- // see implementations
- },
- /**
- * Find the last occurence of a zip signature (4 bytes).
- * @param {string} sig the signature to find.
- * @return {number} the index of the last occurence, -1 if not found.
- */
- lastIndexOfSignature: function(sig) {
- // see implementations
- },
- /**
- * Get the next date.
- * @return {Date} the date.
- */
- readDate: function() {
- var dostime = this.readInt(4);
- return new Date(
- ((dostime >> 25) & 0x7f) + 1980, // year
- ((dostime >> 21) & 0x0f) - 1, // month
- (dostime >> 16) & 0x1f, // day
- (dostime >> 11) & 0x1f, // hour
- (dostime >> 5) & 0x3f, // minute
- (dostime & 0x1f) << 1); // second
- }
- };
- module.exports = DataReader;
-
- },{"./utils":21}],6:[function(_dereq_,module,exports){
- 'use strict';
- exports.base64 = false;
- exports.binary = false;
- exports.dir = false;
- exports.createFolders = false;
- exports.date = null;
- exports.compression = null;
- exports.comment = null;
-
- },{}],7:[function(_dereq_,module,exports){
- 'use strict';
- var utils = _dereq_('./utils');
-
- /**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
- exports.string2binary = function(str) {
- return utils.string2binary(str);
- };
-
- /**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
- exports.string2Uint8Array = function(str) {
- return utils.transformTo("uint8array", str);
- };
-
- /**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
- exports.uint8Array2String = function(array) {
- return utils.transformTo("string", array);
- };
-
- /**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
- exports.string2Blob = function(str) {
- var buffer = utils.transformTo("arraybuffer", str);
- return utils.arrayBuffer2Blob(buffer);
- };
-
- /**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
- exports.arrayBuffer2Blob = function(buffer) {
- return utils.arrayBuffer2Blob(buffer);
- };
-
- /**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
- exports.transformTo = function(outputType, input) {
- return utils.transformTo(outputType, input);
- };
-
- /**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
- exports.getTypeOf = function(input) {
- return utils.getTypeOf(input);
- };
-
- /**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
- exports.checkSupport = function(type) {
- return utils.checkSupport(type);
- };
-
- /**
- * @deprecated
- * This value will be removed in a future version without replacement.
- */
- exports.MAX_VALUE_16BITS = utils.MAX_VALUE_16BITS;
-
- /**
- * @deprecated
- * This value will be removed in a future version without replacement.
- */
- exports.MAX_VALUE_32BITS = utils.MAX_VALUE_32BITS;
-
-
- /**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
- exports.pretty = function(str) {
- return utils.pretty(str);
- };
-
- /**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
- exports.findCompression = function(compressionMethod) {
- return utils.findCompression(compressionMethod);
- };
-
- /**
- * @deprecated
- * This function will be removed in a future version without replacement.
- */
- exports.isRegExp = function (object) {
- return utils.isRegExp(object);
- };
-
-
- },{"./utils":21}],8:[function(_dereq_,module,exports){
- 'use strict';
- var USE_TYPEDARRAY = (typeof Uint8Array !== 'undefined') && (typeof Uint16Array !== 'undefined') && (typeof Uint32Array !== 'undefined');
-
- var pako = _dereq_("pako");
- exports.uncompressInputType = USE_TYPEDARRAY ? "uint8array" : "array";
- exports.compressInputType = USE_TYPEDARRAY ? "uint8array" : "array";
-
- exports.magic = "\x08\x00";
- exports.compress = function(input) {
- return pako.deflateRaw(input);
- };
- exports.uncompress = function(input) {
- return pako.inflateRaw(input);
- };
-
- },{"pako":24}],9:[function(_dereq_,module,exports){
- 'use strict';
-
- var base64 = _dereq_('./base64');
-
- /**
- Usage:
- zip = new JSZip();
- zip.file("hello.txt", "Hello, World!").file("tempfile", "nothing");
- zip.folder("images").file("smile.gif", base64Data, {base64: true});
- zip.file("Xmas.txt", "Ho ho ho !", {date : new Date("December 25, 2007 00:00:01")});
- zip.remove("tempfile");
-
- base64zip = zip.generate();
-
- **/
-
- /**
- * Representation a of zip file in js
- * @constructor
- * @param {String=|ArrayBuffer=|Uint8Array=} data the data to load, if any (optional).
- * @param {Object=} options the options for creating this objects (optional).
- */
- function JSZipSync(data, options) {
- // if this constructor is used without `new`, it adds `new` before itself:
- if(!(this instanceof JSZipSync)) return new JSZipSync(data, options);
-
- // object containing the files :
- // {
- // "folder/" : {...},
- // "folder/data.txt" : {...}
- // }
- this.files = {};
-
- this.comment = null;
-
- // Where we are in the hierarchy
- this.root = "";
- if (data) {
- this.load(data, options);
- }
- this.clone = function() {
- var newObj = new JSZipSync();
- for (var i in this) {
- if (typeof this[i] !== "function") {
- newObj[i] = this[i];
- }
- }
- return newObj;
- };
- }
- JSZipSync.prototype = _dereq_('./object');
- JSZipSync.prototype.load = _dereq_('./load');
- JSZipSync.support = _dereq_('./support');
- JSZipSync.defaults = _dereq_('./defaults');
-
- /**
- * @deprecated
- * This namespace will be removed in a future version without replacement.
- */
- JSZipSync.utils = _dereq_('./deprecatedPublicUtils');
-
- JSZipSync.base64 = {
- /**
- * @deprecated
- * This method will be removed in a future version without replacement.
- */
- encode : function(input) {
- return base64.encode(input);
- },
- /**
- * @deprecated
- * This method will be removed in a future version without replacement.
- */
- decode : function(input) {
- return base64.decode(input);
- }
- };
- JSZipSync.compressions = _dereq_('./compressions');
- module.exports = JSZipSync;
-
- },{"./base64":1,"./compressions":3,"./defaults":6,"./deprecatedPublicUtils":7,"./load":10,"./object":13,"./support":17}],10:[function(_dereq_,module,exports){
- 'use strict';
- var base64 = _dereq_('./base64');
- var ZipEntries = _dereq_('./zipEntries');
- module.exports = function(data, options) {
- var files, zipEntries, i, input;
- options = options || {};
- if (options.base64) {
- data = base64.decode(data);
- }
-
- zipEntries = new ZipEntries(data, options);
- files = zipEntries.files;
- for (i = 0; i < files.length; i++) {
- input = files[i];
- this.file(input.fileName, input.decompressed, {
- binary: true,
- optimizedBinaryString: true,
- date: input.date,
- dir: input.dir,
- comment : input.fileComment.length ? input.fileComment : null,
- createFolders: options.createFolders
- });
- }
- if (zipEntries.zipComment.length) {
- this.comment = zipEntries.zipComment;
- }
-
- return this;
- };
-
- },{"./base64":1,"./zipEntries":22}],11:[function(_dereq_,module,exports){
- (function (Buffer){
- 'use strict';
- var Buffer_from = /*::(*/function(){}/*:: :any)*/;
- if(typeof Buffer !== 'undefined') {
- var nbfs = !Buffer.from;
- if(!nbfs) try { Buffer.from("foo", "utf8"); } catch(e) { nbfs = true; }
- Buffer_from = nbfs ? function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); } : Buffer.from.bind(Buffer);
- // $FlowIgnore
- if(!Buffer.alloc) Buffer.alloc = function(n) { return new Buffer(n); };
- }
- module.exports = function(data, encoding){
- return typeof data == 'number' ? Buffer.alloc(data) : Buffer_from(data, encoding);
- };
- module.exports.test = function(b){
- return Buffer.isBuffer(b);
- };
- }).call(this,(typeof Buffer !== "undefined" ? Buffer : undefined))
- },{}],12:[function(_dereq_,module,exports){
- 'use strict';
- var Uint8ArrayReader = _dereq_('./uint8ArrayReader');
-
- function NodeBufferReader(data) {
- this.data = data;
- this.length = this.data.length;
- this.index = 0;
- }
- NodeBufferReader.prototype = new Uint8ArrayReader();
-
- /**
- * @see DataReader.readData
- */
- NodeBufferReader.prototype.readData = function(size) {
- this.checkOffset(size);
- var result = this.data.slice(this.index, this.index + size);
- this.index += size;
- return result;
- };
- module.exports = NodeBufferReader;
-
- },{"./uint8ArrayReader":18}],13:[function(_dereq_,module,exports){
- 'use strict';
- var support = _dereq_('./support');
- var utils = _dereq_('./utils');
- var crc32 = _dereq_('./crc32');
- var signature = _dereq_('./signature');
- var defaults = _dereq_('./defaults');
- var base64 = _dereq_('./base64');
- var compressions = _dereq_('./compressions');
- var CompressedObject = _dereq_('./compressedObject');
- var nodeBuffer = _dereq_('./nodeBuffer');
- var utf8 = _dereq_('./utf8');
- var StringWriter = _dereq_('./stringWriter');
- var Uint8ArrayWriter = _dereq_('./uint8ArrayWriter');
-
- /**
- * Returns the raw data of a ZipObject, decompress the content if necessary.
- * @param {ZipObject} file the file to use.
- * @return {String|ArrayBuffer|Uint8Array|Buffer} the data.
- */
- var getRawData = function(file) {
- if (file._data instanceof CompressedObject) {
- file._data = file._data.getContent();
- file.options.binary = true;
- file.options.base64 = false;
-
- if (utils.getTypeOf(file._data) === "uint8array") {
- var copy = file._data;
- // when reading an arraybuffer, the CompressedObject mechanism will keep it and subarray() a Uint8Array.
- // if we request a file in the same format, we might get the same Uint8Array or its ArrayBuffer (the original zip file).
- file._data = new Uint8Array(copy.length);
- // with an empty Uint8Array, Opera fails with a "Offset larger than array size"
- if (copy.length !== 0) {
- file._data.set(copy, 0);
- }
- }
- }
- return file._data;
- };
-
- /**
- * Returns the data of a ZipObject in a binary form. If the content is an unicode string, encode it.
- * @param {ZipObject} file the file to use.
- * @return {String|ArrayBuffer|Uint8Array|Buffer} the data.
- */
- var getBinaryData = function(file) {
- var result = getRawData(file),
- type = utils.getTypeOf(result);
- if (type === "string") {
- if (!file.options.binary) {
- // unicode text !
- // unicode string => binary string is a painful process, check if we can avoid it.
- if (support.nodebuffer) {
- return nodeBuffer(result, "utf-8");
- }
- }
- return file.asBinary();
- }
- return result;
- };
-
- /**
- * Transform this._data into a string.
- * @param {function} filter a function String -> String, applied if not null on the result.
- * @return {String} the string representing this._data.
- */
- var dataToString = function(asUTF8) {
- var result = getRawData(this);
- if (result === null || typeof result === "undefined") {
- return "";
- }
- // if the data is a base64 string, we decode it before checking the encoding !
- if (this.options.base64) {
- result = base64.decode(result);
- }
- if (asUTF8 && this.options.binary) {
- // JSZip.prototype.utf8decode supports arrays as input
- // skip to array => string step, utf8decode will do it.
- result = out.utf8decode(result);
- }
- else {
- // no utf8 transformation, do the array => string step.
- result = utils.transformTo("string", result);
- }
-
- if (!asUTF8 && !this.options.binary) {
- result = utils.transformTo("string", out.utf8encode(result));
- }
- return result;
- };
- /**
- * A simple object representing a file in the zip file.
- * @constructor
- * @param {string} name the name of the file
- * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data
- * @param {Object} options the options of the file
- */
- var ZipObject = function(name, data, options) {
- this.name = name;
- this.dir = options.dir;
- this.date = options.date;
- this.comment = options.comment;
-
- this._data = data;
- this.options = options;
-
- /*
- * This object contains initial values for dir and date.
- * With them, we can check if the user changed the deprecated metadata in
- * `ZipObject#options` or not.
- */
- this._initialMetadata = {
- dir : options.dir,
- date : options.date
- };
- };
-
- ZipObject.prototype = {
- /**
- * Return the content as UTF8 string.
- * @return {string} the UTF8 string.
- */
- asText: function() {
- return dataToString.call(this, true);
- },
- /**
- * Returns the binary content.
- * @return {string} the content as binary.
- */
- asBinary: function() {
- return dataToString.call(this, false);
- },
- /**
- * Returns the content as a nodejs Buffer.
- * @return {Buffer} the content as a Buffer.
- */
- asNodeBuffer: function() {
- var result = getBinaryData(this);
- return utils.transformTo("nodebuffer", result);
- },
- /**
- * Returns the content as an Uint8Array.
- * @return {Uint8Array} the content as an Uint8Array.
- */
- asUint8Array: function() {
- var result = getBinaryData(this);
- return utils.transformTo("uint8array", result);
- },
- /**
- * Returns the content as an ArrayBuffer.
- * @return {ArrayBuffer} the content as an ArrayBufer.
- */
- asArrayBuffer: function() {
- return this.asUint8Array().buffer;
- }
- };
-
- /**
- * Transform an integer into a string in hexadecimal.
- * @private
- * @param {number} dec the number to convert.
- * @param {number} bytes the number of bytes to generate.
- * @returns {string} the result.
- */
- var decToHex = function(dec, bytes) {
- var hex = "",
- i;
- for (i = 0; i < bytes; i++) {
- hex += String.fromCharCode(dec & 0xff);
- dec = dec >>> 8;
- }
- return hex;
- };
-
- /**
- * Merge the objects passed as parameters into a new one.
- * @private
- * @param {...Object} var_args All objects to merge.
- * @return {Object} a new object with the data of the others.
- */
- var extend = function() {
- var result = {}, i, attr;
- for (i = 0; i < arguments.length; i++) { // arguments is not enumerable in some browsers
- for (attr in arguments[i]) {
- if (arguments[i].hasOwnProperty(attr) && typeof result[attr] === "undefined") {
- result[attr] = arguments[i][attr];
- }
- }
- }
- return result;
- };
-
- /**
- * Transforms the (incomplete) options from the user into the complete
- * set of options to create a file.
- * @private
- * @param {Object} o the options from the user.
- * @return {Object} the complete set of options.
- */
- var prepareFileAttrs = function(o) {
- o = o || {};
- if (o.base64 === true && (o.binary === null || o.binary === undefined)) {
- o.binary = true;
- }
- o = extend(o, defaults);
- o.date = o.date || new Date();
- if (o.compression !== null) o.compression = o.compression.toUpperCase();
-
- return o;
- };
-
- /**
- * Add a file in the current folder.
- * @private
- * @param {string} name the name of the file
- * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data of the file
- * @param {Object} o the options of the file
- * @return {Object} the new file.
- */
- var fileAdd = function(name, data, o) {
- // be sure sub folders exist
- var dataType = utils.getTypeOf(data),
- parent;
-
- o = prepareFileAttrs(o);
-
- if (o.createFolders && (parent = parentFolder(name))) {
- folderAdd.call(this, parent, true);
- }
-
- if (o.dir || data === null || typeof data === "undefined") {
- o.base64 = false;
- o.binary = false;
- data = null;
- }
- else if (dataType === "string") {
- if (o.binary && !o.base64) {
- // optimizedBinaryString == true means that the file has already been filtered with a 0xFF mask
- if (o.optimizedBinaryString !== true) {
- // this is a string, not in a base64 format.
- // Be sure that this is a correct "binary string"
- data = utils.string2binary(data);
- }
- }
- }
- else { // arraybuffer, uint8array, ...
- o.base64 = false;
- o.binary = true;
-
- if (!dataType && !(data instanceof CompressedObject)) {
- throw new Error("The data of '" + name + "' is in an unsupported format !");
- }
-
- // special case : it's way easier to work with Uint8Array than with ArrayBuffer
- if (dataType === "arraybuffer") {
- data = utils.transformTo("uint8array", data);
- }
- }
-
- var object = new ZipObject(name, data, o);
- this.files[name] = object;
- return object;
- };
-
- /**
- * Find the parent folder of the path.
- * @private
- * @param {string} path the path to use
- * @return {string} the parent folder, or ""
- */
- var parentFolder = function (path) {
- if (path.slice(-1) == '/') {
- path = path.substring(0, path.length - 1);
- }
- var lastSlash = path.lastIndexOf('/');
- return (lastSlash > 0) ? path.substring(0, lastSlash) : "";
- };
-
- /**
- * Add a (sub) folder in the current folder.
- * @private
- * @param {string} name the folder's name
- * @param {boolean=} [createFolders] If true, automatically create sub
- * folders. Defaults to false.
- * @return {Object} the new folder.
- */
- var folderAdd = function(name, createFolders) {
- // Check the name ends with a /
- if (name.slice(-1) != "/") {
- name += "/"; // IE doesn't like substr(-1)
- }
-
- createFolders = (typeof createFolders !== 'undefined') ? createFolders : false;
-
- // Does this folder already exist?
- if (!this.files[name]) {
- fileAdd.call(this, name, null, {
- dir: true,
- createFolders: createFolders
- });
- }
- return this.files[name];
- };
-
- /**
- * Generate a JSZip.CompressedObject for a given zipOject.
- * @param {ZipObject} file the object to read.
- * @param {JSZip.compression} compression the compression to use.
- * @return {JSZip.CompressedObject} the compressed result.
- */
- var generateCompressedObjectFrom = function(file, compression) {
- var result = new CompressedObject(),
- content;
-
- // the data has not been decompressed, we might reuse things !
- if (file._data instanceof CompressedObject) {
- result.uncompressedSize = file._data.uncompressedSize;
- result.crc32 = file._data.crc32;
-
- if (result.uncompressedSize === 0 || file.dir) {
- compression = compressions['STORE'];
- result.compressedContent = "";
- result.crc32 = 0;
- }
- else if (file._data.compressionMethod === compression.magic) {
- result.compressedContent = file._data.getCompressedContent();
- }
- else {
- content = file._data.getContent();
- // need to decompress / recompress
- result.compressedContent = compression.compress(utils.transformTo(compression.compressInputType, content));
- }
- }
- else {
- // have uncompressed data
- content = getBinaryData(file);
- if (!content || content.length === 0 || file.dir) {
- compression = compressions['STORE'];
- content = "";
- }
- result.uncompressedSize = content.length;
- result.crc32 = crc32(content);
- result.compressedContent = compression.compress(utils.transformTo(compression.compressInputType, content));
- }
-
- result.compressedSize = result.compressedContent.length;
- result.compressionMethod = compression.magic;
-
- return result;
- };
-
- /**
- * Generate the various parts used in the construction of the final zip file.
- * @param {string} name the file name.
- * @param {ZipObject} file the file content.
- * @param {JSZip.CompressedObject} compressedObject the compressed object.
- * @param {number} offset the current offset from the start of the zip file.
- * @return {object} the zip parts.
- */
- var generateZipParts = function(name, file, compressedObject, offset) {
- var data = compressedObject.compressedContent,
- utfEncodedFileName = utils.transformTo("string", utf8.utf8encode(file.name)),
- comment = file.comment || "",
- utfEncodedComment = utils.transformTo("string", utf8.utf8encode(comment)),
- useUTF8ForFileName = utfEncodedFileName.length !== file.name.length,
- useUTF8ForComment = utfEncodedComment.length !== comment.length,
- o = file.options,
- dosTime,
- dosDate,
- extraFields = "",
- unicodePathExtraField = "",
- unicodeCommentExtraField = "",
- dir, date;
-
-
- // handle the deprecated options.dir
- if (file._initialMetadata.dir !== file.dir) {
- dir = file.dir;
- } else {
- dir = o.dir;
- }
-
- // handle the deprecated options.date
- if(file._initialMetadata.date !== file.date) {
- date = file.date;
- } else {
- date = o.date;
- }
-
-
- dosTime = date.getHours();
- dosTime = dosTime << 6;
- dosTime = dosTime | date.getMinutes();
- dosTime = dosTime << 5;
- dosTime = dosTime | date.getSeconds() / 2;
-
- dosDate = date.getFullYear() - 1980;
- dosDate = dosDate << 4;
- dosDate = dosDate | (date.getMonth() + 1);
- dosDate = dosDate << 5;
- dosDate = dosDate | date.getDate();
-
- if (useUTF8ForFileName) {
- // set the unicode path extra field. unzip needs at least one extra
- // field to correctly handle unicode path, so using the path is as good
- // as any other information. This could improve the situation with
- // other archive managers too.
- // This field is usually used without the utf8 flag, with a non
- // unicode path in the header (winrar, winzip). This helps (a bit)
- // with the messy Windows' default compressed folders feature but
- // breaks on p7zip which doesn't seek the unicode path extra field.
- // So for now, UTF-8 everywhere !
- unicodePathExtraField =
- // Version
- decToHex(1, 1) +
- // NameCRC32
- decToHex(crc32(utfEncodedFileName), 4) +
- // UnicodeName
- utfEncodedFileName;
-
- extraFields +=
- // Info-ZIP Unicode Path Extra Field
- "\x75\x70" +
- // size
- decToHex(unicodePathExtraField.length, 2) +
- // content
- unicodePathExtraField;
- }
-
- if(useUTF8ForComment) {
-
- unicodeCommentExtraField =
- // Version
- decToHex(1, 1) +
- // CommentCRC32
- decToHex(this.crc32(utfEncodedComment), 4) +
- // UnicodeName
- utfEncodedComment;
-
- extraFields +=
- // Info-ZIP Unicode Path Extra Field
- "\x75\x63" +
- // size
- decToHex(unicodeCommentExtraField.length, 2) +
- // content
- unicodeCommentExtraField;
- }
-
- var header = "";
-
- // version needed to extract
- header += "\x0A\x00";
- // general purpose bit flag
- // set bit 11 if utf8
- header += (useUTF8ForFileName || useUTF8ForComment) ? "\x00\x08" : "\x00\x00";
- // compression method
- header += compressedObject.compressionMethod;
- // last mod file time
- header += decToHex(dosTime, 2);
- // last mod file date
- header += decToHex(dosDate, 2);
- // crc-32
- header += decToHex(compressedObject.crc32, 4);
- // compressed size
- header += decToHex(compressedObject.compressedSize, 4);
- // uncompressed size
- header += decToHex(compressedObject.uncompressedSize, 4);
- // file name length
- header += decToHex(utfEncodedFileName.length, 2);
- // extra field length
- header += decToHex(extraFields.length, 2);
-
-
- var fileRecord = signature.LOCAL_FILE_HEADER + header + utfEncodedFileName + extraFields;
-
- var dirRecord = signature.CENTRAL_FILE_HEADER +
- // version made by (00: DOS)
- "\x14\x00" +
- // file header (common to file and central directory)
- header +
- // file comment length
- decToHex(utfEncodedComment.length, 2) +
- // disk number start
- "\x00\x00" +
- // internal file attributes TODO
- "\x00\x00" +
- // external file attributes
- (dir === true ? "\x10\x00\x00\x00" : "\x00\x00\x00\x00") +
- // relative offset of local header
- decToHex(offset, 4) +
- // file name
- utfEncodedFileName +
- // extra field
- extraFields +
- // file comment
- utfEncodedComment;
-
- return {
- fileRecord: fileRecord,
- dirRecord: dirRecord,
- compressedObject: compressedObject
- };
- };
-
-
- // return the actual prototype of JSZip
- var out = {
- /**
- * Read an existing zip and merge the data in the current JSZip object.
- * The implementation is in jszip-load.js, don't forget to include it.
- * @param {String|ArrayBuffer|Uint8Array|Buffer} stream The stream to load
- * @param {Object} options Options for loading the stream.
- * options.base64 : is the stream in base64 ? default : false
- * @return {JSZip} the current JSZip object
- */
- load: function(stream, options) {
- throw new Error("Load method is not defined. Is the file jszip-load.js included ?");
- },
-
- /**
- * Filter nested files/folders with the specified function.
- * @param {Function} search the predicate to use :
- * function (relativePath, file) {...}
- * It takes 2 arguments : the relative path and the file.
- * @return {Array} An array of matching elements.
- */
- filter: function(search) {
- var result = [],
- filename, relativePath, file, fileClone;
- for (filename in this.files) {
- if (!this.files.hasOwnProperty(filename)) {
- continue;
- }
- file = this.files[filename];
- // return a new object, don't let the user mess with our internal objects :)
- fileClone = new ZipObject(file.name, file._data, extend(file.options));
- relativePath = filename.slice(this.root.length, filename.length);
- if (filename.slice(0, this.root.length) === this.root && // the file is in the current root
- search(relativePath, fileClone)) { // and the file matches the function
- result.push(fileClone);
- }
- }
- return result;
- },
-
- /**
- * Add a file to the zip file, or search a file.
- * @param {string|RegExp} name The name of the file to add (if data is defined),
- * the name of the file to find (if no data) or a regex to match files.
- * @param {String|ArrayBuffer|Uint8Array|Buffer} data The file data, either raw or base64 encoded
- * @param {Object} o File options
- * @return {JSZip|Object|Array} this JSZip object (when adding a file),
- * a file (when searching by string) or an array of files (when searching by regex).
- */
- file: function(name, data, o) {
- if (arguments.length === 1) {
- if (utils.isRegExp(name)) {
- var regexp = name;
- return this.filter(function(relativePath, file) {
- return !file.dir && regexp.test(relativePath);
- });
- }
- else { // text
- return this.filter(function(relativePath, file) {
- return !file.dir && relativePath === name;
- })[0] || null;
- }
- }
- else { // more than one argument : we have data !
- name = this.root + name;
- fileAdd.call(this, name, data, o);
- }
- return this;
- },
-
- /**
- * Add a directory to the zip file, or search.
- * @param {String|RegExp} arg The name of the directory to add, or a regex to search folders.
- * @return {JSZip} an object with the new directory as the root, or an array containing matching folders.
- */
- folder: function(arg) {
- if (!arg) {
- return this;
- }
-
- if (utils.isRegExp(arg)) {
- return this.filter(function(relativePath, file) {
- return file.dir && arg.test(relativePath);
- });
- }
-
- // else, name is a new folder
- var name = this.root + arg;
- var newFolder = folderAdd.call(this, name);
-
- // Allow chaining by returning a new object with this folder as the root
- var ret = this.clone();
- ret.root = newFolder.name;
- return ret;
- },
-
- /**
- * Delete a file, or a directory and all sub-files, from the zip
- * @param {string} name the name of the file to delete
- * @return {JSZip} this JSZip object
- */
- remove: function(name) {
- name = this.root + name;
- var file = this.files[name];
- if (!file) {
- // Look for any folders
- if (name.slice(-1) != "/") {
- name += "/";
- }
- file = this.files[name];
- }
-
- if (file && !file.dir) {
- // file
- delete this.files[name];
- } else {
- // maybe a folder, delete recursively
- var kids = this.filter(function(relativePath, file) {
- return file.name.slice(0, name.length) === name;
- });
- for (var i = 0; i < kids.length; i++) {
- delete this.files[kids[i].name];
- }
- }
-
- return this;
- },
-
- /**
- * Generate the complete zip file
- * @param {Object} options the options to generate the zip file :
- * - base64, (deprecated, use type instead) true to generate base64.
- * - compression, "STORE" by default.
- * - type, "base64" by default. Values are : string, base64, uint8array, arraybuffer, blob.
- * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the zip file
- */
- generate: function(options) {
- options = extend(options || {}, {
- base64: true,
- compression: "STORE",
- type: "base64",
- comment: null
- });
-
- utils.checkSupport(options.type);
-
- var zipData = [],
- localDirLength = 0,
- centralDirLength = 0,
- writer, i,
- utfEncodedComment = utils.transformTo("string", this.utf8encode(options.comment || this.comment || ""));
-
- // first, generate all the zip parts.
- for (var name in this.files) {
- if (!this.files.hasOwnProperty(name)) {
- continue;
- }
- var file = this.files[name];
-
- var compressionName = file.options.compression || options.compression.toUpperCase();
- var compression = compressions[compressionName];
- if (!compression) {
- throw new Error(compressionName + " is not a valid compression method !");
- }
-
- var compressedObject = generateCompressedObjectFrom.call(this, file, compression);
-
- var zipPart = generateZipParts.call(this, name, file, compressedObject, localDirLength);
- localDirLength += zipPart.fileRecord.length + compressedObject.compressedSize;
- centralDirLength += zipPart.dirRecord.length;
- zipData.push(zipPart);
- }
-
- var dirEnd = "";
-
- // end of central dir signature
- dirEnd = signature.CENTRAL_DIRECTORY_END +
- // number of this disk
- "\x00\x00" +
- // number of the disk with the start of the central directory
- "\x00\x00" +
- // total number of entries in the central directory on this disk
- decToHex(zipData.length, 2) +
- // total number of entries in the central directory
- decToHex(zipData.length, 2) +
- // size of the central directory 4 bytes
- decToHex(centralDirLength, 4) +
- // offset of start of central directory with respect to the starting disk number
- decToHex(localDirLength, 4) +
- // .ZIP file comment length
- decToHex(utfEncodedComment.length, 2) +
- // .ZIP file comment
- utfEncodedComment;
-
-
- // we have all the parts (and the total length)
- // time to create a writer !
- var typeName = options.type.toLowerCase();
- if(typeName==="uint8array"||typeName==="arraybuffer"||typeName==="blob"||typeName==="nodebuffer") {
- writer = new Uint8ArrayWriter(localDirLength + centralDirLength + dirEnd.length);
- }else{
- writer = new StringWriter(localDirLength + centralDirLength + dirEnd.length);
- }
-
- for (i = 0; i < zipData.length; i++) {
- writer.append(zipData[i].fileRecord);
- writer.append(zipData[i].compressedObject.compressedContent);
- }
- for (i = 0; i < zipData.length; i++) {
- writer.append(zipData[i].dirRecord);
- }
-
- writer.append(dirEnd);
-
- var zip = writer.finalize();
-
-
-
- switch(options.type.toLowerCase()) {
- // case "zip is an Uint8Array"
- case "uint8array" :
- case "arraybuffer" :
- case "nodebuffer" :
- return utils.transformTo(options.type.toLowerCase(), zip);
- case "blob" :
- return utils.arrayBuffer2Blob(utils.transformTo("arraybuffer", zip));
- // case "zip is a string"
- case "base64" :
- return (options.base64) ? base64.encode(zip) : zip;
- default : // case "string" :
- return zip;
- }
-
- },
-
- /**
- * @deprecated
- * This method will be removed in a future version without replacement.
- */
- crc32: function (input, crc) {
- return crc32(input, crc);
- },
-
- /**
- * @deprecated
- * This method will be removed in a future version without replacement.
- */
- utf8encode: function (string) {
- return utils.transformTo("string", utf8.utf8encode(string));
- },
-
- /**
- * @deprecated
- * This method will be removed in a future version without replacement.
- */
- utf8decode: function (input) {
- return utf8.utf8decode(input);
- }
- };
- module.exports = out;
-
- },{"./base64":1,"./compressedObject":2,"./compressions":3,"./crc32":4,"./defaults":6,"./nodeBuffer":11,"./signature":14,"./stringWriter":16,"./support":17,"./uint8ArrayWriter":19,"./utf8":20,"./utils":21}],14:[function(_dereq_,module,exports){
- 'use strict';
- exports.LOCAL_FILE_HEADER = "PK\x03\x04";
- exports.CENTRAL_FILE_HEADER = "PK\x01\x02";
- exports.CENTRAL_DIRECTORY_END = "PK\x05\x06";
- exports.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x06\x07";
- exports.ZIP64_CENTRAL_DIRECTORY_END = "PK\x06\x06";
- exports.DATA_DESCRIPTOR = "PK\x07\x08";
-
- },{}],15:[function(_dereq_,module,exports){
- 'use strict';
- var DataReader = _dereq_('./dataReader');
- var utils = _dereq_('./utils');
-
- function StringReader(data, optimizedBinaryString) {
- this.data = data;
- if (!optimizedBinaryString) {
- this.data = utils.string2binary(this.data);
- }
- this.length = this.data.length;
- this.index = 0;
- }
- StringReader.prototype = new DataReader();
- /**
- * @see DataReader.byteAt
- */
- StringReader.prototype.byteAt = function(i) {
- return this.data.charCodeAt(i);
- };
- /**
- * @see DataReader.lastIndexOfSignature
- */
- StringReader.prototype.lastIndexOfSignature = function(sig) {
- return this.data.lastIndexOf(sig);
- };
- /**
- * @see DataReader.readData
- */
- StringReader.prototype.readData = function(size) {
- this.checkOffset(size);
- // this will work because the constructor applied the "& 0xff" mask.
- var result = this.data.slice(this.index, this.index + size);
- this.index += size;
- return result;
- };
- module.exports = StringReader;
-
- },{"./dataReader":5,"./utils":21}],16:[function(_dereq_,module,exports){
- 'use strict';
-
- var utils = _dereq_('./utils');
-
- /**
- * An object to write any content to a string.
- * @constructor
- */
- var StringWriter = function() {
- this.data = [];
- };
- StringWriter.prototype = {
- /**
- * Append any content to the current string.
- * @param {Object} input the content to add.
- */
- append: function(input) {
- input = utils.transformTo("string", input);
- this.data.push(input);
- },
- /**
- * Finalize the construction an return the result.
- * @return {string} the generated string.
- */
- finalize: function() {
- return this.data.join("");
- }
- };
-
- module.exports = StringWriter;
-
- },{"./utils":21}],17:[function(_dereq_,module,exports){
- (function (Buffer){
- 'use strict';
- exports.base64 = true;
- exports.array = true;
- exports.string = true;
- exports.arraybuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined";
- // contains true if JSZip can read/generate nodejs Buffer, false otherwise.
- // Browserify will provide a Buffer implementation for browsers, which is
- // an augmented Uint8Array (i.e., can be used as either Buffer or U8).
- exports.nodebuffer = typeof Buffer !== "undefined";
- // contains true if JSZip can read/generate Uint8Array, false otherwise.
- exports.uint8array = typeof Uint8Array !== "undefined";
-
- if (typeof ArrayBuffer === "undefined") {
- exports.blob = false;
- }
- else {
- var buffer = new ArrayBuffer(0);
- try {
- exports.blob = new Blob([buffer], {
- type: "application/zip"
- }).size === 0;
- }
- catch (e) {
- try {
- var Builder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;
- var builder = new Builder();
- builder.append(buffer);
- exports.blob = builder.getBlob('application/zip').size === 0;
- }
- catch (e) {
- exports.blob = false;
- }
- }
- }
-
- }).call(this,(typeof Buffer !== "undefined" ? Buffer : undefined))
- },{}],18:[function(_dereq_,module,exports){
- 'use strict';
- var DataReader = _dereq_('./dataReader');
-
- function Uint8ArrayReader(data) {
- if (data) {
- this.data = data;
- this.length = this.data.length;
- this.index = 0;
- }
- }
- Uint8ArrayReader.prototype = new DataReader();
- /**
- * @see DataReader.byteAt
- */
- Uint8ArrayReader.prototype.byteAt = function(i) {
- return this.data[i];
- };
- /**
- * @see DataReader.lastIndexOfSignature
- */
- Uint8ArrayReader.prototype.lastIndexOfSignature = function(sig) {
- var sig0 = sig.charCodeAt(0),
- sig1 = sig.charCodeAt(1),
- sig2 = sig.charCodeAt(2),
- sig3 = sig.charCodeAt(3);
- for (var i = this.length - 4; i >= 0; --i) {
- if (this.data[i] === sig0 && this.data[i + 1] === sig1 && this.data[i + 2] === sig2 && this.data[i + 3] === sig3) {
- return i;
- }
- }
-
- return -1;
- };
- /**
- * @see DataReader.readData
- */
- Uint8ArrayReader.prototype.readData = function(size) {
- this.checkOffset(size);
- if(size === 0) {
- // in IE10, when using subarray(idx, idx), we get the array [0x00] instead of [].
- return new Uint8Array(0);
- }
- var result = this.data.subarray(this.index, this.index + size);
- this.index += size;
- return result;
- };
- module.exports = Uint8ArrayReader;
-
- },{"./dataReader":5}],19:[function(_dereq_,module,exports){
- 'use strict';
-
- var utils = _dereq_('./utils');
-
- /**
- * An object to write any content to an Uint8Array.
- * @constructor
- * @param {number} length The length of the array.
- */
- var Uint8ArrayWriter = function(length) {
- this.data = new Uint8Array(length);
- this.index = 0;
- };
- Uint8ArrayWriter.prototype = {
- /**
- * Append any content to the current array.
- * @param {Object} input the content to add.
- */
- append: function(input) {
- if (input.length !== 0) {
- // with an empty Uint8Array, Opera fails with a "Offset larger than array size"
- input = utils.transformTo("uint8array", input);
- this.data.set(input, this.index);
- this.index += input.length;
- }
- },
- /**
- * Finalize the construction an return the result.
- * @return {Uint8Array} the generated array.
- */
- finalize: function() {
- return this.data;
- }
- };
-
- module.exports = Uint8ArrayWriter;
-
- },{"./utils":21}],20:[function(_dereq_,module,exports){
- 'use strict';
-
- var utils = _dereq_('./utils');
- var support = _dereq_('./support');
- var nodeBuffer = _dereq_('./nodeBuffer');
-
- /**
- * The following functions come from pako, from pako/lib/utils/strings
- * released under the MIT license, see pako https://github.com/nodeca/pako/
- */
-
- // Table with utf8 lengths (calculated by first byte of sequence)
- // Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
- // because max possible codepoint is 0x10ffff
- var _utf8len = new Array(256);
- for (var i=0; i<256; i++) {
- _utf8len[i] = (i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1);
- }
- _utf8len[254]=_utf8len[254]=1; // Invalid sequence start
-
- // convert string to array (typed, when possible)
- var string2buf = function (str) {
- var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
-
- // count binary size
- for (m_pos = 0; m_pos < str_len; m_pos++) {
- c = str.charCodeAt(m_pos);
- if (((c & 0xfc00) === 0xd800) && (m_pos+1 < str_len)) {
- c2 = str.charCodeAt(m_pos+1);
- if ((c2 & 0xfc00) === 0xdc00) {
- c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
- m_pos++;
- }
- }
- buf_len += (c < 0x80) ? 1 : ((c < 0x800) ? 2 : ((c < 0x10000) ? 3 : 4));
- }
-
- // allocate buffer
- if (support.uint8array) {
- buf = new Uint8Array(buf_len);
- } else {
- buf = new Array(buf_len);
- }
-
- // convert
- for (i=0, m_pos = 0; i < buf_len; m_pos++) {
- c = str.charCodeAt(m_pos);
- if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {
- c2 = str.charCodeAt(m_pos+1);
- if ((c2 & 0xfc00) === 0xdc00) {
- c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
- m_pos++;
- }
- }
- if (c < 0x80) {
- /* one byte */
- buf[i++] = c;
- } else if (c < 0x800) {
- /* two bytes */
- buf[i++] = 0xC0 | (c >>> 6);
- buf[i++] = 0x80 | (c & 0x3f);
- } else if (c < 0x10000) {
- /* three bytes */
- buf[i++] = 0xE0 | (c >>> 12);
- buf[i++] = 0x80 | ((c >>> 6) & 0x3f);
- buf[i++] = 0x80 | (c & 0x3f);
- } else {
- /* four bytes */
- buf[i++] = 0xf0 | (c >>> 18);
- buf[i++] = 0x80 | ((c >>> 12) & 0x3f);
- buf[i++] = 0x80 | ((c >>> 6) & 0x3f);
- buf[i++] = 0x80 | (c & 0x3f);
- }
- }
-
- return buf;
- };
-
- // Calculate max possible position in utf8 buffer,
- // that will not break sequence. If that's not possible
- // - (very small limits) return max size as is.
- //
- // buf[] - utf8 bytes array
- // max - length limit (mandatory);
- var utf8border = function(buf, max) {
- var pos;
-
- max = max || buf.length;
- if (max > buf.length) { max = buf.length; }
-
- // go back from last position, until start of sequence found
- pos = max-1;
- while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }
-
- // Fuckup - very small and broken sequence,
- // return max, because we should return something anyway.
- if (pos < 0) { return max; }
-
- // If we came to start of buffer - that means vuffer is too small,
- // return max too.
- if (pos === 0) { return max; }
-
- return (pos + _utf8len[buf[pos]] > max) ? pos : max;
- };
-
- // convert array to string
- var buf2string = function (buf) {
- var str, i, out, c, c_len;
- var len = buf.length;
-
- // Reserve max possible length (2 words per char)
- // NB: by unknown reasons, Array is significantly faster for
- // String.fromCharCode.apply than Uint16Array.
- var utf16buf = new Array(len*2);
-
- for (out=0, i=0; i<len;) {
- c = buf[i++];
- // quick process ascii
- if (c < 0x80) { utf16buf[out++] = c; continue; }
-
- c_len = _utf8len[c];
- // skip 5 & 6 byte codes
- if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len-1; continue; }
-
- // apply mask on first byte
- c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;
- // join the rest
- while (c_len > 1 && i < len) {
- c = (c << 6) | (buf[i++] & 0x3f);
- c_len--;
- }
-
- // terminated by end of string?
- if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }
-
- if (c < 0x10000) {
- utf16buf[out++] = c;
- } else {
- c -= 0x10000;
- utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);
- utf16buf[out++] = 0xdc00 | (c & 0x3ff);
- }
- }
-
- // shrinkBuf(utf16buf, out)
- if (utf16buf.length !== out) {
- if(utf16buf.subarray) {
- utf16buf = utf16buf.subarray(0, out);
- } else {
- utf16buf.length = out;
- }
- }
-
- // return String.fromCharCode.apply(null, utf16buf);
- return utils.applyFromCharCode(utf16buf);
- };
-
-
- // That's all for the pako functions.
-
-
- /**
- * Transform a javascript string into an array (typed if possible) of bytes,
- * UTF-8 encoded.
- * @param {String} str the string to encode
- * @return {Array|Uint8Array|Buffer} the UTF-8 encoded string.
- */
- exports.utf8encode = function utf8encode(str) {
- if (support.nodebuffer) {
- return nodeBuffer(str, "utf-8");
- }
-
- return string2buf(str);
- };
-
-
- /**
- * Transform a bytes array (or a representation) representing an UTF-8 encoded
- * string into a javascript string.
- * @param {Array|Uint8Array|Buffer} buf the data de decode
- * @return {String} the decoded string.
- */
- exports.utf8decode = function utf8decode(buf) {
- if (support.nodebuffer) {
- return utils.transformTo("nodebuffer", buf).toString("utf-8");
- }
-
- buf = utils.transformTo(support.uint8array ? "uint8array" : "array", buf);
-
- // return buf2string(buf);
- // Chrome prefers to work with "small" chunks of data
- // for the method buf2string.
- // Firefox and Chrome has their own shortcut, IE doesn't seem to really care.
- var result = [], k = 0, len = buf.length, chunk = 65536;
- while (k < len) {
- var nextBoundary = utf8border(buf, Math.min(k + chunk, len));
- if (support.uint8array) {
- result.push(buf2string(buf.subarray(k, nextBoundary)));
- } else {
- result.push(buf2string(buf.slice(k, nextBoundary)));
- }
- k = nextBoundary;
- }
- return result.join("");
-
- };
- // vim: set shiftwidth=4 softtabstop=4:
-
- },{"./nodeBuffer":11,"./support":17,"./utils":21}],21:[function(_dereq_,module,exports){
- 'use strict';
- var support = _dereq_('./support');
- var compressions = _dereq_('./compressions');
- var nodeBuffer = _dereq_('./nodeBuffer');
- /**
- * Convert a string to a "binary string" : a string containing only char codes between 0 and 255.
- * @param {string} str the string to transform.
- * @return {String} the binary string.
- */
- exports.string2binary = function(str) {
- var result = "";
- for (var i = 0; i < str.length; i++) {
- result += String.fromCharCode(str.charCodeAt(i) & 0xff);
- }
- return result;
- };
- exports.arrayBuffer2Blob = function(buffer) {
- exports.checkSupport("blob");
-
- try {
- // Blob constructor
- return new Blob([buffer], {
- type: "application/zip"
- });
- }
- catch (e) {
-
- try {
- // deprecated, browser only, old way
- var Builder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;
- var builder = new Builder();
- builder.append(buffer);
- return builder.getBlob('application/zip');
- }
- catch (e) {
-
- // well, fuck ?!
- throw new Error("Bug : can't construct the Blob.");
- }
- }
-
-
- };
- /**
- * The identity function.
- * @param {Object} input the input.
- * @return {Object} the same input.
- */
- function identity(input) {
- return input;
- }
-
- /**
- * Fill in an array with a string.
- * @param {String} str the string to use.
- * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to fill in (will be mutated).
- * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated array.
- */
- function stringToArrayLike(str, array) {
- for (var i = 0; i < str.length; ++i) {
- array[i] = str.charCodeAt(i) & 0xFF;
- }
- return array;
- }
-
- /**
- * Transform an array-like object to a string.
- * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform.
- * @return {String} the result.
- */
- function arrayLikeToString(array) {
- // Performances notes :
- // --------------------
- // String.fromCharCode.apply(null, array) is the fastest, see
- // see http://jsperf.com/converting-a-uint8array-to-a-string/2
- // but the stack is limited (and we can get huge arrays !).
- //
- // result += String.fromCharCode(array[i]); generate too many strings !
- //
- // This code is inspired by http://jsperf.com/arraybuffer-to-string-apply-performance/2
- var chunk = 65536;
- var result = [],
- len = array.length,
- type = exports.getTypeOf(array),
- k = 0,
- canUseApply = true;
- try {
- switch(type) {
- case "uint8array":
- String.fromCharCode.apply(null, new Uint8Array(0));
- break;
- case "nodebuffer":
- String.fromCharCode.apply(null, nodeBuffer(0));
- break;
- }
- } catch(e) {
- canUseApply = false;
- }
-
- // no apply : slow and painful algorithm
- // default browser on android 4.*
- if (!canUseApply) {
- var resultStr = "";
- for(var i = 0; i < array.length;i++) {
- resultStr += String.fromCharCode(array[i]);
- }
- return resultStr;
- }
- while (k < len && chunk > 1) {
- try {
- if (type === "array" || type === "nodebuffer") {
- result.push(String.fromCharCode.apply(null, array.slice(k, Math.min(k + chunk, len))));
- }
- else {
- result.push(String.fromCharCode.apply(null, array.subarray(k, Math.min(k + chunk, len))));
- }
- k += chunk;
- }
- catch (e) {
- chunk = Math.floor(chunk / 2);
- }
- }
- return result.join("");
- }
-
- exports.applyFromCharCode = arrayLikeToString;
-
-
- /**
- * Copy the data from an array-like to an other array-like.
- * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayFrom the origin array.
- * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayTo the destination array which will be mutated.
- * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated destination array.
- */
- function arrayLikeToArrayLike(arrayFrom, arrayTo) {
- for (var i = 0; i < arrayFrom.length; i++) {
- arrayTo[i] = arrayFrom[i];
- }
- return arrayTo;
- }
-
- // a matrix containing functions to transform everything into everything.
- var transform = {};
-
- // string to ?
- transform["string"] = {
- "string": identity,
- "array": function(input) {
- return stringToArrayLike(input, new Array(input.length));
- },
- "arraybuffer": function(input) {
- return transform["string"]["uint8array"](input).buffer;
- },
- "uint8array": function(input) {
- return stringToArrayLike(input, new Uint8Array(input.length));
- },
- "nodebuffer": function(input) {
- return stringToArrayLike(input, nodeBuffer(input.length));
- }
- };
-
- // array to ?
- transform["array"] = {
- "string": arrayLikeToString,
- "array": identity,
- "arraybuffer": function(input) {
- return (new Uint8Array(input)).buffer;
- },
- "uint8array": function(input) {
- return new Uint8Array(input);
- },
- "nodebuffer": function(input) {
- return nodeBuffer(input);
- }
- };
-
- // arraybuffer to ?
- transform["arraybuffer"] = {
- "string": function(input) {
- return arrayLikeToString(new Uint8Array(input));
- },
- "array": function(input) {
- return arrayLikeToArrayLike(new Uint8Array(input), new Array(input.byteLength));
- },
- "arraybuffer": identity,
- "uint8array": function(input) {
- return new Uint8Array(input);
- },
- "nodebuffer": function(input) {
- return nodeBuffer(new Uint8Array(input));
- }
- };
-
- // uint8array to ?
- transform["uint8array"] = {
- "string": arrayLikeToString,
- "array": function(input) {
- return arrayLikeToArrayLike(input, new Array(input.length));
- },
- "arraybuffer": function(input) {
- return input.buffer;
- },
- "uint8array": identity,
- "nodebuffer": function(input) {
- return nodeBuffer(input);
- }
- };
-
- // nodebuffer to ?
- transform["nodebuffer"] = {
- "string": arrayLikeToString,
- "array": function(input) {
- return arrayLikeToArrayLike(input, new Array(input.length));
- },
- "arraybuffer": function(input) {
- return transform["nodebuffer"]["uint8array"](input).buffer;
- },
- "uint8array": function(input) {
- return arrayLikeToArrayLike(input, new Uint8Array(input.length));
- },
- "nodebuffer": identity
- };
-
- /**
- * Transform an input into any type.
- * The supported output type are : string, array, uint8array, arraybuffer, nodebuffer.
- * If no output type is specified, the unmodified input will be returned.
- * @param {String} outputType the output type.
- * @param {String|Array|ArrayBuffer|Uint8Array|Buffer} input the input to convert.
- * @throws {Error} an Error if the browser doesn't support the requested output type.
- */
- exports.transformTo = function(outputType, input) {
- if (!input) {
- // undefined, null, etc
- // an empty string won't harm.
- input = "";
- }
- if (!outputType) {
- return input;
- }
- exports.checkSupport(outputType);
- var inputType = exports.getTypeOf(input);
- var result = transform[inputType][outputType](input);
- return result;
- };
-
- /**
- * Return the type of the input.
- * The type will be in a format valid for JSZip.utils.transformTo : string, array, uint8array, arraybuffer.
- * @param {Object} input the input to identify.
- * @return {String} the (lowercase) type of the input.
- */
- exports.getTypeOf = function(input) {
- if (typeof input === "string") {
- return "string";
- }
- if (Object.prototype.toString.call(input) === "[object Array]") {
- return "array";
- }
- if (support.nodebuffer && nodeBuffer.test(input)) {
- return "nodebuffer";
- }
- if (support.uint8array && input instanceof Uint8Array) {
- return "uint8array";
- }
- if (support.arraybuffer && input instanceof ArrayBuffer) {
- return "arraybuffer";
- }
- };
-
- /**
- * Throw an exception if the type is not supported.
- * @param {String} type the type to check.
- * @throws {Error} an Error if the browser doesn't support the requested type.
- */
- exports.checkSupport = function(type) {
- var supported = support[type.toLowerCase()];
- if (!supported) {
- throw new Error(type + " is not supported by this browser");
- }
- };
- exports.MAX_VALUE_16BITS = 65535;
- exports.MAX_VALUE_32BITS = -1; // well, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF" is parsed as -1
-
- /**
- * Prettify a string read as binary.
- * @param {string} str the string to prettify.
- * @return {string} a pretty string.
- */
- exports.pretty = function(str) {
- var res = '',
- code, i;
- for (i = 0; i < (str || "").length; i++) {
- code = str.charCodeAt(i);
- res += '\\x' + (code < 16 ? "0" : "") + code.toString(16).toUpperCase();
- }
- return res;
- };
-
- /**
- * Find a compression registered in JSZip.
- * @param {string} compressionMethod the method magic to find.
- * @return {Object|null} the JSZip compression object, null if none found.
- */
- exports.findCompression = function(compressionMethod) {
- for (var method in compressions) {
- if (!compressions.hasOwnProperty(method)) {
- continue;
- }
- if (compressions[method].magic === compressionMethod) {
- return compressions[method];
- }
- }
- return null;
- };
- /**
- * Cross-window, cross-Node-context regular expression detection
- * @param {Object} object Anything
- * @return {Boolean} true if the object is a regular expression,
- * false otherwise
- */
- exports.isRegExp = function (object) {
- return Object.prototype.toString.call(object) === "[object RegExp]";
- };
-
-
- },{"./compressions":3,"./nodeBuffer":11,"./support":17}],22:[function(_dereq_,module,exports){
- 'use strict';
- var StringReader = _dereq_('./stringReader');
- var NodeBufferReader = _dereq_('./nodeBufferReader');
- var Uint8ArrayReader = _dereq_('./uint8ArrayReader');
- var utils = _dereq_('./utils');
- var sig = _dereq_('./signature');
- var ZipEntry = _dereq_('./zipEntry');
- var support = _dereq_('./support');
- var jszipProto = _dereq_('./object');
- // class ZipEntries {{{
- /**
- * All the entries in the zip file.
- * @constructor
- * @param {String|ArrayBuffer|Uint8Array} data the binary stream to load.
- * @param {Object} loadOptions Options for loading the stream.
- */
- function ZipEntries(data, loadOptions) {
- this.files = [];
- this.loadOptions = loadOptions;
- if (data) {
- this.load(data);
- }
- }
- ZipEntries.prototype = {
- /**
- * Check that the reader is on the speficied signature.
- * @param {string} expectedSignature the expected signature.
- * @throws {Error} if it is an other signature.
- */
- checkSignature: function(expectedSignature) {
- var signature = this.reader.readString(4);
- if (signature !== expectedSignature) {
- throw new Error("Corrupted zip or bug : unexpected signature " + "(" + utils.pretty(signature) + ", expected " + utils.pretty(expectedSignature) + ")");
- }
- },
- /**
- * Read the end of the central directory.
- */
- readBlockEndOfCentral: function() {
- this.diskNumber = this.reader.readInt(2);
- this.diskWithCentralDirStart = this.reader.readInt(2);
- this.centralDirRecordsOnThisDisk = this.reader.readInt(2);
- this.centralDirRecords = this.reader.readInt(2);
- this.centralDirSize = this.reader.readInt(4);
- this.centralDirOffset = this.reader.readInt(4);
-
- this.zipCommentLength = this.reader.readInt(2);
- // warning : the encoding depends of the system locale
- // On a linux machine with LANG=en_US.utf8, this field is utf8 encoded.
- // On a windows machine, this field is encoded with the localized windows code page.
- this.zipComment = this.reader.readString(this.zipCommentLength);
- // To get consistent behavior with the generation part, we will assume that
- // this is utf8 encoded.
- this.zipComment = jszipProto.utf8decode(this.zipComment);
- },
- /**
- * Read the end of the Zip 64 central directory.
- * Not merged with the method readEndOfCentral :
- * The end of central can coexist with its Zip64 brother,
- * I don't want to read the wrong number of bytes !
- */
- readBlockZip64EndOfCentral: function() {
- this.zip64EndOfCentralSize = this.reader.readInt(8);
- this.versionMadeBy = this.reader.readString(2);
- this.versionNeeded = this.reader.readInt(2);
- this.diskNumber = this.reader.readInt(4);
- this.diskWithCentralDirStart = this.reader.readInt(4);
- this.centralDirRecordsOnThisDisk = this.reader.readInt(8);
- this.centralDirRecords = this.reader.readInt(8);
- this.centralDirSize = this.reader.readInt(8);
- this.centralDirOffset = this.reader.readInt(8);
-
- this.zip64ExtensibleData = {};
- var extraDataSize = this.zip64EndOfCentralSize - 44,
- index = 0,
- extraFieldId,
- extraFieldLength,
- extraFieldValue;
- while (index < extraDataSize) {
- extraFieldId = this.reader.readInt(2);
- extraFieldLength = this.reader.readInt(4);
- extraFieldValue = this.reader.readString(extraFieldLength);
- this.zip64ExtensibleData[extraFieldId] = {
- id: extraFieldId,
- length: extraFieldLength,
- value: extraFieldValue
- };
- }
- },
- /**
- * Read the end of the Zip 64 central directory locator.
- */
- readBlockZip64EndOfCentralLocator: function() {
- this.diskWithZip64CentralDirStart = this.reader.readInt(4);
- this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8);
- this.disksCount = this.reader.readInt(4);
- if (this.disksCount > 1) {
- throw new Error("Multi-volumes zip are not supported");
- }
- },
- /**
- * Read the local files, based on the offset read in the central part.
- */
- readLocalFiles: function() {
- var i, file;
- for (i = 0; i < this.files.length; i++) {
- file = this.files[i];
- this.reader.setIndex(file.localHeaderOffset);
- this.checkSignature(sig.LOCAL_FILE_HEADER);
- file.readLocalPart(this.reader);
- file.handleUTF8();
- }
- },
- /**
- * Read the central directory.
- */
- readCentralDir: function() {
- var file;
-
- this.reader.setIndex(this.centralDirOffset);
- while (this.reader.readString(4) === sig.CENTRAL_FILE_HEADER) {
- file = new ZipEntry({
- zip64: this.zip64
- }, this.loadOptions);
- file.readCentralPart(this.reader);
- this.files.push(file);
- }
- },
- /**
- * Read the end of central directory.
- */
- readEndOfCentral: function() {
- var offset = this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END);
- if (offset === -1) {
- throw new Error("Corrupted zip : can't find end of central directory");
- }
- this.reader.setIndex(offset);
- this.checkSignature(sig.CENTRAL_DIRECTORY_END);
- this.readBlockEndOfCentral();
-
-
- /* extract from the zip spec :
- 4) If one of the fields in the end of central directory
- record is too small to hold required data, the field
- should be set to -1 (0xFFFF or 0xFFFFFFFF) and the
- ZIP64 format record should be created.
- 5) The end of central directory record and the
- Zip64 end of central directory locator record must
- reside on the same disk when splitting or spanning
- an archive.
- */
- if (this.diskNumber === utils.MAX_VALUE_16BITS || this.diskWithCentralDirStart === utils.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === utils.MAX_VALUE_16BITS || this.centralDirRecords === utils.MAX_VALUE_16BITS || this.centralDirSize === utils.MAX_VALUE_32BITS || this.centralDirOffset === utils.MAX_VALUE_32BITS) {
- this.zip64 = true;
-
- /*
- Warning : the zip64 extension is supported, but ONLY if the 64bits integer read from
- the zip file can fit into a 32bits integer. This cannot be solved : Javascript represents
- all numbers as 64-bit double precision IEEE 754 floating point numbers.
- So, we have 53bits for integers and bitwise operations treat everything as 32bits.
- see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/Bitwise_Operators
- and http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf section 8.5
- */
-
- // should look for a zip64 EOCD locator
- offset = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);
- if (offset === -1) {
- throw new Error("Corrupted zip : can't find the ZIP64 end of central directory locator");
- }
- this.reader.setIndex(offset);
- this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);
- this.readBlockZip64EndOfCentralLocator();
-
- // now the zip64 EOCD record
- this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir);
- this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_END);
- this.readBlockZip64EndOfCentral();
- }
- },
- prepareReader: function(data) {
- var type = utils.getTypeOf(data);
- if (type === "string" && !support.uint8array) {
- this.reader = new StringReader(data, this.loadOptions.optimizedBinaryString);
- }
- else if (type === "nodebuffer") {
- this.reader = new NodeBufferReader(data);
- }
- else {
- this.reader = new Uint8ArrayReader(utils.transformTo("uint8array", data));
- }
- },
- /**
- * Read a zip file and create ZipEntries.
- * @param {String|ArrayBuffer|Uint8Array|Buffer} data the binary string representing a zip file.
- */
- load: function(data) {
- this.prepareReader(data);
- this.readEndOfCentral();
- this.readCentralDir();
- this.readLocalFiles();
- }
- };
- // }}} end of ZipEntries
- module.exports = ZipEntries;
-
- },{"./nodeBufferReader":12,"./object":13,"./signature":14,"./stringReader":15,"./support":17,"./uint8ArrayReader":18,"./utils":21,"./zipEntry":23}],23:[function(_dereq_,module,exports){
- 'use strict';
- var StringReader = _dereq_('./stringReader');
- var utils = _dereq_('./utils');
- var CompressedObject = _dereq_('./compressedObject');
- var jszipProto = _dereq_('./object');
- // class ZipEntry {{{
- /**
- * An entry in the zip file.
- * @constructor
- * @param {Object} options Options of the current file.
- * @param {Object} loadOptions Options for loading the stream.
- */
- function ZipEntry(options, loadOptions) {
- this.options = options;
- this.loadOptions = loadOptions;
- }
- ZipEntry.prototype = {
- /**
- * say if the file is encrypted.
- * @return {boolean} true if the file is encrypted, false otherwise.
- */
- isEncrypted: function() {
- // bit 1 is set
- return (this.bitFlag & 0x0001) === 0x0001;
- },
- /**
- * say if the file has utf-8 filename/comment.
- * @return {boolean} true if the filename/comment is in utf-8, false otherwise.
- */
- useUTF8: function() {
- // bit 11 is set
- return (this.bitFlag & 0x0800) === 0x0800;
- },
- /**
- * Prepare the function used to generate the compressed content from this ZipFile.
- * @param {DataReader} reader the reader to use.
- * @param {number} from the offset from where we should read the data.
- * @param {number} length the length of the data to read.
- * @return {Function} the callback to get the compressed content (the type depends of the DataReader class).
- */
- prepareCompressedContent: function(reader, from, length) {
- return function() {
- var previousIndex = reader.index;
- reader.setIndex(from);
- var compressedFileData = reader.readData(length);
- reader.setIndex(previousIndex);
-
- return compressedFileData;
- };
- },
- /**
- * Prepare the function used to generate the uncompressed content from this ZipFile.
- * @param {DataReader} reader the reader to use.
- * @param {number} from the offset from where we should read the data.
- * @param {number} length the length of the data to read.
- * @param {JSZip.compression} compression the compression used on this file.
- * @param {number} uncompressedSize the uncompressed size to expect.
- * @return {Function} the callback to get the uncompressed content (the type depends of the DataReader class).
- */
- prepareContent: function(reader, from, length, compression, uncompressedSize) {
- return function() {
-
- var compressedFileData = utils.transformTo(compression.uncompressInputType, this.getCompressedContent());
- var uncompressedFileData = compression.uncompress(compressedFileData);
-
- if (uncompressedFileData.length !== uncompressedSize) {
- throw new Error("Bug : uncompressed data size mismatch");
- }
-
- return uncompressedFileData;
- };
- },
- /**
- * Read the local part of a zip file and add the info in this object.
- * @param {DataReader} reader the reader to use.
- */
- readLocalPart: function(reader) {
- var compression, localExtraFieldsLength;
-
- // we already know everything from the central dir !
- // If the central dir data are false, we are doomed.
- // On the bright side, the local part is scary : zip64, data descriptors, both, etc.
- // The less data we get here, the more reliable this should be.
- // Let's skip the whole header and dash to the data !
- reader.skip(22);
- // in some zip created on windows, the filename stored in the central dir contains \ instead of /.
- // Strangely, the filename here is OK.
- // I would love to treat these zip files as corrupted (see http://www.info-zip.org/FAQ.html#backslashes
- // or APPNOTE#4.4.17.1, "All slashes MUST be forward slashes '/'") but there are a lot of bad zip generators...
- // Search "unzip mismatching "local" filename continuing with "central" filename version" on
- // the internet.
- //
- // I think I see the logic here : the central directory is used to display
- // content and the local directory is used to extract the files. Mixing / and \
- // may be used to display \ to windows users and use / when extracting the files.
- // Unfortunately, this lead also to some issues : http://seclists.org/fulldisclosure/2009/Sep/394
- this.fileNameLength = reader.readInt(2);
- localExtraFieldsLength = reader.readInt(2); // can't be sure this will be the same as the central dir
- this.fileName = reader.readString(this.fileNameLength);
- reader.skip(localExtraFieldsLength);
-
- if (this.compressedSize == -1 || this.uncompressedSize == -1) {
- throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory " + "(compressedSize == -1 || uncompressedSize == -1)");
- }
-
- compression = utils.findCompression(this.compressionMethod);
- if (compression === null) { // no compression found
- throw new Error("Corrupted zip : compression " + utils.pretty(this.compressionMethod) + " unknown (inner file : " + this.fileName + ")");
- }
- this.decompressed = new CompressedObject();
- this.decompressed.compressedSize = this.compressedSize;
- this.decompressed.uncompressedSize = this.uncompressedSize;
- this.decompressed.crc32 = this.crc32;
- this.decompressed.compressionMethod = this.compressionMethod;
- this.decompressed.getCompressedContent = this.prepareCompressedContent(reader, reader.index, this.compressedSize, compression);
- this.decompressed.getContent = this.prepareContent(reader, reader.index, this.compressedSize, compression, this.uncompressedSize);
-
- // we need to compute the crc32...
- if (this.loadOptions.checkCRC32) {
- this.decompressed = utils.transformTo("string", this.decompressed.getContent());
- if (jszipProto.crc32(this.decompressed) !== this.crc32) {
- throw new Error("Corrupted zip : CRC32 mismatch");
- }
- }
- },
-
- /**
- * Read the central part of a zip file and add the info in this object.
- * @param {DataReader} reader the reader to use.
- */
- readCentralPart: function(reader) {
- this.versionMadeBy = reader.readString(2);
- this.versionNeeded = reader.readInt(2);
- this.bitFlag = reader.readInt(2);
- this.compressionMethod = reader.readString(2);
- this.date = reader.readDate();
- this.crc32 = reader.readInt(4);
- this.compressedSize = reader.readInt(4);
- this.uncompressedSize = reader.readInt(4);
- this.fileNameLength = reader.readInt(2);
- this.extraFieldsLength = reader.readInt(2);
- this.fileCommentLength = reader.readInt(2);
- this.diskNumberStart = reader.readInt(2);
- this.internalFileAttributes = reader.readInt(2);
- this.externalFileAttributes = reader.readInt(4);
- this.localHeaderOffset = reader.readInt(4);
-
- if (this.isEncrypted()) {
- throw new Error("Encrypted zip are not supported");
- }
-
- this.fileName = reader.readString(this.fileNameLength);
- this.readExtraFields(reader);
- this.parseZIP64ExtraField(reader);
- this.fileComment = reader.readString(this.fileCommentLength);
-
- // warning, this is true only for zip with madeBy == DOS (plateform dependent feature)
- this.dir = this.externalFileAttributes & 0x00000010 ? true : false;
- },
- /**
- * Parse the ZIP64 extra field and merge the info in the current ZipEntry.
- * @param {DataReader} reader the reader to use.
- */
- parseZIP64ExtraField: function(reader) {
-
- if (!this.extraFields[0x0001]) {
- return;
- }
-
- // should be something, preparing the extra reader
- var extraReader = new StringReader(this.extraFields[0x0001].value);
-
- // I really hope that these 64bits integer can fit in 32 bits integer, because js
- // won't let us have more.
- if (this.uncompressedSize === utils.MAX_VALUE_32BITS) {
- this.uncompressedSize = extraReader.readInt(8);
- }
- if (this.compressedSize === utils.MAX_VALUE_32BITS) {
- this.compressedSize = extraReader.readInt(8);
- }
- if (this.localHeaderOffset === utils.MAX_VALUE_32BITS) {
- this.localHeaderOffset = extraReader.readInt(8);
- }
- if (this.diskNumberStart === utils.MAX_VALUE_32BITS) {
- this.diskNumberStart = extraReader.readInt(4);
- }
- },
- /**
- * Read the central part of a zip file and add the info in this object.
- * @param {DataReader} reader the reader to use.
- */
- readExtraFields: function(reader) {
- var start = reader.index,
- extraFieldId,
- extraFieldLength,
- extraFieldValue;
-
- this.extraFields = this.extraFields || {};
-
- while (reader.index < start + this.extraFieldsLength) {
- extraFieldId = reader.readInt(2);
- extraFieldLength = reader.readInt(2);
- extraFieldValue = reader.readString(extraFieldLength);
-
- this.extraFields[extraFieldId] = {
- id: extraFieldId,
- length: extraFieldLength,
- value: extraFieldValue
- };
- }
- },
- /**
- * Apply an UTF8 transformation if needed.
- */
- handleUTF8: function() {
- if (this.useUTF8()) {
- this.fileName = jszipProto.utf8decode(this.fileName);
- this.fileComment = jszipProto.utf8decode(this.fileComment);
- } else {
- var upath = this.findExtraFieldUnicodePath();
- if (upath !== null) {
- this.fileName = upath;
- }
- var ucomment = this.findExtraFieldUnicodeComment();
- if (ucomment !== null) {
- this.fileComment = ucomment;
- }
- }
- },
-
- /**
- * Find the unicode path declared in the extra field, if any.
- * @return {String} the unicode path, null otherwise.
- */
- findExtraFieldUnicodePath: function() {
- var upathField = this.extraFields[0x7075];
- if (upathField) {
- var extraReader = new StringReader(upathField.value);
-
- // wrong version
- if (extraReader.readInt(1) !== 1) {
- return null;
- }
-
- // the crc of the filename changed, this field is out of date.
- if (jszipProto.crc32(this.fileName) !== extraReader.readInt(4)) {
- return null;
- }
-
- return jszipProto.utf8decode(extraReader.readString(upathField.length - 5));
- }
- return null;
- },
-
- /**
- * Find the unicode comment declared in the extra field, if any.
- * @return {String} the unicode comment, null otherwise.
- */
- findExtraFieldUnicodeComment: function() {
- var ucommentField = this.extraFields[0x6375];
- if (ucommentField) {
- var extraReader = new StringReader(ucommentField.value);
-
- // wrong version
- if (extraReader.readInt(1) !== 1) {
- return null;
- }
-
- // the crc of the comment changed, this field is out of date.
- if (jszipProto.crc32(this.fileComment) !== extraReader.readInt(4)) {
- return null;
- }
-
- return jszipProto.utf8decode(extraReader.readString(ucommentField.length - 5));
- }
- return null;
- }
- };
- module.exports = ZipEntry;
-
- },{"./compressedObject":2,"./object":13,"./stringReader":15,"./utils":21}],24:[function(_dereq_,module,exports){
- // Top level file is just a mixin of submodules & constants
- 'use strict';
-
- var assign = _dereq_('./lib/utils/common').assign;
-
- var deflate = _dereq_('./lib/deflate');
- var inflate = _dereq_('./lib/inflate');
- var constants = _dereq_('./lib/zlib/constants');
-
- var pako = {};
-
- assign(pako, deflate, inflate, constants);
-
- module.exports = pako;
- },{"./lib/deflate":25,"./lib/inflate":26,"./lib/utils/common":27,"./lib/zlib/constants":30}],25:[function(_dereq_,module,exports){
- 'use strict';
-
-
- var zlib_deflate = _dereq_('./zlib/deflate.js');
- var utils = _dereq_('./utils/common');
- var strings = _dereq_('./utils/strings');
- var msg = _dereq_('./zlib/messages');
- var zstream = _dereq_('./zlib/zstream');
-
-
- /* Public constants ==========================================================*/
- /* ===========================================================================*/
-
- var Z_NO_FLUSH = 0;
- var Z_FINISH = 4;
-
- var Z_OK = 0;
- var Z_STREAM_END = 1;
-
- var Z_DEFAULT_COMPRESSION = -1;
-
- var Z_DEFAULT_STRATEGY = 0;
-
- var Z_DEFLATED = 8;
-
- /* ===========================================================================*/
-
-
- /**
- * class Deflate
- *
- * Generic JS-style wrapper for zlib calls. If you don't need
- * streaming behaviour - use more simple functions: [[deflate]],
- * [[deflateRaw]] and [[gzip]].
- **/
-
- /* internal
- * Deflate.chunks -> Array
- *
- * Chunks of output data, if [[Deflate#onData]] not overriden.
- **/
-
- /**
- * Deflate.result -> Uint8Array|Array
- *
- * Compressed result, generated by default [[Deflate#onData]]
- * and [[Deflate#onEnd]] handlers. Filled after you push last chunk
- * (call [[Deflate#push]] with `Z_FINISH` / `true` param).
- **/
-
- /**
- * Deflate.err -> Number
- *
- * Error code after deflate finished. 0 (Z_OK) on success.
- * You will not need it in real life, because deflate errors
- * are possible only on wrong options or bad `onData` / `onEnd`
- * custom handlers.
- **/
-
- /**
- * Deflate.msg -> String
- *
- * Error message, if [[Deflate.err]] != 0
- **/
-
-
- /**
- * new Deflate(options)
- * - options (Object): zlib deflate options.
- *
- * Creates new deflator instance with specified params. Throws exception
- * on bad params. Supported options:
- *
- * - `level`
- * - `windowBits`
- * - `memLevel`
- * - `strategy`
- *
- * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
- * for more information on these.
- *
- * Additional options, for internal needs:
- *
- * - `chunkSize` - size of generated data chunks (16K by default)
- * - `raw` (Boolean) - do raw deflate
- * - `gzip` (Boolean) - create gzip wrapper
- * - `to` (String) - if equal to 'string', then result will be "binary string"
- * (each char code [0..255])
- * - `header` (Object) - custom header for gzip
- * - `text` (Boolean) - true if compressed data believed to be text
- * - `time` (Number) - modification time, unix timestamp
- * - `os` (Number) - operation system code
- * - `extra` (Array) - array of bytes with extra data (max 65536)
- * - `name` (String) - file name (binary string)
- * - `comment` (String) - comment (binary string)
- * - `hcrc` (Boolean) - true if header crc should be added
- *
- * ##### Example:
- *
- * ```javascript
- * var pako = require('pako')
- * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
- * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
- *
- * var deflate = new pako.Deflate({ level: 3});
- *
- * deflate.push(chunk1, false);
- * deflate.push(chunk2, true); // true -> last chunk
- *
- * if (deflate.err) { throw new Error(deflate.err); }
- *
- * console.log(deflate.result);
- * ```
- **/
- var Deflate = function(options) {
-
- this.options = utils.assign({
- level: Z_DEFAULT_COMPRESSION,
- method: Z_DEFLATED,
- chunkSize: 16384,
- windowBits: 15,
- memLevel: 8,
- strategy: Z_DEFAULT_STRATEGY,
- to: ''
- }, options || {});
-
- var opt = this.options;
-
- if (opt.raw && (opt.windowBits > 0)) {
- opt.windowBits = -opt.windowBits;
- }
-
- else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {
- opt.windowBits += 16;
- }
-
- this.err = 0; // error code, if happens (0 = Z_OK)
- this.msg = ''; // error message
- this.ended = false; // used to avoid multiple onEnd() calls
- this.chunks = []; // chunks of compressed data
-
- this.strm = new zstream();
- this.strm.avail_out = 0;
-
- var status = zlib_deflate.deflateInit2(
- this.strm,
- opt.level,
- opt.method,
- opt.windowBits,
- opt.memLevel,
- opt.strategy
- );
-
- if (status !== Z_OK) {
- throw new Error(msg[status]);
- }
-
- if (opt.header) {
- zlib_deflate.deflateSetHeader(this.strm, opt.header);
- }
- };
-
- /**
- * Deflate#push(data[, mode]) -> Boolean
- * - data (Uint8Array|Array|String): input data. Strings will be converted to
- * utf8 byte sequence.
- * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
- * See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH.
- *
- * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with
- * new compressed chunks. Returns `true` on success. The last data block must have
- * mode Z_FINISH (or `true`). That flush internal pending buffers and call
- * [[Deflate#onEnd]].
- *
- * On fail call [[Deflate#onEnd]] with error code and return false.
- *
- * We strongly recommend to use `Uint8Array` on input for best speed (output
- * array format is detected automatically). Also, don't skip last param and always
- * use the same type in your code (boolean or number). That will improve JS speed.
- *
- * For regular `Array`-s make sure all elements are [0..255].
- *
- * ##### Example
- *
- * ```javascript
- * push(chunk, false); // push one of data chunks
- * ...
- * push(chunk, true); // push last chunk
- * ```
- **/
- Deflate.prototype.push = function(data, mode) {
- var strm = this.strm;
- var chunkSize = this.options.chunkSize;
- var status, _mode;
-
- if (this.ended) { return false; }
-
- _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);
-
- // Convert data if needed
- if (typeof data === 'string') {
- // If we need to compress text, change encoding to utf8.
- strm.input = strings.string2buf(data);
- } else {
- strm.input = data;
- }
-
- strm.next_in = 0;
- strm.avail_in = strm.input.length;
-
- do {
- if (strm.avail_out === 0) {
- strm.output = new utils.Buf8(chunkSize);
- strm.next_out = 0;
- strm.avail_out = chunkSize;
- }
- status = zlib_deflate.deflate(strm, _mode); /* no bad return value */
-
- if (status !== Z_STREAM_END && status !== Z_OK) {
- this.onEnd(status);
- this.ended = true;
- return false;
- }
- if (strm.avail_out === 0 || (strm.avail_in === 0 && _mode === Z_FINISH)) {
- if (this.options.to === 'string') {
- this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));
- } else {
- this.onData(utils.shrinkBuf(strm.output, strm.next_out));
- }
- }
- } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);
-
- // Finalize on the last chunk.
- if (_mode === Z_FINISH) {
- status = zlib_deflate.deflateEnd(this.strm);
- this.onEnd(status);
- this.ended = true;
- return status === Z_OK;
- }
-
- return true;
- };
-
-
- /**
- * Deflate#onData(chunk) -> Void
- * - chunk (Uint8Array|Array|String): ouput data. Type of array depends
- * on js engine support. When string output requested, each chunk
- * will be string.
- *
- * By default, stores data blocks in `chunks[]` property and glue
- * those in `onEnd`. Override this handler, if you need another behaviour.
- **/
- Deflate.prototype.onData = function(chunk) {
- this.chunks.push(chunk);
- };
-
-
- /**
- * Deflate#onEnd(status) -> Void
- * - status (Number): deflate status. 0 (Z_OK) on success,
- * other if not.
- *
- * Called once after you tell deflate that input stream complete
- * or error happenned. By default - join collected chunks,
- * free memory and fill `results` / `err` properties.
- **/
- Deflate.prototype.onEnd = function(status) {
- // On success - join
- if (status === Z_OK) {
- if (this.options.to === 'string') {
- this.result = this.chunks.join('');
- } else {
- this.result = utils.flattenChunks(this.chunks);
- }
- }
- this.chunks = [];
- this.err = status;
- this.msg = this.strm.msg;
- };
-
-
- /**
- * deflate(data[, options]) -> Uint8Array|Array|String
- * - data (Uint8Array|Array|String): input data to compress.
- * - options (Object): zlib deflate options.
- *
- * Compress `data` with deflate alrorythm and `options`.
- *
- * Supported options are:
- *
- * - level
- * - windowBits
- * - memLevel
- * - strategy
- *
- * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
- * for more information on these.
- *
- * Sugar (options):
- *
- * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
- * negative windowBits implicitly.
- * - `to` (String) - if equal to 'string', then result will be "binary string"
- * (each char code [0..255])
- *
- * ##### Example:
- *
- * ```javascript
- * var pako = require('pako')
- * , data = Uint8Array([1,2,3,4,5,6,7,8,9]);
- *
- * console.log(pako.deflate(data));
- * ```
- **/
- function deflate(input, options) {
- var deflator = new Deflate(options);
-
- deflator.push(input, true);
-
- // That will never happens, if you don't cheat with options :)
- if (deflator.err) { throw deflator.msg; }
-
- return deflator.result;
- }
-
-
- /**
- * deflateRaw(data[, options]) -> Uint8Array|Array|String
- * - data (Uint8Array|Array|String): input data to compress.
- * - options (Object): zlib deflate options.
- *
- * The same as [[deflate]], but creates raw data, without wrapper
- * (header and adler32 crc).
- **/
- function deflateRaw(input, options) {
- options = options || {};
- options.raw = true;
- return deflate(input, options);
- }
-
-
- /**
- * gzip(data[, options]) -> Uint8Array|Array|String
- * - data (Uint8Array|Array|String): input data to compress.
- * - options (Object): zlib deflate options.
- *
- * The same as [[deflate]], but create gzip wrapper instead of
- * deflate one.
- **/
- function gzip(input, options) {
- options = options || {};
- options.gzip = true;
- return deflate(input, options);
- }
-
-
- exports.Deflate = Deflate;
- exports.deflate = deflate;
- exports.deflateRaw = deflateRaw;
- exports.gzip = gzip;
- },{"./utils/common":27,"./utils/strings":28,"./zlib/deflate.js":32,"./zlib/messages":37,"./zlib/zstream":39}],26:[function(_dereq_,module,exports){
- 'use strict';
-
-
- var zlib_inflate = _dereq_('./zlib/inflate.js');
- var utils = _dereq_('./utils/common');
- var strings = _dereq_('./utils/strings');
- var c = _dereq_('./zlib/constants');
- var msg = _dereq_('./zlib/messages');
- var zstream = _dereq_('./zlib/zstream');
- var gzheader = _dereq_('./zlib/gzheader');
-
-
- /**
- * class Inflate
- *
- * Generic JS-style wrapper for zlib calls. If you don't need
- * streaming behaviour - use more simple functions: [[inflate]]
- * and [[inflateRaw]].
- **/
-
- /* internal
- * inflate.chunks -> Array
- *
- * Chunks of output data, if [[Inflate#onData]] not overriden.
- **/
-
- /**
- * Inflate.result -> Uint8Array|Array|String
- *
- * Uncompressed result, generated by default [[Inflate#onData]]
- * and [[Inflate#onEnd]] handlers. Filled after you push last chunk
- * (call [[Inflate#push]] with `Z_FINISH` / `true` param).
- **/
-
- /**
- * Inflate.err -> Number
- *
- * Error code after inflate finished. 0 (Z_OK) on success.
- * Should be checked if broken data possible.
- **/
-
- /**
- * Inflate.msg -> String
- *
- * Error message, if [[Inflate.err]] != 0
- **/
-
-
- /**
- * new Inflate(options)
- * - options (Object): zlib inflate options.
- *
- * Creates new inflator instance with specified params. Throws exception
- * on bad params. Supported options:
- *
- * - `windowBits`
- *
- * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
- * for more information on these.
- *
- * Additional options, for internal needs:
- *
- * - `chunkSize` - size of generated data chunks (16K by default)
- * - `raw` (Boolean) - do raw inflate
- * - `to` (String) - if equal to 'string', then result will be converted
- * from utf8 to utf16 (javascript) string. When string output requested,
- * chunk length can differ from `chunkSize`, depending on content.
- *
- * By default, when no options set, autodetect deflate/gzip data format via
- * wrapper header.
- *
- * ##### Example:
- *
- * ```javascript
- * var pako = require('pako')
- * , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
- * , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
- *
- * var inflate = new pako.Inflate({ level: 3});
- *
- * inflate.push(chunk1, false);
- * inflate.push(chunk2, true); // true -> last chunk
- *
- * if (inflate.err) { throw new Error(inflate.err); }
- *
- * console.log(inflate.result);
- * ```
- **/
- var Inflate = function(options) {
-
- this.options = utils.assign({
- chunkSize: 16384,
- windowBits: 0,
- to: ''
- }, options || {});
-
- var opt = this.options;
-
- // Force window size for `raw` data, if not set directly,
- // because we have no header for autodetect.
- if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {
- opt.windowBits = -opt.windowBits;
- if (opt.windowBits === 0) { opt.windowBits = -15; }
- }
-
- // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate
- if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&
- !(options && options.windowBits)) {
- opt.windowBits += 32;
- }
-
- // Gzip header has no info about windows size, we can do autodetect only
- // for deflate. So, if window size not set, force it to max when gzip possible
- if ((opt.windowBits > 15) && (opt.windowBits < 48)) {
- // bit 3 (16) -> gzipped data
- // bit 4 (32) -> autodetect gzip/deflate
- if ((opt.windowBits & 15) === 0) {
- opt.windowBits |= 15;
- }
- }
-
- this.err = 0; // error code, if happens (0 = Z_OK)
- this.msg = ''; // error message
- this.ended = false; // used to avoid multiple onEnd() calls
- this.chunks = []; // chunks of compressed data
-
- this.strm = new zstream();
- this.strm.avail_out = 0;
-
- var status = zlib_inflate.inflateInit2(
- this.strm,
- opt.windowBits
- );
-
- if (status !== c.Z_OK) {
- throw new Error(msg[status]);
- }
-
- this.header = new gzheader();
-
- zlib_inflate.inflateGetHeader(this.strm, this.header);
- };
-
- /**
- * Inflate#push(data[, mode]) -> Boolean
- * - data (Uint8Array|Array|String): input data
- * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
- * See constants. Skipped or `false` means Z_NO_FLUSH, `true` meansh Z_FINISH.
- *
- * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with
- * new output chunks. Returns `true` on success. The last data block must have
- * mode Z_FINISH (or `true`). That flush internal pending buffers and call
- * [[Inflate#onEnd]].
- *
- * On fail call [[Inflate#onEnd]] with error code and return false.
- *
- * We strongly recommend to use `Uint8Array` on input for best speed (output
- * format is detected automatically). Also, don't skip last param and always
- * use the same type in your code (boolean or number). That will improve JS speed.
- *
- * For regular `Array`-s make sure all elements are [0..255].
- *
- * ##### Example
- *
- * ```javascript
- * push(chunk, false); // push one of data chunks
- * ...
- * push(chunk, true); // push last chunk
- * ```
- **/
- Inflate.prototype.push = function(data, mode) {
- var strm = this.strm;
- var chunkSize = this.options.chunkSize;
- var status, _mode;
- var next_out_utf8, tail, utf8str;
-
- if (this.ended) { return false; }
- _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);
-
- // Convert data if needed
- if (typeof data === 'string') {
- // Only binary strings can be decompressed on practice
- strm.input = strings.binstring2buf(data);
- } else {
- strm.input = data;
- }
-
- strm.next_in = 0;
- strm.avail_in = strm.input.length;
-
- do {
- if (strm.avail_out === 0) {
- strm.output = new utils.Buf8(chunkSize);
- strm.next_out = 0;
- strm.avail_out = chunkSize;
- }
-
- status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); /* no bad return value */
-
- if (status !== c.Z_STREAM_END && status !== c.Z_OK) {
- this.onEnd(status);
- this.ended = true;
- return false;
- }
-
- if (strm.next_out) {
- if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && _mode === c.Z_FINISH)) {
-
- if (this.options.to === 'string') {
-
- next_out_utf8 = strings.utf8border(strm.output, strm.next_out);
-
- tail = strm.next_out - next_out_utf8;
- utf8str = strings.buf2string(strm.output, next_out_utf8);
-
- // move tail
- strm.next_out = tail;
- strm.avail_out = chunkSize - tail;
- if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }
-
- this.onData(utf8str);
-
- } else {
- this.onData(utils.shrinkBuf(strm.output, strm.next_out));
- }
- }
- }
- } while ((strm.avail_in > 0) && status !== c.Z_STREAM_END);
-
- if (status === c.Z_STREAM_END) {
- _mode = c.Z_FINISH;
- }
- // Finalize on the last chunk.
- if (_mode === c.Z_FINISH) {
- status = zlib_inflate.inflateEnd(this.strm);
- this.onEnd(status);
- this.ended = true;
- return status === c.Z_OK;
- }
-
- return true;
- };
-
-
- /**
- * Inflate#onData(chunk) -> Void
- * - chunk (Uint8Array|Array|String): ouput data. Type of array depends
- * on js engine support. When string output requested, each chunk
- * will be string.
- *
- * By default, stores data blocks in `chunks[]` property and glue
- * those in `onEnd`. Override this handler, if you need another behaviour.
- **/
- Inflate.prototype.onData = function(chunk) {
- this.chunks.push(chunk);
- };
-
-
- /**
- * Inflate#onEnd(status) -> Void
- * - status (Number): inflate status. 0 (Z_OK) on success,
- * other if not.
- *
- * Called once after you tell inflate that input stream complete
- * or error happenned. By default - join collected chunks,
- * free memory and fill `results` / `err` properties.
- **/
- Inflate.prototype.onEnd = function(status) {
- // On success - join
- if (status === c.Z_OK) {
- if (this.options.to === 'string') {
- // Glue & convert here, until we teach pako to send
- // utf8 alligned strings to onData
- this.result = this.chunks.join('');
- } else {
- this.result = utils.flattenChunks(this.chunks);
- }
- }
- this.chunks = [];
- this.err = status;
- this.msg = this.strm.msg;
- };
-
-
- /**
- * inflate(data[, options]) -> Uint8Array|Array|String
- * - data (Uint8Array|Array|String): input data to decompress.
- * - options (Object): zlib inflate options.
- *
- * Decompress `data` with inflate/ungzip and `options`. Autodetect
- * format via wrapper header by default. That's why we don't provide
- * separate `ungzip` method.
- *
- * Supported options are:
- *
- * - windowBits
- *
- * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
- * for more information.
- *
- * Sugar (options):
- *
- * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
- * negative windowBits implicitly.
- * - `to` (String) - if equal to 'string', then result will be converted
- * from utf8 to utf16 (javascript) string. When string output requested,
- * chunk length can differ from `chunkSize`, depending on content.
- *
- *
- * ##### Example:
- *
- * ```javascript
- * var pako = require('pako')
- * , input = pako.deflate([1,2,3,4,5,6,7,8,9])
- * , output;
- *
- * try {
- * output = pako.inflate(input);
- * } catch (err)
- * console.log(err);
- * }
- * ```
- **/
- function inflate(input, options) {
- var inflator = new Inflate(options);
-
- inflator.push(input, true);
-
- // That will never happens, if you don't cheat with options :)
- if (inflator.err) { throw inflator.msg; }
-
- return inflator.result;
- }
-
-
- /**
- * inflateRaw(data[, options]) -> Uint8Array|Array|String
- * - data (Uint8Array|Array|String): input data to decompress.
- * - options (Object): zlib inflate options.
- *
- * The same as [[inflate]], but creates raw data, without wrapper
- * (header and adler32 crc).
- **/
- function inflateRaw(input, options) {
- options = options || {};
- options.raw = true;
- return inflate(input, options);
- }
-
-
- /**
- * ungzip(data[, options]) -> Uint8Array|Array|String
- * - data (Uint8Array|Array|String): input data to decompress.
- * - options (Object): zlib inflate options.
- *
- * Just shortcut to [[inflate]], because it autodetects format
- * by header.content. Done for convenience.
- **/
-
-
- exports.Inflate = Inflate;
- exports.inflate = inflate;
- exports.inflateRaw = inflateRaw;
- exports.ungzip = inflate;
-
- },{"./utils/common":27,"./utils/strings":28,"./zlib/constants":30,"./zlib/gzheader":33,"./zlib/inflate.js":35,"./zlib/messages":37,"./zlib/zstream":39}],27:[function(_dereq_,module,exports){
- 'use strict';
-
-
- var TYPED_OK = (typeof Uint8Array !== 'undefined') &&
- (typeof Uint16Array !== 'undefined') &&
- (typeof Int32Array !== 'undefined');
-
-
- exports.assign = function (obj /*from1, from2, from3, ...*/) {
- var sources = Array.prototype.slice.call(arguments, 1);
- while (sources.length) {
- var source = sources.shift();
- if (!source) { continue; }
-
- if (typeof(source) !== 'object') {
- throw new TypeError(source + 'must be non-object');
- }
-
- for (var p in source) {
- if (source.hasOwnProperty(p)) {
- obj[p] = source[p];
- }
- }
- }
-
- return obj;
- };
-
-
- // reduce buffer size, avoiding mem copy
- exports.shrinkBuf = function (buf, size) {
- if (buf.length === size) { return buf; }
- if (buf.subarray) { return buf.subarray(0, size); }
- buf.length = size;
- return buf;
- };
-
-
- var fnTyped = {
- arraySet: function (dest, src, src_offs, len, dest_offs) {
- if (src.subarray && dest.subarray) {
- dest.set(src.subarray(src_offs, src_offs+len), dest_offs);
- return;
- }
- // Fallback to ordinary array
- for(var i=0; i<len; i++) {
- dest[dest_offs + i] = src[src_offs + i];
- }
- },
- // Join array of chunks to single array.
- flattenChunks: function(chunks) {
- var i, l, len, pos, chunk, result;
-
- // calculate data length
- len = 0;
- for (i=0, l=chunks.length; i<l; i++) {
- len += chunks[i].length;
- }
-
- // join chunks
- result = new Uint8Array(len);
- pos = 0;
- for (i=0, l=chunks.length; i<l; i++) {
- chunk = chunks[i];
- result.set(chunk, pos);
- pos += chunk.length;
- }
-
- return result;
- }
- };
-
- var fnUntyped = {
- arraySet: function (dest, src, src_offs, len, dest_offs) {
- for(var i=0; i<len; i++) {
- dest[dest_offs + i] = src[src_offs + i];
- }
- },
- // Join array of chunks to single array.
- flattenChunks: function(chunks) {
- return [].concat.apply([], chunks);
- }
- };
-
-
- // Enable/Disable typed arrays use, for testing
- //
- exports.setTyped = function (on) {
- if (on) {
- exports.Buf8 = Uint8Array;
- exports.Buf16 = Uint16Array;
- exports.Buf32 = Int32Array;
- exports.assign(exports, fnTyped);
- } else {
- exports.Buf8 = Array;
- exports.Buf16 = Array;
- exports.Buf32 = Array;
- exports.assign(exports, fnUntyped);
- }
- };
-
- exports.setTyped(TYPED_OK);
- },{}],28:[function(_dereq_,module,exports){
- // String encode/decode helpers
- 'use strict';
-
-
- var utils = _dereq_('./common');
-
-
- // Quick check if we can use fast array to bin string conversion
- //
- // - apply(Array) can fail on Android 2.2
- // - apply(Uint8Array) can fail on iOS 5.1 Safary
- //
- var STR_APPLY_OK = true;
- var STR_APPLY_UIA_OK = true;
-
- try { String.fromCharCode.apply(null, [0]); } catch(__) { STR_APPLY_OK = false; }
- try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch(__) { STR_APPLY_UIA_OK = false; }
-
-
- // Table with utf8 lengths (calculated by first byte of sequence)
- // Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
- // because max possible codepoint is 0x10ffff
- var _utf8len = new utils.Buf8(256);
- for (var i=0; i<256; i++) {
- _utf8len[i] = (i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1);
- }
- _utf8len[254]=_utf8len[254]=1; // Invalid sequence start
-
-
- // convert string to array (typed, when possible)
- exports.string2buf = function (str) {
- var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
-
- // count binary size
- for (m_pos = 0; m_pos < str_len; m_pos++) {
- c = str.charCodeAt(m_pos);
- if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {
- c2 = str.charCodeAt(m_pos+1);
- if ((c2 & 0xfc00) === 0xdc00) {
- c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
- m_pos++;
- }
- }
- buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;
- }
-
- // allocate buffer
- buf = new utils.Buf8(buf_len);
-
- // convert
- for (i=0, m_pos = 0; i < buf_len; m_pos++) {
- c = str.charCodeAt(m_pos);
- if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {
- c2 = str.charCodeAt(m_pos+1);
- if ((c2 & 0xfc00) === 0xdc00) {
- c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
- m_pos++;
- }
- }
- if (c < 0x80) {
- /* one byte */
- buf[i++] = c;
- } else if (c < 0x800) {
- /* two bytes */
- buf[i++] = 0xC0 | (c >>> 6);
- buf[i++] = 0x80 | (c & 0x3f);
- } else if (c < 0x10000) {
- /* three bytes */
- buf[i++] = 0xE0 | (c >>> 12);
- buf[i++] = 0x80 | (c >>> 6 & 0x3f);
- buf[i++] = 0x80 | (c & 0x3f);
- } else {
- /* four bytes */
- buf[i++] = 0xf0 | (c >>> 18);
- buf[i++] = 0x80 | (c >>> 12 & 0x3f);
- buf[i++] = 0x80 | (c >>> 6 & 0x3f);
- buf[i++] = 0x80 | (c & 0x3f);
- }
- }
-
- return buf;
- };
-
- // Helper (used in 2 places)
- function buf2binstring(buf, len) {
- // use fallback for big arrays to avoid stack overflow
- if (len < 65537) {
- if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {
- return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));
- }
- }
-
- var result = '';
- for(var i=0; i < len; i++) {
- result += String.fromCharCode(buf[i]);
- }
- return result;
- }
-
-
- // Convert byte array to binary string
- exports.buf2binstring = function(buf) {
- return buf2binstring(buf, buf.length);
- };
-
-
- // Convert binary string (typed, when possible)
- exports.binstring2buf = function(str) {
- var buf = new utils.Buf8(str.length);
- for(var i=0, len=buf.length; i < len; i++) {
- buf[i] = str.charCodeAt(i);
- }
- return buf;
- };
-
-
- // convert array to string
- exports.buf2string = function (buf, max) {
- var i, out, c, c_len;
- var len = max || buf.length;
-
- // Reserve max possible length (2 words per char)
- // NB: by unknown reasons, Array is significantly faster for
- // String.fromCharCode.apply than Uint16Array.
- var utf16buf = new Array(len*2);
-
- for (out=0, i=0; i<len;) {
- c = buf[i++];
- // quick process ascii
- if (c < 0x80) { utf16buf[out++] = c; continue; }
-
- c_len = _utf8len[c];
- // skip 5 & 6 byte codes
- if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len-1; continue; }
-
- // apply mask on first byte
- c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;
- // join the rest
- while (c_len > 1 && i < len) {
- c = (c << 6) | (buf[i++] & 0x3f);
- c_len--;
- }
-
- // terminated by end of string?
- if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }
-
- if (c < 0x10000) {
- utf16buf[out++] = c;
- } else {
- c -= 0x10000;
- utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);
- utf16buf[out++] = 0xdc00 | (c & 0x3ff);
- }
- }
-
- return buf2binstring(utf16buf, out);
- };
-
-
- // Calculate max possible position in utf8 buffer,
- // that will not break sequence. If that's not possible
- // - (very small limits) return max size as is.
- //
- // buf[] - utf8 bytes array
- // max - length limit (mandatory);
- exports.utf8border = function(buf, max) {
- var pos;
-
- max = max || buf.length;
- if (max > buf.length) { max = buf.length; }
-
- // go back from last position, until start of sequence found
- pos = max-1;
- while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }
-
- // Fuckup - very small and broken sequence,
- // return max, because we should return something anyway.
- if (pos < 0) { return max; }
-
- // If we came to start of buffer - that means vuffer is too small,
- // return max too.
- if (pos === 0) { return max; }
-
- return (pos + _utf8len[buf[pos]] > max) ? pos : max;
- };
-
- },{"./common":27}],29:[function(_dereq_,module,exports){
- 'use strict';
-
- // Note: adler32 takes 12% for level 0 and 2% for level 6.
- // It doesn't worth to make additional optimizationa as in original.
- // Small size is preferable.
-
- function adler32(adler, buf, len, pos) {
- var s1 = (adler & 0xffff) |0
- , s2 = ((adler >>> 16) & 0xffff) |0
- , n = 0;
-
- while (len !== 0) {
- // Set limit ~ twice less than 5552, to keep
- // s2 in 31-bits, because we force signed ints.
- // in other case %= will fail.
- n = len > 2000 ? 2000 : len;
- len -= n;
-
- do {
- s1 = (s1 + buf[pos++]) |0;
- s2 = (s2 + s1) |0;
- } while (--n);
-
- s1 %= 65521;
- s2 %= 65521;
- }
-
- return (s1 | (s2 << 16)) |0;
- }
-
-
- module.exports = adler32;
- },{}],30:[function(_dereq_,module,exports){
- module.exports = {
-
- /* Allowed flush values; see deflate() and inflate() below for details */
- Z_NO_FLUSH: 0,
- Z_PARTIAL_FLUSH: 1,
- Z_SYNC_FLUSH: 2,
- Z_FULL_FLUSH: 3,
- Z_FINISH: 4,
- Z_BLOCK: 5,
- Z_TREES: 6,
-
- /* Return codes for the compression/decompression functions. Negative values
- * are errors, positive values are used for special but normal events.
- */
- Z_OK: 0,
- Z_STREAM_END: 1,
- Z_NEED_DICT: 2,
- Z_ERRNO: -1,
- Z_STREAM_ERROR: -2,
- Z_DATA_ERROR: -3,
- //Z_MEM_ERROR: -4,
- Z_BUF_ERROR: -5,
- //Z_VERSION_ERROR: -6,
-
- /* compression levels */
- Z_NO_COMPRESSION: 0,
- Z_BEST_SPEED: 1,
- Z_BEST_COMPRESSION: 9,
- Z_DEFAULT_COMPRESSION: -1,
-
-
- Z_FILTERED: 1,
- Z_HUFFMAN_ONLY: 2,
- Z_RLE: 3,
- Z_FIXED: 4,
- Z_DEFAULT_STRATEGY: 0,
-
- /* Possible values of the data_type field (though see inflate()) */
- Z_BINARY: 0,
- Z_TEXT: 1,
- //Z_ASCII: 1, // = Z_TEXT (deprecated)
- Z_UNKNOWN: 2,
-
- /* The deflate compression method */
- Z_DEFLATED: 8
- //Z_NULL: null // Use -1 or null inline, depending on var type
- };
- },{}],31:[function(_dereq_,module,exports){
- 'use strict';
-
- // Note: we can't get significant speed boost here.
- // So write code to minimize size - no pregenerated tables
- // and array tools dependencies.
-
-
- // Use ordinary array, since untyped makes no boost here
- function makeTable() {
- var c, table = [];
-
- for(var n =0; n < 256; n++){
- c = n;
- for(var k =0; k < 8; k++){
- c = ((c&1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
- }
- table[n] = c;
- }
-
- return table;
- }
-
- // Create table on load. Just 255 signed longs. Not a problem.
- var crcTable = makeTable();
-
-
- function crc32(crc, buf, len, pos) {
- var t = crcTable
- , end = pos + len;
-
- crc = crc ^ (-1);
-
- for (var i = pos; i < end; i++ ) {
- crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
- }
-
- return (crc ^ (-1)); // >>> 0;
- }
-
-
- module.exports = crc32;
- },{}],32:[function(_dereq_,module,exports){
- 'use strict';
-
- var utils = _dereq_('../utils/common');
- var trees = _dereq_('./trees');
- var adler32 = _dereq_('./adler32');
- var crc32 = _dereq_('./crc32');
- var msg = _dereq_('./messages');
-
- /* Public constants ==========================================================*/
- /* ===========================================================================*/
-
-
- /* Allowed flush values; see deflate() and inflate() below for details */
- var Z_NO_FLUSH = 0;
- var Z_PARTIAL_FLUSH = 1;
- //var Z_SYNC_FLUSH = 2;
- var Z_FULL_FLUSH = 3;
- var Z_FINISH = 4;
- var Z_BLOCK = 5;
- //var Z_TREES = 6;
-
-
- /* Return codes for the compression/decompression functions. Negative values
- * are errors, positive values are used for special but normal events.
- */
- var Z_OK = 0;
- var Z_STREAM_END = 1;
- //var Z_NEED_DICT = 2;
- //var Z_ERRNO = -1;
- var Z_STREAM_ERROR = -2;
- var Z_DATA_ERROR = -3;
- //var Z_MEM_ERROR = -4;
- var Z_BUF_ERROR = -5;
- //var Z_VERSION_ERROR = -6;
-
-
- /* compression levels */
- //var Z_NO_COMPRESSION = 0;
- //var Z_BEST_SPEED = 1;
- //var Z_BEST_COMPRESSION = 9;
- var Z_DEFAULT_COMPRESSION = -1;
-
-
- var Z_FILTERED = 1;
- var Z_HUFFMAN_ONLY = 2;
- var Z_RLE = 3;
- var Z_FIXED = 4;
- var Z_DEFAULT_STRATEGY = 0;
-
- /* Possible values of the data_type field (though see inflate()) */
- //var Z_BINARY = 0;
- //var Z_TEXT = 1;
- //var Z_ASCII = 1; // = Z_TEXT
- var Z_UNKNOWN = 2;
-
-
- /* The deflate compression method */
- var Z_DEFLATED = 8;
-
- /*============================================================================*/
-
-
- var MAX_MEM_LEVEL = 9;
- /* Maximum value for memLevel in deflateInit2 */
- var MAX_WBITS = 15;
- /* 32K LZ77 window */
- var DEF_MEM_LEVEL = 8;
-
-
- var LENGTH_CODES = 29;
- /* number of length codes, not counting the special END_BLOCK code */
- var LITERALS = 256;
- /* number of literal bytes 0..255 */
- var L_CODES = LITERALS + 1 + LENGTH_CODES;
- /* number of Literal or Length codes, including the END_BLOCK code */
- var D_CODES = 30;
- /* number of distance codes */
- var BL_CODES = 19;
- /* number of codes used to transfer the bit lengths */
- var HEAP_SIZE = 2*L_CODES + 1;
- /* maximum heap size */
- var MAX_BITS = 15;
- /* All codes must not exceed MAX_BITS bits */
-
- var MIN_MATCH = 3;
- var MAX_MATCH = 258;
- var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);
-
- var PRESET_DICT = 0x20;
-
- var INIT_STATE = 42;
- var EXTRA_STATE = 69;
- var NAME_STATE = 73;
- var COMMENT_STATE = 91;
- var HCRC_STATE = 103;
- var BUSY_STATE = 113;
- var FINISH_STATE = 666;
-
- var BS_NEED_MORE = 1; /* block not completed, need more input or more output */
- var BS_BLOCK_DONE = 2; /* block flush performed */
- var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */
- var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */
-
- var OS_CODE = 0x03; // Unix :) . Don't detect, use this default.
-
- function err(strm, errorCode) {
- strm.msg = msg[errorCode];
- return errorCode;
- }
-
- function rank(f) {
- return ((f) << 1) - ((f) > 4 ? 9 : 0);
- }
-
- function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }
-
-
- /* =========================================================================
- * Flush as much pending output as possible. All deflate() output goes
- * through this function so some applications may wish to modify it
- * to avoid allocating a large strm->output buffer and copying into it.
- * (See also read_buf()).
- */
- function flush_pending(strm) {
- var s = strm.state;
-
- //_tr_flush_bits(s);
- var len = s.pending;
- if (len > strm.avail_out) {
- len = strm.avail_out;
- }
- if (len === 0) { return; }
-
- utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);
- strm.next_out += len;
- s.pending_out += len;
- strm.total_out += len;
- strm.avail_out -= len;
- s.pending -= len;
- if (s.pending === 0) {
- s.pending_out = 0;
- }
- }
-
-
- function flush_block_only (s, last) {
- trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);
- s.block_start = s.strstart;
- flush_pending(s.strm);
- }
-
-
- function put_byte(s, b) {
- s.pending_buf[s.pending++] = b;
- }
-
-
- /* =========================================================================
- * Put a short in the pending buffer. The 16-bit value is put in MSB order.
- * IN assertion: the stream state is correct and there is enough room in
- * pending_buf.
- */
- function putShortMSB(s, b) {
- // put_byte(s, (Byte)(b >> 8));
- // put_byte(s, (Byte)(b & 0xff));
- s.pending_buf[s.pending++] = (b >>> 8) & 0xff;
- s.pending_buf[s.pending++] = b & 0xff;
- }
-
-
- /* ===========================================================================
- * Read a new buffer from the current input stream, update the adler32
- * and total number of bytes read. All deflate() input goes through
- * this function so some applications may wish to modify it to avoid
- * allocating a large strm->input buffer and copying from it.
- * (See also flush_pending()).
- */
- function read_buf(strm, buf, start, size) {
- var len = strm.avail_in;
-
- if (len > size) { len = size; }
- if (len === 0) { return 0; }
-
- strm.avail_in -= len;
-
- utils.arraySet(buf, strm.input, strm.next_in, len, start);
- if (strm.state.wrap === 1) {
- strm.adler = adler32(strm.adler, buf, len, start);
- }
-
- else if (strm.state.wrap === 2) {
- strm.adler = crc32(strm.adler, buf, len, start);
- }
-
- strm.next_in += len;
- strm.total_in += len;
-
- return len;
- }
-
-
- /* ===========================================================================
- * Set match_start to the longest match starting at the given string and
- * return its length. Matches shorter or equal to prev_length are discarded,
- * in which case the result is equal to prev_length and match_start is
- * garbage.
- * IN assertions: cur_match is the head of the hash chain for the current
- * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
- * OUT assertion: the match length is not greater than s->lookahead.
- */
- function longest_match(s, cur_match) {
- var chain_length = s.max_chain_length; /* max hash chain length */
- var scan = s.strstart; /* current string */
- var match; /* matched string */
- var len; /* length of current match */
- var best_len = s.prev_length; /* best match length so far */
- var nice_match = s.nice_match; /* stop if match long enough */
- var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?
- s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;
-
- var _win = s.window; // shortcut
-
- var wmask = s.w_mask;
- var prev = s.prev;
-
- /* Stop when cur_match becomes <= limit. To simplify the code,
- * we prevent matches with the string of window index 0.
- */
-
- var strend = s.strstart + MAX_MATCH;
- var scan_end1 = _win[scan + best_len - 1];
- var scan_end = _win[scan + best_len];
-
- /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
- * It is easy to get rid of this optimization if necessary.
- */
- // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
-
- /* Do not waste too much time if we already have a good match: */
- if (s.prev_length >= s.good_match) {
- chain_length >>= 2;
- }
- /* Do not look for matches beyond the end of the input. This is necessary
- * to make deflate deterministic.
- */
- if (nice_match > s.lookahead) { nice_match = s.lookahead; }
-
- // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
-
- do {
- // Assert(cur_match < s->strstart, "no future");
- match = cur_match;
-
- /* Skip to next match if the match length cannot increase
- * or if the match length is less than 2. Note that the checks below
- * for insufficient lookahead only occur occasionally for performance
- * reasons. Therefore uninitialized memory will be accessed, and
- * conditional jumps will be made that depend on those values.
- * However the length of the match is limited to the lookahead, so
- * the output of deflate is not affected by the uninitialized values.
- */
-
- if (_win[match + best_len] !== scan_end ||
- _win[match + best_len - 1] !== scan_end1 ||
- _win[match] !== _win[scan] ||
- _win[++match] !== _win[scan + 1]) {
- continue;
- }
-
- /* The check at best_len-1 can be removed because it will be made
- * again later. (This heuristic is not always a win.)
- * It is not necessary to compare scan[2] and match[2] since they
- * are always equal when the other bytes match, given that
- * the hash keys are equal and that HASH_BITS >= 8.
- */
- scan += 2;
- match++;
- // Assert(*scan == *match, "match[2]?");
-
- /* We check for insufficient lookahead only every 8th comparison;
- * the 256th check will be made at strstart+258.
- */
- do {
- /*jshint noempty:false*/
- } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
- _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
- _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
- _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
- scan < strend);
-
- // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
-
- len = MAX_MATCH - (strend - scan);
- scan = strend - MAX_MATCH;
-
- if (len > best_len) {
- s.match_start = cur_match;
- best_len = len;
- if (len >= nice_match) {
- break;
- }
- scan_end1 = _win[scan + best_len - 1];
- scan_end = _win[scan + best_len];
- }
- } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);
-
- if (best_len <= s.lookahead) {
- return best_len;
- }
- return s.lookahead;
- }
-
-
- /* ===========================================================================
- * Fill the window when the lookahead becomes insufficient.
- * Updates strstart and lookahead.
- *
- * IN assertion: lookahead < MIN_LOOKAHEAD
- * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
- * At least one byte has been read, or avail_in == 0; reads are
- * performed for at least two bytes (required for the zip translate_eol
- * option -- not supported here).
- */
- function fill_window(s) {
- var _w_size = s.w_size;
- var p, n, m, more, str;
-
- //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
-
- do {
- more = s.window_size - s.lookahead - s.strstart;
-
- // JS ints have 32 bit, block below not needed
- /* Deal with !@#$% 64K limit: */
- //if (sizeof(int) <= 2) {
- // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
- // more = wsize;
- //
- // } else if (more == (unsigned)(-1)) {
- // /* Very unlikely, but possible on 16 bit machine if
- // * strstart == 0 && lookahead == 1 (input done a byte at time)
- // */
- // more--;
- // }
- //}
-
-
- /* If the window is almost full and there is insufficient lookahead,
- * move the upper half to the lower one to make room in the upper half.
- */
- if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {
-
- utils.arraySet(s.window, s.window, _w_size, _w_size, 0);
- s.match_start -= _w_size;
- s.strstart -= _w_size;
- /* we now have strstart >= MAX_DIST */
- s.block_start -= _w_size;
-
- /* Slide the hash table (could be avoided with 32 bit values
- at the expense of memory usage). We slide even when level == 0
- to keep the hash table consistent if we switch back to level > 0
- later. (Using level 0 permanently is not an optimal usage of
- zlib, so we don't care about this pathological case.)
- */
-
- n = s.hash_size;
- p = n;
- do {
- m = s.head[--p];
- s.head[p] = (m >= _w_size ? m - _w_size : 0);
- } while (--n);
-
- n = _w_size;
- p = n;
- do {
- m = s.prev[--p];
- s.prev[p] = (m >= _w_size ? m - _w_size : 0);
- /* If n is not on any hash chain, prev[n] is garbage but
- * its value will never be used.
- */
- } while (--n);
-
- more += _w_size;
- }
- if (s.strm.avail_in === 0) {
- break;
- }
-
- /* If there was no sliding:
- * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
- * more == window_size - lookahead - strstart
- * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
- * => more >= window_size - 2*WSIZE + 2
- * In the BIG_MEM or MMAP case (not yet supported),
- * window_size == input_size + MIN_LOOKAHEAD &&
- * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
- * Otherwise, window_size == 2*WSIZE so more >= 2.
- * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
- */
- //Assert(more >= 2, "more < 2");
- n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
- s.lookahead += n;
-
- /* Initialize the hash value now that we have some input: */
- if (s.lookahead + s.insert >= MIN_MATCH) {
- str = s.strstart - s.insert;
- s.ins_h = s.window[str];
-
- /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */
- s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;
- //#if MIN_MATCH != 3
- // Call update_hash() MIN_MATCH-3 more times
- //#endif
- while (s.insert) {
- /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
- s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH-1]) & s.hash_mask;
-
- s.prev[str & s.w_mask] = s.head[s.ins_h];
- s.head[s.ins_h] = str;
- str++;
- s.insert--;
- if (s.lookahead + s.insert < MIN_MATCH) {
- break;
- }
- }
- }
- /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
- * but this is not important since only literal bytes will be emitted.
- */
-
- } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);
-
- /* If the WIN_INIT bytes after the end of the current data have never been
- * written, then zero those bytes in order to avoid memory check reports of
- * the use of uninitialized (or uninitialised as Julian writes) bytes by
- * the longest match routines. Update the high water mark for the next
- * time through here. WIN_INIT is set to MAX_MATCH since the longest match
- * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
- */
- // if (s.high_water < s.window_size) {
- // var curr = s.strstart + s.lookahead;
- // var init = 0;
- //
- // if (s.high_water < curr) {
- // /* Previous high water mark below current data -- zero WIN_INIT
- // * bytes or up to end of window, whichever is less.
- // */
- // init = s.window_size - curr;
- // if (init > WIN_INIT)
- // init = WIN_INIT;
- // zmemzero(s->window + curr, (unsigned)init);
- // s->high_water = curr + init;
- // }
- // else if (s->high_water < (ulg)curr + WIN_INIT) {
- // /* High water mark at or above current data, but below current data
- // * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
- // * to end of window, whichever is less.
- // */
- // init = (ulg)curr + WIN_INIT - s->high_water;
- // if (init > s->window_size - s->high_water)
- // init = s->window_size - s->high_water;
- // zmemzero(s->window + s->high_water, (unsigned)init);
- // s->high_water += init;
- // }
- // }
- //
- // Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
- // "not enough room for search");
- }
-
- /* ===========================================================================
- * Copy without compression as much as possible from the input stream, return
- * the current block state.
- * This function does not insert new strings in the dictionary since
- * uncompressible data is probably not useful. This function is used
- * only for the level=0 compression option.
- * NOTE: this function should be optimized to avoid extra copying from
- * window to pending_buf.
- */
- function deflate_stored(s, flush) {
- /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
- * to pending_buf_size, and each stored block has a 5 byte header:
- */
- var max_block_size = 0xffff;
-
- if (max_block_size > s.pending_buf_size - 5) {
- max_block_size = s.pending_buf_size - 5;
- }
-
- /* Copy as much as possible from input to output: */
- for (;;) {
- /* Fill the window as much as possible: */
- if (s.lookahead <= 1) {
-
- //Assert(s->strstart < s->w_size+MAX_DIST(s) ||
- // s->block_start >= (long)s->w_size, "slide too late");
- // if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||
- // s.block_start >= s.w_size)) {
- // throw new Error("slide too late");
- // }
-
- fill_window(s);
- if (s.lookahead === 0 && flush === Z_NO_FLUSH) {
- return BS_NEED_MORE;
- }
-
- if (s.lookahead === 0) {
- break;
- }
- /* flush the current block */
- }
- //Assert(s->block_start >= 0L, "block gone");
- // if (s.block_start < 0) throw new Error("block gone");
-
- s.strstart += s.lookahead;
- s.lookahead = 0;
-
- /* Emit a stored block if pending_buf will be full: */
- var max_start = s.block_start + max_block_size;
-
- if (s.strstart === 0 || s.strstart >= max_start) {
- /* strstart == 0 is possible when wraparound on 16-bit machine */
- s.lookahead = s.strstart - max_start;
- s.strstart = max_start;
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
-
-
- }
- /* Flush if we may have to slide, otherwise block_start may become
- * negative and the data will be gone:
- */
- if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
- }
-
- s.insert = 0;
-
- if (flush === Z_FINISH) {
- /*** FLUSH_BLOCK(s, 1); ***/
- flush_block_only(s, true);
- if (s.strm.avail_out === 0) {
- return BS_FINISH_STARTED;
- }
- /***/
- return BS_FINISH_DONE;
- }
-
- if (s.strstart > s.block_start) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
-
- return BS_NEED_MORE;
- }
-
- /* ===========================================================================
- * Compress as much as possible from the input stream, return the current
- * block state.
- * This function does not perform lazy evaluation of matches and inserts
- * new strings in the dictionary only for unmatched strings or for short
- * matches. It is used only for the fast compression options.
- */
- function deflate_fast(s, flush) {
- var hash_head; /* head of the hash chain */
- var bflush; /* set if current block must be flushed */
-
- for (;;) {
- /* Make sure that we always have enough lookahead, except
- * at the end of the input file. We need MAX_MATCH bytes
- * for the next match, plus MIN_MATCH bytes to insert the
- * string following the next match.
- */
- if (s.lookahead < MIN_LOOKAHEAD) {
- fill_window(s);
- if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
- return BS_NEED_MORE;
- }
- if (s.lookahead === 0) {
- break; /* flush the current block */
- }
- }
-
- /* Insert the string window[strstart .. strstart+2] in the
- * dictionary, and set hash_head to the head of the hash chain:
- */
- hash_head = 0/*NIL*/;
- if (s.lookahead >= MIN_MATCH) {
- /*** INSERT_STRING(s, s.strstart, hash_head); ***/
- s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
- hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
- s.head[s.ins_h] = s.strstart;
- /***/
- }
-
- /* Find the longest match, discarding those <= prev_length.
- * At this point we have always match_length < MIN_MATCH
- */
- if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {
- /* To simplify the code, we prevent matches with the string
- * of window index 0 (in particular we have to avoid a match
- * of the string with itself at the start of the input file).
- */
- s.match_length = longest_match(s, hash_head);
- /* longest_match() sets match_start */
- }
- if (s.match_length >= MIN_MATCH) {
- // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only
-
- /*** _tr_tally_dist(s, s.strstart - s.match_start,
- s.match_length - MIN_MATCH, bflush); ***/
- bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);
-
- s.lookahead -= s.match_length;
-
- /* Insert new strings in the hash table only if the match length
- * is not too large. This saves time but degrades compression.
- */
- if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {
- s.match_length--; /* string at strstart already in table */
- do {
- s.strstart++;
- /*** INSERT_STRING(s, s.strstart, hash_head); ***/
- s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
- hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
- s.head[s.ins_h] = s.strstart;
- /***/
- /* strstart never exceeds WSIZE-MAX_MATCH, so there are
- * always MIN_MATCH bytes ahead.
- */
- } while (--s.match_length !== 0);
- s.strstart++;
- } else
- {
- s.strstart += s.match_length;
- s.match_length = 0;
- s.ins_h = s.window[s.strstart];
- /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */
- s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;
-
- //#if MIN_MATCH != 3
- // Call UPDATE_HASH() MIN_MATCH-3 more times
- //#endif
- /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
- * matter since it will be recomputed at next deflate call.
- */
- }
- } else {
- /* No match, output a literal byte */
- //Tracevv((stderr,"%c", s.window[s.strstart]));
- /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
- bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
-
- s.lookahead--;
- s.strstart++;
- }
- if (bflush) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
- }
- s.insert = ((s.strstart < (MIN_MATCH-1)) ? s.strstart : MIN_MATCH-1);
- if (flush === Z_FINISH) {
- /*** FLUSH_BLOCK(s, 1); ***/
- flush_block_only(s, true);
- if (s.strm.avail_out === 0) {
- return BS_FINISH_STARTED;
- }
- /***/
- return BS_FINISH_DONE;
- }
- if (s.last_lit) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
- return BS_BLOCK_DONE;
- }
-
- /* ===========================================================================
- * Same as above, but achieves better compression. We use a lazy
- * evaluation for matches: a match is finally adopted only if there is
- * no better match at the next window position.
- */
- function deflate_slow(s, flush) {
- var hash_head; /* head of hash chain */
- var bflush; /* set if current block must be flushed */
-
- var max_insert;
-
- /* Process the input block. */
- for (;;) {
- /* Make sure that we always have enough lookahead, except
- * at the end of the input file. We need MAX_MATCH bytes
- * for the next match, plus MIN_MATCH bytes to insert the
- * string following the next match.
- */
- if (s.lookahead < MIN_LOOKAHEAD) {
- fill_window(s);
- if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
- return BS_NEED_MORE;
- }
- if (s.lookahead === 0) { break; } /* flush the current block */
- }
-
- /* Insert the string window[strstart .. strstart+2] in the
- * dictionary, and set hash_head to the head of the hash chain:
- */
- hash_head = 0/*NIL*/;
- if (s.lookahead >= MIN_MATCH) {
- /*** INSERT_STRING(s, s.strstart, hash_head); ***/
- s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
- hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
- s.head[s.ins_h] = s.strstart;
- /***/
- }
-
- /* Find the longest match, discarding those <= prev_length.
- */
- s.prev_length = s.match_length;
- s.prev_match = s.match_start;
- s.match_length = MIN_MATCH-1;
-
- if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&
- s.strstart - hash_head <= (s.w_size-MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {
- /* To simplify the code, we prevent matches with the string
- * of window index 0 (in particular we have to avoid a match
- * of the string with itself at the start of the input file).
- */
- s.match_length = longest_match(s, hash_head);
- /* longest_match() sets match_start */
-
- if (s.match_length <= 5 &&
- (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {
-
- /* If prev_match is also MIN_MATCH, match_start is garbage
- * but we will ignore the current match anyway.
- */
- s.match_length = MIN_MATCH-1;
- }
- }
- /* If there was a match at the previous step and the current
- * match is not better, output the previous match:
- */
- if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
- max_insert = s.strstart + s.lookahead - MIN_MATCH;
- /* Do not insert strings in hash table beyond this. */
-
- //check_match(s, s.strstart-1, s.prev_match, s.prev_length);
-
- /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,
- s.prev_length - MIN_MATCH, bflush);***/
- bflush = trees._tr_tally(s, s.strstart - 1- s.prev_match, s.prev_length - MIN_MATCH);
- /* Insert in hash table all strings up to the end of the match.
- * strstart-1 and strstart are already inserted. If there is not
- * enough lookahead, the last two strings are not inserted in
- * the hash table.
- */
- s.lookahead -= s.prev_length-1;
- s.prev_length -= 2;
- do {
- if (++s.strstart <= max_insert) {
- /*** INSERT_STRING(s, s.strstart, hash_head); ***/
- s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
- hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
- s.head[s.ins_h] = s.strstart;
- /***/
- }
- } while (--s.prev_length !== 0);
- s.match_available = 0;
- s.match_length = MIN_MATCH-1;
- s.strstart++;
-
- if (bflush) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
-
- } else if (s.match_available) {
- /* If there was no match at the previous position, output a
- * single literal. If there was a match but the current match
- * is longer, truncate the previous match to a single literal.
- */
- //Tracevv((stderr,"%c", s->window[s->strstart-1]));
- /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
- bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);
-
- if (bflush) {
- /*** FLUSH_BLOCK_ONLY(s, 0) ***/
- flush_block_only(s, false);
- /***/
- }
- s.strstart++;
- s.lookahead--;
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- } else {
- /* There is no previous match to compare with, wait for
- * the next step to decide.
- */
- s.match_available = 1;
- s.strstart++;
- s.lookahead--;
- }
- }
- //Assert (flush != Z_NO_FLUSH, "no flush?");
- if (s.match_available) {
- //Tracevv((stderr,"%c", s->window[s->strstart-1]));
- /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
- bflush = trees._tr_tally(s, 0, s.window[s.strstart-1]);
-
- s.match_available = 0;
- }
- s.insert = s.strstart < MIN_MATCH-1 ? s.strstart : MIN_MATCH-1;
- if (flush === Z_FINISH) {
- /*** FLUSH_BLOCK(s, 1); ***/
- flush_block_only(s, true);
- if (s.strm.avail_out === 0) {
- return BS_FINISH_STARTED;
- }
- /***/
- return BS_FINISH_DONE;
- }
- if (s.last_lit) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
-
- return BS_BLOCK_DONE;
- }
-
-
- /* ===========================================================================
- * For Z_RLE, simply look for runs of bytes, generate matches only of distance
- * one. Do not maintain a hash table. (It will be regenerated if this run of
- * deflate switches away from Z_RLE.)
- */
- function deflate_rle(s, flush) {
- var bflush; /* set if current block must be flushed */
- var prev; /* byte at distance one to match */
- var scan, strend; /* scan goes up to strend for length of run */
-
- var _win = s.window;
-
- for (;;) {
- /* Make sure that we always have enough lookahead, except
- * at the end of the input file. We need MAX_MATCH bytes
- * for the longest run, plus one for the unrolled loop.
- */
- if (s.lookahead <= MAX_MATCH) {
- fill_window(s);
- if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {
- return BS_NEED_MORE;
- }
- if (s.lookahead === 0) { break; } /* flush the current block */
- }
-
- /* See how many times the previous byte repeats */
- s.match_length = 0;
- if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
- scan = s.strstart - 1;
- prev = _win[scan];
- if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
- strend = s.strstart + MAX_MATCH;
- do {
- /*jshint noempty:false*/
- } while (prev === _win[++scan] && prev === _win[++scan] &&
- prev === _win[++scan] && prev === _win[++scan] &&
- prev === _win[++scan] && prev === _win[++scan] &&
- prev === _win[++scan] && prev === _win[++scan] &&
- scan < strend);
- s.match_length = MAX_MATCH - (strend - scan);
- if (s.match_length > s.lookahead) {
- s.match_length = s.lookahead;
- }
- }
- //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
- }
-
- /* Emit match if have run of MIN_MATCH or longer, else emit literal */
- if (s.match_length >= MIN_MATCH) {
- //check_match(s, s.strstart, s.strstart - 1, s.match_length);
-
- /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/
- bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);
-
- s.lookahead -= s.match_length;
- s.strstart += s.match_length;
- s.match_length = 0;
- } else {
- /* No match, output a literal byte */
- //Tracevv((stderr,"%c", s->window[s->strstart]));
- /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
- bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
-
- s.lookahead--;
- s.strstart++;
- }
- if (bflush) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
- }
- s.insert = 0;
- if (flush === Z_FINISH) {
- /*** FLUSH_BLOCK(s, 1); ***/
- flush_block_only(s, true);
- if (s.strm.avail_out === 0) {
- return BS_FINISH_STARTED;
- }
- /***/
- return BS_FINISH_DONE;
- }
- if (s.last_lit) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
- return BS_BLOCK_DONE;
- }
-
- /* ===========================================================================
- * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.
- * (It will be regenerated if this run of deflate switches away from Huffman.)
- */
- function deflate_huff(s, flush) {
- var bflush; /* set if current block must be flushed */
-
- for (;;) {
- /* Make sure that we have a literal to write. */
- if (s.lookahead === 0) {
- fill_window(s);
- if (s.lookahead === 0) {
- if (flush === Z_NO_FLUSH) {
- return BS_NEED_MORE;
- }
- break; /* flush the current block */
- }
- }
-
- /* Output a literal byte */
- s.match_length = 0;
- //Tracevv((stderr,"%c", s->window[s->strstart]));
- /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
- bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
- s.lookahead--;
- s.strstart++;
- if (bflush) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
- }
- s.insert = 0;
- if (flush === Z_FINISH) {
- /*** FLUSH_BLOCK(s, 1); ***/
- flush_block_only(s, true);
- if (s.strm.avail_out === 0) {
- return BS_FINISH_STARTED;
- }
- /***/
- return BS_FINISH_DONE;
- }
- if (s.last_lit) {
- /*** FLUSH_BLOCK(s, 0); ***/
- flush_block_only(s, false);
- if (s.strm.avail_out === 0) {
- return BS_NEED_MORE;
- }
- /***/
- }
- return BS_BLOCK_DONE;
- }
-
- /* Values for max_lazy_match, good_match and max_chain_length, depending on
- * the desired pack level (0..9). The values given below have been tuned to
- * exclude worst case performance for pathological files. Better values may be
- * found for specific files.
- */
- var Config = function (good_length, max_lazy, nice_length, max_chain, func) {
- this.good_length = good_length;
- this.max_lazy = max_lazy;
- this.nice_length = nice_length;
- this.max_chain = max_chain;
- this.func = func;
- };
-
- var configuration_table;
-
- configuration_table = [
- /* good lazy nice chain */
- new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */
- new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */
- new Config(4, 5, 16, 8, deflate_fast), /* 2 */
- new Config(4, 6, 32, 32, deflate_fast), /* 3 */
-
- new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */
- new Config(8, 16, 32, 32, deflate_slow), /* 5 */
- new Config(8, 16, 128, 128, deflate_slow), /* 6 */
- new Config(8, 32, 128, 256, deflate_slow), /* 7 */
- new Config(32, 128, 258, 1024, deflate_slow), /* 8 */
- new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */
- ];
-
-
- /* ===========================================================================
- * Initialize the "longest match" routines for a new zlib stream
- */
- function lm_init(s) {
- s.window_size = 2 * s.w_size;
-
- /*** CLEAR_HASH(s); ***/
- zero(s.head); // Fill with NIL (= 0);
-
- /* Set the default configuration parameters:
- */
- s.max_lazy_match = configuration_table[s.level].max_lazy;
- s.good_match = configuration_table[s.level].good_length;
- s.nice_match = configuration_table[s.level].nice_length;
- s.max_chain_length = configuration_table[s.level].max_chain;
-
- s.strstart = 0;
- s.block_start = 0;
- s.lookahead = 0;
- s.insert = 0;
- s.match_length = s.prev_length = MIN_MATCH - 1;
- s.match_available = 0;
- s.ins_h = 0;
- }
-
-
- function DeflateState() {
- this.strm = null; /* pointer back to this zlib stream */
- this.status = 0; /* as the name implies */
- this.pending_buf = null; /* output still pending */
- this.pending_buf_size = 0; /* size of pending_buf */
- this.pending_out = 0; /* next pending byte to output to the stream */
- this.pending = 0; /* nb of bytes in the pending buffer */
- this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
- this.gzhead = null; /* gzip header information to write */
- this.gzindex = 0; /* where in extra, name, or comment */
- this.method = Z_DEFLATED; /* can only be DEFLATED */
- this.last_flush = -1; /* value of flush param for previous deflate call */
-
- this.w_size = 0; /* LZ77 window size (32K by default) */
- this.w_bits = 0; /* log2(w_size) (8..16) */
- this.w_mask = 0; /* w_size - 1 */
-
- this.window = null;
- /* Sliding window. Input bytes are read into the second half of the window,
- * and move to the first half later to keep a dictionary of at least wSize
- * bytes. With this organization, matches are limited to a distance of
- * wSize-MAX_MATCH bytes, but this ensures that IO is always
- * performed with a length multiple of the block size.
- */
-
- this.window_size = 0;
- /* Actual size of window: 2*wSize, except when the user input buffer
- * is directly used as sliding window.
- */
-
- this.prev = null;
- /* Link to older string with same hash index. To limit the size of this
- * array to 64K, this link is maintained only for the last 32K strings.
- * An index in this array is thus a window index modulo 32K.
- */
-
- this.head = null; /* Heads of the hash chains or NIL. */
-
- this.ins_h = 0; /* hash index of string to be inserted */
- this.hash_size = 0; /* number of elements in hash table */
- this.hash_bits = 0; /* log2(hash_size) */
- this.hash_mask = 0; /* hash_size-1 */
-
- this.hash_shift = 0;
- /* Number of bits by which ins_h must be shifted at each input
- * step. It must be such that after MIN_MATCH steps, the oldest
- * byte no longer takes part in the hash key, that is:
- * hash_shift * MIN_MATCH >= hash_bits
- */
-
- this.block_start = 0;
- /* Window position at the beginning of the current output block. Gets
- * negative when the window is moved backwards.
- */
-
- this.match_length = 0; /* length of best match */
- this.prev_match = 0; /* previous match */
- this.match_available = 0; /* set if previous match exists */
- this.strstart = 0; /* start of string to insert */
- this.match_start = 0; /* start of matching string */
- this.lookahead = 0; /* number of valid bytes ahead in window */
-
- this.prev_length = 0;
- /* Length of the best match at previous step. Matches not greater than this
- * are discarded. This is used in the lazy match evaluation.
- */
-
- this.max_chain_length = 0;
- /* To speed up deflation, hash chains are never searched beyond this
- * length. A higher limit improves compression ratio but degrades the
- * speed.
- */
-
- this.max_lazy_match = 0;
- /* Attempt to find a better match only when the current match is strictly
- * smaller than this value. This mechanism is used only for compression
- * levels >= 4.
- */
- // That's alias to max_lazy_match, don't use directly
- //this.max_insert_length = 0;
- /* Insert new strings in the hash table only if the match length is not
- * greater than this length. This saves time but degrades compression.
- * max_insert_length is used only for compression levels <= 3.
- */
-
- this.level = 0; /* compression level (1..9) */
- this.strategy = 0; /* favor or force Huffman coding*/
-
- this.good_match = 0;
- /* Use a faster search when the previous match is longer than this */
-
- this.nice_match = 0; /* Stop searching when current match exceeds this */
-
- /* used by trees.c: */
-
- /* Didn't use ct_data typedef below to suppress compiler warning */
-
- // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
- // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
- // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
-
- // Use flat array of DOUBLE size, with interleaved fata,
- // because JS does not support effective
- this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);
- this.dyn_dtree = new utils.Buf16((2*D_CODES+1) * 2);
- this.bl_tree = new utils.Buf16((2*BL_CODES+1) * 2);
- zero(this.dyn_ltree);
- zero(this.dyn_dtree);
- zero(this.bl_tree);
-
- this.l_desc = null; /* desc. for literal tree */
- this.d_desc = null; /* desc. for distance tree */
- this.bl_desc = null; /* desc. for bit length tree */
-
- //ush bl_count[MAX_BITS+1];
- this.bl_count = new utils.Buf16(MAX_BITS+1);
- /* number of codes at each bit length for an optimal tree */
-
- //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
- this.heap = new utils.Buf16(2*L_CODES+1); /* heap used to build the Huffman trees */
- zero(this.heap);
-
- this.heap_len = 0; /* number of elements in the heap */
- this.heap_max = 0; /* element of largest frequency */
- /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
- * The same heap array is used to build all trees.
- */
-
- this.depth = new utils.Buf16(2*L_CODES+1); //uch depth[2*L_CODES+1];
- zero(this.depth);
- /* Depth of each subtree used as tie breaker for trees of equal frequency
- */
-
- this.l_buf = 0; /* buffer index for literals or lengths */
-
- this.lit_bufsize = 0;
- /* Size of match buffer for literals/lengths. There are 4 reasons for
- * limiting lit_bufsize to 64K:
- * - frequencies can be kept in 16 bit counters
- * - if compression is not successful for the first block, all input
- * data is still in the window so we can still emit a stored block even
- * when input comes from standard input. (This can also be done for
- * all blocks if lit_bufsize is not greater than 32K.)
- * - if compression is not successful for a file smaller than 64K, we can
- * even emit a stored file instead of a stored block (saving 5 bytes).
- * This is applicable only for zip (not gzip or zlib).
- * - creating new Huffman trees less frequently may not provide fast
- * adaptation to changes in the input data statistics. (Take for
- * example a binary file with poorly compressible code followed by
- * a highly compressible string table.) Smaller buffer sizes give
- * fast adaptation but have of course the overhead of transmitting
- * trees more frequently.
- * - I can't count above 4
- */
-
- this.last_lit = 0; /* running index in l_buf */
-
- this.d_buf = 0;
- /* Buffer index for distances. To simplify the code, d_buf and l_buf have
- * the same number of elements. To use different lengths, an extra flag
- * array would be necessary.
- */
-
- this.opt_len = 0; /* bit length of current block with optimal trees */
- this.static_len = 0; /* bit length of current block with static trees */
- this.matches = 0; /* number of string matches in current block */
- this.insert = 0; /* bytes at end of window left to insert */
-
-
- this.bi_buf = 0;
- /* Output buffer. bits are inserted starting at the bottom (least
- * significant bits).
- */
- this.bi_valid = 0;
- /* Number of valid bits in bi_buf. All bits above the last valid bit
- * are always zero.
- */
-
- // Used for window memory init. We safely ignore it for JS. That makes
- // sense only for pointers and memory check tools.
- //this.high_water = 0;
- /* High water mark offset in window for initialized bytes -- bytes above
- * this are set to zero in order to avoid memory check warnings when
- * longest match routines access bytes past the input. This is then
- * updated to the new high water mark.
- */
- }
-
-
- function deflateResetKeep(strm) {
- var s;
-
- if (!strm || !strm.state) {
- return err(strm, Z_STREAM_ERROR);
- }
-
- strm.total_in = strm.total_out = 0;
- strm.data_type = Z_UNKNOWN;
-
- s = strm.state;
- s.pending = 0;
- s.pending_out = 0;
-
- if (s.wrap < 0) {
- s.wrap = -s.wrap;
- /* was made negative by deflate(..., Z_FINISH); */
- }
- s.status = (s.wrap ? INIT_STATE : BUSY_STATE);
- strm.adler = (s.wrap === 2) ?
- 0 // crc32(0, Z_NULL, 0)
- :
- 1; // adler32(0, Z_NULL, 0)
- s.last_flush = Z_NO_FLUSH;
- trees._tr_init(s);
- return Z_OK;
- }
-
-
- function deflateReset(strm) {
- var ret = deflateResetKeep(strm);
- if (ret === Z_OK) {
- lm_init(strm.state);
- }
- return ret;
- }
-
-
- function deflateSetHeader(strm, head) {
- if (!strm || !strm.state) { return Z_STREAM_ERROR; }
- if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }
- strm.state.gzhead = head;
- return Z_OK;
- }
-
-
- function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
- if (!strm) { // === Z_NULL
- return Z_STREAM_ERROR;
- }
- var wrap = 1;
-
- if (level === Z_DEFAULT_COMPRESSION) {
- level = 6;
- }
-
- if (windowBits < 0) { /* suppress zlib wrapper */
- wrap = 0;
- windowBits = -windowBits;
- }
-
- else if (windowBits > 15) {
- wrap = 2; /* write gzip wrapper instead */
- windowBits -= 16;
- }
-
-
- if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||
- windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
- strategy < 0 || strategy > Z_FIXED) {
- return err(strm, Z_STREAM_ERROR);
- }
-
-
- if (windowBits === 8) {
- windowBits = 9;
- }
- /* until 256-byte window bug fixed */
-
- var s = new DeflateState();
-
- strm.state = s;
- s.strm = strm;
-
- s.wrap = wrap;
- s.gzhead = null;
- s.w_bits = windowBits;
- s.w_size = 1 << s.w_bits;
- s.w_mask = s.w_size - 1;
-
- s.hash_bits = memLevel + 7;
- s.hash_size = 1 << s.hash_bits;
- s.hash_mask = s.hash_size - 1;
- s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);
-
- s.window = new utils.Buf8(s.w_size * 2);
- s.head = new utils.Buf16(s.hash_size);
- s.prev = new utils.Buf16(s.w_size);
-
- // Don't need mem init magic for JS.
- //s.high_water = 0; /* nothing written to s->window yet */
-
- s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
-
- s.pending_buf_size = s.lit_bufsize * 4;
- s.pending_buf = new utils.Buf8(s.pending_buf_size);
-
- s.d_buf = s.lit_bufsize >> 1;
- s.l_buf = (1 + 2) * s.lit_bufsize;
-
- s.level = level;
- s.strategy = strategy;
- s.method = method;
-
- return deflateReset(strm);
- }
-
- function deflateInit(strm, level) {
- return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
- }
-
-
- function deflate(strm, flush) {
- var old_flush, s;
- var beg, val; // for gzip header write only
-
- if (!strm || !strm.state ||
- flush > Z_BLOCK || flush < 0) {
- return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
- }
-
- s = strm.state;
-
- if (!strm.output ||
- (!strm.input && strm.avail_in !== 0) ||
- (s.status === FINISH_STATE && flush !== Z_FINISH)) {
- return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);
- }
-
- s.strm = strm; /* just in case */
- old_flush = s.last_flush;
- s.last_flush = flush;
-
- /* Write the header */
- if (s.status === INIT_STATE) {
-
- if (s.wrap === 2) { // GZIP header
- strm.adler = 0; //crc32(0L, Z_NULL, 0);
- put_byte(s, 31);
- put_byte(s, 139);
- put_byte(s, 8);
- if (!s.gzhead) { // s->gzhead == Z_NULL
- put_byte(s, 0);
- put_byte(s, 0);
- put_byte(s, 0);
- put_byte(s, 0);
- put_byte(s, 0);
- put_byte(s, s.level === 9 ? 2 :
- (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
- 4 : 0));
- put_byte(s, OS_CODE);
- s.status = BUSY_STATE;
- }
- else {
- put_byte(s, (s.gzhead.text ? 1 : 0) +
- (s.gzhead.hcrc ? 2 : 0) +
- (!s.gzhead.extra ? 0 : 4) +
- (!s.gzhead.name ? 0 : 8) +
- (!s.gzhead.comment ? 0 : 16)
- );
- put_byte(s, s.gzhead.time & 0xff);
- put_byte(s, (s.gzhead.time >> 8) & 0xff);
- put_byte(s, (s.gzhead.time >> 16) & 0xff);
- put_byte(s, (s.gzhead.time >> 24) & 0xff);
- put_byte(s, s.level === 9 ? 2 :
- (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
- 4 : 0));
- put_byte(s, s.gzhead.os & 0xff);
- if (s.gzhead.extra && s.gzhead.extra.length) {
- put_byte(s, s.gzhead.extra.length & 0xff);
- put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);
- }
- if (s.gzhead.hcrc) {
- strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
- }
- s.gzindex = 0;
- s.status = EXTRA_STATE;
- }
- }
- else // DEFLATE header
- {
- var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;
- var level_flags = -1;
-
- if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {
- level_flags = 0;
- } else if (s.level < 6) {
- level_flags = 1;
- } else if (s.level === 6) {
- level_flags = 2;
- } else {
- level_flags = 3;
- }
- header |= (level_flags << 6);
- if (s.strstart !== 0) { header |= PRESET_DICT; }
- header += 31 - (header % 31);
-
- s.status = BUSY_STATE;
- putShortMSB(s, header);
-
- /* Save the adler32 of the preset dictionary: */
- if (s.strstart !== 0) {
- putShortMSB(s, strm.adler >>> 16);
- putShortMSB(s, strm.adler & 0xffff);
- }
- strm.adler = 1; // adler32(0L, Z_NULL, 0);
- }
- }
-
- //#ifdef GZIP
- if (s.status === EXTRA_STATE) {
- if (s.gzhead.extra/* != Z_NULL*/) {
- beg = s.pending; /* start of bytes to update crc */
-
- while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {
- if (s.pending === s.pending_buf_size) {
- if (s.gzhead.hcrc && s.pending > beg) {
- strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
- }
- flush_pending(strm);
- beg = s.pending;
- if (s.pending === s.pending_buf_size) {
- break;
- }
- }
- put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);
- s.gzindex++;
- }
- if (s.gzhead.hcrc && s.pending > beg) {
- strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
- }
- if (s.gzindex === s.gzhead.extra.length) {
- s.gzindex = 0;
- s.status = NAME_STATE;
- }
- }
- else {
- s.status = NAME_STATE;
- }
- }
- if (s.status === NAME_STATE) {
- if (s.gzhead.name/* != Z_NULL*/) {
- beg = s.pending; /* start of bytes to update crc */
- //int val;
-
- do {
- if (s.pending === s.pending_buf_size) {
- if (s.gzhead.hcrc && s.pending > beg) {
- strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
- }
- flush_pending(strm);
- beg = s.pending;
- if (s.pending === s.pending_buf_size) {
- val = 1;
- break;
- }
- }
- // JS specific: little magic to add zero terminator to end of string
- if (s.gzindex < s.gzhead.name.length) {
- val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;
- } else {
- val = 0;
- }
- put_byte(s, val);
- } while (val !== 0);
-
- if (s.gzhead.hcrc && s.pending > beg){
- strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
- }
- if (val === 0) {
- s.gzindex = 0;
- s.status = COMMENT_STATE;
- }
- }
- else {
- s.status = COMMENT_STATE;
- }
- }
- if (s.status === COMMENT_STATE) {
- if (s.gzhead.comment/* != Z_NULL*/) {
- beg = s.pending; /* start of bytes to update crc */
- //int val;
-
- do {
- if (s.pending === s.pending_buf_size) {
- if (s.gzhead.hcrc && s.pending > beg) {
- strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
- }
- flush_pending(strm);
- beg = s.pending;
- if (s.pending === s.pending_buf_size) {
- val = 1;
- break;
- }
- }
- // JS specific: little magic to add zero terminator to end of string
- if (s.gzindex < s.gzhead.comment.length) {
- val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;
- } else {
- val = 0;
- }
- put_byte(s, val);
- } while (val !== 0);
-
- if (s.gzhead.hcrc && s.pending > beg) {
- strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
- }
- if (val === 0) {
- s.status = HCRC_STATE;
- }
- }
- else {
- s.status = HCRC_STATE;
- }
- }
- if (s.status === HCRC_STATE) {
- if (s.gzhead.hcrc) {
- if (s.pending + 2 > s.pending_buf_size) {
- flush_pending(strm);
- }
- if (s.pending + 2 <= s.pending_buf_size) {
- put_byte(s, strm.adler & 0xff);
- put_byte(s, (strm.adler >> 8) & 0xff);
- strm.adler = 0; //crc32(0L, Z_NULL, 0);
- s.status = BUSY_STATE;
- }
- }
- else {
- s.status = BUSY_STATE;
- }
- }
- //#endif
-
- /* Flush as much pending output as possible */
- if (s.pending !== 0) {
- flush_pending(strm);
- if (strm.avail_out === 0) {
- /* Since avail_out is 0, deflate will be called again with
- * more output space, but possibly with both pending and
- * avail_in equal to zero. There won't be anything to do,
- * but this is not an error situation so make sure we
- * return OK instead of BUF_ERROR at next call of deflate:
- */
- s.last_flush = -1;
- return Z_OK;
- }
-
- /* Make sure there is something to do and avoid duplicate consecutive
- * flushes. For repeated and useless calls with Z_FINISH, we keep
- * returning Z_STREAM_END instead of Z_BUF_ERROR.
- */
- } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&
- flush !== Z_FINISH) {
- return err(strm, Z_BUF_ERROR);
- }
-
- /* User must not provide more input after the first FINISH: */
- if (s.status === FINISH_STATE && strm.avail_in !== 0) {
- return err(strm, Z_BUF_ERROR);
- }
-
- /* Start a new block or continue the current one.
- */
- if (strm.avail_in !== 0 || s.lookahead !== 0 ||
- (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {
- var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :
- (s.strategy === Z_RLE ? deflate_rle(s, flush) :
- configuration_table[s.level].func(s, flush));
-
- if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {
- s.status = FINISH_STATE;
- }
- if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
- if (strm.avail_out === 0) {
- s.last_flush = -1;
- /* avoid BUF_ERROR next call, see above */
- }
- return Z_OK;
- /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
- * of deflate should use the same flush parameter to make sure
- * that the flush is complete. So we don't have to output an
- * empty block here, this will be done at next call. This also
- * ensures that for a very small output buffer, we emit at most
- * one empty block.
- */
- }
- if (bstate === BS_BLOCK_DONE) {
- if (flush === Z_PARTIAL_FLUSH) {
- trees._tr_align(s);
- }
- else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
-
- trees._tr_stored_block(s, 0, 0, false);
- /* For a full flush, this empty block will be recognized
- * as a special marker by inflate_sync().
- */
- if (flush === Z_FULL_FLUSH) {
- /*** CLEAR_HASH(s); ***/ /* forget history */
- zero(s.head); // Fill with NIL (= 0);
-
- if (s.lookahead === 0) {
- s.strstart = 0;
- s.block_start = 0;
- s.insert = 0;
- }
- }
- }
- flush_pending(strm);
- if (strm.avail_out === 0) {
- s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */
- return Z_OK;
- }
- }
- }
- //Assert(strm->avail_out > 0, "bug2");
- //if (strm.avail_out <= 0) { throw new Error("bug2");}
-
- if (flush !== Z_FINISH) { return Z_OK; }
- if (s.wrap <= 0) { return Z_STREAM_END; }
-
- /* Write the trailer */
- if (s.wrap === 2) {
- put_byte(s, strm.adler & 0xff);
- put_byte(s, (strm.adler >> 8) & 0xff);
- put_byte(s, (strm.adler >> 16) & 0xff);
- put_byte(s, (strm.adler >> 24) & 0xff);
- put_byte(s, strm.total_in & 0xff);
- put_byte(s, (strm.total_in >> 8) & 0xff);
- put_byte(s, (strm.total_in >> 16) & 0xff);
- put_byte(s, (strm.total_in >> 24) & 0xff);
- }
- else
- {
- putShortMSB(s, strm.adler >>> 16);
- putShortMSB(s, strm.adler & 0xffff);
- }
-
- flush_pending(strm);
- /* If avail_out is zero, the application will call deflate again
- * to flush the rest.
- */
- if (s.wrap > 0) { s.wrap = -s.wrap; }
- /* write the trailer only once! */
- return s.pending !== 0 ? Z_OK : Z_STREAM_END;
- }
-
- function deflateEnd(strm) {
- var status;
-
- if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
- return Z_STREAM_ERROR;
- }
-
- status = strm.state.status;
- if (status !== INIT_STATE &&
- status !== EXTRA_STATE &&
- status !== NAME_STATE &&
- status !== COMMENT_STATE &&
- status !== HCRC_STATE &&
- status !== BUSY_STATE &&
- status !== FINISH_STATE
- ) {
- return err(strm, Z_STREAM_ERROR);
- }
-
- strm.state = null;
-
- return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
- }
-
- /* =========================================================================
- * Copy the source state to the destination state
- */
- //function deflateCopy(dest, source) {
- //
- //}
-
- exports.deflateInit = deflateInit;
- exports.deflateInit2 = deflateInit2;
- exports.deflateReset = deflateReset;
- exports.deflateResetKeep = deflateResetKeep;
- exports.deflateSetHeader = deflateSetHeader;
- exports.deflate = deflate;
- exports.deflateEnd = deflateEnd;
- exports.deflateInfo = 'pako deflate (from Nodeca project)';
-
- /* Not implemented
- exports.deflateBound = deflateBound;
- exports.deflateCopy = deflateCopy;
- exports.deflateSetDictionary = deflateSetDictionary;
- exports.deflateParams = deflateParams;
- exports.deflatePending = deflatePending;
- exports.deflatePrime = deflatePrime;
- exports.deflateTune = deflateTune;
- */
- },{"../utils/common":27,"./adler32":29,"./crc32":31,"./messages":37,"./trees":38}],33:[function(_dereq_,module,exports){
- 'use strict';
-
-
- function GZheader() {
- /* true if compressed data believed to be text */
- this.text = 0;
- /* modification time */
- this.time = 0;
- /* extra flags (not used when writing a gzip file) */
- this.xflags = 0;
- /* operating system */
- this.os = 0;
- /* pointer to extra field or Z_NULL if none */
- this.extra = null;
- /* extra field length (valid if extra != Z_NULL) */
- this.extra_len = 0; // Actually, we don't need it in JS,
- // but leave for few code modifications
-
- //
- // Setup limits is not necessary because in js we should not preallocate memory
- // for inflate use constant limit in 65536 bytes
- //
-
- /* space at extra (only when reading header) */
- // this.extra_max = 0;
- /* pointer to zero-terminated file name or Z_NULL */
- this.name = '';
- /* space at name (only when reading header) */
- // this.name_max = 0;
- /* pointer to zero-terminated comment or Z_NULL */
- this.comment = '';
- /* space at comment (only when reading header) */
- // this.comm_max = 0;
- /* true if there was or will be a header crc */
- this.hcrc = 0;
- /* true when done reading gzip header (not used when writing a gzip file) */
- this.done = false;
- }
-
- module.exports = GZheader;
- },{}],34:[function(_dereq_,module,exports){
- 'use strict';
-
- // See state defs from inflate.js
- var BAD = 30; /* got a data error -- remain here until reset */
- var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
-
- /*
- Decode literal, length, and distance codes and write out the resulting
- literal and match bytes until either not enough input or output is
- available, an end-of-block is encountered, or a data error is encountered.
- When large enough input and output buffers are supplied to inflate(), for
- example, a 16K input buffer and a 64K output buffer, more than 95% of the
- inflate execution time is spent in this routine.
-
- Entry assumptions:
-
- state.mode === LEN
- strm.avail_in >= 6
- strm.avail_out >= 258
- start >= strm.avail_out
- state.bits < 8
-
- On return, state.mode is one of:
-
- LEN -- ran out of enough output space or enough available input
- TYPE -- reached end of block code, inflate() to interpret next block
- BAD -- error in block data
-
- Notes:
-
- - The maximum input bits used by a length/distance pair is 15 bits for the
- length code, 5 bits for the length extra, 15 bits for the distance code,
- and 13 bits for the distance extra. This totals 48 bits, or six bytes.
- Therefore if strm.avail_in >= 6, then there is enough input to avoid
- checking for available input while decoding.
-
- - The maximum bytes that a single length/distance pair can output is 258
- bytes, which is the maximum length that can be coded. inflate_fast()
- requires strm.avail_out >= 258 for each loop to avoid checking for
- output space.
- */
- module.exports = function inflate_fast(strm, start) {
- var state;
- var _in; /* local strm.input */
- var last; /* have enough input while in < last */
- var _out; /* local strm.output */
- var beg; /* inflate()'s initial strm.output */
- var end; /* while out < end, enough space available */
- //#ifdef INFLATE_STRICT
- var dmax; /* maximum distance from zlib header */
- //#endif
- var wsize; /* window size or zero if not using window */
- var whave; /* valid bytes in the window */
- var wnext; /* window write index */
- var window; /* allocated sliding window, if wsize != 0 */
- var hold; /* local strm.hold */
- var bits; /* local strm.bits */
- var lcode; /* local strm.lencode */
- var dcode; /* local strm.distcode */
- var lmask; /* mask for first level of length codes */
- var dmask; /* mask for first level of distance codes */
- var here; /* retrieved table entry */
- var op; /* code bits, operation, extra bits, or */
- /* window position, window bytes to copy */
- var len; /* match length, unused bytes */
- var dist; /* match distance */
- var from; /* where to copy match from */
- var from_source;
-
-
- var input, output; // JS specific, because we have no pointers
-
- /* copy state to local variables */
- state = strm.state;
- //here = state.here;
- _in = strm.next_in;
- input = strm.input;
- last = _in + (strm.avail_in - 5);
- _out = strm.next_out;
- output = strm.output;
- beg = _out - (start - strm.avail_out);
- end = _out + (strm.avail_out - 257);
- //#ifdef INFLATE_STRICT
- dmax = state.dmax;
- //#endif
- wsize = state.wsize;
- whave = state.whave;
- wnext = state.wnext;
- window = state.window;
- hold = state.hold;
- bits = state.bits;
- lcode = state.lencode;
- dcode = state.distcode;
- lmask = (1 << state.lenbits) - 1;
- dmask = (1 << state.distbits) - 1;
-
-
- /* decode literals and length/distances until end-of-block or not enough
- input data or output space */
-
- top:
- do {
- if (bits < 15) {
- hold += input[_in++] << bits;
- bits += 8;
- hold += input[_in++] << bits;
- bits += 8;
- }
-
- here = lcode[hold & lmask];
-
- dolen:
- for (;;) { // Goto emulation
- op = here >>> 24/*here.bits*/;
- hold >>>= op;
- bits -= op;
- op = (here >>> 16) & 0xff/*here.op*/;
- if (op === 0) { /* literal */
- //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
- // "inflate: literal '%c'\n" :
- // "inflate: literal 0x%02x\n", here.val));
- output[_out++] = here & 0xffff/*here.val*/;
- }
- else if (op & 16) { /* length base */
- len = here & 0xffff/*here.val*/;
- op &= 15; /* number of extra bits */
- if (op) {
- if (bits < op) {
- hold += input[_in++] << bits;
- bits += 8;
- }
- len += hold & ((1 << op) - 1);
- hold >>>= op;
- bits -= op;
- }
- //Tracevv((stderr, "inflate: length %u\n", len));
- if (bits < 15) {
- hold += input[_in++] << bits;
- bits += 8;
- hold += input[_in++] << bits;
- bits += 8;
- }
- here = dcode[hold & dmask];
-
- dodist:
- for (;;) { // goto emulation
- op = here >>> 24/*here.bits*/;
- hold >>>= op;
- bits -= op;
- op = (here >>> 16) & 0xff/*here.op*/;
-
- if (op & 16) { /* distance base */
- dist = here & 0xffff/*here.val*/;
- op &= 15; /* number of extra bits */
- if (bits < op) {
- hold += input[_in++] << bits;
- bits += 8;
- if (bits < op) {
- hold += input[_in++] << bits;
- bits += 8;
- }
- }
- dist += hold & ((1 << op) - 1);
- //#ifdef INFLATE_STRICT
- if (dist > dmax) {
- strm.msg = 'invalid distance too far back';
- state.mode = BAD;
- break top;
- }
- //#endif
- hold >>>= op;
- bits -= op;
- //Tracevv((stderr, "inflate: distance %u\n", dist));
- op = _out - beg; /* max distance in output */
- if (dist > op) { /* see if copy from window */
- op = dist - op; /* distance back in window */
- if (op > whave) {
- if (state.sane) {
- strm.msg = 'invalid distance too far back';
- state.mode = BAD;
- break top;
- }
-
- // (!) This block is disabled in zlib defailts,
- // don't enable it for binary compatibility
- //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
- // if (len <= op - whave) {
- // do {
- // output[_out++] = 0;
- // } while (--len);
- // continue top;
- // }
- // len -= op - whave;
- // do {
- // output[_out++] = 0;
- // } while (--op > whave);
- // if (op === 0) {
- // from = _out - dist;
- // do {
- // output[_out++] = output[from++];
- // } while (--len);
- // continue top;
- // }
- //#endif
- }
- from = 0; // window index
- from_source = window;
- if (wnext === 0) { /* very common case */
- from += wsize - op;
- if (op < len) { /* some from window */
- len -= op;
- do {
- output[_out++] = window[from++];
- } while (--op);
- from = _out - dist; /* rest from output */
- from_source = output;
- }
- }
- else if (wnext < op) { /* wrap around window */
- from += wsize + wnext - op;
- op -= wnext;
- if (op < len) { /* some from end of window */
- len -= op;
- do {
- output[_out++] = window[from++];
- } while (--op);
- from = 0;
- if (wnext < len) { /* some from start of window */
- op = wnext;
- len -= op;
- do {
- output[_out++] = window[from++];
- } while (--op);
- from = _out - dist; /* rest from output */
- from_source = output;
- }
- }
- }
- else { /* contiguous in window */
- from += wnext - op;
- if (op < len) { /* some from window */
- len -= op;
- do {
- output[_out++] = window[from++];
- } while (--op);
- from = _out - dist; /* rest from output */
- from_source = output;
- }
- }
- while (len > 2) {
- output[_out++] = from_source[from++];
- output[_out++] = from_source[from++];
- output[_out++] = from_source[from++];
- len -= 3;
- }
- if (len) {
- output[_out++] = from_source[from++];
- if (len > 1) {
- output[_out++] = from_source[from++];
- }
- }
- }
- else {
- from = _out - dist; /* copy direct from output */
- do { /* minimum length is three */
- output[_out++] = output[from++];
- output[_out++] = output[from++];
- output[_out++] = output[from++];
- len -= 3;
- } while (len > 2);
- if (len) {
- output[_out++] = output[from++];
- if (len > 1) {
- output[_out++] = output[from++];
- }
- }
- }
- }
- else if ((op & 64) === 0) { /* 2nd level distance code */
- here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
- continue dodist;
- }
- else {
- strm.msg = 'invalid distance code';
- state.mode = BAD;
- break top;
- }
-
- break; // need to emulate goto via "continue"
- }
- }
- else if ((op & 64) === 0) { /* 2nd level length code */
- here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
- continue dolen;
- }
- else if (op & 32) { /* end-of-block */
- //Tracevv((stderr, "inflate: end of block\n"));
- state.mode = TYPE;
- break top;
- }
- else {
- strm.msg = 'invalid literal/length code';
- state.mode = BAD;
- break top;
- }
-
- break; // need to emulate goto via "continue"
- }
- } while (_in < last && _out < end);
-
- /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
- len = bits >> 3;
- _in -= len;
- bits -= len << 3;
- hold &= (1 << bits) - 1;
-
- /* update state and return */
- strm.next_in = _in;
- strm.next_out = _out;
- strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));
- strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));
- state.hold = hold;
- state.bits = bits;
- return;
- };
-
- },{}],35:[function(_dereq_,module,exports){
- 'use strict';
-
-
- var utils = _dereq_('../utils/common');
- var adler32 = _dereq_('./adler32');
- var crc32 = _dereq_('./crc32');
- var inflate_fast = _dereq_('./inffast');
- var inflate_table = _dereq_('./inftrees');
-
- var CODES = 0;
- var LENS = 1;
- var DISTS = 2;
-
- /* Public constants ==========================================================*/
- /* ===========================================================================*/
-
-
- /* Allowed flush values; see deflate() and inflate() below for details */
- //var Z_NO_FLUSH = 0;
- //var Z_PARTIAL_FLUSH = 1;
- //var Z_SYNC_FLUSH = 2;
- //var Z_FULL_FLUSH = 3;
- var Z_FINISH = 4;
- var Z_BLOCK = 5;
- var Z_TREES = 6;
-
-
- /* Return codes for the compression/decompression functions. Negative values
- * are errors, positive values are used for special but normal events.
- */
- var Z_OK = 0;
- var Z_STREAM_END = 1;
- var Z_NEED_DICT = 2;
- //var Z_ERRNO = -1;
- var Z_STREAM_ERROR = -2;
- var Z_DATA_ERROR = -3;
- var Z_MEM_ERROR = -4;
- var Z_BUF_ERROR = -5;
- //var Z_VERSION_ERROR = -6;
-
- /* The deflate compression method */
- var Z_DEFLATED = 8;
-
-
- /* STATES ====================================================================*/
- /* ===========================================================================*/
-
-
- var HEAD = 1; /* i: waiting for magic header */
- var FLAGS = 2; /* i: waiting for method and flags (gzip) */
- var TIME = 3; /* i: waiting for modification time (gzip) */
- var OS = 4; /* i: waiting for extra flags and operating system (gzip) */
- var EXLEN = 5; /* i: waiting for extra length (gzip) */
- var EXTRA = 6; /* i: waiting for extra bytes (gzip) */
- var NAME = 7; /* i: waiting for end of file name (gzip) */
- var COMMENT = 8; /* i: waiting for end of comment (gzip) */
- var HCRC = 9; /* i: waiting for header crc (gzip) */
- var DICTID = 10; /* i: waiting for dictionary check value */
- var DICT = 11; /* waiting for inflateSetDictionary() call */
- var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
- var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */
- var STORED = 14; /* i: waiting for stored size (length and complement) */
- var COPY_ = 15; /* i/o: same as COPY below, but only first time in */
- var COPY = 16; /* i/o: waiting for input or output to copy stored block */
- var TABLE = 17; /* i: waiting for dynamic block table lengths */
- var LENLENS = 18; /* i: waiting for code length code lengths */
- var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */
- var LEN_ = 20; /* i: same as LEN below, but only first time in */
- var LEN = 21; /* i: waiting for length/lit/eob code */
- var LENEXT = 22; /* i: waiting for length extra bits */
- var DIST = 23; /* i: waiting for distance code */
- var DISTEXT = 24; /* i: waiting for distance extra bits */
- var MATCH = 25; /* o: waiting for output space to copy string */
- var LIT = 26; /* o: waiting for output space to write literal */
- var CHECK = 27; /* i: waiting for 32-bit check value */
- var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */
- var DONE = 29; /* finished check, done -- remain here until reset */
- var BAD = 30; /* got a data error -- remain here until reset */
- var MEM = 31; /* got an inflate() memory error -- remain here until reset */
- var SYNC = 32; /* looking for synchronization bytes to restart inflate() */
-
- /* ===========================================================================*/
-
-
-
- var ENOUGH_LENS = 852;
- var ENOUGH_DISTS = 592;
- //var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
-
- var MAX_WBITS = 15;
- /* 32K LZ77 window */
- var DEF_WBITS = MAX_WBITS;
-
-
- function ZSWAP32(q) {
- return (((q >>> 24) & 0xff) +
- ((q >>> 8) & 0xff00) +
- ((q & 0xff00) << 8) +
- ((q & 0xff) << 24));
- }
-
-
- function InflateState() {
- this.mode = 0; /* current inflate mode */
- this.last = false; /* true if processing last block */
- this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
- this.havedict = false; /* true if dictionary provided */
- this.flags = 0; /* gzip header method and flags (0 if zlib) */
- this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */
- this.check = 0; /* protected copy of check value */
- this.total = 0; /* protected copy of output count */
- // TODO: may be {}
- this.head = null; /* where to save gzip header information */
-
- /* sliding window */
- this.wbits = 0; /* log base 2 of requested window size */
- this.wsize = 0; /* window size or zero if not using window */
- this.whave = 0; /* valid bytes in the window */
- this.wnext = 0; /* window write index */
- this.window = null; /* allocated sliding window, if needed */
-
- /* bit accumulator */
- this.hold = 0; /* input bit accumulator */
- this.bits = 0; /* number of bits in "in" */
-
- /* for string and stored block copying */
- this.length = 0; /* literal or length of data to copy */
- this.offset = 0; /* distance back to copy string from */
-
- /* for table and code decoding */
- this.extra = 0; /* extra bits needed */
-
- /* fixed and dynamic code tables */
- this.lencode = null; /* starting table for length/literal codes */
- this.distcode = null; /* starting table for distance codes */
- this.lenbits = 0; /* index bits for lencode */
- this.distbits = 0; /* index bits for distcode */
-
- /* dynamic table building */
- this.ncode = 0; /* number of code length code lengths */
- this.nlen = 0; /* number of length code lengths */
- this.ndist = 0; /* number of distance code lengths */
- this.have = 0; /* number of code lengths in lens[] */
- this.next = null; /* next available space in codes[] */
-
- this.lens = new utils.Buf16(320); /* temporary storage for code lengths */
- this.work = new utils.Buf16(288); /* work area for code table building */
-
- /*
- because we don't have pointers in js, we use lencode and distcode directly
- as buffers so we don't need codes
- */
- //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */
- this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */
- this.distdyn = null; /* dynamic table for distance codes (JS specific) */
- this.sane = 0; /* if false, allow invalid distance too far */
- this.back = 0; /* bits back of last unprocessed length/lit */
- this.was = 0; /* initial length of match */
- }
-
- function inflateResetKeep(strm) {
- var state;
-
- if (!strm || !strm.state) { return Z_STREAM_ERROR; }
- state = strm.state;
- strm.total_in = strm.total_out = state.total = 0;
- strm.msg = ''; /*Z_NULL*/
- if (state.wrap) { /* to support ill-conceived Java test suite */
- strm.adler = state.wrap & 1;
- }
- state.mode = HEAD;
- state.last = 0;
- state.havedict = 0;
- state.dmax = 32768;
- state.head = null/*Z_NULL*/;
- state.hold = 0;
- state.bits = 0;
- //state.lencode = state.distcode = state.next = state.codes;
- state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
- state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);
-
- state.sane = 1;
- state.back = -1;
- //Tracev((stderr, "inflate: reset\n"));
- return Z_OK;
- }
-
- function inflateReset(strm) {
- var state;
-
- if (!strm || !strm.state) { return Z_STREAM_ERROR; }
- state = strm.state;
- state.wsize = 0;
- state.whave = 0;
- state.wnext = 0;
- return inflateResetKeep(strm);
-
- }
-
- function inflateReset2(strm, windowBits) {
- var wrap;
- var state;
-
- /* get the state */
- if (!strm || !strm.state) { return Z_STREAM_ERROR; }
- state = strm.state;
-
- /* extract wrap request from windowBits parameter */
- if (windowBits < 0) {
- wrap = 0;
- windowBits = -windowBits;
- }
- else {
- wrap = (windowBits >> 4) + 1;
- if (windowBits < 48) {
- windowBits &= 15;
- }
- }
-
- /* set number of window bits, free window if different */
- if (windowBits && (windowBits < 8 || windowBits > 15)) {
- return Z_STREAM_ERROR;
- }
- if (state.window !== null && state.wbits !== windowBits) {
- state.window = null;
- }
-
- /* update state and reset the rest of it */
- state.wrap = wrap;
- state.wbits = windowBits;
- return inflateReset(strm);
- }
-
- function inflateInit2(strm, windowBits) {
- var ret;
- var state;
-
- if (!strm) { return Z_STREAM_ERROR; }
- //strm.msg = Z_NULL; /* in case we return an error */
-
- state = new InflateState();
-
- //if (state === Z_NULL) return Z_MEM_ERROR;
- //Tracev((stderr, "inflate: allocated\n"));
- strm.state = state;
- state.window = null/*Z_NULL*/;
- ret = inflateReset2(strm, windowBits);
- if (ret !== Z_OK) {
- strm.state = null/*Z_NULL*/;
- }
- return ret;
- }
-
- function inflateInit(strm) {
- return inflateInit2(strm, DEF_WBITS);
- }
-
-
- /*
- Return state with length and distance decoding tables and index sizes set to
- fixed code decoding. Normally this returns fixed tables from inffixed.h.
- If BUILDFIXED is defined, then instead this routine builds the tables the
- first time it's called, and returns those tables the first time and
- thereafter. This reduces the size of the code by about 2K bytes, in
- exchange for a little execution time. However, BUILDFIXED should not be
- used for threaded applications, since the rewriting of the tables and virgin
- may not be thread-safe.
- */
- var virgin = true;
-
- var lenfix, distfix; // We have no pointers in JS, so keep tables separate
-
- function fixedtables(state) {
- /* build fixed huffman tables if first call (may not be thread safe) */
- if (virgin) {
- var sym;
-
- lenfix = new utils.Buf32(512);
- distfix = new utils.Buf32(32);
-
- /* literal/length table */
- sym = 0;
- while (sym < 144) { state.lens[sym++] = 8; }
- while (sym < 256) { state.lens[sym++] = 9; }
- while (sym < 280) { state.lens[sym++] = 7; }
- while (sym < 288) { state.lens[sym++] = 8; }
-
- inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, {bits: 9});
-
- /* distance table */
- sym = 0;
- while (sym < 32) { state.lens[sym++] = 5; }
-
- inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, {bits: 5});
-
- /* do this just once */
- virgin = false;
- }
-
- state.lencode = lenfix;
- state.lenbits = 9;
- state.distcode = distfix;
- state.distbits = 5;
- }
-
-
- /*
- Update the window with the last wsize (normally 32K) bytes written before
- returning. If window does not exist yet, create it. This is only called
- when a window is already in use, or when output has been written during this
- inflate call, but the end of the deflate stream has not been reached yet.
- It is also called to create a window for dictionary data when a dictionary
- is loaded.
-
- Providing output buffers larger than 32K to inflate() should provide a speed
- advantage, since only the last 32K of output is copied to the sliding window
- upon return from inflate(), and since all distances after the first 32K of
- output will fall in the output data, making match copies simpler and faster.
- The advantage may be dependent on the size of the processor's data caches.
- */
- function updatewindow(strm, src, end, copy) {
- var dist;
- var state = strm.state;
-
- /* if it hasn't been done already, allocate space for the window */
- if (state.window === null) {
- state.wsize = 1 << state.wbits;
- state.wnext = 0;
- state.whave = 0;
-
- state.window = new utils.Buf8(state.wsize);
- }
-
- /* copy state->wsize or less output bytes into the circular window */
- if (copy >= state.wsize) {
- utils.arraySet(state.window,src, end - state.wsize, state.wsize, 0);
- state.wnext = 0;
- state.whave = state.wsize;
- }
- else {
- dist = state.wsize - state.wnext;
- if (dist > copy) {
- dist = copy;
- }
- //zmemcpy(state->window + state->wnext, end - copy, dist);
- utils.arraySet(state.window,src, end - copy, dist, state.wnext);
- copy -= dist;
- if (copy) {
- //zmemcpy(state->window, end - copy, copy);
- utils.arraySet(state.window,src, end - copy, copy, 0);
- state.wnext = copy;
- state.whave = state.wsize;
- }
- else {
- state.wnext += dist;
- if (state.wnext === state.wsize) { state.wnext = 0; }
- if (state.whave < state.wsize) { state.whave += dist; }
- }
- }
- return 0;
- }
-
- function inflate(strm, flush) {
- var state;
- var input, output; // input/output buffers
- var next; /* next input INDEX */
- var put; /* next output INDEX */
- var have, left; /* available input and output */
- var hold; /* bit buffer */
- var bits; /* bits in bit buffer */
- var _in, _out; /* save starting available input and output */
- var copy; /* number of stored or match bytes to copy */
- var from; /* where to copy match bytes from */
- var from_source;
- var here = 0; /* current decoding table entry */
- var here_bits, here_op, here_val; // paked "here" denormalized (JS specific)
- //var last; /* parent table entry */
- var last_bits, last_op, last_val; // paked "last" denormalized (JS specific)
- var len; /* length to copy for repeats, bits to drop */
- var ret; /* return code */
- var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */
- var opts;
-
- var n; // temporary var for NEED_BITS
-
- var order = /* permutation of code lengths */
- [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
-
-
- if (!strm || !strm.state || !strm.output ||
- (!strm.input && strm.avail_in !== 0)) {
- return Z_STREAM_ERROR;
- }
-
- state = strm.state;
- if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */
-
-
- //--- LOAD() ---
- put = strm.next_out;
- output = strm.output;
- left = strm.avail_out;
- next = strm.next_in;
- input = strm.input;
- have = strm.avail_in;
- hold = state.hold;
- bits = state.bits;
- //---
-
- _in = have;
- _out = left;
- ret = Z_OK;
-
- inf_leave: // goto emulation
- for (;;) {
- switch (state.mode) {
- case HEAD:
- if (state.wrap === 0) {
- state.mode = TYPEDO;
- break;
- }
- //=== NEEDBITS(16);
- while (bits < 16) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */
- state.check = 0/*crc32(0L, Z_NULL, 0)*/;
- //=== CRC2(state.check, hold);
- hbuf[0] = hold & 0xff;
- hbuf[1] = (hold >>> 8) & 0xff;
- state.check = crc32(state.check, hbuf, 2, 0);
- //===//
-
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- state.mode = FLAGS;
- break;
- }
- state.flags = 0; /* expect zlib header */
- if (state.head) {
- state.head.done = false;
- }
- if (!(state.wrap & 1) || /* check if zlib header allowed */
- (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {
- strm.msg = 'incorrect header check';
- state.mode = BAD;
- break;
- }
- if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {
- strm.msg = 'unknown compression method';
- state.mode = BAD;
- break;
- }
- //--- DROPBITS(4) ---//
- hold >>>= 4;
- bits -= 4;
- //---//
- len = (hold & 0x0f)/*BITS(4)*/ + 8;
- if (state.wbits === 0) {
- state.wbits = len;
- }
- else if (len > state.wbits) {
- strm.msg = 'invalid window size';
- state.mode = BAD;
- break;
- }
- state.dmax = 1 << len;
- //Tracev((stderr, "inflate: zlib header ok\n"));
- strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
- state.mode = hold & 0x200 ? DICTID : TYPE;
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- break;
- case FLAGS:
- //=== NEEDBITS(16); */
- while (bits < 16) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- state.flags = hold;
- if ((state.flags & 0xff) !== Z_DEFLATED) {
- strm.msg = 'unknown compression method';
- state.mode = BAD;
- break;
- }
- if (state.flags & 0xe000) {
- strm.msg = 'unknown header flags set';
- state.mode = BAD;
- break;
- }
- if (state.head) {
- state.head.text = ((hold >> 8) & 1);
- }
- if (state.flags & 0x0200) {
- //=== CRC2(state.check, hold);
- hbuf[0] = hold & 0xff;
- hbuf[1] = (hold >>> 8) & 0xff;
- state.check = crc32(state.check, hbuf, 2, 0);
- //===//
- }
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- state.mode = TIME;
- /* falls through */
- case TIME:
- //=== NEEDBITS(32); */
- while (bits < 32) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- if (state.head) {
- state.head.time = hold;
- }
- if (state.flags & 0x0200) {
- //=== CRC4(state.check, hold)
- hbuf[0] = hold & 0xff;
- hbuf[1] = (hold >>> 8) & 0xff;
- hbuf[2] = (hold >>> 16) & 0xff;
- hbuf[3] = (hold >>> 24) & 0xff;
- state.check = crc32(state.check, hbuf, 4, 0);
- //===
- }
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- state.mode = OS;
- /* falls through */
- case OS:
- //=== NEEDBITS(16); */
- while (bits < 16) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- if (state.head) {
- state.head.xflags = (hold & 0xff);
- state.head.os = (hold >> 8);
- }
- if (state.flags & 0x0200) {
- //=== CRC2(state.check, hold);
- hbuf[0] = hold & 0xff;
- hbuf[1] = (hold >>> 8) & 0xff;
- state.check = crc32(state.check, hbuf, 2, 0);
- //===//
- }
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- state.mode = EXLEN;
- /* falls through */
- case EXLEN:
- if (state.flags & 0x0400) {
- //=== NEEDBITS(16); */
- while (bits < 16) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- state.length = hold;
- if (state.head) {
- state.head.extra_len = hold;
- }
- if (state.flags & 0x0200) {
- //=== CRC2(state.check, hold);
- hbuf[0] = hold & 0xff;
- hbuf[1] = (hold >>> 8) & 0xff;
- state.check = crc32(state.check, hbuf, 2, 0);
- //===//
- }
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- }
- else if (state.head) {
- state.head.extra = null/*Z_NULL*/;
- }
- state.mode = EXTRA;
- /* falls through */
- case EXTRA:
- if (state.flags & 0x0400) {
- copy = state.length;
- if (copy > have) { copy = have; }
- if (copy) {
- if (state.head) {
- len = state.head.extra_len - state.length;
- if (!state.head.extra) {
- // Use untyped array for more conveniend processing later
- state.head.extra = new Array(state.head.extra_len);
- }
- utils.arraySet(
- state.head.extra,
- input,
- next,
- // extra field is limited to 65536 bytes
- // - no need for additional size check
- copy,
- /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
- len
- );
- //zmemcpy(state.head.extra + len, next,
- // len + copy > state.head.extra_max ?
- // state.head.extra_max - len : copy);
- }
- if (state.flags & 0x0200) {
- state.check = crc32(state.check, input, copy, next);
- }
- have -= copy;
- next += copy;
- state.length -= copy;
- }
- if (state.length) { break inf_leave; }
- }
- state.length = 0;
- state.mode = NAME;
- /* falls through */
- case NAME:
- if (state.flags & 0x0800) {
- if (have === 0) { break inf_leave; }
- copy = 0;
- do {
- // TODO: 2 or 1 bytes?
- len = input[next + copy++];
- /* use constant limit because in js we should not preallocate memory */
- if (state.head && len &&
- (state.length < 65536 /*state.head.name_max*/)) {
- state.head.name += String.fromCharCode(len);
- }
- } while (len && copy < have);
-
- if (state.flags & 0x0200) {
- state.check = crc32(state.check, input, copy, next);
- }
- have -= copy;
- next += copy;
- if (len) { break inf_leave; }
- }
- else if (state.head) {
- state.head.name = null;
- }
- state.length = 0;
- state.mode = COMMENT;
- /* falls through */
- case COMMENT:
- if (state.flags & 0x1000) {
- if (have === 0) { break inf_leave; }
- copy = 0;
- do {
- len = input[next + copy++];
- /* use constant limit because in js we should not preallocate memory */
- if (state.head && len &&
- (state.length < 65536 /*state.head.comm_max*/)) {
- state.head.comment += String.fromCharCode(len);
- }
- } while (len && copy < have);
- if (state.flags & 0x0200) {
- state.check = crc32(state.check, input, copy, next);
- }
- have -= copy;
- next += copy;
- if (len) { break inf_leave; }
- }
- else if (state.head) {
- state.head.comment = null;
- }
- state.mode = HCRC;
- /* falls through */
- case HCRC:
- if (state.flags & 0x0200) {
- //=== NEEDBITS(16); */
- while (bits < 16) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- if (hold !== (state.check & 0xffff)) {
- strm.msg = 'header crc mismatch';
- state.mode = BAD;
- break;
- }
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- }
- if (state.head) {
- state.head.hcrc = ((state.flags >> 9) & 1);
- state.head.done = true;
- }
- strm.adler = state.check = 0 /*crc32(0L, Z_NULL, 0)*/;
- state.mode = TYPE;
- break;
- case DICTID:
- //=== NEEDBITS(32); */
- while (bits < 32) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- strm.adler = state.check = ZSWAP32(hold);
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- state.mode = DICT;
- /* falls through */
- case DICT:
- if (state.havedict === 0) {
- //--- RESTORE() ---
- strm.next_out = put;
- strm.avail_out = left;
- strm.next_in = next;
- strm.avail_in = have;
- state.hold = hold;
- state.bits = bits;
- //---
- return Z_NEED_DICT;
- }
- strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
- state.mode = TYPE;
- /* falls through */
- case TYPE:
- if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }
- /* falls through */
- case TYPEDO:
- if (state.last) {
- //--- BYTEBITS() ---//
- hold >>>= bits & 7;
- bits -= bits & 7;
- //---//
- state.mode = CHECK;
- break;
- }
- //=== NEEDBITS(3); */
- while (bits < 3) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- state.last = (hold & 0x01)/*BITS(1)*/;
- //--- DROPBITS(1) ---//
- hold >>>= 1;
- bits -= 1;
- //---//
-
- switch ((hold & 0x03)/*BITS(2)*/) {
- case 0: /* stored block */
- //Tracev((stderr, "inflate: stored block%s\n",
- // state.last ? " (last)" : ""));
- state.mode = STORED;
- break;
- case 1: /* fixed block */
- fixedtables(state);
- //Tracev((stderr, "inflate: fixed codes block%s\n",
- // state.last ? " (last)" : ""));
- state.mode = LEN_; /* decode codes */
- if (flush === Z_TREES) {
- //--- DROPBITS(2) ---//
- hold >>>= 2;
- bits -= 2;
- //---//
- break inf_leave;
- }
- break;
- case 2: /* dynamic block */
- //Tracev((stderr, "inflate: dynamic codes block%s\n",
- // state.last ? " (last)" : ""));
- state.mode = TABLE;
- break;
- case 3:
- strm.msg = 'invalid block type';
- state.mode = BAD;
- }
- //--- DROPBITS(2) ---//
- hold >>>= 2;
- bits -= 2;
- //---//
- break;
- case STORED:
- //--- BYTEBITS() ---// /* go to byte boundary */
- hold >>>= bits & 7;
- bits -= bits & 7;
- //---//
- //=== NEEDBITS(32); */
- while (bits < 32) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {
- strm.msg = 'invalid stored block lengths';
- state.mode = BAD;
- break;
- }
- state.length = hold & 0xffff;
- //Tracev((stderr, "inflate: stored length %u\n",
- // state.length));
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- state.mode = COPY_;
- if (flush === Z_TREES) { break inf_leave; }
- /* falls through */
- case COPY_:
- state.mode = COPY;
- /* falls through */
- case COPY:
- copy = state.length;
- if (copy) {
- if (copy > have) { copy = have; }
- if (copy > left) { copy = left; }
- if (copy === 0) { break inf_leave; }
- //--- zmemcpy(put, next, copy); ---
- utils.arraySet(output, input, next, copy, put);
- //---//
- have -= copy;
- next += copy;
- left -= copy;
- put += copy;
- state.length -= copy;
- break;
- }
- //Tracev((stderr, "inflate: stored end\n"));
- state.mode = TYPE;
- break;
- case TABLE:
- //=== NEEDBITS(14); */
- while (bits < 14) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;
- //--- DROPBITS(5) ---//
- hold >>>= 5;
- bits -= 5;
- //---//
- state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;
- //--- DROPBITS(5) ---//
- hold >>>= 5;
- bits -= 5;
- //---//
- state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;
- //--- DROPBITS(4) ---//
- hold >>>= 4;
- bits -= 4;
- //---//
- //#ifndef PKZIP_BUG_WORKAROUND
- if (state.nlen > 286 || state.ndist > 30) {
- strm.msg = 'too many length or distance symbols';
- state.mode = BAD;
- break;
- }
- //#endif
- //Tracev((stderr, "inflate: table sizes ok\n"));
- state.have = 0;
- state.mode = LENLENS;
- /* falls through */
- case LENLENS:
- while (state.have < state.ncode) {
- //=== NEEDBITS(3);
- while (bits < 3) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);
- //--- DROPBITS(3) ---//
- hold >>>= 3;
- bits -= 3;
- //---//
- }
- while (state.have < 19) {
- state.lens[order[state.have++]] = 0;
- }
- // We have separate tables & no pointers. 2 commented lines below not needed.
- //state.next = state.codes;
- //state.lencode = state.next;
- // Switch to use dynamic table
- state.lencode = state.lendyn;
- state.lenbits = 7;
-
- opts = {bits: state.lenbits};
- ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
- state.lenbits = opts.bits;
-
- if (ret) {
- strm.msg = 'invalid code lengths set';
- state.mode = BAD;
- break;
- }
- //Tracev((stderr, "inflate: code lengths ok\n"));
- state.have = 0;
- state.mode = CODELENS;
- /* falls through */
- case CODELENS:
- while (state.have < state.nlen + state.ndist) {
- for (;;) {
- here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/
- here_bits = here >>> 24;
- here_op = (here >>> 16) & 0xff;
- here_val = here & 0xffff;
-
- if ((here_bits) <= bits) { break; }
- //--- PULLBYTE() ---//
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- //---//
- }
- if (here_val < 16) {
- //--- DROPBITS(here.bits) ---//
- hold >>>= here_bits;
- bits -= here_bits;
- //---//
- state.lens[state.have++] = here_val;
- }
- else {
- if (here_val === 16) {
- //=== NEEDBITS(here.bits + 2);
- n = here_bits + 2;
- while (bits < n) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- //--- DROPBITS(here.bits) ---//
- hold >>>= here_bits;
- bits -= here_bits;
- //---//
- if (state.have === 0) {
- strm.msg = 'invalid bit length repeat';
- state.mode = BAD;
- break;
- }
- len = state.lens[state.have - 1];
- copy = 3 + (hold & 0x03);//BITS(2);
- //--- DROPBITS(2) ---//
- hold >>>= 2;
- bits -= 2;
- //---//
- }
- else if (here_val === 17) {
- //=== NEEDBITS(here.bits + 3);
- n = here_bits + 3;
- while (bits < n) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- //--- DROPBITS(here.bits) ---//
- hold >>>= here_bits;
- bits -= here_bits;
- //---//
- len = 0;
- copy = 3 + (hold & 0x07);//BITS(3);
- //--- DROPBITS(3) ---//
- hold >>>= 3;
- bits -= 3;
- //---//
- }
- else {
- //=== NEEDBITS(here.bits + 7);
- n = here_bits + 7;
- while (bits < n) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- //--- DROPBITS(here.bits) ---//
- hold >>>= here_bits;
- bits -= here_bits;
- //---//
- len = 0;
- copy = 11 + (hold & 0x7f);//BITS(7);
- //--- DROPBITS(7) ---//
- hold >>>= 7;
- bits -= 7;
- //---//
- }
- if (state.have + copy > state.nlen + state.ndist) {
- strm.msg = 'invalid bit length repeat';
- state.mode = BAD;
- break;
- }
- while (copy--) {
- state.lens[state.have++] = len;
- }
- }
- }
-
- /* handle error breaks in while */
- if (state.mode === BAD) { break; }
-
- /* check for end-of-block code (better have one) */
- if (state.lens[256] === 0) {
- strm.msg = 'invalid code -- missing end-of-block';
- state.mode = BAD;
- break;
- }
-
- /* build code tables -- note: do not change the lenbits or distbits
- values here (9 and 6) without reading the comments in inftrees.h
- concerning the ENOUGH constants, which depend on those values */
- state.lenbits = 9;
-
- opts = {bits: state.lenbits};
- ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
- // We have separate tables & no pointers. 2 commented lines below not needed.
- // state.next_index = opts.table_index;
- state.lenbits = opts.bits;
- // state.lencode = state.next;
-
- if (ret) {
- strm.msg = 'invalid literal/lengths set';
- state.mode = BAD;
- break;
- }
-
- state.distbits = 6;
- //state.distcode.copy(state.codes);
- // Switch to use dynamic table
- state.distcode = state.distdyn;
- opts = {bits: state.distbits};
- ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
- // We have separate tables & no pointers. 2 commented lines below not needed.
- // state.next_index = opts.table_index;
- state.distbits = opts.bits;
- // state.distcode = state.next;
-
- if (ret) {
- strm.msg = 'invalid distances set';
- state.mode = BAD;
- break;
- }
- //Tracev((stderr, 'inflate: codes ok\n'));
- state.mode = LEN_;
- if (flush === Z_TREES) { break inf_leave; }
- /* falls through */
- case LEN_:
- state.mode = LEN;
- /* falls through */
- case LEN:
- if (have >= 6 && left >= 258) {
- //--- RESTORE() ---
- strm.next_out = put;
- strm.avail_out = left;
- strm.next_in = next;
- strm.avail_in = have;
- state.hold = hold;
- state.bits = bits;
- //---
- inflate_fast(strm, _out);
- //--- LOAD() ---
- put = strm.next_out;
- output = strm.output;
- left = strm.avail_out;
- next = strm.next_in;
- input = strm.input;
- have = strm.avail_in;
- hold = state.hold;
- bits = state.bits;
- //---
-
- if (state.mode === TYPE) {
- state.back = -1;
- }
- break;
- }
- state.back = 0;
- for (;;) {
- here = state.lencode[hold & ((1 << state.lenbits) -1)]; /*BITS(state.lenbits)*/
- here_bits = here >>> 24;
- here_op = (here >>> 16) & 0xff;
- here_val = here & 0xffff;
-
- if (here_bits <= bits) { break; }
- //--- PULLBYTE() ---//
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- //---//
- }
- if (here_op && (here_op & 0xf0) === 0) {
- last_bits = here_bits;
- last_op = here_op;
- last_val = here_val;
- for (;;) {
- here = state.lencode[last_val +
- ((hold & ((1 << (last_bits + last_op)) -1))/*BITS(last.bits + last.op)*/ >> last_bits)];
- here_bits = here >>> 24;
- here_op = (here >>> 16) & 0xff;
- here_val = here & 0xffff;
-
- if ((last_bits + here_bits) <= bits) { break; }
- //--- PULLBYTE() ---//
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- //---//
- }
- //--- DROPBITS(last.bits) ---//
- hold >>>= last_bits;
- bits -= last_bits;
- //---//
- state.back += last_bits;
- }
- //--- DROPBITS(here.bits) ---//
- hold >>>= here_bits;
- bits -= here_bits;
- //---//
- state.back += here_bits;
- state.length = here_val;
- if (here_op === 0) {
- //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
- // "inflate: literal '%c'\n" :
- // "inflate: literal 0x%02x\n", here.val));
- state.mode = LIT;
- break;
- }
- if (here_op & 32) {
- //Tracevv((stderr, "inflate: end of block\n"));
- state.back = -1;
- state.mode = TYPE;
- break;
- }
- if (here_op & 64) {
- strm.msg = 'invalid literal/length code';
- state.mode = BAD;
- break;
- }
- state.extra = here_op & 15;
- state.mode = LENEXT;
- /* falls through */
- case LENEXT:
- if (state.extra) {
- //=== NEEDBITS(state.extra);
- n = state.extra;
- while (bits < n) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- state.length += hold & ((1 << state.extra) -1)/*BITS(state.extra)*/;
- //--- DROPBITS(state.extra) ---//
- hold >>>= state.extra;
- bits -= state.extra;
- //---//
- state.back += state.extra;
- }
- //Tracevv((stderr, "inflate: length %u\n", state.length));
- state.was = state.length;
- state.mode = DIST;
- /* falls through */
- case DIST:
- for (;;) {
- here = state.distcode[hold & ((1 << state.distbits) -1)];/*BITS(state.distbits)*/
- here_bits = here >>> 24;
- here_op = (here >>> 16) & 0xff;
- here_val = here & 0xffff;
-
- if ((here_bits) <= bits) { break; }
- //--- PULLBYTE() ---//
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- //---//
- }
- if ((here_op & 0xf0) === 0) {
- last_bits = here_bits;
- last_op = here_op;
- last_val = here_val;
- for (;;) {
- here = state.distcode[last_val +
- ((hold & ((1 << (last_bits + last_op)) -1))/*BITS(last.bits + last.op)*/ >> last_bits)];
- here_bits = here >>> 24;
- here_op = (here >>> 16) & 0xff;
- here_val = here & 0xffff;
-
- if ((last_bits + here_bits) <= bits) { break; }
- //--- PULLBYTE() ---//
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- //---//
- }
- //--- DROPBITS(last.bits) ---//
- hold >>>= last_bits;
- bits -= last_bits;
- //---//
- state.back += last_bits;
- }
- //--- DROPBITS(here.bits) ---//
- hold >>>= here_bits;
- bits -= here_bits;
- //---//
- state.back += here_bits;
- if (here_op & 64) {
- strm.msg = 'invalid distance code';
- state.mode = BAD;
- break;
- }
- state.offset = here_val;
- state.extra = (here_op) & 15;
- state.mode = DISTEXT;
- /* falls through */
- case DISTEXT:
- if (state.extra) {
- //=== NEEDBITS(state.extra);
- n = state.extra;
- while (bits < n) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- state.offset += hold & ((1 << state.extra) -1)/*BITS(state.extra)*/;
- //--- DROPBITS(state.extra) ---//
- hold >>>= state.extra;
- bits -= state.extra;
- //---//
- state.back += state.extra;
- }
- //#ifdef INFLATE_STRICT
- if (state.offset > state.dmax) {
- strm.msg = 'invalid distance too far back';
- state.mode = BAD;
- break;
- }
- //#endif
- //Tracevv((stderr, "inflate: distance %u\n", state.offset));
- state.mode = MATCH;
- /* falls through */
- case MATCH:
- if (left === 0) { break inf_leave; }
- copy = _out - left;
- if (state.offset > copy) { /* copy from window */
- copy = state.offset - copy;
- if (copy > state.whave) {
- if (state.sane) {
- strm.msg = 'invalid distance too far back';
- state.mode = BAD;
- break;
- }
- // (!) This block is disabled in zlib defailts,
- // don't enable it for binary compatibility
- //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
- // Trace((stderr, "inflate.c too far\n"));
- // copy -= state.whave;
- // if (copy > state.length) { copy = state.length; }
- // if (copy > left) { copy = left; }
- // left -= copy;
- // state.length -= copy;
- // do {
- // output[put++] = 0;
- // } while (--copy);
- // if (state.length === 0) { state.mode = LEN; }
- // break;
- //#endif
- }
- if (copy > state.wnext) {
- copy -= state.wnext;
- from = state.wsize - copy;
- }
- else {
- from = state.wnext - copy;
- }
- if (copy > state.length) { copy = state.length; }
- from_source = state.window;
- }
- else { /* copy from output */
- from_source = output;
- from = put - state.offset;
- copy = state.length;
- }
- if (copy > left) { copy = left; }
- left -= copy;
- state.length -= copy;
- do {
- output[put++] = from_source[from++];
- } while (--copy);
- if (state.length === 0) { state.mode = LEN; }
- break;
- case LIT:
- if (left === 0) { break inf_leave; }
- output[put++] = state.length;
- left--;
- state.mode = LEN;
- break;
- case CHECK:
- if (state.wrap) {
- //=== NEEDBITS(32);
- while (bits < 32) {
- if (have === 0) { break inf_leave; }
- have--;
- // Use '|' insdead of '+' to make sure that result is signed
- hold |= input[next++] << bits;
- bits += 8;
- }
- //===//
- _out -= left;
- strm.total_out += _out;
- state.total += _out;
- if (_out) {
- strm.adler = state.check =
- /*UPDATE(state.check, put - _out, _out);*/
- (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));
-
- }
- _out = left;
- // NB: crc32 stored as signed 32-bit int, ZSWAP32 returns signed too
- if ((state.flags ? hold : ZSWAP32(hold)) !== state.check) {
- strm.msg = 'incorrect data check';
- state.mode = BAD;
- break;
- }
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- //Tracev((stderr, "inflate: check matches trailer\n"));
- }
- state.mode = LENGTH;
- /* falls through */
- case LENGTH:
- if (state.wrap && state.flags) {
- //=== NEEDBITS(32);
- while (bits < 32) {
- if (have === 0) { break inf_leave; }
- have--;
- hold += input[next++] << bits;
- bits += 8;
- }
- //===//
- if (hold !== (state.total & 0xffffffff)) {
- strm.msg = 'incorrect length check';
- state.mode = BAD;
- break;
- }
- //=== INITBITS();
- hold = 0;
- bits = 0;
- //===//
- //Tracev((stderr, "inflate: length matches trailer\n"));
- }
- state.mode = DONE;
- /* falls through */
- case DONE:
- ret = Z_STREAM_END;
- break inf_leave;
- case BAD:
- ret = Z_DATA_ERROR;
- break inf_leave;
- case MEM:
- return Z_MEM_ERROR;
- case SYNC:
- /* falls through */
- default:
- return Z_STREAM_ERROR;
- }
- }
-
- // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave"
-
- /*
- Return from inflate(), updating the total counts and the check value.
- If there was no progress during the inflate() call, return a buffer
- error. Call updatewindow() to create and/or update the window state.
- Note: a memory error from inflate() is non-recoverable.
- */
-
- //--- RESTORE() ---
- strm.next_out = put;
- strm.avail_out = left;
- strm.next_in = next;
- strm.avail_in = have;
- state.hold = hold;
- state.bits = bits;
- //---
-
- if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
- (state.mode < CHECK || flush !== Z_FINISH))) {
- if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
- state.mode = MEM;
- return Z_MEM_ERROR;
- }
- }
- _in -= strm.avail_in;
- _out -= strm.avail_out;
- strm.total_in += _in;
- strm.total_out += _out;
- state.total += _out;
- if (state.wrap && _out) {
- strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
- (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));
- }
- strm.data_type = state.bits + (state.last ? 64 : 0) +
- (state.mode === TYPE ? 128 : 0) +
- (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
- if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {
- ret = Z_BUF_ERROR;
- }
- return ret;
- }
-
- function inflateEnd(strm) {
-
- if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {
- return Z_STREAM_ERROR;
- }
-
- var state = strm.state;
- if (state.window) {
- state.window = null;
- }
- strm.state = null;
- return Z_OK;
- }
-
- function inflateGetHeader(strm, head) {
- var state;
-
- /* check state */
- if (!strm || !strm.state) { return Z_STREAM_ERROR; }
- state = strm.state;
- if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }
-
- /* save header structure */
- state.head = head;
- head.done = false;
- return Z_OK;
- }
-
-
- exports.inflateReset = inflateReset;
- exports.inflateReset2 = inflateReset2;
- exports.inflateResetKeep = inflateResetKeep;
- exports.inflateInit = inflateInit;
- exports.inflateInit2 = inflateInit2;
- exports.inflate = inflate;
- exports.inflateEnd = inflateEnd;
- exports.inflateGetHeader = inflateGetHeader;
- exports.inflateInfo = 'pako inflate (from Nodeca project)';
-
- /* Not implemented
- exports.inflateCopy = inflateCopy;
- exports.inflateGetDictionary = inflateGetDictionary;
- exports.inflateMark = inflateMark;
- exports.inflatePrime = inflatePrime;
- exports.inflateSetDictionary = inflateSetDictionary;
- exports.inflateSync = inflateSync;
- exports.inflateSyncPoint = inflateSyncPoint;
- exports.inflateUndermine = inflateUndermine;
- */
- },{"../utils/common":27,"./adler32":29,"./crc32":31,"./inffast":34,"./inftrees":36}],36:[function(_dereq_,module,exports){
- 'use strict';
-
-
- var utils = _dereq_('../utils/common');
-
- var MAXBITS = 15;
- var ENOUGH_LENS = 852;
- var ENOUGH_DISTS = 592;
- //var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
-
- var CODES = 0;
- var LENS = 1;
- var DISTS = 2;
-
- var lbase = [ /* Length codes 257..285 base */
- 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
- 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
- ];
-
- var lext = [ /* Length codes 257..285 extra */
- 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
- 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78
- ];
-
- var dbase = [ /* Distance codes 0..29 base */
- 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
- 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
- 8193, 12289, 16385, 24577, 0, 0
- ];
-
- var dext = [ /* Distance codes 0..29 extra */
- 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
- 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
- 28, 28, 29, 29, 64, 64
- ];
-
- module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)
- {
- var bits = opts.bits;
- //here = opts.here; /* table entry for duplication */
-
- var len = 0; /* a code's length in bits */
- var sym = 0; /* index of code symbols */
- var min = 0, max = 0; /* minimum and maximum code lengths */
- var root = 0; /* number of index bits for root table */
- var curr = 0; /* number of index bits for current table */
- var drop = 0; /* code bits to drop for sub-table */
- var left = 0; /* number of prefix codes available */
- var used = 0; /* code entries in table used */
- var huff = 0; /* Huffman code */
- var incr; /* for incrementing code, index */
- var fill; /* index for replicating entries */
- var low; /* low bits for current root entry */
- var mask; /* mask for low root bits */
- var next; /* next available space in table */
- var base = null; /* base value table to use */
- var base_index = 0;
- // var shoextra; /* extra bits table to use */
- var end; /* use base and extra for symbol > end */
- var count = new utils.Buf16(MAXBITS+1); //[MAXBITS+1]; /* number of codes of each length */
- var offs = new utils.Buf16(MAXBITS+1); //[MAXBITS+1]; /* offsets in table for each length */
- var extra = null;
- var extra_index = 0;
-
- var here_bits, here_op, here_val;
-
- /*
- Process a set of code lengths to create a canonical Huffman code. The
- code lengths are lens[0..codes-1]. Each length corresponds to the
- symbols 0..codes-1. The Huffman code is generated by first sorting the
- symbols by length from short to long, and retaining the symbol order
- for codes with equal lengths. Then the code starts with all zero bits
- for the first code of the shortest length, and the codes are integer
- increments for the same length, and zeros are appended as the length
- increases. For the deflate format, these bits are stored backwards
- from their more natural integer increment ordering, and so when the
- decoding tables are built in the large loop below, the integer codes
- are incremented backwards.
-
- This routine assumes, but does not check, that all of the entries in
- lens[] are in the range 0..MAXBITS. The caller must assure this.
- 1..MAXBITS is interpreted as that code length. zero means that that
- symbol does not occur in this code.
-
- The codes are sorted by computing a count of codes for each length,
- creating from that a table of starting indices for each length in the
- sorted table, and then entering the symbols in order in the sorted
- table. The sorted table is work[], with that space being provided by
- the caller.
-
- The length counts are used for other purposes as well, i.e. finding
- the minimum and maximum length codes, determining if there are any
- codes at all, checking for a valid set of lengths, and looking ahead
- at length counts to determine sub-table sizes when building the
- decoding tables.
- */
-
- /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
- for (len = 0; len <= MAXBITS; len++) {
- count[len] = 0;
- }
- for (sym = 0; sym < codes; sym++) {
- count[lens[lens_index + sym]]++;
- }
-
- /* bound code lengths, force root to be within code lengths */
- root = bits;
- for (max = MAXBITS; max >= 1; max--) {
- if (count[max] !== 0) { break; }
- }
- if (root > max) {
- root = max;
- }
- if (max === 0) { /* no symbols to code at all */
- //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */
- //table.bits[opts.table_index] = 1; //here.bits = (var char)1;
- //table.val[opts.table_index++] = 0; //here.val = (var short)0;
- table[table_index++] = (1 << 24) | (64 << 16) | 0;
-
-
- //table.op[opts.table_index] = 64;
- //table.bits[opts.table_index] = 1;
- //table.val[opts.table_index++] = 0;
- table[table_index++] = (1 << 24) | (64 << 16) | 0;
-
- opts.bits = 1;
- return 0; /* no symbols, but wait for decoding to report error */
- }
- for (min = 1; min < max; min++) {
- if (count[min] !== 0) { break; }
- }
- if (root < min) {
- root = min;
- }
-
- /* check for an over-subscribed or incomplete set of lengths */
- left = 1;
- for (len = 1; len <= MAXBITS; len++) {
- left <<= 1;
- left -= count[len];
- if (left < 0) {
- return -1;
- } /* over-subscribed */
- }
- if (left > 0 && (type === CODES || max !== 1)) {
- return -1; /* incomplete set */
- }
-
- /* generate offsets into symbol table for each length for sorting */
- offs[1] = 0;
- for (len = 1; len < MAXBITS; len++) {
- offs[len + 1] = offs[len] + count[len];
- }
-
- /* sort symbols by length, by symbol order within each length */
- for (sym = 0; sym < codes; sym++) {
- if (lens[lens_index + sym] !== 0) {
- work[offs[lens[lens_index + sym]]++] = sym;
- }
- }
-
- /*
- Create and fill in decoding tables. In this loop, the table being
- filled is at next and has curr index bits. The code being used is huff
- with length len. That code is converted to an index by dropping drop
- bits off of the bottom. For codes where len is less than drop + curr,
- those top drop + curr - len bits are incremented through all values to
- fill the table with replicated entries.
-
- root is the number of index bits for the root table. When len exceeds
- root, sub-tables are created pointed to by the root entry with an index
- of the low root bits of huff. This is saved in low to check for when a
- new sub-table should be started. drop is zero when the root table is
- being filled, and drop is root when sub-tables are being filled.
-
- When a new sub-table is needed, it is necessary to look ahead in the
- code lengths to determine what size sub-table is needed. The length
- counts are used for this, and so count[] is decremented as codes are
- entered in the tables.
-
- used keeps track of how many table entries have been allocated from the
- provided *table space. It is checked for LENS and DIST tables against
- the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
- the initial root table size constants. See the comments in inftrees.h
- for more information.
-
- sym increments through all symbols, and the loop terminates when
- all codes of length max, i.e. all codes, have been processed. This
- routine permits incomplete codes, so another loop after this one fills
- in the rest of the decoding tables with invalid code markers.
- */
-
- /* set up for code type */
- // poor man optimization - use if-else instead of switch,
- // to avoid deopts in old v8
- if (type === CODES) {
- base = extra = work; /* dummy value--not used */
- end = 19;
- } else if (type === LENS) {
- base = lbase;
- base_index -= 257;
- extra = lext;
- extra_index -= 257;
- end = 256;
- } else { /* DISTS */
- base = dbase;
- extra = dext;
- end = -1;
- }
-
- /* initialize opts for loop */
- huff = 0; /* starting code */
- sym = 0; /* starting code symbol */
- len = min; /* starting code length */
- next = table_index; /* current table to fill in */
- curr = root; /* current table index bits */
- drop = 0; /* current bits to drop from code for index */
- low = -1; /* trigger new sub-table when len > root */
- used = 1 << root; /* use root table entries */
- mask = used - 1; /* mask for comparing low */
-
- /* check available table space */
- if ((type === LENS && used > ENOUGH_LENS) ||
- (type === DISTS && used > ENOUGH_DISTS)) {
- return 1;
- }
-
- var i=0;
- /* process all codes and make table entries */
- for (;;) {
- i++;
- /* create table entry */
- here_bits = len - drop;
- if (work[sym] < end) {
- here_op = 0;
- here_val = work[sym];
- }
- else if (work[sym] > end) {
- here_op = extra[extra_index + work[sym]];
- here_val = base[base_index + work[sym]];
- }
- else {
- here_op = 32 + 64; /* end of block */
- here_val = 0;
- }
-
- /* replicate for those indices with low len bits equal to huff */
- incr = 1 << (len - drop);
- fill = 1 << curr;
- min = fill; /* save offset to next table */
- do {
- fill -= incr;
- table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;
- } while (fill !== 0);
-
- /* backwards increment the len-bit code huff */
- incr = 1 << (len - 1);
- while (huff & incr) {
- incr >>= 1;
- }
- if (incr !== 0) {
- huff &= incr - 1;
- huff += incr;
- } else {
- huff = 0;
- }
-
- /* go to next symbol, update count, len */
- sym++;
- if (--count[len] === 0) {
- if (len === max) { break; }
- len = lens[lens_index + work[sym]];
- }
-
- /* create new sub-table if needed */
- if (len > root && (huff & mask) !== low) {
- /* if first time, transition to sub-tables */
- if (drop === 0) {
- drop = root;
- }
-
- /* increment past last table */
- next += min; /* here min is 1 << curr */
-
- /* determine length of next table */
- curr = len - drop;
- left = 1 << curr;
- while (curr + drop < max) {
- left -= count[curr + drop];
- if (left <= 0) { break; }
- curr++;
- left <<= 1;
- }
-
- /* check for enough space */
- used += 1 << curr;
- if ((type === LENS && used > ENOUGH_LENS) ||
- (type === DISTS && used > ENOUGH_DISTS)) {
- return 1;
- }
-
- /* point entry in root table to sub-table */
- low = huff & mask;
- /*table.op[low] = curr;
- table.bits[low] = root;
- table.val[low] = next - opts.table_index;*/
- table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;
- }
- }
-
- /* fill in remaining table entry if code is incomplete (guaranteed to have
- at most one remaining entry, since if the code is incomplete, the
- maximum code length that was allowed to get this far is one bit) */
- if (huff !== 0) {
- //table.op[next + huff] = 64; /* invalid code marker */
- //table.bits[next + huff] = len - drop;
- //table.val[next + huff] = 0;
- table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;
- }
-
- /* set return parameters */
- //opts.table_index += used;
- opts.bits = root;
- return 0;
- };
-
- },{"../utils/common":27}],37:[function(_dereq_,module,exports){
- 'use strict';
-
- module.exports = {
- '2': 'need dictionary', /* Z_NEED_DICT 2 */
- '1': 'stream end', /* Z_STREAM_END 1 */
- '0': '', /* Z_OK 0 */
- '-1': 'file error', /* Z_ERRNO (-1) */
- '-2': 'stream error', /* Z_STREAM_ERROR (-2) */
- '-3': 'data error', /* Z_DATA_ERROR (-3) */
- '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */
- '-5': 'buffer error', /* Z_BUF_ERROR (-5) */
- '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
- };
- },{}],38:[function(_dereq_,module,exports){
- 'use strict';
-
-
- var utils = _dereq_('../utils/common');
-
- /* Public constants ==========================================================*/
- /* ===========================================================================*/
-
-
- //var Z_FILTERED = 1;
- //var Z_HUFFMAN_ONLY = 2;
- //var Z_RLE = 3;
- var Z_FIXED = 4;
- //var Z_DEFAULT_STRATEGY = 0;
-
- /* Possible values of the data_type field (though see inflate()) */
- var Z_BINARY = 0;
- var Z_TEXT = 1;
- //var Z_ASCII = 1; // = Z_TEXT
- var Z_UNKNOWN = 2;
-
- /*============================================================================*/
-
-
- function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }
-
- // From zutil.h
-
- var STORED_BLOCK = 0;
- var STATIC_TREES = 1;
- var DYN_TREES = 2;
- /* The three kinds of block type */
-
- var MIN_MATCH = 3;
- var MAX_MATCH = 258;
- /* The minimum and maximum match lengths */
-
- // From deflate.h
- /* ===========================================================================
- * Internal compression state.
- */
-
- var LENGTH_CODES = 29;
- /* number of length codes, not counting the special END_BLOCK code */
-
- var LITERALS = 256;
- /* number of literal bytes 0..255 */
-
- var L_CODES = LITERALS + 1 + LENGTH_CODES;
- /* number of Literal or Length codes, including the END_BLOCK code */
-
- var D_CODES = 30;
- /* number of distance codes */
-
- var BL_CODES = 19;
- /* number of codes used to transfer the bit lengths */
-
- var HEAP_SIZE = 2*L_CODES + 1;
- /* maximum heap size */
-
- var MAX_BITS = 15;
- /* All codes must not exceed MAX_BITS bits */
-
- var Buf_size = 16;
- /* size of bit buffer in bi_buf */
-
-
- /* ===========================================================================
- * Constants
- */
-
- var MAX_BL_BITS = 7;
- /* Bit length codes must not exceed MAX_BL_BITS bits */
-
- var END_BLOCK = 256;
- /* end of block literal code */
-
- var REP_3_6 = 16;
- /* repeat previous bit length 3-6 times (2 bits of repeat count) */
-
- var REPZ_3_10 = 17;
- /* repeat a zero length 3-10 times (3 bits of repeat count) */
-
- var REPZ_11_138 = 18;
- /* repeat a zero length 11-138 times (7 bits of repeat count) */
-
- var extra_lbits = /* extra bits for each length code */
- [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];
-
- var extra_dbits = /* extra bits for each distance code */
- [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];
-
- var extra_blbits = /* extra bits for each bit length code */
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];
-
- var bl_order =
- [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];
- /* The lengths of the bit length codes are sent in order of decreasing
- * probability, to avoid transmitting the lengths for unused bit length codes.
- */
-
- /* ===========================================================================
- * Local data. These are initialized only once.
- */
-
- // We pre-fill arrays with 0 to avoid uninitialized gaps
-
- var DIST_CODE_LEN = 512; /* see definition of array dist_code below */
-
- // !!!! Use flat array insdead of structure, Freq = i*2, Len = i*2+1
- var static_ltree = new Array((L_CODES+2) * 2);
- zero(static_ltree);
- /* The static literal tree. Since the bit lengths are imposed, there is no
- * need for the L_CODES extra codes used during heap construction. However
- * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
- * below).
- */
-
- var static_dtree = new Array(D_CODES * 2);
- zero(static_dtree);
- /* The static distance tree. (Actually a trivial tree since all codes use
- * 5 bits.)
- */
-
- var _dist_code = new Array(DIST_CODE_LEN);
- zero(_dist_code);
- /* Distance codes. The first 256 values correspond to the distances
- * 3 .. 258, the last 256 values correspond to the top 8 bits of
- * the 15 bit distances.
- */
-
- var _length_code = new Array(MAX_MATCH-MIN_MATCH+1);
- zero(_length_code);
- /* length code for each normalized match length (0 == MIN_MATCH) */
-
- var base_length = new Array(LENGTH_CODES);
- zero(base_length);
- /* First normalized length for each code (0 = MIN_MATCH) */
-
- var base_dist = new Array(D_CODES);
- zero(base_dist);
- /* First normalized distance for each code (0 = distance of 1) */
-
-
- var StaticTreeDesc = function (static_tree, extra_bits, extra_base, elems, max_length) {
-
- this.static_tree = static_tree; /* static tree or NULL */
- this.extra_bits = extra_bits; /* extra bits for each code or NULL */
- this.extra_base = extra_base; /* base index for extra_bits */
- this.elems = elems; /* max number of elements in the tree */
- this.max_length = max_length; /* max bit length for the codes */
-
- // show if `static_tree` has data or dummy - needed for monomorphic objects
- this.has_stree = static_tree && static_tree.length;
- };
-
-
- var static_l_desc;
- var static_d_desc;
- var static_bl_desc;
-
-
- var TreeDesc = function(dyn_tree, stat_desc) {
- this.dyn_tree = dyn_tree; /* the dynamic tree */
- this.max_code = 0; /* largest code with non zero frequency */
- this.stat_desc = stat_desc; /* the corresponding static tree */
- };
-
-
-
- function d_code(dist) {
- return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
- }
-
-
- /* ===========================================================================
- * Output a short LSB first on the stream.
- * IN assertion: there is enough room in pendingBuf.
- */
- function put_short (s, w) {
- // put_byte(s, (uch)((w) & 0xff));
- // put_byte(s, (uch)((ush)(w) >> 8));
- s.pending_buf[s.pending++] = (w) & 0xff;
- s.pending_buf[s.pending++] = (w >>> 8) & 0xff;
- }
-
-
- /* ===========================================================================
- * Send a value on a given number of bits.
- * IN assertion: length <= 16 and value fits in length bits.
- */
- function send_bits(s, value, length) {
- if (s.bi_valid > (Buf_size - length)) {
- s.bi_buf |= (value << s.bi_valid) & 0xffff;
- put_short(s, s.bi_buf);
- s.bi_buf = value >> (Buf_size - s.bi_valid);
- s.bi_valid += length - Buf_size;
- } else {
- s.bi_buf |= (value << s.bi_valid) & 0xffff;
- s.bi_valid += length;
- }
- }
-
-
- function send_code(s, c, tree) {
- send_bits(s, tree[c*2]/*.Code*/, tree[c*2 + 1]/*.Len*/);
- }
-
-
- /* ===========================================================================
- * Reverse the first len bits of a code, using straightforward code (a faster
- * method would use a table)
- * IN assertion: 1 <= len <= 15
- */
- function bi_reverse(code, len) {
- var res = 0;
- do {
- res |= code & 1;
- code >>>= 1;
- res <<= 1;
- } while (--len > 0);
- return res >>> 1;
- }
-
-
- /* ===========================================================================
- * Flush the bit buffer, keeping at most 7 bits in it.
- */
- function bi_flush(s) {
- if (s.bi_valid === 16) {
- put_short(s, s.bi_buf);
- s.bi_buf = 0;
- s.bi_valid = 0;
-
- } else if (s.bi_valid >= 8) {
- s.pending_buf[s.pending++] = s.bi_buf & 0xff;
- s.bi_buf >>= 8;
- s.bi_valid -= 8;
- }
- }
-
-
- /* ===========================================================================
- * Compute the optimal bit lengths for a tree and update the total bit length
- * for the current block.
- * IN assertion: the fields freq and dad are set, heap[heap_max] and
- * above are the tree nodes sorted by increasing frequency.
- * OUT assertions: the field len is set to the optimal bit length, the
- * array bl_count contains the frequencies for each bit length.
- * The length opt_len is updated; static_len is also updated if stree is
- * not null.
- */
- function gen_bitlen(s, desc)
- // deflate_state *s;
- // tree_desc *desc; /* the tree descriptor */
- {
- var tree = desc.dyn_tree;
- var max_code = desc.max_code;
- var stree = desc.stat_desc.static_tree;
- var has_stree = desc.stat_desc.has_stree;
- var extra = desc.stat_desc.extra_bits;
- var base = desc.stat_desc.extra_base;
- var max_length = desc.stat_desc.max_length;
- var h; /* heap index */
- var n, m; /* iterate over the tree elements */
- var bits; /* bit length */
- var xbits; /* extra bits */
- var f; /* frequency */
- var overflow = 0; /* number of elements with bit length too large */
-
- for (bits = 0; bits <= MAX_BITS; bits++) {
- s.bl_count[bits] = 0;
- }
-
- /* In a first pass, compute the optimal bit lengths (which may
- * overflow in the case of the bit length tree).
- */
- tree[s.heap[s.heap_max]*2 + 1]/*.Len*/ = 0; /* root of the heap */
-
- for (h = s.heap_max+1; h < HEAP_SIZE; h++) {
- n = s.heap[h];
- bits = tree[tree[n*2 +1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;
- if (bits > max_length) {
- bits = max_length;
- overflow++;
- }
- tree[n*2 + 1]/*.Len*/ = bits;
- /* We overwrite tree[n].Dad which is no longer needed */
-
- if (n > max_code) { continue; } /* not a leaf node */
-
- s.bl_count[bits]++;
- xbits = 0;
- if (n >= base) {
- xbits = extra[n-base];
- }
- f = tree[n * 2]/*.Freq*/;
- s.opt_len += f * (bits + xbits);
- if (has_stree) {
- s.static_len += f * (stree[n*2 + 1]/*.Len*/ + xbits);
- }
- }
- if (overflow === 0) { return; }
-
- // Trace((stderr,"\nbit length overflow\n"));
- /* This happens for example on obj2 and pic of the Calgary corpus */
-
- /* Find the first bit length which could increase: */
- do {
- bits = max_length-1;
- while (s.bl_count[bits] === 0) { bits--; }
- s.bl_count[bits]--; /* move one leaf down the tree */
- s.bl_count[bits+1] += 2; /* move one overflow item as its brother */
- s.bl_count[max_length]--;
- /* The brother of the overflow item also moves one step up,
- * but this does not affect bl_count[max_length]
- */
- overflow -= 2;
- } while (overflow > 0);
-
- /* Now recompute all bit lengths, scanning in increasing frequency.
- * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
- * lengths instead of fixing only the wrong ones. This idea is taken
- * from 'ar' written by Haruhiko Okumura.)
- */
- for (bits = max_length; bits !== 0; bits--) {
- n = s.bl_count[bits];
- while (n !== 0) {
- m = s.heap[--h];
- if (m > max_code) { continue; }
- if (tree[m*2 + 1]/*.Len*/ !== bits) {
- // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
- s.opt_len += (bits - tree[m*2 + 1]/*.Len*/)*tree[m*2]/*.Freq*/;
- tree[m*2 + 1]/*.Len*/ = bits;
- }
- n--;
- }
- }
- }
-
-
- /* ===========================================================================
- * Generate the codes for a given tree and bit counts (which need not be
- * optimal).
- * IN assertion: the array bl_count contains the bit length statistics for
- * the given tree and the field len is set for all tree elements.
- * OUT assertion: the field code is set for all tree elements of non
- * zero code length.
- */
- function gen_codes(tree, max_code, bl_count)
- // ct_data *tree; /* the tree to decorate */
- // int max_code; /* largest code with non zero frequency */
- // ushf *bl_count; /* number of codes at each bit length */
- {
- var next_code = new Array(MAX_BITS+1); /* next code value for each bit length */
- var code = 0; /* running code value */
- var bits; /* bit index */
- var n; /* code index */
-
- /* The distribution counts are first used to generate the code values
- * without bit reversal.
- */
- for (bits = 1; bits <= MAX_BITS; bits++) {
- next_code[bits] = code = (code + bl_count[bits-1]) << 1;
- }
- /* Check that the bit counts in bl_count are consistent. The last code
- * must be all ones.
- */
- //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
- // "inconsistent bit counts");
- //Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
-
- for (n = 0; n <= max_code; n++) {
- var len = tree[n*2 + 1]/*.Len*/;
- if (len === 0) { continue; }
- /* Now reverse the bits */
- tree[n*2]/*.Code*/ = bi_reverse(next_code[len]++, len);
-
- //Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
- // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
- }
- }
-
-
- /* ===========================================================================
- * Initialize the various 'constant' tables.
- */
- function tr_static_init() {
- var n; /* iterates over tree elements */
- var bits; /* bit counter */
- var length; /* length value */
- var code; /* code value */
- var dist; /* distance index */
- var bl_count = new Array(MAX_BITS+1);
- /* number of codes at each bit length for an optimal tree */
-
- // do check in _tr_init()
- //if (static_init_done) return;
-
- /* For some embedded targets, global variables are not initialized: */
- /*#ifdef NO_INIT_GLOBAL_POINTERS
- static_l_desc.static_tree = static_ltree;
- static_l_desc.extra_bits = extra_lbits;
- static_d_desc.static_tree = static_dtree;
- static_d_desc.extra_bits = extra_dbits;
- static_bl_desc.extra_bits = extra_blbits;
- #endif*/
-
- /* Initialize the mapping length (0..255) -> length code (0..28) */
- length = 0;
- for (code = 0; code < LENGTH_CODES-1; code++) {
- base_length[code] = length;
- for (n = 0; n < (1<<extra_lbits[code]); n++) {
- _length_code[length++] = code;
- }
- }
- //Assert (length == 256, "tr_static_init: length != 256");
- /* Note that the length 255 (match length 258) can be represented
- * in two different ways: code 284 + 5 bits or code 285, so we
- * overwrite length_code[255] to use the best encoding:
- */
- _length_code[length-1] = code;
-
- /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
- dist = 0;
- for (code = 0 ; code < 16; code++) {
- base_dist[code] = dist;
- for (n = 0; n < (1<<extra_dbits[code]); n++) {
- _dist_code[dist++] = code;
- }
- }
- //Assert (dist == 256, "tr_static_init: dist != 256");
- dist >>= 7; /* from now on, all distances are divided by 128 */
- for ( ; code < D_CODES; code++) {
- base_dist[code] = dist << 7;
- for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
- _dist_code[256 + dist++] = code;
- }
- }
- //Assert (dist == 256, "tr_static_init: 256+dist != 512");
-
- /* Construct the codes of the static literal tree */
- for (bits = 0; bits <= MAX_BITS; bits++) {
- bl_count[bits] = 0;
- }
-
- n = 0;
- while (n <= 143) {
- static_ltree[n*2 + 1]/*.Len*/ = 8;
- n++;
- bl_count[8]++;
- }
- while (n <= 255) {
- static_ltree[n*2 + 1]/*.Len*/ = 9;
- n++;
- bl_count[9]++;
- }
- while (n <= 279) {
- static_ltree[n*2 + 1]/*.Len*/ = 7;
- n++;
- bl_count[7]++;
- }
- while (n <= 287) {
- static_ltree[n*2 + 1]/*.Len*/ = 8;
- n++;
- bl_count[8]++;
- }
- /* Codes 286 and 287 do not exist, but we must include them in the
- * tree construction to get a canonical Huffman tree (longest code
- * all ones)
- */
- gen_codes(static_ltree, L_CODES+1, bl_count);
-
- /* The static distance tree is trivial: */
- for (n = 0; n < D_CODES; n++) {
- static_dtree[n*2 + 1]/*.Len*/ = 5;
- static_dtree[n*2]/*.Code*/ = bi_reverse(n, 5);
- }
-
- // Now data ready and we can init static trees
- static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS);
- static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);
- static_bl_desc =new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);
-
- //static_init_done = true;
- }
-
-
- /* ===========================================================================
- * Initialize a new block.
- */
- function init_block(s) {
- var n; /* iterates over tree elements */
-
- /* Initialize the trees. */
- for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n*2]/*.Freq*/ = 0; }
- for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n*2]/*.Freq*/ = 0; }
- for (n = 0; n < BL_CODES; n++) { s.bl_tree[n*2]/*.Freq*/ = 0; }
-
- s.dyn_ltree[END_BLOCK*2]/*.Freq*/ = 1;
- s.opt_len = s.static_len = 0;
- s.last_lit = s.matches = 0;
- }
-
-
- /* ===========================================================================
- * Flush the bit buffer and align the output on a byte boundary
- */
- function bi_windup(s)
- {
- if (s.bi_valid > 8) {
- put_short(s, s.bi_buf);
- } else if (s.bi_valid > 0) {
- //put_byte(s, (Byte)s->bi_buf);
- s.pending_buf[s.pending++] = s.bi_buf;
- }
- s.bi_buf = 0;
- s.bi_valid = 0;
- }
-
- /* ===========================================================================
- * Copy a stored block, storing first the length and its
- * one's complement if requested.
- */
- function copy_block(s, buf, len, header)
- //DeflateState *s;
- //charf *buf; /* the input data */
- //unsigned len; /* its length */
- //int header; /* true if block header must be written */
- {
- bi_windup(s); /* align on byte boundary */
-
- if (header) {
- put_short(s, len);
- put_short(s, ~len);
- }
- // while (len--) {
- // put_byte(s, *buf++);
- // }
- utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
- s.pending += len;
- }
-
- /* ===========================================================================
- * Compares to subtrees, using the tree depth as tie breaker when
- * the subtrees have equal frequency. This minimizes the worst case length.
- */
- function smaller(tree, n, m, depth) {
- var _n2 = n*2;
- var _m2 = m*2;
- return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||
- (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));
- }
-
- /* ===========================================================================
- * Restore the heap property by moving down the tree starting at node k,
- * exchanging a node with the smallest of its two sons if necessary, stopping
- * when the heap property is re-established (each father smaller than its
- * two sons).
- */
- function pqdownheap(s, tree, k)
- // deflate_state *s;
- // ct_data *tree; /* the tree to restore */
- // int k; /* node to move down */
- {
- var v = s.heap[k];
- var j = k << 1; /* left son of k */
- while (j <= s.heap_len) {
- /* Set j to the smallest of the two sons: */
- if (j < s.heap_len &&
- smaller(tree, s.heap[j+1], s.heap[j], s.depth)) {
- j++;
- }
- /* Exit if v is smaller than both sons */
- if (smaller(tree, v, s.heap[j], s.depth)) { break; }
-
- /* Exchange v with the smallest son */
- s.heap[k] = s.heap[j];
- k = j;
-
- /* And continue down the tree, setting j to the left son of k */
- j <<= 1;
- }
- s.heap[k] = v;
- }
-
-
- // inlined manually
- // var SMALLEST = 1;
-
- /* ===========================================================================
- * Send the block data compressed using the given Huffman trees
- */
- function compress_block(s, ltree, dtree)
- // deflate_state *s;
- // const ct_data *ltree; /* literal tree */
- // const ct_data *dtree; /* distance tree */
- {
- var dist; /* distance of matched string */
- var lc; /* match length or unmatched char (if dist == 0) */
- var lx = 0; /* running index in l_buf */
- var code; /* the code to send */
- var extra; /* number of extra bits to send */
-
- if (s.last_lit !== 0) {
- do {
- dist = (s.pending_buf[s.d_buf + lx*2] << 8) | (s.pending_buf[s.d_buf + lx*2 + 1]);
- lc = s.pending_buf[s.l_buf + lx];
- lx++;
-
- if (dist === 0) {
- send_code(s, lc, ltree); /* send a literal byte */
- //Tracecv(isgraph(lc), (stderr," '%c' ", lc));
- } else {
- /* Here, lc is the match length - MIN_MATCH */
- code = _length_code[lc];
- send_code(s, code+LITERALS+1, ltree); /* send the length code */
- extra = extra_lbits[code];
- if (extra !== 0) {
- lc -= base_length[code];
- send_bits(s, lc, extra); /* send the extra length bits */
- }
- dist--; /* dist is now the match distance - 1 */
- code = d_code(dist);
- //Assert (code < D_CODES, "bad d_code");
-
- send_code(s, code, dtree); /* send the distance code */
- extra = extra_dbits[code];
- if (extra !== 0) {
- dist -= base_dist[code];
- send_bits(s, dist, extra); /* send the extra distance bits */
- }
- } /* literal or match pair ? */
-
- /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
- //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
- // "pendingBuf overflow");
-
- } while (lx < s.last_lit);
- }
-
- send_code(s, END_BLOCK, ltree);
- }
-
-
- /* ===========================================================================
- * Construct one Huffman tree and assigns the code bit strings and lengths.
- * Update the total bit length for the current block.
- * IN assertion: the field freq is set for all tree elements.
- * OUT assertions: the fields len and code are set to the optimal bit length
- * and corresponding code. The length opt_len is updated; static_len is
- * also updated if stree is not null. The field max_code is set.
- */
- function build_tree(s, desc)
- // deflate_state *s;
- // tree_desc *desc; /* the tree descriptor */
- {
- var tree = desc.dyn_tree;
- var stree = desc.stat_desc.static_tree;
- var has_stree = desc.stat_desc.has_stree;
- var elems = desc.stat_desc.elems;
- var n, m; /* iterate over heap elements */
- var max_code = -1; /* largest code with non zero frequency */
- var node; /* new node being created */
-
- /* Construct the initial heap, with least frequent element in
- * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
- * heap[0] is not used.
- */
- s.heap_len = 0;
- s.heap_max = HEAP_SIZE;
-
- for (n = 0; n < elems; n++) {
- if (tree[n * 2]/*.Freq*/ !== 0) {
- s.heap[++s.heap_len] = max_code = n;
- s.depth[n] = 0;
-
- } else {
- tree[n*2 + 1]/*.Len*/ = 0;
- }
- }
-
- /* The pkzip format requires that at least one distance code exists,
- * and that at least one bit should be sent even if there is only one
- * possible code. So to avoid special checks later on we force at least
- * two codes of non zero frequency.
- */
- while (s.heap_len < 2) {
- node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);
- tree[node * 2]/*.Freq*/ = 1;
- s.depth[node] = 0;
- s.opt_len--;
-
- if (has_stree) {
- s.static_len -= stree[node*2 + 1]/*.Len*/;
- }
- /* node is 0 or 1 so it does not have extra bits */
- }
- desc.max_code = max_code;
-
- /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
- * establish sub-heaps of increasing lengths:
- */
- for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }
-
- /* Construct the Huffman tree by repeatedly combining the least two
- * frequent nodes.
- */
- node = elems; /* next internal node of the tree */
- do {
- //pqremove(s, tree, n); /* n = node of least frequency */
- /*** pqremove ***/
- n = s.heap[1/*SMALLEST*/];
- s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];
- pqdownheap(s, tree, 1/*SMALLEST*/);
- /***/
-
- m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */
-
- s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */
- s.heap[--s.heap_max] = m;
-
- /* Create a new node father of n and m */
- tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;
- s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
- tree[n*2 + 1]/*.Dad*/ = tree[m*2 + 1]/*.Dad*/ = node;
-
- /* and insert the new node in the heap */
- s.heap[1/*SMALLEST*/] = node++;
- pqdownheap(s, tree, 1/*SMALLEST*/);
-
- } while (s.heap_len >= 2);
-
- s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];
-
- /* At this point, the fields freq and dad are set. We can now
- * generate the bit lengths.
- */
- gen_bitlen(s, desc);
-
- /* The field len is now set, we can generate the bit codes */
- gen_codes(tree, max_code, s.bl_count);
- }
-
-
- /* ===========================================================================
- * Scan a literal or distance tree to determine the frequencies of the codes
- * in the bit length tree.
- */
- function scan_tree(s, tree, max_code)
- // deflate_state *s;
- // ct_data *tree; /* the tree to be scanned */
- // int max_code; /* and its largest code of non zero frequency */
- {
- var n; /* iterates over all tree elements */
- var prevlen = -1; /* last emitted length */
- var curlen; /* length of current code */
-
- var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */
-
- var count = 0; /* repeat count of the current code */
- var max_count = 7; /* max repeat count */
- var min_count = 4; /* min repeat count */
-
- if (nextlen === 0) {
- max_count = 138;
- min_count = 3;
- }
- tree[(max_code+1)*2 + 1]/*.Len*/ = 0xffff; /* guard */
-
- for (n = 0; n <= max_code; n++) {
- curlen = nextlen;
- nextlen = tree[(n+1)*2 + 1]/*.Len*/;
-
- if (++count < max_count && curlen === nextlen) {
- continue;
-
- } else if (count < min_count) {
- s.bl_tree[curlen * 2]/*.Freq*/ += count;
-
- } else if (curlen !== 0) {
-
- if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }
- s.bl_tree[REP_3_6*2]/*.Freq*/++;
-
- } else if (count <= 10) {
- s.bl_tree[REPZ_3_10*2]/*.Freq*/++;
-
- } else {
- s.bl_tree[REPZ_11_138*2]/*.Freq*/++;
- }
-
- count = 0;
- prevlen = curlen;
-
- if (nextlen === 0) {
- max_count = 138;
- min_count = 3;
-
- } else if (curlen === nextlen) {
- max_count = 6;
- min_count = 3;
-
- } else {
- max_count = 7;
- min_count = 4;
- }
- }
- }
-
-
- /* ===========================================================================
- * Send a literal or distance tree in compressed form, using the codes in
- * bl_tree.
- */
- function send_tree(s, tree, max_code)
- // deflate_state *s;
- // ct_data *tree; /* the tree to be scanned */
- // int max_code; /* and its largest code of non zero frequency */
- {
- var n; /* iterates over all tree elements */
- var prevlen = -1; /* last emitted length */
- var curlen; /* length of current code */
-
- var nextlen = tree[0*2 + 1]/*.Len*/; /* length of next code */
-
- var count = 0; /* repeat count of the current code */
- var max_count = 7; /* max repeat count */
- var min_count = 4; /* min repeat count */
-
- /* tree[max_code+1].Len = -1; */ /* guard already set */
- if (nextlen === 0) {
- max_count = 138;
- min_count = 3;
- }
-
- for (n = 0; n <= max_code; n++) {
- curlen = nextlen;
- nextlen = tree[(n+1)*2 + 1]/*.Len*/;
-
- if (++count < max_count && curlen === nextlen) {
- continue;
-
- } else if (count < min_count) {
- do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);
-
- } else if (curlen !== 0) {
- if (curlen !== prevlen) {
- send_code(s, curlen, s.bl_tree);
- count--;
- }
- //Assert(count >= 3 && count <= 6, " 3_6?");
- send_code(s, REP_3_6, s.bl_tree);
- send_bits(s, count-3, 2);
-
- } else if (count <= 10) {
- send_code(s, REPZ_3_10, s.bl_tree);
- send_bits(s, count-3, 3);
-
- } else {
- send_code(s, REPZ_11_138, s.bl_tree);
- send_bits(s, count-11, 7);
- }
-
- count = 0;
- prevlen = curlen;
- if (nextlen === 0) {
- max_count = 138;
- min_count = 3;
-
- } else if (curlen === nextlen) {
- max_count = 6;
- min_count = 3;
-
- } else {
- max_count = 7;
- min_count = 4;
- }
- }
- }
-
-
- /* ===========================================================================
- * Construct the Huffman tree for the bit lengths and return the index in
- * bl_order of the last bit length code to send.
- */
- function build_bl_tree(s) {
- var max_blindex; /* index of last bit length code of non zero freq */
-
- /* Determine the bit length frequencies for literal and distance trees */
- scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
- scan_tree(s, s.dyn_dtree, s.d_desc.max_code);
-
- /* Build the bit length tree: */
- build_tree(s, s.bl_desc);
- /* opt_len now includes the length of the tree representations, except
- * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
- */
-
- /* Determine the number of bit length codes to send. The pkzip format
- * requires that at least 4 bit length codes be sent. (appnote.txt says
- * 3 but the actual value used is 4.)
- */
- for (max_blindex = BL_CODES-1; max_blindex >= 3; max_blindex--) {
- if (s.bl_tree[bl_order[max_blindex]*2 + 1]/*.Len*/ !== 0) {
- break;
- }
- }
- /* Update opt_len to include the bit length tree and counts */
- s.opt_len += 3*(max_blindex+1) + 5+5+4;
- //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
- // s->opt_len, s->static_len));
-
- return max_blindex;
- }
-
-
- /* ===========================================================================
- * Send the header for a block using dynamic Huffman trees: the counts, the
- * lengths of the bit length codes, the literal tree and the distance tree.
- * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
- */
- function send_all_trees(s, lcodes, dcodes, blcodes)
- // deflate_state *s;
- // int lcodes, dcodes, blcodes; /* number of codes for each tree */
- {
- var rank; /* index in bl_order */
-
- //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
- //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
- // "too many codes");
- //Tracev((stderr, "\nbl counts: "));
- send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
- send_bits(s, dcodes-1, 5);
- send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */
- for (rank = 0; rank < blcodes; rank++) {
- //Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
- send_bits(s, s.bl_tree[bl_order[rank]*2 + 1]/*.Len*/, 3);
- }
- //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
-
- send_tree(s, s.dyn_ltree, lcodes-1); /* literal tree */
- //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
-
- send_tree(s, s.dyn_dtree, dcodes-1); /* distance tree */
- //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
- }
-
-
- /* ===========================================================================
- * Check if the data type is TEXT or BINARY, using the following algorithm:
- * - TEXT if the two conditions below are satisfied:
- * a) There are no non-portable control characters belonging to the
- * "black list" (0..6, 14..25, 28..31).
- * b) There is at least one printable character belonging to the
- * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
- * - BINARY otherwise.
- * - The following partially-portable control characters form a
- * "gray list" that is ignored in this detection algorithm:
- * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
- * IN assertion: the fields Freq of dyn_ltree are set.
- */
- function detect_data_type(s) {
- /* black_mask is the bit mask of black-listed bytes
- * set bits 0..6, 14..25, and 28..31
- * 0xf3ffc07f = binary 11110011111111111100000001111111
- */
- var black_mask = 0xf3ffc07f;
- var n;
-
- /* Check for non-textual ("black-listed") bytes. */
- for (n = 0; n <= 31; n++, black_mask >>>= 1) {
- if ((black_mask & 1) && (s.dyn_ltree[n*2]/*.Freq*/ !== 0)) {
- return Z_BINARY;
- }
- }
-
- /* Check for textual ("white-listed") bytes. */
- if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||
- s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {
- return Z_TEXT;
- }
- for (n = 32; n < LITERALS; n++) {
- if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {
- return Z_TEXT;
- }
- }
-
- /* There are no "black-listed" or "white-listed" bytes:
- * this stream either is empty or has tolerated ("gray-listed") bytes only.
- */
- return Z_BINARY;
- }
-
-
- var static_init_done = false;
-
- /* ===========================================================================
- * Initialize the tree data structures for a new zlib stream.
- */
- function _tr_init(s)
- {
-
- if (!static_init_done) {
- tr_static_init();
- static_init_done = true;
- }
-
- s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);
- s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);
- s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);
-
- s.bi_buf = 0;
- s.bi_valid = 0;
-
- /* Initialize the first block of the first file: */
- init_block(s);
- }
-
-
- /* ===========================================================================
- * Send a stored block
- */
- function _tr_stored_block(s, buf, stored_len, last)
- //DeflateState *s;
- //charf *buf; /* input block */
- //ulg stored_len; /* length of input block */
- //int last; /* one if this is the last block for a file */
- {
- send_bits(s, (STORED_BLOCK<<1)+(last ? 1 : 0), 3); /* send block type */
- copy_block(s, buf, stored_len, true); /* with header */
- }
-
-
- /* ===========================================================================
- * Send one empty static block to give enough lookahead for inflate.
- * This takes 10 bits, of which 7 may remain in the bit buffer.
- */
- function _tr_align(s) {
- send_bits(s, STATIC_TREES<<1, 3);
- send_code(s, END_BLOCK, static_ltree);
- bi_flush(s);
- }
-
-
- /* ===========================================================================
- * Determine the best encoding for the current block: dynamic trees, static
- * trees or store, and output the encoded block to the zip file.
- */
- function _tr_flush_block(s, buf, stored_len, last)
- //DeflateState *s;
- //charf *buf; /* input block, or NULL if too old */
- //ulg stored_len; /* length of input block */
- //int last; /* one if this is the last block for a file */
- {
- var opt_lenb, static_lenb; /* opt_len and static_len in bytes */
- var max_blindex = 0; /* index of last bit length code of non zero freq */
-
- /* Build the Huffman trees unless a stored block is forced */
- if (s.level > 0) {
-
- /* Check if the file is binary or text */
- if (s.strm.data_type === Z_UNKNOWN) {
- s.strm.data_type = detect_data_type(s);
- }
-
- /* Construct the literal and distance trees */
- build_tree(s, s.l_desc);
- // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
- // s->static_len));
-
- build_tree(s, s.d_desc);
- // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
- // s->static_len));
- /* At this point, opt_len and static_len are the total bit lengths of
- * the compressed block data, excluding the tree representations.
- */
-
- /* Build the bit length tree for the above two trees, and get the index
- * in bl_order of the last bit length code to send.
- */
- max_blindex = build_bl_tree(s);
-
- /* Determine the best encoding. Compute the block lengths in bytes. */
- opt_lenb = (s.opt_len+3+7) >>> 3;
- static_lenb = (s.static_len+3+7) >>> 3;
-
- // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
- // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
- // s->last_lit));
-
- if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }
-
- } else {
- // Assert(buf != (char*)0, "lost buf");
- opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
- }
-
- if ((stored_len+4 <= opt_lenb) && (buf !== -1)) {
- /* 4: two words for the lengths */
-
- /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
- * Otherwise we can't have processed more than WSIZE input bytes since
- * the last block flush, because compression would have been
- * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
- * transform a block into a stored block.
- */
- _tr_stored_block(s, buf, stored_len, last);
-
- } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {
-
- send_bits(s, (STATIC_TREES<<1) + (last ? 1 : 0), 3);
- compress_block(s, static_ltree, static_dtree);
-
- } else {
- send_bits(s, (DYN_TREES<<1) + (last ? 1 : 0), 3);
- send_all_trees(s, s.l_desc.max_code+1, s.d_desc.max_code+1, max_blindex+1);
- compress_block(s, s.dyn_ltree, s.dyn_dtree);
- }
- // Assert (s->compressed_len == s->bits_sent, "bad compressed size");
- /* The above check is made mod 2^32, for files larger than 512 MB
- * and uLong implemented on 32 bits.
- */
- init_block(s);
-
- if (last) {
- bi_windup(s);
- }
- // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
- // s->compressed_len-7*last));
- }
-
- /* ===========================================================================
- * Save the match info and tally the frequency counts. Return true if
- * the current block must be flushed.
- */
- function _tr_tally(s, dist, lc)
- // deflate_state *s;
- // unsigned dist; /* distance of matched string */
- // unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
- {
- //var out_length, in_length, dcode;
-
- s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;
- s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;
-
- s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;
- s.last_lit++;
-
- if (dist === 0) {
- /* lc is the unmatched char */
- s.dyn_ltree[lc*2]/*.Freq*/++;
- } else {
- s.matches++;
- /* Here, lc is the match length - MIN_MATCH */
- dist--; /* dist = match distance - 1 */
- //Assert((ush)dist < (ush)MAX_DIST(s) &&
- // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
- // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
-
- s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;
- s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;
- }
-
- // (!) This block is disabled in zlib defailts,
- // don't enable it for binary compatibility
-
- //#ifdef TRUNCATE_BLOCK
- // /* Try to guess if it is profitable to stop the current block here */
- // if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {
- // /* Compute an upper bound for the compressed length */
- // out_length = s.last_lit*8;
- // in_length = s.strstart - s.block_start;
- //
- // for (dcode = 0; dcode < D_CODES; dcode++) {
- // out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);
- // }
- // out_length >>>= 3;
- // //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
- // // s->last_lit, in_length, out_length,
- // // 100L - out_length*100L/in_length));
- // if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {
- // return true;
- // }
- // }
- //#endif
-
- return (s.last_lit === s.lit_bufsize-1);
- /* We avoid equality with lit_bufsize because of wraparound at 64K
- * on 16 bit machines and because stored blocks are restricted to
- * 64K-1 bytes.
- */
- }
-
- exports._tr_init = _tr_init;
- exports._tr_stored_block = _tr_stored_block;
- exports._tr_flush_block = _tr_flush_block;
- exports._tr_tally = _tr_tally;
- exports._tr_align = _tr_align;
- },{"../utils/common":27}],39:[function(_dereq_,module,exports){
- 'use strict';
-
-
- function ZStream() {
- /* next input byte */
- this.input = null; // JS specific, because we have no pointers
- this.next_in = 0;
- /* number of bytes available at input */
- this.avail_in = 0;
- /* total number of input bytes read so far */
- this.total_in = 0;
- /* next output byte should be put there */
- this.output = null; // JS specific, because we have no pointers
- this.next_out = 0;
- /* remaining free space at output */
- this.avail_out = 0;
- /* total number of bytes output so far */
- this.total_out = 0;
- /* last error message, NULL if no error */
- this.msg = ''/*Z_NULL*/;
- /* not visible by applications */
- this.state = null;
- /* best guess about the data type: binary or text */
- this.data_type = 2/*Z_UNKNOWN*/;
- /* adler32 value of the uncompressed data */
- this.adler = 0;
- }
-
- module.exports = ZStream;
- },{}]},{},[9])
- (9)
- }));
-
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
-
- /***/ }),
-
- /***/ "./node_modules/xlsx/xlsx.js":
- /*!***********************************!*\
- !*** ./node_modules/xlsx/xlsx.js ***!
- \***********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function(global, Buffer, process) {/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
- /* vim: set ts=2: */
- /*exported XLSX */
- /*global global, exports, module, require:false, process:false, Buffer:false, ArrayBuffer:false */
- var XLSX = {};
- function make_xlsx_lib(XLSX){
- XLSX.version = '0.15.2';
- var current_codepage = 1200, current_ansi = 1252;
- /*global cptable:true, window */
- if(true) {
- if(typeof cptable === 'undefined') {
- if(typeof global !== 'undefined') global.cptable = __webpack_require__(/*! ./dist/cpexcel.js */ "./node_modules/xlsx/dist/cpexcel.js");
- else if(typeof window !== 'undefined') window.cptable = __webpack_require__(/*! ./dist/cpexcel.js */ "./node_modules/xlsx/dist/cpexcel.js");
- }
- }
-
- var VALID_ANSI = [ 874, 932, 936, 949, 950 ];
- for(var i = 0; i <= 8; ++i) VALID_ANSI.push(1250 + i);
- /* ECMA-376 Part I 18.4.1 charset to codepage mapping */
- var CS2CP = ({
- 0: 1252, /* ANSI */
- 1: 65001, /* DEFAULT */
- 2: 65001, /* SYMBOL */
- 77: 10000, /* MAC */
- 128: 932, /* SHIFTJIS */
- 129: 949, /* HANGUL */
- 130: 1361, /* JOHAB */
- 134: 936, /* GB2312 */
- 136: 950, /* CHINESEBIG5 */
- 161: 1253, /* GREEK */
- 162: 1254, /* TURKISH */
- 163: 1258, /* VIETNAMESE */
- 177: 1255, /* HEBREW */
- 178: 1256, /* ARABIC */
- 186: 1257, /* BALTIC */
- 204: 1251, /* RUSSIAN */
- 222: 874, /* THAI */
- 238: 1250, /* EASTEUROPE */
- 255: 1252, /* OEM */
- 69: 6969 /* MISC */
- });
-
- var set_ansi = function(cp) { if(VALID_ANSI.indexOf(cp) == -1) return; current_ansi = CS2CP[0] = cp; };
- function reset_ansi() { set_ansi(1252); }
-
- var set_cp = function(cp) { current_codepage = cp; set_ansi(cp); };
- function reset_cp() { set_cp(1200); reset_ansi(); }
-
- function char_codes(data) { var o = []; for(var i = 0, len = data.length; i < len; ++i) o[i] = data.charCodeAt(i); return o; }
-
- function utf16leread(data) {
- var o = [];
- for(var i = 0; i < (data.length>>1); ++i) o[i] = String.fromCharCode(data.charCodeAt(2*i) + (data.charCodeAt(2*i+1)<<8));
- return o.join("");
- }
- function utf16beread(data) {
- var o = [];
- for(var i = 0; i < (data.length>>1); ++i) o[i] = String.fromCharCode(data.charCodeAt(2*i+1) + (data.charCodeAt(2*i)<<8));
- return o.join("");
- }
-
- var debom = function(data) {
- var c1 = data.charCodeAt(0), c2 = data.charCodeAt(1);
- if(c1 == 0xFF && c2 == 0xFE) return utf16leread(data.slice(2));
- if(c1 == 0xFE && c2 == 0xFF) return utf16beread(data.slice(2));
- if(c1 == 0xFEFF) return data.slice(1);
- return data;
- };
-
- var _getchar = function _gc1(x) { return String.fromCharCode(x); };
- var _getansi = function _ga1(x) { return String.fromCharCode(x); };
- if(typeof cptable !== 'undefined') {
- set_cp = function(cp) { current_codepage = cp; set_ansi(cp); };
- debom = function(data) {
- if(data.charCodeAt(0) === 0xFF && data.charCodeAt(1) === 0xFE) { return cptable.utils.decode(1200, char_codes(data.slice(2))); }
- return data;
- };
- _getchar = function _gc2(x) {
- if(current_codepage === 1200) return String.fromCharCode(x);
- return cptable.utils.decode(current_codepage, [x&255,x>>8])[0];
- };
- _getansi = function _ga2(x) {
- return cptable.utils.decode(current_ansi, [x])[0];
- };
- }
- var DENSE = null;
- var DIF_XL = true;
- var Base64 = (function make_b64(){
- var map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
- return {
- encode: function(input) {
- var o = "";
- var c1=0, c2=0, c3=0, e1=0, e2=0, e3=0, e4=0;
- for(var i = 0; i < input.length; ) {
- c1 = input.charCodeAt(i++);
- e1 = (c1 >> 2);
-
- c2 = input.charCodeAt(i++);
- e2 = ((c1 & 3) << 4) | (c2 >> 4);
-
- c3 = input.charCodeAt(i++);
- e3 = ((c2 & 15) << 2) | (c3 >> 6);
- e4 = (c3 & 63);
- if (isNaN(c2)) { e3 = e4 = 64; }
- else if (isNaN(c3)) { e4 = 64; }
- o += map.charAt(e1) + map.charAt(e2) + map.charAt(e3) + map.charAt(e4);
- }
- return o;
- },
- decode: function b64_decode(input) {
- var o = "";
- var c1=0, c2=0, c3=0, e1=0, e2=0, e3=0, e4=0;
- input = input.replace(/[^\w\+\/\=]/g, "");
- for(var i = 0; i < input.length;) {
- e1 = map.indexOf(input.charAt(i++));
- e2 = map.indexOf(input.charAt(i++));
- c1 = (e1 << 2) | (e2 >> 4);
- o += String.fromCharCode(c1);
-
- e3 = map.indexOf(input.charAt(i++));
- c2 = ((e2 & 15) << 4) | (e3 >> 2);
- if (e3 !== 64) { o += String.fromCharCode(c2); }
-
- e4 = map.indexOf(input.charAt(i++));
- c3 = ((e3 & 3) << 6) | e4;
- if (e4 !== 64) { o += String.fromCharCode(c3); }
- }
- return o;
- }
- };
- })();
- var has_buf = (typeof Buffer !== 'undefined' && typeof process !== 'undefined' && typeof process.versions !== 'undefined' && !!process.versions.node);
-
- var Buffer_from = function(){};
-
- if(typeof Buffer !== 'undefined') {
- var nbfs = !Buffer.from;
- if(!nbfs) try { Buffer.from("foo", "utf8"); } catch(e) { nbfs = true; }
- Buffer_from = nbfs ? function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); } : Buffer.from.bind(Buffer);
- // $FlowIgnore
- if(!Buffer.alloc) Buffer.alloc = function(n) { return new Buffer(n); };
- // $FlowIgnore
- if(!Buffer.allocUnsafe) Buffer.allocUnsafe = function(n) { return new Buffer(n); };
- }
-
- function new_raw_buf(len) {
- /* jshint -W056 */
- return has_buf ? Buffer.alloc(len) : new Array(len);
- /* jshint +W056 */
- }
-
- function new_unsafe_buf(len) {
- /* jshint -W056 */
- return has_buf ? Buffer.allocUnsafe(len) : new Array(len);
- /* jshint +W056 */
- }
-
- var s2a = function s2a(s) {
- if(has_buf) return Buffer_from(s, "binary");
- return s.split("").map(function(x){ return x.charCodeAt(0) & 0xff; });
- };
-
- function s2ab(s) {
- if(typeof ArrayBuffer === 'undefined') return s2a(s);
- var buf = new ArrayBuffer(s.length), view = new Uint8Array(buf);
- for (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
- return buf;
- }
-
- function a2s(data) {
- if(Array.isArray(data)) return data.map(function(c) { return String.fromCharCode(c); }).join("");
- var o = []; for(var i = 0; i < data.length; ++i) o[i] = String.fromCharCode(data[i]); return o.join("");
- }
-
- function a2u(data) {
- if(typeof Uint8Array === 'undefined') throw new Error("Unsupported");
- return new Uint8Array(data);
- }
-
- function ab2a(data) {
- if(typeof ArrayBuffer == 'undefined') throw new Error("Unsupported");
- if(data instanceof ArrayBuffer) return ab2a(new Uint8Array(data));
- var o = new Array(data.length);
- for(var i = 0; i < data.length; ++i) o[i] = data[i];
- return o;
- }
-
- var bconcat = function(bufs) { return [].concat.apply([], bufs); };
-
- var chr0 = /\u0000/g, chr1 = /[\u0001-\u0006]/g;
- /* ssf.js (C) 2013-present SheetJS -- http://sheetjs.com */
- /*jshint -W041 */
- var SSF = ({});
- var make_ssf = function make_ssf(SSF){
- SSF.version = '0.10.2';
- function _strrev(x) { var o = "", i = x.length-1; while(i>=0) o += x.charAt(i--); return o; }
- function fill(c,l) { var o = ""; while(o.length < l) o+=c; return o; }
- function pad0(v,d){var t=""+v; return t.length>=d?t:fill('0',d-t.length)+t;}
- function pad_(v,d){var t=""+v;return t.length>=d?t:fill(' ',d-t.length)+t;}
- function rpad_(v,d){var t=""+v; return t.length>=d?t:t+fill(' ',d-t.length);}
- function pad0r1(v,d){var t=""+Math.round(v); return t.length>=d?t:fill('0',d-t.length)+t;}
- function pad0r2(v,d){var t=""+v; return t.length>=d?t:fill('0',d-t.length)+t;}
- var p2_32 = Math.pow(2,32);
- function pad0r(v,d){if(v>p2_32||v<-p2_32) return pad0r1(v,d); var i = Math.round(v); return pad0r2(i,d); }
- function isgeneral(s, i) { i = i || 0; return s.length >= 7 + i && (s.charCodeAt(i)|32) === 103 && (s.charCodeAt(i+1)|32) === 101 && (s.charCodeAt(i+2)|32) === 110 && (s.charCodeAt(i+3)|32) === 101 && (s.charCodeAt(i+4)|32) === 114 && (s.charCodeAt(i+5)|32) === 97 && (s.charCodeAt(i+6)|32) === 108; }
- var days = [
- ['Sun', 'Sunday'],
- ['Mon', 'Monday'],
- ['Tue', 'Tuesday'],
- ['Wed', 'Wednesday'],
- ['Thu', 'Thursday'],
- ['Fri', 'Friday'],
- ['Sat', 'Saturday']
- ];
- var months = [
- ['J', 'Jan', 'January'],
- ['F', 'Feb', 'February'],
- ['M', 'Mar', 'March'],
- ['A', 'Apr', 'April'],
- ['M', 'May', 'May'],
- ['J', 'Jun', 'June'],
- ['J', 'Jul', 'July'],
- ['A', 'Aug', 'August'],
- ['S', 'Sep', 'September'],
- ['O', 'Oct', 'October'],
- ['N', 'Nov', 'November'],
- ['D', 'Dec', 'December']
- ];
- function init_table(t) {
- t[0]= 'General';
- t[1]= '0';
- t[2]= '0.00';
- t[3]= '#,##0';
- t[4]= '#,##0.00';
- t[9]= '0%';
- t[10]= '0.00%';
- t[11]= '0.00E+00';
- t[12]= '# ?/?';
- t[13]= '# ??/??';
- t[14]= 'm/d/yy';
- t[15]= 'd-mmm-yy';
- t[16]= 'd-mmm';
- t[17]= 'mmm-yy';
- t[18]= 'h:mm AM/PM';
- t[19]= 'h:mm:ss AM/PM';
- t[20]= 'h:mm';
- t[21]= 'h:mm:ss';
- t[22]= 'm/d/yy h:mm';
- t[37]= '#,##0 ;(#,##0)';
- t[38]= '#,##0 ;[Red](#,##0)';
- t[39]= '#,##0.00;(#,##0.00)';
- t[40]= '#,##0.00;[Red](#,##0.00)';
- t[45]= 'mm:ss';
- t[46]= '[h]:mm:ss';
- t[47]= 'mmss.0';
- t[48]= '##0.0E+0';
- t[49]= '@';
- t[56]= '"上午/下午 "hh"時"mm"分"ss"秒 "';
- t[65535]= 'General';
- }
-
- var table_fmt = {};
- init_table(table_fmt);
- function frac(x, D, mixed) {
- var sgn = x < 0 ? -1 : 1;
- var B = x * sgn;
- var P_2 = 0, P_1 = 1, P = 0;
- var Q_2 = 1, Q_1 = 0, Q = 0;
- var A = Math.floor(B);
- while(Q_1 < D) {
- A = Math.floor(B);
- P = A * P_1 + P_2;
- Q = A * Q_1 + Q_2;
- if((B - A) < 0.00000005) break;
- B = 1 / (B - A);
- P_2 = P_1; P_1 = P;
- Q_2 = Q_1; Q_1 = Q;
- }
- if(Q > D) { if(Q_1 > D) { Q = Q_2; P = P_2; } else { Q = Q_1; P = P_1; } }
- if(!mixed) return [0, sgn * P, Q];
- var q = Math.floor(sgn * P/Q);
- return [q, sgn*P - q*Q, Q];
- }
- function parse_date_code(v,opts,b2) {
- if(v > 2958465 || v < 0) return null;
- var date = (v|0), time = Math.floor(86400 * (v - date)), dow=0;
- var dout=[];
- var out={D:date, T:time, u:86400*(v-date)-time,y:0,m:0,d:0,H:0,M:0,S:0,q:0};
- if(Math.abs(out.u) < 1e-6) out.u = 0;
- if(opts && opts.date1904) date += 1462;
- if(out.u > 0.9999) {
- out.u = 0;
- if(++time == 86400) { out.T = time = 0; ++date; ++out.D; }
- }
- if(date === 60) {dout = b2 ? [1317,10,29] : [1900,2,29]; dow=3;}
- else if(date === 0) {dout = b2 ? [1317,8,29] : [1900,1,0]; dow=6;}
- else {
- if(date > 60) --date;
- /* 1 = Jan 1 1900 in Gregorian */
- var d = new Date(1900, 0, 1);
- d.setDate(d.getDate() + date - 1);
- dout = [d.getFullYear(), d.getMonth()+1,d.getDate()];
- dow = d.getDay();
- if(date < 60) dow = (dow + 6) % 7;
- if(b2) dow = fix_hijri(d, dout);
- }
- out.y = dout[0]; out.m = dout[1]; out.d = dout[2];
- out.S = time % 60; time = Math.floor(time / 60);
- out.M = time % 60; time = Math.floor(time / 60);
- out.H = time;
- out.q = dow;
- return out;
- }
- SSF.parse_date_code = parse_date_code;
- var basedate = new Date(1899, 11, 31, 0, 0, 0);
- var dnthresh = basedate.getTime();
- var base1904 = new Date(1900, 2, 1, 0, 0, 0);
- function datenum_local(v, date1904) {
- var epoch = v.getTime();
- if(date1904) epoch -= 1461*24*60*60*1000;
- else if(v >= base1904) epoch += 24*60*60*1000;
- return (epoch - (dnthresh + (v.getTimezoneOffset() - basedate.getTimezoneOffset()) * 60000)) / (24 * 60 * 60 * 1000);
- }
- function general_fmt_int(v) { return v.toString(10); }
- SSF._general_int = general_fmt_int;
- var general_fmt_num = (function make_general_fmt_num() {
- var gnr1 = /\.(\d*[1-9])0+$/, gnr2 = /\.0*$/, gnr4 = /\.(\d*[1-9])0+/, gnr5 = /\.0*[Ee]/, gnr6 = /(E[+-])(\d)$/;
- function gfn2(v) {
- var w = (v<0?12:11);
- var o = gfn5(v.toFixed(12)); if(o.length <= w) return o;
- o = v.toPrecision(10); if(o.length <= w) return o;
- return v.toExponential(5);
- }
- function gfn3(v) {
- var o = v.toFixed(11).replace(gnr1,".$1");
- if(o.length > (v<0?12:11)) o = v.toPrecision(6);
- return o;
- }
- function gfn4(o) {
- for(var i = 0; i != o.length; ++i) if((o.charCodeAt(i) | 0x20) === 101) return o.replace(gnr4,".$1").replace(gnr5,"E").replace("e","E").replace(gnr6,"$10$2");
- return o;
- }
- function gfn5(o) {
- return o.indexOf(".") > -1 ? o.replace(gnr2,"").replace(gnr1,".$1") : o;
- }
- return function general_fmt_num(v) {
- var V = Math.floor(Math.log(Math.abs(v))*Math.LOG10E), o;
- if(V >= -4 && V <= -1) o = v.toPrecision(10+V);
- else if(Math.abs(V) <= 9) o = gfn2(v);
- else if(V === 10) o = v.toFixed(10).substr(0,12);
- else o = gfn3(v);
- return gfn5(gfn4(o));
- };})();
- SSF._general_num = general_fmt_num;
- function general_fmt(v, opts) {
- switch(typeof v) {
- case 'string': return v;
- case 'boolean': return v ? "TRUE" : "FALSE";
- case 'number': return (v|0) === v ? general_fmt_int(v) : general_fmt_num(v);
- case 'undefined': return "";
- case 'object':
- if(v == null) return "";
- if(v instanceof Date) return format(14, datenum_local(v, opts && opts.date1904), opts);
- }
- throw new Error("unsupported value in General format: " + v);
- }
- SSF._general = general_fmt;
- function fix_hijri() { return 0; }
- /*jshint -W086 */
- function write_date(type, fmt, val, ss0) {
- var o="", ss=0, tt=0, y = val.y, out, outl = 0;
- switch(type) {
- case 98: /* 'b' buddhist year */
- y = val.y + 543;
- /* falls through */
- case 121: /* 'y' year */
- switch(fmt.length) {
- case 1: case 2: out = y % 100; outl = 2; break;
- default: out = y % 10000; outl = 4; break;
- } break;
- case 109: /* 'm' month */
- switch(fmt.length) {
- case 1: case 2: out = val.m; outl = fmt.length; break;
- case 3: return months[val.m-1][1];
- case 5: return months[val.m-1][0];
- default: return months[val.m-1][2];
- } break;
- case 100: /* 'd' day */
- switch(fmt.length) {
- case 1: case 2: out = val.d; outl = fmt.length; break;
- case 3: return days[val.q][0];
- default: return days[val.q][1];
- } break;
- case 104: /* 'h' 12-hour */
- switch(fmt.length) {
- case 1: case 2: out = 1+(val.H+11)%12; outl = fmt.length; break;
- default: throw 'bad hour format: ' + fmt;
- } break;
- case 72: /* 'H' 24-hour */
- switch(fmt.length) {
- case 1: case 2: out = val.H; outl = fmt.length; break;
- default: throw 'bad hour format: ' + fmt;
- } break;
- case 77: /* 'M' minutes */
- switch(fmt.length) {
- case 1: case 2: out = val.M; outl = fmt.length; break;
- default: throw 'bad minute format: ' + fmt;
- } break;
- case 115: /* 's' seconds */
- if(fmt != 's' && fmt != 'ss' && fmt != '.0' && fmt != '.00' && fmt != '.000') throw 'bad second format: ' + fmt;
- if(val.u === 0 && (fmt == "s" || fmt == "ss")) return pad0(val.S, fmt.length);
- if(ss0 >= 2) tt = ss0 === 3 ? 1000 : 100;
- else tt = ss0 === 1 ? 10 : 1;
- ss = Math.round((tt)*(val.S + val.u));
- if(ss >= 60*tt) ss = 0;
- if(fmt === 's') return ss === 0 ? "0" : ""+ss/tt;
- o = pad0(ss,2 + ss0);
- if(fmt === 'ss') return o.substr(0,2);
- return "." + o.substr(2,fmt.length-1);
- case 90: /* 'Z' absolute time */
- switch(fmt) {
- case '[h]': case '[hh]': out = val.D*24+val.H; break;
- case '[m]': case '[mm]': out = (val.D*24+val.H)*60+val.M; break;
- case '[s]': case '[ss]': out = ((val.D*24+val.H)*60+val.M)*60+Math.round(val.S+val.u); break;
- default: throw 'bad abstime format: ' + fmt;
- } outl = fmt.length === 3 ? 1 : 2; break;
- case 101: /* 'e' era */
- out = y; outl = 1;
- }
- if(outl > 0) return pad0(out, outl); else return "";
- }
- /*jshint +W086 */
- function commaify(s) {
- var w = 3;
- if(s.length <= w) return s;
- var j = (s.length % w), o = s.substr(0,j);
- for(; j!=s.length; j+=w) o+=(o.length > 0 ? "," : "") + s.substr(j,w);
- return o;
- }
- var write_num = (function make_write_num(){
- var pct1 = /%/g;
- function write_num_pct(type, fmt, val){
- var sfmt = fmt.replace(pct1,""), mul = fmt.length - sfmt.length;
- return write_num(type, sfmt, val * Math.pow(10,2*mul)) + fill("%",mul);
- }
- function write_num_cm(type, fmt, val){
- var idx = fmt.length - 1;
- while(fmt.charCodeAt(idx-1) === 44) --idx;
- return write_num(type, fmt.substr(0,idx), val / Math.pow(10,3*(fmt.length-idx)));
- }
- function write_num_exp(fmt, val){
- var o;
- var idx = fmt.indexOf("E") - fmt.indexOf(".") - 1;
- if(fmt.match(/^#+0.0E\+0$/)) {
- if(val == 0) return "0.0E+0";
- else if(val < 0) return "-" + write_num_exp(fmt, -val);
- var period = fmt.indexOf("."); if(period === -1) period=fmt.indexOf('E');
- var ee = Math.floor(Math.log(val)*Math.LOG10E)%period;
- if(ee < 0) ee += period;
- o = (val/Math.pow(10,ee)).toPrecision(idx+1+(period+ee)%period);
- if(o.indexOf("e") === -1) {
- var fakee = Math.floor(Math.log(val)*Math.LOG10E);
- if(o.indexOf(".") === -1) o = o.charAt(0) + "." + o.substr(1) + "E+" + (fakee - o.length+ee);
- else o += "E+" + (fakee - ee);
- while(o.substr(0,2) === "0.") {
- o = o.charAt(0) + o.substr(2,period) + "." + o.substr(2+period);
- o = o.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");
- }
- o = o.replace(/\+-/,"-");
- }
- o = o.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function($$,$1,$2,$3) { return $1 + $2 + $3.substr(0,(period+ee)%period) + "." + $3.substr(ee) + "E"; });
- } else o = val.toExponential(idx);
- if(fmt.match(/E\+00$/) && o.match(/e[+-]\d$/)) o = o.substr(0,o.length-1) + "0" + o.charAt(o.length-1);
- if(fmt.match(/E\-/) && o.match(/e\+/)) o = o.replace(/e\+/,"e");
- return o.replace("e","E");
- }
- var frac1 = /# (\?+)( ?)\/( ?)(\d+)/;
- function write_num_f1(r, aval, sign) {
- var den = parseInt(r[4],10), rr = Math.round(aval * den), base = Math.floor(rr/den);
- var myn = (rr - base*den), myd = den;
- return sign + (base === 0 ? "" : ""+base) + " " + (myn === 0 ? fill(" ", r[1].length + 1 + r[4].length) : pad_(myn,r[1].length) + r[2] + "/" + r[3] + pad0(myd,r[4].length));
- }
- function write_num_f2(r, aval, sign) {
- return sign + (aval === 0 ? "" : ""+aval) + fill(" ", r[1].length + 2 + r[4].length);
- }
- var dec1 = /^#*0*\.([0#]+)/;
- var closeparen = /\).*[0#]/;
- var phone = /\(###\) ###\\?-####/;
- function hashq(str) {
- var o = "", cc;
- for(var i = 0; i != str.length; ++i) switch((cc=str.charCodeAt(i))) {
- case 35: break;
- case 63: o+= " "; break;
- case 48: o+= "0"; break;
- default: o+= String.fromCharCode(cc);
- }
- return o;
- }
- function rnd(val, d) { var dd = Math.pow(10,d); return ""+(Math.round(val * dd)/dd); }
- function dec(val, d) {
- if (d < ('' + Math.round((val-Math.floor(val))*Math.pow(10,d))).length) {
- return 0;
- }
- return Math.round((val-Math.floor(val))*Math.pow(10,d));
- }
- function carry(val, d) {
- if (d < ('' + Math.round((val-Math.floor(val))*Math.pow(10,d))).length) {
- return 1;
- }
- return 0;
- }
- function flr(val) { if(val < 2147483647 && val > -2147483648) return ""+(val >= 0 ? (val|0) : (val-1|0)); return ""+Math.floor(val); }
- function write_num_flt(type, fmt, val) {
- if(type.charCodeAt(0) === 40 && !fmt.match(closeparen)) {
- var ffmt = fmt.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");
- if(val >= 0) return write_num_flt('n', ffmt, val);
- return '(' + write_num_flt('n', ffmt, -val) + ')';
- }
- if(fmt.charCodeAt(fmt.length - 1) === 44) return write_num_cm(type, fmt, val);
- if(fmt.indexOf('%') !== -1) return write_num_pct(type, fmt, val);
- if(fmt.indexOf('E') !== -1) return write_num_exp(fmt, val);
- if(fmt.charCodeAt(0) === 36) return "$"+write_num_flt(type,fmt.substr(fmt.charAt(1)==' '?2:1),val);
- var o;
- var r, ri, ff, aval = Math.abs(val), sign = val < 0 ? "-" : "";
- if(fmt.match(/^00+$/)) return sign + pad0r(aval,fmt.length);
- if(fmt.match(/^[#?]+$/)) {
- o = pad0r(val,0); if(o === "0") o = "";
- return o.length > fmt.length ? o : hashq(fmt.substr(0,fmt.length-o.length)) + o;
- }
- if((r = fmt.match(frac1))) return write_num_f1(r, aval, sign);
- if(fmt.match(/^#+0+$/)) return sign + pad0r(aval,fmt.length - fmt.indexOf("0"));
- if((r = fmt.match(dec1))) {
- o = rnd(val, r[1].length).replace(/^([^\.]+)$/,"$1."+hashq(r[1])).replace(/\.$/,"."+hashq(r[1])).replace(/\.(\d*)$/,function($$, $1) { return "." + $1 + fill("0", hashq(r[1]).length-$1.length); });
- return fmt.indexOf("0.") !== -1 ? o : o.replace(/^0\./,".");
- }
- fmt = fmt.replace(/^#+([0.])/, "$1");
- if((r = fmt.match(/^(0*)\.(#*)$/))) {
- return sign + rnd(aval, r[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,r[1].length?"0.":".");
- }
- if((r = fmt.match(/^#{1,3},##0(\.?)$/))) return sign + commaify(pad0r(aval,0));
- if((r = fmt.match(/^#,##0\.([#0]*0)$/))) {
- return val < 0 ? "-" + write_num_flt(type, fmt, -val) : commaify(""+(Math.floor(val) + carry(val, r[1].length))) + "." + pad0(dec(val, r[1].length),r[1].length);
- }
- if((r = fmt.match(/^#,#*,#0/))) return write_num_flt(type,fmt.replace(/^#,#*,/,""),val);
- if((r = fmt.match(/^([0#]+)(\\?-([0#]+))+$/))) {
- o = _strrev(write_num_flt(type, fmt.replace(/[\\-]/g,""), val));
- ri = 0;
- return _strrev(_strrev(fmt.replace(/\\/g,"")).replace(/[0#]/g,function(x){return ri<o.length?o.charAt(ri++):x==='0'?'0':"";}));
- }
- if(fmt.match(phone)) {
- o = write_num_flt(type, "##########", val);
- return "(" + o.substr(0,3) + ") " + o.substr(3, 3) + "-" + o.substr(6);
- }
- var oa = "";
- if((r = fmt.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))) {
- ri = Math.min(r[4].length,7);
- ff = frac(aval, Math.pow(10,ri)-1, false);
- o = "" + sign;
- oa = write_num("n", r[1], ff[1]);
- if(oa.charAt(oa.length-1) == " ") oa = oa.substr(0,oa.length-1) + "0";
- o += oa + r[2] + "/" + r[3];
- oa = rpad_(ff[2],ri);
- if(oa.length < r[4].length) oa = hashq(r[4].substr(r[4].length-oa.length)) + oa;
- o += oa;
- return o;
- }
- if((r = fmt.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))) {
- ri = Math.min(Math.max(r[1].length, r[4].length),7);
- ff = frac(aval, Math.pow(10,ri)-1, true);
- return sign + (ff[0]||(ff[1] ? "" : "0")) + " " + (ff[1] ? pad_(ff[1],ri) + r[2] + "/" + r[3] + rpad_(ff[2],ri): fill(" ", 2*ri+1 + r[2].length + r[3].length));
- }
- if((r = fmt.match(/^[#0?]+$/))) {
- o = pad0r(val, 0);
- if(fmt.length <= o.length) return o;
- return hashq(fmt.substr(0,fmt.length-o.length)) + o;
- }
- if((r = fmt.match(/^([#0?]+)\.([#0]+)$/))) {
- o = "" + val.toFixed(Math.min(r[2].length,10)).replace(/([^0])0+$/,"$1");
- ri = o.indexOf(".");
- var lres = fmt.indexOf(".") - ri, rres = fmt.length - o.length - lres;
- return hashq(fmt.substr(0,lres) + o + fmt.substr(fmt.length-rres));
- }
- if((r = fmt.match(/^00,000\.([#0]*0)$/))) {
- ri = dec(val, r[1].length);
- return val < 0 ? "-" + write_num_flt(type, fmt, -val) : commaify(flr(val)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function($$) { return "00," + ($$.length < 3 ? pad0(0,3-$$.length) : "") + $$; }) + "." + pad0(ri,r[1].length);
- }
- switch(fmt) {
- case "###,##0.00": return write_num_flt(type, "#,##0.00", val);
- case "###,###":
- case "##,###":
- case "#,###": var x = commaify(pad0r(aval,0)); return x !== "0" ? sign + x : "";
- case "###,###.00": return write_num_flt(type, "###,##0.00",val).replace(/^0\./,".");
- case "#,###.00": return write_num_flt(type, "#,##0.00",val).replace(/^0\./,".");
- default:
- }
- throw new Error("unsupported format |" + fmt + "|");
- }
- function write_num_cm2(type, fmt, val){
- var idx = fmt.length - 1;
- while(fmt.charCodeAt(idx-1) === 44) --idx;
- return write_num(type, fmt.substr(0,idx), val / Math.pow(10,3*(fmt.length-idx)));
- }
- function write_num_pct2(type, fmt, val){
- var sfmt = fmt.replace(pct1,""), mul = fmt.length - sfmt.length;
- return write_num(type, sfmt, val * Math.pow(10,2*mul)) + fill("%",mul);
- }
- function write_num_exp2(fmt, val){
- var o;
- var idx = fmt.indexOf("E") - fmt.indexOf(".") - 1;
- if(fmt.match(/^#+0.0E\+0$/)) {
- if(val == 0) return "0.0E+0";
- else if(val < 0) return "-" + write_num_exp2(fmt, -val);
- var period = fmt.indexOf("."); if(period === -1) period=fmt.indexOf('E');
- var ee = Math.floor(Math.log(val)*Math.LOG10E)%period;
- if(ee < 0) ee += period;
- o = (val/Math.pow(10,ee)).toPrecision(idx+1+(period+ee)%period);
- if(!o.match(/[Ee]/)) {
- var fakee = Math.floor(Math.log(val)*Math.LOG10E);
- if(o.indexOf(".") === -1) o = o.charAt(0) + "." + o.substr(1) + "E+" + (fakee - o.length+ee);
- else o += "E+" + (fakee - ee);
- o = o.replace(/\+-/,"-");
- }
- o = o.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function($$,$1,$2,$3) { return $1 + $2 + $3.substr(0,(period+ee)%period) + "." + $3.substr(ee) + "E"; });
- } else o = val.toExponential(idx);
- if(fmt.match(/E\+00$/) && o.match(/e[+-]\d$/)) o = o.substr(0,o.length-1) + "0" + o.charAt(o.length-1);
- if(fmt.match(/E\-/) && o.match(/e\+/)) o = o.replace(/e\+/,"e");
- return o.replace("e","E");
- }
- function write_num_int(type, fmt, val) {
- if(type.charCodeAt(0) === 40 && !fmt.match(closeparen)) {
- var ffmt = fmt.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");
- if(val >= 0) return write_num_int('n', ffmt, val);
- return '(' + write_num_int('n', ffmt, -val) + ')';
- }
- if(fmt.charCodeAt(fmt.length - 1) === 44) return write_num_cm2(type, fmt, val);
- if(fmt.indexOf('%') !== -1) return write_num_pct2(type, fmt, val);
- if(fmt.indexOf('E') !== -1) return write_num_exp2(fmt, val);
- if(fmt.charCodeAt(0) === 36) return "$"+write_num_int(type,fmt.substr(fmt.charAt(1)==' '?2:1),val);
- var o;
- var r, ri, ff, aval = Math.abs(val), sign = val < 0 ? "-" : "";
- if(fmt.match(/^00+$/)) return sign + pad0(aval,fmt.length);
- if(fmt.match(/^[#?]+$/)) {
- o = (""+val); if(val === 0) o = "";
- return o.length > fmt.length ? o : hashq(fmt.substr(0,fmt.length-o.length)) + o;
- }
- if((r = fmt.match(frac1))) return write_num_f2(r, aval, sign);
- if(fmt.match(/^#+0+$/)) return sign + pad0(aval,fmt.length - fmt.indexOf("0"));
- if((r = fmt.match(dec1))) {
- o = (""+val).replace(/^([^\.]+)$/,"$1."+hashq(r[1])).replace(/\.$/,"."+hashq(r[1]));
- o = o.replace(/\.(\d*)$/,function($$, $1) {
- return "." + $1 + fill("0", hashq(r[1]).length-$1.length); });
- return fmt.indexOf("0.") !== -1 ? o : o.replace(/^0\./,".");
- }
- fmt = fmt.replace(/^#+([0.])/, "$1");
- if((r = fmt.match(/^(0*)\.(#*)$/))) {
- return sign + (""+aval).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,r[1].length?"0.":".");
- }
- if((r = fmt.match(/^#{1,3},##0(\.?)$/))) return sign + commaify((""+aval));
- if((r = fmt.match(/^#,##0\.([#0]*0)$/))) {
- return val < 0 ? "-" + write_num_int(type, fmt, -val) : commaify((""+val)) + "." + fill('0',r[1].length);
- }
- if((r = fmt.match(/^#,#*,#0/))) return write_num_int(type,fmt.replace(/^#,#*,/,""),val);
- if((r = fmt.match(/^([0#]+)(\\?-([0#]+))+$/))) {
- o = _strrev(write_num_int(type, fmt.replace(/[\\-]/g,""), val));
- ri = 0;
- return _strrev(_strrev(fmt.replace(/\\/g,"")).replace(/[0#]/g,function(x){return ri<o.length?o.charAt(ri++):x==='0'?'0':"";}));
- }
- if(fmt.match(phone)) {
- o = write_num_int(type, "##########", val);
- return "(" + o.substr(0,3) + ") " + o.substr(3, 3) + "-" + o.substr(6);
- }
- var oa = "";
- if((r = fmt.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))) {
- ri = Math.min(r[4].length,7);
- ff = frac(aval, Math.pow(10,ri)-1, false);
- o = "" + sign;
- oa = write_num("n", r[1], ff[1]);
- if(oa.charAt(oa.length-1) == " ") oa = oa.substr(0,oa.length-1) + "0";
- o += oa + r[2] + "/" + r[3];
- oa = rpad_(ff[2],ri);
- if(oa.length < r[4].length) oa = hashq(r[4].substr(r[4].length-oa.length)) + oa;
- o += oa;
- return o;
- }
- if((r = fmt.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))) {
- ri = Math.min(Math.max(r[1].length, r[4].length),7);
- ff = frac(aval, Math.pow(10,ri)-1, true);
- return sign + (ff[0]||(ff[1] ? "" : "0")) + " " + (ff[1] ? pad_(ff[1],ri) + r[2] + "/" + r[3] + rpad_(ff[2],ri): fill(" ", 2*ri+1 + r[2].length + r[3].length));
- }
- if((r = fmt.match(/^[#0?]+$/))) {
- o = "" + val;
- if(fmt.length <= o.length) return o;
- return hashq(fmt.substr(0,fmt.length-o.length)) + o;
- }
- if((r = fmt.match(/^([#0]+)\.([#0]+)$/))) {
- o = "" + val.toFixed(Math.min(r[2].length,10)).replace(/([^0])0+$/,"$1");
- ri = o.indexOf(".");
- var lres = fmt.indexOf(".") - ri, rres = fmt.length - o.length - lres;
- return hashq(fmt.substr(0,lres) + o + fmt.substr(fmt.length-rres));
- }
- if((r = fmt.match(/^00,000\.([#0]*0)$/))) {
- return val < 0 ? "-" + write_num_int(type, fmt, -val) : commaify(""+val).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function($$) { return "00," + ($$.length < 3 ? pad0(0,3-$$.length) : "") + $$; }) + "." + pad0(0,r[1].length);
- }
- switch(fmt) {
- case "###,###":
- case "##,###":
- case "#,###": var x = commaify(""+aval); return x !== "0" ? sign + x : "";
- default:
- if(fmt.match(/\.[0#?]*$/)) return write_num_int(type, fmt.slice(0,fmt.lastIndexOf(".")), val) + hashq(fmt.slice(fmt.lastIndexOf(".")));
- }
- throw new Error("unsupported format |" + fmt + "|");
- }
- return function write_num(type, fmt, val) {
- return (val|0) === val ? write_num_int(type, fmt, val) : write_num_flt(type, fmt, val);
- };})();
- function split_fmt(fmt) {
- var out = [];
- var in_str = false/*, cc*/;
- for(var i = 0, j = 0; i < fmt.length; ++i) switch((/*cc=*/fmt.charCodeAt(i))) {
- case 34: /* '"' */
- in_str = !in_str; break;
- case 95: case 42: case 92: /* '_' '*' '\\' */
- ++i; break;
- case 59: /* ';' */
- out[out.length] = fmt.substr(j,i-j);
- j = i+1;
- }
- out[out.length] = fmt.substr(j);
- if(in_str === true) throw new Error("Format |" + fmt + "| unterminated string ");
- return out;
- }
- SSF._split = split_fmt;
- var abstime = /\[[HhMmSs]*\]/;
- function fmt_is_date(fmt) {
- var i = 0, /*cc = 0,*/ c = "", o = "";
- while(i < fmt.length) {
- switch((c = fmt.charAt(i))) {
- case 'G': if(isgeneral(fmt, i)) i+= 6; i++; break;
- case '"': for(;(/*cc=*/fmt.charCodeAt(++i)) !== 34 && i < fmt.length;) ++i; ++i; break;
- case '\\': i+=2; break;
- case '_': i+=2; break;
- case '@': ++i; break;
- case 'B': case 'b':
- if(fmt.charAt(i+1) === "1" || fmt.charAt(i+1) === "2") return true;
- /* falls through */
- case 'M': case 'D': case 'Y': case 'H': case 'S': case 'E':
- /* falls through */
- case 'm': case 'd': case 'y': case 'h': case 's': case 'e': case 'g': return true;
- case 'A': case 'a':
- if(fmt.substr(i, 3).toUpperCase() === "A/P") return true;
- if(fmt.substr(i, 5).toUpperCase() === "AM/PM") return true;
- ++i; break;
- case '[':
- o = c;
- while(fmt.charAt(i++) !== ']' && i < fmt.length) o += fmt.charAt(i);
- if(o.match(abstime)) return true;
- break;
- case '.':
- /* falls through */
- case '0': case '#':
- while(i < fmt.length && ("0#?.,E+-%".indexOf(c=fmt.charAt(++i)) > -1 || (c=='\\' && fmt.charAt(i+1) == "-" && "0#".indexOf(fmt.charAt(i+2))>-1))){/* empty */}
- break;
- case '?': while(fmt.charAt(++i) === c){/* empty */} break;
- case '*': ++i; if(fmt.charAt(i) == ' ' || fmt.charAt(i) == '*') ++i; break;
- case '(': case ')': ++i; break;
- case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
- while(i < fmt.length && "0123456789".indexOf(fmt.charAt(++i)) > -1){/* empty */} break;
- case ' ': ++i; break;
- default: ++i; break;
- }
- }
- return false;
- }
- SSF.is_date = fmt_is_date;
- function eval_fmt(fmt, v, opts, flen) {
- var out = [], o = "", i = 0, c = "", lst='t', dt, j, cc;
- var hr='H';
- /* Tokenize */
- while(i < fmt.length) {
- switch((c = fmt.charAt(i))) {
- case 'G': /* General */
- if(!isgeneral(fmt, i)) throw new Error('unrecognized character ' + c + ' in ' +fmt);
- out[out.length] = {t:'G', v:'General'}; i+=7; break;
- case '"': /* Literal text */
- for(o="";(cc=fmt.charCodeAt(++i)) !== 34 && i < fmt.length;) o += String.fromCharCode(cc);
- out[out.length] = {t:'t', v:o}; ++i; break;
- case '\\': var w = fmt.charAt(++i), t = (w === "(" || w === ")") ? w : 't';
- out[out.length] = {t:t, v:w}; ++i; break;
- case '_': out[out.length] = {t:'t', v:" "}; i+=2; break;
- case '@': /* Text Placeholder */
- out[out.length] = {t:'T', v:v}; ++i; break;
- case 'B': case 'b':
- if(fmt.charAt(i+1) === "1" || fmt.charAt(i+1) === "2") {
- if(dt==null) { dt=parse_date_code(v, opts, fmt.charAt(i+1) === "2"); if(dt==null) return ""; }
- out[out.length] = {t:'X', v:fmt.substr(i,2)}; lst = c; i+=2; break;
- }
- /* falls through */
- case 'M': case 'D': case 'Y': case 'H': case 'S': case 'E':
- c = c.toLowerCase();
- /* falls through */
- case 'm': case 'd': case 'y': case 'h': case 's': case 'e': case 'g':
- if(v < 0) return "";
- if(dt==null) { dt=parse_date_code(v, opts); if(dt==null) return ""; }
- o = c; while(++i < fmt.length && fmt.charAt(i).toLowerCase() === c) o+=c;
- if(c === 'm' && lst.toLowerCase() === 'h') c = 'M';
- if(c === 'h') c = hr;
- out[out.length] = {t:c, v:o}; lst = c; break;
- case 'A': case 'a':
- var q={t:c, v:c};
- if(dt==null) dt=parse_date_code(v, opts);
- if(fmt.substr(i, 3).toUpperCase() === "A/P") { if(dt!=null) q.v = dt.H >= 12 ? "P" : "A"; q.t = 'T'; hr='h';i+=3;}
- else if(fmt.substr(i,5).toUpperCase() === "AM/PM") { if(dt!=null) q.v = dt.H >= 12 ? "PM" : "AM"; q.t = 'T'; i+=5; hr='h'; }
- else { q.t = "t"; ++i; }
- if(dt==null && q.t === 'T') return "";
- out[out.length] = q; lst = c; break;
- case '[':
- o = c;
- while(fmt.charAt(i++) !== ']' && i < fmt.length) o += fmt.charAt(i);
- if(o.slice(-1) !== ']') throw 'unterminated "[" block: |' + o + '|';
- if(o.match(abstime)) {
- if(dt==null) { dt=parse_date_code(v, opts); if(dt==null) return ""; }
- out[out.length] = {t:'Z', v:o.toLowerCase()};
- lst = o.charAt(1);
- } else if(o.indexOf("$") > -1) {
- o = (o.match(/\$([^-\[\]]*)/)||[])[1]||"$";
- if(!fmt_is_date(fmt)) out[out.length] = {t:'t',v:o};
- }
- break;
- /* Numbers */
- case '.':
- if(dt != null) {
- o = c; while(++i < fmt.length && (c=fmt.charAt(i)) === "0") o += c;
- out[out.length] = {t:'s', v:o}; break;
- }
- /* falls through */
- case '0': case '#':
- o = c; while((++i < fmt.length && "0#?.,E+-%".indexOf(c=fmt.charAt(i)) > -1) || (c=='\\' && fmt.charAt(i+1) == "-" && i < fmt.length - 2 && "0#".indexOf(fmt.charAt(i+2))>-1)) o += c;
- out[out.length] = {t:'n', v:o}; break;
- case '?':
- o = c; while(fmt.charAt(++i) === c) o+=c;
- out[out.length] = {t:c, v:o}; lst = c; break;
- case '*': ++i; if(fmt.charAt(i) == ' ' || fmt.charAt(i) == '*') ++i; break; // **
- case '(': case ')': out[out.length] = {t:(flen===1?'t':c), v:c}; ++i; break;
- case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
- o = c; while(i < fmt.length && "0123456789".indexOf(fmt.charAt(++i)) > -1) o+=fmt.charAt(i);
- out[out.length] = {t:'D', v:o}; break;
- case ' ': out[out.length] = {t:c, v:c}; ++i; break;
- default:
- if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(c) === -1) throw new Error('unrecognized character ' + c + ' in ' + fmt);
- out[out.length] = {t:'t', v:c}; ++i; break;
- }
- }
- var bt = 0, ss0 = 0, ssm;
- for(i=out.length-1, lst='t'; i >= 0; --i) {
- switch(out[i].t) {
- case 'h': case 'H': out[i].t = hr; lst='h'; if(bt < 1) bt = 1; break;
- case 's':
- if((ssm=out[i].v.match(/\.0+$/))) ss0=Math.max(ss0,ssm[0].length-1);
- if(bt < 3) bt = 3;
- /* falls through */
- case 'd': case 'y': case 'M': case 'e': lst=out[i].t; break;
- case 'm': if(lst === 's') { out[i].t = 'M'; if(bt < 2) bt = 2; } break;
- case 'X': /*if(out[i].v === "B2");*/
- break;
- case 'Z':
- if(bt < 1 && out[i].v.match(/[Hh]/)) bt = 1;
- if(bt < 2 && out[i].v.match(/[Mm]/)) bt = 2;
- if(bt < 3 && out[i].v.match(/[Ss]/)) bt = 3;
- }
- }
- switch(bt) {
- case 0: break;
- case 1:
- if(dt.u >= 0.5) { dt.u = 0; ++dt.S; }
- if(dt.S >= 60) { dt.S = 0; ++dt.M; }
- if(dt.M >= 60) { dt.M = 0; ++dt.H; }
- break;
- case 2:
- if(dt.u >= 0.5) { dt.u = 0; ++dt.S; }
- if(dt.S >= 60) { dt.S = 0; ++dt.M; }
- break;
- }
- /* replace fields */
- var nstr = "", jj;
- for(i=0; i < out.length; ++i) {
- switch(out[i].t) {
- case 't': case 'T': case ' ': case 'D': break;
- case 'X': out[i].v = ""; out[i].t = ";"; break;
- case 'd': case 'm': case 'y': case 'h': case 'H': case 'M': case 's': case 'e': case 'b': case 'Z':
- out[i].v = write_date(out[i].t.charCodeAt(0), out[i].v, dt, ss0);
- out[i].t = 't'; break;
- case 'n': case '(': case '?':
- jj = i+1;
- while(out[jj] != null && (
- (c=out[jj].t) === "?" || c === "D" ||
- ((c === " " || c === "t") && out[jj+1] != null && (out[jj+1].t === '?' || out[jj+1].t === "t" && out[jj+1].v === '/')) ||
- (out[i].t === '(' && (c === ' ' || c === 'n' || c === ')')) ||
- (c === 't' && (out[jj].v === '/' || out[jj].v === ' ' && out[jj+1] != null && out[jj+1].t == '?'))
- )) {
- out[i].v += out[jj].v;
- out[jj] = {v:"", t:";"}; ++jj;
- }
- nstr += out[i].v;
- i = jj-1; break;
- case 'G': out[i].t = 't'; out[i].v = general_fmt(v,opts); break;
- }
- }
- var vv = "", myv, ostr;
- if(nstr.length > 0) {
- if(nstr.charCodeAt(0) == 40) /* '(' */ {
- myv = (v<0&&nstr.charCodeAt(0) === 45 ? -v : v);
- ostr = write_num('(', nstr, myv);
- } else {
- myv = (v<0 && flen > 1 ? -v : v);
- ostr = write_num('n', nstr, myv);
- if(myv < 0 && out[0] && out[0].t == 't') {
- ostr = ostr.substr(1);
- out[0].v = "-" + out[0].v;
- }
- }
- jj=ostr.length-1;
- var decpt = out.length;
- for(i=0; i < out.length; ++i) if(out[i] != null && out[i].t != 't' && out[i].v.indexOf(".") > -1) { decpt = i; break; }
- var lasti=out.length;
- if(decpt === out.length && ostr.indexOf("E") === -1) {
- for(i=out.length-1; i>= 0;--i) {
- if(out[i] == null || 'n?('.indexOf(out[i].t) === -1) continue;
- if(jj>=out[i].v.length-1) { jj -= out[i].v.length; out[i].v = ostr.substr(jj+1, out[i].v.length); }
- else if(jj < 0) out[i].v = "";
- else { out[i].v = ostr.substr(0, jj+1); jj = -1; }
- out[i].t = 't';
- lasti = i;
- }
- if(jj>=0 && lasti<out.length) out[lasti].v = ostr.substr(0,jj+1) + out[lasti].v;
- }
- else if(decpt !== out.length && ostr.indexOf("E") === -1) {
- jj = ostr.indexOf(".")-1;
- for(i=decpt; i>= 0; --i) {
- if(out[i] == null || 'n?('.indexOf(out[i].t) === -1) continue;
- j=out[i].v.indexOf(".")>-1&&i===decpt?out[i].v.indexOf(".")-1:out[i].v.length-1;
- vv = out[i].v.substr(j+1);
- for(; j>=0; --j) {
- if(jj>=0 && (out[i].v.charAt(j) === "0" || out[i].v.charAt(j) === "#")) vv = ostr.charAt(jj--) + vv;
- }
- out[i].v = vv;
- out[i].t = 't';
- lasti = i;
- }
- if(jj>=0 && lasti<out.length) out[lasti].v = ostr.substr(0,jj+1) + out[lasti].v;
- jj = ostr.indexOf(".")+1;
- for(i=decpt; i<out.length; ++i) {
- if(out[i] == null || ('n?('.indexOf(out[i].t) === -1 && i !== decpt)) continue;
- j=out[i].v.indexOf(".")>-1&&i===decpt?out[i].v.indexOf(".")+1:0;
- vv = out[i].v.substr(0,j);
- for(; j<out[i].v.length; ++j) {
- if(jj<ostr.length) vv += ostr.charAt(jj++);
- }
- out[i].v = vv;
- out[i].t = 't';
- lasti = i;
- }
- }
- }
- for(i=0; i<out.length; ++i) if(out[i] != null && 'n(?'.indexOf(out[i].t)>-1) {
- myv = (flen >1 && v < 0 && i>0 && out[i-1].v === "-" ? -v:v);
- out[i].v = write_num(out[i].t, out[i].v, myv);
- out[i].t = 't';
- }
- var retval = "";
- for(i=0; i !== out.length; ++i) if(out[i] != null) retval += out[i].v;
- return retval;
- }
- SSF._eval = eval_fmt;
- var cfregex = /\[[=<>]/;
- var cfregex2 = /\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;
- function chkcond(v, rr) {
- if(rr == null) return false;
- var thresh = parseFloat(rr[2]);
- switch(rr[1]) {
- case "=": if(v == thresh) return true; break;
- case ">": if(v > thresh) return true; break;
- case "<": if(v < thresh) return true; break;
- case "<>": if(v != thresh) return true; break;
- case ">=": if(v >= thresh) return true; break;
- case "<=": if(v <= thresh) return true; break;
- }
- return false;
- }
- function choose_fmt(f, v) {
- var fmt = split_fmt(f);
- var l = fmt.length, lat = fmt[l-1].indexOf("@");
- if(l<4 && lat>-1) --l;
- if(fmt.length > 4) throw new Error("cannot find right format for |" + fmt.join("|") + "|");
- if(typeof v !== "number") return [4, fmt.length === 4 || lat>-1?fmt[fmt.length-1]:"@"];
- switch(fmt.length) {
- case 1: fmt = lat>-1 ? ["General", "General", "General", fmt[0]] : [fmt[0], fmt[0], fmt[0], "@"]; break;
- case 2: fmt = lat>-1 ? [fmt[0], fmt[0], fmt[0], fmt[1]] : [fmt[0], fmt[1], fmt[0], "@"]; break;
- case 3: fmt = lat>-1 ? [fmt[0], fmt[1], fmt[0], fmt[2]] : [fmt[0], fmt[1], fmt[2], "@"]; break;
- case 4: break;
- }
- var ff = v > 0 ? fmt[0] : v < 0 ? fmt[1] : fmt[2];
- if(fmt[0].indexOf("[") === -1 && fmt[1].indexOf("[") === -1) return [l, ff];
- if(fmt[0].match(cfregex) != null || fmt[1].match(cfregex) != null) {
- var m1 = fmt[0].match(cfregex2);
- var m2 = fmt[1].match(cfregex2);
- return chkcond(v, m1) ? [l, fmt[0]] : chkcond(v, m2) ? [l, fmt[1]] : [l, fmt[m1 != null && m2 != null ? 2 : 1]];
- }
- return [l, ff];
- }
- function format(fmt,v,o) {
- if(o == null) o = {};
- var sfmt = "";
- switch(typeof fmt) {
- case "string":
- if(fmt == "m/d/yy" && o.dateNF) sfmt = o.dateNF;
- else sfmt = fmt;
- break;
- case "number":
- if(fmt == 14 && o.dateNF) sfmt = o.dateNF;
- else sfmt = (o.table != null ? (o.table) : table_fmt)[fmt];
- break;
- }
- if(isgeneral(sfmt,0)) return general_fmt(v, o);
- if(v instanceof Date) v = datenum_local(v, o.date1904);
- var f = choose_fmt(sfmt, v);
- if(isgeneral(f[1])) return general_fmt(v, o);
- if(v === true) v = "TRUE"; else if(v === false) v = "FALSE";
- else if(v === "" || v == null) return "";
- return eval_fmt(f[1], v, o, f[0]);
- }
- function load_entry(fmt, idx) {
- if(typeof idx != 'number') {
- idx = +idx || -1;
- for(var i = 0; i < 0x0188; ++i) {
- if(table_fmt[i] == undefined) { if(idx < 0) idx = i; continue; }
- if(table_fmt[i] == fmt) { idx = i; break; }
- }
- if(idx < 0) idx = 0x187;
- }
- table_fmt[idx] = fmt;
- return idx;
- }
- SSF.load = load_entry;
- SSF._table = table_fmt;
- SSF.get_table = function get_table() { return table_fmt; };
- SSF.load_table = function load_table(tbl) {
- for(var i=0; i!=0x0188; ++i)
- if(tbl[i] !== undefined) load_entry(tbl[i], i);
- };
- SSF.init_table = init_table;
- SSF.format = format;
- };
- make_ssf(SSF);
- /* map from xlml named formats to SSF TODO: localize */
- var XLMLFormatMap/*{[string]:string}*/ = ({
- "General Number": "General",
- "General Date": SSF._table[22],
- "Long Date": "dddd, mmmm dd, yyyy",
- "Medium Date": SSF._table[15],
- "Short Date": SSF._table[14],
- "Long Time": SSF._table[19],
- "Medium Time": SSF._table[18],
- "Short Time": SSF._table[20],
- "Currency": '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',
- "Fixed": SSF._table[2],
- "Standard": SSF._table[4],
- "Percent": SSF._table[10],
- "Scientific": SSF._table[11],
- "Yes/No": '"Yes";"Yes";"No";@',
- "True/False": '"True";"True";"False";@',
- "On/Off": '"Yes";"Yes";"No";@'
- });
-
- var SSFImplicit/*{[number]:string}*/ = ({
- "5": '"$"#,##0_);\\("$"#,##0\\)',
- "6": '"$"#,##0_);[Red]\\("$"#,##0\\)',
- "7": '"$"#,##0.00_);\\("$"#,##0.00\\)',
- "8": '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',
- "23": 'General', "24": 'General', "25": 'General', "26": 'General',
- "27": 'm/d/yy', "28": 'm/d/yy', "29": 'm/d/yy', "30": 'm/d/yy', "31": 'm/d/yy',
- "32": 'h:mm:ss', "33": 'h:mm:ss', "34": 'h:mm:ss', "35": 'h:mm:ss',
- "36": 'm/d/yy',
- "41": '_(* #,##0_);_(* \(#,##0\);_(* "-"_);_(@_)',
- "42": '_("$"* #,##0_);_("$"* \(#,##0\);_("$"* "-"_);_(@_)',
- "43": '_(* #,##0.00_);_(* \(#,##0.00\);_(* "-"??_);_(@_)',
- "44": '_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)',
- "50": 'm/d/yy', "51": 'm/d/yy', "52": 'm/d/yy', "53": 'm/d/yy', "54": 'm/d/yy',
- "55": 'm/d/yy', "56": 'm/d/yy', "57": 'm/d/yy', "58": 'm/d/yy',
- "59": '0',
- "60": '0.00',
- "61": '#,##0',
- "62": '#,##0.00',
- "63": '"$"#,##0_);\\("$"#,##0\\)',
- "64": '"$"#,##0_);[Red]\\("$"#,##0\\)',
- "65": '"$"#,##0.00_);\\("$"#,##0.00\\)',
- "66": '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',
- "67": '0%',
- "68": '0.00%',
- "69": '# ?/?',
- "70": '# ??/??',
- "71": 'm/d/yy',
- "72": 'm/d/yy',
- "73": 'd-mmm-yy',
- "74": 'd-mmm',
- "75": 'mmm-yy',
- "76": 'h:mm',
- "77": 'h:mm:ss',
- "78": 'm/d/yy h:mm',
- "79": 'mm:ss',
- "80": '[h]:mm:ss',
- "81": 'mmss.0'
- });
-
- /* dateNF parse TODO: move to SSF */
- var dateNFregex = /[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;
- function dateNF_regex(dateNF) {
- var fmt = typeof dateNF == "number" ? SSF._table[dateNF] : dateNF;
- fmt = fmt.replace(dateNFregex, "(\\d+)");
- return new RegExp("^" + fmt + "$");
- }
- function dateNF_fix(str, dateNF, match) {
- var Y = -1, m = -1, d = -1, H = -1, M = -1, S = -1;
- (dateNF.match(dateNFregex)||[]).forEach(function(n, i) {
- var v = parseInt(match[i+1], 10);
- switch(n.toLowerCase().charAt(0)) {
- case 'y': Y = v; break; case 'd': d = v; break;
- case 'h': H = v; break; case 's': S = v; break;
- case 'm': if(H >= 0) M = v; else m = v; break;
- }
- });
- if(S >= 0 && M == -1 && m >= 0) { M = m; m = -1; }
- var datestr = (("" + (Y>=0?Y: new Date().getFullYear())).slice(-4) + "-" + ("00" + (m>=1?m:1)).slice(-2) + "-" + ("00" + (d>=1?d:1)).slice(-2));
- if(datestr.length == 7) datestr = "0" + datestr;
- if(datestr.length == 8) datestr = "20" + datestr;
- var timestr = (("00" + (H>=0?H:0)).slice(-2) + ":" + ("00" + (M>=0?M:0)).slice(-2) + ":" + ("00" + (S>=0?S:0)).slice(-2));
- if(H == -1 && M == -1 && S == -1) return datestr;
- if(Y == -1 && m == -1 && d == -1) return timestr;
- return datestr + "T" + timestr;
- }
-
- var DO_NOT_EXPORT_CFB = true;
- /* cfb.js (C) 2013-present SheetJS -- http://sheetjs.com */
- /* vim: set ts=2: */
- /*jshint eqnull:true */
- /*exported CFB */
- /*global module, require:false, process:false, Buffer:false, Uint8Array:false, Uint16Array:false */
-
- /* crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */
- /* vim: set ts=2: */
- /*exported CRC32 */
- var CRC32;
- (function (factory) {
- /*jshint ignore:start */
- /*eslint-disable */
- factory(CRC32 = {});
- /*eslint-enable */
- /*jshint ignore:end */
- }(function(CRC32) {
- CRC32.version = '1.2.0';
- /* see perf/crc32table.js */
- /*global Int32Array */
- function signed_crc_table() {
- var c = 0, table = new Array(256);
-
- for(var n =0; n != 256; ++n){
- c = n;
- c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
- c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
- c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
- c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
- c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
- c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
- c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
- c = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
- table[n] = c;
- }
-
- return typeof Int32Array !== 'undefined' ? new Int32Array(table) : table;
- }
-
- var T = signed_crc_table();
- function crc32_bstr(bstr, seed) {
- var C = seed ^ -1, L = bstr.length - 1;
- for(var i = 0; i < L;) {
- C = (C>>>8) ^ T[(C^bstr.charCodeAt(i++))&0xFF];
- C = (C>>>8) ^ T[(C^bstr.charCodeAt(i++))&0xFF];
- }
- if(i === L) C = (C>>>8) ^ T[(C ^ bstr.charCodeAt(i))&0xFF];
- return C ^ -1;
- }
-
- function crc32_buf(buf, seed) {
- if(buf.length > 10000) return crc32_buf_8(buf, seed);
- var C = seed ^ -1, L = buf.length - 3;
- for(var i = 0; i < L;) {
- C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
- C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
- C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
- C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
- }
- while(i < L+3) C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
- return C ^ -1;
- }
-
- function crc32_buf_8(buf, seed) {
- var C = seed ^ -1, L = buf.length - 7;
- for(var i = 0; i < L;) {
- C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
- C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
- C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
- C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
- C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
- C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
- C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
- C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
- }
- while(i < L+7) C = (C>>>8) ^ T[(C^buf[i++])&0xFF];
- return C ^ -1;
- }
-
- function crc32_str(str, seed) {
- var C = seed ^ -1;
- for(var i = 0, L=str.length, c, d; i < L;) {
- c = str.charCodeAt(i++);
- if(c < 0x80) {
- C = (C>>>8) ^ T[(C ^ c)&0xFF];
- } else if(c < 0x800) {
- C = (C>>>8) ^ T[(C ^ (192|((c>>6)&31)))&0xFF];
- C = (C>>>8) ^ T[(C ^ (128|(c&63)))&0xFF];
- } else if(c >= 0xD800 && c < 0xE000) {
- c = (c&1023)+64; d = str.charCodeAt(i++)&1023;
- C = (C>>>8) ^ T[(C ^ (240|((c>>8)&7)))&0xFF];
- C = (C>>>8) ^ T[(C ^ (128|((c>>2)&63)))&0xFF];
- C = (C>>>8) ^ T[(C ^ (128|((d>>6)&15)|((c&3)<<4)))&0xFF];
- C = (C>>>8) ^ T[(C ^ (128|(d&63)))&0xFF];
- } else {
- C = (C>>>8) ^ T[(C ^ (224|((c>>12)&15)))&0xFF];
- C = (C>>>8) ^ T[(C ^ (128|((c>>6)&63)))&0xFF];
- C = (C>>>8) ^ T[(C ^ (128|(c&63)))&0xFF];
- }
- }
- return C ^ -1;
- }
- CRC32.table = T;
- CRC32.bstr = crc32_bstr;
- CRC32.buf = crc32_buf;
- CRC32.str = crc32_str;
- }));
- /* [MS-CFB] v20171201 */
- var CFB = (function _CFB(){
- var exports = {};
- exports.version = '1.1.3';
- /* [MS-CFB] 2.6.4 */
- function namecmp(l, r) {
- var L = l.split("/"), R = r.split("/");
- for(var i = 0, c = 0, Z = Math.min(L.length, R.length); i < Z; ++i) {
- if((c = L[i].length - R[i].length)) return c;
- if(L[i] != R[i]) return L[i] < R[i] ? -1 : 1;
- }
- return L.length - R.length;
- }
- function dirname(p) {
- if(p.charAt(p.length - 1) == "/") return (p.slice(0,-1).indexOf("/") === -1) ? p : dirname(p.slice(0, -1));
- var c = p.lastIndexOf("/");
- return (c === -1) ? p : p.slice(0, c+1);
- }
-
- function filename(p) {
- if(p.charAt(p.length - 1) == "/") return filename(p.slice(0, -1));
- var c = p.lastIndexOf("/");
- return (c === -1) ? p : p.slice(c+1);
- }
- /* -------------------------------------------------------------------------- */
- /* DOS Date format:
- high|YYYYYYYm.mmmddddd.HHHHHMMM.MMMSSSSS|low
- add 1980 to stored year
- stored second should be doubled
- */
-
- /* write JS date to buf as a DOS date */
- function write_dos_date(buf, date) {
- if(typeof date === "string") date = new Date(date);
- var hms = date.getHours();
- hms = hms << 6 | date.getMinutes();
- hms = hms << 5 | (date.getSeconds()>>>1);
- buf.write_shift(2, hms);
- var ymd = (date.getFullYear() - 1980);
- ymd = ymd << 4 | (date.getMonth()+1);
- ymd = ymd << 5 | date.getDate();
- buf.write_shift(2, ymd);
- }
-
- /* read four bytes from buf and interpret as a DOS date */
- function parse_dos_date(buf) {
- var hms = buf.read_shift(2) & 0xFFFF;
- var ymd = buf.read_shift(2) & 0xFFFF;
- var val = new Date();
- var d = ymd & 0x1F; ymd >>>= 5;
- var m = ymd & 0x0F; ymd >>>= 4;
- val.setMilliseconds(0);
- val.setFullYear(ymd + 1980);
- val.setMonth(m-1);
- val.setDate(d);
- var S = hms & 0x1F; hms >>>= 5;
- var M = hms & 0x3F; hms >>>= 6;
- val.setHours(hms);
- val.setMinutes(M);
- val.setSeconds(S<<1);
- return val;
- }
- function parse_extra_field(blob) {
- prep_blob(blob, 0);
- var o = {};
- var flags = 0;
- while(blob.l <= blob.length - 4) {
- var type = blob.read_shift(2);
- var sz = blob.read_shift(2), tgt = blob.l + sz;
- var p = {};
- switch(type) {
- /* UNIX-style Timestamps */
- case 0x5455: {
- flags = blob.read_shift(1);
- if(flags & 1) p.mtime = blob.read_shift(4);
- /* for some reason, CD flag corresponds to LFH */
- if(sz > 5) {
- if(flags & 2) p.atime = blob.read_shift(4);
- if(flags & 4) p.ctime = blob.read_shift(4);
- }
- if(p.mtime) p.mt = new Date(p.mtime*1000);
- }
- break;
- }
- blob.l = tgt;
- o[type] = p;
- }
- return o;
- }
- var fs;
- function get_fs() { return fs || (fs = __webpack_require__(/*! fs */ 1)); }
- function parse(file, options) {
- if(file[0] == 0x50 && file[1] == 0x4b) return parse_zip(file, options);
- if(file.length < 512) throw new Error("CFB file size " + file.length + " < 512");
- var mver = 3;
- var ssz = 512;
- var nmfs = 0; // number of mini FAT sectors
- var difat_sec_cnt = 0;
- var dir_start = 0;
- var minifat_start = 0;
- var difat_start = 0;
-
- var fat_addrs = []; // locations of FAT sectors
-
- /* [MS-CFB] 2.2 Compound File Header */
- var blob = file.slice(0,512);
- prep_blob(blob, 0);
-
- /* major version */
- var mv = check_get_mver(blob);
- mver = mv[0];
- switch(mver) {
- case 3: ssz = 512; break; case 4: ssz = 4096; break;
- case 0: if(mv[1] == 0) return parse_zip(file, options);
- /* falls through */
- default: throw new Error("Major Version: Expected 3 or 4 saw " + mver);
- }
-
- /* reprocess header */
- if(ssz !== 512) { blob = file.slice(0,ssz); prep_blob(blob, 28 /* blob.l */); }
- /* Save header for final object */
- var header = file.slice(0,ssz);
-
- check_shifts(blob, mver);
-
- // Number of Directory Sectors
- var dir_cnt = blob.read_shift(4, 'i');
- if(mver === 3 && dir_cnt !== 0) throw new Error('# Directory Sectors: Expected 0 saw ' + dir_cnt);
-
- // Number of FAT Sectors
- blob.l += 4;
-
- // First Directory Sector Location
- dir_start = blob.read_shift(4, 'i');
-
- // Transaction Signature
- blob.l += 4;
-
- // Mini Stream Cutoff Size
- blob.chk('00100000', 'Mini Stream Cutoff Size: ');
-
- // First Mini FAT Sector Location
- minifat_start = blob.read_shift(4, 'i');
-
- // Number of Mini FAT Sectors
- nmfs = blob.read_shift(4, 'i');
-
- // First DIFAT sector location
- difat_start = blob.read_shift(4, 'i');
-
- // Number of DIFAT Sectors
- difat_sec_cnt = blob.read_shift(4, 'i');
-
- // Grab FAT Sector Locations
- for(var q = -1, j = 0; j < 109; ++j) { /* 109 = (512 - blob.l)>>>2; */
- q = blob.read_shift(4, 'i');
- if(q<0) break;
- fat_addrs[j] = q;
- }
-
- /** Break the file up into sectors */
- var sectors = sectorify(file, ssz);
-
- sleuth_fat(difat_start, difat_sec_cnt, sectors, ssz, fat_addrs);
-
- /** Chains */
- var sector_list = make_sector_list(sectors, dir_start, fat_addrs, ssz);
-
- sector_list[dir_start].name = "!Directory";
- if(nmfs > 0 && minifat_start !== ENDOFCHAIN) sector_list[minifat_start].name = "!MiniFAT";
- sector_list[fat_addrs[0]].name = "!FAT";
- sector_list.fat_addrs = fat_addrs;
- sector_list.ssz = ssz;
-
- /* [MS-CFB] 2.6.1 Compound File Directory Entry */
- var files = {}, Paths = [], FileIndex = [], FullPaths = [];
- read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, minifat_start);
-
- build_full_paths(FileIndex, FullPaths, Paths);
- Paths.shift();
-
- var o = {
- FileIndex: FileIndex,
- FullPaths: FullPaths
- };
-
- // $FlowIgnore
- if(options && options.raw) o.raw = {header: header, sectors: sectors};
- return o;
- } // parse
-
- /* [MS-CFB] 2.2 Compound File Header -- read up to major version */
- function check_get_mver(blob) {
- if(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];
- // header signature 8
- blob.chk(HEADER_SIGNATURE, 'Header Signature: ');
-
- // clsid 16
- //blob.chk(HEADER_CLSID, 'CLSID: ');
- blob.l += 16;
-
- // minor version 2
- var mver = blob.read_shift(2, 'u');
-
- return [blob.read_shift(2,'u'), mver];
- }
- function check_shifts(blob, mver) {
- var shift = 0x09;
-
- // Byte Order
- //blob.chk('feff', 'Byte Order: '); // note: some writers put 0xffff
- blob.l += 2;
-
- // Sector Shift
- switch((shift = blob.read_shift(2))) {
- case 0x09: if(mver != 3) throw new Error('Sector Shift: Expected 9 saw ' + shift); break;
- case 0x0c: if(mver != 4) throw new Error('Sector Shift: Expected 12 saw ' + shift); break;
- default: throw new Error('Sector Shift: Expected 9 or 12 saw ' + shift);
- }
-
- // Mini Sector Shift
- blob.chk('0600', 'Mini Sector Shift: ');
-
- // Reserved
- blob.chk('000000000000', 'Reserved: ');
- }
-
- /** Break the file up into sectors */
- function sectorify(file, ssz) {
- var nsectors = Math.ceil(file.length/ssz)-1;
- var sectors = [];
- for(var i=1; i < nsectors; ++i) sectors[i-1] = file.slice(i*ssz,(i+1)*ssz);
- sectors[nsectors-1] = file.slice(nsectors*ssz);
- return sectors;
- }
-
- /* [MS-CFB] 2.6.4 Red-Black Tree */
- function build_full_paths(FI, FP, Paths) {
- var i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;
- var dad = [], q = [];
-
- for(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }
-
- for(; j < q.length; ++j) {
- i = q[j];
- L = FI[i].L; R = FI[i].R; C = FI[i].C;
- if(dad[i] === i) {
- if(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];
- if(R !== -1 && dad[R] !== R) dad[i] = dad[R];
- }
- if(C !== -1 /*NOSTREAM*/) dad[C] = i;
- if(L !== -1 && i != dad[i]) { dad[L] = dad[i]; if(q.lastIndexOf(L) < j) q.push(L); }
- if(R !== -1 && i != dad[i]) { dad[R] = dad[i]; if(q.lastIndexOf(R) < j) q.push(R); }
- }
- for(i=1; i < pl; ++i) if(dad[i] === i) {
- if(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];
- else if(L !== -1 && dad[L] !== L) dad[i] = dad[L];
- }
-
- for(i=1; i < pl; ++i) {
- if(FI[i].type === 0 /* unknown */) continue;
- j = i;
- if(j != dad[j]) do {
- j = dad[j];
- FP[i] = FP[j] + "/" + FP[i];
- } while (j !== 0 && -1 !== dad[j] && j != dad[j]);
- dad[i] = -1;
- }
-
- FP[0] += "/";
- for(i=1; i < pl; ++i) {
- if(FI[i].type !== 2 /* stream */) FP[i] += "/";
- }
- }
-
- function get_mfat_entry(entry, payload, mini) {
- var start = entry.start, size = entry.size;
- //return (payload.slice(start*MSSZ, start*MSSZ + size));
- var o = [];
- var idx = start;
- while(mini && size > 0 && idx >= 0) {
- o.push(payload.slice(idx * MSSZ, idx * MSSZ + MSSZ));
- size -= MSSZ;
- idx = __readInt32LE(mini, idx * 4);
- }
- if(o.length === 0) return (new_buf(0));
- return (bconcat(o).slice(0, entry.size));
- }
-
- /** Chase down the rest of the DIFAT chain to build a comprehensive list
- DIFAT chains by storing the next sector number as the last 32 bits */
- function sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {
- var q = ENDOFCHAIN;
- if(idx === ENDOFCHAIN) {
- if(cnt !== 0) throw new Error("DIFAT chain shorter than expected");
- } else if(idx !== -1 /*FREESECT*/) {
- var sector = sectors[idx], m = (ssz>>>2)-1;
- if(!sector) return;
- for(var i = 0; i < m; ++i) {
- if((q = __readInt32LE(sector,i*4)) === ENDOFCHAIN) break;
- fat_addrs.push(q);
- }
- sleuth_fat(__readInt32LE(sector,ssz-4),cnt - 1, sectors, ssz, fat_addrs);
- }
- }
-
- /** Follow the linked list of sectors for a given starting point */
- function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {
- var buf = [], buf_chain = [];
- if(!chkd) chkd = [];
- var modulus = ssz - 1, j = 0, jj = 0;
- for(j=start; j>=0;) {
- chkd[j] = true;
- buf[buf.length] = j;
- buf_chain.push(sectors[j]);
- var addr = fat_addrs[Math.floor(j*4/ssz)];
- jj = ((j*4) & modulus);
- if(ssz < 4 + jj) throw new Error("FAT boundary crossed: " + j + " 4 "+ssz);
- if(!sectors[addr]) break;
- j = __readInt32LE(sectors[addr], jj);
- }
- return {nodes: buf, data:__toBuffer([buf_chain])};
- }
-
- /** Chase down the sector linked lists */
- function make_sector_list(sectors, dir_start, fat_addrs, ssz) {
- var sl = sectors.length, sector_list = ([]);
- var chkd = [], buf = [], buf_chain = [];
- var modulus = ssz - 1, i=0, j=0, k=0, jj=0;
- for(i=0; i < sl; ++i) {
- buf = ([]);
- k = (i + dir_start); if(k >= sl) k-=sl;
- if(chkd[k]) continue;
- buf_chain = [];
- for(j=k; j>=0;) {
- chkd[j] = true;
- buf[buf.length] = j;
- buf_chain.push(sectors[j]);
- var addr = fat_addrs[Math.floor(j*4/ssz)];
- jj = ((j*4) & modulus);
- if(ssz < 4 + jj) throw new Error("FAT boundary crossed: " + j + " 4 "+ssz);
- if(!sectors[addr]) break;
- j = __readInt32LE(sectors[addr], jj);
- }
- sector_list[k] = ({nodes: buf, data:__toBuffer([buf_chain])});
- }
- return sector_list;
- }
-
- /* [MS-CFB] 2.6.1 Compound File Directory Entry */
- function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, mini) {
- var minifat_store = 0, pl = (Paths.length?2:0);
- var sector = sector_list[dir_start].data;
- var i = 0, namelen = 0, name;
- for(; i < sector.length; i+= 128) {
- var blob = sector.slice(i, i+128);
- prep_blob(blob, 64);
- namelen = blob.read_shift(2);
- name = __utf16le(blob,0,namelen-pl);
- Paths.push(name);
- var o = ({
- name: name,
- type: blob.read_shift(1),
- color: blob.read_shift(1),
- L: blob.read_shift(4, 'i'),
- R: blob.read_shift(4, 'i'),
- C: blob.read_shift(4, 'i'),
- clsid: blob.read_shift(16),
- state: blob.read_shift(4, 'i'),
- start: 0,
- size: 0
- });
- var ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);
- if(ctime !== 0) o.ct = read_date(blob, blob.l-8);
- var mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);
- if(mtime !== 0) o.mt = read_date(blob, blob.l-8);
- o.start = blob.read_shift(4, 'i');
- o.size = blob.read_shift(4, 'i');
- if(o.size < 0 && o.start < 0) { o.size = o.type = 0; o.start = ENDOFCHAIN; o.name = ""; }
- if(o.type === 5) { /* root */
- minifat_store = o.start;
- if(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = "!StreamData";
- /*minifat_size = o.size;*/
- } else if(o.size >= 4096 /* MSCSZ */) {
- o.storage = 'fat';
- if(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);
- sector_list[o.start].name = o.name;
- o.content = (sector_list[o.start].data.slice(0,o.size));
- } else {
- o.storage = 'minifat';
- if(o.size < 0) o.size = 0;
- else if(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) {
- o.content = get_mfat_entry(o, sector_list[minifat_store].data, (sector_list[mini]||{}).data);
- }
- }
- if(o.content) prep_blob(o.content, 0);
- files[name] = o;
- FileIndex.push(o);
- }
- }
-
- function read_date(blob, offset) {
- return new Date(( ( (__readUInt32LE(blob,offset+4)/1e7)*Math.pow(2,32)+__readUInt32LE(blob,offset)/1e7 ) - 11644473600)*1000);
- }
-
- function read_file(filename, options) {
- get_fs();
- return parse(fs.readFileSync(filename), options);
- }
-
- function read(blob, options) {
- switch(options && options.type || "base64") {
- case "file": return read_file(blob, options);
- case "base64": return parse(s2a(Base64.decode(blob)), options);
- case "binary": return parse(s2a(blob), options);
- }
- return parse(blob, options);
- }
-
- function init_cfb(cfb, opts) {
- var o = opts || {}, root = o.root || "Root Entry";
- if(!cfb.FullPaths) cfb.FullPaths = [];
- if(!cfb.FileIndex) cfb.FileIndex = [];
- if(cfb.FullPaths.length !== cfb.FileIndex.length) throw new Error("inconsistent CFB structure");
- if(cfb.FullPaths.length === 0) {
- cfb.FullPaths[0] = root + "/";
- cfb.FileIndex[0] = ({ name: root, type: 5 });
- }
- if(o.CLSID) cfb.FileIndex[0].clsid = o.CLSID;
- seed_cfb(cfb);
- }
- function seed_cfb(cfb) {
- var nm = "\u0001Sh33tJ5";
- if(CFB.find(cfb, "/" + nm)) return;
- var p = new_buf(4); p[0] = 55; p[1] = p[3] = 50; p[2] = 54;
- cfb.FileIndex.push(({ name: nm, type: 2, content:p, size:4, L:69, R:69, C:69 }));
- cfb.FullPaths.push(cfb.FullPaths[0] + nm);
- rebuild_cfb(cfb);
- }
- function rebuild_cfb(cfb, f) {
- init_cfb(cfb);
- var gc = false, s = false;
- for(var i = cfb.FullPaths.length - 1; i >= 0; --i) {
- var _file = cfb.FileIndex[i];
- switch(_file.type) {
- case 0:
- if(s) gc = true;
- else { cfb.FileIndex.pop(); cfb.FullPaths.pop(); }
- break;
- case 1: case 2: case 5:
- s = true;
- if(isNaN(_file.R * _file.L * _file.C)) gc = true;
- if(_file.R > -1 && _file.L > -1 && _file.R == _file.L) gc = true;
- break;
- default: gc = true; break;
- }
- }
- if(!gc && !f) return;
-
- var now = new Date(1987, 1, 19), j = 0;
- var data = [];
- for(i = 0; i < cfb.FullPaths.length; ++i) {
- if(cfb.FileIndex[i].type === 0) continue;
- data.push([cfb.FullPaths[i], cfb.FileIndex[i]]);
- }
- for(i = 0; i < data.length; ++i) {
- var dad = dirname(data[i][0]);
- s = false;
- for(j = 0; j < data.length; ++j) if(data[j][0] === dad) s = true;
- if(!s) data.push([dad, ({
- name: filename(dad).replace("/",""),
- type: 1,
- clsid: HEADER_CLSID,
- ct: now, mt: now,
- content: null
- })]);
- }
-
- data.sort(function(x,y) { return namecmp(x[0], y[0]); });
- cfb.FullPaths = []; cfb.FileIndex = [];
- for(i = 0; i < data.length; ++i) { cfb.FullPaths[i] = data[i][0]; cfb.FileIndex[i] = data[i][1]; }
- for(i = 0; i < data.length; ++i) {
- var elt = cfb.FileIndex[i];
- var nm = cfb.FullPaths[i];
-
- elt.name = filename(nm).replace("/","");
- elt.L = elt.R = elt.C = -(elt.color = 1);
- elt.size = elt.content ? elt.content.length : 0;
- elt.start = 0;
- elt.clsid = (elt.clsid || HEADER_CLSID);
- if(i === 0) {
- elt.C = data.length > 1 ? 1 : -1;
- elt.size = 0;
- elt.type = 5;
- } else if(nm.slice(-1) == "/") {
- for(j=i+1;j < data.length; ++j) if(dirname(cfb.FullPaths[j])==nm) break;
- elt.C = j >= data.length ? -1 : j;
- for(j=i+1;j < data.length; ++j) if(dirname(cfb.FullPaths[j])==dirname(nm)) break;
- elt.R = j >= data.length ? -1 : j;
- elt.type = 1;
- } else {
- if(dirname(cfb.FullPaths[i+1]||"") == dirname(nm)) elt.R = i + 1;
- elt.type = 2;
- }
- }
-
- }
-
- function _write(cfb, options) {
- var _opts = options || {};
- rebuild_cfb(cfb);
- if(_opts.fileType == 'zip') return write_zip(cfb, _opts);
- var L = (function(cfb){
- var mini_size = 0, fat_size = 0;
- for(var i = 0; i < cfb.FileIndex.length; ++i) {
- var file = cfb.FileIndex[i];
- if(!file.content) continue;
- var flen = file.content.length;
- if(flen > 0){
- if(flen < 0x1000) mini_size += (flen + 0x3F) >> 6;
- else fat_size += (flen + 0x01FF) >> 9;
- }
- }
- var dir_cnt = (cfb.FullPaths.length +3) >> 2;
- var mini_cnt = (mini_size + 7) >> 3;
- var mfat_cnt = (mini_size + 0x7F) >> 7;
- var fat_base = mini_cnt + fat_size + dir_cnt + mfat_cnt;
- var fat_cnt = (fat_base + 0x7F) >> 7;
- var difat_cnt = fat_cnt <= 109 ? 0 : Math.ceil((fat_cnt-109)/0x7F);
- while(((fat_base + fat_cnt + difat_cnt + 0x7F) >> 7) > fat_cnt) difat_cnt = ++fat_cnt <= 109 ? 0 : Math.ceil((fat_cnt-109)/0x7F);
- var L = [1, difat_cnt, fat_cnt, mfat_cnt, dir_cnt, fat_size, mini_size, 0];
- cfb.FileIndex[0].size = mini_size << 6;
- L[7] = (cfb.FileIndex[0].start=L[0]+L[1]+L[2]+L[3]+L[4]+L[5])+((L[6]+7) >> 3);
- return L;
- })(cfb);
- var o = new_buf(L[7] << 9);
- var i = 0, T = 0;
- {
- for(i = 0; i < 8; ++i) o.write_shift(1, HEADER_SIG[i]);
- for(i = 0; i < 8; ++i) o.write_shift(2, 0);
- o.write_shift(2, 0x003E);
- o.write_shift(2, 0x0003);
- o.write_shift(2, 0xFFFE);
- o.write_shift(2, 0x0009);
- o.write_shift(2, 0x0006);
- for(i = 0; i < 3; ++i) o.write_shift(2, 0);
- o.write_shift(4, 0);
- o.write_shift(4, L[2]);
- o.write_shift(4, L[0] + L[1] + L[2] + L[3] - 1);
- o.write_shift(4, 0);
- o.write_shift(4, 1<<12);
- o.write_shift(4, L[3] ? L[0] + L[1] + L[2] - 1: ENDOFCHAIN);
- o.write_shift(4, L[3]);
- o.write_shift(-4, L[1] ? L[0] - 1: ENDOFCHAIN);
- o.write_shift(4, L[1]);
- for(i = 0; i < 109; ++i) o.write_shift(-4, i < L[2] ? L[1] + i : -1);
- }
- if(L[1]) {
- for(T = 0; T < L[1]; ++T) {
- for(; i < 236 + T * 127; ++i) o.write_shift(-4, i < L[2] ? L[1] + i : -1);
- o.write_shift(-4, T === L[1] - 1 ? ENDOFCHAIN : T + 1);
- }
- }
- var chainit = function(w) {
- for(T += w; i<T-1; ++i) o.write_shift(-4, i+1);
- if(w) { ++i; o.write_shift(-4, ENDOFCHAIN); }
- };
- T = i = 0;
- for(T+=L[1]; i<T; ++i) o.write_shift(-4, consts.DIFSECT);
- for(T+=L[2]; i<T; ++i) o.write_shift(-4, consts.FATSECT);
- chainit(L[3]);
- chainit(L[4]);
- var j = 0, flen = 0;
- var file = cfb.FileIndex[0];
- for(; j < cfb.FileIndex.length; ++j) {
- file = cfb.FileIndex[j];
- if(!file.content) continue;
- flen = file.content.length;
- if(flen < 0x1000) continue;
- file.start = T;
- chainit((flen + 0x01FF) >> 9);
- }
- chainit((L[6] + 7) >> 3);
- while(o.l & 0x1FF) o.write_shift(-4, consts.ENDOFCHAIN);
- T = i = 0;
- for(j = 0; j < cfb.FileIndex.length; ++j) {
- file = cfb.FileIndex[j];
- if(!file.content) continue;
- flen = file.content.length;
- if(!flen || flen >= 0x1000) continue;
- file.start = T;
- chainit((flen + 0x3F) >> 6);
- }
- while(o.l & 0x1FF) o.write_shift(-4, consts.ENDOFCHAIN);
- for(i = 0; i < L[4]<<2; ++i) {
- var nm = cfb.FullPaths[i];
- if(!nm || nm.length === 0) {
- for(j = 0; j < 17; ++j) o.write_shift(4, 0);
- for(j = 0; j < 3; ++j) o.write_shift(4, -1);
- for(j = 0; j < 12; ++j) o.write_shift(4, 0);
- continue;
- }
- file = cfb.FileIndex[i];
- if(i === 0) file.start = file.size ? file.start - 1 : ENDOFCHAIN;
- var _nm = (i === 0 && _opts.root) || file.name;
- flen = 2*(_nm.length+1);
- o.write_shift(64, _nm, "utf16le");
- o.write_shift(2, flen);
- o.write_shift(1, file.type);
- o.write_shift(1, file.color);
- o.write_shift(-4, file.L);
- o.write_shift(-4, file.R);
- o.write_shift(-4, file.C);
- if(!file.clsid) for(j = 0; j < 4; ++j) o.write_shift(4, 0);
- else o.write_shift(16, file.clsid, "hex");
- o.write_shift(4, file.state || 0);
- o.write_shift(4, 0); o.write_shift(4, 0);
- o.write_shift(4, 0); o.write_shift(4, 0);
- o.write_shift(4, file.start);
- o.write_shift(4, file.size); o.write_shift(4, 0);
- }
- for(i = 1; i < cfb.FileIndex.length; ++i) {
- file = cfb.FileIndex[i];
- if(file.size >= 0x1000) {
- o.l = (file.start+1) << 9;
- for(j = 0; j < file.size; ++j) o.write_shift(1, file.content[j]);
- for(; j & 0x1FF; ++j) o.write_shift(1, 0);
- }
- }
- for(i = 1; i < cfb.FileIndex.length; ++i) {
- file = cfb.FileIndex[i];
- if(file.size > 0 && file.size < 0x1000) {
- for(j = 0; j < file.size; ++j) o.write_shift(1, file.content[j]);
- for(; j & 0x3F; ++j) o.write_shift(1, 0);
- }
- }
- while(o.l < o.length) o.write_shift(1, 0);
- return o;
- }
- /* [MS-CFB] 2.6.4 (Unicode 3.0.1 case conversion) */
- function find(cfb, path) {
- var UCFullPaths = cfb.FullPaths.map(function(x) { return x.toUpperCase(); });
- var UCPaths = UCFullPaths.map(function(x) { var y = x.split("/"); return y[y.length - (x.slice(-1) == "/" ? 2 : 1)]; });
- var k = false;
- if(path.charCodeAt(0) === 47 /* "/" */) { k = true; path = UCFullPaths[0].slice(0, -1) + path; }
- else k = path.indexOf("/") !== -1;
- var UCPath = path.toUpperCase();
- var w = k === true ? UCFullPaths.indexOf(UCPath) : UCPaths.indexOf(UCPath);
- if(w !== -1) return cfb.FileIndex[w];
-
- var m = !UCPath.match(chr1);
- UCPath = UCPath.replace(chr0,'');
- if(m) UCPath = UCPath.replace(chr1,'!');
- for(w = 0; w < UCFullPaths.length; ++w) {
- if((m ? UCFullPaths[w].replace(chr1,'!') : UCFullPaths[w]).replace(chr0,'') == UCPath) return cfb.FileIndex[w];
- if((m ? UCPaths[w].replace(chr1,'!') : UCPaths[w]).replace(chr0,'') == UCPath) return cfb.FileIndex[w];
- }
- return null;
- }
- /** CFB Constants */
- var MSSZ = 64; /* Mini Sector Size = 1<<6 */
- //var MSCSZ = 4096; /* Mini Stream Cutoff Size */
- /* 2.1 Compound File Sector Numbers and Types */
- var ENDOFCHAIN = -2;
- /* 2.2 Compound File Header */
- var HEADER_SIGNATURE = 'd0cf11e0a1b11ae1';
- var HEADER_SIG = [0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1];
- var HEADER_CLSID = '00000000000000000000000000000000';
- var consts = {
- /* 2.1 Compund File Sector Numbers and Types */
- MAXREGSECT: -6,
- DIFSECT: -4,
- FATSECT: -3,
- ENDOFCHAIN: ENDOFCHAIN,
- FREESECT: -1,
- /* 2.2 Compound File Header */
- HEADER_SIGNATURE: HEADER_SIGNATURE,
- HEADER_MINOR_VERSION: '3e00',
- MAXREGSID: -6,
- NOSTREAM: -1,
- HEADER_CLSID: HEADER_CLSID,
- /* 2.6.1 Compound File Directory Entry */
- EntryTypes: ['unknown','storage','stream','lockbytes','property','root']
- };
-
- function write_file(cfb, filename, options) {
- get_fs();
- var o = _write(cfb, options);
- fs.writeFileSync(filename, o);
- }
-
- function a2s(o) {
- var out = new Array(o.length);
- for(var i = 0; i < o.length; ++i) out[i] = String.fromCharCode(o[i]);
- return out.join("");
- }
-
- function write(cfb, options) {
- var o = _write(cfb, options);
- switch(options && options.type) {
- case "file": get_fs(); fs.writeFileSync(options.filename, (o)); return o;
- case "binary": return a2s(o);
- case "base64": return Base64.encode(a2s(o));
- }
- return o;
- }
- /* node < 8.1 zlib does not expose bytesRead, so default to pure JS */
- var _zlib;
- function use_zlib(zlib) { try {
- var InflateRaw = zlib.InflateRaw;
- var InflRaw = new InflateRaw();
- InflRaw._processChunk(new Uint8Array([3, 0]), InflRaw._finishFlushFlag);
- if(InflRaw.bytesRead) _zlib = zlib;
- else throw new Error("zlib does not expose bytesRead");
- } catch(e) {console.error("cannot use native zlib: " + (e.message || e)); } }
-
- function _inflateRawSync(payload, usz) {
- if(!_zlib) return _inflate(payload, usz);
- var InflateRaw = _zlib.InflateRaw;
- var InflRaw = new InflateRaw();
- var out = InflRaw._processChunk(payload.slice(payload.l), InflRaw._finishFlushFlag);
- payload.l += InflRaw.bytesRead;
- return out;
- }
-
- function _deflateRawSync(payload) {
- return _zlib ? _zlib.deflateRawSync(payload) : _deflate(payload);
- }
- var CLEN_ORDER = [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];
-
- /* LEN_ID = [ 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285 ]; */
- var LEN_LN = [ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13 , 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258 ];
-
- /* DST_ID = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 ]; */
- var DST_LN = [ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 ];
-
- function bit_swap_8(n) { var t = (((((n<<1)|(n<<11)) & 0x22110) | (((n<<5)|(n<<15)) & 0x88440))); return ((t>>16) | (t>>8) |t)&0xFF; }
-
- var use_typed_arrays = typeof Uint8Array !== 'undefined';
-
- var bitswap8 = use_typed_arrays ? new Uint8Array(1<<8) : [];
- for(var q = 0; q < (1<<8); ++q) bitswap8[q] = bit_swap_8(q);
-
- function bit_swap_n(n, b) {
- var rev = bitswap8[n & 0xFF];
- if(b <= 8) return rev >>> (8-b);
- rev = (rev << 8) | bitswap8[(n>>8)&0xFF];
- if(b <= 16) return rev >>> (16-b);
- rev = (rev << 8) | bitswap8[(n>>16)&0xFF];
- return rev >>> (24-b);
- }
-
- /* helpers for unaligned bit reads */
- function read_bits_2(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 6 ? 0 : buf[h+1]<<8))>>>w)& 0x03; }
- function read_bits_3(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 5 ? 0 : buf[h+1]<<8))>>>w)& 0x07; }
- function read_bits_4(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 4 ? 0 : buf[h+1]<<8))>>>w)& 0x0F; }
- function read_bits_5(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 3 ? 0 : buf[h+1]<<8))>>>w)& 0x1F; }
- function read_bits_7(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 1 ? 0 : buf[h+1]<<8))>>>w)& 0x7F; }
-
- /* works up to n = 3 * 8 + 1 = 25 */
- function read_bits_n(buf, bl, n) {
- var w = (bl&7), h = (bl>>>3), f = ((1<<n)-1);
- var v = buf[h] >>> w;
- if(n < 8 - w) return v & f;
- v |= buf[h+1]<<(8-w);
- if(n < 16 - w) return v & f;
- v |= buf[h+2]<<(16-w);
- if(n < 24 - w) return v & f;
- v |= buf[h+3]<<(24-w);
- return v & f;
- }
-
- /* until ArrayBuffer#realloc is a thing, fake a realloc */
- function realloc(b, sz) {
- var L = b.length, M = 2*L > sz ? 2*L : sz + 5, i = 0;
- if(L >= sz) return b;
- if(has_buf) {
- var o = new_unsafe_buf(M);
- // $FlowIgnore
- if(b.copy) b.copy(o);
- else for(; i < b.length; ++i) o[i] = b[i];
- return o;
- } else if(use_typed_arrays) {
- var a = new Uint8Array(M);
- if(a.set) a.set(b);
- else for(; i < b.length; ++i) a[i] = b[i];
- return a;
- }
- b.length = M;
- return b;
- }
-
- /* zero-filled arrays for older browsers */
- function zero_fill_array(n) {
- var o = new Array(n);
- for(var i = 0; i < n; ++i) o[i] = 0;
- return o;
- }var _deflate = (function() {
- var _deflateRaw = (function() {
- return function deflateRaw(data, out) {
- var boff = 0;
- while(boff < data.length) {
- var L = Math.min(0xFFFF, data.length - boff);
- var h = boff + L == data.length;
- /* TODO: this is only type 0 stored */
- out.write_shift(1, +h);
- out.write_shift(2, L);
- out.write_shift(2, (~L) & 0xFFFF);
- while(L-- > 0) out[out.l++] = data[boff++];
- }
- return out.l;
- };
- })();
-
- return function(data) {
- var buf = new_buf(50+Math.floor(data.length*1.1));
- var off = _deflateRaw(data, buf);
- return buf.slice(0, off);
- };
- })();
- /* modified inflate function also moves original read head */
-
- /* build tree (used for literals and lengths) */
- function build_tree(clens, cmap, MAX) {
- var maxlen = 1, w = 0, i = 0, j = 0, ccode = 0, L = clens.length;
-
- var bl_count = use_typed_arrays ? new Uint16Array(32) : zero_fill_array(32);
- for(i = 0; i < 32; ++i) bl_count[i] = 0;
-
- for(i = L; i < MAX; ++i) clens[i] = 0;
- L = clens.length;
-
- var ctree = use_typed_arrays ? new Uint16Array(L) : zero_fill_array(L); // []
-
- /* build code tree */
- for(i = 0; i < L; ++i) {
- bl_count[(w = clens[i])]++;
- if(maxlen < w) maxlen = w;
- ctree[i] = 0;
- }
- bl_count[0] = 0;
- for(i = 1; i <= maxlen; ++i) bl_count[i+16] = (ccode = (ccode + bl_count[i-1])<<1);
- for(i = 0; i < L; ++i) {
- ccode = clens[i];
- if(ccode != 0) ctree[i] = bl_count[ccode+16]++;
- }
-
- /* cmap[maxlen + 4 bits] = (off&15) + (lit<<4) reverse mapping */
- var cleni = 0;
- for(i = 0; i < L; ++i) {
- cleni = clens[i];
- if(cleni != 0) {
- ccode = bit_swap_n(ctree[i], maxlen)>>(maxlen-cleni);
- for(j = (1<<(maxlen + 4 - cleni)) - 1; j>=0; --j)
- cmap[ccode|(j<<cleni)] = (cleni&15) | (i<<4);
- }
- }
- return maxlen;
- }
-
- var fix_lmap = use_typed_arrays ? new Uint16Array(512) : zero_fill_array(512);
- var fix_dmap = use_typed_arrays ? new Uint16Array(32) : zero_fill_array(32);
- if(!use_typed_arrays) {
- for(var i = 0; i < 512; ++i) fix_lmap[i] = 0;
- for(i = 0; i < 32; ++i) fix_dmap[i] = 0;
- }
- (function() {
- var dlens = [];
- var i = 0;
- for(;i<32; i++) dlens.push(5);
- build_tree(dlens, fix_dmap, 32);
-
- var clens = [];
- i = 0;
- for(; i<=143; i++) clens.push(8);
- for(; i<=255; i++) clens.push(9);
- for(; i<=279; i++) clens.push(7);
- for(; i<=287; i++) clens.push(8);
- build_tree(clens, fix_lmap, 288);
- })();
-
- var dyn_lmap = use_typed_arrays ? new Uint16Array(32768) : zero_fill_array(32768);
- var dyn_dmap = use_typed_arrays ? new Uint16Array(32768) : zero_fill_array(32768);
- var dyn_cmap = use_typed_arrays ? new Uint16Array(128) : zero_fill_array(128);
- var dyn_len_1 = 1, dyn_len_2 = 1;
-
- /* 5.5.3 Expanding Huffman Codes */
- function dyn(data, boff) {
- /* nomenclature from RFC1951 refers to bit values; these are offset by the implicit constant */
- var _HLIT = read_bits_5(data, boff) + 257; boff += 5;
- var _HDIST = read_bits_5(data, boff) + 1; boff += 5;
- var _HCLEN = read_bits_4(data, boff) + 4; boff += 4;
- var w = 0;
-
- /* grab and store code lengths */
- var clens = use_typed_arrays ? new Uint8Array(19) : zero_fill_array(19);
- var ctree = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];
- var maxlen = 1;
- var bl_count = use_typed_arrays ? new Uint8Array(8) : zero_fill_array(8);
- var next_code = use_typed_arrays ? new Uint8Array(8) : zero_fill_array(8);
- var L = clens.length; /* 19 */
- for(var i = 0; i < _HCLEN; ++i) {
- clens[CLEN_ORDER[i]] = w = read_bits_3(data, boff);
- if(maxlen < w) maxlen = w;
- bl_count[w]++;
- boff += 3;
- }
-
- /* build code tree */
- var ccode = 0;
- bl_count[0] = 0;
- for(i = 1; i <= maxlen; ++i) next_code[i] = ccode = (ccode + bl_count[i-1])<<1;
- for(i = 0; i < L; ++i) if((ccode = clens[i]) != 0) ctree[i] = next_code[ccode]++;
- /* cmap[7 bits from stream] = (off&7) + (lit<<3) */
- var cleni = 0;
- for(i = 0; i < L; ++i) {
- cleni = clens[i];
- if(cleni != 0) {
- ccode = bitswap8[ctree[i]]>>(8-cleni);
- for(var j = (1<<(7-cleni))-1; j>=0; --j) dyn_cmap[ccode|(j<<cleni)] = (cleni&7) | (i<<3);
- }
- }
-
- /* read literal and dist codes at once */
- var hcodes = [];
- maxlen = 1;
- for(; hcodes.length < _HLIT + _HDIST;) {
- ccode = dyn_cmap[read_bits_7(data, boff)];
- boff += ccode & 7;
- switch((ccode >>>= 3)) {
- case 16:
- w = 3 + read_bits_2(data, boff); boff += 2;
- ccode = hcodes[hcodes.length - 1];
- while(w-- > 0) hcodes.push(ccode);
- break;
- case 17:
- w = 3 + read_bits_3(data, boff); boff += 3;
- while(w-- > 0) hcodes.push(0);
- break;
- case 18:
- w = 11 + read_bits_7(data, boff); boff += 7;
- while(w -- > 0) hcodes.push(0);
- break;
- default:
- hcodes.push(ccode);
- if(maxlen < ccode) maxlen = ccode;
- break;
- }
- }
-
- /* build literal / length trees */
- var h1 = hcodes.slice(0, _HLIT), h2 = hcodes.slice(_HLIT);
- for(i = _HLIT; i < 286; ++i) h1[i] = 0;
- for(i = _HDIST; i < 30; ++i) h2[i] = 0;
- dyn_len_1 = build_tree(h1, dyn_lmap, 286);
- dyn_len_2 = build_tree(h2, dyn_dmap, 30);
- return boff;
- }
-
- /* return [ data, bytesRead ] */
- function inflate(data, usz) {
- /* shortcircuit for empty buffer [0x03, 0x00] */
- if(data[0] == 3 && !(data[1] & 0x3)) { return [new_raw_buf(usz), 2]; }
-
- /* bit offset */
- var boff = 0;
-
- /* header includes final bit and type bits */
- var header = 0;
-
- var outbuf = new_unsafe_buf(usz ? usz : (1<<18));
- var woff = 0;
- var OL = outbuf.length>>>0;
- var max_len_1 = 0, max_len_2 = 0;
-
- while((header&1) == 0) {
- header = read_bits_3(data, boff); boff += 3;
- if((header >>> 1) == 0) {
- /* Stored block */
- if(boff & 7) boff += 8 - (boff&7);
- /* 2 bytes sz, 2 bytes bit inverse */
- var sz = data[boff>>>3] | data[(boff>>>3)+1]<<8;
- boff += 32;
- /* push sz bytes */
- if(!usz && OL < woff + sz) { outbuf = realloc(outbuf, woff + sz); OL = outbuf.length; }
- if(typeof data.copy === 'function') {
- // $FlowIgnore
- data.copy(outbuf, woff, boff>>>3, (boff>>>3)+sz);
- woff += sz; boff += 8*sz;
- } else while(sz-- > 0) { outbuf[woff++] = data[boff>>>3]; boff += 8; }
- continue;
- } else if((header >>> 1) == 1) {
- /* Fixed Huffman */
- max_len_1 = 9; max_len_2 = 5;
- } else {
- /* Dynamic Huffman */
- boff = dyn(data, boff);
- max_len_1 = dyn_len_1; max_len_2 = dyn_len_2;
- }
- if(!usz && (OL < woff + 32767)) { outbuf = realloc(outbuf, woff + 32767); OL = outbuf.length; }
- for(;;) { // while(true) is apparently out of vogue in modern JS circles
- /* ingest code and move read head */
- var bits = read_bits_n(data, boff, max_len_1);
- var code = (header>>>1) == 1 ? fix_lmap[bits] : dyn_lmap[bits];
- boff += code & 15; code >>>= 4;
- /* 0-255 are literals, 256 is end of block token, 257+ are copy tokens */
- if(((code>>>8)&0xFF) === 0) outbuf[woff++] = code;
- else if(code == 256) break;
- else {
- code -= 257;
- var len_eb = (code < 8) ? 0 : ((code-4)>>2); if(len_eb > 5) len_eb = 0;
- var tgt = woff + LEN_LN[code];
- /* length extra bits */
- if(len_eb > 0) {
- tgt += read_bits_n(data, boff, len_eb);
- boff += len_eb;
- }
-
- /* dist code */
- bits = read_bits_n(data, boff, max_len_2);
- code = (header>>>1) == 1 ? fix_dmap[bits] : dyn_dmap[bits];
- boff += code & 15; code >>>= 4;
- var dst_eb = (code < 4 ? 0 : (code-2)>>1);
- var dst = DST_LN[code];
- /* dist extra bits */
- if(dst_eb > 0) {
- dst += read_bits_n(data, boff, dst_eb);
- boff += dst_eb;
- }
-
- /* in the common case, manual byte copy is faster than TA set / Buffer copy */
- if(!usz && OL < tgt) { outbuf = realloc(outbuf, tgt); OL = outbuf.length; }
- while(woff < tgt) { outbuf[woff] = outbuf[woff - dst]; ++woff; }
- }
- }
- }
- return [usz ? outbuf : outbuf.slice(0, woff), (boff+7)>>>3];
- }
-
- function _inflate(payload, usz) {
- var data = payload.slice(payload.l||0);
- var out = inflate(data, usz);
- payload.l += out[1];
- return out[0];
- }
-
- function warn_or_throw(wrn, msg) {
- if(wrn) { if(typeof console !== 'undefined') console.error(msg); }
- else throw new Error(msg);
- }
-
- function parse_zip(file, options) {
- var blob = file;
- prep_blob(blob, 0);
-
- var FileIndex = [], FullPaths = [];
- var o = {
- FileIndex: FileIndex,
- FullPaths: FullPaths
- };
- init_cfb(o, { root: options.root });
-
- /* find end of central directory, start just after signature */
- var i = blob.length - 4;
- while((blob[i] != 0x50 || blob[i+1] != 0x4b || blob[i+2] != 0x05 || blob[i+3] != 0x06) && i >= 0) --i;
- blob.l = i + 4;
-
- /* parse end of central directory */
- blob.l += 4;
- var fcnt = blob.read_shift(2);
- blob.l += 6;
- var start_cd = blob.read_shift(4);
-
- /* parse central directory */
- blob.l = start_cd;
-
- for(i = 0; i < fcnt; ++i) {
- /* trust local file header instead of CD entry */
- blob.l += 20;
- var csz = blob.read_shift(4);
- var usz = blob.read_shift(4);
- var namelen = blob.read_shift(2);
- var efsz = blob.read_shift(2);
- var fcsz = blob.read_shift(2);
- blob.l += 8;
- var offset = blob.read_shift(4);
- var EF = parse_extra_field(blob.slice(blob.l+namelen, blob.l+namelen+efsz));
- blob.l += namelen + efsz + fcsz;
-
- var L = blob.l;
- blob.l = offset + 4;
- parse_local_file(blob, csz, usz, o, EF);
- blob.l = L;
- }
-
- return o;
- }
-
-
- /* head starts just after local file header signature */
- function parse_local_file(blob, csz, usz, o, EF) {
- /* [local file header] */
- blob.l += 2;
- var flags = blob.read_shift(2);
- var meth = blob.read_shift(2);
- var date = parse_dos_date(blob);
-
- if(flags & 0x2041) throw new Error("Unsupported ZIP encryption");
- var crc32 = blob.read_shift(4);
- var _csz = blob.read_shift(4);
- var _usz = blob.read_shift(4);
-
- var namelen = blob.read_shift(2);
- var efsz = blob.read_shift(2);
-
- // TODO: flags & (1<<11) // UTF8
- var name = ""; for(var i = 0; i < namelen; ++i) name += String.fromCharCode(blob[blob.l++]);
- if(efsz) {
- var ef = parse_extra_field(blob.slice(blob.l, blob.l + efsz));
- if((ef[0x5455]||{}).mt) date = ef[0x5455].mt;
- if(((EF||{})[0x5455]||{}).mt) date = EF[0x5455].mt;
- }
- blob.l += efsz;
-
- /* [encryption header] */
-
- /* [file data] */
- var data = blob.slice(blob.l, blob.l + _csz);
- switch(meth) {
- case 8: data = _inflateRawSync(blob, _usz); break;
- case 0: break;
- default: throw new Error("Unsupported ZIP Compression method " + meth);
- }
-
- /* [data descriptor] */
- var wrn = false;
- if(flags & 8) {
- crc32 = blob.read_shift(4);
- if(crc32 == 0x08074b50) { crc32 = blob.read_shift(4); wrn = true; }
- _csz = blob.read_shift(4);
- _usz = blob.read_shift(4);
- }
-
- if(_csz != csz) warn_or_throw(wrn, "Bad compressed size: " + csz + " != " + _csz);
- if(_usz != usz) warn_or_throw(wrn, "Bad uncompressed size: " + usz + " != " + _usz);
- var _crc32 = CRC32.buf(data, 0);
- if((crc32>>0) != (_crc32>>0)) warn_or_throw(wrn, "Bad CRC32 checksum: " + crc32 + " != " + _crc32);
- cfb_add(o, name, data, {unsafe: true, mt: date});
- }
- function write_zip(cfb, options) {
- var _opts = options || {};
- var out = [], cdirs = [];
- var o = new_buf(1);
- var method = (_opts.compression ? 8 : 0), flags = 0;
- var desc = false;
- if(desc) flags |= 8;
- var i = 0, j = 0;
-
- var start_cd = 0, fcnt = 0;
- var root = cfb.FullPaths[0], fp = root, fi = cfb.FileIndex[0];
- var crcs = [];
- var sz_cd = 0;
-
- for(i = 1; i < cfb.FullPaths.length; ++i) {
- fp = cfb.FullPaths[i].slice(root.length); fi = cfb.FileIndex[i];
- if(!fi.size || !fi.content || fp == "\u0001Sh33tJ5") continue;
- var start = start_cd;
-
- /* TODO: CP437 filename */
- var namebuf = new_buf(fp.length);
- for(j = 0; j < fp.length; ++j) namebuf.write_shift(1, fp.charCodeAt(j) & 0x7F);
- namebuf = namebuf.slice(0, namebuf.l);
- crcs[fcnt] = CRC32.buf(fi.content, 0);
-
- var outbuf = fi.content;
- if(method == 8) outbuf = _deflateRawSync(outbuf);
-
- /* local file header */
- o = new_buf(30);
- o.write_shift(4, 0x04034b50);
- o.write_shift(2, 20);
- o.write_shift(2, flags);
- o.write_shift(2, method);
- /* TODO: last mod file time/date */
- if(fi.mt) write_dos_date(o, fi.mt);
- else o.write_shift(4, 0);
- o.write_shift(-4, (flags & 8) ? 0 : crcs[fcnt]);
- o.write_shift(4, (flags & 8) ? 0 : outbuf.length);
- o.write_shift(4, (flags & 8) ? 0 : fi.content.length);
- o.write_shift(2, namebuf.length);
- o.write_shift(2, 0);
-
- start_cd += o.length;
- out.push(o);
- start_cd += namebuf.length;
- out.push(namebuf);
-
- /* TODO: encryption header ? */
- start_cd += outbuf.length;
- out.push(outbuf);
-
- /* data descriptor */
- if(flags & 8) {
- o = new_buf(12);
- o.write_shift(-4, crcs[fcnt]);
- o.write_shift(4, outbuf.length);
- o.write_shift(4, fi.content.length);
- start_cd += o.l;
- out.push(o);
- }
-
- /* central directory */
- o = new_buf(46);
- o.write_shift(4, 0x02014b50);
- o.write_shift(2, 0);
- o.write_shift(2, 20);
- o.write_shift(2, flags);
- o.write_shift(2, method);
- o.write_shift(4, 0); /* TODO: last mod file time/date */
- o.write_shift(-4, crcs[fcnt]);
-
- o.write_shift(4, outbuf.length);
- o.write_shift(4, fi.content.length);
- o.write_shift(2, namebuf.length);
- o.write_shift(2, 0);
- o.write_shift(2, 0);
- o.write_shift(2, 0);
- o.write_shift(2, 0);
- o.write_shift(4, 0);
- o.write_shift(4, start);
-
- sz_cd += o.l;
- cdirs.push(o);
- sz_cd += namebuf.length;
- cdirs.push(namebuf);
- ++fcnt;
- }
-
- /* end of central directory */
- o = new_buf(22);
- o.write_shift(4, 0x06054b50);
- o.write_shift(2, 0);
- o.write_shift(2, 0);
- o.write_shift(2, fcnt);
- o.write_shift(2, fcnt);
- o.write_shift(4, sz_cd);
- o.write_shift(4, start_cd);
- o.write_shift(2, 0);
-
- return bconcat(([bconcat((out)), bconcat(cdirs), o]));
- }
- function cfb_new(opts) {
- var o = ({});
- init_cfb(o, opts);
- return o;
- }
-
- function cfb_add(cfb, name, content, opts) {
- var unsafe = opts && opts.unsafe;
- if(!unsafe) init_cfb(cfb);
- var file = !unsafe && CFB.find(cfb, name);
- if(!file) {
- var fpath = cfb.FullPaths[0];
- if(name.slice(0, fpath.length) == fpath) fpath = name;
- else {
- if(fpath.slice(-1) != "/") fpath += "/";
- fpath = (fpath + name).replace("//","/");
- }
- file = ({name: filename(name), type: 2});
- cfb.FileIndex.push(file);
- cfb.FullPaths.push(fpath);
- if(!unsafe) CFB.utils.cfb_gc(cfb);
- }
- file.content = (content);
- file.size = content ? content.length : 0;
- if(opts) {
- if(opts.CLSID) file.clsid = opts.CLSID;
- if(opts.mt) file.mt = opts.mt;
- if(opts.ct) file.ct = opts.ct;
- }
- return file;
- }
-
- function cfb_del(cfb, name) {
- init_cfb(cfb);
- var file = CFB.find(cfb, name);
- if(file) for(var j = 0; j < cfb.FileIndex.length; ++j) if(cfb.FileIndex[j] == file) {
- cfb.FileIndex.splice(j, 1);
- cfb.FullPaths.splice(j, 1);
- return true;
- }
- return false;
- }
-
- function cfb_mov(cfb, old_name, new_name) {
- init_cfb(cfb);
- var file = CFB.find(cfb, old_name);
- if(file) for(var j = 0; j < cfb.FileIndex.length; ++j) if(cfb.FileIndex[j] == file) {
- cfb.FileIndex[j].name = filename(new_name);
- cfb.FullPaths[j] = new_name;
- return true;
- }
- return false;
- }
-
- function cfb_gc(cfb) { rebuild_cfb(cfb, true); }
-
- exports.find = find;
- exports.read = read;
- exports.parse = parse;
- exports.write = write;
- exports.writeFile = write_file;
- exports.utils = {
- cfb_new: cfb_new,
- cfb_add: cfb_add,
- cfb_del: cfb_del,
- cfb_mov: cfb_mov,
- cfb_gc: cfb_gc,
- ReadShift: ReadShift,
- CheckField: CheckField,
- prep_blob: prep_blob,
- bconcat: bconcat,
- use_zlib: use_zlib,
- _deflateRaw: _deflate,
- _inflateRaw: _inflate,
- consts: consts
- };
-
- return exports;
- })();
-
- if( true && typeof DO_NOT_EXPORT_CFB === 'undefined') { module.exports = CFB; }
- var _fs;
- if(true) try { _fs = __webpack_require__(/*! fs */ 1); } catch(e) {}
-
- /* normalize data for blob ctor */
- function blobify(data) {
- if(typeof data === "string") return s2ab(data);
- if(Array.isArray(data)) return a2u(data);
- return data;
- }
- /* write or download file */
- function write_dl(fname, payload, enc) {
- /*global IE_SaveFile, Blob, navigator, saveAs, URL, document, File, chrome */
- if(typeof _fs !== 'undefined' && _fs.writeFileSync) return enc ? _fs.writeFileSync(fname, payload, enc) : _fs.writeFileSync(fname, payload);
- var data = (enc == "utf8") ? utf8write(payload) : payload;
- if(typeof IE_SaveFile !== 'undefined') return IE_SaveFile(data, fname);
- if(typeof Blob !== 'undefined') {
- var blob = new Blob([blobify(data)], {type:"application/octet-stream"});
- if(typeof navigator !== 'undefined' && navigator.msSaveBlob) return navigator.msSaveBlob(blob, fname);
- if(typeof saveAs !== 'undefined') return saveAs(blob, fname);
- if(typeof URL !== 'undefined' && typeof document !== 'undefined' && document.createElement && URL.createObjectURL) {
- var url = URL.createObjectURL(blob);
- if(typeof chrome === 'object' && typeof (chrome.downloads||{}).download == "function") {
- if(URL.revokeObjectURL && typeof setTimeout !== 'undefined') setTimeout(function() { URL.revokeObjectURL(url); }, 60000);
- return chrome.downloads.download({ url: url, filename: fname, saveAs: true});
- }
- var a = document.createElement("a");
- if(a.download != null) {
- a.download = fname; a.href = url; document.body.appendChild(a); a.click();
- document.body.removeChild(a);
- if(URL.revokeObjectURL && typeof setTimeout !== 'undefined') setTimeout(function() { URL.revokeObjectURL(url); }, 60000);
- return url;
- }
- }
- }
- // $FlowIgnore
- if(typeof $ !== 'undefined' && typeof File !== 'undefined' && typeof Folder !== 'undefined') try { // extendscript
- // $FlowIgnore
- var out = File(fname); out.open("w"); out.encoding = "binary";
- if(Array.isArray(payload)) payload = a2s(payload);
- out.write(payload); out.close(); return payload;
- } catch(e) { if(!e.message || !e.message.match(/onstruct/)) throw e; }
- throw new Error("cannot save file " + fname);
- }
-
- /* read binary data from file */
- function read_binary(path) {
- if(typeof _fs !== 'undefined') return _fs.readFileSync(path);
- // $FlowIgnore
- if(typeof $ !== 'undefined' && typeof File !== 'undefined' && typeof Folder !== 'undefined') try { // extendscript
- // $FlowIgnore
- var infile = File(path); infile.open("r"); infile.encoding = "binary";
- var data = infile.read(); infile.close();
- return data;
- } catch(e) { if(!e.message || !e.message.match(/onstruct/)) throw e; }
- throw new Error("Cannot access file " + path);
- }
- function keys(o) {
- var ks = Object.keys(o), o2 = [];
- for(var i = 0; i < ks.length; ++i) if(o.hasOwnProperty(ks[i])) o2.push(ks[i]);
- return o2;
- }
-
- function evert_key(obj, key) {
- var o = ([]), K = keys(obj);
- for(var i = 0; i !== K.length; ++i) if(o[obj[K[i]][key]] == null) o[obj[K[i]][key]] = K[i];
- return o;
- }
-
- function evert(obj) {
- var o = ([]), K = keys(obj);
- for(var i = 0; i !== K.length; ++i) o[obj[K[i]]] = K[i];
- return o;
- }
-
- function evert_num(obj) {
- var o = ([]), K = keys(obj);
- for(var i = 0; i !== K.length; ++i) o[obj[K[i]]] = parseInt(K[i],10);
- return o;
- }
-
- function evert_arr(obj) {
- var o = ([]), K = keys(obj);
- for(var i = 0; i !== K.length; ++i) {
- if(o[obj[K[i]]] == null) o[obj[K[i]]] = [];
- o[obj[K[i]]].push(K[i]);
- }
- return o;
- }
-
- var basedate = new Date(1899, 11, 30, 0, 0, 0); // 2209161600000
- var dnthresh = basedate.getTime() + (new Date().getTimezoneOffset() - basedate.getTimezoneOffset()) * 60000;
- function datenum(v, date1904) {
- var epoch = v.getTime();
- if(date1904) epoch -= 1462*24*60*60*1000;
- return (epoch - dnthresh) / (24 * 60 * 60 * 1000);
- }
- function numdate(v) {
- var out = new Date();
- out.setTime(v * 24 * 60 * 60 * 1000 + dnthresh);
- return out;
- }
-
- /* ISO 8601 Duration */
- function parse_isodur(s) {
- var sec = 0, mt = 0, time = false;
- var m = s.match(/P([0-9\.]+Y)?([0-9\.]+M)?([0-9\.]+D)?T([0-9\.]+H)?([0-9\.]+M)?([0-9\.]+S)?/);
- if(!m) throw new Error("|" + s + "| is not an ISO8601 Duration");
- for(var i = 1; i != m.length; ++i) {
- if(!m[i]) continue;
- mt = 1;
- if(i > 3) time = true;
- switch(m[i].slice(m[i].length-1)) {
- case 'Y':
- throw new Error("Unsupported ISO Duration Field: " + m[i].slice(m[i].length-1));
- case 'D': mt *= 24;
- /* falls through */
- case 'H': mt *= 60;
- /* falls through */
- case 'M':
- if(!time) throw new Error("Unsupported ISO Duration Field: M");
- else mt *= 60;
- /* falls through */
- case 'S': break;
- }
- sec += mt * parseInt(m[i], 10);
- }
- return sec;
- }
-
- var good_pd_date = new Date('2017-02-19T19:06:09.000Z');
- if(isNaN(good_pd_date.getFullYear())) good_pd_date = new Date('2/19/17');
- var good_pd = good_pd_date.getFullYear() == 2017;
- /* parses a date as a local date */
- function parseDate(str, fixdate) {
- var d = new Date(str);
- if(good_pd) {
- if(fixdate > 0) d.setTime(d.getTime() + d.getTimezoneOffset() * 60 * 1000);
- else if(fixdate < 0) d.setTime(d.getTime() - d.getTimezoneOffset() * 60 * 1000);
- return d;
- }
- if(str instanceof Date) return str;
- if(good_pd_date.getFullYear() == 1917 && !isNaN(d.getFullYear())) {
- var s = d.getFullYear();
- if(str.indexOf("" + s) > -1) return d;
- d.setFullYear(d.getFullYear() + 100); return d;
- }
- var n = str.match(/\d+/g)||["2017","2","19","0","0","0"];
- var out = new Date(+n[0], +n[1] - 1, +n[2], (+n[3]||0), (+n[4]||0), (+n[5]||0));
- if(str.indexOf("Z") > -1) out = new Date(out.getTime() - out.getTimezoneOffset() * 60 * 1000);
- return out;
- }
-
- function cc2str(arr) {
- var o = "";
- for(var i = 0; i != arr.length; ++i) o += String.fromCharCode(arr[i]);
- return o;
- }
-
- function dup(o) {
- if(typeof JSON != 'undefined' && !Array.isArray(o)) return JSON.parse(JSON.stringify(o));
- if(typeof o != 'object' || o == null) return o;
- if(o instanceof Date) return new Date(o.getTime());
- var out = {};
- for(var k in o) if(o.hasOwnProperty(k)) out[k] = dup(o[k]);
- return out;
- }
-
- function fill(c,l) { var o = ""; while(o.length < l) o+=c; return o; }
-
- /* TODO: stress test */
- function fuzzynum(s) {
- var v = Number(s);
- if(!isNaN(v)) return v;
- var wt = 1;
- var ss = s.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g, function() { wt *= 100; return "";});
- if(!isNaN(v = Number(ss))) return v / wt;
- ss = ss.replace(/[(](.*)[)]/,function($$, $1) { wt = -wt; return $1;});
- if(!isNaN(v = Number(ss))) return v / wt;
- return v;
- }
- function fuzzydate(s) {
- var o = new Date(s), n = new Date(NaN);
- var y = o.getYear(), m = o.getMonth(), d = o.getDate();
- if(isNaN(d)) return n;
- if(y < 0 || y > 8099) return n;
- if((m > 0 || d > 1) && y != 101) return o;
- if(s.toLowerCase().match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)) return o;
- if(s.match(/[^-0-9:,\/\\]/)) return n;
- return o;
- }
-
- var safe_split_regex = "abacaba".split(/(:?b)/i).length == 5;
- function split_regex(str, re, def) {
- if(safe_split_regex || typeof re == "string") return str.split(re);
- var p = str.split(re), o = [p[0]];
- for(var i = 1; i < p.length; ++i) { o.push(def); o.push(p[i]); }
- return o;
- }
- function getdatastr(data) {
- if(!data) return null;
- if(data.data) return debom(data.data);
- if(data.asNodeBuffer && has_buf) return debom(data.asNodeBuffer().toString('binary'));
- if(data.asBinary) return debom(data.asBinary());
- if(data._data && data._data.getContent) return debom(cc2str(Array.prototype.slice.call(data._data.getContent(),0)));
- if(data.content && data.type) return debom(cc2str(data.content));
- return null;
- }
-
- function getdatabin(data) {
- if(!data) return null;
- if(data.data) return char_codes(data.data);
- if(data.asNodeBuffer && has_buf) return data.asNodeBuffer();
- if(data._data && data._data.getContent) {
- var o = data._data.getContent();
- if(typeof o == "string") return char_codes(o);
- return Array.prototype.slice.call(o);
- }
- if(data.content && data.type) return data.content;
- return null;
- }
-
- function getdata(data) { return (data && data.name.slice(-4) === ".bin") ? getdatabin(data) : getdatastr(data); }
-
- /* Part 2 Section 10.1.2 "Mapping Content Types" Names are case-insensitive */
- /* OASIS does not comment on filename case sensitivity */
- function safegetzipfile(zip, file) {
- var k = zip.FullPaths || keys(zip.files);
- var f = file.toLowerCase(), g = f.replace(/\//g,'\\');
- for(var i=0; i<k.length; ++i) {
- var n = k[i].toLowerCase();
- if(f == n || g == n) return zip.files[k[i]];
- }
- return null;
- }
-
- function getzipfile(zip, file) {
- var o = safegetzipfile(zip, file);
- if(o == null) throw new Error("Cannot find file " + file + " in zip");
- return o;
- }
-
- function getzipdata(zip, file, safe) {
- if(!safe) return getdata(getzipfile(zip, file));
- if(!file) return null;
- try { return getzipdata(zip, file); } catch(e) { return null; }
- }
-
- function getzipstr(zip, file, safe) {
- if(!safe) return getdatastr(getzipfile(zip, file));
- if(!file) return null;
- try { return getzipstr(zip, file); } catch(e) { return null; }
- }
-
- function zipentries(zip) {
- var k = zip.FullPaths || keys(zip.files), o = [];
- for(var i = 0; i < k.length; ++i) if(k[i].slice(-1) != '/') o.push(k[i]);
- return o.sort();
- }
-
- function zip_add_file(zip, path, content) {
- if(zip.FullPaths) CFB.utils.cfb_add(zip, path, content);
- else zip.file(path, content);
- }
-
- var jszip;
- /*global JSZipSync:true */
- if(typeof JSZipSync !== 'undefined') jszip = JSZipSync;
- if(true) {
- if( true && module.exports) {
- if(typeof jszip === 'undefined') jszip = __webpack_require__(/*! ./jszip.js */ "./node_modules/xlsx/jszip.js");
- }
- }
-
- function zip_new() {
- if(!jszip) return CFB.utils.cfb_new();
- return new jszip();
- }
-
- function zip_read(d, o) {
- var zip;
- if(jszip) switch(o.type) {
- case "base64": zip = new jszip(d, { base64:true }); break;
- case "binary": case "array": zip = new jszip(d, { base64:false }); break;
- case "buffer": zip = new jszip(d); break;
- default: throw new Error("Unrecognized type " + o.type);
- }
- else switch(o.type) {
- case "base64": zip = CFB.read(d, { type: "base64" }); break;
- case "binary": zip = CFB.read(d, { type: "binary" }); break;
- case "buffer": case "array": zip = CFB.read(d, { type: "buffer" }); break;
- default: throw new Error("Unrecognized type " + o.type);
- }
- return zip;
- }
-
- function resolve_path(path, base) {
- if(path.charAt(0) == "/") return path.slice(1);
- var result = base.split('/');
- if(base.slice(-1) != "/") result.pop(); // folder path
- var target = path.split('/');
- while (target.length !== 0) {
- var step = target.shift();
- if (step === '..') result.pop();
- else if (step !== '.') result.push(step);
- }
- return result.join('/');
- }
- var XML_HEADER = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n';
- var attregexg=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g;
- var tagregex=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s?[\/\?]?>/g;
-
- if(!(XML_HEADER.match(tagregex))) tagregex = /<[^>]*>/g;
- var nsregex=/<\w*:/, nsregex2 = /<(\/?)\w+:/;
- function parsexmltag(tag, skip_root, skip_LC) {
- var z = ({});
- var eq = 0, c = 0;
- for(; eq !== tag.length; ++eq) if((c = tag.charCodeAt(eq)) === 32 || c === 10 || c === 13) break;
- if(!skip_root) z[0] = tag.slice(0, eq);
- if(eq === tag.length) return z;
- var m = tag.match(attregexg), j=0, v="", i=0, q="", cc="", quot = 1;
- if(m) for(i = 0; i != m.length; ++i) {
- cc = m[i];
- for(c=0; c != cc.length; ++c) if(cc.charCodeAt(c) === 61) break;
- q = cc.slice(0,c).trim();
- while(cc.charCodeAt(c+1) == 32) ++c;
- quot = ((eq=cc.charCodeAt(c+1)) == 34 || eq == 39) ? 1 : 0;
- v = cc.slice(c+1+quot, cc.length-quot);
- for(j=0;j!=q.length;++j) if(q.charCodeAt(j) === 58) break;
- if(j===q.length) {
- if(q.indexOf("_") > 0) q = q.slice(0, q.indexOf("_")); // from ods
- z[q] = v;
- if(!skip_LC) z[q.toLowerCase()] = v;
- }
- else {
- var k = (j===5 && q.slice(0,5)==="xmlns"?"xmlns":"")+q.slice(j+1);
- if(z[k] && q.slice(j-3,j) == "ext") continue; // from ods
- z[k] = v;
- if(!skip_LC) z[k.toLowerCase()] = v;
- }
- }
- return z;
- }
- function strip_ns(x) { return x.replace(nsregex2, "<$1"); }
-
- var encodings = {
- '"': '"',
- ''': "'",
- '>': '>',
- '<': '<',
- '&': '&'
- };
- var rencoding = evert(encodings);
- //var rencstr = "&<>'\"".split("");
-
- // TODO: CP remap (need to read file version to determine OS)
- var unescapexml = (function() {
- /* 22.4.2.4 bstr (Basic String) */
- var encregex = /&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/g, coderegex = /_x([\da-fA-F]{4})_/g;
- return function unescapexml(text) {
- var s = text + '', i = s.indexOf("<![CDATA[");
- if(i == -1) return s.replace(encregex, function($$, $1) { return encodings[$$]||String.fromCharCode(parseInt($1,$$.indexOf("x")>-1?16:10))||$$; }).replace(coderegex,function(m,c) {return String.fromCharCode(parseInt(c,16));});
- var j = s.indexOf("]]>");
- return unescapexml(s.slice(0, i)) + s.slice(i+9,j) + unescapexml(s.slice(j+3));
- };
- })();
-
- var decregex=/[&<>'"]/g, charegex = /[\u0000-\u0008\u000b-\u001f]/g;
- function escapexml(text){
- var s = text + '';
- return s.replace(decregex, function(y) { return rencoding[y]; }).replace(charegex,function(s) { return "_x" + ("000"+s.charCodeAt(0).toString(16)).slice(-4) + "_";});
- }
- function escapexmltag(text){ return escapexml(text).replace(/ /g,"_x0020_"); }
-
- var htmlcharegex = /[\u0000-\u001f]/g;
- function escapehtml(text){
- var s = text + '';
- return s.replace(decregex, function(y) { return rencoding[y]; }).replace(/\n/g, "<br/>").replace(htmlcharegex,function(s) { return "&#x" + ("000"+s.charCodeAt(0).toString(16)).slice(-4) + ";"; });
- }
-
- function escapexlml(text){
- var s = text + '';
- return s.replace(decregex, function(y) { return rencoding[y]; }).replace(htmlcharegex,function(s) { return "&#x" + (s.charCodeAt(0).toString(16)).toUpperCase() + ";"; });
- }
-
- /* TODO: handle codepages */
- var xlml_fixstr = (function() {
- var entregex = /&#(\d+);/g;
- function entrepl($$,$1) { return String.fromCharCode(parseInt($1,10)); }
- return function xlml_fixstr(str) { return str.replace(entregex,entrepl); };
- })();
- var xlml_unfixstr = (function() {
- return function xlml_unfixstr(str) { return str.replace(/(\r\n|[\r\n])/g,"\ "); };
- })();
-
- function parsexmlbool(value) {
- switch(value) {
- case 1: case true: case '1': case 'true': case 'TRUE': return true;
- /* case '0': case 'false': case 'FALSE':*/
- default: return false;
- }
- }
-
- var utf8read = function utf8reada(orig) {
- var out = "", i = 0, c = 0, d = 0, e = 0, f = 0, w = 0;
- while (i < orig.length) {
- c = orig.charCodeAt(i++);
- if (c < 128) { out += String.fromCharCode(c); continue; }
- d = orig.charCodeAt(i++);
- if (c>191 && c<224) { f = ((c & 31) << 6); f |= (d & 63); out += String.fromCharCode(f); continue; }
- e = orig.charCodeAt(i++);
- if (c < 240) { out += String.fromCharCode(((c & 15) << 12) | ((d & 63) << 6) | (e & 63)); continue; }
- f = orig.charCodeAt(i++);
- w = (((c & 7) << 18) | ((d & 63) << 12) | ((e & 63) << 6) | (f & 63))-65536;
- out += String.fromCharCode(0xD800 + ((w>>>10)&1023));
- out += String.fromCharCode(0xDC00 + (w&1023));
- }
- return out;
- };
-
- var utf8write = function(orig) {
- var out = [], i = 0, c = 0, d = 0;
- while(i < orig.length) {
- c = orig.charCodeAt(i++);
- switch(true) {
- case c < 128: out.push(String.fromCharCode(c)); break;
- case c < 2048:
- out.push(String.fromCharCode(192 + (c >> 6)));
- out.push(String.fromCharCode(128 + (c & 63)));
- break;
- case c >= 55296 && c < 57344:
- c -= 55296; d = orig.charCodeAt(i++) - 56320 + (c<<10);
- out.push(String.fromCharCode(240 + ((d >>18) & 7)));
- out.push(String.fromCharCode(144 + ((d >>12) & 63)));
- out.push(String.fromCharCode(128 + ((d >> 6) & 63)));
- out.push(String.fromCharCode(128 + (d & 63)));
- break;
- default:
- out.push(String.fromCharCode(224 + (c >> 12)));
- out.push(String.fromCharCode(128 + ((c >> 6) & 63)));
- out.push(String.fromCharCode(128 + (c & 63)));
- }
- }
- return out.join("");
- };
-
- if(has_buf) {
- var utf8readb = function utf8readb(data) {
- var out = Buffer.alloc(2*data.length), w, i, j = 1, k = 0, ww=0, c;
- for(i = 0; i < data.length; i+=j) {
- j = 1;
- if((c=data.charCodeAt(i)) < 128) w = c;
- else if(c < 224) { w = (c&31)*64+(data.charCodeAt(i+1)&63); j=2; }
- else if(c < 240) { w=(c&15)*4096+(data.charCodeAt(i+1)&63)*64+(data.charCodeAt(i+2)&63); j=3; }
- else { j = 4;
- w = (c & 7)*262144+(data.charCodeAt(i+1)&63)*4096+(data.charCodeAt(i+2)&63)*64+(data.charCodeAt(i+3)&63);
- w -= 65536; ww = 0xD800 + ((w>>>10)&1023); w = 0xDC00 + (w&1023);
- }
- if(ww !== 0) { out[k++] = ww&255; out[k++] = ww>>>8; ww = 0; }
- out[k++] = w%256; out[k++] = w>>>8;
- }
- return out.slice(0,k).toString('ucs2');
- };
- var corpus = "foo bar baz\u00e2\u0098\u0083\u00f0\u009f\u008d\u00a3";
- if(utf8read(corpus) == utf8readb(corpus)) utf8read = utf8readb;
- var utf8readc = function utf8readc(data) { return Buffer_from(data, 'binary').toString('utf8'); };
- if(utf8read(corpus) == utf8readc(corpus)) utf8read = utf8readc;
-
- utf8write = function(data) { return Buffer_from(data, 'utf8').toString("binary"); };
- }
-
- // matches <foo>...</foo> extracts content
- var matchtag = (function() {
- var mtcache = ({});
- return function matchtag(f,g) {
- var t = f+"|"+(g||"");
- if(mtcache[t]) return mtcache[t];
- return (mtcache[t] = new RegExp('<(?:\\w+:)?'+f+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)</(?:\\w+:)?'+f+'>',((g||""))));
- };
- })();
-
- var htmldecode = (function() {
- var entities = [
- ['nbsp', ' '], ['middot', '·'],
- ['quot', '"'], ['apos', "'"], ['gt', '>'], ['lt', '<'], ['amp', '&']
- ].map(function(x) { return [new RegExp('&' + x[0] + ';', "g"), x[1]]; });
- return function htmldecode(str) {
- var o = str
- // Remove new lines and spaces from start of content
- .replace(/^[\t\n\r ]+/, "")
- // Remove new lines and spaces from end of content
- .replace(/[\t\n\r ]+$/,"")
- // Added line which removes any white space characters after and before html tags
- .replace(/>\s+/g,">").replace(/\s+</g,"<")
- // Replace remaining new lines and spaces with space
- .replace(/[\t\n\r ]+/g, " ")
- // Replace <br> tags with new lines
- .replace(/<\s*[bB][rR]\s*\/?>/g,"\n")
- // Strip HTML elements
- .replace(/<[^>]*>/g,"");
- for(var i = 0; i < entities.length; ++i) o = o.replace(entities[i][0], entities[i][1]);
- return o;
- };
- })();
-
- var vtregex = (function(){ var vt_cache = {};
- return function vt_regex(bt) {
- if(vt_cache[bt] !== undefined) return vt_cache[bt];
- return (vt_cache[bt] = new RegExp("<(?:vt:)?" + bt + ">([\\s\\S]*?)</(?:vt:)?" + bt + ">", 'g') );
- };})();
- var vtvregex = /<\/?(?:vt:)?variant>/g, vtmregex = /<(?:vt:)([^>]*)>([\s\S]*)</;
- function parseVector(data, opts) {
- var h = parsexmltag(data);
-
- var matches = data.match(vtregex(h.baseType))||[];
- var res = [];
- if(matches.length != h.size) {
- if(opts.WTF) throw new Error("unexpected vector length " + matches.length + " != " + h.size);
- return res;
- }
- matches.forEach(function(x) {
- var v = x.replace(vtvregex,"").match(vtmregex);
- if(v) res.push({v:utf8read(v[2]), t:v[1]});
- });
- return res;
- }
-
- var wtregex = /(^\s|\s$|\n)/;
- function writetag(f,g) { return '<' + f + (g.match(wtregex)?' xml:space="preserve"' : "") + '>' + g + '</' + f + '>'; }
-
- function wxt_helper(h) { return keys(h).map(function(k) { return " " + k + '="' + h[k] + '"';}).join(""); }
- function writextag(f,g,h) { return '<' + f + ((h != null) ? wxt_helper(h) : "") + ((g != null) ? (g.match(wtregex)?' xml:space="preserve"' : "") + '>' + g + '</' + f : "/") + '>';}
-
- function write_w3cdtf(d, t) { try { return d.toISOString().replace(/\.\d*/,""); } catch(e) { if(t) throw e; } return ""; }
-
- function write_vt(s) {
- switch(typeof s) {
- case 'string': return writextag('vt:lpwstr', s);
- case 'number': return writextag((s|0)==s?'vt:i4':'vt:r8', String(s));
- case 'boolean': return writextag('vt:bool',s?'true':'false');
- }
- if(s instanceof Date) return writextag('vt:filetime', write_w3cdtf(s));
- throw new Error("Unable to serialize " + s);
- }
-
- var XMLNS = ({
- 'dc': 'http://purl.org/dc/elements/1.1/',
- 'dcterms': 'http://purl.org/dc/terms/',
- 'dcmitype': 'http://purl.org/dc/dcmitype/',
- 'mx': 'http://schemas.microsoft.com/office/mac/excel/2008/main',
- 'r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',
- 'sjs': 'http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties',
- 'vt': 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes',
- 'xsi': 'http://www.w3.org/2001/XMLSchema-instance',
- 'xsd': 'http://www.w3.org/2001/XMLSchema'
- });
-
- XMLNS.main = [
- 'http://schemas.openxmlformats.org/spreadsheetml/2006/main',
- 'http://purl.oclc.org/ooxml/spreadsheetml/main',
- 'http://schemas.microsoft.com/office/excel/2006/main',
- 'http://schemas.microsoft.com/office/excel/2006/2'
- ];
-
- var XLMLNS = ({
- 'o': 'urn:schemas-microsoft-com:office:office',
- 'x': 'urn:schemas-microsoft-com:office:excel',
- 'ss': 'urn:schemas-microsoft-com:office:spreadsheet',
- 'dt': 'uuid:C2F41010-65B3-11d1-A29F-00AA00C14882',
- 'mv': 'http://macVmlSchemaUri',
- 'v': 'urn:schemas-microsoft-com:vml',
- 'html': 'http://www.w3.org/TR/REC-html40'
- });
- function read_double_le(b, idx) {
- var s = 1 - 2 * (b[idx + 7] >>> 7);
- var e = ((b[idx + 7] & 0x7f) << 4) + ((b[idx + 6] >>> 4) & 0x0f);
- var m = (b[idx+6]&0x0f);
- for(var i = 5; i >= 0; --i) m = m * 256 + b[idx + i];
- if(e == 0x7ff) return m == 0 ? (s * Infinity) : NaN;
- if(e == 0) e = -1022;
- else { e -= 1023; m += Math.pow(2,52); }
- return s * Math.pow(2, e - 52) * m;
- }
-
- function write_double_le(b, v, idx) {
- var bs = ((((v < 0) || (1/v == -Infinity)) ? 1 : 0) << 7), e = 0, m = 0;
- var av = bs ? (-v) : v;
- if(!isFinite(av)) { e = 0x7ff; m = isNaN(v) ? 0x6969 : 0; }
- else if(av == 0) e = m = 0;
- else {
- e = Math.floor(Math.log(av) / Math.LN2);
- m = av * Math.pow(2, 52 - e);
- if((e <= -1023) && (!isFinite(m) || (m < Math.pow(2,52)))) { e = -1022; }
- else { m -= Math.pow(2,52); e+=1023; }
- }
- for(var i = 0; i <= 5; ++i, m/=256) b[idx + i] = m & 0xff;
- b[idx + 6] = ((e & 0x0f) << 4) | (m & 0xf);
- b[idx + 7] = (e >> 4) | bs;
- }
-
- var __toBuffer = function(bufs) { var x=[],w=10240; for(var i=0;i<bufs[0].length;++i) if(bufs[0][i]) for(var j=0,L=bufs[0][i].length;j<L;j+=w) x.push.apply(x, bufs[0][i].slice(j,j+w)); return x; };
- var ___toBuffer = __toBuffer;
- var __utf16le = function(b,s,e) { var ss=[]; for(var i=s; i<e; i+=2) ss.push(String.fromCharCode(__readUInt16LE(b,i))); return ss.join("").replace(chr0,''); };
- var ___utf16le = __utf16le;
- var __hexlify = function(b,s,l) { var ss=[]; for(var i=s; i<s+l; ++i) ss.push(("0" + b[i].toString(16)).slice(-2)); return ss.join(""); };
- var ___hexlify = __hexlify;
- var __utf8 = function(b,s,e) { var ss=[]; for(var i=s; i<e; i++) ss.push(String.fromCharCode(__readUInt8(b,i))); return ss.join(""); };
- var ___utf8 = __utf8;
- var __lpstr = function(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? __utf8(b, i+4,i+4+len-1) : "";};
- var ___lpstr = __lpstr;
- var __cpstr = function(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? __utf8(b, i+4,i+4+len-1) : "";};
- var ___cpstr = __cpstr;
- var __lpwstr = function(b,i) { var len = 2*__readUInt32LE(b,i); return len > 0 ? __utf8(b, i+4,i+4+len-1) : "";};
- var ___lpwstr = __lpwstr;
- var __lpp4, ___lpp4;
- __lpp4 = ___lpp4 = function lpp4_(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? __utf16le(b, i+4,i+4+len) : "";};
- var __8lpp4 = function(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? __utf8(b, i+4,i+4+len) : "";};
- var ___8lpp4 = __8lpp4;
- var __double, ___double;
- __double = ___double = function(b, idx) { return read_double_le(b, idx);};
- var is_buf = function is_buf_a(a) { return Array.isArray(a); };
-
- if(has_buf) {
- __utf16le = function(b,s,e) { if(!Buffer.isBuffer(b)) return ___utf16le(b,s,e); return b.toString('utf16le',s,e).replace(chr0,'')/*.replace(chr1,'!')*/; };
- __hexlify = function(b,s,l) { return Buffer.isBuffer(b) ? b.toString('hex',s,s+l) : ___hexlify(b,s,l); };
- __lpstr = function lpstr_b(b, i) { if(!Buffer.isBuffer(b)) return ___lpstr(b, i); var len = b.readUInt32LE(i); return len > 0 ? b.toString('utf8',i+4,i+4+len-1) : "";};
- __cpstr = function cpstr_b(b, i) { if(!Buffer.isBuffer(b)) return ___cpstr(b, i); var len = b.readUInt32LE(i); return len > 0 ? b.toString('utf8',i+4,i+4+len-1) : "";};
- __lpwstr = function lpwstr_b(b, i) { if(!Buffer.isBuffer(b)) return ___lpwstr(b, i); var len = 2*b.readUInt32LE(i); return b.toString('utf16le',i+4,i+4+len-1);};
- __lpp4 = function lpp4_b(b, i) { if(!Buffer.isBuffer(b)) return ___lpp4(b, i); var len = b.readUInt32LE(i); return b.toString('utf16le',i+4,i+4+len);};
- __8lpp4 = function lpp4_8b(b, i) { if(!Buffer.isBuffer(b)) return ___8lpp4(b, i); var len = b.readUInt32LE(i); return b.toString('utf8',i+4,i+4+len);};
- __utf8 = function utf8_b(b, s, e) { return (Buffer.isBuffer(b)) ? b.toString('utf8',s,e) : ___utf8(b,s,e); };
- __toBuffer = function(bufs) { return (bufs[0].length > 0 && Buffer.isBuffer(bufs[0][0])) ? Buffer.concat(bufs[0]) : ___toBuffer(bufs);};
- bconcat = function(bufs) { return Buffer.isBuffer(bufs[0]) ? Buffer.concat(bufs) : [].concat.apply([], bufs); };
- __double = function double_(b, i) { if(Buffer.isBuffer(b)) return b.readDoubleLE(i); return ___double(b,i); };
- is_buf = function is_buf_b(a) { return Buffer.isBuffer(a) || Array.isArray(a); };
- }
-
- /* from js-xls */
- if(typeof cptable !== 'undefined') {
- __utf16le = function(b,s,e) { return cptable.utils.decode(1200, b.slice(s,e)).replace(chr0, ''); };
- __utf8 = function(b,s,e) { return cptable.utils.decode(65001, b.slice(s,e)); };
- __lpstr = function(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? cptable.utils.decode(current_ansi, b.slice(i+4, i+4+len-1)) : "";};
- __cpstr = function(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? cptable.utils.decode(current_codepage, b.slice(i+4, i+4+len-1)) : "";};
- __lpwstr = function(b,i) { var len = 2*__readUInt32LE(b,i); return len > 0 ? cptable.utils.decode(1200, b.slice(i+4,i+4+len-1)) : "";};
- __lpp4 = function(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? cptable.utils.decode(1200, b.slice(i+4,i+4+len)) : "";};
- __8lpp4 = function(b,i) { var len = __readUInt32LE(b,i); return len > 0 ? cptable.utils.decode(65001, b.slice(i+4,i+4+len)) : "";};
- }
-
- var __readUInt8 = function(b, idx) { return b[idx]; };
- var __readUInt16LE = function(b, idx) { return (b[idx+1]*(1<<8))+b[idx]; };
- var __readInt16LE = function(b, idx) { var u = (b[idx+1]*(1<<8))+b[idx]; return (u < 0x8000) ? u : ((0xffff - u + 1) * -1); };
- var __readUInt32LE = function(b, idx) { return b[idx+3]*(1<<24)+(b[idx+2]<<16)+(b[idx+1]<<8)+b[idx]; };
- var __readInt32LE = function(b, idx) { return (b[idx+3]<<24)|(b[idx+2]<<16)|(b[idx+1]<<8)|b[idx]; };
- var __readInt32BE = function(b, idx) { return (b[idx]<<24)|(b[idx+1]<<16)|(b[idx+2]<<8)|b[idx+3]; };
-
- function ReadShift(size, t) {
- var o="", oI, oR, oo=[], w, vv, i, loc;
- switch(t) {
- case 'dbcs':
- loc = this.l;
- if(has_buf && Buffer.isBuffer(this)) o = this.slice(this.l, this.l+2*size).toString("utf16le");
- else for(i = 0; i < size; ++i) { o+=String.fromCharCode(__readUInt16LE(this, loc)); loc+=2; }
- size *= 2;
- break;
-
- case 'utf8': o = __utf8(this, this.l, this.l + size); break;
- case 'utf16le': size *= 2; o = __utf16le(this, this.l, this.l + size); break;
-
- case 'wstr':
- if(typeof cptable !== 'undefined') o = cptable.utils.decode(current_codepage, this.slice(this.l, this.l+2*size));
- else return ReadShift.call(this, size, 'dbcs');
- size = 2 * size; break;
-
- /* [MS-OLEDS] 2.1.4 LengthPrefixedAnsiString */
- case 'lpstr-ansi': o = __lpstr(this, this.l); size = 4 + __readUInt32LE(this, this.l); break;
- case 'lpstr-cp': o = __cpstr(this, this.l); size = 4 + __readUInt32LE(this, this.l); break;
- /* [MS-OLEDS] 2.1.5 LengthPrefixedUnicodeString */
- case 'lpwstr': o = __lpwstr(this, this.l); size = 4 + 2 * __readUInt32LE(this, this.l); break;
- /* [MS-OFFCRYPTO] 2.1.2 Length-Prefixed Padded Unicode String (UNICODE-LP-P4) */
- case 'lpp4': size = 4 + __readUInt32LE(this, this.l); o = __lpp4(this, this.l); if(size & 0x02) size += 2; break;
- /* [MS-OFFCRYPTO] 2.1.3 Length-Prefixed UTF-8 String (UTF-8-LP-P4) */
- case '8lpp4': size = 4 + __readUInt32LE(this, this.l); o = __8lpp4(this, this.l); if(size & 0x03) size += 4 - (size & 0x03); break;
-
- case 'cstr': size = 0; o = "";
- while((w=__readUInt8(this, this.l + size++))!==0) oo.push(_getchar(w));
- o = oo.join(""); break;
- case '_wstr': size = 0; o = "";
- while((w=__readUInt16LE(this,this.l +size))!==0){oo.push(_getchar(w));size+=2;}
- size+=2; o = oo.join(""); break;
-
- /* sbcs and dbcs support continue records in the SST way TODO codepages */
- case 'dbcs-cont': o = ""; loc = this.l;
- for(i = 0; i < size; ++i) {
- if(this.lens && this.lens.indexOf(loc) !== -1) {
- w = __readUInt8(this, loc);
- this.l = loc + 1;
- vv = ReadShift.call(this, size-i, w ? 'dbcs-cont' : 'sbcs-cont');
- return oo.join("") + vv;
- }
- oo.push(_getchar(__readUInt16LE(this, loc)));
- loc+=2;
- } o = oo.join(""); size *= 2; break;
-
- case 'cpstr':
- if(typeof cptable !== 'undefined') {
- o = cptable.utils.decode(current_codepage, this.slice(this.l, this.l + size));
- break;
- }
- /* falls through */
- case 'sbcs-cont': o = ""; loc = this.l;
- for(i = 0; i != size; ++i) {
- if(this.lens && this.lens.indexOf(loc) !== -1) {
- w = __readUInt8(this, loc);
- this.l = loc + 1;
- vv = ReadShift.call(this, size-i, w ? 'dbcs-cont' : 'sbcs-cont');
- return oo.join("") + vv;
- }
- oo.push(_getchar(__readUInt8(this, loc)));
- loc+=1;
- } o = oo.join(""); break;
-
- default:
- switch(size) {
- case 1: oI = __readUInt8(this, this.l); this.l++; return oI;
- case 2: oI = (t === 'i' ? __readInt16LE : __readUInt16LE)(this, this.l); this.l += 2; return oI;
- case 4: case -4:
- if(t === 'i' || ((this[this.l+3] & 0x80)===0)) { oI = ((size > 0) ? __readInt32LE : __readInt32BE)(this, this.l); this.l += 4; return oI; }
- else { oR = __readUInt32LE(this, this.l); this.l += 4; } return oR;
- case 8: case -8:
- if(t === 'f') {
- if(size == 8) oR = __double(this, this.l);
- else oR = __double([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]], 0);
- this.l += 8; return oR;
- } else size = 8;
- /* falls through */
- case 16: o = __hexlify(this, this.l, size); break;
- }}
- this.l+=size; return o;
- }
-
- var __writeUInt32LE = function(b, val, idx) { b[idx] = (val & 0xFF); b[idx+1] = ((val >>> 8) & 0xFF); b[idx+2] = ((val >>> 16) & 0xFF); b[idx+3] = ((val >>> 24) & 0xFF); };
- var __writeInt32LE = function(b, val, idx) { b[idx] = (val & 0xFF); b[idx+1] = ((val >> 8) & 0xFF); b[idx+2] = ((val >> 16) & 0xFF); b[idx+3] = ((val >> 24) & 0xFF); };
- var __writeUInt16LE = function(b, val, idx) { b[idx] = (val & 0xFF); b[idx+1] = ((val >>> 8) & 0xFF); };
-
- function WriteShift(t, val, f) {
- var size = 0, i = 0;
- if(f === 'dbcs') {
- for(i = 0; i != val.length; ++i) __writeUInt16LE(this, val.charCodeAt(i), this.l + 2 * i);
- size = 2 * val.length;
- } else if(f === 'sbcs') {
- if(typeof cptable !== 'undefined' && current_ansi == 874) {
- /* TODO: use tables directly, don't encode */
- for(i = 0; i != val.length; ++i) {
- var cppayload = cptable.utils.encode(current_ansi, val.charAt(i));
- this[this.l + i] = cppayload[0];
- }
- } else {
- val = val.replace(/[^\x00-\x7F]/g, "_");
- for(i = 0; i != val.length; ++i) this[this.l + i] = (val.charCodeAt(i) & 0xFF);
- }
- size = val.length;
- } else if(f === 'hex') {
- for(; i < t; ++i) {
- this[this.l++] = (parseInt(val.slice(2*i, 2*i+2), 16)||0);
- } return this;
- } else if(f === 'utf16le') {
- var end = Math.min(this.l + t, this.length);
- for(i = 0; i < Math.min(val.length, t); ++i) {
- var cc = val.charCodeAt(i);
- this[this.l++] = (cc & 0xff);
- this[this.l++] = (cc >> 8);
- }
- while(this.l < end) this[this.l++] = 0;
- return this;
- } else switch(t) {
- case 1: size = 1; this[this.l] = val&0xFF; break;
- case 2: size = 2; this[this.l] = val&0xFF; val >>>= 8; this[this.l+1] = val&0xFF; break;
- case 3: size = 3; this[this.l] = val&0xFF; val >>>= 8; this[this.l+1] = val&0xFF; val >>>= 8; this[this.l+2] = val&0xFF; break;
- case 4: size = 4; __writeUInt32LE(this, val, this.l); break;
- case 8: size = 8; if(f === 'f') { write_double_le(this, val, this.l); break; }
- /* falls through */
- case 16: break;
- case -4: size = 4; __writeInt32LE(this, val, this.l); break;
- }
- this.l += size; return this;
- }
-
- function CheckField(hexstr, fld) {
- var m = __hexlify(this,this.l,hexstr.length>>1);
- if(m !== hexstr) throw new Error(fld + 'Expected ' + hexstr + ' saw ' + m);
- this.l += hexstr.length>>1;
- }
-
- function prep_blob(blob, pos) {
- blob.l = pos;
- blob.read_shift = ReadShift;
- blob.chk = CheckField;
- blob.write_shift = WriteShift;
- }
-
- function parsenoop(blob, length) { blob.l += length; }
-
- function new_buf(sz) {
- var o = new_raw_buf(sz);
- prep_blob(o, 0);
- return o;
- }
-
- /* [MS-XLSB] 2.1.4 Record */
- function recordhopper(data, cb, opts) {
- if(!data) return;
- var tmpbyte, cntbyte, length;
- prep_blob(data, data.l || 0);
- var L = data.length, RT = 0, tgt = 0;
- while(data.l < L) {
- RT = data.read_shift(1);
- if(RT & 0x80) RT = (RT & 0x7F) + ((data.read_shift(1) & 0x7F)<<7);
- var R = XLSBRecordEnum[RT] || XLSBRecordEnum[0xFFFF];
- tmpbyte = data.read_shift(1);
- length = tmpbyte & 0x7F;
- for(cntbyte = 1; cntbyte <4 && (tmpbyte & 0x80); ++cntbyte) length += ((tmpbyte = data.read_shift(1)) & 0x7F)<<(7*cntbyte);
- tgt = data.l + length;
- var d = (R.f||parsenoop)(data, length, opts);
- data.l = tgt;
- if(cb(d, R.n, RT)) return;
- }
- }
-
- /* control buffer usage for fixed-length buffers */
- function buf_array() {
- var bufs = [], blksz = has_buf ? 256 : 2048;
- var newblk = function ba_newblk(sz) {
- var o = (new_buf(sz));
- prep_blob(o, 0);
- return o;
- };
-
- var curbuf = newblk(blksz);
-
- var endbuf = function ba_endbuf() {
- if(!curbuf) return;
- if(curbuf.length > curbuf.l) { curbuf = curbuf.slice(0, curbuf.l); curbuf.l = curbuf.length; }
- if(curbuf.length > 0) bufs.push(curbuf);
- curbuf = null;
- };
-
- var next = function ba_next(sz) {
- if(curbuf && (sz < (curbuf.length - curbuf.l))) return curbuf;
- endbuf();
- return (curbuf = newblk(Math.max(sz+1, blksz)));
- };
-
- var end = function ba_end() {
- endbuf();
- return __toBuffer([bufs]);
- };
-
- var push = function ba_push(buf) { endbuf(); curbuf = buf; if(curbuf.l == null) curbuf.l = curbuf.length; next(blksz); };
-
- return ({ next:next, push:push, end:end, _bufs:bufs });
- }
-
- function write_record(ba, type, payload, length) {
- var t = +XLSBRE[type], l;
- if(isNaN(t)) return; // TODO: throw something here?
- if(!length) length = XLSBRecordEnum[t].p || (payload||[]).length || 0;
- l = 1 + (t >= 0x80 ? 1 : 0) + 1/* + length*/;
- if(length >= 0x80) ++l; if(length >= 0x4000) ++l; if(length >= 0x200000) ++l;
- var o = ba.next(l);
- if(t <= 0x7F) o.write_shift(1, t);
- else {
- o.write_shift(1, (t & 0x7F) + 0x80);
- o.write_shift(1, (t >> 7));
- }
- for(var i = 0; i != 4; ++i) {
- if(length >= 0x80) { o.write_shift(1, (length & 0x7F)+0x80); length >>= 7; }
- else { o.write_shift(1, length); break; }
- }
- if(length > 0 && is_buf(payload)) ba.push(payload);
- }
- /* XLS ranges enforced */
- function shift_cell_xls(cell, tgt, opts) {
- var out = dup(cell);
- if(tgt.s) {
- if(out.cRel) out.c += tgt.s.c;
- if(out.rRel) out.r += tgt.s.r;
- } else {
- if(out.cRel) out.c += tgt.c;
- if(out.rRel) out.r += tgt.r;
- }
- if(!opts || opts.biff < 12) {
- while(out.c >= 0x100) out.c -= 0x100;
- while(out.r >= 0x10000) out.r -= 0x10000;
- }
- return out;
- }
-
- function shift_range_xls(cell, range, opts) {
- var out = dup(cell);
- out.s = shift_cell_xls(out.s, range.s, opts);
- out.e = shift_cell_xls(out.e, range.s, opts);
- return out;
- }
-
- function encode_cell_xls(c, biff) {
- if(c.cRel && c.c < 0) { c = dup(c); while(c.c < 0) c.c += (biff > 8) ? 0x4000 : 0x100; }
- if(c.rRel && c.r < 0) { c = dup(c); while(c.r < 0) c.r += (biff > 8) ? 0x100000 : ((biff > 5) ? 0x10000 : 0x4000); }
- var s = encode_cell(c);
- if(!c.cRel && c.cRel != null) s = fix_col(s);
- if(!c.rRel && c.rRel != null) s = fix_row(s);
- return s;
- }
-
- function encode_range_xls(r, opts) {
- if(r.s.r == 0 && !r.s.rRel) {
- if(r.e.r == (opts.biff >= 12 ? 0xFFFFF : (opts.biff >= 8 ? 0x10000 : 0x4000)) && !r.e.rRel) {
- return (r.s.cRel ? "" : "$") + encode_col(r.s.c) + ":" + (r.e.cRel ? "" : "$") + encode_col(r.e.c);
- }
- }
- if(r.s.c == 0 && !r.s.cRel) {
- if(r.e.c == (opts.biff >= 12 ? 0xFFFF : 0xFF) && !r.e.cRel) {
- return (r.s.rRel ? "" : "$") + encode_row(r.s.r) + ":" + (r.e.rRel ? "" : "$") + encode_row(r.e.r);
- }
- }
- return encode_cell_xls(r.s, opts.biff) + ":" + encode_cell_xls(r.e, opts.biff);
- }
- var OFFCRYPTO = {};
-
- var make_offcrypto = function(O, _crypto) {
- var crypto;
- if(typeof _crypto !== 'undefined') crypto = _crypto;
- else if(true) {
- try { crypto = __webpack_require__(/*! crypto */ 2); }
- catch(e) { crypto = null; }
- }
-
- O.rc4 = function(key, data) {
- var S = new Array(256);
- var c = 0, i = 0, j = 0, t = 0;
- for(i = 0; i != 256; ++i) S[i] = i;
- for(i = 0; i != 256; ++i) {
- j = (j + S[i] + (key[i%key.length]).charCodeAt(0))&255;
- t = S[i]; S[i] = S[j]; S[j] = t;
- }
- // $FlowIgnore
- i = j = 0; var out = Buffer(data.length);
- for(c = 0; c != data.length; ++c) {
- i = (i + 1)&255;
- j = (j + S[i])%256;
- t = S[i]; S[i] = S[j]; S[j] = t;
- out[c] = (data[c] ^ S[(S[i]+S[j])&255]);
- }
- return out;
- };
-
- O.md5 = function(hex) {
- if(!crypto) throw new Error("Unsupported crypto");
- return crypto.createHash('md5').update(hex).digest('hex');
- };
- };
- /*global crypto:true */
- make_offcrypto(OFFCRYPTO, typeof crypto !== "undefined" ? crypto : undefined);
-
- function decode_row(rowstr) { return parseInt(unfix_row(rowstr),10) - 1; }
- function encode_row(row) { return "" + (row + 1); }
- function fix_row(cstr) { return cstr.replace(/([A-Z]|^)(\d+)$/,"$1$$$2"); }
- function unfix_row(cstr) { return cstr.replace(/\$(\d+)$/,"$1"); }
-
- function decode_col(colstr) { var c = unfix_col(colstr), d = 0, i = 0; for(; i !== c.length; ++i) d = 26*d + c.charCodeAt(i) - 64; return d - 1; }
- function encode_col(col) { if(col < 0) throw new Error("invalid column " + col); var s=""; for(++col; col; col=Math.floor((col-1)/26)) s = String.fromCharCode(((col-1)%26) + 65) + s; return s; }
- function fix_col(cstr) { return cstr.replace(/^([A-Z])/,"$$$1"); }
- function unfix_col(cstr) { return cstr.replace(/^\$([A-Z])/,"$1"); }
-
- function split_cell(cstr) { return cstr.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(","); }
- function decode_cell(cstr) { var splt = split_cell(cstr); return { c:decode_col(splt[0]), r:decode_row(splt[1]) }; }
- function encode_cell(cell) { return encode_col(cell.c) + encode_row(cell.r); }
- function decode_range(range) { var x =range.split(":").map(decode_cell); return {s:x[0],e:x[x.length-1]}; }
- function encode_range(cs,ce) {
- if(typeof ce === 'undefined' || typeof ce === 'number') {
- return encode_range(cs.s, cs.e);
- }
- if(typeof cs !== 'string') cs = encode_cell((cs));
- if(typeof ce !== 'string') ce = encode_cell((ce));
- return cs == ce ? cs : cs + ":" + ce;
- }
-
- function safe_decode_range(range) {
- var o = {s:{c:0,r:0},e:{c:0,r:0}};
- var idx = 0, i = 0, cc = 0;
- var len = range.length;
- for(idx = 0; i < len; ++i) {
- if((cc=range.charCodeAt(i)-64) < 1 || cc > 26) break;
- idx = 26*idx + cc;
- }
- o.s.c = --idx;
-
- for(idx = 0; i < len; ++i) {
- if((cc=range.charCodeAt(i)-48) < 0 || cc > 9) break;
- idx = 10*idx + cc;
- }
- o.s.r = --idx;
-
- if(i === len || range.charCodeAt(++i) === 58) { o.e.c=o.s.c; o.e.r=o.s.r; return o; }
-
- for(idx = 0; i != len; ++i) {
- if((cc=range.charCodeAt(i)-64) < 1 || cc > 26) break;
- idx = 26*idx + cc;
- }
- o.e.c = --idx;
-
- for(idx = 0; i != len; ++i) {
- if((cc=range.charCodeAt(i)-48) < 0 || cc > 9) break;
- idx = 10*idx + cc;
- }
- o.e.r = --idx;
- return o;
- }
-
- function safe_format_cell(cell, v) {
- var q = (cell.t == 'd' && v instanceof Date);
- if(cell.z != null) try { return (cell.w = SSF.format(cell.z, q ? datenum(v) : v)); } catch(e) { }
- try { return (cell.w = SSF.format((cell.XF||{}).numFmtId||(q ? 14 : 0), q ? datenum(v) : v)); } catch(e) { return ''+v; }
- }
-
- function format_cell(cell, v, o) {
- if(cell == null || cell.t == null || cell.t == 'z') return "";
- if(cell.w !== undefined) return cell.w;
- if(cell.t == 'd' && !cell.z && o && o.dateNF) cell.z = o.dateNF;
- if(v == undefined) return safe_format_cell(cell, cell.v);
- return safe_format_cell(cell, v);
- }
-
- function sheet_to_workbook(sheet, opts) {
- var n = opts && opts.sheet ? opts.sheet : "Sheet1";
- var sheets = {}; sheets[n] = sheet;
- return { SheetNames: [n], Sheets: sheets };
- }
-
- function sheet_add_aoa(_ws, data, opts) {
- var o = opts || {};
- var dense = _ws ? Array.isArray(_ws) : o.dense;
- if(DENSE != null && dense == null) dense = DENSE;
- var ws = _ws || (dense ? ([]) : ({}));
- var _R = 0, _C = 0;
- if(ws && o.origin != null) {
- if(typeof o.origin == 'number') _R = o.origin;
- else {
- var _origin = typeof o.origin == "string" ? decode_cell(o.origin) : o.origin;
- _R = _origin.r; _C = _origin.c;
- }
- }
- var range = ({s: {c:10000000, r:10000000}, e: {c:0, r:0}});
- if(ws['!ref']) {
- var _range = safe_decode_range(ws['!ref']);
- range.s.c = _range.s.c;
- range.s.r = _range.s.r;
- range.e.c = Math.max(range.e.c, _range.e.c);
- range.e.r = Math.max(range.e.r, _range.e.r);
- if(_R == -1) range.e.r = _R = _range.e.r + 1;
- }
- for(var R = 0; R != data.length; ++R) {
- if(!data[R]) continue;
- if(!Array.isArray(data[R])) throw new Error("aoa_to_sheet expects an array of arrays");
- for(var C = 0; C != data[R].length; ++C) {
- if(typeof data[R][C] === 'undefined') continue;
- var cell = ({v: data[R][C] });
- var __R = _R + R, __C = _C + C;
- if(range.s.r > __R) range.s.r = __R;
- if(range.s.c > __C) range.s.c = __C;
- if(range.e.r < __R) range.e.r = __R;
- if(range.e.c < __C) range.e.c = __C;
- if(data[R][C] && typeof data[R][C] === 'object' && !Array.isArray(data[R][C]) && !(data[R][C] instanceof Date)) cell = data[R][C];
- else {
- if(Array.isArray(cell.v)) { cell.f = data[R][C][1]; cell.v = cell.v[0]; }
- if(cell.v === null) { if(cell.f) cell.t = 'n'; else if(!o.sheetStubs) continue; else cell.t = 'z'; }
- else if(typeof cell.v === 'number') cell.t = 'n';
- else if(typeof cell.v === 'boolean') cell.t = 'b';
- else if(cell.v instanceof Date) {
- cell.z = o.dateNF || SSF._table[14];
- if(o.cellDates) { cell.t = 'd'; cell.w = SSF.format(cell.z, datenum(cell.v)); }
- else { cell.t = 'n'; cell.v = datenum(cell.v); cell.w = SSF.format(cell.z, cell.v); }
- }
- else cell.t = 's';
- }
- if(dense) {
- if(!ws[__R]) ws[__R] = [];
- ws[__R][__C] = cell;
- } else {
- var cell_ref = encode_cell(({c:__C,r:__R}));
- ws[cell_ref] = cell;
- }
- }
- }
- if(range.s.c < 10000000) ws['!ref'] = encode_range(range);
- return ws;
- }
- function aoa_to_sheet(data, opts) { return sheet_add_aoa(null, data, opts); }
-
- function write_UInt32LE(x, o) {
- if(!o) o = new_buf(4);
- o.write_shift(4, x);
- return o;
- }
-
- /* [MS-XLSB] 2.5.168 */
- function parse_XLWideString(data) {
- var cchCharacters = data.read_shift(4);
- return cchCharacters === 0 ? "" : data.read_shift(cchCharacters, 'dbcs');
- }
- function write_XLWideString(data, o) {
- var _null = false; if(o == null) { _null = true; o = new_buf(4+2*data.length); }
- o.write_shift(4, data.length);
- if(data.length > 0) o.write_shift(0, data, 'dbcs');
- return _null ? o.slice(0, o.l) : o;
- }
-
- /* [MS-XLSB] 2.5.143 */
- function parse_StrRun(data) {
- return { ich: data.read_shift(2), ifnt: data.read_shift(2) };
- }
- function write_StrRun(run, o) {
- if(!o) o = new_buf(4);
- o.write_shift(2, run.ich || 0);
- o.write_shift(2, run.ifnt || 0);
- return o;
- }
-
- /* [MS-XLSB] 2.5.121 */
- function parse_RichStr(data, length) {
- var start = data.l;
- var flags = data.read_shift(1);
- var str = parse_XLWideString(data);
- var rgsStrRun = [];
- var z = ({ t: str, h: str });
- if((flags & 1) !== 0) { /* fRichStr */
- /* TODO: formatted string */
- var dwSizeStrRun = data.read_shift(4);
- for(var i = 0; i != dwSizeStrRun; ++i) rgsStrRun.push(parse_StrRun(data));
- z.r = rgsStrRun;
- }
- else z.r = [{ich:0, ifnt:0}];
- //if((flags & 2) !== 0) { /* fExtStr */
- // /* TODO: phonetic string */
- //}
- data.l = start + length;
- return z;
- }
- function write_RichStr(str, o) {
- /* TODO: formatted string */
- var _null = false; if(o == null) { _null = true; o = new_buf(15+4*str.t.length); }
- o.write_shift(1,0);
- write_XLWideString(str.t, o);
- return _null ? o.slice(0, o.l) : o;
- }
- /* [MS-XLSB] 2.4.328 BrtCommentText (RichStr w/1 run) */
- var parse_BrtCommentText = parse_RichStr;
- function write_BrtCommentText(str, o) {
- /* TODO: formatted string */
- var _null = false; if(o == null) { _null = true; o = new_buf(23+4*str.t.length); }
- o.write_shift(1,1);
- write_XLWideString(str.t, o);
- o.write_shift(4,1);
- write_StrRun({ich:0,ifnt:0}, o);
- return _null ? o.slice(0, o.l) : o;
- }
-
- /* [MS-XLSB] 2.5.9 */
- function parse_XLSBCell(data) {
- var col = data.read_shift(4);
- var iStyleRef = data.read_shift(2);
- iStyleRef += data.read_shift(1) <<16;
- data.l++; //var fPhShow = data.read_shift(1);
- return { c:col, iStyleRef: iStyleRef };
- }
- function write_XLSBCell(cell, o) {
- if(o == null) o = new_buf(8);
- o.write_shift(-4, cell.c);
- o.write_shift(3, cell.iStyleRef || cell.s);
- o.write_shift(1, 0); /* fPhShow */
- return o;
- }
-
-
- /* [MS-XLSB] 2.5.21 */
- var parse_XLSBCodeName = parse_XLWideString;
- var write_XLSBCodeName = write_XLWideString;
-
- /* [MS-XLSB] 2.5.166 */
- function parse_XLNullableWideString(data) {
- var cchCharacters = data.read_shift(4);
- return cchCharacters === 0 || cchCharacters === 0xFFFFFFFF ? "" : data.read_shift(cchCharacters, 'dbcs');
- }
- function write_XLNullableWideString(data, o) {
- var _null = false; if(o == null) { _null = true; o = new_buf(127); }
- o.write_shift(4, data.length > 0 ? data.length : 0xFFFFFFFF);
- if(data.length > 0) o.write_shift(0, data, 'dbcs');
- return _null ? o.slice(0, o.l) : o;
- }
-
- /* [MS-XLSB] 2.5.165 */
- var parse_XLNameWideString = parse_XLWideString;
- //var write_XLNameWideString = write_XLWideString;
-
- /* [MS-XLSB] 2.5.114 */
- var parse_RelID = parse_XLNullableWideString;
- var write_RelID = write_XLNullableWideString;
-
-
- /* [MS-XLS] 2.5.217 ; [MS-XLSB] 2.5.122 */
- function parse_RkNumber(data) {
- var b = data.slice(data.l, data.l+4);
- var fX100 = (b[0] & 1), fInt = (b[0] & 2);
- data.l+=4;
- b[0] &= 0xFC; // b[0] &= ~3;
- var RK = fInt === 0 ? __double([0,0,0,0,b[0],b[1],b[2],b[3]],0) : __readInt32LE(b,0)>>2;
- return fX100 ? (RK/100) : RK;
- }
- function write_RkNumber(data, o) {
- if(o == null) o = new_buf(4);
- var fX100 = 0, fInt = 0, d100 = data * 100;
- if((data == (data | 0)) && (data >= -(1<<29)) && (data < (1 << 29))) { fInt = 1; }
- else if((d100 == (d100 | 0)) && (d100 >= -(1<<29)) && (d100 < (1 << 29))) { fInt = 1; fX100 = 1; }
- if(fInt) o.write_shift(-4, ((fX100 ? d100 : data) << 2) + (fX100 + 2));
- else throw new Error("unsupported RkNumber " + data); // TODO
- }
-
-
- /* [MS-XLSB] 2.5.117 RfX */
- function parse_RfX(data ) {
- var cell = ({s: {}, e: {}});
- cell.s.r = data.read_shift(4);
- cell.e.r = data.read_shift(4);
- cell.s.c = data.read_shift(4);
- cell.e.c = data.read_shift(4);
- return cell;
- }
- function write_RfX(r, o) {
- if(!o) o = new_buf(16);
- o.write_shift(4, r.s.r);
- o.write_shift(4, r.e.r);
- o.write_shift(4, r.s.c);
- o.write_shift(4, r.e.c);
- return o;
- }
-
- /* [MS-XLSB] 2.5.153 UncheckedRfX */
- var parse_UncheckedRfX = parse_RfX;
- var write_UncheckedRfX = write_RfX;
-
-
- /* [MS-XLS] 2.5.342 ; [MS-XLSB] 2.5.171 */
- /* TODO: error checking, NaN and Infinity values are not valid Xnum */
- function parse_Xnum(data) { return data.read_shift(8, 'f'); }
- function write_Xnum(data, o) { return (o || new_buf(8)).write_shift(8, data, 'f'); }
-
- /* [MS-XLSB] 2.5.97.2 */
- var BErr = {
- 0x00: "#NULL!",
- 0x07: "#DIV/0!",
- 0x0F: "#VALUE!",
- 0x17: "#REF!",
- 0x1D: "#NAME?",
- 0x24: "#NUM!",
- 0x2A: "#N/A",
- 0x2B: "#GETTING_DATA",
- 0xFF: "#WTF?"
- };
- var RBErr = evert_num(BErr);
-
- /* [MS-XLSB] 2.4.324 BrtColor */
- function parse_BrtColor(data) {
- var out = {};
- var d = data.read_shift(1);
-
- //var fValidRGB = d & 1;
- var xColorType = d >>> 1;
-
- var index = data.read_shift(1);
- var nTS = data.read_shift(2, 'i');
- var bR = data.read_shift(1);
- var bG = data.read_shift(1);
- var bB = data.read_shift(1);
- data.l++; //var bAlpha = data.read_shift(1);
-
- switch(xColorType) {
- case 0: out.auto = 1; break;
- case 1:
- out.index = index;
- var icv = XLSIcv[index];
- /* automatic pseudo index 81 */
- if(icv) out.rgb = rgb2Hex(icv);
- break;
- case 2:
- /* if(!fValidRGB) throw new Error("invalid"); */
- out.rgb = rgb2Hex([bR, bG, bB]);
- break;
- case 3: out.theme = index; break;
- }
- if(nTS != 0) out.tint = nTS > 0 ? nTS / 32767 : nTS / 32768;
-
- return out;
- }
- function write_BrtColor(color, o) {
- if(!o) o = new_buf(8);
- if(!color||color.auto) { o.write_shift(4, 0); o.write_shift(4, 0); return o; }
- if(color.index != null) {
- o.write_shift(1, 0x02);
- o.write_shift(1, color.index);
- } else if(color.theme != null) {
- o.write_shift(1, 0x06);
- o.write_shift(1, color.theme);
- } else {
- o.write_shift(1, 0x05);
- o.write_shift(1, 0);
- }
- var nTS = color.tint || 0;
- if(nTS > 0) nTS *= 32767;
- else if(nTS < 0) nTS *= 32768;
- o.write_shift(2, nTS);
- if(!color.rgb || color.theme != null) {
- o.write_shift(2, 0);
- o.write_shift(1, 0);
- o.write_shift(1, 0);
- } else {
- var rgb = (color.rgb || 'FFFFFF');
- if(typeof rgb == 'number') rgb = ("000000" + rgb.toString(16)).slice(-6);
- o.write_shift(1, parseInt(rgb.slice(0,2),16));
- o.write_shift(1, parseInt(rgb.slice(2,4),16));
- o.write_shift(1, parseInt(rgb.slice(4,6),16));
- o.write_shift(1, 0xFF);
- }
- return o;
- }
-
- /* [MS-XLSB] 2.5.52 */
- function parse_FontFlags(data) {
- var d = data.read_shift(1);
- data.l++;
- var out = {
- fBold: d & 0x01,
- fItalic: d & 0x02,
- fUnderline: d & 0x04,
- fStrikeout: d & 0x08,
- fOutline: d & 0x10,
- fShadow: d & 0x20,
- fCondense: d & 0x40,
- fExtend: d & 0x80
- };
- return out;
- }
- function write_FontFlags(font, o) {
- if(!o) o = new_buf(2);
- var grbit =
- (font.italic ? 0x02 : 0) |
- (font.strike ? 0x08 : 0) |
- (font.outline ? 0x10 : 0) |
- (font.shadow ? 0x20 : 0) |
- (font.condense ? 0x40 : 0) |
- (font.extend ? 0x80 : 0);
- o.write_shift(1, grbit);
- o.write_shift(1, 0);
- return o;
- }
-
- /* [MS-OLEDS] 2.3.1 and 2.3.2 */
- function parse_ClipboardFormatOrString(o, w) {
- // $FlowIgnore
- var ClipFmt = {2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"};
- var m = o.read_shift(4);
- switch(m) {
- case 0x00000000: return "";
- case 0xffffffff: case 0xfffffffe: return ClipFmt[o.read_shift(4)]||"";
- }
- if(m > 0x190) throw new Error("Unsupported Clipboard: " + m.toString(16));
- o.l -= 4;
- return o.read_shift(0, w == 1 ? "lpstr" : "lpwstr");
- }
- function parse_ClipboardFormatOrAnsiString(o) { return parse_ClipboardFormatOrString(o, 1); }
- function parse_ClipboardFormatOrUnicodeString(o) { return parse_ClipboardFormatOrString(o, 2); }
-
- /* [MS-OLEPS] 2.2 PropertyType */
- //var VT_EMPTY = 0x0000;
- //var VT_NULL = 0x0001;
- var VT_I2 = 0x0002;
- var VT_I4 = 0x0003;
- //var VT_R4 = 0x0004;
- //var VT_R8 = 0x0005;
- //var VT_CY = 0x0006;
- //var VT_DATE = 0x0007;
- //var VT_BSTR = 0x0008;
- //var VT_ERROR = 0x000A;
- var VT_BOOL = 0x000B;
- var VT_VARIANT = 0x000C;
- //var VT_DECIMAL = 0x000E;
- //var VT_I1 = 0x0010;
- //var VT_UI1 = 0x0011;
- //var VT_UI2 = 0x0012;
- var VT_UI4 = 0x0013;
- //var VT_I8 = 0x0014;
- //var VT_UI8 = 0x0015;
- //var VT_INT = 0x0016;
- //var VT_UINT = 0x0017;
- var VT_LPSTR = 0x001E;
- //var VT_LPWSTR = 0x001F;
- var VT_FILETIME = 0x0040;
- var VT_BLOB = 0x0041;
- //var VT_STREAM = 0x0042;
- //var VT_STORAGE = 0x0043;
- //var VT_STREAMED_Object = 0x0044;
- //var VT_STORED_Object = 0x0045;
- //var VT_BLOB_Object = 0x0046;
- var VT_CF = 0x0047;
- //var VT_CLSID = 0x0048;
- //var VT_VERSIONED_STREAM = 0x0049;
- var VT_VECTOR = 0x1000;
- //var VT_ARRAY = 0x2000;
-
- var VT_STRING = 0x0050; // 2.3.3.1.11 VtString
- var VT_USTR = 0x0051; // 2.3.3.1.12 VtUnalignedString
- var VT_CUSTOM = [VT_STRING, VT_USTR];
-
- /* [MS-OSHARED] 2.3.3.2.2.1 Document Summary Information PIDDSI */
- var DocSummaryPIDDSI = {
- 0x01: { n: 'CodePage', t: VT_I2 },
- 0x02: { n: 'Category', t: VT_STRING },
- 0x03: { n: 'PresentationFormat', t: VT_STRING },
- 0x04: { n: 'ByteCount', t: VT_I4 },
- 0x05: { n: 'LineCount', t: VT_I4 },
- 0x06: { n: 'ParagraphCount', t: VT_I4 },
- 0x07: { n: 'SlideCount', t: VT_I4 },
- 0x08: { n: 'NoteCount', t: VT_I4 },
- 0x09: { n: 'HiddenCount', t: VT_I4 },
- 0x0a: { n: 'MultimediaClipCount', t: VT_I4 },
- 0x0b: { n: 'ScaleCrop', t: VT_BOOL },
- 0x0c: { n: 'HeadingPairs', t: VT_VECTOR | VT_VARIANT },
- 0x0d: { n: 'TitlesOfParts', t: VT_VECTOR | VT_LPSTR },
- 0x0e: { n: 'Manager', t: VT_STRING },
- 0x0f: { n: 'Company', t: VT_STRING },
- 0x10: { n: 'LinksUpToDate', t: VT_BOOL },
- 0x11: { n: 'CharacterCount', t: VT_I4 },
- 0x13: { n: 'SharedDoc', t: VT_BOOL },
- 0x16: { n: 'HyperlinksChanged', t: VT_BOOL },
- 0x17: { n: 'AppVersion', t: VT_I4, p: 'version' },
- 0x18: { n: 'DigSig', t: VT_BLOB },
- 0x1A: { n: 'ContentType', t: VT_STRING },
- 0x1B: { n: 'ContentStatus', t: VT_STRING },
- 0x1C: { n: 'Language', t: VT_STRING },
- 0x1D: { n: 'Version', t: VT_STRING },
- 0xFF: {}
- };
-
- /* [MS-OSHARED] 2.3.3.2.1.1 Summary Information Property Set PIDSI */
- var SummaryPIDSI = {
- 0x01: { n: 'CodePage', t: VT_I2 },
- 0x02: { n: 'Title', t: VT_STRING },
- 0x03: { n: 'Subject', t: VT_STRING },
- 0x04: { n: 'Author', t: VT_STRING },
- 0x05: { n: 'Keywords', t: VT_STRING },
- 0x06: { n: 'Comments', t: VT_STRING },
- 0x07: { n: 'Template', t: VT_STRING },
- 0x08: { n: 'LastAuthor', t: VT_STRING },
- 0x09: { n: 'RevNumber', t: VT_STRING },
- 0x0A: { n: 'EditTime', t: VT_FILETIME },
- 0x0B: { n: 'LastPrinted', t: VT_FILETIME },
- 0x0C: { n: 'CreatedDate', t: VT_FILETIME },
- 0x0D: { n: 'ModifiedDate', t: VT_FILETIME },
- 0x0E: { n: 'PageCount', t: VT_I4 },
- 0x0F: { n: 'WordCount', t: VT_I4 },
- 0x10: { n: 'CharCount', t: VT_I4 },
- 0x11: { n: 'Thumbnail', t: VT_CF },
- 0x12: { n: 'Application', t: VT_STRING },
- 0x13: { n: 'DocSecurity', t: VT_I4 },
- 0xFF: {}
- };
-
- /* [MS-OLEPS] 2.18 */
- var SpecialProperties = {
- 0x80000000: { n: 'Locale', t: VT_UI4 },
- 0x80000003: { n: 'Behavior', t: VT_UI4 },
- 0x72627262: {}
- };
-
- (function() {
- for(var y in SpecialProperties) if(SpecialProperties.hasOwnProperty(y))
- DocSummaryPIDDSI[y] = SummaryPIDSI[y] = SpecialProperties[y];
- })();
-
- var DocSummaryRE = evert_key(DocSummaryPIDDSI, "n");
- var SummaryRE = evert_key(SummaryPIDSI, "n");
-
- /* [MS-XLS] 2.4.63 Country/Region codes */
- var CountryEnum = {
- 0x0001: "US", // United States
- 0x0002: "CA", // Canada
- 0x0003: "", // Latin America (except Brazil)
- 0x0007: "RU", // Russia
- 0x0014: "EG", // Egypt
- 0x001E: "GR", // Greece
- 0x001F: "NL", // Netherlands
- 0x0020: "BE", // Belgium
- 0x0021: "FR", // France
- 0x0022: "ES", // Spain
- 0x0024: "HU", // Hungary
- 0x0027: "IT", // Italy
- 0x0029: "CH", // Switzerland
- 0x002B: "AT", // Austria
- 0x002C: "GB", // United Kingdom
- 0x002D: "DK", // Denmark
- 0x002E: "SE", // Sweden
- 0x002F: "NO", // Norway
- 0x0030: "PL", // Poland
- 0x0031: "DE", // Germany
- 0x0034: "MX", // Mexico
- 0x0037: "BR", // Brazil
- 0x003d: "AU", // Australia
- 0x0040: "NZ", // New Zealand
- 0x0042: "TH", // Thailand
- 0x0051: "JP", // Japan
- 0x0052: "KR", // Korea
- 0x0054: "VN", // Viet Nam
- 0x0056: "CN", // China
- 0x005A: "TR", // Turkey
- 0x0069: "JS", // Ramastan
- 0x00D5: "DZ", // Algeria
- 0x00D8: "MA", // Morocco
- 0x00DA: "LY", // Libya
- 0x015F: "PT", // Portugal
- 0x0162: "IS", // Iceland
- 0x0166: "FI", // Finland
- 0x01A4: "CZ", // Czech Republic
- 0x0376: "TW", // Taiwan
- 0x03C1: "LB", // Lebanon
- 0x03C2: "JO", // Jordan
- 0x03C3: "SY", // Syria
- 0x03C4: "IQ", // Iraq
- 0x03C5: "KW", // Kuwait
- 0x03C6: "SA", // Saudi Arabia
- 0x03CB: "AE", // United Arab Emirates
- 0x03CC: "IL", // Israel
- 0x03CE: "QA", // Qatar
- 0x03D5: "IR", // Iran
- 0xFFFF: "US" // United States
- };
-
- /* [MS-XLS] 2.5.127 */
- var XLSFillPattern = [
- null,
- 'solid',
- 'mediumGray',
- 'darkGray',
- 'lightGray',
- 'darkHorizontal',
- 'darkVertical',
- 'darkDown',
- 'darkUp',
- 'darkGrid',
- 'darkTrellis',
- 'lightHorizontal',
- 'lightVertical',
- 'lightDown',
- 'lightUp',
- 'lightGrid',
- 'lightTrellis',
- 'gray125',
- 'gray0625'
- ];
-
- function rgbify(arr) { return arr.map(function(x) { return [(x>>16)&255,(x>>8)&255,x&255]; }); }
-
- /* [MS-XLS] 2.5.161 */
- /* [MS-XLSB] 2.5.75 Icv */
- var _XLSIcv = rgbify([
- /* Color Constants */
- 0x000000,
- 0xFFFFFF,
- 0xFF0000,
- 0x00FF00,
- 0x0000FF,
- 0xFFFF00,
- 0xFF00FF,
- 0x00FFFF,
-
- /* Overridable Defaults */
- 0x000000,
- 0xFFFFFF,
- 0xFF0000,
- 0x00FF00,
- 0x0000FF,
- 0xFFFF00,
- 0xFF00FF,
- 0x00FFFF,
-
- 0x800000,
- 0x008000,
- 0x000080,
- 0x808000,
- 0x800080,
- 0x008080,
- 0xC0C0C0,
- 0x808080,
- 0x9999FF,
- 0x993366,
- 0xFFFFCC,
- 0xCCFFFF,
- 0x660066,
- 0xFF8080,
- 0x0066CC,
- 0xCCCCFF,
-
- 0x000080,
- 0xFF00FF,
- 0xFFFF00,
- 0x00FFFF,
- 0x800080,
- 0x800000,
- 0x008080,
- 0x0000FF,
- 0x00CCFF,
- 0xCCFFFF,
- 0xCCFFCC,
- 0xFFFF99,
- 0x99CCFF,
- 0xFF99CC,
- 0xCC99FF,
- 0xFFCC99,
-
- 0x3366FF,
- 0x33CCCC,
- 0x99CC00,
- 0xFFCC00,
- 0xFF9900,
- 0xFF6600,
- 0x666699,
- 0x969696,
- 0x003366,
- 0x339966,
- 0x003300,
- 0x333300,
- 0x993300,
- 0x993366,
- 0x333399,
- 0x333333,
-
- /* Other entries to appease BIFF8/12 */
- 0xFFFFFF, /* 0x40 icvForeground ?? */
- 0x000000, /* 0x41 icvBackground ?? */
- 0x000000, /* 0x42 icvFrame ?? */
- 0x000000, /* 0x43 icv3D ?? */
- 0x000000, /* 0x44 icv3DText ?? */
- 0x000000, /* 0x45 icv3DHilite ?? */
- 0x000000, /* 0x46 icv3DShadow ?? */
- 0x000000, /* 0x47 icvHilite ?? */
- 0x000000, /* 0x48 icvCtlText ?? */
- 0x000000, /* 0x49 icvCtlScrl ?? */
- 0x000000, /* 0x4A icvCtlInv ?? */
- 0x000000, /* 0x4B icvCtlBody ?? */
- 0x000000, /* 0x4C icvCtlFrame ?? */
- 0x000000, /* 0x4D icvCtlFore ?? */
- 0x000000, /* 0x4E icvCtlBack ?? */
- 0x000000, /* 0x4F icvCtlNeutral */
- 0x000000, /* 0x50 icvInfoBk ?? */
- 0x000000 /* 0x51 icvInfoText ?? */
- ]);
- var XLSIcv = dup(_XLSIcv);
- /* Parts enumerated in OPC spec, MS-XLSB and MS-XLSX */
- /* 12.3 Part Summary <SpreadsheetML> */
- /* 14.2 Part Summary <DrawingML> */
- /* [MS-XLSX] 2.1 Part Enumerations ; [MS-XLSB] 2.1.7 Part Enumeration */
- var ct2type/*{[string]:string}*/ = ({
- /* Workbook */
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": "workbooks",
-
- /* Worksheet */
- "application/vnd.ms-excel.binIndexWs": "TODO", /* Binary Index */
-
- /* Macrosheet */
- "application/vnd.ms-excel.intlmacrosheet": "TODO",
- "application/vnd.ms-excel.binIndexMs": "TODO", /* Binary Index */
-
- /* File Properties */
- "application/vnd.openxmlformats-package.core-properties+xml": "coreprops",
- "application/vnd.openxmlformats-officedocument.custom-properties+xml": "custprops",
- "application/vnd.openxmlformats-officedocument.extended-properties+xml": "extprops",
-
- /* Custom Data Properties */
- "application/vnd.openxmlformats-officedocument.customXmlProperties+xml": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty": "TODO",
-
- /* PivotTable */
- "application/vnd.ms-excel.pivotTable": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml": "TODO",
-
- /* Chart Objects */
- "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": "TODO",
-
- /* Chart Colors */
- "application/vnd.ms-office.chartcolorstyle+xml": "TODO",
-
- /* Chart Style */
- "application/vnd.ms-office.chartstyle+xml": "TODO",
-
- /* Chart Advanced */
- "application/vnd.ms-office.chartex+xml": "TODO",
-
- /* Calculation Chain */
- "application/vnd.ms-excel.calcChain": "calcchains",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml": "calcchains",
-
- /* Printer Settings */
- "application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings": "TODO",
-
- /* ActiveX */
- "application/vnd.ms-office.activeX": "TODO",
- "application/vnd.ms-office.activeX+xml": "TODO",
-
- /* Custom Toolbars */
- "application/vnd.ms-excel.attachedToolbars": "TODO",
-
- /* External Data Connections */
- "application/vnd.ms-excel.connections": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": "TODO",
-
- /* External Links */
- "application/vnd.ms-excel.externalLink": "links",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml": "links",
-
- /* Metadata */
- "application/vnd.ms-excel.sheetMetadata": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml": "TODO",
-
- /* PivotCache */
- "application/vnd.ms-excel.pivotCacheDefinition": "TODO",
- "application/vnd.ms-excel.pivotCacheRecords": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml": "TODO",
-
- /* Query Table */
- "application/vnd.ms-excel.queryTable": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml": "TODO",
-
- /* Shared Workbook */
- "application/vnd.ms-excel.userNames": "TODO",
- "application/vnd.ms-excel.revisionHeaders": "TODO",
- "application/vnd.ms-excel.revisionLog": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml": "TODO",
-
- /* Single Cell Table */
- "application/vnd.ms-excel.tableSingleCells": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml": "TODO",
-
- /* Slicer */
- "application/vnd.ms-excel.slicer": "TODO",
- "application/vnd.ms-excel.slicerCache": "TODO",
- "application/vnd.ms-excel.slicer+xml": "TODO",
- "application/vnd.ms-excel.slicerCache+xml": "TODO",
-
- /* Sort Map */
- "application/vnd.ms-excel.wsSortMap": "TODO",
-
- /* Table */
- "application/vnd.ms-excel.table": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": "TODO",
-
- /* Themes */
- "application/vnd.openxmlformats-officedocument.theme+xml": "themes",
-
- /* Theme Override */
- "application/vnd.openxmlformats-officedocument.themeOverride+xml": "TODO",
-
- /* Timeline */
- "application/vnd.ms-excel.Timeline+xml": "TODO", /* verify */
- "application/vnd.ms-excel.TimelineCache+xml": "TODO", /* verify */
-
- /* VBA */
- "application/vnd.ms-office.vbaProject": "vba",
- "application/vnd.ms-office.vbaProjectSignature": "vba",
-
- /* Volatile Dependencies */
- "application/vnd.ms-office.volatileDependencies": "TODO",
- "application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml": "TODO",
-
- /* Control Properties */
- "application/vnd.ms-excel.controlproperties+xml": "TODO",
-
- /* Data Model */
- "application/vnd.openxmlformats-officedocument.model+data": "TODO",
-
- /* Survey */
- "application/vnd.ms-excel.Survey+xml": "TODO",
-
- /* Drawing */
- "application/vnd.openxmlformats-officedocument.drawing+xml": "drawings",
- "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": "TODO",
- "application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml": "TODO",
- "application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml": "TODO",
- "application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml": "TODO",
- "application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml": "TODO",
-
- /* VML */
- "application/vnd.openxmlformats-officedocument.vmlDrawing": "TODO",
-
- "application/vnd.openxmlformats-package.relationships+xml": "rels",
- "application/vnd.openxmlformats-officedocument.oleObject": "TODO",
-
- /* Image */
- "image/png": "TODO",
-
- "sheet": "js"
- });
-
- var CT_LIST = (function(){
- var o = {
- workbooks: {
- xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",
- xlsm: "application/vnd.ms-excel.sheet.macroEnabled.main+xml",
- xlsb: "application/vnd.ms-excel.sheet.binary.macroEnabled.main",
- xlam: "application/vnd.ms-excel.addin.macroEnabled.main+xml",
- xltx: "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"
- },
- strs: { /* Shared Strings */
- xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",
- xlsb: "application/vnd.ms-excel.sharedStrings"
- },
- comments: { /* Comments */
- xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",
- xlsb: "application/vnd.ms-excel.comments"
- },
- sheets: { /* Worksheet */
- xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",
- xlsb: "application/vnd.ms-excel.worksheet"
- },
- charts: { /* Chartsheet */
- xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml",
- xlsb: "application/vnd.ms-excel.chartsheet"
- },
- dialogs: { /* Dialogsheet */
- xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml",
- xlsb: "application/vnd.ms-excel.dialogsheet"
- },
- macros: { /* Macrosheet (Excel 4.0 Macros) */
- xlsx: "application/vnd.ms-excel.macrosheet+xml",
- xlsb: "application/vnd.ms-excel.macrosheet"
- },
- styles: { /* Styles */
- xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
- xlsb: "application/vnd.ms-excel.styles"
- }
- };
- keys(o).forEach(function(k) { ["xlsm", "xlam"].forEach(function(v) { if(!o[k][v]) o[k][v] = o[k].xlsx; }); });
- keys(o).forEach(function(k){ keys(o[k]).forEach(function(v) { ct2type[o[k][v]] = k; }); });
- return o;
- })();
-
- var type2ct/*{[string]:Array<string>}*/ = evert_arr(ct2type);
-
- XMLNS.CT = 'http://schemas.openxmlformats.org/package/2006/content-types';
-
- function new_ct() {
- return ({
- workbooks:[], sheets:[], charts:[], dialogs:[], macros:[],
- rels:[], strs:[], comments:[], links:[],
- coreprops:[], extprops:[], custprops:[], themes:[], styles:[],
- calcchains:[], vba: [], drawings: [],
- TODO:[], xmlns: "" });
- }
-
- function parse_ct(data) {
- var ct = new_ct();
- if(!data || !data.match) return ct;
- var ctext = {};
- (data.match(tagregex)||[]).forEach(function(x) {
- var y = parsexmltag(x);
- switch(y[0].replace(nsregex,"<")) {
- case '<?xml': break;
- case '<Types': ct.xmlns = y['xmlns' + (y[0].match(/<(\w+):/)||["",""])[1] ]; break;
- case '<Default': ctext[y.Extension] = y.ContentType; break;
- case '<Override':
- if(ct[ct2type[y.ContentType]] !== undefined) ct[ct2type[y.ContentType]].push(y.PartName);
- break;
- }
- });
- if(ct.xmlns !== XMLNS.CT) throw new Error("Unknown Namespace: " + ct.xmlns);
- ct.calcchain = ct.calcchains.length > 0 ? ct.calcchains[0] : "";
- ct.sst = ct.strs.length > 0 ? ct.strs[0] : "";
- ct.style = ct.styles.length > 0 ? ct.styles[0] : "";
- ct.defaults = ctext;
- delete ct.calcchains;
- return ct;
- }
-
- var CTYPE_XML_ROOT = writextag('Types', null, {
- 'xmlns': XMLNS.CT,
- 'xmlns:xsd': XMLNS.xsd,
- 'xmlns:xsi': XMLNS.xsi
- });
-
- var CTYPE_DEFAULTS = [
- ['xml', 'application/xml'],
- ['bin', 'application/vnd.ms-excel.sheet.binary.macroEnabled.main'],
- ['vml', 'application/vnd.openxmlformats-officedocument.vmlDrawing'],
- ['data', 'application/vnd.openxmlformats-officedocument.model+data'],
- /* from test files */
- ['bmp', 'image/bmp'],
- ['png', 'image/png'],
- ['gif', 'image/gif'],
- ['emf', 'image/x-emf'],
- ['wmf', 'image/x-wmf'],
- ['jpg', 'image/jpeg'], ['jpeg', 'image/jpeg'],
- ['tif', 'image/tiff'], ['tiff', 'image/tiff'],
- ['pdf', 'application/pdf'],
- ['rels', type2ct.rels[0]]
- ].map(function(x) {
- return writextag('Default', null, {'Extension':x[0], 'ContentType': x[1]});
- });
-
- function write_ct(ct, opts) {
- var o = [], v;
- o[o.length] = (XML_HEADER);
- o[o.length] = (CTYPE_XML_ROOT);
- o = o.concat(CTYPE_DEFAULTS);
-
- /* only write first instance */
- var f1 = function(w) {
- if(ct[w] && ct[w].length > 0) {
- v = ct[w][0];
- o[o.length] = (writextag('Override', null, {
- 'PartName': (v[0] == '/' ? "":"/") + v,
- 'ContentType': CT_LIST[w][opts.bookType || 'xlsx']
- }));
- }
- };
-
- /* book type-specific */
- var f2 = function(w) {
- (ct[w]||[]).forEach(function(v) {
- o[o.length] = (writextag('Override', null, {
- 'PartName': (v[0] == '/' ? "":"/") + v,
- 'ContentType': CT_LIST[w][opts.bookType || 'xlsx']
- }));
- });
- };
-
- /* standard type */
- var f3 = function(t) {
- (ct[t]||[]).forEach(function(v) {
- o[o.length] = (writextag('Override', null, {
- 'PartName': (v[0] == '/' ? "":"/") + v,
- 'ContentType': type2ct[t][0]
- }));
- });
- };
-
- f1('workbooks');
- f2('sheets');
- f2('charts');
- f3('themes');
- ['strs', 'styles'].forEach(f1);
- ['coreprops', 'extprops', 'custprops'].forEach(f3);
- f3('vba');
- f3('comments');
- f3('drawings');
- if(o.length>2){ o[o.length] = ('</Types>'); o[1]=o[1].replace("/>",">"); }
- return o.join("");
- }
- /* 9.3 Relationships */
- var RELS = ({
- WB: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
- SHEET: "http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
- HLINK: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
- VML: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",
- XPATH: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",
- XMISS: "http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",
- XLINK: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",
- VBA: "http://schemas.microsoft.com/office/2006/relationships/vbaProject"
- });
-
- /* 9.3.3 Representing Relationships */
- function get_rels_path(file) {
- var n = file.lastIndexOf("/");
- return file.slice(0,n+1) + '_rels/' + file.slice(n+1) + ".rels";
- }
-
- function parse_rels(data, currentFilePath) {
- var rels = {"!id":{}};
- if (!data) return rels;
- if (currentFilePath.charAt(0) !== '/') {
- currentFilePath = '/'+currentFilePath;
- }
- var hash = {};
-
- (data.match(tagregex)||[]).forEach(function(x) {
- var y = parsexmltag(x);
- /* 9.3.2.2 OPC_Relationships */
- if (y[0] === '<Relationship') {
- var rel = {}; rel.Type = y.Type; rel.Target = y.Target; rel.Id = y.Id; rel.TargetMode = y.TargetMode;
- var canonictarget = y.TargetMode === 'External' ? y.Target : resolve_path(y.Target, currentFilePath);
- rels[canonictarget] = rel;
- hash[y.Id] = rel;
- }
- });
- rels["!id"] = hash;
- return rels;
- }
-
- XMLNS.RELS = 'http://schemas.openxmlformats.org/package/2006/relationships';
-
- var RELS_ROOT = writextag('Relationships', null, {
- //'xmlns:ns0': XMLNS.RELS,
- 'xmlns': XMLNS.RELS
- });
-
- /* TODO */
- function write_rels(rels) {
- var o = [XML_HEADER, RELS_ROOT];
- keys(rels['!id']).forEach(function(rid) {
- o[o.length] = (writextag('Relationship', null, rels['!id'][rid]));
- });
- if(o.length>2){ o[o.length] = ('</Relationships>'); o[1]=o[1].replace("/>",">"); }
- return o.join("");
- }
-
- var RELS_EXTERN = [RELS.HLINK, RELS.XPATH, RELS.XMISS];
- function add_rels(rels, rId, f, type, relobj, targetmode) {
- if(!relobj) relobj = {};
- if(!rels['!id']) rels['!id'] = {};
- if(rId < 0) for(rId = 1; rels['!id']['rId' + rId]; ++rId){/* empty */}
- relobj.Id = 'rId' + rId;
- relobj.Type = type;
- relobj.Target = f;
- if(targetmode) relobj.TargetMode = targetmode;
- else if(RELS_EXTERN.indexOf(relobj.Type) > -1) relobj.TargetMode = "External";
- if(rels['!id'][relobj.Id]) throw new Error("Cannot rewrite rId " + rId);
- rels['!id'][relobj.Id] = relobj;
- rels[('/' + relobj.Target).replace("//","/")] = relobj;
- return rId;
- }
- /* Open Document Format for Office Applications (OpenDocument) Version 1.2 */
- /* Part 3 Section 4 Manifest File */
- var CT_ODS = "application/vnd.oasis.opendocument.spreadsheet";
- function parse_manifest(d, opts) {
- var str = xlml_normalize(d);
- var Rn;
- var FEtag;
- while((Rn = xlmlregex.exec(str))) switch(Rn[3]) {
- case 'manifest': break; // 4.2 <manifest:manifest>
- case 'file-entry': // 4.3 <manifest:file-entry>
- FEtag = parsexmltag(Rn[0], false);
- if(FEtag.path == '/' && FEtag.type !== CT_ODS) throw new Error("This OpenDocument is not a spreadsheet");
- break;
- case 'encryption-data': // 4.4 <manifest:encryption-data>
- case 'algorithm': // 4.5 <manifest:algorithm>
- case 'start-key-generation': // 4.6 <manifest:start-key-generation>
- case 'key-derivation': // 4.7 <manifest:key-derivation>
- throw new Error("Unsupported ODS Encryption");
- default: if(opts && opts.WTF) throw Rn;
- }
- }
-
- function write_manifest(manifest) {
- var o = [XML_HEADER];
- o.push('<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2">\n');
- o.push(' <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.spreadsheet"/>\n');
- for(var i = 0; i < manifest.length; ++i) o.push(' <manifest:file-entry manifest:full-path="' + manifest[i][0] + '" manifest:media-type="' + manifest[i][1] + '"/>\n');
- o.push('</manifest:manifest>');
- return o.join("");
- }
-
- /* Part 3 Section 6 Metadata Manifest File */
- function write_rdf_type(file, res, tag) {
- return [
- ' <rdf:Description rdf:about="' + file + '">\n',
- ' <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/' + (tag || "odf") + '#' + res + '"/>\n',
- ' </rdf:Description>\n'
- ].join("");
- }
- function write_rdf_has(base, file) {
- return [
- ' <rdf:Description rdf:about="' + base + '">\n',
- ' <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="' + file + '"/>\n',
- ' </rdf:Description>\n'
- ].join("");
- }
- function write_rdf(rdf) {
- var o = [XML_HEADER];
- o.push('<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n');
- for(var i = 0; i != rdf.length; ++i) {
- o.push(write_rdf_type(rdf[i][0], rdf[i][1]));
- o.push(write_rdf_has("",rdf[i][0]));
- }
- o.push(write_rdf_type("","Document", "pkg"));
- o.push('</rdf:RDF>');
- return o.join("");
- }
- /* TODO: pull properties */
- var write_meta_ods = (function() {
- var payload = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" office:version="1.2"><office:meta><meta:generator>Sheet' + 'JS ' + XLSX.version + '</meta:generator></office:meta></office:document-meta>';
- return function wmo() {
- return payload;
- };
- })();
-
- /* ECMA-376 Part II 11.1 Core Properties Part */
- /* [MS-OSHARED] 2.3.3.2.[1-2].1 (PIDSI/PIDDSI) */
- var CORE_PROPS = [
- ["cp:category", "Category"],
- ["cp:contentStatus", "ContentStatus"],
- ["cp:keywords", "Keywords"],
- ["cp:lastModifiedBy", "LastAuthor"],
- ["cp:lastPrinted", "LastPrinted"],
- ["cp:revision", "RevNumber"],
- ["cp:version", "Version"],
- ["dc:creator", "Author"],
- ["dc:description", "Comments"],
- ["dc:identifier", "Identifier"],
- ["dc:language", "Language"],
- ["dc:subject", "Subject"],
- ["dc:title", "Title"],
- ["dcterms:created", "CreatedDate", 'date'],
- ["dcterms:modified", "ModifiedDate", 'date']
- ];
-
- XMLNS.CORE_PROPS = "http://schemas.openxmlformats.org/package/2006/metadata/core-properties";
- RELS.CORE_PROPS = 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties';
-
- var CORE_PROPS_REGEX = (function() {
- var r = new Array(CORE_PROPS.length);
- for(var i = 0; i < CORE_PROPS.length; ++i) {
- var f = CORE_PROPS[i];
- var g = "(?:"+ f[0].slice(0,f[0].indexOf(":")) +":)"+ f[0].slice(f[0].indexOf(":")+1);
- r[i] = new RegExp("<" + g + "[^>]*>([\\s\\S]*?)<\/" + g + ">");
- }
- return r;
- })();
-
- function parse_core_props(data) {
- var p = {};
- data = utf8read(data);
-
- for(var i = 0; i < CORE_PROPS.length; ++i) {
- var f = CORE_PROPS[i], cur = data.match(CORE_PROPS_REGEX[i]);
- if(cur != null && cur.length > 0) p[f[1]] = cur[1];
- if(f[2] === 'date' && p[f[1]]) p[f[1]] = parseDate(p[f[1]]);
- }
-
- return p;
- }
-
- var CORE_PROPS_XML_ROOT = writextag('cp:coreProperties', null, {
- //'xmlns': XMLNS.CORE_PROPS,
- 'xmlns:cp': XMLNS.CORE_PROPS,
- 'xmlns:dc': XMLNS.dc,
- 'xmlns:dcterms': XMLNS.dcterms,
- 'xmlns:dcmitype': XMLNS.dcmitype,
- 'xmlns:xsi': XMLNS.xsi
- });
-
- function cp_doit(f, g, h, o, p) {
- if(p[f] != null || g == null || g === "") return;
- p[f] = g;
- o[o.length] = (h ? writextag(f,g,h) : writetag(f,g));
- }
-
- function write_core_props(cp, _opts) {
- var opts = _opts || {};
- var o = [XML_HEADER, CORE_PROPS_XML_ROOT], p = {};
- if(!cp && !opts.Props) return o.join("");
-
- if(cp) {
- if(cp.CreatedDate != null) cp_doit("dcterms:created", typeof cp.CreatedDate === "string" ? cp.CreatedDate : write_w3cdtf(cp.CreatedDate, opts.WTF), {"xsi:type":"dcterms:W3CDTF"}, o, p);
- if(cp.ModifiedDate != null) cp_doit("dcterms:modified", typeof cp.ModifiedDate === "string" ? cp.ModifiedDate : write_w3cdtf(cp.ModifiedDate, opts.WTF), {"xsi:type":"dcterms:W3CDTF"}, o, p);
- }
-
- for(var i = 0; i != CORE_PROPS.length; ++i) {
- var f = CORE_PROPS[i];
- var v = opts.Props && opts.Props[f[1]] != null ? opts.Props[f[1]] : cp ? cp[f[1]] : null;
- if(v === true) v = "1";
- else if(v === false) v = "0";
- else if(typeof v == "number") v = String(v);
- if(v != null) cp_doit(f[0], v, null, o, p);
- }
- if(o.length>2){ o[o.length] = ('</cp:coreProperties>'); o[1]=o[1].replace("/>",">"); }
- return o.join("");
- }
- /* 15.2.12.3 Extended File Properties Part */
- /* [MS-OSHARED] 2.3.3.2.[1-2].1 (PIDSI/PIDDSI) */
- var EXT_PROPS = [
- ["Application", "Application", "string"],
- ["AppVersion", "AppVersion", "string"],
- ["Company", "Company", "string"],
- ["DocSecurity", "DocSecurity", "string"],
- ["Manager", "Manager", "string"],
- ["HyperlinksChanged", "HyperlinksChanged", "bool"],
- ["SharedDoc", "SharedDoc", "bool"],
- ["LinksUpToDate", "LinksUpToDate", "bool"],
- ["ScaleCrop", "ScaleCrop", "bool"],
- ["HeadingPairs", "HeadingPairs", "raw"],
- ["TitlesOfParts", "TitlesOfParts", "raw"]
- ];
-
- XMLNS.EXT_PROPS = "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties";
- RELS.EXT_PROPS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties';
-
- var PseudoPropsPairs = [
- "Worksheets", "SheetNames",
- "NamedRanges", "DefinedNames",
- "Chartsheets", "ChartNames"
- ];
- function load_props_pairs(HP, TOP, props, opts) {
- var v = [];
- if(typeof HP == "string") v = parseVector(HP, opts);
- else for(var j = 0; j < HP.length; ++j) v = v.concat(HP[j].map(function(hp) { return {v:hp}; }));
- var parts = (typeof TOP == "string") ? parseVector(TOP, opts).map(function (x) { return x.v; }) : TOP;
- var idx = 0, len = 0;
- if(parts.length > 0) for(var i = 0; i !== v.length; i += 2) {
- len = +(v[i+1].v);
- switch(v[i].v) {
- case "Worksheets":
- case "工作表":
- case "Листы":
- case "أوراق العمل":
- case "ワークシート":
- case "גליונות עבודה":
- case "Arbeitsblätter":
- case "Çalışma Sayfaları":
- case "Feuilles de calcul":
- case "Fogli di lavoro":
- case "Folhas de cálculo":
- case "Planilhas":
- case "Regneark":
- case "Hojas de cálculo":
- case "Werkbladen":
- props.Worksheets = len;
- props.SheetNames = parts.slice(idx, idx + len);
- break;
-
- case "Named Ranges":
- case "Rangos con nombre":
- case "名前付き一覧":
- case "Benannte Bereiche":
- case "Navngivne områder":
- props.NamedRanges = len;
- props.DefinedNames = parts.slice(idx, idx + len);
- break;
-
- case "Charts":
- case "Diagramme":
- props.Chartsheets = len;
- props.ChartNames = parts.slice(idx, idx + len);
- break;
- }
- idx += len;
- }
- }
-
- function parse_ext_props(data, p, opts) {
- var q = {}; if(!p) p = {};
- data = utf8read(data);
-
- EXT_PROPS.forEach(function(f) {
- switch(f[2]) {
- case "string": p[f[1]] = (data.match(matchtag(f[0]))||[])[1]; break;
- case "bool": p[f[1]] = (data.match(matchtag(f[0]))||[])[1] === "true"; break;
- case "raw":
- var cur = data.match(new RegExp("<" + f[0] + "[^>]*>([\\s\\S]*?)<\/" + f[0] + ">"));
- if(cur && cur.length > 0) q[f[1]] = cur[1];
- break;
- }
- });
-
- if(q.HeadingPairs && q.TitlesOfParts) load_props_pairs(q.HeadingPairs, q.TitlesOfParts, p, opts);
-
- return p;
- }
-
- var EXT_PROPS_XML_ROOT = writextag('Properties', null, {
- 'xmlns': XMLNS.EXT_PROPS,
- 'xmlns:vt': XMLNS.vt
- });
-
- function write_ext_props(cp) {
- var o = [], W = writextag;
- if(!cp) cp = {};
- cp.Application = "SheetJS";
- o[o.length] = (XML_HEADER);
- o[o.length] = (EXT_PROPS_XML_ROOT);
-
- EXT_PROPS.forEach(function(f) {
- if(cp[f[1]] === undefined) return;
- var v;
- switch(f[2]) {
- case 'string': v = String(cp[f[1]]); break;
- case 'bool': v = cp[f[1]] ? 'true' : 'false'; break;
- }
- if(v !== undefined) o[o.length] = (W(f[0], v));
- });
-
- /* TODO: HeadingPairs, TitlesOfParts */
- o[o.length] = (W('HeadingPairs', W('vt:vector', W('vt:variant', '<vt:lpstr>Worksheets</vt:lpstr>')+W('vt:variant', W('vt:i4', String(cp.Worksheets))), {size:2, baseType:"variant"})));
- o[o.length] = (W('TitlesOfParts', W('vt:vector', cp.SheetNames.map(function(s) { return "<vt:lpstr>" + escapexml(s) + "</vt:lpstr>"; }).join(""), {size: cp.Worksheets, baseType:"lpstr"})));
- if(o.length>2){ o[o.length] = ('</Properties>'); o[1]=o[1].replace("/>",">"); }
- return o.join("");
- }
- /* 15.2.12.2 Custom File Properties Part */
- XMLNS.CUST_PROPS = "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties";
- RELS.CUST_PROPS = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties';
-
- var custregex = /<[^>]+>[^<]*/g;
- function parse_cust_props(data, opts) {
- var p = {}, name = "";
- var m = data.match(custregex);
- if(m) for(var i = 0; i != m.length; ++i) {
- var x = m[i], y = parsexmltag(x);
- switch(y[0]) {
- case '<?xml': break;
- case '<Properties': break;
- case '<property': name = y.name; break;
- case '</property>': name = null; break;
- default: if (x.indexOf('<vt:') === 0) {
- var toks = x.split('>');
- var type = toks[0].slice(4), text = toks[1];
- /* 22.4.2.32 (CT_Variant). Omit the binary types from 22.4 (Variant Types) */
- switch(type) {
- case 'lpstr': case 'bstr': case 'lpwstr':
- p[name] = unescapexml(text);
- break;
- case 'bool':
- p[name] = parsexmlbool(text);
- break;
- case 'i1': case 'i2': case 'i4': case 'i8': case 'int': case 'uint':
- p[name] = parseInt(text, 10);
- break;
- case 'r4': case 'r8': case 'decimal':
- p[name] = parseFloat(text);
- break;
- case 'filetime': case 'date':
- p[name] = parseDate(text);
- break;
- case 'cy': case 'error':
- p[name] = unescapexml(text);
- break;
- default:
- if(type.slice(-1) == '/') break;
- if(opts.WTF && typeof console !== 'undefined') console.warn('Unexpected', x, type, toks);
- }
- } else if(x.slice(0,2) === "</") {/* empty */
- } else if(opts.WTF) throw new Error(x);
- }
- }
- return p;
- }
-
- var CUST_PROPS_XML_ROOT = writextag('Properties', null, {
- 'xmlns': XMLNS.CUST_PROPS,
- 'xmlns:vt': XMLNS.vt
- });
-
- function write_cust_props(cp) {
- var o = [XML_HEADER, CUST_PROPS_XML_ROOT];
- if(!cp) return o.join("");
- var pid = 1;
- keys(cp).forEach(function custprop(k) { ++pid;
- o[o.length] = (writextag('property', write_vt(cp[k]), {
- 'fmtid': '{D5CDD505-2E9C-101B-9397-08002B2CF9AE}',
- 'pid': pid,
- 'name': k
- }));
- });
- if(o.length>2){ o[o.length] = '</Properties>'; o[1]=o[1].replace("/>",">"); }
- return o.join("");
- }
- /* Common Name -> XLML Name */
- var XLMLDocPropsMap = {
- Title: 'Title',
- Subject: 'Subject',
- Author: 'Author',
- Keywords: 'Keywords',
- Comments: 'Description',
- LastAuthor: 'LastAuthor',
- RevNumber: 'Revision',
- Application: 'AppName',
- /* TotalTime: 'TotalTime', */
- LastPrinted: 'LastPrinted',
- CreatedDate: 'Created',
- ModifiedDate: 'LastSaved',
- /* Pages */
- /* Words */
- /* Characters */
- Category: 'Category',
- /* PresentationFormat */
- Manager: 'Manager',
- Company: 'Company',
- /* Guid */
- /* HyperlinkBase */
- /* Bytes */
- /* Lines */
- /* Paragraphs */
- /* CharactersWithSpaces */
- AppVersion: 'Version',
-
- ContentStatus: 'ContentStatus', /* NOTE: missing from schema */
- Identifier: 'Identifier', /* NOTE: missing from schema */
- Language: 'Language' /* NOTE: missing from schema */
- };
- var evert_XLMLDPM = evert(XLMLDocPropsMap);
-
- function xlml_set_prop(Props, tag, val) {
- tag = evert_XLMLDPM[tag] || tag;
- Props[tag] = val;
- }
-
- function xlml_write_docprops(Props, opts) {
- var o = [];
- keys(XLMLDocPropsMap).map(function(m) {
- for(var i = 0; i < CORE_PROPS.length; ++i) if(CORE_PROPS[i][1] == m) return CORE_PROPS[i];
- for(i = 0; i < EXT_PROPS.length; ++i) if(EXT_PROPS[i][1] == m) return EXT_PROPS[i];
- throw m;
- }).forEach(function(p) {
- if(Props[p[1]] == null) return;
- var m = opts && opts.Props && opts.Props[p[1]] != null ? opts.Props[p[1]] : Props[p[1]];
- switch(p[2]) {
- case 'date': m = new Date(m).toISOString().replace(/\.\d*Z/,"Z"); break;
- }
- if(typeof m == 'number') m = String(m);
- else if(m === true || m === false) { m = m ? "1" : "0"; }
- else if(m instanceof Date) m = new Date(m).toISOString().replace(/\.\d*Z/,"");
- o.push(writetag(XLMLDocPropsMap[p[1]] || p[1], m));
- });
- return writextag('DocumentProperties', o.join(""), {xmlns:XLMLNS.o });
- }
- function xlml_write_custprops(Props, Custprops) {
- var BLACKLIST = ["Worksheets","SheetNames"];
- var T = 'CustomDocumentProperties';
- var o = [];
- if(Props) keys(Props).forEach(function(k) {
- if(!Props.hasOwnProperty(k)) return;
- for(var i = 0; i < CORE_PROPS.length; ++i) if(k == CORE_PROPS[i][1]) return;
- for(i = 0; i < EXT_PROPS.length; ++i) if(k == EXT_PROPS[i][1]) return;
- for(i = 0; i < BLACKLIST.length; ++i) if(k == BLACKLIST[i]) return;
-
- var m = Props[k];
- var t = "string";
- if(typeof m == 'number') { t = "float"; m = String(m); }
- else if(m === true || m === false) { t = "boolean"; m = m ? "1" : "0"; }
- else m = String(m);
- o.push(writextag(escapexmltag(k), m, {"dt:dt":t}));
- });
- if(Custprops) keys(Custprops).forEach(function(k) {
- if(!Custprops.hasOwnProperty(k)) return;
- if(Props && Props.hasOwnProperty(k)) return;
- var m = Custprops[k];
- var t = "string";
- if(typeof m == 'number') { t = "float"; m = String(m); }
- else if(m === true || m === false) { t = "boolean"; m = m ? "1" : "0"; }
- else if(m instanceof Date) { t = "dateTime.tz"; m = m.toISOString(); }
- else m = String(m);
- o.push(writextag(escapexmltag(k), m, {"dt:dt":t}));
- });
- return '<' + T + ' xmlns="' + XLMLNS.o + '">' + o.join("") + '</' + T + '>';
- }
- /* [MS-DTYP] 2.3.3 FILETIME */
- /* [MS-OLEDS] 2.1.3 FILETIME (Packet Version) */
- /* [MS-OLEPS] 2.8 FILETIME (Packet Version) */
- function parse_FILETIME(blob) {
- var dwLowDateTime = blob.read_shift(4), dwHighDateTime = blob.read_shift(4);
- return new Date(((dwHighDateTime/1e7*Math.pow(2,32) + dwLowDateTime/1e7) - 11644473600)*1000).toISOString().replace(/\.000/,"");
- }
- function write_FILETIME(time) {
- var date = (typeof time == "string") ? new Date(Date.parse(time)) : time;
- var t = date.getTime() / 1000 + 11644473600;
- var l = t % Math.pow(2,32), h = (t - l) / Math.pow(2,32);
- l *= 1e7; h *= 1e7;
- var w = (l / Math.pow(2,32)) | 0;
- if(w > 0) { l = l % Math.pow(2,32); h += w; }
- var o = new_buf(8); o.write_shift(4, l); o.write_shift(4, h); return o;
- }
-
- /* [MS-OSHARED] 2.3.3.1.4 Lpstr */
- function parse_lpstr(blob, type, pad) {
- var start = blob.l;
- var str = blob.read_shift(0, 'lpstr-cp');
- if(pad) while((blob.l - start) & 3) ++blob.l;
- return str;
- }
-
- /* [MS-OSHARED] 2.3.3.1.6 Lpwstr */
- function parse_lpwstr(blob, type, pad) {
- var str = blob.read_shift(0, 'lpwstr');
- if(pad) blob.l += (4 - ((str.length+1) & 3)) & 3;
- return str;
- }
-
-
- /* [MS-OSHARED] 2.3.3.1.11 VtString */
- /* [MS-OSHARED] 2.3.3.1.12 VtUnalignedString */
- function parse_VtStringBase(blob, stringType, pad) {
- if(stringType === 0x1F /*VT_LPWSTR*/) return parse_lpwstr(blob);
- return parse_lpstr(blob, stringType, pad);
- }
-
- function parse_VtString(blob, t, pad) { return parse_VtStringBase(blob, t, pad === false ? 0: 4); }
- function parse_VtUnalignedString(blob, t) { if(!t) throw new Error("VtUnalignedString must have positive length"); return parse_VtStringBase(blob, t, 0); }
-
- /* [MS-OSHARED] 2.3.3.1.9 VtVecUnalignedLpstrValue */
- function parse_VtVecUnalignedLpstrValue(blob) {
- var length = blob.read_shift(4);
- var ret = [];
- for(var i = 0; i != length; ++i) ret[i] = blob.read_shift(0, 'lpstr-cp').replace(chr0,'');
- return ret;
- }
-
- /* [MS-OSHARED] 2.3.3.1.10 VtVecUnalignedLpstr */
- function parse_VtVecUnalignedLpstr(blob) {
- return parse_VtVecUnalignedLpstrValue(blob);
- }
-
- /* [MS-OSHARED] 2.3.3.1.13 VtHeadingPair */
- function parse_VtHeadingPair(blob) {
- var headingString = parse_TypedPropertyValue(blob, VT_USTR);
- var headerParts = parse_TypedPropertyValue(blob, VT_I4);
- return [headingString, headerParts];
- }
-
- /* [MS-OSHARED] 2.3.3.1.14 VtVecHeadingPairValue */
- function parse_VtVecHeadingPairValue(blob) {
- var cElements = blob.read_shift(4);
- var out = [];
- for(var i = 0; i != cElements / 2; ++i) out.push(parse_VtHeadingPair(blob));
- return out;
- }
-
- /* [MS-OSHARED] 2.3.3.1.15 VtVecHeadingPair */
- function parse_VtVecHeadingPair(blob) {
- // NOTE: When invoked, wType & padding were already consumed
- return parse_VtVecHeadingPairValue(blob);
- }
-
- /* [MS-OLEPS] 2.18.1 Dictionary (uses 2.17, 2.16) */
- function parse_dictionary(blob,CodePage) {
- var cnt = blob.read_shift(4);
- var dict = ({});
- for(var j = 0; j != cnt; ++j) {
- var pid = blob.read_shift(4);
- var len = blob.read_shift(4);
- dict[pid] = blob.read_shift(len, (CodePage === 0x4B0 ?'utf16le':'utf8')).replace(chr0,'').replace(chr1,'!');
- if(CodePage === 0x4B0 && (len % 2)) blob.l += 2;
- }
- if(blob.l & 3) blob.l = (blob.l>>2+1)<<2;
- return dict;
- }
-
- /* [MS-OLEPS] 2.9 BLOB */
- function parse_BLOB(blob) {
- var size = blob.read_shift(4);
- var bytes = blob.slice(blob.l,blob.l+size);
- blob.l += size;
- if((size & 3) > 0) blob.l += (4 - (size & 3)) & 3;
- return bytes;
- }
-
- /* [MS-OLEPS] 2.11 ClipboardData */
- function parse_ClipboardData(blob) {
- // TODO
- var o = {};
- o.Size = blob.read_shift(4);
- //o.Format = blob.read_shift(4);
- blob.l += o.Size + 3 - (o.Size - 1) % 4;
- return o;
- }
-
- /* [MS-OLEPS] 2.15 TypedPropertyValue */
- function parse_TypedPropertyValue(blob, type, _opts) {
- var t = blob.read_shift(2), ret, opts = _opts||{};
- blob.l += 2;
- if(type !== VT_VARIANT)
- if(t !== type && VT_CUSTOM.indexOf(type)===-1) throw new Error('Expected type ' + type + ' saw ' + t);
- switch(type === VT_VARIANT ? t : type) {
- case 0x02 /*VT_I2*/: ret = blob.read_shift(2, 'i'); if(!opts.raw) blob.l += 2; return ret;
- case 0x03 /*VT_I4*/: ret = blob.read_shift(4, 'i'); return ret;
- case 0x0B /*VT_BOOL*/: return blob.read_shift(4) !== 0x0;
- case 0x13 /*VT_UI4*/: ret = blob.read_shift(4); return ret;
- case 0x1E /*VT_LPSTR*/: return parse_lpstr(blob, t, 4).replace(chr0,'');
- case 0x1F /*VT_LPWSTR*/: return parse_lpwstr(blob);
- case 0x40 /*VT_FILETIME*/: return parse_FILETIME(blob);
- case 0x41 /*VT_BLOB*/: return parse_BLOB(blob);
- case 0x47 /*VT_CF*/: return parse_ClipboardData(blob);
- case 0x50 /*VT_STRING*/: return parse_VtString(blob, t, !opts.raw).replace(chr0,'');
- case 0x51 /*VT_USTR*/: return parse_VtUnalignedString(blob, t/*, 4*/).replace(chr0,'');
- case 0x100C /*VT_VECTOR|VT_VARIANT*/: return parse_VtVecHeadingPair(blob);
- case 0x101E /*VT_LPSTR*/: return parse_VtVecUnalignedLpstr(blob);
- default: throw new Error("TypedPropertyValue unrecognized type " + type + " " + t);
- }
- }
- function write_TypedPropertyValue(type, value) {
- var o = new_buf(4), p = new_buf(4);
- o.write_shift(4, type == 0x50 ? 0x1F : type);
- switch(type) {
- case 0x03 /*VT_I4*/: p.write_shift(-4, value); break;
- case 0x05 /*VT_I4*/: p = new_buf(8); p.write_shift(8, value, 'f'); break;
- case 0x0B /*VT_BOOL*/: p.write_shift(4, value ? 0x01 : 0x00); break;
- case 0x40 /*VT_FILETIME*/: p = write_FILETIME(value); break;
- case 0x1F /*VT_LPWSTR*/:
- case 0x50 /*VT_STRING*/:
- p = new_buf(4 + 2 * (value.length + 1) + (value.length % 2 ? 0 : 2));
- p.write_shift(4, value.length + 1);
- p.write_shift(0, value, "dbcs");
- while(p.l != p.length) p.write_shift(1, 0);
- break;
- default: throw new Error("TypedPropertyValue unrecognized type " + type + " " + value);
- }
- return bconcat([o, p]);
- }
-
- /* [MS-OLEPS] 2.20 PropertySet */
- function parse_PropertySet(blob, PIDSI) {
- var start_addr = blob.l;
- var size = blob.read_shift(4);
- var NumProps = blob.read_shift(4);
- var Props = [], i = 0;
- var CodePage = 0;
- var Dictionary = -1, DictObj = ({});
- for(i = 0; i != NumProps; ++i) {
- var PropID = blob.read_shift(4);
- var Offset = blob.read_shift(4);
- Props[i] = [PropID, Offset + start_addr];
- }
- Props.sort(function(x,y) { return x[1] - y[1]; });
- var PropH = {};
- for(i = 0; i != NumProps; ++i) {
- if(blob.l !== Props[i][1]) {
- var fail = true;
- if(i>0 && PIDSI) switch(PIDSI[Props[i-1][0]].t) {
- case 0x02 /*VT_I2*/: if(blob.l+2 === Props[i][1]) { blob.l+=2; fail = false; } break;
- case 0x50 /*VT_STRING*/: if(blob.l <= Props[i][1]) { blob.l=Props[i][1]; fail = false; } break;
- case 0x100C /*VT_VECTOR|VT_VARIANT*/: if(blob.l <= Props[i][1]) { blob.l=Props[i][1]; fail = false; } break;
- }
- if((!PIDSI||i==0) && blob.l <= Props[i][1]) { fail=false; blob.l = Props[i][1]; }
- if(fail) throw new Error("Read Error: Expected address " + Props[i][1] + ' at ' + blob.l + ' :' + i);
- }
- if(PIDSI) {
- var piddsi = PIDSI[Props[i][0]];
- PropH[piddsi.n] = parse_TypedPropertyValue(blob, piddsi.t, {raw:true});
- if(piddsi.p === 'version') PropH[piddsi.n] = String(PropH[piddsi.n] >> 16) + "." + ("0000" + String(PropH[piddsi.n] & 0xFFFF)).slice(-4);
- if(piddsi.n == "CodePage") switch(PropH[piddsi.n]) {
- case 0: PropH[piddsi.n] = 1252;
- /* falls through */
- case 874:
- case 932:
- case 936:
- case 949:
- case 950:
- case 1250:
- case 1251:
- case 1253:
- case 1254:
- case 1255:
- case 1256:
- case 1257:
- case 1258:
- case 10000:
- case 1200:
- case 1201:
- case 1252:
- case 65000: case -536:
- case 65001: case -535:
- set_cp(CodePage = (PropH[piddsi.n]>>>0) & 0xFFFF); break;
- default: throw new Error("Unsupported CodePage: " + PropH[piddsi.n]);
- }
- } else {
- if(Props[i][0] === 0x1) {
- CodePage = PropH.CodePage = (parse_TypedPropertyValue(blob, VT_I2));
- set_cp(CodePage);
- if(Dictionary !== -1) {
- var oldpos = blob.l;
- blob.l = Props[Dictionary][1];
- DictObj = parse_dictionary(blob,CodePage);
- blob.l = oldpos;
- }
- } else if(Props[i][0] === 0) {
- if(CodePage === 0) { Dictionary = i; blob.l = Props[i+1][1]; continue; }
- DictObj = parse_dictionary(blob,CodePage);
- } else {
- var name = DictObj[Props[i][0]];
- var val;
- /* [MS-OSHARED] 2.3.3.2.3.1.2 + PROPVARIANT */
- switch(blob[blob.l]) {
- case 0x41 /*VT_BLOB*/: blob.l += 4; val = parse_BLOB(blob); break;
- case 0x1E /*VT_LPSTR*/: blob.l += 4; val = parse_VtString(blob, blob[blob.l-4]).replace(/\u0000+$/,""); break;
- case 0x1F /*VT_LPWSTR*/: blob.l += 4; val = parse_VtString(blob, blob[blob.l-4]).replace(/\u0000+$/,""); break;
- case 0x03 /*VT_I4*/: blob.l += 4; val = blob.read_shift(4, 'i'); break;
- case 0x13 /*VT_UI4*/: blob.l += 4; val = blob.read_shift(4); break;
- case 0x05 /*VT_R8*/: blob.l += 4; val = blob.read_shift(8, 'f'); break;
- case 0x0B /*VT_BOOL*/: blob.l += 4; val = parsebool(blob, 4); break;
- case 0x40 /*VT_FILETIME*/: blob.l += 4; val = parseDate(parse_FILETIME(blob)); break;
- default: throw new Error("unparsed value: " + blob[blob.l]);
- }
- PropH[name] = val;
- }
- }
- }
- blob.l = start_addr + size; /* step ahead to skip padding */
- return PropH;
- }
- var XLSPSSkip = [ "CodePage", "Thumbnail", "_PID_LINKBASE", "_PID_HLINKS", "SystemIdentifier", "FMTID" ].concat(PseudoPropsPairs);
- function guess_property_type(val) {
- switch(typeof val) {
- case "boolean": return 0x0B;
- case "number": return ((val|0)==val) ? 0x03 : 0x05;
- case "string": return 0x1F;
- case "object": if(val instanceof Date) return 0x40; break;
- }
- return -1;
- }
- function write_PropertySet(entries, RE, PIDSI) {
- var hdr = new_buf(8), piao = [], prop = [];
- var sz = 8, i = 0;
-
- var pr = new_buf(8), pio = new_buf(8);
- pr.write_shift(4, 0x0002);
- pr.write_shift(4, 0x04B0);
- pio.write_shift(4, 0x0001);
- prop.push(pr); piao.push(pio);
- sz += 8 + pr.length;
-
- if(!RE) {
- pio = new_buf(8);
- pio.write_shift(4, 0);
- piao.unshift(pio);
-
- var bufs = [new_buf(4)];
- bufs[0].write_shift(4, entries.length);
- for(i = 0; i < entries.length; ++i) {
- var value = entries[i][0];
- pr = new_buf(4 + 4 + 2 * (value.length + 1) + (value.length % 2 ? 0 : 2));
- pr.write_shift(4, i+2);
- pr.write_shift(4, value.length + 1);
- pr.write_shift(0, value, "dbcs");
- while(pr.l != pr.length) pr.write_shift(1, 0);
- bufs.push(pr);
- }
- pr = bconcat(bufs);
- prop.unshift(pr);
- sz += 8 + pr.length;
- }
-
- for(i = 0; i < entries.length; ++i) {
- if(RE && !RE[entries[i][0]]) continue;
- if(XLSPSSkip.indexOf(entries[i][0]) > -1) continue;
- if(entries[i][1] == null) continue;
-
- var val = entries[i][1], idx = 0;
- if(RE) {
- idx = +RE[entries[i][0]];
- var pinfo = (PIDSI)[idx];
- if(pinfo.p == "version" && typeof val == "string") {
- var arr = val.split(".");
- val = ((+arr[0])<<16) + ((+arr[1])||0);
- }
- pr = write_TypedPropertyValue(pinfo.t, val);
- } else {
- var T = guess_property_type(val);
- if(T == -1) { T = 0x1F; val = String(val); }
- pr = write_TypedPropertyValue(T, val);
- }
- prop.push(pr);
-
- pio = new_buf(8);
- pio.write_shift(4, !RE ? 2+i : idx);
- piao.push(pio);
-
- sz += 8 + pr.length;
- }
-
- var w = 8 * (prop.length + 1);
- for(i = 0; i < prop.length; ++i) { piao[i].write_shift(4, w); w += prop[i].length; }
- hdr.write_shift(4, sz);
- hdr.write_shift(4, prop.length);
- return bconcat([hdr].concat(piao).concat(prop));
- }
-
- /* [MS-OLEPS] 2.21 PropertySetStream */
- function parse_PropertySetStream(file, PIDSI, clsid) {
- var blob = file.content;
- if(!blob) return ({});
- prep_blob(blob, 0);
-
- var NumSets, FMTID0, FMTID1, Offset0, Offset1 = 0;
- blob.chk('feff', 'Byte Order: ');
-
- /*var vers = */blob.read_shift(2); // TODO: check version
- var SystemIdentifier = blob.read_shift(4);
- var CLSID = blob.read_shift(16);
- if(CLSID !== CFB.utils.consts.HEADER_CLSID && CLSID !== clsid) throw new Error("Bad PropertySet CLSID " + CLSID);
- NumSets = blob.read_shift(4);
- if(NumSets !== 1 && NumSets !== 2) throw new Error("Unrecognized #Sets: " + NumSets);
- FMTID0 = blob.read_shift(16); Offset0 = blob.read_shift(4);
-
- if(NumSets === 1 && Offset0 !== blob.l) throw new Error("Length mismatch: " + Offset0 + " !== " + blob.l);
- else if(NumSets === 2) { FMTID1 = blob.read_shift(16); Offset1 = blob.read_shift(4); }
- var PSet0 = parse_PropertySet(blob, PIDSI);
-
- var rval = ({ SystemIdentifier: SystemIdentifier });
- for(var y in PSet0) rval[y] = PSet0[y];
- //rval.blob = blob;
- rval.FMTID = FMTID0;
- //rval.PSet0 = PSet0;
- if(NumSets === 1) return rval;
- if(Offset1 - blob.l == 2) blob.l += 2;
- if(blob.l !== Offset1) throw new Error("Length mismatch 2: " + blob.l + " !== " + Offset1);
- var PSet1;
- try { PSet1 = parse_PropertySet(blob, null); } catch(e) {/* empty */}
- for(y in PSet1) rval[y] = PSet1[y];
- rval.FMTID = [FMTID0, FMTID1]; // TODO: verify FMTID0/1
- return rval;
- }
- function write_PropertySetStream(entries, clsid, RE, PIDSI, entries2, clsid2) {
- var hdr = new_buf(entries2 ? 68 : 48);
- var bufs = [hdr];
- hdr.write_shift(2, 0xFFFE);
- hdr.write_shift(2, 0x0000); /* TODO: type 1 props */
- hdr.write_shift(4, 0x32363237);
- hdr.write_shift(16, CFB.utils.consts.HEADER_CLSID, "hex");
- hdr.write_shift(4, (entries2 ? 2 : 1));
- hdr.write_shift(16, clsid, "hex");
- hdr.write_shift(4, (entries2 ? 68 : 48));
- var ps0 = write_PropertySet(entries, RE, PIDSI);
- bufs.push(ps0);
-
- if(entries2) {
- var ps1 = write_PropertySet(entries2, null, null);
- hdr.write_shift(16, clsid2, "hex");
- hdr.write_shift(4, 68 + ps0.length);
- bufs.push(ps1);
- }
- return bconcat(bufs);
- }
-
- function parsenoop2(blob, length) { blob.read_shift(length); return null; }
- function writezeroes(n, o) { if(!o) o=new_buf(n); for(var j=0; j<n; ++j) o.write_shift(1, 0); return o; }
-
- function parslurp(blob, length, cb) {
- var arr = [], target = blob.l + length;
- while(blob.l < target) arr.push(cb(blob, target - blob.l));
- if(target !== blob.l) throw new Error("Slurp error");
- return arr;
- }
-
- function parsebool(blob, length) { return blob.read_shift(length) === 0x1; }
- function writebool(v, o) { if(!o) o=new_buf(2); o.write_shift(2, +!!v); return o; }
-
- function parseuint16(blob) { return blob.read_shift(2, 'u'); }
- function writeuint16(v, o) { if(!o) o=new_buf(2); o.write_shift(2, v); return o; }
- function parseuint16a(blob, length) { return parslurp(blob,length,parseuint16);}
-
- /* --- 2.5 Structures --- */
-
- /* [MS-XLS] 2.5.10 Bes (boolean or error) */
- function parse_Bes(blob) {
- var v = blob.read_shift(1), t = blob.read_shift(1);
- return t === 0x01 ? v : v === 0x01;
- }
- function write_Bes(v, t, o) {
- if(!o) o = new_buf(2);
- o.write_shift(1, +v);
- o.write_shift(1, ((t == 'e') ? 1 : 0));
- return o;
- }
-
- /* [MS-XLS] 2.5.240 ShortXLUnicodeString */
- function parse_ShortXLUnicodeString(blob, length, opts) {
- var cch = blob.read_shift(opts && opts.biff >= 12 ? 2 : 1);
- var encoding = 'sbcs-cont';
- var cp = current_codepage;
- if(opts && opts.biff >= 8) current_codepage = 1200;
- if(!opts || opts.biff == 8 ) {
- var fHighByte = blob.read_shift(1);
- if(fHighByte) { encoding = 'dbcs-cont'; }
- } else if(opts.biff == 12) {
- encoding = 'wstr';
- }
- if(opts.biff >= 2 && opts.biff <= 5) encoding = 'cpstr';
- var o = cch ? blob.read_shift(cch, encoding) : "";
- current_codepage = cp;
- return o;
- }
-
- /* 2.5.293 XLUnicodeRichExtendedString */
- function parse_XLUnicodeRichExtendedString(blob) {
- var cp = current_codepage;
- current_codepage = 1200;
- var cch = blob.read_shift(2), flags = blob.read_shift(1);
- var /*fHighByte = flags & 0x1,*/ fExtSt = flags & 0x4, fRichSt = flags & 0x8;
- var width = 1 + (flags & 0x1); // 0x0 -> utf8, 0x1 -> dbcs
- var cRun = 0, cbExtRst;
- var z = {};
- if(fRichSt) cRun = blob.read_shift(2);
- if(fExtSt) cbExtRst = blob.read_shift(4);
- var encoding = width == 2 ? 'dbcs-cont' : 'sbcs-cont';
- var msg = cch === 0 ? "" : blob.read_shift(cch, encoding);
- if(fRichSt) blob.l += 4 * cRun; //TODO: parse this
- if(fExtSt) blob.l += cbExtRst; //TODO: parse this
- z.t = msg;
- if(!fRichSt) { z.raw = "<t>" + z.t + "</t>"; z.r = z.t; }
- current_codepage = cp;
- return z;
- }
-
- /* 2.5.296 XLUnicodeStringNoCch */
- function parse_XLUnicodeStringNoCch(blob, cch, opts) {
- var retval;
- if(opts) {
- if(opts.biff >= 2 && opts.biff <= 5) return blob.read_shift(cch, 'cpstr');
- if(opts.biff >= 12) return blob.read_shift(cch, 'dbcs-cont');
- }
- var fHighByte = blob.read_shift(1);
- if(fHighByte===0) { retval = blob.read_shift(cch, 'sbcs-cont'); }
- else { retval = blob.read_shift(cch, 'dbcs-cont'); }
- return retval;
- }
-
- /* 2.5.294 XLUnicodeString */
- function parse_XLUnicodeString(blob, length, opts) {
- var cch = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
- if(cch === 0) { blob.l++; return ""; }
- return parse_XLUnicodeStringNoCch(blob, cch, opts);
- }
- /* BIFF5 override */
- function parse_XLUnicodeString2(blob, length, opts) {
- if(opts.biff > 5) return parse_XLUnicodeString(blob, length, opts);
- var cch = blob.read_shift(1);
- if(cch === 0) { blob.l++; return ""; }
- return blob.read_shift(cch, (opts.biff <= 4 || !blob.lens ) ? 'cpstr' : 'sbcs-cont');
- }
- /* TODO: BIFF5 and lower, codepage awareness */
- function write_XLUnicodeString(str, opts, o) {
- if(!o) o = new_buf(3 + 2 * str.length);
- o.write_shift(2, str.length);
- o.write_shift(1, 1);
- o.write_shift(31, str, 'utf16le');
- return o;
- }
-
- /* [MS-XLS] 2.5.61 ControlInfo */
- function parse_ControlInfo(blob) {
- var flags = blob.read_shift(1);
- blob.l++;
- var accel = blob.read_shift(2);
- blob.l += 2;
- return [flags, accel];
- }
-
- /* [MS-OSHARED] 2.3.7.6 URLMoniker TODO: flags */
- function parse_URLMoniker(blob) {
- var len = blob.read_shift(4), start = blob.l;
- var extra = false;
- if(len > 24) {
- /* look ahead */
- blob.l += len - 24;
- if(blob.read_shift(16) === "795881f43b1d7f48af2c825dc4852763") extra = true;
- blob.l = start;
- }
- var url = blob.read_shift((extra?len-24:len)>>1, 'utf16le').replace(chr0,"");
- if(extra) blob.l += 24;
- return url;
- }
-
- /* [MS-OSHARED] 2.3.7.8 FileMoniker TODO: all fields */
- function parse_FileMoniker(blob) {
- blob.l += 2; //var cAnti = blob.read_shift(2);
- var ansiPath = blob.read_shift(0, 'lpstr-ansi');
- blob.l += 2; //var endServer = blob.read_shift(2);
- if(blob.read_shift(2) != 0xDEAD) throw new Error("Bad FileMoniker");
- var sz = blob.read_shift(4);
- if(sz === 0) return ansiPath.replace(/\\/g,"/");
- var bytes = blob.read_shift(4);
- if(blob.read_shift(2) != 3) throw new Error("Bad FileMoniker");
- var unicodePath = blob.read_shift(bytes>>1, 'utf16le').replace(chr0,"");
- return unicodePath;
- }
-
- /* [MS-OSHARED] 2.3.7.2 HyperlinkMoniker TODO: all the monikers */
- function parse_HyperlinkMoniker(blob, length) {
- var clsid = blob.read_shift(16); length -= 16;
- switch(clsid) {
- case "e0c9ea79f9bace118c8200aa004ba90b": return parse_URLMoniker(blob, length);
- case "0303000000000000c000000000000046": return parse_FileMoniker(blob, length);
- default: throw new Error("Unsupported Moniker " + clsid);
- }
- }
-
- /* [MS-OSHARED] 2.3.7.9 HyperlinkString */
- function parse_HyperlinkString(blob) {
- var len = blob.read_shift(4);
- var o = len > 0 ? blob.read_shift(len, 'utf16le').replace(chr0, "") : "";
- return o;
- }
-
- /* [MS-OSHARED] 2.3.7.1 Hyperlink Object */
- function parse_Hyperlink(blob, length) {
- var end = blob.l + length;
- var sVer = blob.read_shift(4);
- if(sVer !== 2) throw new Error("Unrecognized streamVersion: " + sVer);
- var flags = blob.read_shift(2);
- blob.l += 2;
- var displayName, targetFrameName, moniker, oleMoniker, Loc="", guid, fileTime;
- if(flags & 0x0010) displayName = parse_HyperlinkString(blob, end - blob.l);
- if(flags & 0x0080) targetFrameName = parse_HyperlinkString(blob, end - blob.l);
- if((flags & 0x0101) === 0x0101) moniker = parse_HyperlinkString(blob, end - blob.l);
- if((flags & 0x0101) === 0x0001) oleMoniker = parse_HyperlinkMoniker(blob, end - blob.l);
- if(flags & 0x0008) Loc = parse_HyperlinkString(blob, end - blob.l);
- if(flags & 0x0020) guid = blob.read_shift(16);
- if(flags & 0x0040) fileTime = parse_FILETIME(blob/*, 8*/);
- blob.l = end;
- var target = targetFrameName||moniker||oleMoniker||"";
- if(target && Loc) target+="#"+Loc;
- if(!target) target = "#" + Loc;
- var out = ({Target:target});
- if(guid) out.guid = guid;
- if(fileTime) out.time = fileTime;
- if(displayName) out.Tooltip = displayName;
- return out;
- }
- function write_Hyperlink(hl) {
- var out = new_buf(512), i = 0;
- var Target = hl.Target;
- var F = Target.indexOf("#") > -1 ? 0x1f : 0x17;
- switch(Target.charAt(0)) { case "#": F=0x1c; break; case ".": F&=~2; break; }
- out.write_shift(4,2); out.write_shift(4, F);
- var data = [8,6815827,6619237,4849780,83]; for(i = 0; i < data.length; ++i) out.write_shift(4, data[i]);
- if(F == 0x1C) {
- Target = Target.slice(1);
- out.write_shift(4, Target.length + 1);
- for(i = 0; i < Target.length; ++i) out.write_shift(2, Target.charCodeAt(i));
- out.write_shift(2, 0);
- } else if(F & 0x02) {
- data = "e0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" ");
- for(i = 0; i < data.length; ++i) out.write_shift(1, parseInt(data[i], 16));
- out.write_shift(4, 2*(Target.length + 1));
- for(i = 0; i < Target.length; ++i) out.write_shift(2, Target.charCodeAt(i));
- out.write_shift(2, 0);
- } else {
- data = "03 03 00 00 00 00 00 00 c0 00 00 00 00 00 00 46".split(" ");
- for(i = 0; i < data.length; ++i) out.write_shift(1, parseInt(data[i], 16));
- var P = 0;
- while(Target.slice(P*3,P*3+3)=="../"||Target.slice(P*3,P*3+3)=="..\\") ++P;
- out.write_shift(2, P);
- out.write_shift(4, Target.length + 1);
- for(i = 0; i < Target.length; ++i) out.write_shift(1, Target.charCodeAt(i) & 0xFF);
- out.write_shift(1, 0);
- out.write_shift(2, 0xFFFF);
- out.write_shift(2, 0xDEAD);
- for(i = 0; i < 6; ++i) out.write_shift(4, 0);
- }
- return out.slice(0, out.l);
- }
-
- /* 2.5.178 LongRGBA */
- function parse_LongRGBA(blob) { var r = blob.read_shift(1), g = blob.read_shift(1), b = blob.read_shift(1), a = blob.read_shift(1); return [r,g,b,a]; }
-
- /* 2.5.177 LongRGB */
- function parse_LongRGB(blob, length) { var x = parse_LongRGBA(blob, length); x[3] = 0; return x; }
-
-
- /* [MS-XLS] 2.5.19 */
- function parse_XLSCell(blob) {
- var rw = blob.read_shift(2); // 0-indexed
- var col = blob.read_shift(2);
- var ixfe = blob.read_shift(2);
- return ({r:rw, c:col, ixfe:ixfe});
- }
- function write_XLSCell(R, C, ixfe, o) {
- if(!o) o = new_buf(6);
- o.write_shift(2, R);
- o.write_shift(2, C);
- o.write_shift(2, ixfe||0);
- return o;
- }
-
- /* [MS-XLS] 2.5.134 */
- function parse_frtHeader(blob) {
- var rt = blob.read_shift(2);
- var flags = blob.read_shift(2); // TODO: parse these flags
- blob.l += 8;
- return {type: rt, flags: flags};
- }
-
-
-
- function parse_OptXLUnicodeString(blob, length, opts) { return length === 0 ? "" : parse_XLUnicodeString2(blob, length, opts); }
-
- /* [MS-XLS] 2.5.344 */
- function parse_XTI(blob, length, opts) {
- var w = opts.biff > 8 ? 4 : 2;
- var iSupBook = blob.read_shift(w), itabFirst = blob.read_shift(w,'i'), itabLast = blob.read_shift(w,'i');
- return [iSupBook, itabFirst, itabLast];
- }
-
- /* [MS-XLS] 2.5.218 */
- function parse_RkRec(blob) {
- var ixfe = blob.read_shift(2);
- var RK = parse_RkNumber(blob);
- return [ixfe, RK];
- }
-
- /* [MS-XLS] 2.5.1 */
- function parse_AddinUdf(blob, length, opts) {
- blob.l += 4; length -= 4;
- var l = blob.l + length;
- var udfName = parse_ShortXLUnicodeString(blob, length, opts);
- var cb = blob.read_shift(2);
- l -= blob.l;
- if(cb !== l) throw new Error("Malformed AddinUdf: padding = " + l + " != " + cb);
- blob.l += cb;
- return udfName;
- }
-
- /* [MS-XLS] 2.5.209 TODO: Check sizes */
- function parse_Ref8U(blob) {
- var rwFirst = blob.read_shift(2);
- var rwLast = blob.read_shift(2);
- var colFirst = blob.read_shift(2);
- var colLast = blob.read_shift(2);
- return {s:{c:colFirst, r:rwFirst}, e:{c:colLast,r:rwLast}};
- }
- function write_Ref8U(r, o) {
- if(!o) o = new_buf(8);
- o.write_shift(2, r.s.r);
- o.write_shift(2, r.e.r);
- o.write_shift(2, r.s.c);
- o.write_shift(2, r.e.c);
- return o;
- }
-
- /* [MS-XLS] 2.5.211 */
- function parse_RefU(blob) {
- var rwFirst = blob.read_shift(2);
- var rwLast = blob.read_shift(2);
- var colFirst = blob.read_shift(1);
- var colLast = blob.read_shift(1);
- return {s:{c:colFirst, r:rwFirst}, e:{c:colLast,r:rwLast}};
- }
-
- /* [MS-XLS] 2.5.207 */
- var parse_Ref = parse_RefU;
-
- /* [MS-XLS] 2.5.143 */
- function parse_FtCmo(blob) {
- blob.l += 4;
- var ot = blob.read_shift(2);
- var id = blob.read_shift(2);
- var flags = blob.read_shift(2);
- blob.l+=12;
- return [id, ot, flags];
- }
-
- /* [MS-XLS] 2.5.149 */
- function parse_FtNts(blob) {
- var out = {};
- blob.l += 4;
- blob.l += 16; // GUID TODO
- out.fSharedNote = blob.read_shift(2);
- blob.l += 4;
- return out;
- }
-
- /* [MS-XLS] 2.5.142 */
- function parse_FtCf(blob) {
- var out = {};
- blob.l += 4;
- blob.cf = blob.read_shift(2);
- return out;
- }
-
- /* [MS-XLS] 2.5.140 - 2.5.154 and friends */
- function parse_FtSkip(blob) { blob.l += 2; blob.l += blob.read_shift(2); }
- var FtTab = {
- 0x00: parse_FtSkip, /* FtEnd */
- 0x04: parse_FtSkip, /* FtMacro */
- 0x05: parse_FtSkip, /* FtButton */
- 0x06: parse_FtSkip, /* FtGmo */
- 0x07: parse_FtCf, /* FtCf */
- 0x08: parse_FtSkip, /* FtPioGrbit */
- 0x09: parse_FtSkip, /* FtPictFmla */
- 0x0A: parse_FtSkip, /* FtCbls */
- 0x0B: parse_FtSkip, /* FtRbo */
- 0x0C: parse_FtSkip, /* FtSbs */
- 0x0D: parse_FtNts, /* FtNts */
- 0x0E: parse_FtSkip, /* FtSbsFmla */
- 0x0F: parse_FtSkip, /* FtGboData */
- 0x10: parse_FtSkip, /* FtEdoData */
- 0x11: parse_FtSkip, /* FtRboData */
- 0x12: parse_FtSkip, /* FtCblsData */
- 0x13: parse_FtSkip, /* FtLbsData */
- 0x14: parse_FtSkip, /* FtCblsFmla */
- 0x15: parse_FtCmo
- };
- function parse_FtArray(blob, length) {
- var tgt = blob.l + length;
- var fts = [];
- while(blob.l < tgt) {
- var ft = blob.read_shift(2);
- blob.l-=2;
- try {
- fts.push(FtTab[ft](blob, tgt - blob.l));
- } catch(e) { blob.l = tgt; return fts; }
- }
- if(blob.l != tgt) blob.l = tgt; //throw new Error("bad Object Ft-sequence");
- return fts;
- }
-
- /* --- 2.4 Records --- */
-
- /* [MS-XLS] 2.4.21 */
- function parse_BOF(blob, length) {
- var o = {BIFFVer:0, dt:0};
- o.BIFFVer = blob.read_shift(2); length -= 2;
- if(length >= 2) { o.dt = blob.read_shift(2); blob.l -= 2; }
- switch(o.BIFFVer) {
- case 0x0600: /* BIFF8 */
- case 0x0500: /* BIFF5 */
- case 0x0400: /* BIFF4 */
- case 0x0300: /* BIFF3 */
- case 0x0200: /* BIFF2 */
- case 0x0002: case 0x0007: /* BIFF2 */
- break;
- default: if(length > 6) throw new Error("Unexpected BIFF Ver " + o.BIFFVer);
- }
-
- blob.read_shift(length);
- return o;
- }
- function write_BOF(wb, t, o) {
- var h = 0x0600, w = 16;
- switch(o.bookType) {
- case 'biff8': break;
- case 'biff5': h = 0x0500; w = 8; break;
- case 'biff4': h = 0x0004; w = 6; break;
- case 'biff3': h = 0x0003; w = 6; break;
- case 'biff2': h = 0x0002; w = 4; break;
- case 'xla': break;
- default: throw new Error("unsupported BIFF version");
- }
- var out = new_buf(w);
- out.write_shift(2, h);
- out.write_shift(2, t);
- if(w > 4) out.write_shift(2, 0x7262);
- if(w > 6) out.write_shift(2, 0x07CD);
- if(w > 8) {
- out.write_shift(2, 0xC009);
- out.write_shift(2, 0x0001);
- out.write_shift(2, 0x0706);
- out.write_shift(2, 0x0000);
- }
- return out;
- }
-
-
- /* [MS-XLS] 2.4.146 */
- function parse_InterfaceHdr(blob, length) {
- if(length === 0) return 0x04b0;
- if((blob.read_shift(2))!==0x04b0){/* empty */}
- return 0x04b0;
- }
-
-
- /* [MS-XLS] 2.4.349 */
- function parse_WriteAccess(blob, length, opts) {
- if(opts.enc) { blob.l += length; return ""; }
- var l = blob.l;
- // TODO: make sure XLUnicodeString doesnt overrun
- var UserName = parse_XLUnicodeString2(blob, 0, opts);
- blob.read_shift(length + l - blob.l);
- return UserName;
- }
- function write_WriteAccess(s, opts) {
- var b8 = !opts || opts.biff == 8;
- var o = new_buf(b8 ? 112 : 54);
- o.write_shift(opts.biff == 8 ? 2 : 1, 7);
- if(b8) o.write_shift(1, 0);
- o.write_shift(4, 0x33336853);
- o.write_shift(4, (0x00534A74 | (b8 ? 0 : 0x20000000)));
- while(o.l < o.length) o.write_shift(1, (b8 ? 0 : 32));
- return o;
- }
-
- /* [MS-XLS] 2.4.351 */
- function parse_WsBool(blob, length, opts) {
- var flags = opts && opts.biff == 8 || length == 2 ? blob.read_shift(2) : (blob.l += length, 0);
- return { fDialog: flags & 0x10 };
- }
-
- /* [MS-XLS] 2.4.28 */
- function parse_BoundSheet8(blob, length, opts) {
- var pos = blob.read_shift(4);
- var hidden = blob.read_shift(1) & 0x03;
- var dt = blob.read_shift(1);
- switch(dt) {
- case 0: dt = 'Worksheet'; break;
- case 1: dt = 'Macrosheet'; break;
- case 2: dt = 'Chartsheet'; break;
- case 6: dt = 'VBAModule'; break;
- }
- var name = parse_ShortXLUnicodeString(blob, 0, opts);
- if(name.length === 0) name = "Sheet1";
- return { pos:pos, hs:hidden, dt:dt, name:name };
- }
- function write_BoundSheet8(data, opts) {
- var w = (!opts || opts.biff >= 8 ? 2 : 1);
- var o = new_buf(8 + w * data.name.length);
- o.write_shift(4, data.pos);
- o.write_shift(1, data.hs || 0);
- o.write_shift(1, data.dt);
- o.write_shift(1, data.name.length);
- if(opts.biff >= 8) o.write_shift(1, 1);
- o.write_shift(w * data.name.length, data.name, opts.biff < 8 ? 'sbcs' : 'utf16le');
- var out = o.slice(0, o.l);
- out.l = o.l; return out;
- }
-
- /* [MS-XLS] 2.4.265 TODO */
- function parse_SST(blob, length) {
- var end = blob.l + length;
- var cnt = blob.read_shift(4);
- var ucnt = blob.read_shift(4);
- var strs = ([]);
- for(var i = 0; i != ucnt && blob.l < end; ++i) {
- strs.push(parse_XLUnicodeRichExtendedString(blob));
- }
- strs.Count = cnt; strs.Unique = ucnt;
- return strs;
- }
-
- /* [MS-XLS] 2.4.107 */
- function parse_ExtSST(blob, length) {
- var extsst = {};
- extsst.dsst = blob.read_shift(2);
- blob.l += length-2;
- return extsst;
- }
-
-
- /* [MS-XLS] 2.4.221 TODO: check BIFF2-4 */
- function parse_Row(blob) {
- var z = ({});
- z.r = blob.read_shift(2);
- z.c = blob.read_shift(2);
- z.cnt = blob.read_shift(2) - z.c;
- var miyRw = blob.read_shift(2);
- blob.l += 4; // reserved(2), unused(2)
- var flags = blob.read_shift(1); // various flags
- blob.l += 3; // reserved(8), ixfe(12), flags(4)
- if(flags & 0x07) z.level = flags & 0x07;
- // collapsed: flags & 0x10
- if(flags & 0x20) z.hidden = true;
- if(flags & 0x40) z.hpt = miyRw / 20;
- return z;
- }
-
-
- /* [MS-XLS] 2.4.125 */
- function parse_ForceFullCalculation(blob) {
- var header = parse_frtHeader(blob);
- if(header.type != 0x08A3) throw new Error("Invalid Future Record " + header.type);
- var fullcalc = blob.read_shift(4);
- return fullcalc !== 0x0;
- }
-
-
-
-
-
- /* [MS-XLS] 2.4.215 rt */
- function parse_RecalcId(blob) {
- blob.read_shift(2);
- return blob.read_shift(4);
- }
-
- /* [MS-XLS] 2.4.87 */
- function parse_DefaultRowHeight(blob, length, opts) {
- var f = 0;
- if(!(opts && opts.biff == 2)) {
- f = blob.read_shift(2);
- }
- var miyRw = blob.read_shift(2);
- if((opts && opts.biff == 2)) {
- f = 1 - (miyRw >> 15); miyRw &= 0x7fff;
- }
- var fl = {Unsynced:f&1,DyZero:(f&2)>>1,ExAsc:(f&4)>>2,ExDsc:(f&8)>>3};
- return [fl, miyRw];
- }
-
- /* [MS-XLS] 2.4.345 TODO */
- function parse_Window1(blob) {
- var xWn = blob.read_shift(2), yWn = blob.read_shift(2), dxWn = blob.read_shift(2), dyWn = blob.read_shift(2);
- var flags = blob.read_shift(2), iTabCur = blob.read_shift(2), iTabFirst = blob.read_shift(2);
- var ctabSel = blob.read_shift(2), wTabRatio = blob.read_shift(2);
- return { Pos: [xWn, yWn], Dim: [dxWn, dyWn], Flags: flags, CurTab: iTabCur,
- FirstTab: iTabFirst, Selected: ctabSel, TabRatio: wTabRatio };
- }
- function write_Window1() {
- var o = new_buf(18);
- o.write_shift(2, 0);
- o.write_shift(2, 0);
- o.write_shift(2, 0x7260);
- o.write_shift(2, 0x44c0);
- o.write_shift(2, 0x38);
- o.write_shift(2, 0);
- o.write_shift(2, 0);
- o.write_shift(2, 1);
- o.write_shift(2, 0x01f4);
- return o;
- }
- /* [MS-XLS] 2.4.346 TODO */
- function parse_Window2(blob, length, opts) {
- if(opts && opts.biff >= 2 && opts.biff < 8) return {};
- var f = blob.read_shift(2);
- return { RTL: f & 0x40 };
- }
- function write_Window2(view) {
- var o = new_buf(18), f = 0x6b6;
- if(view && view.RTL) f |= 0x40;
- o.write_shift(2, f);
- o.write_shift(4, 0);
- o.write_shift(4, 64);
- o.write_shift(4, 0);
- o.write_shift(4, 0);
- return o;
- }
-
- /* [MS-XLS] 2.4.189 TODO */
- function parse_Pane(/*blob, length, opts*/) {
- }
-
- /* [MS-XLS] 2.4.122 TODO */
- function parse_Font(blob, length, opts) {
- var o = {
- dyHeight: blob.read_shift(2),
- fl: blob.read_shift(2)
- };
- switch((opts && opts.biff) || 8) {
- case 2: break;
- case 3: case 4: blob.l += 2; break;
- default: blob.l += 10; break;
- }
- o.name = parse_ShortXLUnicodeString(blob, 0, opts);
- return o;
- }
- function write_Font(data, opts) {
- var name = data.name || "Arial";
- var b5 = (opts && (opts.biff == 5)), w = (b5 ? (15 + name.length) : (16 + 2 * name.length));
- var o = new_buf(w);
- o.write_shift(2, (data.sz || 12) * 20);
- o.write_shift(4, 0);
- o.write_shift(2, 400);
- o.write_shift(4, 0);
- o.write_shift(2, 0);
- o.write_shift(1, name.length);
- if(!b5) o.write_shift(1, 1);
- o.write_shift((b5 ? 1 : 2) * name.length, name, (b5 ? "sbcs" : "utf16le"));
- return o;
- }
-
- /* [MS-XLS] 2.4.149 */
- function parse_LabelSst(blob) {
- var cell = parse_XLSCell(blob);
- cell.isst = blob.read_shift(4);
- return cell;
- }
-
- /* [MS-XLS] 2.4.148 */
- function parse_Label(blob, length, opts) {
- var target = blob.l + length;
- var cell = parse_XLSCell(blob, 6);
- if(opts.biff == 2) blob.l++;
- var str = parse_XLUnicodeString(blob, target - blob.l, opts);
- cell.val = str;
- return cell;
- }
- function write_Label(R, C, v, os, opts) {
- var b8 = !opts || opts.biff == 8;
- var o = new_buf(6 + 2 + (+b8) + (1 + b8) * v.length);
- write_XLSCell(R, C, os, o);
- o.write_shift(2, v.length);
- if(b8) o.write_shift(1, 1);
- o.write_shift((1 + b8) * v.length, v, b8 ? 'utf16le' : 'sbcs');
- return o;
- }
-
-
- /* [MS-XLS] 2.4.126 Number Formats */
- function parse_Format(blob, length, opts) {
- var numFmtId = blob.read_shift(2);
- var fmtstr = parse_XLUnicodeString2(blob, 0, opts);
- return [numFmtId, fmtstr];
- }
- function write_Format(i, f, opts, o) {
- var b5 = (opts && (opts.biff == 5));
- if(!o) o = new_buf(b5 ? (3 + f.length) : (5 + 2 * f.length));
- o.write_shift(2, i);
- o.write_shift((b5 ? 1 : 2), f.length);
- if(!b5) o.write_shift(1, 1);
- o.write_shift((b5 ? 1 : 2) * f.length, f, (b5 ? 'sbcs' : 'utf16le'));
- var out = (o.length > o.l) ? o.slice(0, o.l) : o;
- if(out.l == null) out.l = out.length;
- return out;
- }
- var parse_BIFF2Format = parse_XLUnicodeString2;
-
- /* [MS-XLS] 2.4.90 */
- function parse_Dimensions(blob, length, opts) {
- var end = blob.l + length;
- var w = opts.biff == 8 || !opts.biff ? 4 : 2;
- var r = blob.read_shift(w), R = blob.read_shift(w);
- var c = blob.read_shift(2), C = blob.read_shift(2);
- blob.l = end;
- return {s: {r:r, c:c}, e: {r:R, c:C}};
- }
- function write_Dimensions(range, opts) {
- var w = opts.biff == 8 || !opts.biff ? 4 : 2;
- var o = new_buf(2*w + 6);
- o.write_shift(w, range.s.r);
- o.write_shift(w, range.e.r + 1);
- o.write_shift(2, range.s.c);
- o.write_shift(2, range.e.c + 1);
- o.write_shift(2, 0);
- return o;
- }
-
- /* [MS-XLS] 2.4.220 */
- function parse_RK(blob) {
- var rw = blob.read_shift(2), col = blob.read_shift(2);
- var rkrec = parse_RkRec(blob);
- return {r:rw, c:col, ixfe:rkrec[0], rknum:rkrec[1]};
- }
-
- /* [MS-XLS] 2.4.175 */
- function parse_MulRk(blob, length) {
- var target = blob.l + length - 2;
- var rw = blob.read_shift(2), col = blob.read_shift(2);
- var rkrecs = [];
- while(blob.l < target) rkrecs.push(parse_RkRec(blob));
- if(blob.l !== target) throw new Error("MulRK read error");
- var lastcol = blob.read_shift(2);
- if(rkrecs.length != lastcol - col + 1) throw new Error("MulRK length mismatch");
- return {r:rw, c:col, C:lastcol, rkrec:rkrecs};
- }
- /* [MS-XLS] 2.4.174 */
- function parse_MulBlank(blob, length) {
- var target = blob.l + length - 2;
- var rw = blob.read_shift(2), col = blob.read_shift(2);
- var ixfes = [];
- while(blob.l < target) ixfes.push(blob.read_shift(2));
- if(blob.l !== target) throw new Error("MulBlank read error");
- var lastcol = blob.read_shift(2);
- if(ixfes.length != lastcol - col + 1) throw new Error("MulBlank length mismatch");
- return {r:rw, c:col, C:lastcol, ixfe:ixfes};
- }
-
- /* [MS-XLS] 2.5.20 2.5.249 TODO: interpret values here */
- function parse_CellStyleXF(blob, length, style, opts) {
- var o = {};
- var a = blob.read_shift(4), b = blob.read_shift(4);
- var c = blob.read_shift(4), d = blob.read_shift(2);
- o.patternType = XLSFillPattern[c >> 26];
-
- if(!opts.cellStyles) return o;
- o.alc = a & 0x07;
- o.fWrap = (a >> 3) & 0x01;
- o.alcV = (a >> 4) & 0x07;
- o.fJustLast = (a >> 7) & 0x01;
- o.trot = (a >> 8) & 0xFF;
- o.cIndent = (a >> 16) & 0x0F;
- o.fShrinkToFit = (a >> 20) & 0x01;
- o.iReadOrder = (a >> 22) & 0x02;
- o.fAtrNum = (a >> 26) & 0x01;
- o.fAtrFnt = (a >> 27) & 0x01;
- o.fAtrAlc = (a >> 28) & 0x01;
- o.fAtrBdr = (a >> 29) & 0x01;
- o.fAtrPat = (a >> 30) & 0x01;
- o.fAtrProt = (a >> 31) & 0x01;
-
- o.dgLeft = b & 0x0F;
- o.dgRight = (b >> 4) & 0x0F;
- o.dgTop = (b >> 8) & 0x0F;
- o.dgBottom = (b >> 12) & 0x0F;
- o.icvLeft = (b >> 16) & 0x7F;
- o.icvRight = (b >> 23) & 0x7F;
- o.grbitDiag = (b >> 30) & 0x03;
-
- o.icvTop = c & 0x7F;
- o.icvBottom = (c >> 7) & 0x7F;
- o.icvDiag = (c >> 14) & 0x7F;
- o.dgDiag = (c >> 21) & 0x0F;
-
- o.icvFore = d & 0x7F;
- o.icvBack = (d >> 7) & 0x7F;
- o.fsxButton = (d >> 14) & 0x01;
- return o;
- }
- //function parse_CellXF(blob, length, opts) {return parse_CellStyleXF(blob,length,0, opts);}
- //function parse_StyleXF(blob, length, opts) {return parse_CellStyleXF(blob,length,1, opts);}
-
- /* [MS-XLS] 2.4.353 TODO: actually do this right */
- function parse_XF(blob, length, opts) {
- var o = {};
- o.ifnt = blob.read_shift(2); o.numFmtId = blob.read_shift(2); o.flags = blob.read_shift(2);
- o.fStyle = (o.flags >> 2) & 0x01;
- length -= 6;
- o.data = parse_CellStyleXF(blob, length, o.fStyle, opts);
- return o;
- }
- function write_XF(data, ixfeP, opts, o) {
- var b5 = (opts && (opts.biff == 5));
- if(!o) o = new_buf(b5 ? 16 : 20);
- o.write_shift(2, 0);
- if(data.style) {
- o.write_shift(2, (data.numFmtId||0));
- o.write_shift(2, 0xFFF4);
- } else {
- o.write_shift(2, (data.numFmtId||0));
- o.write_shift(2, (ixfeP<<4));
- }
- o.write_shift(4, 0);
- o.write_shift(4, 0);
- if(!b5) o.write_shift(4, 0);
- o.write_shift(2, 0);
- return o;
- }
-
- /* [MS-XLS] 2.4.134 */
- function parse_Guts(blob) {
- blob.l += 4;
- var out = [blob.read_shift(2), blob.read_shift(2)];
- if(out[0] !== 0) out[0]--;
- if(out[1] !== 0) out[1]--;
- if(out[0] > 7 || out[1] > 7) throw new Error("Bad Gutters: " + out.join("|"));
- return out;
- }
- function write_Guts(guts) {
- var o = new_buf(8);
- o.write_shift(4, 0);
- o.write_shift(2, guts[0] ? guts[0] + 1 : 0);
- o.write_shift(2, guts[1] ? guts[1] + 1 : 0);
- return o;
- }
-
- /* [MS-XLS] 2.4.24 */
- function parse_BoolErr(blob, length, opts) {
- var cell = parse_XLSCell(blob, 6);
- if(opts.biff == 2) ++blob.l;
- var val = parse_Bes(blob, 2);
- cell.val = val;
- cell.t = (val === true || val === false) ? 'b' : 'e';
- return cell;
- }
- function write_BoolErr(R, C, v, os, opts, t) {
- var o = new_buf(8);
- write_XLSCell(R, C, os, o);
- write_Bes(v, t, o);
- return o;
- }
-
- /* [MS-XLS] 2.4.180 Number */
- function parse_Number(blob) {
- var cell = parse_XLSCell(blob, 6);
- var xnum = parse_Xnum(blob, 8);
- cell.val = xnum;
- return cell;
- }
- function write_Number(R, C, v, os) {
- var o = new_buf(14);
- write_XLSCell(R, C, os, o);
- write_Xnum(v, o);
- return o;
- }
-
- var parse_XLHeaderFooter = parse_OptXLUnicodeString; // TODO: parse 2.4.136
-
- /* [MS-XLS] 2.4.271 */
- function parse_SupBook(blob, length, opts) {
- var end = blob.l + length;
- var ctab = blob.read_shift(2);
- var cch = blob.read_shift(2);
- opts.sbcch = cch;
- if(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];
- if(cch < 0x01 || cch >0xff) throw new Error("Unexpected SupBook type: "+cch);
- var virtPath = parse_XLUnicodeStringNoCch(blob, cch);
- /* TODO: 2.5.277 Virtual Path */
- var rgst = [];
- while(end > blob.l) rgst.push(parse_XLUnicodeString(blob));
- return [cch, ctab, virtPath, rgst];
- }
-
- /* [MS-XLS] 2.4.105 TODO */
- function parse_ExternName(blob, length, opts) {
- var flags = blob.read_shift(2);
- var body;
- var o = ({
- fBuiltIn: flags & 0x01,
- fWantAdvise: (flags >>> 1) & 0x01,
- fWantPict: (flags >>> 2) & 0x01,
- fOle: (flags >>> 3) & 0x01,
- fOleLink: (flags >>> 4) & 0x01,
- cf: (flags >>> 5) & 0x3FF,
- fIcon: flags >>> 15 & 0x01
- });
- if(opts.sbcch === 0x3A01) body = parse_AddinUdf(blob, length-2, opts);
- //else throw new Error("unsupported SupBook cch: " + opts.sbcch);
- o.body = body || blob.read_shift(length-2);
- if(typeof body === "string") o.Name = body;
- return o;
- }
-
- /* [MS-XLS] 2.4.150 TODO */
- var XLSLblBuiltIn = [
- "_xlnm.Consolidate_Area",
- "_xlnm.Auto_Open",
- "_xlnm.Auto_Close",
- "_xlnm.Extract",
- "_xlnm.Database",
- "_xlnm.Criteria",
- "_xlnm.Print_Area",
- "_xlnm.Print_Titles",
- "_xlnm.Recorder",
- "_xlnm.Data_Form",
- "_xlnm.Auto_Activate",
- "_xlnm.Auto_Deactivate",
- "_xlnm.Sheet_Title",
- "_xlnm._FilterDatabase"
- ];
- function parse_Lbl(blob, length, opts) {
- var target = blob.l + length;
- var flags = blob.read_shift(2);
- var chKey = blob.read_shift(1);
- var cch = blob.read_shift(1);
- var cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
- var itab = 0;
- if(!opts || opts.biff >= 5) {
- if(opts.biff != 5) blob.l += 2;
- itab = blob.read_shift(2);
- if(opts.biff == 5) blob.l += 2;
- blob.l += 4;
- }
- var name = parse_XLUnicodeStringNoCch(blob, cch, opts);
- if(flags & 0x20) name = XLSLblBuiltIn[name.charCodeAt(0)];
- var npflen = target - blob.l; if(opts && opts.biff == 2) --npflen;
- var rgce = target == blob.l || cce === 0 ? [] : parse_NameParsedFormula(blob, npflen, opts, cce);
- return {
- chKey: chKey,
- Name: name,
- itab: itab,
- rgce: rgce
- };
- }
-
- /* [MS-XLS] 2.4.106 TODO: verify filename encoding */
- function parse_ExternSheet(blob, length, opts) {
- if(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);
- var o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);
- while(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));
- // [iSupBook, itabFirst, itabLast];
- if(blob.l != target) throw new Error("Bad ExternSheet: " + blob.l + " != " + target);
- return o;
- }
- function parse_BIFF5ExternSheet(blob, length, opts) {
- if(blob[blob.l + 1] == 0x03) blob[blob.l]++;
- var o = parse_ShortXLUnicodeString(blob, length, opts);
- return o.charCodeAt(0) == 0x03 ? o.slice(1) : o;
- }
-
- /* [MS-XLS] 2.4.176 TODO: check older biff */
- function parse_NameCmt(blob, length, opts) {
- if(opts.biff < 8) { blob.l += length; return; }
- var cchName = blob.read_shift(2);
- var cchComment = blob.read_shift(2);
- var name = parse_XLUnicodeStringNoCch(blob, cchName, opts);
- var comment = parse_XLUnicodeStringNoCch(blob, cchComment, opts);
- return [name, comment];
- }
-
- /* [MS-XLS] 2.4.260 */
- function parse_ShrFmla(blob, length, opts) {
- var ref = parse_RefU(blob, 6);
- blob.l++;
- var cUse = blob.read_shift(1);
- length -= 8;
- return [parse_SharedParsedFormula(blob, length, opts), cUse, ref];
- }
-
- /* [MS-XLS] 2.4.4 TODO */
- function parse_Array(blob, length, opts) {
- var ref = parse_Ref(blob, 6);
- /* TODO: fAlwaysCalc */
- switch(opts.biff) {
- case 2: blob.l ++; length -= 7; break;
- case 3: case 4: blob.l += 2; length -= 8; break;
- default: blob.l += 6; length -= 12;
- }
- return [ref, parse_ArrayParsedFormula(blob, length, opts, ref)];
- }
-
- /* [MS-XLS] 2.4.173 */
- function parse_MTRSettings(blob) {
- var fMTREnabled = blob.read_shift(4) !== 0x00;
- var fUserSetThreadCount = blob.read_shift(4) !== 0x00;
- var cUserThreadCount = blob.read_shift(4);
- return [fMTREnabled, fUserSetThreadCount, cUserThreadCount];
- }
-
- /* [MS-XLS] 2.5.186 TODO: BIFF5 */
- function parse_NoteSh(blob, length, opts) {
- if(opts.biff < 8) return;
- var row = blob.read_shift(2), col = blob.read_shift(2);
- var flags = blob.read_shift(2), idObj = blob.read_shift(2);
- var stAuthor = parse_XLUnicodeString2(blob, 0, opts);
- if(opts.biff < 8) blob.read_shift(1);
- return [{r:row,c:col}, stAuthor, idObj, flags];
- }
-
- /* [MS-XLS] 2.4.179 */
- function parse_Note(blob, length, opts) {
- /* TODO: Support revisions */
- return parse_NoteSh(blob, length, opts);
- }
-
- /* [MS-XLS] 2.4.168 */
- function parse_MergeCells(blob, length) {
- var merges = [];
- var cmcs = blob.read_shift(2);
- while (cmcs--) merges.push(parse_Ref8U(blob,length));
- return merges;
- }
- function write_MergeCells(merges) {
- var o = new_buf(2 + merges.length * 8);
- o.write_shift(2, merges.length);
- for(var i = 0; i < merges.length; ++i) write_Ref8U(merges[i], o);
- return o;
- }
-
- /* [MS-XLS] 2.4.181 TODO: parse all the things! */
- function parse_Obj(blob, length, opts) {
- if(opts && opts.biff < 8) return parse_BIFF5Obj(blob, length, opts);
- var cmo = parse_FtCmo(blob, 22); // id, ot, flags
- var fts = parse_FtArray(blob, length-22, cmo[1]);
- return { cmo: cmo, ft:fts };
- }
- /* from older spec */
- var parse_BIFF5OT = [];
- parse_BIFF5OT[0x08] = function(blob, length) {
- var tgt = blob.l + length;
- blob.l += 10; // todo
- var cf = blob.read_shift(2);
- blob.l += 4;
- blob.l += 2; //var cbPictFmla = blob.read_shift(2);
- blob.l += 2;
- blob.l += 2; //var grbit = blob.read_shift(2);
- blob.l += 4;
- var cchName = blob.read_shift(1);
- blob.l += cchName; // TODO: stName
- blob.l = tgt; // TODO: fmla
- return { fmt:cf };
- };
-
- function parse_BIFF5Obj(blob, length, opts) {
- blob.l += 4; //var cnt = blob.read_shift(4);
- var ot = blob.read_shift(2);
- var id = blob.read_shift(2);
- var grbit = blob.read_shift(2);
- blob.l += 2; //var colL = blob.read_shift(2);
- blob.l += 2; //var dxL = blob.read_shift(2);
- blob.l += 2; //var rwT = blob.read_shift(2);
- blob.l += 2; //var dyT = blob.read_shift(2);
- blob.l += 2; //var colR = blob.read_shift(2);
- blob.l += 2; //var dxR = blob.read_shift(2);
- blob.l += 2; //var rwB = blob.read_shift(2);
- blob.l += 2; //var dyB = blob.read_shift(2);
- blob.l += 2; //var cbMacro = blob.read_shift(2);
- blob.l += 6;
- length -= 36;
- var fts = [];
- fts.push((parse_BIFF5OT[ot]||parsenoop)(blob, length, opts));
- return { cmo: [id, ot, grbit], ft:fts };
- }
-
- /* [MS-XLS] 2.4.329 TODO: parse properly */
- function parse_TxO(blob, length, opts) {
- var s = blob.l;
- var texts = "";
- try {
- blob.l += 4;
- var ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];
- var controlInfo; // eslint-disable-line no-unused-vars
- if([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6;
- else controlInfo = parse_ControlInfo(blob, 6, opts);
- var cchText = blob.read_shift(2);
- /*var cbRuns = */blob.read_shift(2);
- /*var ifntEmpty = */parseuint16(blob, 2);
- var len = blob.read_shift(2);
- blob.l += len;
- //var fmla = parse_ObjFmla(blob, s + length - blob.l);
-
- for(var i = 1; i < blob.lens.length-1; ++i) {
- if(blob.l-s != blob.lens[i]) throw new Error("TxO: bad continue record");
- var hdr = blob[blob.l];
- var t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1);
- texts += t;
- if(texts.length >= (hdr ? cchText : 2*cchText)) break;
- }
- if(texts.length !== cchText && texts.length !== cchText*2) {
- throw new Error("cchText: " + cchText + " != " + texts.length);
- }
-
- blob.l = s + length;
- /* [MS-XLS] 2.5.272 TxORuns */
- // var rgTxoRuns = [];
- // for(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;
- // var cchText2 = blob.read_shift(2);
- // if(cchText2 !== cchText) throw new Error("TxOLastRun mismatch: " + cchText2 + " " + cchText);
- // blob.l += 6;
- // if(s + length != blob.l) throw new Error("TxO " + (s + length) + ", at " + blob.l);
- return { t: texts };
- } catch(e) { blob.l = s + length; return { t: texts }; }
- }
-
- /* [MS-XLS] 2.4.140 */
- function parse_HLink(blob, length) {
- var ref = parse_Ref8U(blob, 8);
- blob.l += 16; /* CLSID */
- var hlink = parse_Hyperlink(blob, length-24);
- return [ref, hlink];
- }
- function write_HLink(hl) {
- var O = new_buf(24);
- var ref = decode_cell(hl[0]);
- O.write_shift(2, ref.r); O.write_shift(2, ref.r);
- O.write_shift(2, ref.c); O.write_shift(2, ref.c);
- var clsid = "d0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" ");
- for(var i = 0; i < 16; ++i) O.write_shift(1, parseInt(clsid[i], 16));
- return bconcat([O, write_Hyperlink(hl[1])]);
- }
-
-
- /* [MS-XLS] 2.4.141 */
- function parse_HLinkTooltip(blob, length) {
- blob.read_shift(2);
- var ref = parse_Ref8U(blob, 8);
- var wzTooltip = blob.read_shift((length-10)/2, 'dbcs-cont');
- wzTooltip = wzTooltip.replace(chr0,"");
- return [ref, wzTooltip];
- }
- function write_HLinkTooltip(hl) {
- var TT = hl[1].Tooltip;
- var O = new_buf(10 + 2 * (TT.length + 1));
- O.write_shift(2, 0x0800);
- var ref = decode_cell(hl[0]);
- O.write_shift(2, ref.r); O.write_shift(2, ref.r);
- O.write_shift(2, ref.c); O.write_shift(2, ref.c);
- for(var i = 0; i < TT.length; ++i) O.write_shift(2, TT.charCodeAt(i));
- O.write_shift(2, 0);
- return O;
- }
-
- /* [MS-XLS] 2.4.63 */
- function parse_Country(blob) {
- var o = [0,0], d;
- d = blob.read_shift(2); o[0] = CountryEnum[d] || d;
- d = blob.read_shift(2); o[1] = CountryEnum[d] || d;
- return o;
- }
- function write_Country(o) {
- if(!o) o = new_buf(4);
- o.write_shift(2, 0x01);
- o.write_shift(2, 0x01);
- return o;
- }
-
- /* [MS-XLS] 2.4.50 ClrtClient */
- function parse_ClrtClient(blob) {
- var ccv = blob.read_shift(2);
- var o = [];
- while(ccv-->0) o.push(parse_LongRGB(blob, 8));
- return o;
- }
-
- /* [MS-XLS] 2.4.188 */
- function parse_Palette(blob) {
- var ccv = blob.read_shift(2);
- var o = [];
- while(ccv-->0) o.push(parse_LongRGB(blob, 8));
- return o;
- }
-
- /* [MS-XLS] 2.4.354 */
- function parse_XFCRC(blob) {
- blob.l += 2;
- var o = {cxfs:0, crc:0};
- o.cxfs = blob.read_shift(2);
- o.crc = blob.read_shift(4);
- return o;
- }
-
- /* [MS-XLS] 2.4.53 TODO: parse flags */
- /* [MS-XLSB] 2.4.323 TODO: parse flags */
- function parse_ColInfo(blob, length, opts) {
- if(!opts.cellStyles) return parsenoop(blob, length);
- var w = opts && opts.biff >= 12 ? 4 : 2;
- var colFirst = blob.read_shift(w);
- var colLast = blob.read_shift(w);
- var coldx = blob.read_shift(w);
- var ixfe = blob.read_shift(w);
- var flags = blob.read_shift(2);
- if(w == 2) blob.l += 2;
- var o = ({s:colFirst, e:colLast, w:coldx, ixfe:ixfe, flags:flags});
- if(opts.biff >= 5 || !opts.biff) o.level = (flags >> 8) & 0x7;
- return o;
- }
-
- /* [MS-XLS] 2.4.257 */
- function parse_Setup(blob, length) {
- var o = {};
- if(length < 32) return o;
- blob.l += 16;
- o.header = parse_Xnum(blob, 8);
- o.footer = parse_Xnum(blob, 8);
- blob.l += 2;
- return o;
- }
-
- /* [MS-XLS] 2.4.261 */
- function parse_ShtProps(blob, length, opts) {
- var def = {area:false};
- if(opts.biff != 5) { blob.l += length; return def; }
- var d = blob.read_shift(1); blob.l += 3;
- if((d & 0x10)) def.area = true;
- return def;
- }
-
- /* [MS-XLS] 2.4.241 */
- function write_RRTabId(n) {
- var out = new_buf(2 * n);
- for(var i = 0; i < n; ++i) out.write_shift(2, i+1);
- return out;
- }
-
- var parse_Blank = parse_XLSCell; /* [MS-XLS] 2.4.20 Just the cell */
- var parse_Scl = parseuint16a; /* [MS-XLS] 2.4.247 num, den */
- var parse_String = parse_XLUnicodeString; /* [MS-XLS] 2.4.268 */
-
- /* --- Specific to versions before BIFF8 --- */
- function parse_ImData(blob) {
- var cf = blob.read_shift(2);
- var env = blob.read_shift(2);
- var lcb = blob.read_shift(4);
- var o = {fmt:cf, env:env, len:lcb, data:blob.slice(blob.l,blob.l+lcb)};
- blob.l += lcb;
- return o;
- }
-
- /* BIFF2_??? where ??? is the name from [XLS] */
- function parse_BIFF2STR(blob, length, opts) {
- var cell = parse_XLSCell(blob, 6);
- ++blob.l;
- var str = parse_XLUnicodeString2(blob, length-7, opts);
- cell.t = 'str';
- cell.val = str;
- return cell;
- }
-
- function parse_BIFF2NUM(blob) {
- var cell = parse_XLSCell(blob, 6);
- ++blob.l;
- var num = parse_Xnum(blob, 8);
- cell.t = 'n';
- cell.val = num;
- return cell;
- }
- function write_BIFF2NUM(r, c, val) {
- var out = new_buf(15);
- write_BIFF2Cell(out, r, c);
- out.write_shift(8, val, 'f');
- return out;
- }
-
- function parse_BIFF2INT(blob) {
- var cell = parse_XLSCell(blob, 6);
- ++blob.l;
- var num = blob.read_shift(2);
- cell.t = 'n';
- cell.val = num;
- return cell;
- }
- function write_BIFF2INT(r, c, val) {
- var out = new_buf(9);
- write_BIFF2Cell(out, r, c);
- out.write_shift(2, val);
- return out;
- }
-
- function parse_BIFF2STRING(blob) {
- var cch = blob.read_shift(1);
- if(cch === 0) { blob.l++; return ""; }
- return blob.read_shift(cch, 'sbcs-cont');
- }
-
- /* TODO: convert to BIFF8 font struct */
- function parse_BIFF2FONTXTRA(blob, length) {
- blob.l += 6; // unknown
- blob.l += 2; // font weight "bls"
- blob.l += 1; // charset
- blob.l += 3; // unknown
- blob.l += 1; // font family
- blob.l += length - 13;
- }
-
- /* TODO: parse rich text runs */
- function parse_RString(blob, length, opts) {
- var end = blob.l + length;
- var cell = parse_XLSCell(blob, 6);
- var cch = blob.read_shift(2);
- var str = parse_XLUnicodeStringNoCch(blob, cch, opts);
- blob.l = end;
- cell.t = 'str';
- cell.val = str;
- return cell;
- }
- /* from js-harb (C) 2014-present SheetJS */
- var DBF = (function() {
- var dbf_codepage_map = {
- /* Code Pages Supported by Visual FoxPro */
- 0x01: 437, 0x02: 850,
- 0x03: 1252, 0x04: 10000,
- 0x64: 852, 0x65: 866,
- 0x66: 865, 0x67: 861,
- 0x68: 895, 0x69: 620,
- 0x6A: 737, 0x6B: 857,
- 0x78: 950, 0x79: 949,
- 0x7A: 936, 0x7B: 932,
- 0x7C: 874, 0x7D: 1255,
- 0x7E: 1256, 0x96: 10007,
- 0x97: 10029, 0x98: 10006,
- 0xC8: 1250, 0xC9: 1251,
- 0xCA: 1254, 0xCB: 1253,
-
- /* shapefile DBF extension */
- 0x00: 20127, 0x08: 865,
- 0x09: 437, 0x0A: 850,
- 0x0B: 437, 0x0D: 437,
- 0x0E: 850, 0x0F: 437,
- 0x10: 850, 0x11: 437,
- 0x12: 850, 0x13: 932,
- 0x14: 850, 0x15: 437,
- 0x16: 850, 0x17: 865,
- 0x18: 437, 0x19: 437,
- 0x1A: 850, 0x1B: 437,
- 0x1C: 863, 0x1D: 850,
- 0x1F: 852, 0x22: 852,
- 0x23: 852, 0x24: 860,
- 0x25: 850, 0x26: 866,
- 0x37: 850, 0x40: 852,
- 0x4D: 936, 0x4E: 949,
- 0x4F: 950, 0x50: 874,
- 0x57: 1252, 0x58: 1252,
- 0x59: 1252,
-
- 0xFF: 16969
- };
- var dbf_reverse_map = evert({
- 0x01: 437, 0x02: 850,
- 0x03: 1252, 0x04: 10000,
- 0x64: 852, 0x65: 866,
- 0x66: 865, 0x67: 861,
- 0x68: 895, 0x69: 620,
- 0x6A: 737, 0x6B: 857,
- 0x78: 950, 0x79: 949,
- 0x7A: 936, 0x7B: 932,
- 0x7C: 874, 0x7D: 1255,
- 0x7E: 1256, 0x96: 10007,
- 0x97: 10029, 0x98: 10006,
- 0xC8: 1250, 0xC9: 1251,
- 0xCA: 1254, 0xCB: 1253,
- 0x00: 20127
- });
- /* TODO: find an actual specification */
- function dbf_to_aoa(buf, opts) {
- var out = [];
- /* TODO: browser based */
- var d = (new_raw_buf(1));
- switch(opts.type) {
- case 'base64': d = s2a(Base64.decode(buf)); break;
- case 'binary': d = s2a(buf); break;
- case 'buffer':
- case 'array': d = buf; break;
- }
- prep_blob(d, 0);
- /* header */
- var ft = d.read_shift(1);
- var memo = false;
- var vfp = false, l7 = false;
- switch(ft) {
- case 0x02: case 0x03: break;
- case 0x30: vfp = true; memo = true; break;
- case 0x31: vfp = true; break;
- case 0x83: memo = true; break;
- case 0x8B: memo = true; break;
- case 0x8C: memo = true; l7 = true; break;
- case 0xF5: memo = true; break;
- default: throw new Error("DBF Unsupported Version: " + ft.toString(16));
- }
- var /*filedate = new Date(),*/ nrow = 0, fpos = 0;
- if(ft == 0x02) nrow = d.read_shift(2);
- /*filedate = new Date(d.read_shift(1) + 1900, d.read_shift(1) - 1, d.read_shift(1));*/d.l += 3;
- if(ft != 0x02) nrow = d.read_shift(4);
- if(ft != 0x02) fpos = d.read_shift(2);
- var rlen = d.read_shift(2);
-
- var /*flags = 0,*/ current_cp = 1252;
- if(ft != 0x02) {
- d.l+=16;
- /*flags = */d.read_shift(1);
- //if(memo && ((flags & 0x02) === 0)) throw new Error("DBF Flags " + flags.toString(16) + " ft " + ft.toString(16));
-
- /* codepage present in FoxPro */
- if(d[d.l] !== 0) current_cp = dbf_codepage_map[d[d.l]];
- d.l+=1;
-
- d.l+=2;
- }
- if(l7) d.l += 36;
- var fields = [], field = ({});
- var hend = fpos - 10 - (vfp ? 264 : 0), ww = l7 ? 32 : 11;
- while(ft == 0x02 ? d.l < d.length && d[d.l] != 0x0d: d.l < hend) {
- field = ({});
- field.name = cptable.utils.decode(current_cp, d.slice(d.l, d.l+ww)).replace(/[\u0000\r\n].*$/g,"");
- d.l += ww;
- field.type = String.fromCharCode(d.read_shift(1));
- if(ft != 0x02 && !l7) field.offset = d.read_shift(4);
- field.len = d.read_shift(1);
- if(ft == 0x02) field.offset = d.read_shift(2);
- field.dec = d.read_shift(1);
- if(field.name.length) fields.push(field);
- if(ft != 0x02) d.l += l7 ? 13 : 14;
- switch(field.type) {
- case 'B': // VFP Double
- if((!vfp || field.len != 8) && opts.WTF) console.log('Skipping ' + field.name + ':' + field.type);
- break;
- case 'G': // General
- case 'P': // Picture
- if(opts.WTF) console.log('Skipping ' + field.name + ':' + field.type);
- break;
- case 'C': // character
- case 'D': // date
- case 'F': // floating point
- case 'I': // long
- case 'L': // boolean
- case 'M': // memo
- case 'N': // number
- case 'O': // double
- case 'T': // datetime
- case 'Y': // currency
- case '0': // VFP _NullFlags
- case '@': // timestamp
- case '+': // autoincrement
- break;
- default: throw new Error('Unknown Field Type: ' + field.type);
- }
- }
- if(d[d.l] !== 0x0D) d.l = fpos-1;
- else if(ft == 0x02) d.l = 0x209;
- if(ft != 0x02) {
- if(d.read_shift(1) !== 0x0D) throw new Error("DBF Terminator not found " + d.l + " " + d[d.l]);
- d.l = fpos;
- }
- /* data */
- var R = 0, C = 0;
- out[0] = [];
- for(C = 0; C != fields.length; ++C) out[0][C] = fields[C].name;
- while(nrow-- > 0) {
- if(d[d.l] === 0x2A) { d.l+=rlen; continue; }
- ++d.l;
- out[++R] = []; C = 0;
- for(C = 0; C != fields.length; ++C) {
- var dd = d.slice(d.l, d.l+fields[C].len); d.l+=fields[C].len;
- prep_blob(dd, 0);
- var s = cptable.utils.decode(current_cp, dd);
- switch(fields[C].type) {
- case 'C':
- out[R][C] = cptable.utils.decode(current_cp, dd);
- out[R][C] = out[R][C].trim();
- break;
- case 'D':
- if(s.length === 8) out[R][C] = new Date(+s.slice(0,4), +s.slice(4,6)-1, +s.slice(6,8));
- else out[R][C] = s;
- break;
- case 'F': out[R][C] = parseFloat(s.trim()); break;
- case '+': case 'I': out[R][C] = l7 ? dd.read_shift(-4, 'i') ^ 0x80000000 : dd.read_shift(4, 'i'); break;
- case 'L': switch(s.toUpperCase()) {
- case 'Y': case 'T': out[R][C] = true; break;
- case 'N': case 'F': out[R][C] = false; break;
- case ' ': case '?': out[R][C] = false; break; /* NOTE: technically uninitialized */
- default: throw new Error("DBF Unrecognized L:|" + s + "|");
- } break;
- case 'M': /* TODO: handle memo files */
- if(!memo) throw new Error("DBF Unexpected MEMO for type " + ft.toString(16));
- out[R][C] = "##MEMO##" + (l7 ? parseInt(s.trim(), 10): dd.read_shift(4));
- break;
- case 'N': out[R][C] = +s.replace(/\u0000/g,"").trim(); break;
- case '@': out[R][C] = new Date(dd.read_shift(-8, 'f') - 0x388317533400); break;
- case 'T': out[R][C] = new Date((dd.read_shift(4) - 0x253D8C) * 0x5265C00 + dd.read_shift(4)); break;
- case 'Y': out[R][C] = dd.read_shift(4,'i')/1e4; break;
- case 'O': out[R][C] = -dd.read_shift(-8, 'f'); break;
- case 'B': if(vfp && fields[C].len == 8) { out[R][C] = dd.read_shift(8,'f'); break; }
- /* falls through */
- case 'G': case 'P': dd.l += fields[C].len; break;
- case '0':
- if(fields[C].name === '_NullFlags') break;
- /* falls through */
- default: throw new Error("DBF Unsupported data type " + fields[C].type);
- }
- }
- }
- if(ft != 0x02) if(d.l < d.length && d[d.l++] != 0x1A) throw new Error("DBF EOF Marker missing " + (d.l-1) + " of " + d.length + " " + d[d.l-1].toString(16));
- if(opts && opts.sheetRows) out = out.slice(0, opts.sheetRows);
- return out;
- }
-
- function dbf_to_sheet(buf, opts) {
- var o = opts || {};
- if(!o.dateNF) o.dateNF = "yyyymmdd";
- return aoa_to_sheet(dbf_to_aoa(buf, o), o);
- }
-
- function dbf_to_workbook(buf, opts) {
- try { return sheet_to_workbook(dbf_to_sheet(buf, opts), opts); }
- catch(e) { if(opts && opts.WTF) throw e; }
- return ({SheetNames:[],Sheets:{}});
- }
-
- var _RLEN = { 'B': 8, 'C': 250, 'L': 1, 'D': 8, '?': 0, '': 0 };
- function sheet_to_dbf(ws, opts) {
- var o = opts || {};
- if(+o.codepage >= 0) set_cp(+o.codepage);
- if(o.type == "string") throw new Error("Cannot write DBF to JS string");
- var ba = buf_array();
- var aoa = sheet_to_json(ws, {header:1, raw:true, cellDates:true});
- var headers = aoa[0], data = aoa.slice(1);
- var i = 0, j = 0, hcnt = 0, rlen = 1;
- for(i = 0; i < headers.length; ++i) {
- if(i == null) continue;
- ++hcnt;
- if(typeof headers[i] === 'number') headers[i] = headers[i].toString(10);
- if(typeof headers[i] !== 'string') throw new Error("DBF Invalid column name " + headers[i] + " |" + (typeof headers[i]) + "|");
- if(headers.indexOf(headers[i]) !== i) for(j=0; j<1024;++j)
- if(headers.indexOf(headers[i] + "_" + j) == -1) { headers[i] += "_" + j; break; }
- }
- var range = safe_decode_range(ws['!ref']);
- var coltypes = [];
- for(i = 0; i <= range.e.c - range.s.c; ++i) {
- var col = [];
- for(j=0; j < data.length; ++j) {
- if(data[j][i] != null) col.push(data[j][i]);
- }
- if(col.length == 0 || headers[i] == null) { coltypes[i] = '?'; continue; }
- var guess = '', _guess = '';
- for(j = 0; j < col.length; ++j) {
- switch(typeof col[j]) {
- /* TODO: check if L2 compat is desired */
- case 'number': _guess = 'B'; break;
- case 'string': _guess = 'C'; break;
- case 'boolean': _guess = 'L'; break;
- case 'object': _guess = col[j] instanceof Date ? 'D' : 'C'; break;
- default: _guess = 'C';
- }
- guess = guess && guess != _guess ? 'C' : _guess;
- if(guess == 'C') break;
- }
- rlen += _RLEN[guess] || 0;
- coltypes[i] = guess;
- }
-
- var h = ba.next(32);
- h.write_shift(4, 0x13021130);
- h.write_shift(4, data.length);
- h.write_shift(2, 296 + 32 * hcnt);
- h.write_shift(2, rlen);
- for(i=0; i < 4; ++i) h.write_shift(4, 0);
- h.write_shift(4, 0x00000000 | ((+dbf_reverse_map[current_ansi] || 0x03)<<8));
-
- for(i = 0, j = 0; i < headers.length; ++i) {
- if(headers[i] == null) continue;
- var hf = ba.next(32);
- var _f = (headers[i].slice(-10) + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00").slice(0, 11);
- hf.write_shift(1, _f, "sbcs");
- hf.write_shift(1, coltypes[i] == '?' ? 'C' : coltypes[i], "sbcs");
- hf.write_shift(4, j);
- hf.write_shift(1, _RLEN[coltypes[i]] || 0);
- hf.write_shift(1, 0);
- hf.write_shift(1, 0x02);
- hf.write_shift(4, 0);
- hf.write_shift(1, 0);
- hf.write_shift(4, 0);
- hf.write_shift(4, 0);
- j += _RLEN[coltypes[i]] || 0;
- }
-
- var hb = ba.next(264);
- hb.write_shift(4, 0x0000000D);
- for(i=0; i < 65;++i) hb.write_shift(4, 0x00000000);
- for(i=0; i < data.length; ++i) {
- var rout = ba.next(rlen);
- rout.write_shift(1, 0);
- for(j=0; j<headers.length; ++j) {
- if(headers[j] == null) continue;
- switch(coltypes[j]) {
- case 'L': rout.write_shift(1, data[i][j] == null ? 0x3F : data[i][j] ? 0x54 : 0x46); break;
- case 'B': rout.write_shift(8, data[i][j]||0, 'f'); break;
- case 'D':
- if(!data[i][j]) rout.write_shift(8, "00000000", "sbcs");
- else {
- rout.write_shift(4, ("0000"+data[i][j].getFullYear()).slice(-4), "sbcs");
- rout.write_shift(2, ("00"+(data[i][j].getMonth()+1)).slice(-2), "sbcs");
- rout.write_shift(2, ("00"+data[i][j].getDate()).slice(-2), "sbcs");
- } break;
- case 'C':
- var _s = String(data[i][j]||"");
- rout.write_shift(1, _s, "sbcs");
- for(hcnt=0; hcnt < 250-_s.length; ++hcnt) rout.write_shift(1, 0x20); break;
- }
- }
- // data
- }
- ba.next(1).write_shift(1, 0x1A);
- return ba.end();
- }
- return {
- to_workbook: dbf_to_workbook,
- to_sheet: dbf_to_sheet,
- from_sheet: sheet_to_dbf
- };
- })();
-
- var SYLK = (function() {
- /* TODO: stress test sequences */
- var sylk_escapes = ({
- AA:'À', BA:'Á', CA:'Â', DA:195, HA:'Ä', JA:197,
- AE:'È', BE:'É', CE:'Ê', HE:'Ë',
- AI:'Ì', BI:'Í', CI:'Î', HI:'Ï',
- AO:'Ò', BO:'Ó', CO:'Ô', DO:213, HO:'Ö',
- AU:'Ù', BU:'Ú', CU:'Û', HU:'Ü',
- Aa:'à', Ba:'á', Ca:'â', Da:227, Ha:'ä', Ja:229,
- Ae:'è', Be:'é', Ce:'ê', He:'ë',
- Ai:'ì', Bi:'í', Ci:'î', Hi:'ï',
- Ao:'ò', Bo:'ó', Co:'ô', Do:245, Ho:'ö',
- Au:'ù', Bu:'ú', Cu:'û', Hu:'ü',
- KC:'Ç', Kc:'ç', q:'æ', z:'œ', a:'Æ', j:'Œ',
- DN:209, Dn:241, Hy:255,
- S:169, c:170, R:174, B:180,
- 0:176, 1:177, 2:178,
- 3:179, 5:181, 6:182,
- 7:183, Q:185, k:186, b:208, i:216, l:222, s:240, y:248,
- "!":161, '"':162, "#":163, "(":164, "%":165, "'":167, "H ":168,
- "+":171, ";":187, "<":188, "=":189, ">":190, "?":191, "{":223
- });
- var sylk_char_regex = new RegExp("\u001BN(" + keys(sylk_escapes).join("|").replace(/\|\|\|/, "|\\||").replace(/([?()+])/g,"\\$1") + "|\\|)", "gm");
- var sylk_char_fn = function(_, $1){ var o = sylk_escapes[$1]; return typeof o == "number" ? _getansi(o) : o; };
- var decode_sylk_char = function($$, $1, $2) { var newcc = (($1.charCodeAt(0) - 0x20)<<4) | ($2.charCodeAt(0) - 0x30); return newcc == 59 ? $$ : _getansi(newcc); };
- sylk_escapes["|"] = 254;
- /* TODO: find an actual specification */
- function sylk_to_aoa(d, opts) {
- switch(opts.type) {
- case 'base64': return sylk_to_aoa_str(Base64.decode(d), opts);
- case 'binary': return sylk_to_aoa_str(d, opts);
- case 'buffer': return sylk_to_aoa_str(d.toString('binary'), opts);
- case 'array': return sylk_to_aoa_str(cc2str(d), opts);
- }
- throw new Error("Unrecognized type " + opts.type);
- }
- function sylk_to_aoa_str(str, opts) {
- var records = str.split(/[\n\r]+/), R = -1, C = -1, ri = 0, rj = 0, arr = [];
- var formats = [];
- var next_cell_format = null;
- var sht = {}, rowinfo = [], colinfo = [], cw = [];
- var Mval = 0, j;
- if(+opts.codepage >= 0) set_cp(+opts.codepage);
- for (; ri !== records.length; ++ri) {
- Mval = 0;
- var rstr=records[ri].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g, decode_sylk_char).replace(sylk_char_regex, sylk_char_fn);
- var record=rstr.replace(/;;/g, "\u0000").split(";").map(function(x) { return x.replace(/\u0000/g, ";"); });
- var RT=record[0], val;
- if(rstr.length > 0) switch(RT) {
- case 'ID': break; /* header */
- case 'E': break; /* EOF */
- case 'B': break; /* dimensions */
- case 'O': break; /* options? */
- case 'P':
- if(record[1].charAt(0) == 'P')
- formats.push(rstr.slice(3).replace(/;;/g, ";"));
- break;
- case 'C':
- var C_seen_K = false, C_seen_X = false;
- for(rj=1; rj<record.length; ++rj) switch(record[rj].charAt(0)) {
- case 'X': C = parseInt(record[rj].slice(1))-1; C_seen_X = true; break;
- case 'Y':
- R = parseInt(record[rj].slice(1))-1; if(!C_seen_X) C = 0;
- for(j = arr.length; j <= R; ++j) arr[j] = [];
- break;
- case 'K':
- val = record[rj].slice(1);
- if(val.charAt(0) === '"') val = val.slice(1,val.length - 1);
- else if(val === 'TRUE') val = true;
- else if(val === 'FALSE') val = false;
- else if(!isNaN(fuzzynum(val))) {
- val = fuzzynum(val);
- if(next_cell_format !== null && SSF.is_date(next_cell_format)) val = numdate(val);
- } else if(!isNaN(fuzzydate(val).getDate())) {
- val = parseDate(val);
- }
- if(typeof cptable !== 'undefined' && typeof val == "string" && ((opts||{}).type != "string") && (opts||{}).codepage) val = cptable.utils.decode(opts.codepage, val);
- C_seen_K = true;
- break;
- case 'E':
- var formula = rc_to_a1(record[rj].slice(1), {r:R,c:C});
- arr[R][C] = [arr[R][C], formula];
- break;
- default: if(opts && opts.WTF) throw new Error("SYLK bad record " + rstr);
- }
- if(C_seen_K) { arr[R][C] = val; next_cell_format = null; }
- break;
- case 'F':
- var F_seen = 0;
- for(rj=1; rj<record.length; ++rj) switch(record[rj].charAt(0)) {
- case 'X': C = parseInt(record[rj].slice(1))-1; ++F_seen; break;
- case 'Y':
- R = parseInt(record[rj].slice(1))-1; /*C = 0;*/
- for(j = arr.length; j <= R; ++j) arr[j] = [];
- break;
- case 'M': Mval = parseInt(record[rj].slice(1)) / 20; break;
- case 'F': break; /* ??? */
- case 'G': break; /* hide grid */
- case 'P':
- next_cell_format = formats[parseInt(record[rj].slice(1))];
- break;
- case 'S': break; /* cell style */
- case 'D': break; /* column */
- case 'N': break; /* font */
- case 'W':
- cw = record[rj].slice(1).split(" ");
- for(j = parseInt(cw[0], 10); j <= parseInt(cw[1], 10); ++j) {
- Mval = parseInt(cw[2], 10);
- colinfo[j-1] = Mval === 0 ? {hidden:true}: {wch:Mval}; process_col(colinfo[j-1]);
- } break;
- case 'C': /* default column format */
- C = parseInt(record[rj].slice(1))-1;
- if(!colinfo[C]) colinfo[C] = {};
- break;
- case 'R': /* row properties */
- R = parseInt(record[rj].slice(1))-1;
- if(!rowinfo[R]) rowinfo[R] = {};
- if(Mval > 0) { rowinfo[R].hpt = Mval; rowinfo[R].hpx = pt2px(Mval); }
- else if(Mval === 0) rowinfo[R].hidden = true;
- break;
- default: if(opts && opts.WTF) throw new Error("SYLK bad record " + rstr);
- }
- if(F_seen < 1) next_cell_format = null; break;
- default: if(opts && opts.WTF) throw new Error("SYLK bad record " + rstr);
- }
- }
- if(rowinfo.length > 0) sht['!rows'] = rowinfo;
- if(colinfo.length > 0) sht['!cols'] = colinfo;
- if(opts && opts.sheetRows) arr = arr.slice(0, opts.sheetRows);
- return [arr, sht];
- }
-
- function sylk_to_sheet(d, opts) {
- var aoasht = sylk_to_aoa(d, opts);
- var aoa = aoasht[0], ws = aoasht[1];
- var o = aoa_to_sheet(aoa, opts);
- keys(ws).forEach(function(k) { o[k] = ws[k]; });
- return o;
- }
-
- function sylk_to_workbook(d, opts) { return sheet_to_workbook(sylk_to_sheet(d, opts), opts); }
-
- function write_ws_cell_sylk(cell, ws, R, C) {
- var o = "C;Y" + (R+1) + ";X" + (C+1) + ";K";
- switch(cell.t) {
- case 'n':
- o += (cell.v||0);
- if(cell.f && !cell.F) o += ";E" + a1_to_rc(cell.f, {r:R, c:C}); break;
- case 'b': o += cell.v ? "TRUE" : "FALSE"; break;
- case 'e': o += cell.w || cell.v; break;
- case 'd': o += '"' + (cell.w || cell.v) + '"'; break;
- case 's': o += '"' + cell.v.replace(/"/g,"") + '"'; break;
- }
- return o;
- }
-
- function write_ws_cols_sylk(out, cols) {
- cols.forEach(function(col, i) {
- var rec = "F;W" + (i+1) + " " + (i+1) + " ";
- if(col.hidden) rec += "0";
- else {
- if(typeof col.width == 'number') col.wpx = width2px(col.width);
- if(typeof col.wpx == 'number') col.wch = px2char(col.wpx);
- if(typeof col.wch == 'number') rec += Math.round(col.wch);
- }
- if(rec.charAt(rec.length - 1) != " ") out.push(rec);
- });
- }
-
- function write_ws_rows_sylk(out, rows) {
- rows.forEach(function(row, i) {
- var rec = "F;";
- if(row.hidden) rec += "M0;";
- else if(row.hpt) rec += "M" + 20 * row.hpt + ";";
- else if(row.hpx) rec += "M" + 20 * px2pt(row.hpx) + ";";
- if(rec.length > 2) out.push(rec + "R" + (i+1));
- });
- }
-
- function sheet_to_sylk(ws, opts) {
- var preamble = ["ID;PWXL;N;E"], o = [];
- var r = safe_decode_range(ws['!ref']), cell;
- var dense = Array.isArray(ws);
- var RS = "\r\n";
-
- preamble.push("P;PGeneral");
- preamble.push("F;P0;DG0G8;M255");
- if(ws['!cols']) write_ws_cols_sylk(preamble, ws['!cols']);
- if(ws['!rows']) write_ws_rows_sylk(preamble, ws['!rows']);
-
- preamble.push("B;Y" + (r.e.r - r.s.r + 1) + ";X" + (r.e.c - r.s.c + 1) + ";D" + [r.s.c,r.s.r,r.e.c,r.e.r].join(" "));
- for(var R = r.s.r; R <= r.e.r; ++R) {
- for(var C = r.s.c; C <= r.e.c; ++C) {
- var coord = encode_cell({r:R,c:C});
- cell = dense ? (ws[R]||[])[C]: ws[coord];
- if(!cell || (cell.v == null && (!cell.f || cell.F))) continue;
- o.push(write_ws_cell_sylk(cell, ws, R, C, opts));
- }
- }
- return preamble.join(RS) + RS + o.join(RS) + RS + "E" + RS;
- }
-
- return {
- to_workbook: sylk_to_workbook,
- to_sheet: sylk_to_sheet,
- from_sheet: sheet_to_sylk
- };
- })();
-
- var DIF = (function() {
- function dif_to_aoa(d, opts) {
- switch(opts.type) {
- case 'base64': return dif_to_aoa_str(Base64.decode(d), opts);
- case 'binary': return dif_to_aoa_str(d, opts);
- case 'buffer': return dif_to_aoa_str(d.toString('binary'), opts);
- case 'array': return dif_to_aoa_str(cc2str(d), opts);
- }
- throw new Error("Unrecognized type " + opts.type);
- }
- function dif_to_aoa_str(str, opts) {
- var records = str.split('\n'), R = -1, C = -1, ri = 0, arr = [];
- for (; ri !== records.length; ++ri) {
- if (records[ri].trim() === 'BOT') { arr[++R] = []; C = 0; continue; }
- if (R < 0) continue;
- var metadata = records[ri].trim().split(",");
- var type = metadata[0], value = metadata[1];
- ++ri;
- var data = records[ri].trim();
- switch (+type) {
- case -1:
- if (data === 'BOT') { arr[++R] = []; C = 0; continue; }
- else if (data !== 'EOD') throw new Error("Unrecognized DIF special command " + data);
- break;
- case 0:
- if(data === 'TRUE') arr[R][C] = true;
- else if(data === 'FALSE') arr[R][C] = false;
- else if(!isNaN(fuzzynum(value))) arr[R][C] = fuzzynum(value);
- else if(!isNaN(fuzzydate(value).getDate())) arr[R][C] = parseDate(value);
- else arr[R][C] = value;
- ++C; break;
- case 1:
- data = data.slice(1,data.length-1);
- arr[R][C++] = data !== '' ? data : null;
- break;
- }
- if (data === 'EOD') break;
- }
- if(opts && opts.sheetRows) arr = arr.slice(0, opts.sheetRows);
- return arr;
- }
-
- function dif_to_sheet(str, opts) { return aoa_to_sheet(dif_to_aoa(str, opts), opts); }
- function dif_to_workbook(str, opts) { return sheet_to_workbook(dif_to_sheet(str, opts), opts); }
-
- var sheet_to_dif = (function() {
- var push_field = function pf(o, topic, v, n, s) {
- o.push(topic);
- o.push(v + "," + n);
- o.push('"' + s.replace(/"/g,'""') + '"');
- };
- var push_value = function po(o, type, v, s) {
- o.push(type + "," + v);
- o.push(type == 1 ? '"' + s.replace(/"/g,'""') + '"' : s);
- };
- return function sheet_to_dif(ws) {
- var o = [];
- var r = safe_decode_range(ws['!ref']), cell;
- var dense = Array.isArray(ws);
- push_field(o, "TABLE", 0, 1, "sheetjs");
- push_field(o, "VECTORS", 0, r.e.r - r.s.r + 1,"");
- push_field(o, "TUPLES", 0, r.e.c - r.s.c + 1,"");
- push_field(o, "DATA", 0, 0,"");
- for(var R = r.s.r; R <= r.e.r; ++R) {
- push_value(o, -1, 0, "BOT");
- for(var C = r.s.c; C <= r.e.c; ++C) {
- var coord = encode_cell({r:R,c:C});
- cell = dense ? (ws[R]||[])[C] : ws[coord];
- if(!cell) { push_value(o, 1, 0, ""); continue;}
- switch(cell.t) {
- case 'n':
- var val = DIF_XL ? cell.w : cell.v;
- if(!val && cell.v != null) val = cell.v;
- if(val == null) {
- if(DIF_XL && cell.f && !cell.F) push_value(o, 1, 0, "=" + cell.f);
- else push_value(o, 1, 0, "");
- }
- else push_value(o, 0, val, "V");
- break;
- case 'b':
- push_value(o, 0, cell.v ? 1 : 0, cell.v ? "TRUE" : "FALSE");
- break;
- case 's':
- push_value(o, 1, 0, (!DIF_XL || isNaN(cell.v)) ? cell.v : '="' + cell.v + '"');
- break;
- case 'd':
- if(!cell.w) cell.w = SSF.format(cell.z || SSF._table[14], datenum(parseDate(cell.v)));
- if(DIF_XL) push_value(o, 0, cell.w, "V");
- else push_value(o, 1, 0, cell.w);
- break;
- default: push_value(o, 1, 0, "");
- }
- }
- }
- push_value(o, -1, 0, "EOD");
- var RS = "\r\n";
- var oo = o.join(RS);
- //while((oo.length & 0x7F) != 0) oo += "\0";
- return oo;
- };
- })();
- return {
- to_workbook: dif_to_workbook,
- to_sheet: dif_to_sheet,
- from_sheet: sheet_to_dif
- };
- })();
-
- var ETH = (function() {
- function decode(s) { return s.replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,"\n"); }
- function encode(s) { return s.replace(/\\/g, "\\b").replace(/:/g, "\\c").replace(/\n/g,"\\n"); }
-
- function eth_to_aoa(str, opts) {
- var records = str.split('\n'), R = -1, C = -1, ri = 0, arr = [];
- for (; ri !== records.length; ++ri) {
- var record = records[ri].trim().split(":");
- if(record[0] !== 'cell') continue;
- var addr = decode_cell(record[1]);
- if(arr.length <= addr.r) for(R = arr.length; R <= addr.r; ++R) if(!arr[R]) arr[R] = [];
- R = addr.r; C = addr.c;
- switch(record[2]) {
- case 't': arr[R][C] = decode(record[3]); break;
- case 'v': arr[R][C] = +record[3]; break;
- case 'vtf': var _f = record[record.length - 1];
- /* falls through */
- case 'vtc':
- switch(record[3]) {
- case 'nl': arr[R][C] = +record[4] ? true : false; break;
- default: arr[R][C] = +record[4]; break;
- }
- if(record[2] == 'vtf') arr[R][C] = [arr[R][C], _f];
- }
- }
- if(opts && opts.sheetRows) arr = arr.slice(0, opts.sheetRows);
- return arr;
- }
-
- function eth_to_sheet(d, opts) { return aoa_to_sheet(eth_to_aoa(d, opts), opts); }
- function eth_to_workbook(d, opts) { return sheet_to_workbook(eth_to_sheet(d, opts), opts); }
-
- var header = [
- "socialcalc:version:1.5",
- "MIME-Version: 1.0",
- "Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"
- ].join("\n");
-
- var sep = [
- "--SocialCalcSpreadsheetControlSave",
- "Content-type: text/plain; charset=UTF-8"
- ].join("\n") + "\n";
-
- /* TODO: the other parts */
- var meta = [
- "# SocialCalc Spreadsheet Control Save",
- "part:sheet"
- ].join("\n");
-
- var end = "--SocialCalcSpreadsheetControlSave--";
-
- function sheet_to_eth_data(ws) {
- if(!ws || !ws['!ref']) return "";
- var o = [], oo = [], cell, coord = "";
- var r = decode_range(ws['!ref']);
- var dense = Array.isArray(ws);
- for(var R = r.s.r; R <= r.e.r; ++R) {
- for(var C = r.s.c; C <= r.e.c; ++C) {
- coord = encode_cell({r:R,c:C});
- cell = dense ? (ws[R]||[])[C] : ws[coord];
- if(!cell || cell.v == null || cell.t === 'z') continue;
- oo = ["cell", coord, 't'];
- switch(cell.t) {
- case 's': case 'str': oo.push(encode(cell.v)); break;
- case 'n':
- if(!cell.f) { oo[2]='v'; oo[3]=cell.v; }
- else { oo[2]='vtf'; oo[3]='n'; oo[4]=cell.v; oo[5]=encode(cell.f); }
- break;
- case 'b':
- oo[2] = 'vt'+(cell.f?'f':'c'); oo[3]='nl'; oo[4]=cell.v?"1":"0";
- oo[5] = encode(cell.f||(cell.v?'TRUE':'FALSE'));
- break;
- case 'd':
- var t = datenum(parseDate(cell.v));
- oo[2] = 'vtc'; oo[3] = 'nd'; oo[4] = ""+t;
- oo[5] = cell.w || SSF.format(cell.z || SSF._table[14], t);
- break;
- case 'e': continue;
- }
- o.push(oo.join(":"));
- }
- }
- o.push("sheet:c:" + (r.e.c-r.s.c+1) + ":r:" + (r.e.r-r.s.r+1) + ":tvf:1");
- o.push("valueformat:1:text-wiki");
- //o.push("copiedfrom:" + ws['!ref']); // clipboard only
- return o.join("\n");
- }
-
- function sheet_to_eth(ws) {
- return [header, sep, meta, sep, sheet_to_eth_data(ws), end].join("\n");
- // return ["version:1.5", sheet_to_eth_data(ws)].join("\n"); // clipboard form
- }
-
- return {
- to_workbook: eth_to_workbook,
- to_sheet: eth_to_sheet,
- from_sheet: sheet_to_eth
- };
- })();
-
- var PRN = (function() {
- function set_text_arr(data, arr, R, C, o) {
- if(o.raw) arr[R][C] = data;
- else if(data === 'TRUE') arr[R][C] = true;
- else if(data === 'FALSE') arr[R][C] = false;
- else if(data === ""){/* empty */}
- else if(!isNaN(fuzzynum(data))) arr[R][C] = fuzzynum(data);
- else if(!isNaN(fuzzydate(data).getDate())) arr[R][C] = parseDate(data);
- else arr[R][C] = data;
- }
-
- function prn_to_aoa_str(f, opts) {
- var o = opts || {};
- var arr = ([]);
- if(!f || f.length === 0) return arr;
- var lines = f.split(/[\r\n]/);
- var L = lines.length - 1;
- while(L >= 0 && lines[L].length === 0) --L;
- var start = 10, idx = 0;
- var R = 0;
- for(; R <= L; ++R) {
- idx = lines[R].indexOf(" ");
- if(idx == -1) idx = lines[R].length; else idx++;
- start = Math.max(start, idx);
- }
- for(R = 0; R <= L; ++R) {
- arr[R] = [];
- /* TODO: confirm that widths are always 10 */
- var C = 0;
- set_text_arr(lines[R].slice(0, start).trim(), arr, R, C, o);
- for(C = 1; C <= (lines[R].length - start)/10 + 1; ++C)
- set_text_arr(lines[R].slice(start+(C-1)*10,start+C*10).trim(),arr,R,C,o);
- }
- if(o.sheetRows) arr = arr.slice(0, o.sheetRows);
- return arr;
- }
-
- // List of accepted CSV separators
- var guess_seps = {
- 0x2C: ',',
- 0x09: "\t",
- 0x3B: ';'
- };
-
- // CSV separator weights to be used in case of equal numbers
- var guess_sep_weights = {
- 0x2C: 3,
- 0x09: 2,
- 0x3B: 1
- };
-
- function guess_sep(str) {
- var cnt = {}, instr = false, end = 0, cc = 0;
- for(;end < str.length;++end) {
- if((cc=str.charCodeAt(end)) == 0x22) instr = !instr;
- else if(!instr && cc in guess_seps) cnt[cc] = (cnt[cc]||0)+1;
- }
-
- cc = [];
- for(end in cnt) if ( cnt.hasOwnProperty(end) ) {
- cc.push([ cnt[end], end ]);
- }
-
- if ( !cc.length ) {
- cnt = guess_sep_weights;
- for(end in cnt) if ( cnt.hasOwnProperty(end) ) {
- cc.push([ cnt[end], end ]);
- }
- }
-
- cc.sort(function(a, b) { return a[0] - b[0] || guess_sep_weights[a[1]] - guess_sep_weights[b[1]]; });
-
- return guess_seps[cc.pop()[1]];
- }
-
- function dsv_to_sheet_str(str, opts) {
- var o = opts || {};
- var sep = "";
- if(DENSE != null && o.dense == null) o.dense = DENSE;
- var ws = o.dense ? ([]) : ({});
- var range = ({s: {c:0, r:0}, e: {c:0, r:0}});
-
- if(str.slice(0,4) == "sep=" && str.charCodeAt(5) == 10) { sep = str.charAt(4); str = str.slice(6); }
- else sep = guess_sep(str.slice(0,1024));
- var R = 0, C = 0, v = 0;
- var start = 0, end = 0, sepcc = sep.charCodeAt(0), instr = false, cc=0;
- str = str.replace(/\r\n/mg, "\n");
- var _re = o.dateNF != null ? dateNF_regex(o.dateNF) : null;
- function finish_cell() {
- var s = str.slice(start, end);
- var cell = ({});
- if(s.charAt(0) == '"' && s.charAt(s.length - 1) == '"') s = s.slice(1,-1).replace(/""/g,'"');
- if(s.length === 0) cell.t = 'z';
- else if(o.raw) { cell.t = 's'; cell.v = s; }
- else if(s.trim().length === 0) { cell.t = 's'; cell.v = s; }
- else if(s.charCodeAt(0) == 0x3D) {
- if(s.charCodeAt(1) == 0x22 && s.charCodeAt(s.length - 1) == 0x22) { cell.t = 's'; cell.v = s.slice(2,-1).replace(/""/g,'"'); }
- else if(fuzzyfmla(s)) { cell.t = 'n'; cell.f = s.slice(1); }
- else { cell.t = 's'; cell.v = s; } }
- else if(s == "TRUE") { cell.t = 'b'; cell.v = true; }
- else if(s == "FALSE") { cell.t = 'b'; cell.v = false; }
- else if(!isNaN(v = fuzzynum(s))) { cell.t = 'n'; if(o.cellText !== false) cell.w = s; cell.v = v; }
- else if(!isNaN(fuzzydate(s).getDate()) || _re && s.match(_re)) {
- cell.z = o.dateNF || SSF._table[14];
- var k = 0;
- if(_re && s.match(_re)){ s=dateNF_fix(s, o.dateNF, (s.match(_re)||[])); k=1; }
- if(o.cellDates) { cell.t = 'd'; cell.v = parseDate(s, k); }
- else { cell.t = 'n'; cell.v = datenum(parseDate(s, k)); }
- if(o.cellText !== false) cell.w = SSF.format(cell.z, cell.v instanceof Date ? datenum(cell.v):cell.v);
- if(!o.cellNF) delete cell.z;
- } else {
- cell.t = 's';
- cell.v = s;
- }
- if(cell.t == 'z'){}
- else if(o.dense) { if(!ws[R]) ws[R] = []; ws[R][C] = cell; }
- else ws[encode_cell({c:C,r:R})] = cell;
- start = end+1;
- if(range.e.c < C) range.e.c = C;
- if(range.e.r < R) range.e.r = R;
- if(cc == sepcc) ++C; else { C = 0; ++R; if(o.sheetRows && o.sheetRows <= R) return true; }
- }
- outer: for(;end < str.length;++end) switch((cc=str.charCodeAt(end))) {
- case 0x22: instr = !instr; break;
- case sepcc: case 0x0a: case 0x0d: if(!instr && finish_cell()) break outer; break;
- default: break;
- }
- if(end - start > 0) finish_cell();
-
- ws['!ref'] = encode_range(range);
- return ws;
- }
-
- function prn_to_sheet_str(str, opts) {
- if(str.slice(0,4) == "sep=") return dsv_to_sheet_str(str, opts);
- if(str.indexOf("\t") >= 0 || str.indexOf(",") >= 0 || str.indexOf(";") >= 0) return dsv_to_sheet_str(str, opts);
- return aoa_to_sheet(prn_to_aoa_str(str, opts), opts);
- }
-
- function prn_to_sheet(d, opts) {
- var str = "", bytes = opts.type == 'string' ? [0,0,0,0] : firstbyte(d, opts);
- switch(opts.type) {
- case 'base64': str = Base64.decode(d); break;
- case 'binary': str = d; break;
- case 'buffer':
- if(opts.codepage == 65001) str = d.toString('utf8');
- else if(opts.codepage && typeof cptable !== 'undefined') str = cptable.utils.decode(opts.codepage, d);
- else str = d.toString('binary');
- break;
- case 'array': str = cc2str(d); break;
- case 'string': str = d; break;
- default: throw new Error("Unrecognized type " + opts.type);
- }
- if(bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF) str = utf8read(str.slice(3));
- else if((opts.type == 'binary') && typeof cptable !== 'undefined' && opts.codepage) str = cptable.utils.decode(opts.codepage, cptable.utils.encode(1252,str));
- if(str.slice(0,19) == "socialcalc:version:") return ETH.to_sheet(opts.type == 'string' ? str : utf8read(str), opts);
- return prn_to_sheet_str(str, opts);
- }
-
- function prn_to_workbook(d, opts) { return sheet_to_workbook(prn_to_sheet(d, opts), opts); }
-
- function sheet_to_prn(ws) {
- var o = [];
- var r = safe_decode_range(ws['!ref']), cell;
- var dense = Array.isArray(ws);
- for(var R = r.s.r; R <= r.e.r; ++R) {
- var oo = [];
- for(var C = r.s.c; C <= r.e.c; ++C) {
- var coord = encode_cell({r:R,c:C});
- cell = dense ? (ws[R]||[])[C] : ws[coord];
- if(!cell || cell.v == null) { oo.push(" "); continue; }
- var w = (cell.w || (format_cell(cell), cell.w) || "").slice(0,10);
- while(w.length < 10) w += " ";
- oo.push(w + (C === 0 ? " " : ""));
- }
- o.push(oo.join(""));
- }
- return o.join("\n");
- }
-
- return {
- to_workbook: prn_to_workbook,
- to_sheet: prn_to_sheet,
- from_sheet: sheet_to_prn
- };
- })();
-
- /* Excel defaults to SYLK but warns if data is not valid */
- function read_wb_ID(d, opts) {
- var o = opts || {}, OLD_WTF = !!o.WTF; o.WTF = true;
- try {
- var out = SYLK.to_workbook(d, o);
- o.WTF = OLD_WTF;
- return out;
- } catch(e) {
- o.WTF = OLD_WTF;
- if(!e.message.match(/SYLK bad record ID/) && OLD_WTF) throw e;
- return PRN.to_workbook(d, opts);
- }
- }
-
- var WK_ = (function() {
- function lotushopper(data, cb, opts) {
- if(!data) return;
- prep_blob(data, data.l || 0);
- var Enum = opts.Enum || WK1Enum;
- while(data.l < data.length) {
- var RT = data.read_shift(2);
- var R = Enum[RT] || Enum[0xFF];
- var length = data.read_shift(2);
- var tgt = data.l + length;
- var d = (R.f||parsenoop)(data, length, opts);
- data.l = tgt;
- if(cb(d, R.n, RT)) return;
- }
- }
-
- function lotus_to_workbook(d, opts) {
- switch(opts.type) {
- case 'base64': return lotus_to_workbook_buf(s2a(Base64.decode(d)), opts);
- case 'binary': return lotus_to_workbook_buf(s2a(d), opts);
- case 'buffer':
- case 'array': return lotus_to_workbook_buf(d, opts);
- }
- throw "Unsupported type " + opts.type;
- }
-
- function lotus_to_workbook_buf(d, opts) {
- if(!d) return d;
- var o = opts || {};
- if(DENSE != null && o.dense == null) o.dense = DENSE;
- var s = ((o.dense ? [] : {})), n = "Sheet1", sidx = 0;
- var sheets = {}, snames = [n];
-
- var refguess = {s: {r:0, c:0}, e: {r:0, c:0} };
- var sheetRows = o.sheetRows || 0;
-
- if(d[2] == 0x02) o.Enum = WK1Enum;
- else if(d[2] == 0x1a) o.Enum = WK3Enum;
- else if(d[2] == 0x0e) { o.Enum = WK3Enum; o.qpro = true; d.l = 0; }
- else throw new Error("Unrecognized LOTUS BOF " + d[2]);
- lotushopper(d, function(val, Rn, RT) {
- if(d[2] == 0x02) switch(RT) {
- case 0x00:
- o.vers = val;
- if(val >= 0x1000) o.qpro = true;
- break;
- case 0x06: refguess = val; break; /* RANGE */
- case 0x0F: /* LABEL */
- if(!o.qpro) val[1].v = val[1].v.slice(1);
- /* falls through */
- case 0x0D: /* INTEGER */
- case 0x0E: /* NUMBER */
- case 0x10: /* FORMULA */
- case 0x33: /* STRING */
- /* TODO: actual translation of the format code */
- if(RT == 0x0E && (val[2] & 0x70) == 0x70 && (val[2] & 0x0F) > 1 && (val[2] & 0x0F) < 15) {
- val[1].z = o.dateNF || SSF._table[14];
- if(o.cellDates) { val[1].t = 'd'; val[1].v = numdate(val[1].v); }
- }
- if(o.dense) {
- if(!s[val[0].r]) s[val[0].r] = [];
- s[val[0].r][val[0].c] = val[1];
- } else s[encode_cell(val[0])] = val[1];
- break;
- } else switch(RT) {
- case 0x16: /* LABEL16 */
- val[1].v = val[1].v.slice(1);
- /* falls through */
- case 0x17: /* NUMBER17 */
- case 0x18: /* NUMBER18 */
- case 0x19: /* FORMULA19 */
- case 0x25: /* NUMBER25 */
- case 0x27: /* NUMBER27 */
- case 0x28: /* FORMULA28 */
- if(val[3] > sidx) {
- s["!ref"] = encode_range(refguess);
- sheets[n] = s;
- s = (o.dense ? [] : {});
- refguess = {s: {r:0, c:0}, e: {r:0, c:0} };
- sidx = val[3]; n = "Sheet" + (sidx + 1);
- snames.push(n);
- }
- if(sheetRows > 0 && val[0].r >= sheetRows) break;
- if(o.dense) {
- if(!s[val[0].r]) s[val[0].r] = [];
- s[val[0].r][val[0].c] = val[1];
- } else s[encode_cell(val[0])] = val[1];
- if(refguess.e.c < val[0].c) refguess.e.c = val[0].c;
- if(refguess.e.r < val[0].r) refguess.e.r = val[0].r;
- break;
- default: break;
- }
- }, o);
-
- s["!ref"] = encode_range(refguess);
- sheets[n] = s;
- return { SheetNames: snames, Sheets:sheets };
- }
-
- function parse_RANGE(blob) {
- var o = {s:{c:0,r:0},e:{c:0,r:0}};
- o.s.c = blob.read_shift(2);
- o.s.r = blob.read_shift(2);
- o.e.c = blob.read_shift(2);
- o.e.r = blob.read_shift(2);
- if(o.s.c == 0xFFFF) o.s.c = o.e.c = o.s.r = o.e.r = 0;
- return o;
- }
-
- function parse_cell(blob, length, opts) {
- var o = [{c:0,r:0}, {t:'n',v:0}, 0];
- if(opts.qpro && opts.vers != 0x5120) {
- o[0].c = blob.read_shift(1);
- blob.l++;
- o[0].r = blob.read_shift(2);
- blob.l+=2;
- } else {
- o[2] = blob.read_shift(1);
- o[0].c = blob.read_shift(2); o[0].r = blob.read_shift(2);
- }
- return o;
- }
-
- function parse_LABEL(blob, length, opts) {
- var tgt = blob.l + length;
- var o = parse_cell(blob, length, opts);
- o[1].t = 's';
- if(opts.vers == 0x5120) {
- blob.l++;
- var len = blob.read_shift(1);
- o[1].v = blob.read_shift(len, 'utf8');
- return o;
- }
- if(opts.qpro) blob.l++;
- o[1].v = blob.read_shift(tgt - blob.l, 'cstr');
- return o;
- }
-
- function parse_INTEGER(blob, length, opts) {
- var o = parse_cell(blob, length, opts);
- o[1].v = blob.read_shift(2, 'i');
- return o;
- }
-
- function parse_NUMBER(blob, length, opts) {
- var o = parse_cell(blob, length, opts);
- o[1].v = blob.read_shift(8, 'f');
- return o;
- }
-
- function parse_FORMULA(blob, length, opts) {
- var tgt = blob.l + length;
- var o = parse_cell(blob, length, opts);
- /* TODO: formula */
- o[1].v = blob.read_shift(8, 'f');
- if(opts.qpro) blob.l = tgt;
- else {
- var flen = blob.read_shift(2);
- blob.l += flen;
- }
- return o;
- }
-
- function parse_cell_3(blob) {
- var o = [{c:0,r:0}, {t:'n',v:0}, 0];
- o[0].r = blob.read_shift(2); o[3] = blob[blob.l++]; o[0].c = blob[blob.l++];
- return o;
- }
-
- function parse_LABEL_16(blob, length) {
- var o = parse_cell_3(blob, length);
- o[1].t = 's';
- o[1].v = blob.read_shift(length - 4, 'cstr');
- return o;
- }
-
- function parse_NUMBER_18(blob, length) {
- var o = parse_cell_3(blob, length);
- o[1].v = blob.read_shift(2);
- var v = o[1].v >> 1;
- /* TODO: figure out all of the corner cases */
- if(o[1].v & 0x1) {
- switch(v & 0x07) {
- case 1: v = (v >> 3) * 500; break;
- case 2: v = (v >> 3) / 20; break;
- case 4: v = (v >> 3) / 2000; break;
- case 6: v = (v >> 3) / 16; break;
- case 7: v = (v >> 3) / 64; break;
- default: throw "unknown NUMBER_18 encoding " + (v & 0x07);
- }
- }
- o[1].v = v;
- return o;
- }
-
- function parse_NUMBER_17(blob, length) {
- var o = parse_cell_3(blob, length);
- var v1 = blob.read_shift(4);
- var v2 = blob.read_shift(4);
- var e = blob.read_shift(2);
- if(e == 0xFFFF) { o[1].v = 0; return o; }
- var s = e & 0x8000; e = (e&0x7FFF) - 16446;
- o[1].v = (s*2 - 1) * ((e > 0 ? (v2 << e) : (v2 >>> -e)) + (e > -32 ? (v1 << (e + 32)) : (v1 >>> -(e + 32))));
- return o;
- }
-
- function parse_FORMULA_19(blob, length) {
- var o = parse_NUMBER_17(blob, 14);
- blob.l += length - 14; /* TODO: formula */
- return o;
- }
-
- function parse_NUMBER_25(blob, length) {
- var o = parse_cell_3(blob, length);
- var v1 = blob.read_shift(4);
- o[1].v = v1 >> 6;
- return o;
- }
-
- function parse_NUMBER_27(blob, length) {
- var o = parse_cell_3(blob, length);
- var v1 = blob.read_shift(8,'f');
- o[1].v = v1;
- return o;
- }
-
- function parse_FORMULA_28(blob, length) {
- var o = parse_NUMBER_27(blob, 14);
- blob.l += length - 10; /* TODO: formula */
- return o;
- }
-
- var WK1Enum = {
- 0x0000: { n:"BOF", f:parseuint16 },
- 0x0001: { n:"EOF" },
- 0x0002: { n:"CALCMODE" },
- 0x0003: { n:"CALCORDER" },
- 0x0004: { n:"SPLIT" },
- 0x0005: { n:"SYNC" },
- 0x0006: { n:"RANGE", f:parse_RANGE },
- 0x0007: { n:"WINDOW1" },
- 0x0008: { n:"COLW1" },
- 0x0009: { n:"WINTWO" },
- 0x000A: { n:"COLW2" },
- 0x000B: { n:"NAME" },
- 0x000C: { n:"BLANK" },
- 0x000D: { n:"INTEGER", f:parse_INTEGER },
- 0x000E: { n:"NUMBER", f:parse_NUMBER },
- 0x000F: { n:"LABEL", f:parse_LABEL },
- 0x0010: { n:"FORMULA", f:parse_FORMULA },
- 0x0018: { n:"TABLE" },
- 0x0019: { n:"ORANGE" },
- 0x001A: { n:"PRANGE" },
- 0x001B: { n:"SRANGE" },
- 0x001C: { n:"FRANGE" },
- 0x001D: { n:"KRANGE1" },
- 0x0020: { n:"HRANGE" },
- 0x0023: { n:"KRANGE2" },
- 0x0024: { n:"PROTEC" },
- 0x0025: { n:"FOOTER" },
- 0x0026: { n:"HEADER" },
- 0x0027: { n:"SETUP" },
- 0x0028: { n:"MARGINS" },
- 0x0029: { n:"LABELFMT" },
- 0x002A: { n:"TITLES" },
- 0x002B: { n:"SHEETJS" },
- 0x002D: { n:"GRAPH" },
- 0x002E: { n:"NGRAPH" },
- 0x002F: { n:"CALCCOUNT" },
- 0x0030: { n:"UNFORMATTED" },
- 0x0031: { n:"CURSORW12" },
- 0x0032: { n:"WINDOW" },
- 0x0033: { n:"STRING", f:parse_LABEL },
- 0x0037: { n:"PASSWORD" },
- 0x0038: { n:"LOCKED" },
- 0x003C: { n:"QUERY" },
- 0x003D: { n:"QUERYNAME" },
- 0x003E: { n:"PRINT" },
- 0x003F: { n:"PRINTNAME" },
- 0x0040: { n:"GRAPH2" },
- 0x0041: { n:"GRAPHNAME" },
- 0x0042: { n:"ZOOM" },
- 0x0043: { n:"SYMSPLIT" },
- 0x0044: { n:"NSROWS" },
- 0x0045: { n:"NSCOLS" },
- 0x0046: { n:"RULER" },
- 0x0047: { n:"NNAME" },
- 0x0048: { n:"ACOMM" },
- 0x0049: { n:"AMACRO" },
- 0x004A: { n:"PARSE" },
- 0x00FF: { n:"", f:parsenoop }
- };
-
- var WK3Enum = {
- 0x0000: { n:"BOF" },
- 0x0001: { n:"EOF" },
- 0x0003: { n:"??" },
- 0x0004: { n:"??" },
- 0x0005: { n:"??" },
- 0x0006: { n:"??" },
- 0x0007: { n:"??" },
- 0x0009: { n:"??" },
- 0x000a: { n:"??" },
- 0x000b: { n:"??" },
- 0x000c: { n:"??" },
- 0x000e: { n:"??" },
- 0x000f: { n:"??" },
- 0x0010: { n:"??" },
- 0x0011: { n:"??" },
- 0x0012: { n:"??" },
- 0x0013: { n:"??" },
- 0x0015: { n:"??" },
- 0x0016: { n:"LABEL16", f:parse_LABEL_16},
- 0x0017: { n:"NUMBER17", f:parse_NUMBER_17 },
- 0x0018: { n:"NUMBER18", f:parse_NUMBER_18 },
- 0x0019: { n:"FORMULA19", f:parse_FORMULA_19},
- 0x001a: { n:"??" },
- 0x001b: { n:"??" },
- 0x001c: { n:"??" },
- 0x001d: { n:"??" },
- 0x001e: { n:"??" },
- 0x001f: { n:"??" },
- 0x0021: { n:"??" },
- 0x0025: { n:"NUMBER25", f:parse_NUMBER_25 },
- 0x0027: { n:"NUMBER27", f:parse_NUMBER_27 },
- 0x0028: { n:"FORMULA28", f:parse_FORMULA_28 },
- 0x00FF: { n:"", f:parsenoop }
- };
- return {
- to_workbook: lotus_to_workbook
- };
- })();
- /* 18.4.7 rPr CT_RPrElt */
- function parse_rpr(rpr) {
- var font = {}, m = rpr.match(tagregex), i = 0;
- var pass = false;
- if(m) for(;i!=m.length; ++i) {
- var y = parsexmltag(m[i]);
- switch(y[0].replace(/\w*:/g,"")) {
- /* 18.8.12 condense CT_BooleanProperty */
- /* ** not required . */
- case '<condense': break;
- /* 18.8.17 extend CT_BooleanProperty */
- /* ** not required . */
- case '<extend': break;
- /* 18.8.36 shadow CT_BooleanProperty */
- /* ** not required . */
- case '<shadow':
- if(!y.val) break;
- /* falls through */
- case '<shadow>':
- case '<shadow/>': font.shadow = 1; break;
- case '</shadow>': break;
-
- /* 18.4.1 charset CT_IntProperty TODO */
- case '<charset':
- if(y.val == '1') break;
- font.cp = CS2CP[parseInt(y.val, 10)];
- break;
-
- /* 18.4.2 outline CT_BooleanProperty TODO */
- case '<outline':
- if(!y.val) break;
- /* falls through */
- case '<outline>':
- case '<outline/>': font.outline = 1; break;
- case '</outline>': break;
-
- /* 18.4.5 rFont CT_FontName */
- case '<rFont': font.name = y.val; break;
-
- /* 18.4.11 sz CT_FontSize */
- case '<sz': font.sz = y.val; break;
-
- /* 18.4.10 strike CT_BooleanProperty */
- case '<strike':
- if(!y.val) break;
- /* falls through */
- case '<strike>':
- case '<strike/>': font.strike = 1; break;
- case '</strike>': break;
-
- /* 18.4.13 u CT_UnderlineProperty */
- case '<u':
- if(!y.val) break;
- switch(y.val) {
- case 'double': font.uval = "double"; break;
- case 'singleAccounting': font.uval = "single-accounting"; break;
- case 'doubleAccounting': font.uval = "double-accounting"; break;
- }
- /* falls through */
- case '<u>':
- case '<u/>': font.u = 1; break;
- case '</u>': break;
-
- /* 18.8.2 b */
- case '<b':
- if(y.val == '0') break;
- /* falls through */
- case '<b>':
- case '<b/>': font.b = 1; break;
- case '</b>': break;
-
- /* 18.8.26 i */
- case '<i':
- if(y.val == '0') break;
- /* falls through */
- case '<i>':
- case '<i/>': font.i = 1; break;
- case '</i>': break;
-
- /* 18.3.1.15 color CT_Color TODO: tint, theme, auto, indexed */
- case '<color':
- if(y.rgb) font.color = y.rgb.slice(2,8);
- break;
-
- /* 18.8.18 family ST_FontFamily */
- case '<family': font.family = y.val; break;
-
- /* 18.4.14 vertAlign CT_VerticalAlignFontProperty TODO */
- case '<vertAlign': font.valign = y.val; break;
-
- /* 18.8.35 scheme CT_FontScheme TODO */
- case '<scheme': break;
-
- /* 18.2.10 extLst CT_ExtensionList ? */
- case '<extLst': case '<extLst>': case '</extLst>': break;
- case '<ext': pass = true; break;
- case '</ext>': pass = false; break;
- default:
- if(y[0].charCodeAt(1) !== 47 && !pass) throw new Error('Unrecognized rich format ' + y[0]);
- }
- }
- return font;
- }
-
- var parse_rs = (function() {
- var tregex = matchtag("t"), rpregex = matchtag("rPr");
- /* 18.4.4 r CT_RElt */
- function parse_r(r) {
- /* 18.4.12 t ST_Xstring */
- var t = r.match(tregex)/*, cp = 65001*/;
- if(!t) return {t:"s", v:""};
-
- var o = ({t:'s', v:unescapexml(t[1])});
- var rpr = r.match(rpregex);
- if(rpr) o.s = parse_rpr(rpr[1]);
- return o;
- }
- var rregex = /<(?:\w+:)?r>/g, rend = /<\/(?:\w+:)?r>/;
- return function parse_rs(rs) {
- return rs.replace(rregex,"").split(rend).map(parse_r).filter(function(r) { return r.v; });
- };
- })();
-
-
- /* Parse a list of <r> tags */
- var rs_to_html = (function parse_rs_factory() {
- var nlregex = /(\r\n|\n)/g;
- function parse_rpr2(font, intro, outro) {
- var style = [];
-
- if(font.u) style.push("text-decoration: underline;");
- if(font.uval) style.push("text-underline-style:" + font.uval + ";");
- if(font.sz) style.push("font-size:" + font.sz + "pt;");
- if(font.outline) style.push("text-effect: outline;");
- if(font.shadow) style.push("text-shadow: auto;");
- intro.push('<span style="' + style.join("") + '">');
-
- if(font.b) { intro.push("<b>"); outro.push("</b>"); }
- if(font.i) { intro.push("<i>"); outro.push("</i>"); }
- if(font.strike) { intro.push("<s>"); outro.push("</s>"); }
-
- var align = font.valign || "";
- if(align == "superscript" || align == "super") align = "sup";
- else if(align == "subscript") align = "sub";
- if(align != "") { intro.push("<" + align + ">"); outro.push("</" + align + ">"); }
-
- outro.push("</span>");
- return font;
- }
-
- /* 18.4.4 r CT_RElt */
- function r_to_html(r) {
- var terms = [[],r.v,[]];
- if(!r.v) return "";
-
- if(r.s) parse_rpr2(r.s, terms[0], terms[2]);
-
- return terms[0].join("") + terms[1].replace(nlregex,'<br/>') + terms[2].join("");
- }
-
- return function parse_rs(rs) {
- return rs.map(r_to_html).join("");
- };
- })();
-
- /* 18.4.8 si CT_Rst */
- var sitregex = /<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g, sirregex = /<(?:\w+:)?r>/;
- var sirphregex = /<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;
- function parse_si(x, opts) {
- var html = opts ? opts.cellHTML : true;
- var z = {};
- if(!x) return null;
- //var y;
- /* 18.4.12 t ST_Xstring (Plaintext String) */
- // TODO: is whitespace actually valid here?
- if(x.match(/^\s*<(?:\w+:)?t[^>]*>/)) {
- z.t = unescapexml(utf8read(x.slice(x.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||""));
- z.r = utf8read(x);
- if(html) z.h = escapehtml(z.t);
- }
- /* 18.4.4 r CT_RElt (Rich Text Run) */
- else if((/*y = */x.match(sirregex))) {
- z.r = utf8read(x);
- z.t = unescapexml(utf8read((x.replace(sirphregex, '').match(sitregex)||[]).join("").replace(tagregex,"")));
- if(html) z.h = rs_to_html(parse_rs(z.r));
- }
- /* 18.4.3 phoneticPr CT_PhoneticPr (TODO: needed for Asian support) */
- /* 18.4.6 rPh CT_PhoneticRun (TODO: needed for Asian support) */
- return z;
- }
-
- /* 18.4 Shared String Table */
- var sstr0 = /<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/;
- var sstr1 = /<(?:\w+:)?(?:si|sstItem)>/g;
- var sstr2 = /<\/(?:\w+:)?(?:si|sstItem)>/;
- function parse_sst_xml(data, opts) {
- var s = ([]), ss = "";
- if(!data) return s;
- /* 18.4.9 sst CT_Sst */
- var sst = data.match(sstr0);
- if(sst) {
- ss = sst[2].replace(sstr1,"").split(sstr2);
- for(var i = 0; i != ss.length; ++i) {
- var o = parse_si(ss[i].trim(), opts);
- if(o != null) s[s.length] = o;
- }
- sst = parsexmltag(sst[1]); s.Count = sst.count; s.Unique = sst.uniqueCount;
- }
- return s;
- }
-
- RELS.SST = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings";
- var straywsregex = /^\s|\s$|[\t\n\r]/;
- function write_sst_xml(sst, opts) {
- if(!opts.bookSST) return "";
- var o = [XML_HEADER];
- o[o.length] = (writextag('sst', null, {
- xmlns: XMLNS.main[0],
- count: sst.Count,
- uniqueCount: sst.Unique
- }));
- for(var i = 0; i != sst.length; ++i) { if(sst[i] == null) continue;
- var s = sst[i];
- var sitag = "<si>";
- if(s.r) sitag += s.r;
- else {
- sitag += "<t";
- if(!s.t) s.t = "";
- if(s.t.match(straywsregex)) sitag += ' xml:space="preserve"';
- sitag += ">" + escapexml(s.t) + "</t>";
- }
- sitag += "</si>";
- o[o.length] = (sitag);
- }
- if(o.length>2){ o[o.length] = ('</sst>'); o[1]=o[1].replace("/>",">"); }
- return o.join("");
- }
- /* [MS-XLSB] 2.4.221 BrtBeginSst */
- function parse_BrtBeginSst(data) {
- return [data.read_shift(4), data.read_shift(4)];
- }
-
- /* [MS-XLSB] 2.1.7.45 Shared Strings */
- function parse_sst_bin(data, opts) {
- var s = ([]);
- var pass = false;
- recordhopper(data, function hopper_sst(val, R_n, RT) {
- switch(RT) {
- case 0x009F: /* 'BrtBeginSst' */
- s.Count = val[0]; s.Unique = val[1]; break;
- case 0x0013: /* 'BrtSSTItem' */
- s.push(val); break;
- case 0x00A0: /* 'BrtEndSst' */
- return true;
-
- case 0x0023: /* 'BrtFRTBegin' */
- pass = true; break;
- case 0x0024: /* 'BrtFRTEnd' */
- pass = false; break;
-
- default:
- if(R_n.indexOf("Begin") > 0){/* empty */}
- else if(R_n.indexOf("End") > 0){/* empty */}
- if(!pass || opts.WTF) throw new Error("Unexpected record " + RT + " " + R_n);
- }
- });
- return s;
- }
-
- function write_BrtBeginSst(sst, o) {
- if(!o) o = new_buf(8);
- o.write_shift(4, sst.Count);
- o.write_shift(4, sst.Unique);
- return o;
- }
-
- var write_BrtSSTItem = write_RichStr;
-
- function write_sst_bin(sst) {
- var ba = buf_array();
- write_record(ba, "BrtBeginSst", write_BrtBeginSst(sst));
- for(var i = 0; i < sst.length; ++i) write_record(ba, "BrtSSTItem", write_BrtSSTItem(sst[i]));
- /* FRTSST */
- write_record(ba, "BrtEndSst");
- return ba.end();
- }
- function _JS2ANSI(str) {
- if(typeof cptable !== 'undefined') return cptable.utils.encode(current_ansi, str);
- var o = [], oo = str.split("");
- for(var i = 0; i < oo.length; ++i) o[i] = oo[i].charCodeAt(0);
- return o;
- }
-
- /* [MS-OFFCRYPTO] 2.1.4 Version */
- function parse_CRYPTOVersion(blob, length) {
- var o = {};
- o.Major = blob.read_shift(2);
- o.Minor = blob.read_shift(2);
- if(length >= 4) blob.l += length - 4;
- return o;
- }
-
- /* [MS-OFFCRYPTO] 2.1.5 DataSpaceVersionInfo */
- function parse_DataSpaceVersionInfo(blob) {
- var o = {};
- o.id = blob.read_shift(0, 'lpp4');
- o.R = parse_CRYPTOVersion(blob, 4);
- o.U = parse_CRYPTOVersion(blob, 4);
- o.W = parse_CRYPTOVersion(blob, 4);
- return o;
- }
-
- /* [MS-OFFCRYPTO] 2.1.6.1 DataSpaceMapEntry Structure */
- function parse_DataSpaceMapEntry(blob) {
- var len = blob.read_shift(4);
- var end = blob.l + len - 4;
- var o = {};
- var cnt = blob.read_shift(4);
- var comps = [];
- /* [MS-OFFCRYPTO] 2.1.6.2 DataSpaceReferenceComponent Structure */
- while(cnt-- > 0) comps.push({ t: blob.read_shift(4), v: blob.read_shift(0, 'lpp4') });
- o.name = blob.read_shift(0, 'lpp4');
- o.comps = comps;
- if(blob.l != end) throw new Error("Bad DataSpaceMapEntry: " + blob.l + " != " + end);
- return o;
- }
-
- /* [MS-OFFCRYPTO] 2.1.6 DataSpaceMap */
- function parse_DataSpaceMap(blob) {
- var o = [];
- blob.l += 4; // must be 0x8
- var cnt = blob.read_shift(4);
- while(cnt-- > 0) o.push(parse_DataSpaceMapEntry(blob));
- return o;
- }
-
- /* [MS-OFFCRYPTO] 2.1.7 DataSpaceDefinition */
- function parse_DataSpaceDefinition(blob) {
- var o = [];
- blob.l += 4; // must be 0x8
- var cnt = blob.read_shift(4);
- while(cnt-- > 0) o.push(blob.read_shift(0, 'lpp4'));
- return o;
- }
-
- /* [MS-OFFCRYPTO] 2.1.8 DataSpaceDefinition */
- function parse_TransformInfoHeader(blob) {
- var o = {};
- /*var len = */blob.read_shift(4);
- blob.l += 4; // must be 0x1
- o.id = blob.read_shift(0, 'lpp4');
- o.name = blob.read_shift(0, 'lpp4');
- o.R = parse_CRYPTOVersion(blob, 4);
- o.U = parse_CRYPTOVersion(blob, 4);
- o.W = parse_CRYPTOVersion(blob, 4);
- return o;
- }
-
- function parse_Primary(blob) {
- /* [MS-OFFCRYPTO] 2.2.6 IRMDSTransformInfo */
- var hdr = parse_TransformInfoHeader(blob);
- /* [MS-OFFCRYPTO] 2.1.9 EncryptionTransformInfo */
- hdr.ename = blob.read_shift(0, '8lpp4');
- hdr.blksz = blob.read_shift(4);
- hdr.cmode = blob.read_shift(4);
- if(blob.read_shift(4) != 0x04) throw new Error("Bad !Primary record");
- return hdr;
- }
-
- /* [MS-OFFCRYPTO] 2.3.2 Encryption Header */
- function parse_EncryptionHeader(blob, length) {
- var tgt = blob.l + length;
- var o = {};
- o.Flags = (blob.read_shift(4) & 0x3F);
- blob.l += 4;
- o.AlgID = blob.read_shift(4);
- var valid = false;
- switch(o.AlgID) {
- case 0x660E: case 0x660F: case 0x6610: valid = (o.Flags == 0x24); break;
- case 0x6801: valid = (o.Flags == 0x04); break;
- case 0: valid = (o.Flags == 0x10 || o.Flags == 0x04 || o.Flags == 0x24); break;
- default: throw 'Unrecognized encryption algorithm: ' + o.AlgID;
- }
- if(!valid) throw new Error("Encryption Flags/AlgID mismatch");
- o.AlgIDHash = blob.read_shift(4);
- o.KeySize = blob.read_shift(4);
- o.ProviderType = blob.read_shift(4);
- blob.l += 8;
- o.CSPName = blob.read_shift((tgt-blob.l)>>1, 'utf16le');
- blob.l = tgt;
- return o;
- }
-
- /* [MS-OFFCRYPTO] 2.3.3 Encryption Verifier */
- function parse_EncryptionVerifier(blob, length) {
- var o = {}, tgt = blob.l + length;
- blob.l += 4; // SaltSize must be 0x10
- o.Salt = blob.slice(blob.l, blob.l+16); blob.l += 16;
- o.Verifier = blob.slice(blob.l, blob.l+16); blob.l += 16;
- /*var sz = */blob.read_shift(4);
- o.VerifierHash = blob.slice(blob.l, tgt); blob.l = tgt;
- return o;
- }
-
- /* [MS-OFFCRYPTO] 2.3.4.* EncryptionInfo Stream */
- function parse_EncryptionInfo(blob) {
- var vers = parse_CRYPTOVersion(blob);
- switch(vers.Minor) {
- case 0x02: return [vers.Minor, parse_EncInfoStd(blob, vers)];
- case 0x03: return [vers.Minor, parse_EncInfoExt(blob, vers)];
- case 0x04: return [vers.Minor, parse_EncInfoAgl(blob, vers)];
- }
- throw new Error("ECMA-376 Encrypted file unrecognized Version: " + vers.Minor);
- }
-
- /* [MS-OFFCRYPTO] 2.3.4.5 EncryptionInfo Stream (Standard Encryption) */
- function parse_EncInfoStd(blob) {
- var flags = blob.read_shift(4);
- if((flags & 0x3F) != 0x24) throw new Error("EncryptionInfo mismatch");
- var sz = blob.read_shift(4);
- //var tgt = blob.l + sz;
- var hdr = parse_EncryptionHeader(blob, sz);
- var verifier = parse_EncryptionVerifier(blob, blob.length - blob.l);
- return { t:"Std", h:hdr, v:verifier };
- }
- /* [MS-OFFCRYPTO] 2.3.4.6 EncryptionInfo Stream (Extensible Encryption) */
- function parse_EncInfoExt() { throw new Error("File is password-protected: ECMA-376 Extensible"); }
- /* [MS-OFFCRYPTO] 2.3.4.10 EncryptionInfo Stream (Agile Encryption) */
- function parse_EncInfoAgl(blob) {
- var KeyData = ["saltSize","blockSize","keyBits","hashSize","cipherAlgorithm","cipherChaining","hashAlgorithm","saltValue"];
- blob.l+=4;
- var xml = blob.read_shift(blob.length - blob.l, 'utf8');
- var o = {};
- xml.replace(tagregex, function xml_agile(x) {
- var y = parsexmltag(x);
- switch(strip_ns(y[0])) {
- case '<?xml': break;
- case '<encryption': case '</encryption>': break;
- case '<keyData': KeyData.forEach(function(k) { o[k] = y[k]; }); break;
- case '<dataIntegrity': o.encryptedHmacKey = y.encryptedHmacKey; o.encryptedHmacValue = y.encryptedHmacValue; break;
- case '<keyEncryptors>': case '<keyEncryptors': o.encs = []; break;
- case '</keyEncryptors>': break;
-
- case '<keyEncryptor': o.uri = y.uri; break;
- case '</keyEncryptor>': break;
- case '<encryptedKey': o.encs.push(y); break;
- default: throw y[0];
- }
- });
- return o;
- }
-
- /* [MS-OFFCRYPTO] 2.3.5.1 RC4 CryptoAPI Encryption Header */
- function parse_RC4CryptoHeader(blob, length) {
- var o = {};
- var vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;
- if(vers.Minor != 2) throw new Error('unrecognized minor version code: ' + vers.Minor);
- if(vers.Major > 4 || vers.Major < 2) throw new Error('unrecognized major version code: ' + vers.Major);
- o.Flags = blob.read_shift(4); length -= 4;
- var sz = blob.read_shift(4); length -= 4;
- o.EncryptionHeader = parse_EncryptionHeader(blob, sz); length -= sz;
- o.EncryptionVerifier = parse_EncryptionVerifier(blob, length);
- return o;
- }
- /* [MS-OFFCRYPTO] 2.3.6.1 RC4 Encryption Header */
- function parse_RC4Header(blob) {
- var o = {};
- var vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);
- if(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;
- o.Salt = blob.read_shift(16);
- o.EncryptedVerifier = blob.read_shift(16);
- o.EncryptedVerifierHash = blob.read_shift(16);
- return o;
- }
-
- /* [MS-OFFCRYPTO] 2.3.7.1 Binary Document Password Verifier Derivation */
- function crypto_CreatePasswordVerifier_Method1(Password) {
- var Verifier = 0x0000, PasswordArray;
- var PasswordDecoded = _JS2ANSI(Password);
- var len = PasswordDecoded.length + 1, i, PasswordByte;
- var Intermediate1, Intermediate2, Intermediate3;
- PasswordArray = new_raw_buf(len);
- PasswordArray[0] = PasswordDecoded.length;
- for(i = 1; i != len; ++i) PasswordArray[i] = PasswordDecoded[i-1];
- for(i = len-1; i >= 0; --i) {
- PasswordByte = PasswordArray[i];
- Intermediate1 = ((Verifier & 0x4000) === 0x0000) ? 0 : 1;
- Intermediate2 = (Verifier << 1) & 0x7FFF;
- Intermediate3 = Intermediate1 | Intermediate2;
- Verifier = Intermediate3 ^ PasswordByte;
- }
- return Verifier ^ 0xCE4B;
- }
-
- /* [MS-OFFCRYPTO] 2.3.7.2 Binary Document XOR Array Initialization */
- var crypto_CreateXorArray_Method1 = (function() {
- var PadArray = [0xBB, 0xFF, 0xFF, 0xBA, 0xFF, 0xFF, 0xB9, 0x80, 0x00, 0xBE, 0x0F, 0x00, 0xBF, 0x0F, 0x00];
- var InitialCode = [0xE1F0, 0x1D0F, 0xCC9C, 0x84C0, 0x110C, 0x0E10, 0xF1CE, 0x313E, 0x1872, 0xE139, 0xD40F, 0x84F9, 0x280C, 0xA96A, 0x4EC3];
- var XorMatrix = [0xAEFC, 0x4DD9, 0x9BB2, 0x2745, 0x4E8A, 0x9D14, 0x2A09, 0x7B61, 0xF6C2, 0xFDA5, 0xEB6B, 0xC6F7, 0x9DCF, 0x2BBF, 0x4563, 0x8AC6, 0x05AD, 0x0B5A, 0x16B4, 0x2D68, 0x5AD0, 0x0375, 0x06EA, 0x0DD4, 0x1BA8, 0x3750, 0x6EA0, 0xDD40, 0xD849, 0xA0B3, 0x5147, 0xA28E, 0x553D, 0xAA7A, 0x44D5, 0x6F45, 0xDE8A, 0xAD35, 0x4A4B, 0x9496, 0x390D, 0x721A, 0xEB23, 0xC667, 0x9CEF, 0x29FF, 0x53FE, 0xA7FC, 0x5FD9, 0x47D3, 0x8FA6, 0x0F6D, 0x1EDA, 0x3DB4, 0x7B68, 0xF6D0, 0xB861, 0x60E3, 0xC1C6, 0x93AD, 0x377B, 0x6EF6, 0xDDEC, 0x45A0, 0x8B40, 0x06A1, 0x0D42, 0x1A84, 0x3508, 0x6A10, 0xAA51, 0x4483, 0x8906, 0x022D, 0x045A, 0x08B4, 0x1168, 0x76B4, 0xED68, 0xCAF1, 0x85C3, 0x1BA7, 0x374E, 0x6E9C, 0x3730, 0x6E60, 0xDCC0, 0xA9A1, 0x4363, 0x86C6, 0x1DAD, 0x3331, 0x6662, 0xCCC4, 0x89A9, 0x0373, 0x06E6, 0x0DCC, 0x1021, 0x2042, 0x4084, 0x8108, 0x1231, 0x2462, 0x48C4];
- var Ror = function(Byte) { return ((Byte/2) | (Byte*128)) & 0xFF; };
- var XorRor = function(byte1, byte2) { return Ror(byte1 ^ byte2); };
- var CreateXorKey_Method1 = function(Password) {
- var XorKey = InitialCode[Password.length - 1];
- var CurrentElement = 0x68;
- for(var i = Password.length-1; i >= 0; --i) {
- var Char = Password[i];
- for(var j = 0; j != 7; ++j) {
- if(Char & 0x40) XorKey ^= XorMatrix[CurrentElement];
- Char *= 2; --CurrentElement;
- }
- }
- return XorKey;
- };
- return function(password) {
- var Password = _JS2ANSI(password);
- var XorKey = CreateXorKey_Method1(Password);
- var Index = Password.length;
- var ObfuscationArray = new_raw_buf(16);
- for(var i = 0; i != 16; ++i) ObfuscationArray[i] = 0x00;
- var Temp, PasswordLastChar, PadIndex;
- if((Index & 1) === 1) {
- Temp = XorKey >> 8;
- ObfuscationArray[Index] = XorRor(PadArray[0], Temp);
- --Index;
- Temp = XorKey & 0xFF;
- PasswordLastChar = Password[Password.length - 1];
- ObfuscationArray[Index] = XorRor(PasswordLastChar, Temp);
- }
- while(Index > 0) {
- --Index;
- Temp = XorKey >> 8;
- ObfuscationArray[Index] = XorRor(Password[Index], Temp);
- --Index;
- Temp = XorKey & 0xFF;
- ObfuscationArray[Index] = XorRor(Password[Index], Temp);
- }
- Index = 15;
- PadIndex = 15 - Password.length;
- while(PadIndex > 0) {
- Temp = XorKey >> 8;
- ObfuscationArray[Index] = XorRor(PadArray[PadIndex], Temp);
- --Index;
- --PadIndex;
- Temp = XorKey & 0xFF;
- ObfuscationArray[Index] = XorRor(Password[Index], Temp);
- --Index;
- --PadIndex;
- }
- return ObfuscationArray;
- };
- })();
-
- /* [MS-OFFCRYPTO] 2.3.7.3 Binary Document XOR Data Transformation Method 1 */
- var crypto_DecryptData_Method1 = function(password, Data, XorArrayIndex, XorArray, O) {
- /* If XorArray is set, use it; if O is not set, make changes in-place */
- if(!O) O = Data;
- if(!XorArray) XorArray = crypto_CreateXorArray_Method1(password);
- var Index, Value;
- for(Index = 0; Index != Data.length; ++Index) {
- Value = Data[Index];
- Value ^= XorArray[XorArrayIndex];
- Value = ((Value>>5) | (Value<<3)) & 0xFF;
- O[Index] = Value;
- ++XorArrayIndex;
- }
- return [O, XorArrayIndex, XorArray];
- };
-
- var crypto_MakeXorDecryptor = function(password) {
- var XorArrayIndex = 0, XorArray = crypto_CreateXorArray_Method1(password);
- return function(Data) {
- var O = crypto_DecryptData_Method1("", Data, XorArrayIndex, XorArray);
- XorArrayIndex = O[1];
- return O[0];
- };
- };
-
- /* 2.5.343 */
- function parse_XORObfuscation(blob, length, opts, out) {
- var o = ({ key: parseuint16(blob), verificationBytes: parseuint16(blob) });
- if(opts.password) o.verifier = crypto_CreatePasswordVerifier_Method1(opts.password);
- out.valid = o.verificationBytes === o.verifier;
- if(out.valid) out.insitu = crypto_MakeXorDecryptor(opts.password);
- return o;
- }
-
- /* 2.4.117 */
- function parse_FilePassHeader(blob, length, oo) {
- var o = oo || {}; o.Info = blob.read_shift(2); blob.l -= 2;
- if(o.Info === 1) o.Data = parse_RC4Header(blob, length);
- else o.Data = parse_RC4CryptoHeader(blob, length);
- return o;
- }
- function parse_FilePass(blob, length, opts) {
- var o = ({ Type: opts.biff >= 8 ? blob.read_shift(2) : 0 }); /* wEncryptionType */
- if(o.Type) parse_FilePassHeader(blob, length-2, o);
- else parse_XORObfuscation(blob, opts.biff >= 8 ? length : length - 2, opts, o);
- return o;
- }
-
-
- var RTF = (function() {
- function rtf_to_sheet(d, opts) {
- switch(opts.type) {
- case 'base64': return rtf_to_sheet_str(Base64.decode(d), opts);
- case 'binary': return rtf_to_sheet_str(d, opts);
- case 'buffer': return rtf_to_sheet_str(d.toString('binary'), opts);
- case 'array': return rtf_to_sheet_str(cc2str(d), opts);
- }
- throw new Error("Unrecognized type " + opts.type);
- }
-
- function rtf_to_sheet_str(str, opts) {
- var o = opts || {};
- var ws = o.dense ? ([]) : ({});
- var range = ({s: {c:0, r:0}, e: {c:0, r:0}});
-
- // TODO: parse
- if(!str.match(/\\trowd/)) throw new Error("RTF missing table");
-
- ws['!ref'] = encode_range(range);
- return ws;
- }
-
- function rtf_to_workbook(d, opts) { return sheet_to_workbook(rtf_to_sheet(d, opts), opts); }
-
- /* TODO: this is a stub */
- function sheet_to_rtf(ws) {
- var o = ["{\\rtf1\\ansi"];
- var r = safe_decode_range(ws['!ref']), cell;
- var dense = Array.isArray(ws);
- for(var R = r.s.r; R <= r.e.r; ++R) {
- o.push("\\trowd\\trautofit1");
- for(var C = r.s.c; C <= r.e.c; ++C) o.push("\\cellx" + (C+1));
- o.push("\\pard\\intbl");
- for(C = r.s.c; C <= r.e.c; ++C) {
- var coord = encode_cell({r:R,c:C});
- cell = dense ? (ws[R]||[])[C]: ws[coord];
- if(!cell || cell.v == null && (!cell.f || cell.F)) continue;
- o.push(" " + (cell.w || (format_cell(cell), cell.w)));
- o.push("\\cell");
- }
- o.push("\\pard\\intbl\\row");
- }
- return o.join("") + "}";
- }
-
- return {
- to_workbook: rtf_to_workbook,
- to_sheet: rtf_to_sheet,
- from_sheet: sheet_to_rtf
- };
- })();
- function hex2RGB(h) {
- var o = h.slice(h[0]==="#"?1:0).slice(0,6);
- return [parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16)];
- }
- function rgb2Hex(rgb) {
- for(var i=0,o=1; i!=3; ++i) o = o*256 + (rgb[i]>255?255:rgb[i]<0?0:rgb[i]);
- return o.toString(16).toUpperCase().slice(1);
- }
-
- function rgb2HSL(rgb) {
- var R = rgb[0]/255, G = rgb[1]/255, B=rgb[2]/255;
- var M = Math.max(R, G, B), m = Math.min(R, G, B), C = M - m;
- if(C === 0) return [0, 0, R];
-
- var H6 = 0, S = 0, L2 = (M + m);
- S = C / (L2 > 1 ? 2 - L2 : L2);
- switch(M){
- case R: H6 = ((G - B) / C + 6)%6; break;
- case G: H6 = ((B - R) / C + 2); break;
- case B: H6 = ((R - G) / C + 4); break;
- }
- return [H6 / 6, S, L2 / 2];
- }
-
- function hsl2RGB(hsl){
- var H = hsl[0], S = hsl[1], L = hsl[2];
- var C = S * 2 * (L < 0.5 ? L : 1 - L), m = L - C/2;
- var rgb = [m,m,m], h6 = 6*H;
-
- var X;
- if(S !== 0) switch(h6|0) {
- case 0: case 6: X = C * h6; rgb[0] += C; rgb[1] += X; break;
- case 1: X = C * (2 - h6); rgb[0] += X; rgb[1] += C; break;
- case 2: X = C * (h6 - 2); rgb[1] += C; rgb[2] += X; break;
- case 3: X = C * (4 - h6); rgb[1] += X; rgb[2] += C; break;
- case 4: X = C * (h6 - 4); rgb[2] += C; rgb[0] += X; break;
- case 5: X = C * (6 - h6); rgb[2] += X; rgb[0] += C; break;
- }
- for(var i = 0; i != 3; ++i) rgb[i] = Math.round(rgb[i]*255);
- return rgb;
- }
-
- /* 18.8.3 bgColor tint algorithm */
- function rgb_tint(hex, tint) {
- if(tint === 0) return hex;
- var hsl = rgb2HSL(hex2RGB(hex));
- if (tint < 0) hsl[2] = hsl[2] * (1 + tint);
- else hsl[2] = 1 - (1 - hsl[2]) * (1 - tint);
- return rgb2Hex(hsl2RGB(hsl));
- }
-
- /* 18.3.1.13 width calculations */
- /* [MS-OI29500] 2.1.595 Column Width & Formatting */
- var DEF_MDW = 6, MAX_MDW = 15, MIN_MDW = 1, MDW = DEF_MDW;
- function width2px(width) { return Math.floor(( width + (Math.round(128/MDW))/256 )* MDW ); }
- function px2char(px) { return (Math.floor((px - 5)/MDW * 100 + 0.5))/100; }
- function char2width(chr) { return (Math.round((chr * MDW + 5)/MDW*256))/256; }
- //function px2char_(px) { return (((px - 5)/MDW * 100 + 0.5))/100; }
- //function char2width_(chr) { return (((chr * MDW + 5)/MDW*256))/256; }
- function cycle_width(collw) { return char2width(px2char(width2px(collw))); }
- /* XLSX/XLSB/XLS specify width in units of MDW */
- function find_mdw_colw(collw) {
- var delta = Math.abs(collw - cycle_width(collw)), _MDW = MDW;
- if(delta > 0.005) for(MDW=MIN_MDW; MDW<MAX_MDW; ++MDW) if(Math.abs(collw - cycle_width(collw)) <= delta) { delta = Math.abs(collw - cycle_width(collw)); _MDW = MDW; }
- MDW = _MDW;
- }
- /* XLML specifies width in terms of pixels */
- /*function find_mdw_wpx(wpx) {
- var delta = Infinity, guess = 0, _MDW = MIN_MDW;
- for(MDW=MIN_MDW; MDW<MAX_MDW; ++MDW) {
- guess = char2width_(px2char_(wpx))*256;
- guess = (guess) % 1;
- if(guess > 0.5) guess--;
- if(Math.abs(guess) < delta) { delta = Math.abs(guess); _MDW = MDW; }
- }
- MDW = _MDW;
- }*/
-
- function process_col(coll) {
- if(coll.width) {
- coll.wpx = width2px(coll.width);
- coll.wch = px2char(coll.wpx);
- coll.MDW = MDW;
- } else if(coll.wpx) {
- coll.wch = px2char(coll.wpx);
- coll.width = char2width(coll.wch);
- coll.MDW = MDW;
- } else if(typeof coll.wch == 'number') {
- coll.width = char2width(coll.wch);
- coll.wpx = width2px(coll.width);
- coll.MDW = MDW;
- }
- if(coll.customWidth) delete coll.customWidth;
- }
-
- var DEF_PPI = 96, PPI = DEF_PPI;
- function px2pt(px) { return px * 96 / PPI; }
- function pt2px(pt) { return pt * PPI / 96; }
-
- /* [MS-EXSPXML3] 2.4.54 ST_enmPattern */
- var XLMLPatternTypeMap = {
- "None": "none",
- "Solid": "solid",
- "Gray50": "mediumGray",
- "Gray75": "darkGray",
- "Gray25": "lightGray",
- "HorzStripe": "darkHorizontal",
- "VertStripe": "darkVertical",
- "ReverseDiagStripe": "darkDown",
- "DiagStripe": "darkUp",
- "DiagCross": "darkGrid",
- "ThickDiagCross": "darkTrellis",
- "ThinHorzStripe": "lightHorizontal",
- "ThinVertStripe": "lightVertical",
- "ThinReverseDiagStripe": "lightDown",
- "ThinHorzCross": "lightGrid"
- };
-
- /* 18.8.5 borders CT_Borders */
- function parse_borders(t, styles, themes, opts) {
- styles.Borders = [];
- var border = {};
- var pass = false;
- (t[0].match(tagregex)||[]).forEach(function(x) {
- var y = parsexmltag(x);
- switch(strip_ns(y[0])) {
- case '<borders': case '<borders>': case '</borders>': break;
-
- /* 18.8.4 border CT_Border */
- case '<border': case '<border>': case '<border/>':
- border = {};
- if(y.diagonalUp) border.diagonalUp = parsexmlbool(y.diagonalUp);
- if(y.diagonalDown) border.diagonalDown = parsexmlbool(y.diagonalDown);
- styles.Borders.push(border);
- break;
- case '</border>': break;
-
- /* note: not in spec, appears to be CT_BorderPr */
- case '<left/>': break;
- case '<left': case '<left>': break;
- case '</left>': break;
-
- /* note: not in spec, appears to be CT_BorderPr */
- case '<right/>': break;
- case '<right': case '<right>': break;
- case '</right>': break;
-
- /* 18.8.43 top CT_BorderPr */
- case '<top/>': break;
- case '<top': case '<top>': break;
- case '</top>': break;
-
- /* 18.8.6 bottom CT_BorderPr */
- case '<bottom/>': break;
- case '<bottom': case '<bottom>': break;
- case '</bottom>': break;
-
- /* 18.8.13 diagonal CT_BorderPr */
- case '<diagonal': case '<diagonal>': case '<diagonal/>': break;
- case '</diagonal>': break;
-
- /* 18.8.25 horizontal CT_BorderPr */
- case '<horizontal': case '<horizontal>': case '<horizontal/>': break;
- case '</horizontal>': break;
-
- /* 18.8.44 vertical CT_BorderPr */
- case '<vertical': case '<vertical>': case '<vertical/>': break;
- case '</vertical>': break;
-
- /* 18.8.37 start CT_BorderPr */
- case '<start': case '<start>': case '<start/>': break;
- case '</start>': break;
-
- /* 18.8.16 end CT_BorderPr */
- case '<end': case '<end>': case '<end/>': break;
- case '</end>': break;
-
- /* 18.8.? color CT_Color */
- case '<color': case '<color>':
- break;
- case '<color/>': case '</color>': break;
-
- /* 18.2.10 extLst CT_ExtensionList ? */
- case '<extLst': case '<extLst>': case '</extLst>': break;
- case '<ext': pass = true; break;
- case '</ext>': pass = false; break;
- default: if(opts && opts.WTF) {
- if(!pass) throw new Error('unrecognized ' + y[0] + ' in borders');
- }
- }
- });
- }
-
- /* 18.8.21 fills CT_Fills */
- function parse_fills(t, styles, themes, opts) {
- styles.Fills = [];
- var fill = {};
- var pass = false;
- (t[0].match(tagregex)||[]).forEach(function(x) {
- var y = parsexmltag(x);
- switch(strip_ns(y[0])) {
- case '<fills': case '<fills>': case '</fills>': break;
-
- /* 18.8.20 fill CT_Fill */
- case '<fill>': case '<fill': case '<fill/>':
- fill = {}; styles.Fills.push(fill); break;
- case '</fill>': break;
-
- /* 18.8.24 gradientFill CT_GradientFill */
- case '<gradientFill>': break;
- case '<gradientFill':
- case '</gradientFill>': styles.Fills.push(fill); fill = {}; break;
-
- /* 18.8.32 patternFill CT_PatternFill */
- case '<patternFill': case '<patternFill>':
- if(y.patternType) fill.patternType = y.patternType;
- break;
- case '<patternFill/>': case '</patternFill>': break;
-
- /* 18.8.3 bgColor CT_Color */
- case '<bgColor':
- if(!fill.bgColor) fill.bgColor = {};
- if(y.indexed) fill.bgColor.indexed = parseInt(y.indexed, 10);
- if(y.theme) fill.bgColor.theme = parseInt(y.theme, 10);
- if(y.tint) fill.bgColor.tint = parseFloat(y.tint);
- /* Excel uses ARGB strings */
- if(y.rgb) fill.bgColor.rgb = y.rgb.slice(-6);
- break;
- case '<bgColor/>': case '</bgColor>': break;
-
- /* 18.8.19 fgColor CT_Color */
- case '<fgColor':
- if(!fill.fgColor) fill.fgColor = {};
- if(y.theme) fill.fgColor.theme = parseInt(y.theme, 10);
- if(y.tint) fill.fgColor.tint = parseFloat(y.tint);
- /* Excel uses ARGB strings */
- if(y.rgb != null) fill.fgColor.rgb = y.rgb.slice(-6);
- break;
- case '<fgColor/>': case '</fgColor>': break;
-
- /* 18.8.38 stop CT_GradientStop */
- case '<stop': case '<stop/>': break;
- case '</stop>': break;
-
- /* 18.8.? color CT_Color */
- case '<color': case '<color/>': break;
- case '</color>': break;
-
- /* 18.2.10 extLst CT_ExtensionList ? */
- case '<extLst': case '<extLst>': case '</extLst>': break;
- case '<ext': pass = true; break;
- case '</ext>': pass = false; break;
- default: if(opts && opts.WTF) {
- if(!pass) throw new Error('unrecognized ' + y[0] + ' in fills');
- }
- }
- });
- }
-
- /* 18.8.23 fonts CT_Fonts */
- function parse_fonts(t, styles, themes, opts) {
- styles.Fonts = [];
- var font = {};
- var pass = false;
- (t[0].match(tagregex)||[]).forEach(function(x) {
- var y = parsexmltag(x);
- switch(strip_ns(y[0])) {
- case '<fonts': case '<fonts>': case '</fonts>': break;
-
- /* 18.8.22 font CT_Font */
- case '<font': case '<font>': break;
- case '</font>': case '<font/>':
- styles.Fonts.push(font);
- font = {};
- break;
-
- /* 18.8.29 name CT_FontName */
- case '<name': if(y.val) font.name = y.val; break;
- case '<name/>': case '</name>': break;
-
- /* 18.8.2 b CT_BooleanProperty */
- case '<b': font.bold = y.val ? parsexmlbool(y.val) : 1; break;
- case '<b/>': font.bold = 1; break;
-
- /* 18.8.26 i CT_BooleanProperty */
- case '<i': font.italic = y.val ? parsexmlbool(y.val) : 1; break;
- case '<i/>': font.italic = 1; break;
-
- /* 18.4.13 u CT_UnderlineProperty */
- case '<u':
- switch(y.val) {
- case "none": font.underline = 0x00; break;
- case "single": font.underline = 0x01; break;
- case "double": font.underline = 0x02; break;
- case "singleAccounting": font.underline = 0x21; break;
- case "doubleAccounting": font.underline = 0x22; break;
- } break;
- case '<u/>': font.underline = 1; break;
-
- /* 18.4.10 strike CT_BooleanProperty */
- case '<strike': font.strike = y.val ? parsexmlbool(y.val) : 1; break;
- case '<strike/>': font.strike = 1; break;
-
- /* 18.4.2 outline CT_BooleanProperty */
- case '<outline': font.outline = y.val ? parsexmlbool(y.val) : 1; break;
- case '<outline/>': font.outline = 1; break;
-
- /* 18.8.36 shadow CT_BooleanProperty */
- case '<shadow': font.shadow = y.val ? parsexmlbool(y.val) : 1; break;
- case '<shadow/>': font.shadow = 1; break;
-
- /* 18.8.12 condense CT_BooleanProperty */
- case '<condense': font.condense = y.val ? parsexmlbool(y.val) : 1; break;
- case '<condense/>': font.condense = 1; break;
-
- /* 18.8.17 extend CT_BooleanProperty */
- case '<extend': font.extend = y.val ? parsexmlbool(y.val) : 1; break;
- case '<extend/>': font.extend = 1; break;
-
- /* 18.4.11 sz CT_FontSize */
- case '<sz': if(y.val) font.sz = +y.val; break;
- case '<sz/>': case '</sz>': break;
-
- /* 18.4.14 vertAlign CT_VerticalAlignFontProperty */
- case '<vertAlign': if(y.val) font.vertAlign = y.val; break;
- case '<vertAlign/>': case '</vertAlign>': break;
-
- /* 18.8.18 family CT_FontFamily */
- case '<family': if(y.val) font.family = parseInt(y.val,10); break;
- case '<family/>': case '</family>': break;
-
- /* 18.8.35 scheme CT_FontScheme */
- case '<scheme': if(y.val) font.scheme = y.val; break;
- case '<scheme/>': case '</scheme>': break;
-
- /* 18.4.1 charset CT_IntProperty */
- case '<charset':
- if(y.val == '1') break;
- y.codepage = CS2CP[parseInt(y.val, 10)];
- break;
-
- /* 18.?.? color CT_Color */
- case '<color':
- if(!font.color) font.color = {};
- if(y.auto) font.color.auto = parsexmlbool(y.auto);
-
- if(y.rgb) font.color.rgb = y.rgb.slice(-6);
- else if(y.indexed) {
- font.color.index = parseInt(y.indexed, 10);
- var icv = XLSIcv[font.color.index];
- if(font.color.index == 81) icv = XLSIcv[1];
- if(!icv) throw new Error(x);
- font.color.rgb = icv[0].toString(16) + icv[1].toString(16) + icv[2].toString(16);
- } else if(y.theme) {
- font.color.theme = parseInt(y.theme, 10);
- if(y.tint) font.color.tint = parseFloat(y.tint);
- if(y.theme && themes.themeElements && themes.themeElements.clrScheme) {
- font.color.rgb = rgb_tint(themes.themeElements.clrScheme[font.color.theme].rgb, font.color.tint || 0);
- }
- }
-
- break;
- case '<color/>': case '</color>': break;
-
- /* note: sometimes mc:AlternateContent appears bare */
- case '<AlternateContent': pass = true; break;
- case '</AlternateContent>': pass = false; break;
-
- /* 18.2.10 extLst CT_ExtensionList ? */
- case '<extLst': case '<extLst>': case '</extLst>': break;
- case '<ext': pass = true; break;
- case '</ext>': pass = false; break;
- default: if(opts && opts.WTF) {
- if(!pass) throw new Error('unrecognized ' + y[0] + ' in fonts');
- }
- }
- });
- }
-
- /* 18.8.31 numFmts CT_NumFmts */
- function parse_numFmts(t, styles, opts) {
- styles.NumberFmt = [];
- var k/*Array<number>*/ = (keys(SSF._table));
- for(var i=0; i < k.length; ++i) styles.NumberFmt[k[i]] = SSF._table[k[i]];
- var m = t[0].match(tagregex);
- if(!m) return;
- for(i=0; i < m.length; ++i) {
- var y = parsexmltag(m[i]);
- switch(strip_ns(y[0])) {
- case '<numFmts': case '</numFmts>': case '<numFmts/>': case '<numFmts>': break;
- case '<numFmt': {
- var f=unescapexml(utf8read(y.formatCode)), j=parseInt(y.numFmtId,10);
- styles.NumberFmt[j] = f;
- if(j>0) {
- if(j > 0x188) {
- for(j = 0x188; j > 0x3c; --j) if(styles.NumberFmt[j] == null) break;
- styles.NumberFmt[j] = f;
- }
- SSF.load(f,j);
- }
- } break;
- case '</numFmt>': break;
- default: if(opts.WTF) throw new Error('unrecognized ' + y[0] + ' in numFmts');
- }
- }
- }
-
- function write_numFmts(NF) {
- var o = ["<numFmts>"];
- [[5,8],[23,26],[41,44],[/*63*/50,/*66],[164,*/392]].forEach(function(r) {
- for(var i = r[0]; i <= r[1]; ++i) if(NF[i] != null) o[o.length] = (writextag('numFmt',null,{numFmtId:i,formatCode:escapexml(NF[i])}));
- });
- if(o.length === 1) return "";
- o[o.length] = ("</numFmts>");
- o[0] = writextag('numFmts', null, { count:o.length-2 }).replace("/>", ">");
- return o.join("");
- }
-
- /* 18.8.10 cellXfs CT_CellXfs */
- var cellXF_uint = [ "numFmtId", "fillId", "fontId", "borderId", "xfId" ];
- var cellXF_bool = [ "applyAlignment", "applyBorder", "applyFill", "applyFont", "applyNumberFormat", "applyProtection", "pivotButton", "quotePrefix" ];
- function parse_cellXfs(t, styles, opts) {
- styles.CellXf = [];
- var xf;
- var pass = false;
- (t[0].match(tagregex)||[]).forEach(function(x) {
- var y = parsexmltag(x), i = 0;
- switch(strip_ns(y[0])) {
- case '<cellXfs': case '<cellXfs>': case '<cellXfs/>': case '</cellXfs>': break;
-
- /* 18.8.45 xf CT_Xf */
- case '<xf': case '<xf/>':
- xf = y;
- delete xf[0];
- for(i = 0; i < cellXF_uint.length; ++i) if(xf[cellXF_uint[i]])
- xf[cellXF_uint[i]] = parseInt(xf[cellXF_uint[i]], 10);
- for(i = 0; i < cellXF_bool.length; ++i) if(xf[cellXF_bool[i]])
- xf[cellXF_bool[i]] = parsexmlbool(xf[cellXF_bool[i]]);
- if(xf.numFmtId > 0x188) {
- for(i = 0x188; i > 0x3c; --i) if(styles.NumberFmt[xf.numFmtId] == styles.NumberFmt[i]) { xf.numFmtId = i; break; }
- }
- styles.CellXf.push(xf); break;
- case '</xf>': break;
-
- /* 18.8.1 alignment CT_CellAlignment */
- case '<alignment': case '<alignment/>':
- var alignment = {};
- if(y.vertical) alignment.vertical = y.vertical;
- if(y.horizontal) alignment.horizontal = y.horizontal;
- if(y.textRotation != null) alignment.textRotation = y.textRotation;
- if(y.indent) alignment.indent = y.indent;
- if(y.wrapText) alignment.wrapText = parsexmlbool(y.wrapText);
- xf.alignment = alignment;
- break;
- case '</alignment>': break;
-
- /* 18.8.33 protection CT_CellProtection */
- case '<protection':
- break;
- case '</protection>': case '<protection/>': break;
-
- /* note: sometimes mc:AlternateContent appears bare */
- case '<AlternateContent': pass = true; break;
- case '</AlternateContent>': pass = false; break;
-
- /* 18.2.10 extLst CT_ExtensionList ? */
- case '<extLst': case '<extLst>': case '</extLst>': break;
- case '<ext': pass = true; break;
- case '</ext>': pass = false; break;
- default: if(opts && opts.WTF) {
- if(!pass) throw new Error('unrecognized ' + y[0] + ' in cellXfs');
- }
- }
- });
- }
-
- function write_cellXfs(cellXfs) {
- var o = [];
- o[o.length] = (writextag('cellXfs',null));
- cellXfs.forEach(function(c) {
- o[o.length] = (writextag('xf', null, c));
- });
- o[o.length] = ("</cellXfs>");
- if(o.length === 2) return "";
- o[0] = writextag('cellXfs',null, {count:o.length-2}).replace("/>",">");
- return o.join("");
- }
-
- /* 18.8 Styles CT_Stylesheet*/
- var parse_sty_xml= (function make_pstyx() {
- var numFmtRegex = /<(?:\w+:)?numFmts([^>]*)>[\S\s]*?<\/(?:\w+:)?numFmts>/;
- var cellXfRegex = /<(?:\w+:)?cellXfs([^>]*)>[\S\s]*?<\/(?:\w+:)?cellXfs>/;
- var fillsRegex = /<(?:\w+:)?fills([^>]*)>[\S\s]*?<\/(?:\w+:)?fills>/;
- var fontsRegex = /<(?:\w+:)?fonts([^>]*)>[\S\s]*?<\/(?:\w+:)?fonts>/;
- var bordersRegex = /<(?:\w+:)?borders([^>]*)>[\S\s]*?<\/(?:\w+:)?borders>/;
-
- return function parse_sty_xml(data, themes, opts) {
- var styles = {};
- if(!data) return styles;
- data = data.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");
- /* 18.8.39 styleSheet CT_Stylesheet */
- var t;
-
- /* 18.8.31 numFmts CT_NumFmts ? */
- if((t=data.match(numFmtRegex))) parse_numFmts(t, styles, opts);
-
- /* 18.8.23 fonts CT_Fonts ? */
- if((t=data.match(fontsRegex))) parse_fonts(t, styles, themes, opts);
-
- /* 18.8.21 fills CT_Fills ? */
- if((t=data.match(fillsRegex))) parse_fills(t, styles, themes, opts);
-
- /* 18.8.5 borders CT_Borders ? */
- if((t=data.match(bordersRegex))) parse_borders(t, styles, themes, opts);
-
- /* 18.8.9 cellStyleXfs CT_CellStyleXfs ? */
-
- /* 18.8.10 cellXfs CT_CellXfs ? */
- if((t=data.match(cellXfRegex))) parse_cellXfs(t, styles, opts);
-
- /* 18.8.8 cellStyles CT_CellStyles ? */
- /* 18.8.15 dxfs CT_Dxfs ? */
- /* 18.8.42 tableStyles CT_TableStyles ? */
- /* 18.8.11 colors CT_Colors ? */
- /* 18.2.10 extLst CT_ExtensionList ? */
-
- return styles;
- };
- })();
-
- var STYLES_XML_ROOT = writextag('styleSheet', null, {
- 'xmlns': XMLNS.main[0],
- 'xmlns:vt': XMLNS.vt
- });
-
- RELS.STY = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles";
-
- function write_sty_xml(wb, opts) {
- var o = [XML_HEADER, STYLES_XML_ROOT], w;
- if(wb.SSF && (w = write_numFmts(wb.SSF)) != null) o[o.length] = w;
- o[o.length] = ('<fonts count="1"><font><sz val="12"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font></fonts>');
- o[o.length] = ('<fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills>');
- o[o.length] = ('<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>');
- o[o.length] = ('<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>');
- if((w = write_cellXfs(opts.cellXfs))) o[o.length] = (w);
- o[o.length] = ('<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>');
- o[o.length] = ('<dxfs count="0"/>');
- o[o.length] = ('<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4"/>');
-
- if(o.length>2){ o[o.length] = ('</styleSheet>'); o[1]=o[1].replace("/>",">"); }
- return o.join("");
- }
- /* [MS-XLSB] 2.4.657 BrtFmt */
- function parse_BrtFmt(data, length) {
- var numFmtId = data.read_shift(2);
- var stFmtCode = parse_XLWideString(data,length-2);
- return [numFmtId, stFmtCode];
- }
- function write_BrtFmt(i, f, o) {
- if(!o) o = new_buf(6 + 4 * f.length);
- o.write_shift(2, i);
- write_XLWideString(f, o);
- var out = (o.length > o.l) ? o.slice(0, o.l) : o;
- if(o.l == null) o.l = o.length;
- return out;
- }
-
- /* [MS-XLSB] 2.4.659 BrtFont TODO */
- function parse_BrtFont(data, length, opts) {
- var out = ({});
-
- out.sz = data.read_shift(2) / 20;
-
- var grbit = parse_FontFlags(data, 2, opts);
- if(grbit.fItalic) out.italic = 1;
- if(grbit.fCondense) out.condense = 1;
- if(grbit.fExtend) out.extend = 1;
- if(grbit.fShadow) out.shadow = 1;
- if(grbit.fOutline) out.outline = 1;
- if(grbit.fStrikeout) out.strike = 1;
-
- var bls = data.read_shift(2);
- if(bls === 0x02BC) out.bold = 1;
-
- switch(data.read_shift(2)) {
- /* case 0: out.vertAlign = "baseline"; break; */
- case 1: out.vertAlign = "superscript"; break;
- case 2: out.vertAlign = "subscript"; break;
- }
-
- var underline = data.read_shift(1);
- if(underline != 0) out.underline = underline;
-
- var family = data.read_shift(1);
- if(family > 0) out.family = family;
-
- var bCharSet = data.read_shift(1);
- if(bCharSet > 0) out.charset = bCharSet;
-
- data.l++;
- out.color = parse_BrtColor(data, 8);
-
- switch(data.read_shift(1)) {
- /* case 0: out.scheme = "none": break; */
- case 1: out.scheme = "major"; break;
- case 2: out.scheme = "minor"; break;
- }
-
- out.name = parse_XLWideString(data, length - 21);
-
- return out;
- }
- function write_BrtFont(font, o) {
- if(!o) o = new_buf(25+4*32);
- o.write_shift(2, font.sz * 20);
- write_FontFlags(font, o);
- o.write_shift(2, font.bold ? 0x02BC : 0x0190);
- var sss = 0;
- if(font.vertAlign == "superscript") sss = 1;
- else if(font.vertAlign == "subscript") sss = 2;
- o.write_shift(2, sss);
- o.write_shift(1, font.underline || 0);
- o.write_shift(1, font.family || 0);
- o.write_shift(1, font.charset || 0);
- o.write_shift(1, 0);
- write_BrtColor(font.color, o);
- var scheme = 0;
- if(font.scheme == "major") scheme = 1;
- if(font.scheme == "minor") scheme = 2;
- o.write_shift(1, scheme);
- write_XLWideString(font.name, o);
- return o.length > o.l ? o.slice(0, o.l) : o;
- }
-
- /* [MS-XLSB] 2.4.650 BrtFill */
- var XLSBFillPTNames = [
- "none",
- "solid",
- "mediumGray",
- "darkGray",
- "lightGray",
- "darkHorizontal",
- "darkVertical",
- "darkDown",
- "darkUp",
- "darkGrid",
- "darkTrellis",
- "lightHorizontal",
- "lightVertical",
- "lightDown",
- "lightUp",
- "lightGrid",
- "lightTrellis",
- "gray125",
- "gray0625"
- ];
- var rev_XLSBFillPTNames = (evert(XLSBFillPTNames));
- /* TODO: gradient fill representation */
- var parse_BrtFill = parsenoop;
- function write_BrtFill(fill, o) {
- if(!o) o = new_buf(4*3 + 8*7 + 16*1);
- var fls = rev_XLSBFillPTNames[fill.patternType];
- if(fls == null) fls = 0x28;
- o.write_shift(4, fls);
- var j = 0;
- if(fls != 0x28) {
- /* TODO: custom FG Color */
- write_BrtColor({auto:1}, o);
- /* TODO: custom BG Color */
- write_BrtColor({auto:1}, o);
-
- for(; j < 12; ++j) o.write_shift(4, 0);
- } else {
- for(; j < 4; ++j) o.write_shift(4, 0);
-
- for(; j < 12; ++j) o.write_shift(4, 0); /* TODO */
- /* iGradientType */
- /* xnumDegree */
- /* xnumFillToLeft */
- /* xnumFillToRight */
- /* xnumFillToTop */
- /* xnumFillToBottom */
- /* cNumStop */
- /* xfillGradientStop */
- }
- return o.length > o.l ? o.slice(0, o.l) : o;
- }
-
- /* [MS-XLSB] 2.4.824 BrtXF */
- function parse_BrtXF(data, length) {
- var tgt = data.l + length;
- var ixfeParent = data.read_shift(2);
- var ifmt = data.read_shift(2);
- data.l = tgt;
- return {ixfe:ixfeParent, numFmtId:ifmt };
- }
- function write_BrtXF(data, ixfeP, o) {
- if(!o) o = new_buf(16);
- o.write_shift(2, ixfeP||0);
- o.write_shift(2, data.numFmtId||0);
- o.write_shift(2, 0); /* iFont */
- o.write_shift(2, 0); /* iFill */
- o.write_shift(2, 0); /* ixBorder */
- o.write_shift(1, 0); /* trot */
- o.write_shift(1, 0); /* indent */
- var flow = 0;
- o.write_shift(1, flow); /* flags */
- o.write_shift(1, 0); /* flags */
- o.write_shift(1, 0); /* xfGrbitAtr */
- o.write_shift(1, 0);
- return o;
- }
-
- /* [MS-XLSB] 2.5.4 Blxf TODO */
- function write_Blxf(data, o) {
- if(!o) o = new_buf(10);
- o.write_shift(1, 0); /* dg */
- o.write_shift(1, 0);
- o.write_shift(4, 0); /* color */
- o.write_shift(4, 0); /* color */
- return o;
- }
- /* [MS-XLSB] 2.4.302 BrtBorder TODO */
- var parse_BrtBorder = parsenoop;
- function write_BrtBorder(border, o) {
- if(!o) o = new_buf(51);
- o.write_shift(1, 0); /* diagonal */
- write_Blxf(null, o); /* top */
- write_Blxf(null, o); /* bottom */
- write_Blxf(null, o); /* left */
- write_Blxf(null, o); /* right */
- write_Blxf(null, o); /* diag */
- return o.length > o.l ? o.slice(0, o.l) : o;
- }
-
- /* [MS-XLSB] 2.4.763 BrtStyle TODO */
- function write_BrtStyle(style, o) {
- if(!o) o = new_buf(12+4*10);
- o.write_shift(4, style.xfId);
- o.write_shift(2, 1);
- o.write_shift(1, +style.builtinId);
- o.write_shift(1, 0); /* iLevel */
- write_XLNullableWideString(style.name || "", o);
- return o.length > o.l ? o.slice(0, o.l) : o;
- }
-
- /* [MS-XLSB] 2.4.272 BrtBeginTableStyles */
- function write_BrtBeginTableStyles(cnt, defTableStyle, defPivotStyle) {
- var o = new_buf(4+256*2*4);
- o.write_shift(4, cnt);
- write_XLNullableWideString(defTableStyle, o);
- write_XLNullableWideString(defPivotStyle, o);
- return o.length > o.l ? o.slice(0, o.l) : o;
- }
-
- /* [MS-XLSB] 2.1.7.50 Styles */
- function parse_sty_bin(data, themes, opts) {
- var styles = {};
- styles.NumberFmt = ([]);
- for(var y in SSF._table) styles.NumberFmt[y] = SSF._table[y];
-
- styles.CellXf = [];
- styles.Fonts = [];
- var state = [];
- var pass = false;
- recordhopper(data, function hopper_sty(val, R_n, RT) {
- switch(RT) {
- case 0x002C: /* 'BrtFmt' */
- styles.NumberFmt[val[0]] = val[1]; SSF.load(val[1], val[0]);
- break;
- case 0x002B: /* 'BrtFont' */
- styles.Fonts.push(val);
- if(val.color.theme != null && themes && themes.themeElements && themes.themeElements.clrScheme) {
- val.color.rgb = rgb_tint(themes.themeElements.clrScheme[val.color.theme].rgb, val.color.tint || 0);
- }
- break;
- case 0x0401: /* 'BrtKnownFonts' */ break;
- case 0x002D: /* 'BrtFill' */
- break;
- case 0x002E: /* 'BrtBorder' */
- break;
- case 0x002F: /* 'BrtXF' */
- if(state[state.length - 1] == "BrtBeginCellXFs") {
- styles.CellXf.push(val);
- }
- break;
- case 0x0030: /* 'BrtStyle' */
- case 0x01FB: /* 'BrtDXF' */
- case 0x023C: /* 'BrtMRUColor' */
- case 0x01DB: /* 'BrtIndexedColor': */
- break;
-
- case 0x0493: /* 'BrtDXF14' */
- case 0x0836: /* 'BrtDXF15' */
- case 0x046A: /* 'BrtSlicerStyleElement' */
- case 0x0200: /* 'BrtTableStyleElement' */
- case 0x082F: /* 'BrtTimelineStyleElement' */
- case 0x0C00: /* 'BrtUid' */
- break;
-
- case 0x0023: /* 'BrtFRTBegin' */
- pass = true; break;
- case 0x0024: /* 'BrtFRTEnd' */
- pass = false; break;
- case 0x0025: /* 'BrtACBegin' */
- state.push(R_n); pass = true; break;
- case 0x0026: /* 'BrtACEnd' */
- state.pop(); pass = false; break;
-
- default:
- if((R_n||"").indexOf("Begin") > 0) state.push(R_n);
- else if((R_n||"").indexOf("End") > 0) state.pop();
- else if(!pass || (opts.WTF && state[state.length-1] != "BrtACBegin")) throw new Error("Unexpected record " + RT + " " + R_n);
- }
- });
- return styles;
- }
-
- function write_FMTS_bin(ba, NF) {
- if(!NF) return;
- var cnt = 0;
- [[5,8],[23,26],[41,44],[/*63*/50,/*66],[164,*/392]].forEach(function(r) {
- for(var i = r[0]; i <= r[1]; ++i) if(NF[i] != null) ++cnt;
- });
-
- if(cnt == 0) return;
- write_record(ba, "BrtBeginFmts", write_UInt32LE(cnt));
- [[5,8],[23,26],[41,44],[/*63*/50,/*66],[164,*/392]].forEach(function(r) {
- for(var i = r[0]; i <= r[1]; ++i) if(NF[i] != null) write_record(ba, "BrtFmt", write_BrtFmt(i, NF[i]));
- });
- write_record(ba, "BrtEndFmts");
- }
-
- function write_FONTS_bin(ba) {
- var cnt = 1;
-
- if(cnt == 0) return;
- write_record(ba, "BrtBeginFonts", write_UInt32LE(cnt));
- write_record(ba, "BrtFont", write_BrtFont({
- sz:12,
- color: {theme:1},
- name: "Calibri",
- family: 2,
- scheme: "minor"
- }));
- /* 1*65491BrtFont [ACFONTS] */
- write_record(ba, "BrtEndFonts");
- }
-
- function write_FILLS_bin(ba) {
- var cnt = 2;
-
- if(cnt == 0) return;
- write_record(ba, "BrtBeginFills", write_UInt32LE(cnt));
- write_record(ba, "BrtFill", write_BrtFill({patternType:"none"}));
- write_record(ba, "BrtFill", write_BrtFill({patternType:"gray125"}));
- /* 1*65431BrtFill */
- write_record(ba, "BrtEndFills");
- }
-
- function write_BORDERS_bin(ba) {
- var cnt = 1;
-
- if(cnt == 0) return;
- write_record(ba, "BrtBeginBorders", write_UInt32LE(cnt));
- write_record(ba, "BrtBorder", write_BrtBorder({}));
- /* 1*65430BrtBorder */
- write_record(ba, "BrtEndBorders");
- }
-
- function write_CELLSTYLEXFS_bin(ba) {
- var cnt = 1;
- write_record(ba, "BrtBeginCellStyleXFs", write_UInt32LE(cnt));
- write_record(ba, "BrtXF", write_BrtXF({
- numFmtId: 0,
- fontId: 0,
- fillId: 0,
- borderId: 0
- }, 0xFFFF));
- /* 1*65430(BrtXF *FRT) */
- write_record(ba, "BrtEndCellStyleXFs");
- }
-
- function write_CELLXFS_bin(ba, data) {
- write_record(ba, "BrtBeginCellXFs", write_UInt32LE(data.length));
- data.forEach(function(c) { write_record(ba, "BrtXF", write_BrtXF(c,0)); });
- /* 1*65430(BrtXF *FRT) */
- write_record(ba, "BrtEndCellXFs");
- }
-
- function write_STYLES_bin(ba) {
- var cnt = 1;
-
- write_record(ba, "BrtBeginStyles", write_UInt32LE(cnt));
- write_record(ba, "BrtStyle", write_BrtStyle({
- xfId:0,
- builtinId:0,
- name:"Normal"
- }));
- /* 1*65430(BrtStyle *FRT) */
- write_record(ba, "BrtEndStyles");
- }
-
- function write_DXFS_bin(ba) {
- var cnt = 0;
-
- write_record(ba, "BrtBeginDXFs", write_UInt32LE(cnt));
- /* *2147483647(BrtDXF *FRT) */
- write_record(ba, "BrtEndDXFs");
- }
-
- function write_TABLESTYLES_bin(ba) {
- var cnt = 0;
-
- write_record(ba, "BrtBeginTableStyles", write_BrtBeginTableStyles(cnt, "TableStyleMedium9", "PivotStyleMedium4"));
- /* *TABLESTYLE */
- write_record(ba, "BrtEndTableStyles");
- }
-
- function write_COLORPALETTE_bin() {
- return;
- /* BrtBeginColorPalette [INDEXEDCOLORS] [MRUCOLORS] BrtEndColorPalette */
- }
-
- /* [MS-XLSB] 2.1.7.50 Styles */
- function write_sty_bin(wb, opts) {
- var ba = buf_array();
- write_record(ba, "BrtBeginStyleSheet");
- write_FMTS_bin(ba, wb.SSF);
- write_FONTS_bin(ba, wb);
- write_FILLS_bin(ba, wb);
- write_BORDERS_bin(ba, wb);
- write_CELLSTYLEXFS_bin(ba, wb);
- write_CELLXFS_bin(ba, opts.cellXfs);
- write_STYLES_bin(ba, wb);
- write_DXFS_bin(ba, wb);
- write_TABLESTYLES_bin(ba, wb);
- write_COLORPALETTE_bin(ba, wb);
- /* FRTSTYLESHEET*/
- write_record(ba, "BrtEndStyleSheet");
- return ba.end();
- }
- RELS.THEME = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";
-
- /* 20.1.6.2 clrScheme CT_ColorScheme */
- function parse_clrScheme(t, themes, opts) {
- themes.themeElements.clrScheme = [];
- var color = {};
- (t[0].match(tagregex)||[]).forEach(function(x) {
- var y = parsexmltag(x);
- switch(y[0]) {
- /* 20.1.6.2 clrScheme (Color Scheme) CT_ColorScheme */
- case '<a:clrScheme': case '</a:clrScheme>': break;
-
- /* 20.1.2.3.32 srgbClr CT_SRgbColor */
- case '<a:srgbClr':
- color.rgb = y.val; break;
-
- /* 20.1.2.3.33 sysClr CT_SystemColor */
- case '<a:sysClr':
- color.rgb = y.lastClr; break;
-
- /* 20.1.4.1.1 accent1 (Accent 1) */
- /* 20.1.4.1.2 accent2 (Accent 2) */
- /* 20.1.4.1.3 accent3 (Accent 3) */
- /* 20.1.4.1.4 accent4 (Accent 4) */
- /* 20.1.4.1.5 accent5 (Accent 5) */
- /* 20.1.4.1.6 accent6 (Accent 6) */
- /* 20.1.4.1.9 dk1 (Dark 1) */
- /* 20.1.4.1.10 dk2 (Dark 2) */
- /* 20.1.4.1.15 folHlink (Followed Hyperlink) */
- /* 20.1.4.1.19 hlink (Hyperlink) */
- /* 20.1.4.1.22 lt1 (Light 1) */
- /* 20.1.4.1.23 lt2 (Light 2) */
- case '<a:dk1>': case '</a:dk1>':
- case '<a:lt1>': case '</a:lt1>':
- case '<a:dk2>': case '</a:dk2>':
- case '<a:lt2>': case '</a:lt2>':
- case '<a:accent1>': case '</a:accent1>':
- case '<a:accent2>': case '</a:accent2>':
- case '<a:accent3>': case '</a:accent3>':
- case '<a:accent4>': case '</a:accent4>':
- case '<a:accent5>': case '</a:accent5>':
- case '<a:accent6>': case '</a:accent6>':
- case '<a:hlink>': case '</a:hlink>':
- case '<a:folHlink>': case '</a:folHlink>':
- if (y[0].charAt(1) === '/') {
- themes.themeElements.clrScheme.push(color);
- color = {};
- } else {
- color.name = y[0].slice(3, y[0].length - 1);
- }
- break;
-
- default: if(opts && opts.WTF) throw new Error('Unrecognized ' + y[0] + ' in clrScheme');
- }
- });
- }
-
- /* 20.1.4.1.18 fontScheme CT_FontScheme */
- function parse_fontScheme() { }
-
- /* 20.1.4.1.15 fmtScheme CT_StyleMatrix */
- function parse_fmtScheme() { }
-
- var clrsregex = /<a:clrScheme([^>]*)>[\s\S]*<\/a:clrScheme>/;
- var fntsregex = /<a:fontScheme([^>]*)>[\s\S]*<\/a:fontScheme>/;
- var fmtsregex = /<a:fmtScheme([^>]*)>[\s\S]*<\/a:fmtScheme>/;
-
- /* 20.1.6.10 themeElements CT_BaseStyles */
- function parse_themeElements(data, themes, opts) {
- themes.themeElements = {};
-
- var t;
-
- [
- /* clrScheme CT_ColorScheme */
- ['clrScheme', clrsregex, parse_clrScheme],
- /* fontScheme CT_FontScheme */
- ['fontScheme', fntsregex, parse_fontScheme],
- /* fmtScheme CT_StyleMatrix */
- ['fmtScheme', fmtsregex, parse_fmtScheme]
- ].forEach(function(m) {
- if(!(t=data.match(m[1]))) throw new Error(m[0] + ' not found in themeElements');
- m[2](t, themes, opts);
- });
- }
-
- var themeltregex = /<a:themeElements([^>]*)>[\s\S]*<\/a:themeElements>/;
-
- /* 14.2.7 Theme Part */
- function parse_theme_xml(data, opts) {
- /* 20.1.6.9 theme CT_OfficeStyleSheet */
- if(!data || data.length === 0) return parse_theme_xml(write_theme());
-
- var t;
- var themes = {};
-
- /* themeElements CT_BaseStyles */
- if(!(t=data.match(themeltregex))) throw new Error('themeElements not found in theme');
- parse_themeElements(t[0], themes, opts);
- themes.raw = data;
- return themes;
- }
-
- function write_theme(Themes, opts) {
- if(opts && opts.themeXLSX) return opts.themeXLSX;
- if(Themes && typeof Themes.raw == "string") return Themes.raw;
- var o = [XML_HEADER];
- o[o.length] = '<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">';
- o[o.length] = '<a:themeElements>';
-
- o[o.length] = '<a:clrScheme name="Office">';
- o[o.length] = '<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>';
- o[o.length] = '<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>';
- o[o.length] = '<a:dk2><a:srgbClr val="1F497D"/></a:dk2>';
- o[o.length] = '<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>';
- o[o.length] = '<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>';
- o[o.length] = '<a:accent2><a:srgbClr val="C0504D"/></a:accent2>';
- o[o.length] = '<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>';
- o[o.length] = '<a:accent4><a:srgbClr val="8064A2"/></a:accent4>';
- o[o.length] = '<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>';
- o[o.length] = '<a:accent6><a:srgbClr val="F79646"/></a:accent6>';
- o[o.length] = '<a:hlink><a:srgbClr val="0000FF"/></a:hlink>';
- o[o.length] = '<a:folHlink><a:srgbClr val="800080"/></a:folHlink>';
- o[o.length] = '</a:clrScheme>';
-
- o[o.length] = '<a:fontScheme name="Office">';
- o[o.length] = '<a:majorFont>';
- o[o.length] = '<a:latin typeface="Cambria"/>';
- o[o.length] = '<a:ea typeface=""/>';
- o[o.length] = '<a:cs typeface=""/>';
- o[o.length] = '<a:font script="Jpan" typeface="MS Pゴシック"/>';
- o[o.length] = '<a:font script="Hang" typeface="맑은 고딕"/>';
- o[o.length] = '<a:font script="Hans" typeface="宋体"/>';
- o[o.length] = '<a:font script="Hant" typeface="新細明體"/>';
- o[o.length] = '<a:font script="Arab" typeface="Times New Roman"/>';
- o[o.length] = '<a:font script="Hebr" typeface="Times New Roman"/>';
- o[o.length] = '<a:font script="Thai" typeface="Tahoma"/>';
- o[o.length] = '<a:font script="Ethi" typeface="Nyala"/>';
- o[o.length] = '<a:font script="Beng" typeface="Vrinda"/>';
- o[o.length] = '<a:font script="Gujr" typeface="Shruti"/>';
- o[o.length] = '<a:font script="Khmr" typeface="MoolBoran"/>';
- o[o.length] = '<a:font script="Knda" typeface="Tunga"/>';
- o[o.length] = '<a:font script="Guru" typeface="Raavi"/>';
- o[o.length] = '<a:font script="Cans" typeface="Euphemia"/>';
- o[o.length] = '<a:font script="Cher" typeface="Plantagenet Cherokee"/>';
- o[o.length] = '<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>';
- o[o.length] = '<a:font script="Tibt" typeface="Microsoft Himalaya"/>';
- o[o.length] = '<a:font script="Thaa" typeface="MV Boli"/>';
- o[o.length] = '<a:font script="Deva" typeface="Mangal"/>';
- o[o.length] = '<a:font script="Telu" typeface="Gautami"/>';
- o[o.length] = '<a:font script="Taml" typeface="Latha"/>';
- o[o.length] = '<a:font script="Syrc" typeface="Estrangelo Edessa"/>';
- o[o.length] = '<a:font script="Orya" typeface="Kalinga"/>';
- o[o.length] = '<a:font script="Mlym" typeface="Kartika"/>';
- o[o.length] = '<a:font script="Laoo" typeface="DokChampa"/>';
- o[o.length] = '<a:font script="Sinh" typeface="Iskoola Pota"/>';
- o[o.length] = '<a:font script="Mong" typeface="Mongolian Baiti"/>';
- o[o.length] = '<a:font script="Viet" typeface="Times New Roman"/>';
- o[o.length] = '<a:font script="Uigh" typeface="Microsoft Uighur"/>';
- o[o.length] = '<a:font script="Geor" typeface="Sylfaen"/>';
- o[o.length] = '</a:majorFont>';
- o[o.length] = '<a:minorFont>';
- o[o.length] = '<a:latin typeface="Calibri"/>';
- o[o.length] = '<a:ea typeface=""/>';
- o[o.length] = '<a:cs typeface=""/>';
- o[o.length] = '<a:font script="Jpan" typeface="MS Pゴシック"/>';
- o[o.length] = '<a:font script="Hang" typeface="맑은 고딕"/>';
- o[o.length] = '<a:font script="Hans" typeface="宋体"/>';
- o[o.length] = '<a:font script="Hant" typeface="新細明體"/>';
- o[o.length] = '<a:font script="Arab" typeface="Arial"/>';
- o[o.length] = '<a:font script="Hebr" typeface="Arial"/>';
- o[o.length] = '<a:font script="Thai" typeface="Tahoma"/>';
- o[o.length] = '<a:font script="Ethi" typeface="Nyala"/>';
- o[o.length] = '<a:font script="Beng" typeface="Vrinda"/>';
- o[o.length] = '<a:font script="Gujr" typeface="Shruti"/>';
- o[o.length] = '<a:font script="Khmr" typeface="DaunPenh"/>';
- o[o.length] = '<a:font script="Knda" typeface="Tunga"/>';
- o[o.length] = '<a:font script="Guru" typeface="Raavi"/>';
- o[o.length] = '<a:font script="Cans" typeface="Euphemia"/>';
- o[o.length] = '<a:font script="Cher" typeface="Plantagenet Cherokee"/>';
- o[o.length] = '<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>';
- o[o.length] = '<a:font script="Tibt" typeface="Microsoft Himalaya"/>';
- o[o.length] = '<a:font script="Thaa" typeface="MV Boli"/>';
- o[o.length] = '<a:font script="Deva" typeface="Mangal"/>';
- o[o.length] = '<a:font script="Telu" typeface="Gautami"/>';
- o[o.length] = '<a:font script="Taml" typeface="Latha"/>';
- o[o.length] = '<a:font script="Syrc" typeface="Estrangelo Edessa"/>';
- o[o.length] = '<a:font script="Orya" typeface="Kalinga"/>';
- o[o.length] = '<a:font script="Mlym" typeface="Kartika"/>';
- o[o.length] = '<a:font script="Laoo" typeface="DokChampa"/>';
- o[o.length] = '<a:font script="Sinh" typeface="Iskoola Pota"/>';
- o[o.length] = '<a:font script="Mong" typeface="Mongolian Baiti"/>';
- o[o.length] = '<a:font script="Viet" typeface="Arial"/>';
- o[o.length] = '<a:font script="Uigh" typeface="Microsoft Uighur"/>';
- o[o.length] = '<a:font script="Geor" typeface="Sylfaen"/>';
- o[o.length] = '</a:minorFont>';
- o[o.length] = '</a:fontScheme>';
-
- o[o.length] = '<a:fmtScheme name="Office">';
- o[o.length] = '<a:fillStyleLst>';
- o[o.length] = '<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>';
- o[o.length] = '<a:gradFill rotWithShape="1">';
- o[o.length] = '<a:gsLst>';
- o[o.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>';
- o[o.length] = '<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>';
- o[o.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';
- o[o.length] = '</a:gsLst>';
- o[o.length] = '<a:lin ang="16200000" scaled="1"/>';
- o[o.length] = '</a:gradFill>';
- o[o.length] = '<a:gradFill rotWithShape="1">';
- o[o.length] = '<a:gsLst>';
- o[o.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>';
- o[o.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';
- o[o.length] = '</a:gsLst>';
- o[o.length] = '<a:lin ang="16200000" scaled="0"/>';
- o[o.length] = '</a:gradFill>';
- o[o.length] = '</a:fillStyleLst>';
- o[o.length] = '<a:lnStyleLst>';
- o[o.length] = '<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>';
- o[o.length] = '<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>';
- o[o.length] = '<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>';
- o[o.length] = '</a:lnStyleLst>';
- o[o.length] = '<a:effectStyleLst>';
- o[o.length] = '<a:effectStyle>';
- o[o.length] = '<a:effectLst>';
- o[o.length] = '<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>';
- o[o.length] = '</a:effectLst>';
- o[o.length] = '</a:effectStyle>';
- o[o.length] = '<a:effectStyle>';
- o[o.length] = '<a:effectLst>';
- o[o.length] = '<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>';
- o[o.length] = '</a:effectLst>';
- o[o.length] = '</a:effectStyle>';
- o[o.length] = '<a:effectStyle>';
- o[o.length] = '<a:effectLst>';
- o[o.length] = '<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>';
- o[o.length] = '</a:effectLst>';
- o[o.length] = '<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>';
- o[o.length] = '<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>';
- o[o.length] = '</a:effectStyle>';
- o[o.length] = '</a:effectStyleLst>';
- o[o.length] = '<a:bgFillStyleLst>';
- o[o.length] = '<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>';
- o[o.length] = '<a:gradFill rotWithShape="1">';
- o[o.length] = '<a:gsLst>';
- o[o.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';
- o[o.length] = '<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';
- o[o.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>';
- o[o.length] = '</a:gsLst>';
- o[o.length] = '<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>';
- o[o.length] = '</a:gradFill>';
- o[o.length] = '<a:gradFill rotWithShape="1">';
- o[o.length] = '<a:gsLst>';
- o[o.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>';
- o[o.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>';
- o[o.length] = '</a:gsLst>';
- o[o.length] = '<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>';
- o[o.length] = '</a:gradFill>';
- o[o.length] = '</a:bgFillStyleLst>';
- o[o.length] = '</a:fmtScheme>';
- o[o.length] = '</a:themeElements>';
-
- o[o.length] = '<a:objectDefaults>';
- o[o.length] = '<a:spDef>';
- o[o.length] = '<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>';
- o[o.length] = '</a:spDef>';
- o[o.length] = '<a:lnDef>';
- o[o.length] = '<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>';
- o[o.length] = '</a:lnDef>';
- o[o.length] = '</a:objectDefaults>';
- o[o.length] = '<a:extraClrSchemeLst/>';
- o[o.length] = '</a:theme>';
- return o.join("");
- }
- /* [MS-XLS] 2.4.326 TODO: payload is a zip file */
- function parse_Theme(blob, length, opts) {
- var end = blob.l + length;
- var dwThemeVersion = blob.read_shift(4);
- if(dwThemeVersion === 124226) return;
- if(!opts.cellStyles || !jszip) { blob.l = end; return; }
- var data = blob.slice(blob.l);
- blob.l = end;
- var zip; try { zip = new jszip(data); } catch(e) { return; }
- var themeXML = getzipstr(zip, "theme/theme/theme1.xml", true);
- if(!themeXML) return;
- return parse_theme_xml(themeXML, opts);
- }
-
- /* 2.5.49 */
- function parse_ColorTheme(blob) { return blob.read_shift(4); }
-
- /* 2.5.155 */
- function parse_FullColorExt(blob) {
- var o = {};
- o.xclrType = blob.read_shift(2);
- o.nTintShade = blob.read_shift(2);
- switch(o.xclrType) {
- case 0: blob.l += 4; break;
- case 1: o.xclrValue = parse_IcvXF(blob, 4); break;
- case 2: o.xclrValue = parse_LongRGBA(blob, 4); break;
- case 3: o.xclrValue = parse_ColorTheme(blob, 4); break;
- case 4: blob.l += 4; break;
- }
- blob.l += 8;
- return o;
- }
-
- /* 2.5.164 TODO: read 7 bits*/
- function parse_IcvXF(blob, length) {
- return parsenoop(blob, length);
- }
-
- /* 2.5.280 */
- function parse_XFExtGradient(blob, length) {
- return parsenoop(blob, length);
- }
-
- /* [MS-XLS] 2.5.108 */
- function parse_ExtProp(blob) {
- var extType = blob.read_shift(2);
- var cb = blob.read_shift(2) - 4;
- var o = [extType];
- switch(extType) {
- case 0x04: case 0x05: case 0x07: case 0x08:
- case 0x09: case 0x0A: case 0x0B: case 0x0D:
- o[1] = parse_FullColorExt(blob, cb); break;
- case 0x06: o[1] = parse_XFExtGradient(blob, cb); break;
- case 0x0E: case 0x0F: o[1] = blob.read_shift(cb === 1 ? 1 : 2); break;
- default: throw new Error("Unrecognized ExtProp type: " + extType + " " + cb);
- }
- return o;
- }
-
- /* 2.4.355 */
- function parse_XFExt(blob, length) {
- var end = blob.l + length;
- blob.l += 2;
- var ixfe = blob.read_shift(2);
- blob.l += 2;
- var cexts = blob.read_shift(2);
- var ext = [];
- while(cexts-- > 0) ext.push(parse_ExtProp(blob, end-blob.l));
- return {ixfe:ixfe, ext:ext};
- }
-
- /* xf is an XF, see parse_XFExt for xfext */
- function update_xfext(xf, xfext) {
- xfext.forEach(function(xfe) {
- switch(xfe[0]) { /* 2.5.108 extPropData */
- case 0x04: break; /* foreground color */
- case 0x05: break; /* background color */
- case 0x06: break; /* gradient fill */
- case 0x07: break; /* top cell border color */
- case 0x08: break; /* bottom cell border color */
- case 0x09: break; /* left cell border color */
- case 0x0a: break; /* right cell border color */
- case 0x0b: break; /* diagonal cell border color */
- case 0x0d: /* text color */
- break;
- case 0x0e: break; /* font scheme */
- case 0x0f: break; /* indentation level */
- }
- });
- }
-
- /* 18.6 Calculation Chain */
- function parse_cc_xml(data) {
- var d = [];
- if(!data) return d;
- var i = 1;
- (data.match(tagregex)||[]).forEach(function(x) {
- var y = parsexmltag(x);
- switch(y[0]) {
- case '<?xml': break;
- /* 18.6.2 calcChain CT_CalcChain 1 */
- case '<calcChain': case '<calcChain>': case '</calcChain>': break;
- /* 18.6.1 c CT_CalcCell 1 */
- case '<c': delete y[0]; if(y.i) i = y.i; else y.i = i; d.push(y); break;
- }
- });
- return d;
- }
-
- //function write_cc_xml(data, opts) { }
-
- /* [MS-XLSB] 2.6.4.1 */
- function parse_BrtCalcChainItem$(data) {
- var out = {};
- out.i = data.read_shift(4);
- var cell = {};
- cell.r = data.read_shift(4);
- cell.c = data.read_shift(4);
- out.r = encode_cell(cell);
- var flags = data.read_shift(1);
- if(flags & 0x2) out.l = '1';
- if(flags & 0x8) out.a = '1';
- return out;
- }
-
- /* 18.6 Calculation Chain */
- function parse_cc_bin(data, name, opts) {
- var out = [];
- var pass = false;
- recordhopper(data, function hopper_cc(val, R_n, RT) {
- switch(RT) {
- case 0x003F: /* 'BrtCalcChainItem$' */
- out.push(val); break;
-
- default:
- if((R_n||"").indexOf("Begin") > 0){/* empty */}
- else if((R_n||"").indexOf("End") > 0){/* empty */}
- else if(!pass || opts.WTF) throw new Error("Unexpected record " + RT + " " + R_n);
- }
- });
- return out;
- }
-
- //function write_cc_bin(data, opts) { }
- /* 18.14 Supplementary Workbook Data */
- function parse_xlink_xml() {
- //var opts = _opts || {};
- //if(opts.WTF) throw "XLSX External Link";
- }
-
- /* [MS-XLSB] 2.1.7.25 External Link */
- function parse_xlink_bin(data, rel, name, _opts) {
- if(!data) return data;
- var opts = _opts || {};
-
- var pass = false, end = false;
-
- recordhopper(data, function xlink_parse(val, R_n, RT) {
- if(end) return;
- switch(RT) {
- case 0x0167: /* 'BrtSupTabs' */
- case 0x016B: /* 'BrtExternTableStart' */
- case 0x016C: /* 'BrtExternTableEnd' */
- case 0x016E: /* 'BrtExternRowHdr' */
- case 0x016F: /* 'BrtExternCellBlank' */
- case 0x0170: /* 'BrtExternCellReal' */
- case 0x0171: /* 'BrtExternCellBool' */
- case 0x0172: /* 'BrtExternCellError' */
- case 0x0173: /* 'BrtExternCellString' */
- case 0x01D8: /* 'BrtExternValueMeta' */
- case 0x0241: /* 'BrtSupNameStart' */
- case 0x0242: /* 'BrtSupNameValueStart' */
- case 0x0243: /* 'BrtSupNameValueEnd' */
- case 0x0244: /* 'BrtSupNameNum' */
- case 0x0245: /* 'BrtSupNameErr' */
- case 0x0246: /* 'BrtSupNameSt' */
- case 0x0247: /* 'BrtSupNameNil' */
- case 0x0248: /* 'BrtSupNameBool' */
- case 0x0249: /* 'BrtSupNameFmla' */
- case 0x024A: /* 'BrtSupNameBits' */
- case 0x024B: /* 'BrtSupNameEnd' */
- break;
-
- case 0x0023: /* 'BrtFRTBegin' */
- pass = true; break;
- case 0x0024: /* 'BrtFRTEnd' */
- pass = false; break;
-
- default:
- if((R_n||"").indexOf("Begin") > 0){/* empty */}
- else if((R_n||"").indexOf("End") > 0){/* empty */}
- else if(!pass || opts.WTF) throw new Error("Unexpected record " + RT.toString(16) + " " + R_n);
- }
- }, opts);
- }
- /* 20.5 DrawingML - SpreadsheetML Drawing */
- RELS.IMG = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
- RELS.DRAW = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing";
-
- /* 20.5.2.35 wsDr CT_Drawing */
- function parse_drawing(data, rels) {
- if(!data) return "??";
- /*
- Chartsheet Drawing:
- - 20.5.2.35 wsDr CT_Drawing
- - 20.5.2.1 absoluteAnchor CT_AbsoluteAnchor
- - 20.5.2.16 graphicFrame CT_GraphicalObjectFrame
- - 20.1.2.2.16 graphic CT_GraphicalObject
- - 20.1.2.2.17 graphicData CT_GraphicalObjectData
- - chart reference
- the actual type is based on the URI of the graphicData
- TODO: handle embedded charts and other types of graphics
- */
- var id = (data.match(/<c:chart [^>]*r:id="([^"]*)"/)||["",""])[1];
-
- return rels['!id'][id].Target;
- }
-
- /* L.5.5.2 SpreadsheetML Comments + VML Schema */
- var _shapeid = 1024;
- function write_comments_vml(rId, comments) {
- var csize = [21600, 21600];
- /* L.5.2.1.2 Path Attribute */
- var bbox = ["m0,0l0",csize[1],csize[0],csize[1],csize[0],"0xe"].join(",");
- var o = [
- writextag("xml", null, { 'xmlns:v': XLMLNS.v, 'xmlns:o': XLMLNS.o, 'xmlns:x': XLMLNS.x, 'xmlns:mv': XLMLNS.mv }).replace(/\/>/,">"),
- writextag("o:shapelayout", writextag("o:idmap", null, {'v:ext':"edit", 'data':rId}), {'v:ext':"edit"}),
- writextag("v:shapetype", [
- writextag("v:stroke", null, {joinstyle:"miter"}),
- writextag("v:path", null, {gradientshapeok:"t", 'o:connecttype':"rect"})
- ].join(""), {id:"_x0000_t202", 'o:spt':202, coordsize:csize.join(","),path:bbox})
- ];
- while(_shapeid < rId * 1000) _shapeid += 1000;
-
- comments.forEach(function(x) {
- var c = decode_cell(x[0]);
- var fillopts = {'color2':"#BEFF82", 'type':"gradient"};
- if(fillopts.type == "gradient") fillopts.angle = "-180";
- var fillparm = fillopts.type == "gradient" ? writextag("o:fill", null, {type:"gradientUnscaled", 'v:ext':"view"}) : null;
- var fillxml = writextag('v:fill', fillparm, fillopts);
-
- var shadata = ({on:"t", 'obscured':"t"});
- ++_shapeid;
-
- o = o.concat([
- '<v:shape' + wxt_helper({
- id:'_x0000_s' + _shapeid,
- type:"#_x0000_t202",
- style:"position:absolute; margin-left:80pt;margin-top:5pt;width:104pt;height:64pt;z-index:10" + (x[1].hidden ? ";visibility:hidden" : "") ,
- fillcolor:"#ECFAD4",
- strokecolor:"#edeaa1"
- }) + '>',
- fillxml,
- writextag("v:shadow", null, shadata),
- writextag("v:path", null, {'o:connecttype':"none"}),
- '<v:textbox><div style="text-align:left"></div></v:textbox>',
- '<x:ClientData ObjectType="Note">',
- '<x:MoveWithCells/>',
- '<x:SizeWithCells/>',
- /* Part 4 19.4.2.3 Anchor (Anchor) */
- writetag('x:Anchor', [c.c+1, 0, c.r+1, 0, c.c+3, 20, c.r+5, 20].join(",")),
- writetag('x:AutoFill', "False"),
- writetag('x:Row', String(c.r)),
- writetag('x:Column', String(c.c)),
- x[1].hidden ? '' : '<x:Visible/>',
- '</x:ClientData>',
- '</v:shape>'
- ]); });
- o.push('</xml>');
- return o.join("");
- }
- RELS.CMNT = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
-
- function sheet_insert_comments(sheet, comments) {
- var dense = Array.isArray(sheet);
- var cell;
- comments.forEach(function(comment) {
- var r = decode_cell(comment.ref);
- if(dense) {
- if(!sheet[r.r]) sheet[r.r] = [];
- cell = sheet[r.r][r.c];
- } else cell = sheet[comment.ref];
- if (!cell) {
- cell = ({t:"z"});
- if(dense) sheet[r.r][r.c] = cell;
- else sheet[comment.ref] = cell;
- var range = safe_decode_range(sheet["!ref"]||"BDWGO1000001:A1");
- if(range.s.r > r.r) range.s.r = r.r;
- if(range.e.r < r.r) range.e.r = r.r;
- if(range.s.c > r.c) range.s.c = r.c;
- if(range.e.c < r.c) range.e.c = r.c;
- var encoded = encode_range(range);
- if (encoded !== sheet["!ref"]) sheet["!ref"] = encoded;
- }
-
- if (!cell.c) cell.c = [];
- var o = ({a: comment.author, t: comment.t, r: comment.r});
- if(comment.h) o.h = comment.h;
- cell.c.push(o);
- });
- }
-
- /* 18.7 Comments */
- function parse_comments_xml(data, opts) {
- /* 18.7.6 CT_Comments */
- if(data.match(/<(?:\w+:)?comments *\/>/)) return [];
- var authors = [];
- var commentList = [];
- var authtag = data.match(/<(?:\w+:)?authors>([\s\S]*)<\/(?:\w+:)?authors>/);
- if(authtag && authtag[1]) authtag[1].split(/<\/\w*:?author>/).forEach(function(x) {
- if(x === "" || x.trim() === "") return;
- var a = x.match(/<(?:\w+:)?author[^>]*>(.*)/);
- if(a) authors.push(a[1]);
- });
- var cmnttag = data.match(/<(?:\w+:)?commentList>([\s\S]*)<\/(?:\w+:)?commentList>/);
- if(cmnttag && cmnttag[1]) cmnttag[1].split(/<\/\w*:?comment>/).forEach(function(x) {
- if(x === "" || x.trim() === "") return;
- var cm = x.match(/<(?:\w+:)?comment[^>]*>/);
- if(!cm) return;
- var y = parsexmltag(cm[0]);
- var comment = ({ author: y.authorId && authors[y.authorId] || "sheetjsghost", ref: y.ref, guid: y.guid });
- var cell = decode_cell(y.ref);
- if(opts.sheetRows && opts.sheetRows <= cell.r) return;
- var textMatch = x.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/);
- var rt = !!textMatch && !!textMatch[1] && parse_si(textMatch[1]) || {r:"",t:"",h:""};
- comment.r = rt.r;
- if(rt.r == "<t></t>") rt.t = rt.h = "";
- comment.t = rt.t.replace(/\r\n/g,"\n").replace(/\r/g,"\n");
- if(opts.cellHTML) comment.h = rt.h;
- commentList.push(comment);
- });
- return commentList;
- }
-
- var CMNT_XML_ROOT = writextag('comments', null, { 'xmlns': XMLNS.main[0] });
- function write_comments_xml(data) {
- var o = [XML_HEADER, CMNT_XML_ROOT];
-
- var iauthor = [];
- o.push("<authors>");
- data.forEach(function(x) { x[1].forEach(function(w) { var a = escapexml(w.a);
- if(iauthor.indexOf(a) > -1) return;
- iauthor.push(a);
- o.push("<author>" + a + "</author>");
- }); });
- o.push("</authors>");
- o.push("<commentList>");
- data.forEach(function(d) {
- d[1].forEach(function(c) {
- /* 18.7.3 CT_Comment */
- o.push('<comment ref="' + d[0] + '" authorId="' + iauthor.indexOf(escapexml(c.a)) + '"><text>');
- o.push(writetag("t", c.t == null ? "" : escapexml(c.t)));
- o.push('</text></comment>');
- });
- });
- o.push("</commentList>");
- if(o.length>2) { o[o.length] = ('</comments>'); o[1]=o[1].replace("/>",">"); }
- return o.join("");
- }
- /* [MS-XLSB] 2.4.28 BrtBeginComment */
- function parse_BrtBeginComment(data) {
- var out = {};
- out.iauthor = data.read_shift(4);
- var rfx = parse_UncheckedRfX(data, 16);
- out.rfx = rfx.s;
- out.ref = encode_cell(rfx.s);
- data.l += 16; /*var guid = parse_GUID(data); */
- return out;
- }
- function write_BrtBeginComment(data, o) {
- if(o == null) o = new_buf(36);
- o.write_shift(4, data[1].iauthor);
- write_UncheckedRfX((data[0]), o);
- o.write_shift(4, 0);
- o.write_shift(4, 0);
- o.write_shift(4, 0);
- o.write_shift(4, 0);
- return o;
- }
-
- /* [MS-XLSB] 2.4.327 BrtCommentAuthor */
- var parse_BrtCommentAuthor = parse_XLWideString;
- function write_BrtCommentAuthor(data) { return write_XLWideString(data.slice(0, 54)); }
-
- /* [MS-XLSB] 2.1.7.8 Comments */
- function parse_comments_bin(data, opts) {
- var out = [];
- var authors = [];
- var c = {};
- var pass = false;
- recordhopper(data, function hopper_cmnt(val, R_n, RT) {
- switch(RT) {
- case 0x0278: /* 'BrtCommentAuthor' */
- authors.push(val); break;
- case 0x027B: /* 'BrtBeginComment' */
- c = val; break;
- case 0x027D: /* 'BrtCommentText' */
- c.t = val.t; c.h = val.h; c.r = val.r; break;
- case 0x027C: /* 'BrtEndComment' */
- c.author = authors[c.iauthor];
- delete (c).iauthor;
- if(opts.sheetRows && c.rfx && opts.sheetRows <= c.rfx.r) break;
- if(!c.t) c.t = "";
- delete c.rfx; out.push(c); break;
-
- case 0x0C00: /* 'BrtUid' */
- break;
-
- case 0x0023: /* 'BrtFRTBegin' */
- pass = true; break;
- case 0x0024: /* 'BrtFRTEnd' */
- pass = false; break;
- case 0x0025: /* 'BrtACBegin' */ break;
- case 0x0026: /* 'BrtACEnd' */ break;
-
-
- default:
- if((R_n||"").indexOf("Begin") > 0){/* empty */}
- else if((R_n||"").indexOf("End") > 0){/* empty */}
- else if(!pass || opts.WTF) throw new Error("Unexpected record " + RT + " " + R_n);
- }
- });
- return out;
- }
-
- function write_comments_bin(data) {
- var ba = buf_array();
- var iauthor = [];
- write_record(ba, "BrtBeginComments");
-
- write_record(ba, "BrtBeginCommentAuthors");
- data.forEach(function(comment) {
- comment[1].forEach(function(c) {
- if(iauthor.indexOf(c.a) > -1) return;
- iauthor.push(c.a.slice(0,54));
- write_record(ba, "BrtCommentAuthor", write_BrtCommentAuthor(c.a));
- });
- });
- write_record(ba, "BrtEndCommentAuthors");
-
- write_record(ba, "BrtBeginCommentList");
- data.forEach(function(comment) {
- comment[1].forEach(function(c) {
- c.iauthor = iauthor.indexOf(c.a);
- var range = {s:decode_cell(comment[0]),e:decode_cell(comment[0])};
- write_record(ba, "BrtBeginComment", write_BrtBeginComment([range, c]));
- if(c.t && c.t.length > 0) write_record(ba, "BrtCommentText", write_BrtCommentText(c));
- write_record(ba, "BrtEndComment");
- delete c.iauthor;
- });
- });
- write_record(ba, "BrtEndCommentList");
-
- write_record(ba, "BrtEndComments");
- return ba.end();
- }
- var CT_VBA = "application/vnd.ms-office.vbaProject";
- function make_vba_xls(cfb) {
- var newcfb = CFB.utils.cfb_new({root:"R"});
- cfb.FullPaths.forEach(function(p, i) {
- if(p.slice(-1) === "/" || !p.match(/_VBA_PROJECT_CUR/)) return;
- var newpath = p.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/, "");
- CFB.utils.cfb_add(newcfb, newpath, cfb.FileIndex[i].content);
- });
- return CFB.write(newcfb);
- }
-
- function fill_vba_xls(cfb, vba) {
- vba.FullPaths.forEach(function(p, i) {
- if(i == 0) return;
- var newpath = p.replace(/[^\/]*[\/]/, "/_VBA_PROJECT_CUR/");
- if(newpath.slice(-1) !== "/") CFB.utils.cfb_add(cfb, newpath, vba.FileIndex[i].content);
- });
- }
-
- var VBAFMTS = [ "xlsb", "xlsm", "xlam", "biff8", "xla" ];
-
- RELS.DS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet";
- RELS.MS = "http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet";
-
- /* macro and dialog sheet stubs */
- function parse_ds_bin() { return {'!type':'dialog'}; }
- function parse_ds_xml() { return {'!type':'dialog'}; }
- function parse_ms_bin() { return {'!type':'macro'}; }
- function parse_ms_xml() { return {'!type':'macro'}; }
- /* TODO: it will be useful to parse the function str */
- var rc_to_a1 = (function(){
- var rcregex = /(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g;
- var rcbase = ({r:0,c:0});
- function rcfunc($$,$1,$2,$3) {
- var cRel = false, rRel = false;
-
- if($2.length == 0) rRel = true;
- else if($2.charAt(0) == "[") { rRel = true; $2 = $2.slice(1, -1); }
-
- if($3.length == 0) cRel = true;
- else if($3.charAt(0) == "[") { cRel = true; $3 = $3.slice(1, -1); }
-
- var R = $2.length>0?parseInt($2,10)|0:0, C = $3.length>0?parseInt($3,10)|0:0;
-
- if(cRel) C += rcbase.c; else --C;
- if(rRel) R += rcbase.r; else --R;
- return $1 + (cRel ? "" : "$") + encode_col(C) + (rRel ? "" : "$") + encode_row(R);
- }
- return function rc_to_a1(fstr, base) {
- rcbase = base;
- return fstr.replace(rcregex, rcfunc);
- };
- })();
-
- var crefregex = /(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)([1-9]\d{0,5}|10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6])(?![_.\(A-Za-z0-9])/g;
- var a1_to_rc =(function(){
- return function a1_to_rc(fstr, base) {
- return fstr.replace(crefregex, function($0, $1, $2, $3, $4, $5) {
- var c = decode_col($3) - ($2 ? 0 : base.c);
- var r = decode_row($5) - ($4 ? 0 : base.r);
- var R = (r == 0 ? "" : !$4 ? "[" + r + "]" : (r+1));
- var C = (c == 0 ? "" : !$2 ? "[" + c + "]" : (c+1));
- return $1 + "R" + R + "C" + C;
- });
- };
- })();
-
- /* no defined name can collide with a valid cell address A1:XFD1048576 ... except LOG10! */
- function shift_formula_str(f, delta) {
- return f.replace(crefregex, function($0, $1, $2, $3, $4, $5) {
- return $1+($2=="$" ? $2+$3 : encode_col(decode_col($3)+delta.c))+($4=="$" ? $4+$5 : encode_row(decode_row($5) + delta.r));
- });
- }
-
- function shift_formula_xlsx(f, range, cell) {
- var r = decode_range(range), s = r.s, c = decode_cell(cell);
- var delta = {r:c.r - s.r, c:c.c - s.c};
- return shift_formula_str(f, delta);
- }
-
- /* TODO: parse formula */
- function fuzzyfmla(f) {
- if(f.length == 1) return false;
- return true;
- }
-
- function _xlfn(f) {
- return f.replace(/_xlfn\./g,"");
- }
- function parseread1(blob) { blob.l+=1; return; }
-
- /* [MS-XLS] 2.5.51 */
- function parse_ColRelU(blob, length) {
- var c = blob.read_shift(length == 1 ? 1 : 2);
- return [c & 0x3FFF, (c >> 14) & 1, (c >> 15) & 1];
- }
-
- /* [MS-XLS] 2.5.198.105 ; [MS-XLSB] 2.5.97.89 */
- function parse_RgceArea(blob, length, opts) {
- var w = 2;
- if(opts) {
- if(opts.biff >= 2 && opts.biff <= 5) return parse_RgceArea_BIFF2(blob, length, opts);
- else if(opts.biff == 12) w = 4;
- }
- var r=blob.read_shift(w), R=blob.read_shift(w);
- var c=parse_ColRelU(blob, 2);
- var C=parse_ColRelU(blob, 2);
- return { s:{r:r, c:c[0], cRel:c[1], rRel:c[2]}, e:{r:R, c:C[0], cRel:C[1], rRel:C[2]} };
- }
- /* BIFF 2-5 encodes flags in the row field */
- function parse_RgceArea_BIFF2(blob) {
- var r=parse_ColRelU(blob, 2), R=parse_ColRelU(blob, 2);
- var c=blob.read_shift(1);
- var C=blob.read_shift(1);
- return { s:{r:r[0], c:c, cRel:r[1], rRel:r[2]}, e:{r:R[0], c:C, cRel:R[1], rRel:R[2]} };
- }
-
- /* [MS-XLS] 2.5.198.105 ; [MS-XLSB] 2.5.97.90 */
- function parse_RgceAreaRel(blob, length, opts) {
- if(opts.biff < 8) return parse_RgceArea_BIFF2(blob, length, opts);
- var r=blob.read_shift(opts.biff == 12 ? 4 : 2), R=blob.read_shift(opts.biff == 12 ? 4 : 2);
- var c=parse_ColRelU(blob, 2);
- var C=parse_ColRelU(blob, 2);
- return { s:{r:r, c:c[0], cRel:c[1], rRel:c[2]}, e:{r:R, c:C[0], cRel:C[1], rRel:C[2]} };
- }
-
- /* [MS-XLS] 2.5.198.109 ; [MS-XLSB] 2.5.97.91 */
- function parse_RgceLoc(blob, length, opts) {
- if(opts && opts.biff >= 2 && opts.biff <= 5) return parse_RgceLoc_BIFF2(blob, length, opts);
- var r = blob.read_shift(opts && opts.biff == 12 ? 4 : 2);
- var c = parse_ColRelU(blob, 2);
- return {r:r, c:c[0], cRel:c[1], rRel:c[2]};
- }
- function parse_RgceLoc_BIFF2(blob) {
- var r = parse_ColRelU(blob, 2);
- var c = blob.read_shift(1);
- return {r:r[0], c:c, cRel:r[1], rRel:r[2]};
- }
-
- /* [MS-XLS] 2.5.198.107, 2.5.47 */
- function parse_RgceElfLoc(blob) {
- var r = blob.read_shift(2);
- var c = blob.read_shift(2);
- return {r:r, c:c & 0xFF, fQuoted:!!(c & 0x4000), cRel:c>>15, rRel:c>>15 };
- }
-
- /* [MS-XLS] 2.5.198.111 ; [MS-XLSB] 2.5.97.92 TODO */
- function parse_RgceLocRel(blob, length, opts) {
- var biff = opts && opts.biff ? opts.biff : 8;
- if(biff >= 2 && biff <= 5) return parse_RgceLocRel_BIFF2(blob, length, opts);
- var r = blob.read_shift(biff >= 12 ? 4 : 2);
- var cl = blob.read_shift(2);
- var cRel = (cl & 0x4000) >> 14, rRel = (cl & 0x8000) >> 15;
- cl &= 0x3FFF;
- if(rRel == 1) while(r > 0x7FFFF) r -= 0x100000;
- if(cRel == 1) while(cl > 0x1FFF) cl = cl - 0x4000;
- return {r:r,c:cl,cRel:cRel,rRel:rRel};
- }
- function parse_RgceLocRel_BIFF2(blob) {
- var rl = blob.read_shift(2);
- var c = blob.read_shift(1);
- var rRel = (rl & 0x8000) >> 15, cRel = (rl & 0x4000) >> 14;
- rl &= 0x3FFF;
- if(rRel == 1 && rl >= 0x2000) rl = rl - 0x4000;
- if(cRel == 1 && c >= 0x80) c = c - 0x100;
- return {r:rl,c:c,cRel:cRel,rRel:rRel};
- }
-
- /* [MS-XLS] 2.5.198.27 ; [MS-XLSB] 2.5.97.18 */
- function parse_PtgArea(blob, length, opts) {
- var type = (blob[blob.l++] & 0x60) >> 5;
- var area = parse_RgceArea(blob, opts.biff >= 2 && opts.biff <= 5 ? 6 : 8, opts);
- return [type, area];
- }
-
- /* [MS-XLS] 2.5.198.28 ; [MS-XLSB] 2.5.97.19 */
- function parse_PtgArea3d(blob, length, opts) {
- var type = (blob[blob.l++] & 0x60) >> 5;
- var ixti = blob.read_shift(2, 'i');
- var w = 8;
- if(opts) switch(opts.biff) {
- case 5: blob.l += 12; w = 6; break;
- case 12: w = 12; break;
- }
- var area = parse_RgceArea(blob, w, opts);
- return [type, ixti, area];
- }
-
- /* [MS-XLS] 2.5.198.29 ; [MS-XLSB] 2.5.97.20 */
- function parse_PtgAreaErr(blob, length, opts) {
- var type = (blob[blob.l++] & 0x60) >> 5;
- blob.l += opts && (opts.biff > 8) ? 12 : (opts.biff < 8 ? 6 : 8);
- return [type];
- }
- /* [MS-XLS] 2.5.198.30 ; [MS-XLSB] 2.5.97.21 */
- function parse_PtgAreaErr3d(blob, length, opts) {
- var type = (blob[blob.l++] & 0x60) >> 5;
- var ixti = blob.read_shift(2);
- var w = 8;
- if(opts) switch(opts.biff) {
- case 5: blob.l += 12; w = 6; break;
- case 12: w = 12; break;
- }
- blob.l += w;
- return [type, ixti];
- }
-
- /* [MS-XLS] 2.5.198.31 ; [MS-XLSB] 2.5.97.22 */
- function parse_PtgAreaN(blob, length, opts) {
- var type = (blob[blob.l++] & 0x60) >> 5;
- var area = parse_RgceAreaRel(blob, length - 1, opts);
- return [type, area];
- }
-
- /* [MS-XLS] 2.5.198.32 ; [MS-XLSB] 2.5.97.23 */
- function parse_PtgArray(blob, length, opts) {
- var type = (blob[blob.l++] & 0x60) >> 5;
- blob.l += opts.biff == 2 ? 6 : opts.biff == 12 ? 14 : 7;
- return [type];
- }
-
- /* [MS-XLS] 2.5.198.33 ; [MS-XLSB] 2.5.97.24 */
- function parse_PtgAttrBaxcel(blob) {
- var bitSemi = blob[blob.l+1] & 0x01; /* 1 = volatile */
- var bitBaxcel = 1;
- blob.l += 4;
- return [bitSemi, bitBaxcel];
- }
-
- /* [MS-XLS] 2.5.198.34 ; [MS-XLSB] 2.5.97.25 */
- function parse_PtgAttrChoose(blob, length, opts) {
- blob.l +=2;
- var offset = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
- var o = [];
- /* offset is 1 less than the number of elements */
- for(var i = 0; i <= offset; ++i) o.push(blob.read_shift(opts && opts.biff == 2 ? 1 : 2));
- return o;
- }
-
- /* [MS-XLS] 2.5.198.35 ; [MS-XLSB] 2.5.97.26 */
- function parse_PtgAttrGoto(blob, length, opts) {
- var bitGoto = (blob[blob.l+1] & 0xFF) ? 1 : 0;
- blob.l += 2;
- return [bitGoto, blob.read_shift(opts && opts.biff == 2 ? 1 : 2)];
- }
-
- /* [MS-XLS] 2.5.198.36 ; [MS-XLSB] 2.5.97.27 */
- function parse_PtgAttrIf(blob, length, opts) {
- var bitIf = (blob[blob.l+1] & 0xFF) ? 1 : 0;
- blob.l += 2;
- return [bitIf, blob.read_shift(opts && opts.biff == 2 ? 1 : 2)];
- }
-
- /* [MS-XLSB] 2.5.97.28 */
- function parse_PtgAttrIfError(blob) {
- var bitIf = (blob[blob.l+1] & 0xFF) ? 1 : 0;
- blob.l += 2;
- return [bitIf, blob.read_shift(2)];
- }
-
- /* [MS-XLS] 2.5.198.37 ; [MS-XLSB] 2.5.97.29 */
- function parse_PtgAttrSemi(blob, length, opts) {
- var bitSemi = (blob[blob.l+1] & 0xFF) ? 1 : 0;
- blob.l += opts && opts.biff == 2 ? 3 : 4;
- return [bitSemi];
- }
-
- /* [MS-XLS] 2.5.198.40 ; [MS-XLSB] 2.5.97.32 */
- function parse_PtgAttrSpaceType(blob) {
- var type = blob.read_shift(1), cch = blob.read_shift(1);
- return [type, cch];
- }
-
- /* [MS-XLS] 2.5.198.38 ; [MS-XLSB] 2.5.97.30 */
- function parse_PtgAttrSpace(blob) {
- blob.read_shift(2);
- return parse_PtgAttrSpaceType(blob, 2);
- }
-
- /* [MS-XLS] 2.5.198.39 ; [MS-XLSB] 2.5.97.31 */
- function parse_PtgAttrSpaceSemi(blob) {
- blob.read_shift(2);
- return parse_PtgAttrSpaceType(blob, 2);
- }
-
- /* [MS-XLS] 2.5.198.84 ; [MS-XLSB] 2.5.97.68 TODO */
- function parse_PtgRef(blob, length, opts) {
- //var ptg = blob[blob.l] & 0x1F;
- var type = (blob[blob.l] & 0x60)>>5;
- blob.l += 1;
- var loc = parse_RgceLoc(blob, 0, opts);
- return [type, loc];
- }
-
- /* [MS-XLS] 2.5.198.88 ; [MS-XLSB] 2.5.97.72 TODO */
- function parse_PtgRefN(blob, length, opts) {
- var type = (blob[blob.l] & 0x60)>>5;
- blob.l += 1;
- var loc = parse_RgceLocRel(blob, 0, opts);
- return [type, loc];
- }
-
- /* [MS-XLS] 2.5.198.85 ; [MS-XLSB] 2.5.97.69 TODO */
- function parse_PtgRef3d(blob, length, opts) {
- var type = (blob[blob.l] & 0x60)>>5;
- blob.l += 1;
- var ixti = blob.read_shift(2); // XtiIndex
- if(opts && opts.biff == 5) blob.l += 12;
- var loc = parse_RgceLoc(blob, 0, opts); // TODO: or RgceLocRel
- return [type, ixti, loc];
- }
-
-
- /* [MS-XLS] 2.5.198.62 ; [MS-XLSB] 2.5.97.45 TODO */
- function parse_PtgFunc(blob, length, opts) {
- //var ptg = blob[blob.l] & 0x1F;
- var type = (blob[blob.l] & 0x60)>>5;
- blob.l += 1;
- var iftab = blob.read_shift(opts && opts.biff <= 3 ? 1 : 2);
- return [FtabArgc[iftab], Ftab[iftab], type];
- }
- /* [MS-XLS] 2.5.198.63 ; [MS-XLSB] 2.5.97.46 TODO */
- function parse_PtgFuncVar(blob, length, opts) {
- var type = blob[blob.l++];
- var cparams = blob.read_shift(1), tab = opts && opts.biff <= 3 ? [(type == 0x58 ? -1 : 0), blob.read_shift(1)]: parsetab(blob);
- return [cparams, (tab[0] === 0 ? Ftab : Cetab)[tab[1]]];
- }
-
- function parsetab(blob) {
- return [blob[blob.l+1]>>7, blob.read_shift(2) & 0x7FFF];
- }
-
- /* [MS-XLS] 2.5.198.41 ; [MS-XLSB] 2.5.97.33 */
- function parse_PtgAttrSum(blob, length, opts) {
- blob.l += opts && opts.biff == 2 ? 3 : 4; return;
- }
-
- /* [MS-XLS] 2.5.198.58 ; [MS-XLSB] 2.5.97.40 */
- function parse_PtgExp(blob, length, opts) {
- blob.l++;
- if(opts && opts.biff == 12) return [blob.read_shift(4, 'i'), 0];
- var row = blob.read_shift(2);
- var col = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
- return [row, col];
- }
-
- /* [MS-XLS] 2.5.198.57 ; [MS-XLSB] 2.5.97.39 */
- function parse_PtgErr(blob) { blob.l++; return BErr[blob.read_shift(1)]; }
-
- /* [MS-XLS] 2.5.198.66 ; [MS-XLSB] 2.5.97.49 */
- function parse_PtgInt(blob) { blob.l++; return blob.read_shift(2); }
-
- /* [MS-XLS] 2.5.198.42 ; [MS-XLSB] 2.5.97.34 */
- function parse_PtgBool(blob) { blob.l++; return blob.read_shift(1)!==0;}
-
- /* [MS-XLS] 2.5.198.79 ; [MS-XLSB] 2.5.97.63 */
- function parse_PtgNum(blob) { blob.l++; return parse_Xnum(blob, 8); }
-
- /* [MS-XLS] 2.5.198.89 ; [MS-XLSB] 2.5.97.74 */
- function parse_PtgStr(blob, length, opts) { blob.l++; return parse_ShortXLUnicodeString(blob, length-1, opts); }
-
- /* [MS-XLS] 2.5.192.112 + 2.5.192.11{3,4,5,6,7} */
- /* [MS-XLSB] 2.5.97.93 + 2.5.97.9{4,5,6,7} */
- function parse_SerAr(blob, biff) {
- var val = [blob.read_shift(1)];
- if(biff == 12) switch(val[0]) {
- case 0x02: val[0] = 0x04; break; /* SerBool */
- case 0x04: val[0] = 0x10; break; /* SerErr */
- case 0x00: val[0] = 0x01; break; /* SerNum */
- case 0x01: val[0] = 0x02; break; /* SerStr */
- }
- switch(val[0]) {
- case 0x04: /* SerBool -- boolean */
- val[1] = parsebool(blob, 1) ? 'TRUE' : 'FALSE';
- if(biff != 12) blob.l += 7; break;
- case 0x25: /* appears to be an alias */
- case 0x10: /* SerErr -- error */
- val[1] = BErr[blob[blob.l]];
- blob.l += ((biff == 12) ? 4 : 8); break;
- case 0x00: /* SerNil -- honestly, I'm not sure how to reproduce this */
- blob.l += 8; break;
- case 0x01: /* SerNum -- Xnum */
- val[1] = parse_Xnum(blob, 8); break;
- case 0x02: /* SerStr -- XLUnicodeString (<256 chars) */
- val[1] = parse_XLUnicodeString2(blob, 0, {biff:biff > 0 && biff < 8 ? 2 : biff}); break;
- default: throw new Error("Bad SerAr: " + val[0]); /* Unreachable */
- }
- return val;
- }
-
- /* [MS-XLS] 2.5.198.61 ; [MS-XLSB] 2.5.97.44 */
- function parse_PtgExtraMem(blob, cce, opts) {
- var count = blob.read_shift((opts.biff == 12) ? 4 : 2);
- var out = [];
- for(var i = 0; i != count; ++i) out.push(((opts.biff == 12) ? parse_UncheckedRfX : parse_Ref8U)(blob, 8));
- return out;
- }
-
- /* [MS-XLS] 2.5.198.59 ; [MS-XLSB] 2.5.97.41 */
- function parse_PtgExtraArray(blob, length, opts) {
- var rows = 0, cols = 0;
- if(opts.biff == 12) {
- rows = blob.read_shift(4); // DRw
- cols = blob.read_shift(4); // DCol
- } else {
- cols = 1 + blob.read_shift(1); //DColByteU
- rows = 1 + blob.read_shift(2); //DRw
- }
- if(opts.biff >= 2 && opts.biff < 8) { --rows; if(--cols == 0) cols = 0x100; }
- // $FlowIgnore
- for(var i = 0, o = []; i != rows && (o[i] = []); ++i)
- for(var j = 0; j != cols; ++j) o[i][j] = parse_SerAr(blob, opts.biff);
- return o;
- }
-
- /* [MS-XLS] 2.5.198.76 ; [MS-XLSB] 2.5.97.60 */
- function parse_PtgName(blob, length, opts) {
- var type = (blob.read_shift(1) >>> 5) & 0x03;
- var w = (!opts || (opts.biff >= 8)) ? 4 : 2;
- var nameindex = blob.read_shift(w);
- switch(opts.biff) {
- case 2: blob.l += 5; break;
- case 3: case 4: blob.l += 8; break;
- case 5: blob.l += 12; break;
- }
- return [type, 0, nameindex];
- }
-
- /* [MS-XLS] 2.5.198.77 ; [MS-XLSB] 2.5.97.61 */
- function parse_PtgNameX(blob, length, opts) {
- if(opts.biff == 5) return parse_PtgNameX_BIFF5(blob, length, opts);
- var type = (blob.read_shift(1) >>> 5) & 0x03;
- var ixti = blob.read_shift(2); // XtiIndex
- var nameindex = blob.read_shift(4);
- return [type, ixti, nameindex];
- }
- function parse_PtgNameX_BIFF5(blob) {
- var type = (blob.read_shift(1) >>> 5) & 0x03;
- var ixti = blob.read_shift(2, 'i'); // XtiIndex
- blob.l += 8;
- var nameindex = blob.read_shift(2);
- blob.l += 12;
- return [type, ixti, nameindex];
- }
-
- /* [MS-XLS] 2.5.198.70 ; [MS-XLSB] 2.5.97.54 */
- function parse_PtgMemArea(blob, length, opts) {
- var type = (blob.read_shift(1) >>> 5) & 0x03;
- blob.l += (opts && opts.biff == 2 ? 3 : 4);
- var cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
- return [type, cce];
- }
-
- /* [MS-XLS] 2.5.198.72 ; [MS-XLSB] 2.5.97.56 */
- function parse_PtgMemFunc(blob, length, opts) {
- var type = (blob.read_shift(1) >>> 5) & 0x03;
- var cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
- return [type, cce];
- }
-
-
- /* [MS-XLS] 2.5.198.86 ; [MS-XLSB] 2.5.97.69 */
- function parse_PtgRefErr(blob, length, opts) {
- var type = (blob.read_shift(1) >>> 5) & 0x03;
- blob.l += 4;
- if(opts.biff < 8) blob.l--;
- if(opts.biff == 12) blob.l += 2;
- return [type];
- }
-
- /* [MS-XLS] 2.5.198.87 ; [MS-XLSB] 2.5.97.71 */
- function parse_PtgRefErr3d(blob, length, opts) {
- var type = (blob[blob.l++] & 0x60) >> 5;
- var ixti = blob.read_shift(2);
- var w = 4;
- if(opts) switch(opts.biff) {
- case 5: w = 15; break;
- case 12: w = 6; break;
- }
- blob.l += w;
- return [type, ixti];
- }
-
- /* [MS-XLS] 2.5.198.71 ; [MS-XLSB] 2.5.97.55 */
- var parse_PtgMemErr = parsenoop;
- /* [MS-XLS] 2.5.198.73 ; [MS-XLSB] 2.5.97.57 */
- var parse_PtgMemNoMem = parsenoop;
- /* [MS-XLS] 2.5.198.92 */
- var parse_PtgTbl = parsenoop;
-
- function parse_PtgElfLoc(blob, length, opts) {
- blob.l += 2;
- return [parse_RgceElfLoc(blob, 4, opts)];
- }
- function parse_PtgElfNoop(blob) {
- blob.l += 6;
- return [];
- }
- /* [MS-XLS] 2.5.198.46 */
- var parse_PtgElfCol = parse_PtgElfLoc;
- /* [MS-XLS] 2.5.198.47 */
- var parse_PtgElfColS = parse_PtgElfNoop;
- /* [MS-XLS] 2.5.198.48 */
- var parse_PtgElfColSV = parse_PtgElfNoop;
- /* [MS-XLS] 2.5.198.49 */
- var parse_PtgElfColV = parse_PtgElfLoc;
- /* [MS-XLS] 2.5.198.50 */
- function parse_PtgElfLel(blob) {
- blob.l += 2;
- return [parseuint16(blob), blob.read_shift(2) & 0x01];
- }
- /* [MS-XLS] 2.5.198.51 */
- var parse_PtgElfRadical = parse_PtgElfLoc;
- /* [MS-XLS] 2.5.198.52 */
- var parse_PtgElfRadicalLel = parse_PtgElfLel;
- /* [MS-XLS] 2.5.198.53 */
- var parse_PtgElfRadicalS = parse_PtgElfNoop;
- /* [MS-XLS] 2.5.198.54 */
- var parse_PtgElfRw = parse_PtgElfLoc;
- /* [MS-XLS] 2.5.198.55 */
- var parse_PtgElfRwV = parse_PtgElfLoc;
-
- /* [MS-XLSB] 2.5.97.52 TODO */
- var PtgListRT = [
- "Data",
- "All",
- "Headers",
- "??",
- "?Data2",
- "??",
- "?DataHeaders",
- "??",
- "Totals",
- "??",
- "??",
- "??",
- "?DataTotals",
- "??",
- "??",
- "??",
- "?Current"
- ];
- function parse_PtgList(blob) {
- blob.l += 2;
- var ixti = blob.read_shift(2);
- var flags = blob.read_shift(2);
- var idx = blob.read_shift(4);
- var c = blob.read_shift(2);
- var C = blob.read_shift(2);
- var rt = PtgListRT[(flags >> 2) & 0x1F];
- return {ixti: ixti, coltype:(flags&0x3), rt:rt, idx:idx, c:c, C:C};
- }
- /* [MS-XLS] 2.5.198.91 ; [MS-XLSB] 2.5.97.76 */
- function parse_PtgSxName(blob) {
- blob.l += 2;
- return [blob.read_shift(4)];
- }
-
- /* [XLS] old spec */
- function parse_PtgSheet(blob, length, opts) {
- blob.l += 5;
- blob.l += 2;
- blob.l += (opts.biff == 2 ? 1 : 4);
- return ["PTGSHEET"];
- }
- function parse_PtgEndSheet(blob, length, opts) {
- blob.l += (opts.biff == 2 ? 4 : 5);
- return ["PTGENDSHEET"];
- }
- function parse_PtgMemAreaN(blob) {
- var type = (blob.read_shift(1) >>> 5) & 0x03;
- var cce = blob.read_shift(2);
- return [type, cce];
- }
- function parse_PtgMemNoMemN(blob) {
- var type = (blob.read_shift(1) >>> 5) & 0x03;
- var cce = blob.read_shift(2);
- return [type, cce];
- }
- function parse_PtgAttrNoop(blob) {
- blob.l += 4;
- return [0, 0];
- }
-
- /* [MS-XLS] 2.5.198.25 ; [MS-XLSB] 2.5.97.16 */
- var PtgTypes = {
- 0x01: { n:'PtgExp', f:parse_PtgExp },
- 0x02: { n:'PtgTbl', f:parse_PtgTbl },
- 0x03: { n:'PtgAdd', f:parseread1 },
- 0x04: { n:'PtgSub', f:parseread1 },
- 0x05: { n:'PtgMul', f:parseread1 },
- 0x06: { n:'PtgDiv', f:parseread1 },
- 0x07: { n:'PtgPower', f:parseread1 },
- 0x08: { n:'PtgConcat', f:parseread1 },
- 0x09: { n:'PtgLt', f:parseread1 },
- 0x0A: { n:'PtgLe', f:parseread1 },
- 0x0B: { n:'PtgEq', f:parseread1 },
- 0x0C: { n:'PtgGe', f:parseread1 },
- 0x0D: { n:'PtgGt', f:parseread1 },
- 0x0E: { n:'PtgNe', f:parseread1 },
- 0x0F: { n:'PtgIsect', f:parseread1 },
- 0x10: { n:'PtgUnion', f:parseread1 },
- 0x11: { n:'PtgRange', f:parseread1 },
- 0x12: { n:'PtgUplus', f:parseread1 },
- 0x13: { n:'PtgUminus', f:parseread1 },
- 0x14: { n:'PtgPercent', f:parseread1 },
- 0x15: { n:'PtgParen', f:parseread1 },
- 0x16: { n:'PtgMissArg', f:parseread1 },
- 0x17: { n:'PtgStr', f:parse_PtgStr },
- 0x1A: { n:'PtgSheet', f:parse_PtgSheet },
- 0x1B: { n:'PtgEndSheet', f:parse_PtgEndSheet },
- 0x1C: { n:'PtgErr', f:parse_PtgErr },
- 0x1D: { n:'PtgBool', f:parse_PtgBool },
- 0x1E: { n:'PtgInt', f:parse_PtgInt },
- 0x1F: { n:'PtgNum', f:parse_PtgNum },
- 0x20: { n:'PtgArray', f:parse_PtgArray },
- 0x21: { n:'PtgFunc', f:parse_PtgFunc },
- 0x22: { n:'PtgFuncVar', f:parse_PtgFuncVar },
- 0x23: { n:'PtgName', f:parse_PtgName },
- 0x24: { n:'PtgRef', f:parse_PtgRef },
- 0x25: { n:'PtgArea', f:parse_PtgArea },
- 0x26: { n:'PtgMemArea', f:parse_PtgMemArea },
- 0x27: { n:'PtgMemErr', f:parse_PtgMemErr },
- 0x28: { n:'PtgMemNoMem', f:parse_PtgMemNoMem },
- 0x29: { n:'PtgMemFunc', f:parse_PtgMemFunc },
- 0x2A: { n:'PtgRefErr', f:parse_PtgRefErr },
- 0x2B: { n:'PtgAreaErr', f:parse_PtgAreaErr },
- 0x2C: { n:'PtgRefN', f:parse_PtgRefN },
- 0x2D: { n:'PtgAreaN', f:parse_PtgAreaN },
- 0x2E: { n:'PtgMemAreaN', f:parse_PtgMemAreaN },
- 0x2F: { n:'PtgMemNoMemN', f:parse_PtgMemNoMemN },
- 0x39: { n:'PtgNameX', f:parse_PtgNameX },
- 0x3A: { n:'PtgRef3d', f:parse_PtgRef3d },
- 0x3B: { n:'PtgArea3d', f:parse_PtgArea3d },
- 0x3C: { n:'PtgRefErr3d', f:parse_PtgRefErr3d },
- 0x3D: { n:'PtgAreaErr3d', f:parse_PtgAreaErr3d },
- 0xFF: {}
- };
- /* These are duplicated in the PtgTypes table */
- var PtgDupes = {
- 0x40: 0x20, 0x60: 0x20,
- 0x41: 0x21, 0x61: 0x21,
- 0x42: 0x22, 0x62: 0x22,
- 0x43: 0x23, 0x63: 0x23,
- 0x44: 0x24, 0x64: 0x24,
- 0x45: 0x25, 0x65: 0x25,
- 0x46: 0x26, 0x66: 0x26,
- 0x47: 0x27, 0x67: 0x27,
- 0x48: 0x28, 0x68: 0x28,
- 0x49: 0x29, 0x69: 0x29,
- 0x4A: 0x2A, 0x6A: 0x2A,
- 0x4B: 0x2B, 0x6B: 0x2B,
- 0x4C: 0x2C, 0x6C: 0x2C,
- 0x4D: 0x2D, 0x6D: 0x2D,
- 0x4E: 0x2E, 0x6E: 0x2E,
- 0x4F: 0x2F, 0x6F: 0x2F,
- 0x58: 0x22, 0x78: 0x22,
- 0x59: 0x39, 0x79: 0x39,
- 0x5A: 0x3A, 0x7A: 0x3A,
- 0x5B: 0x3B, 0x7B: 0x3B,
- 0x5C: 0x3C, 0x7C: 0x3C,
- 0x5D: 0x3D, 0x7D: 0x3D
- };
- (function(){for(var y in PtgDupes) PtgTypes[y] = PtgTypes[PtgDupes[y]];})();
-
- var Ptg18 = {
- 0x01: { n:'PtgElfLel', f:parse_PtgElfLel },
- 0x02: { n:'PtgElfRw', f:parse_PtgElfRw },
- 0x03: { n:'PtgElfCol', f:parse_PtgElfCol },
- 0x06: { n:'PtgElfRwV', f:parse_PtgElfRwV },
- 0x07: { n:'PtgElfColV', f:parse_PtgElfColV },
- 0x0A: { n:'PtgElfRadical', f:parse_PtgElfRadical },
- 0x0B: { n:'PtgElfRadicalS', f:parse_PtgElfRadicalS },
- 0x0D: { n:'PtgElfColS', f:parse_PtgElfColS },
- 0x0F: { n:'PtgElfColSV', f:parse_PtgElfColSV },
- 0x10: { n:'PtgElfRadicalLel', f:parse_PtgElfRadicalLel },
- 0x19: { n:'PtgList', f:parse_PtgList },
- 0x1D: { n:'PtgSxName', f:parse_PtgSxName },
- 0xFF: {}
- };
- var Ptg19 = {
- 0x00: { n:'PtgAttrNoop', f:parse_PtgAttrNoop },
- 0x01: { n:'PtgAttrSemi', f:parse_PtgAttrSemi },
- 0x02: { n:'PtgAttrIf', f:parse_PtgAttrIf },
- 0x04: { n:'PtgAttrChoose', f:parse_PtgAttrChoose },
- 0x08: { n:'PtgAttrGoto', f:parse_PtgAttrGoto },
- 0x10: { n:'PtgAttrSum', f:parse_PtgAttrSum },
- 0x20: { n:'PtgAttrBaxcel', f:parse_PtgAttrBaxcel },
- 0x40: { n:'PtgAttrSpace', f:parse_PtgAttrSpace },
- 0x41: { n:'PtgAttrSpaceSemi', f:parse_PtgAttrSpaceSemi },
- 0x80: { n:'PtgAttrIfError', f:parse_PtgAttrIfError },
- 0xFF: {}
- };
- Ptg19[0x21] = Ptg19[0x20];
-
- /* [MS-XLS] 2.5.198.103 ; [MS-XLSB] 2.5.97.87 */
- function parse_RgbExtra(blob, length, rgce, opts) {
- if(opts.biff < 8) return parsenoop(blob, length);
- var target = blob.l + length;
- var o = [];
- for(var i = 0; i !== rgce.length; ++i) {
- switch(rgce[i][0]) {
- case 'PtgArray': /* PtgArray -> PtgExtraArray */
- rgce[i][1] = parse_PtgExtraArray(blob, 0, opts);
- o.push(rgce[i][1]);
- break;
- case 'PtgMemArea': /* PtgMemArea -> PtgExtraMem */
- rgce[i][2] = parse_PtgExtraMem(blob, rgce[i][1], opts);
- o.push(rgce[i][2]);
- break;
- case 'PtgExp': /* PtgExp -> PtgExtraCol */
- if(opts && opts.biff == 12) {
- rgce[i][1][1] = blob.read_shift(4);
- o.push(rgce[i][1]);
- } break;
- case 'PtgList': /* TODO: PtgList -> PtgExtraList */
- case 'PtgElfRadicalS': /* TODO: PtgElfRadicalS -> PtgExtraElf */
- case 'PtgElfColS': /* TODO: PtgElfColS -> PtgExtraElf */
- case 'PtgElfColSV': /* TODO: PtgElfColSV -> PtgExtraElf */
- throw "Unsupported " + rgce[i][0];
- default: break;
- }
- }
- length = target - blob.l;
- /* note: this is technically an error but Excel disregards */
- //if(target !== blob.l && blob.l !== target - length) throw new Error(target + " != " + blob.l);
- if(length !== 0) o.push(parsenoop(blob, length));
- return o;
- }
-
- /* [MS-XLS] 2.5.198.104 ; [MS-XLSB] 2.5.97.88 */
- function parse_Rgce(blob, length, opts) {
- var target = blob.l + length;
- var R, id, ptgs = [];
- while(target != blob.l) {
- length = target - blob.l;
- id = blob[blob.l];
- R = PtgTypes[id];
- if(id === 0x18 || id === 0x19) R = (id === 0x18 ? Ptg18 : Ptg19)[blob[blob.l + 1]];
- if(!R || !R.f) { /*ptgs.push*/(parsenoop(blob, length)); }
- else { ptgs.push([R.n, R.f(blob, length, opts)]); }
- }
- return ptgs;
- }
-
- function stringify_array(f) {
- var o = [];
- for(var i = 0; i < f.length; ++i) {
- var x = f[i], r = [];
- for(var j = 0; j < x.length; ++j) {
- var y = x[j];
- if(y) switch(y[0]) {
- // TODO: handle embedded quotes
- case 0x02:
- r.push('"' + y[1].replace(/"/g,'""') + '"'); break;
- default: r.push(y[1]);
- } else r.push("");
- }
- o.push(r.join(","));
- }
- return o.join(";");
- }
-
- /* [MS-XLS] 2.2.2 ; [MS-XLSB] 2.2.2 TODO */
- var PtgBinOp = {
- PtgAdd: "+",
- PtgConcat: "&",
- PtgDiv: "/",
- PtgEq: "=",
- PtgGe: ">=",
- PtgGt: ">",
- PtgLe: "<=",
- PtgLt: "<",
- PtgMul: "*",
- PtgNe: "<>",
- PtgPower: "^",
- PtgSub: "-"
- };
- function formula_quote_sheet_name(sname, opts) {
- if(!sname && !(opts && opts.biff <= 5 && opts.biff >= 2)) throw new Error("empty sheet name");
- if(sname.indexOf(" ") > -1) return "'" + sname + "'";
- return sname;
- }
- function get_ixti_raw(supbooks, ixti, opts) {
- if(!supbooks) return "SH33TJSERR0";
- if(opts.biff > 8 && (!supbooks.XTI || !supbooks.XTI[ixti])) return supbooks.SheetNames[ixti];
- if(!supbooks.XTI) return "SH33TJSERR6";
- var XTI = supbooks.XTI[ixti];
- if(opts.biff < 8) {
- if(ixti > 10000) ixti-= 65536;
- if(ixti < 0) ixti = -ixti;
- return ixti == 0 ? "" : supbooks.XTI[ixti - 1];
- }
- if(!XTI) return "SH33TJSERR1";
- var o = "";
- if(opts.biff > 8) switch(supbooks[XTI[0]][0]) {
- case 0x0165: /* 'BrtSupSelf' */
- o = XTI[1] == -1 ? "#REF" : supbooks.SheetNames[XTI[1]];
- return XTI[1] == XTI[2] ? o : o + ":" + supbooks.SheetNames[XTI[2]];
- case 0x0166: /* 'BrtSupSame' */
- if(opts.SID != null) return supbooks.SheetNames[opts.SID];
- return "SH33TJSSAME" + supbooks[XTI[0]][0];
- case 0x0163: /* 'BrtSupBookSrc' */
- /* falls through */
- default: return "SH33TJSSRC" + supbooks[XTI[0]][0];
- }
- switch(supbooks[XTI[0]][0][0]) {
- case 0x0401:
- o = XTI[1] == -1 ? "#REF" : (supbooks.SheetNames[XTI[1]] || "SH33TJSERR3");
- return XTI[1] == XTI[2] ? o : o + ":" + supbooks.SheetNames[XTI[2]];
- case 0x3A01: return supbooks[XTI[0]].slice(1).map(function(name) { return name.Name; }).join(";;"); //return "SH33TJSERR8";
- default:
- if(!supbooks[XTI[0]][0][3]) return "SH33TJSERR2";
- o = XTI[1] == -1 ? "#REF" : (supbooks[XTI[0]][0][3][XTI[1]] || "SH33TJSERR4");
- return XTI[1] == XTI[2] ? o : o + ":" + supbooks[XTI[0]][0][3][XTI[2]];
- }
- }
- function get_ixti(supbooks, ixti, opts) {
- return formula_quote_sheet_name(get_ixti_raw(supbooks, ixti, opts), opts);
- }
- function stringify_formula(formula/*Array<any>*/, range, cell, supbooks, opts) {
- var biff = (opts && opts.biff) || 8;
- var _range = /*range != null ? range :*/ {s:{c:0, r:0},e:{c:0, r:0}};
- var stack = [], e1, e2, c, ixti=0, nameidx=0, r, sname="";
- if(!formula[0] || !formula[0][0]) return "";
- var last_sp = -1, sp = "";
- for(var ff = 0, fflen = formula[0].length; ff < fflen; ++ff) {
- var f = formula[0][ff];
- switch(f[0]) {
- case 'PtgUminus': /* [MS-XLS] 2.5.198.93 */
- stack.push("-" + stack.pop()); break;
- case 'PtgUplus': /* [MS-XLS] 2.5.198.95 */
- stack.push("+" + stack.pop()); break;
- case 'PtgPercent': /* [MS-XLS] 2.5.198.81 */
- stack.push(stack.pop() + "%"); break;
-
- case 'PtgAdd': /* [MS-XLS] 2.5.198.26 */
- case 'PtgConcat': /* [MS-XLS] 2.5.198.43 */
- case 'PtgDiv': /* [MS-XLS] 2.5.198.45 */
- case 'PtgEq': /* [MS-XLS] 2.5.198.56 */
- case 'PtgGe': /* [MS-XLS] 2.5.198.64 */
- case 'PtgGt': /* [MS-XLS] 2.5.198.65 */
- case 'PtgLe': /* [MS-XLS] 2.5.198.68 */
- case 'PtgLt': /* [MS-XLS] 2.5.198.69 */
- case 'PtgMul': /* [MS-XLS] 2.5.198.75 */
- case 'PtgNe': /* [MS-XLS] 2.5.198.78 */
- case 'PtgPower': /* [MS-XLS] 2.5.198.82 */
- case 'PtgSub': /* [MS-XLS] 2.5.198.90 */
- e1 = stack.pop(); e2 = stack.pop();
- if(last_sp >= 0) {
- switch(formula[0][last_sp][1][0]) {
- case 0:
- // $FlowIgnore
- sp = fill(" ", formula[0][last_sp][1][1]); break;
- case 1:
- // $FlowIgnore
- sp = fill("\r", formula[0][last_sp][1][1]); break;
- default:
- sp = "";
- // $FlowIgnore
- if(opts.WTF) throw new Error("Unexpected PtgAttrSpaceType " + formula[0][last_sp][1][0]);
- }
- e2 = e2 + sp;
- last_sp = -1;
- }
- stack.push(e2+PtgBinOp[f[0]]+e1);
- break;
-
- case 'PtgIsect': /* [MS-XLS] 2.5.198.67 */
- e1 = stack.pop(); e2 = stack.pop();
- stack.push(e2+" "+e1);
- break;
- case 'PtgUnion': /* [MS-XLS] 2.5.198.94 */
- e1 = stack.pop(); e2 = stack.pop();
- stack.push(e2+","+e1);
- break;
- case 'PtgRange': /* [MS-XLS] 2.5.198.83 */
- e1 = stack.pop(); e2 = stack.pop();
- stack.push(e2+":"+e1);
- break;
-
- case 'PtgAttrChoose': /* [MS-XLS] 2.5.198.34 */
- break;
- case 'PtgAttrGoto': /* [MS-XLS] 2.5.198.35 */
- break;
- case 'PtgAttrIf': /* [MS-XLS] 2.5.198.36 */
- break;
- case 'PtgAttrIfError': /* [MS-XLSB] 2.5.97.28 */
- break;
-
-
- case 'PtgRef': /* [MS-XLS] 2.5.198.84 */
- c = shift_cell_xls((f[1][1]), _range, opts);
- stack.push(encode_cell_xls(c, biff));
- break;
- case 'PtgRefN': /* [MS-XLS] 2.5.198.88 */
- c = cell ? shift_cell_xls((f[1][1]), cell, opts) : (f[1][1]);
- stack.push(encode_cell_xls(c, biff));
- break;
- case 'PtgRef3d': /* [MS-XLS] 2.5.198.85 */
- ixti = f[1][1]; c = shift_cell_xls((f[1][2]), _range, opts);
- sname = get_ixti(supbooks, ixti, opts);
- var w = sname; /* IE9 fails on defined names */ // eslint-disable-line no-unused-vars
- stack.push(sname + "!" + encode_cell_xls(c, biff));
- break;
-
- case 'PtgFunc': /* [MS-XLS] 2.5.198.62 */
- case 'PtgFuncVar': /* [MS-XLS] 2.5.198.63 */
- /* f[1] = [argc, func, type] */
- var argc = (f[1][0]), func = (f[1][1]);
- if(!argc) argc = 0;
- argc &= 0x7F;
- var args = argc == 0 ? [] : stack.slice(-argc);
- stack.length -= argc;
- if(func === 'User') func = args.shift();
- stack.push(func + "(" + args.join(",") + ")");
- break;
-
- case 'PtgBool': /* [MS-XLS] 2.5.198.42 */
- stack.push(f[1] ? "TRUE" : "FALSE"); break;
- case 'PtgInt': /* [MS-XLS] 2.5.198.66 */
- stack.push(f[1]); break;
- case 'PtgNum': /* [MS-XLS] 2.5.198.79 TODO: precision? */
- stack.push(String(f[1])); break;
- case 'PtgStr': /* [MS-XLS] 2.5.198.89 */
- // $FlowIgnore
- stack.push('"' + f[1].replace(/"/g, '""') + '"'); break;
- case 'PtgErr': /* [MS-XLS] 2.5.198.57 */
- stack.push(f[1]); break;
- case 'PtgAreaN': /* [MS-XLS] 2.5.198.31 TODO */
- r = shift_range_xls(f[1][1], cell ? {s:cell} : _range, opts);
- stack.push(encode_range_xls((r), opts));
- break;
- case 'PtgArea': /* [MS-XLS] 2.5.198.27 TODO: fixed points */
- r = shift_range_xls(f[1][1], _range, opts);
- stack.push(encode_range_xls((r), opts));
- break;
- case 'PtgArea3d': /* [MS-XLS] 2.5.198.28 TODO */
- ixti = f[1][1]; r = f[1][2];
- sname = get_ixti(supbooks, ixti, opts);
- stack.push(sname + "!" + encode_range_xls((r), opts));
- break;
- case 'PtgAttrSum': /* [MS-XLS] 2.5.198.41 */
- stack.push("SUM(" + stack.pop() + ")");
- break;
-
- case 'PtgAttrBaxcel': /* [MS-XLS] 2.5.198.33 */
- case 'PtgAttrSemi': /* [MS-XLS] 2.5.198.37 */
- break;
-
- case 'PtgName': /* [MS-XLS] 2.5.198.76 ; [MS-XLSB] 2.5.97.60 TODO: revisions */
- /* f[1] = type, 0, nameindex */
- nameidx = (f[1][2]);
- var lbl = (supbooks.names||[])[nameidx-1] || (supbooks[0]||[])[nameidx];
- var name = lbl ? lbl.Name : "SH33TJSNAME" + String(nameidx);
- if(name in XLSXFutureFunctions) name = XLSXFutureFunctions[name];
- stack.push(name);
- break;
-
- case 'PtgNameX': /* [MS-XLS] 2.5.198.77 ; [MS-XLSB] 2.5.97.61 TODO: revisions */
- /* f[1] = type, ixti, nameindex */
- var bookidx = (f[1][1]); nameidx = (f[1][2]); var externbook;
- /* TODO: Properly handle missing values -- this should be using get_ixti_raw primarily */
- if(opts.biff <= 5) {
- if(bookidx < 0) bookidx = -bookidx;
- if(supbooks[bookidx]) externbook = supbooks[bookidx][nameidx];
- } else {
- var o = "";
- if(((supbooks[bookidx]||[])[0]||[])[0] == 0x3A01){/* empty */}
- else if(((supbooks[bookidx]||[])[0]||[])[0] == 0x0401){
- if(supbooks[bookidx][nameidx] && supbooks[bookidx][nameidx].itab > 0) {
- o = supbooks.SheetNames[supbooks[bookidx][nameidx].itab-1] + "!";
- }
- }
- else o = supbooks.SheetNames[nameidx-1]+ "!";
- if(supbooks[bookidx] && supbooks[bookidx][nameidx]) o += supbooks[bookidx][nameidx].Name;
- else if(supbooks[0] && supbooks[0][nameidx]) o += supbooks[0][nameidx].Name;
- else {
- var ixtidata = get_ixti_raw(supbooks, bookidx, opts).split(";;");
- if(ixtidata[nameidx - 1]) o = ixtidata[nameidx - 1]; // TODO: confirm this is correct
- else o += "SH33TJSERRX";
- }
- stack.push(o);
- break;
- }
- if(!externbook) externbook = {Name: "SH33TJSERRY"};
- stack.push(externbook.Name);
- break;
-
- case 'PtgParen': /* [MS-XLS] 2.5.198.80 */
- var lp = '(', rp = ')';
- if(last_sp >= 0) {
- sp = "";
- switch(formula[0][last_sp][1][0]) {
- // $FlowIgnore
- case 2: lp = fill(" ", formula[0][last_sp][1][1]) + lp; break;
- // $FlowIgnore
- case 3: lp = fill("\r", formula[0][last_sp][1][1]) + lp; break;
- // $FlowIgnore
- case 4: rp = fill(" ", formula[0][last_sp][1][1]) + rp; break;
- // $FlowIgnore
- case 5: rp = fill("\r", formula[0][last_sp][1][1]) + rp; break;
- default:
- // $FlowIgnore
- if(opts.WTF) throw new Error("Unexpected PtgAttrSpaceType " + formula[0][last_sp][1][0]);
- }
- last_sp = -1;
- }
- stack.push(lp + stack.pop() + rp); break;
-
- case 'PtgRefErr': /* [MS-XLS] 2.5.198.86 */
- stack.push('#REF!'); break;
-
- case 'PtgRefErr3d': /* [MS-XLS] 2.5.198.87 */
- stack.push('#REF!'); break;
-
- case 'PtgExp': /* [MS-XLS] 2.5.198.58 TODO */
- c = {c:(f[1][1]),r:(f[1][0])};
- var q = ({c: cell.c, r:cell.r});
- if(supbooks.sharedf[encode_cell(c)]) {
- var parsedf = (supbooks.sharedf[encode_cell(c)]);
- stack.push(stringify_formula(parsedf, _range, q, supbooks, opts));
- }
- else {
- var fnd = false;
- for(e1=0;e1!=supbooks.arrayf.length; ++e1) {
- /* TODO: should be something like range_has */
- e2 = supbooks.arrayf[e1];
- if(c.c < e2[0].s.c || c.c > e2[0].e.c) continue;
- if(c.r < e2[0].s.r || c.r > e2[0].e.r) continue;
- stack.push(stringify_formula(e2[1], _range, q, supbooks, opts));
- fnd = true;
- break;
- }
- if(!fnd) stack.push(f[1]);
- }
- break;
-
- case 'PtgArray': /* [MS-XLS] 2.5.198.32 TODO */
- stack.push("{" + stringify_array(f[1]) + "}");
- break;
-
- case 'PtgMemArea': /* [MS-XLS] 2.5.198.70 TODO: confirm this is a non-display */
- //stack.push("(" + f[2].map(encode_range).join(",") + ")");
- break;
-
- case 'PtgAttrSpace': /* [MS-XLS] 2.5.198.38 */
- case 'PtgAttrSpaceSemi': /* [MS-XLS] 2.5.198.39 */
- last_sp = ff;
- break;
-
- case 'PtgTbl': /* [MS-XLS] 2.5.198.92 TODO */
- break;
-
- case 'PtgMemErr': /* [MS-XLS] 2.5.198.71 */
- break;
-
- case 'PtgMissArg': /* [MS-XLS] 2.5.198.74 */
- stack.push("");
- break;
-
- case 'PtgAreaErr': /* [MS-XLS] 2.5.198.29 */
- stack.push("#REF!"); break;
-
- case 'PtgAreaErr3d': /* [MS-XLS] 2.5.198.30 */
- stack.push("#REF!"); break;
-
- case 'PtgList': /* [MS-XLSB] 2.5.97.52 */
- // $FlowIgnore
- stack.push("Table" + f[1].idx + "[#" + f[1].rt + "]");
- break;
-
- case 'PtgMemAreaN':
- case 'PtgMemNoMemN':
- case 'PtgAttrNoop':
- case 'PtgSheet':
- case 'PtgEndSheet':
- break;
-
- case 'PtgMemFunc': /* [MS-XLS] 2.5.198.72 TODO */
- break;
- case 'PtgMemNoMem': /* [MS-XLS] 2.5.198.73 TODO */
- break;
-
- case 'PtgElfCol': /* [MS-XLS] 2.5.198.46 */
- case 'PtgElfColS': /* [MS-XLS] 2.5.198.47 */
- case 'PtgElfColSV': /* [MS-XLS] 2.5.198.48 */
- case 'PtgElfColV': /* [MS-XLS] 2.5.198.49 */
- case 'PtgElfLel': /* [MS-XLS] 2.5.198.50 */
- case 'PtgElfRadical': /* [MS-XLS] 2.5.198.51 */
- case 'PtgElfRadicalLel': /* [MS-XLS] 2.5.198.52 */
- case 'PtgElfRadicalS': /* [MS-XLS] 2.5.198.53 */
- case 'PtgElfRw': /* [MS-XLS] 2.5.198.54 */
- case 'PtgElfRwV': /* [MS-XLS] 2.5.198.55 */
- throw new Error("Unsupported ELFs");
-
- case 'PtgSxName': /* [MS-XLS] 2.5.198.91 TODO -- find a test case */
- throw new Error('Unrecognized Formula Token: ' + String(f));
- default: throw new Error('Unrecognized Formula Token: ' + String(f));
- }
- var PtgNonDisp = ['PtgAttrSpace', 'PtgAttrSpaceSemi', 'PtgAttrGoto'];
- if(opts.biff != 3) if(last_sp >= 0 && PtgNonDisp.indexOf(formula[0][ff][0]) == -1) {
- f = formula[0][last_sp];
- var _left = true;
- switch(f[1][0]) {
- /* note: some bad XLSB files omit the PtgParen */
- case 4: _left = false;
- /* falls through */
- case 0:
- // $FlowIgnore
- sp = fill(" ", f[1][1]); break;
- case 5: _left = false;
- /* falls through */
- case 1:
- // $FlowIgnore
- sp = fill("\r", f[1][1]); break;
- default:
- sp = "";
- // $FlowIgnore
- if(opts.WTF) throw new Error("Unexpected PtgAttrSpaceType " + f[1][0]);
- }
- stack.push((_left ? sp : "") + stack.pop() + (_left ? "" : sp));
- last_sp = -1;
- }
- }
- if(stack.length > 1 && opts.WTF) throw new Error("bad formula stack");
- return stack[0];
- }
-
- /* [MS-XLS] 2.5.198.1 TODO */
- function parse_ArrayParsedFormula(blob, length, opts) {
- var target = blob.l + length, len = opts.biff == 2 ? 1 : 2;
- var rgcb, cce = blob.read_shift(len); // length of rgce
- if(cce == 0xFFFF) return [[],parsenoop(blob, length-2)];
- var rgce = parse_Rgce(blob, cce, opts);
- if(length !== cce + len) rgcb = parse_RgbExtra(blob, length - cce - len, rgce, opts);
- blob.l = target;
- return [rgce, rgcb];
- }
-
- /* [MS-XLS] 2.5.198.3 TODO */
- function parse_XLSCellParsedFormula(blob, length, opts) {
- var target = blob.l + length, len = opts.biff == 2 ? 1 : 2;
- var rgcb, cce = blob.read_shift(len); // length of rgce
- if(cce == 0xFFFF) return [[],parsenoop(blob, length-2)];
- var rgce = parse_Rgce(blob, cce, opts);
- if(length !== cce + len) rgcb = parse_RgbExtra(blob, length - cce - len, rgce, opts);
- blob.l = target;
- return [rgce, rgcb];
- }
-
- /* [MS-XLS] 2.5.198.21 */
- function parse_NameParsedFormula(blob, length, opts, cce) {
- var target = blob.l + length;
- var rgce = parse_Rgce(blob, cce, opts);
- var rgcb;
- if(target !== blob.l) rgcb = parse_RgbExtra(blob, target - blob.l, rgce, opts);
- return [rgce, rgcb];
- }
-
- /* [MS-XLS] 2.5.198.118 TODO */
- function parse_SharedParsedFormula(blob, length, opts) {
- var target = blob.l + length;
- var rgcb, cce = blob.read_shift(2); // length of rgce
- var rgce = parse_Rgce(blob, cce, opts);
- if(cce == 0xFFFF) return [[],parsenoop(blob, length-2)];
- if(length !== cce + 2) rgcb = parse_RgbExtra(blob, target - cce - 2, rgce, opts);
- return [rgce, rgcb];
- }
-
- /* [MS-XLS] 2.5.133 TODO: how to emit empty strings? */
- function parse_FormulaValue(blob) {
- var b;
- if(__readUInt16LE(blob,blob.l + 6) !== 0xFFFF) return [parse_Xnum(blob),'n'];
- switch(blob[blob.l]) {
- case 0x00: blob.l += 8; return ["String", 's'];
- case 0x01: b = blob[blob.l+2] === 0x1; blob.l += 8; return [b,'b'];
- case 0x02: b = blob[blob.l+2]; blob.l += 8; return [b,'e'];
- case 0x03: blob.l += 8; return ["",'s'];
- }
- return [];
- }
- function write_FormulaValue(value) {
- if(value == null) {
- // Blank String Value
- var o = new_buf(8);
- o.write_shift(1, 0x03);
- o.write_shift(1, 0);
- o.write_shift(2, 0);
- o.write_shift(2, 0);
- o.write_shift(2, 0xFFFF);
- return o;
- } else if(typeof value == "number") return write_Xnum(value);
- return write_Xnum(0);
- }
-
- /* [MS-XLS] 2.4.127 TODO */
- function parse_Formula(blob, length, opts) {
- var end = blob.l + length;
- var cell = parse_XLSCell(blob, 6);
- if(opts.biff == 2) ++blob.l;
- var val = parse_FormulaValue(blob,8);
- var flags = blob.read_shift(1);
- if(opts.biff != 2) {
- blob.read_shift(1);
- if(opts.biff >= 5) {
- /*var chn = */blob.read_shift(4);
- }
- }
- var cbf = parse_XLSCellParsedFormula(blob, end - blob.l, opts);
- return {cell:cell, val:val[0], formula:cbf, shared: (flags >> 3) & 1, tt:val[1]};
- }
- function write_Formula(cell, R, C, opts, os) {
- // Cell
- var o1 = write_XLSCell(R, C, os);
-
- // FormulaValue
- var o2 = write_FormulaValue(cell.v);
-
- // flags + cache
- var o3 = new_buf(6);
- var flags = 0x01 | 0x20;
- o3.write_shift(2, flags);
- o3.write_shift(4, 0);
-
- // CellParsedFormula
- var bf = new_buf(cell.bf.length);
- for(var i = 0; i < cell.bf.length; ++i) bf[i] = cell.bf[i];
-
- var out = bconcat([o1, o2, o3, bf]);
- return out;
- }
-
-
- /* XLSB Parsed Formula records have the same shape */
- function parse_XLSBParsedFormula(data, length, opts) {
- var cce = data.read_shift(4);
- var rgce = parse_Rgce(data, cce, opts);
- var cb = data.read_shift(4);
- var rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;
- return [rgce, rgcb];
- }
-
- /* [MS-XLSB] 2.5.97.1 ArrayParsedFormula */
- var parse_XLSBArrayParsedFormula = parse_XLSBParsedFormula;
- /* [MS-XLSB] 2.5.97.4 CellParsedFormula */
- var parse_XLSBCellParsedFormula = parse_XLSBParsedFormula;
- /* [MS-XLSB] 2.5.97.8 DVParsedFormula */
- //var parse_XLSBDVParsedFormula = parse_XLSBParsedFormula;
- /* [MS-XLSB] 2.5.97.9 FRTParsedFormula */
- //var parse_XLSBFRTParsedFormula = parse_XLSBParsedFormula2;
- /* [MS-XLSB] 2.5.97.12 NameParsedFormula */
- var parse_XLSBNameParsedFormula = parse_XLSBParsedFormula;
- /* [MS-XLSB] 2.5.97.98 SharedParsedFormula */
- var parse_XLSBSharedParsedFormula = parse_XLSBParsedFormula;
- /* [MS-XLS] 2.5.198.4 */
- var Cetab = {
- 0x0000: 'BEEP',
- 0x0001: 'OPEN',
- 0x0002: 'OPEN.LINKS',
- 0x0003: 'CLOSE.ALL',
- 0x0004: 'SAVE',
- 0x0005: 'SAVE.AS',
- 0x0006: 'FILE.DELETE',
- 0x0007: 'PAGE.SETUP',
- 0x0008: 'PRINT',
- 0x0009: 'PRINTER.SETUP',
- 0x000A: 'QUIT',
- 0x000B: 'NEW.WINDOW',
- 0x000C: 'ARRANGE.ALL',
- 0x000D: 'WINDOW.SIZE',
- 0x000E: 'WINDOW.MOVE',
- 0x000F: 'FULL',
- 0x0010: 'CLOSE',
- 0x0011: 'RUN',
- 0x0016: 'SET.PRINT.AREA',
- 0x0017: 'SET.PRINT.TITLES',
- 0x0018: 'SET.PAGE.BREAK',
- 0x0019: 'REMOVE.PAGE.BREAK',
- 0x001A: 'FONT',
- 0x001B: 'DISPLAY',
- 0x001C: 'PROTECT.DOCUMENT',
- 0x001D: 'PRECISION',
- 0x001E: 'A1.R1C1',
- 0x001F: 'CALCULATE.NOW',
- 0x0020: 'CALCULATION',
- 0x0022: 'DATA.FIND',
- 0x0023: 'EXTRACT',
- 0x0024: 'DATA.DELETE',
- 0x0025: 'SET.DATABASE',
- 0x0026: 'SET.CRITERIA',
- 0x0027: 'SORT',
- 0x0028: 'DATA.SERIES',
- 0x0029: 'TABLE',
- 0x002A: 'FORMAT.NUMBER',
- 0x002B: 'ALIGNMENT',
- 0x002C: 'STYLE',
- 0x002D: 'BORDER',
- 0x002E: 'CELL.PROTECTION',
- 0x002F: 'COLUMN.WIDTH',
- 0x0030: 'UNDO',
- 0x0031: 'CUT',
- 0x0032: 'COPY',
- 0x0033: 'PASTE',
- 0x0034: 'CLEAR',
- 0x0035: 'PASTE.SPECIAL',
- 0x0036: 'EDIT.DELETE',
- 0x0037: 'INSERT',
- 0x0038: 'FILL.RIGHT',
- 0x0039: 'FILL.DOWN',
- 0x003D: 'DEFINE.NAME',
- 0x003E: 'CREATE.NAMES',
- 0x003F: 'FORMULA.GOTO',
- 0x0040: 'FORMULA.FIND',
- 0x0041: 'SELECT.LAST.CELL',
- 0x0042: 'SHOW.ACTIVE.CELL',
- 0x0043: 'GALLERY.AREA',
- 0x0044: 'GALLERY.BAR',
- 0x0045: 'GALLERY.COLUMN',
- 0x0046: 'GALLERY.LINE',
- 0x0047: 'GALLERY.PIE',
- 0x0048: 'GALLERY.SCATTER',
- 0x0049: 'COMBINATION',
- 0x004A: 'PREFERRED',
- 0x004B: 'ADD.OVERLAY',
- 0x004C: 'GRIDLINES',
- 0x004D: 'SET.PREFERRED',
- 0x004E: 'AXES',
- 0x004F: 'LEGEND',
- 0x0050: 'ATTACH.TEXT',
- 0x0051: 'ADD.ARROW',
- 0x0052: 'SELECT.CHART',
- 0x0053: 'SELECT.PLOT.AREA',
- 0x0054: 'PATTERNS',
- 0x0055: 'MAIN.CHART',
- 0x0056: 'OVERLAY',
- 0x0057: 'SCALE',
- 0x0058: 'FORMAT.LEGEND',
- 0x0059: 'FORMAT.TEXT',
- 0x005A: 'EDIT.REPEAT',
- 0x005B: 'PARSE',
- 0x005C: 'JUSTIFY',
- 0x005D: 'HIDE',
- 0x005E: 'UNHIDE',
- 0x005F: 'WORKSPACE',
- 0x0060: 'FORMULA',
- 0x0061: 'FORMULA.FILL',
- 0x0062: 'FORMULA.ARRAY',
- 0x0063: 'DATA.FIND.NEXT',
- 0x0064: 'DATA.FIND.PREV',
- 0x0065: 'FORMULA.FIND.NEXT',
- 0x0066: 'FORMULA.FIND.PREV',
- 0x0067: 'ACTIVATE',
- 0x0068: 'ACTIVATE.NEXT',
- 0x0069: 'ACTIVATE.PREV',
- 0x006A: 'UNLOCKED.NEXT',
- 0x006B: 'UNLOCKED.PREV',
- 0x006C: 'COPY.PICTURE',
- 0x006D: 'SELECT',
- 0x006E: 'DELETE.NAME',
- 0x006F: 'DELETE.FORMAT',
- 0x0070: 'VLINE',
- 0x0071: 'HLINE',
- 0x0072: 'VPAGE',
- 0x0073: 'HPAGE',
- 0x0074: 'VSCROLL',
- 0x0075: 'HSCROLL',
- 0x0076: 'ALERT',
- 0x0077: 'NEW',
- 0x0078: 'CANCEL.COPY',
- 0x0079: 'SHOW.CLIPBOARD',
- 0x007A: 'MESSAGE',
- 0x007C: 'PASTE.LINK',
- 0x007D: 'APP.ACTIVATE',
- 0x007E: 'DELETE.ARROW',
- 0x007F: 'ROW.HEIGHT',
- 0x0080: 'FORMAT.MOVE',
- 0x0081: 'FORMAT.SIZE',
- 0x0082: 'FORMULA.REPLACE',
- 0x0083: 'SEND.KEYS',
- 0x0084: 'SELECT.SPECIAL',
- 0x0085: 'APPLY.NAMES',
- 0x0086: 'REPLACE.FONT',
- 0x0087: 'FREEZE.PANES',
- 0x0088: 'SHOW.INFO',
- 0x0089: 'SPLIT',
- 0x008A: 'ON.WINDOW',
- 0x008B: 'ON.DATA',
- 0x008C: 'DISABLE.INPUT',
- 0x008E: 'OUTLINE',
- 0x008F: 'LIST.NAMES',
- 0x0090: 'FILE.CLOSE',
- 0x0091: 'SAVE.WORKBOOK',
- 0x0092: 'DATA.FORM',
- 0x0093: 'COPY.CHART',
- 0x0094: 'ON.TIME',
- 0x0095: 'WAIT',
- 0x0096: 'FORMAT.FONT',
- 0x0097: 'FILL.UP',
- 0x0098: 'FILL.LEFT',
- 0x0099: 'DELETE.OVERLAY',
- 0x009B: 'SHORT.MENUS',
- 0x009F: 'SET.UPDATE.STATUS',
- 0x00A1: 'COLOR.PALETTE',
- 0x00A2: 'DELETE.STYLE',
- 0x00A3: 'WINDOW.RESTORE',
- 0x00A4: 'WINDOW.MAXIMIZE',
- 0x00A6: 'CHANGE.LINK',
- 0x00A7: 'CALCULATE.DOCUMENT',
- 0x00A8: 'ON.KEY',
- 0x00A9: 'APP.RESTORE',
- 0x00AA: 'APP.MOVE',
- 0x00AB: 'APP.SIZE',
- 0x00AC: 'APP.MINIMIZE',
- 0x00AD: 'APP.MAXIMIZE',
- 0x00AE: 'BRING.TO.FRONT',
- 0x00AF: 'SEND.TO.BACK',
- 0x00B9: 'MAIN.CHART.TYPE',
- 0x00BA: 'OVERLAY.CHART.TYPE',
- 0x00BB: 'SELECT.END',
- 0x00BC: 'OPEN.MAIL',
- 0x00BD: 'SEND.MAIL',
- 0x00BE: 'STANDARD.FONT',
- 0x00BF: 'CONSOLIDATE',
- 0x00C0: 'SORT.SPECIAL',
- 0x00C1: 'GALLERY.3D.AREA',
- 0x00C2: 'GALLERY.3D.COLUMN',
- 0x00C3: 'GALLERY.3D.LINE',
- 0x00C4: 'GALLERY.3D.PIE',
- 0x00C5: 'VIEW.3D',
- 0x00C6: 'GOAL.SEEK',
- 0x00C7: 'WORKGROUP',
- 0x00C8: 'FILL.GROUP',
- 0x00C9: 'UPDATE.LINK',
- 0x00CA: 'PROMOTE',
- 0x00CB: 'DEMOTE',
- 0x00CC: 'SHOW.DETAIL',
- 0x00CE: 'UNGROUP',
- 0x00CF: 'OBJECT.PROPERTIES',
- 0x00D0: 'SAVE.NEW.OBJECT',
- 0x00D1: 'SHARE',
- 0x00D2: 'SHARE.NAME',
- 0x00D3: 'DUPLICATE',
- 0x00D4: 'APPLY.STYLE',
- 0x00D5: 'ASSIGN.TO.OBJECT',
- 0x00D6: 'OBJECT.PROTECTION',
- 0x00D7: 'HIDE.OBJECT',
- 0x00D8: 'SET.EXTRACT',
- 0x00D9: 'CREATE.PUBLISHER',
- 0x00DA: 'SUBSCRIBE.TO',
- 0x00DB: 'ATTRIBUTES',
- 0x00DC: 'SHOW.TOOLBAR',
- 0x00DE: 'PRINT.PREVIEW',
- 0x00DF: 'EDIT.COLOR',
- 0x00E0: 'SHOW.LEVELS',
- 0x00E1: 'FORMAT.MAIN',
- 0x00E2: 'FORMAT.OVERLAY',
- 0x00E3: 'ON.RECALC',
- 0x00E4: 'EDIT.SERIES',
- 0x00E5: 'DEFINE.STYLE',
- 0x00F0: 'LINE.PRINT',
- 0x00F3: 'ENTER.DATA',
- 0x00F9: 'GALLERY.RADAR',
- 0x00FA: 'MERGE.STYLES',
- 0x00FB: 'EDITION.OPTIONS',
- 0x00FC: 'PASTE.PICTURE',
- 0x00FD: 'PASTE.PICTURE.LINK',
- 0x00FE: 'SPELLING',
- 0x0100: 'ZOOM',
- 0x0103: 'INSERT.OBJECT',
- 0x0104: 'WINDOW.MINIMIZE',
- 0x0109: 'SOUND.NOTE',
- 0x010A: 'SOUND.PLAY',
- 0x010B: 'FORMAT.SHAPE',
- 0x010C: 'EXTEND.POLYGON',
- 0x010D: 'FORMAT.AUTO',
- 0x0110: 'GALLERY.3D.BAR',
- 0x0111: 'GALLERY.3D.SURFACE',
- 0x0112: 'FILL.AUTO',
- 0x0114: 'CUSTOMIZE.TOOLBAR',
- 0x0115: 'ADD.TOOL',
- 0x0116: 'EDIT.OBJECT',
- 0x0117: 'ON.DOUBLECLICK',
- 0x0118: 'ON.ENTRY',
- 0x0119: 'WORKBOOK.ADD',
- 0x011A: 'WORKBOOK.MOVE',
- 0x011B: 'WORKBOOK.COPY',
- 0x011C: 'WORKBOOK.OPTIONS',
- 0x011D: 'SAVE.WORKSPACE',
- 0x0120: 'CHART.WIZARD',
- 0x0121: 'DELETE.TOOL',
- 0x0122: 'MOVE.TOOL',
- 0x0123: 'WORKBOOK.SELECT',
- 0x0124: 'WORKBOOK.ACTIVATE',
- 0x0125: 'ASSIGN.TO.TOOL',
- 0x0127: 'COPY.TOOL',
- 0x0128: 'RESET.TOOL',
- 0x0129: 'CONSTRAIN.NUMERIC',
- 0x012A: 'PASTE.TOOL',
- 0x012E: 'WORKBOOK.NEW',
- 0x0131: 'SCENARIO.CELLS',
- 0x0132: 'SCENARIO.DELETE',
- 0x0133: 'SCENARIO.ADD',
- 0x0134: 'SCENARIO.EDIT',
- 0x0135: 'SCENARIO.SHOW',
- 0x0136: 'SCENARIO.SHOW.NEXT',
- 0x0137: 'SCENARIO.SUMMARY',
- 0x0138: 'PIVOT.TABLE.WIZARD',
- 0x0139: 'PIVOT.FIELD.PROPERTIES',
- 0x013A: 'PIVOT.FIELD',
- 0x013B: 'PIVOT.ITEM',
- 0x013C: 'PIVOT.ADD.FIELDS',
- 0x013E: 'OPTIONS.CALCULATION',
- 0x013F: 'OPTIONS.EDIT',
- 0x0140: 'OPTIONS.VIEW',
- 0x0141: 'ADDIN.MANAGER',
- 0x0142: 'MENU.EDITOR',
- 0x0143: 'ATTACH.TOOLBARS',
- 0x0144: 'VBAActivate',
- 0x0145: 'OPTIONS.CHART',
- 0x0148: 'VBA.INSERT.FILE',
- 0x014A: 'VBA.PROCEDURE.DEFINITION',
- 0x0150: 'ROUTING.SLIP',
- 0x0152: 'ROUTE.DOCUMENT',
- 0x0153: 'MAIL.LOGON',
- 0x0156: 'INSERT.PICTURE',
- 0x0157: 'EDIT.TOOL',
- 0x0158: 'GALLERY.DOUGHNUT',
- 0x015E: 'CHART.TREND',
- 0x0160: 'PIVOT.ITEM.PROPERTIES',
- 0x0162: 'WORKBOOK.INSERT',
- 0x0163: 'OPTIONS.TRANSITION',
- 0x0164: 'OPTIONS.GENERAL',
- 0x0172: 'FILTER.ADVANCED',
- 0x0175: 'MAIL.ADD.MAILER',
- 0x0176: 'MAIL.DELETE.MAILER',
- 0x0177: 'MAIL.REPLY',
- 0x0178: 'MAIL.REPLY.ALL',
- 0x0179: 'MAIL.FORWARD',
- 0x017A: 'MAIL.NEXT.LETTER',
- 0x017B: 'DATA.LABEL',
- 0x017C: 'INSERT.TITLE',
- 0x017D: 'FONT.PROPERTIES',
- 0x017E: 'MACRO.OPTIONS',
- 0x017F: 'WORKBOOK.HIDE',
- 0x0180: 'WORKBOOK.UNHIDE',
- 0x0181: 'WORKBOOK.DELETE',
- 0x0182: 'WORKBOOK.NAME',
- 0x0184: 'GALLERY.CUSTOM',
- 0x0186: 'ADD.CHART.AUTOFORMAT',
- 0x0187: 'DELETE.CHART.AUTOFORMAT',
- 0x0188: 'CHART.ADD.DATA',
- 0x0189: 'AUTO.OUTLINE',
- 0x018A: 'TAB.ORDER',
- 0x018B: 'SHOW.DIALOG',
- 0x018C: 'SELECT.ALL',
- 0x018D: 'UNGROUP.SHEETS',
- 0x018E: 'SUBTOTAL.CREATE',
- 0x018F: 'SUBTOTAL.REMOVE',
- 0x0190: 'RENAME.OBJECT',
- 0x019C: 'WORKBOOK.SCROLL',
- 0x019D: 'WORKBOOK.NEXT',
- 0x019E: 'WORKBOOK.PREV',
- 0x019F: 'WORKBOOK.TAB.SPLIT',
- 0x01A0: 'FULL.SCREEN',
- 0x01A1: 'WORKBOOK.PROTECT',
- 0x01A4: 'SCROLLBAR.PROPERTIES',
- 0x01A5: 'PIVOT.SHOW.PAGES',
- 0x01A6: 'TEXT.TO.COLUMNS',
- 0x01A7: 'FORMAT.CHARTTYPE',
- 0x01A8: 'LINK.FORMAT',
- 0x01A9: 'TRACER.DISPLAY',
- 0x01AE: 'TRACER.NAVIGATE',
- 0x01AF: 'TRACER.CLEAR',
- 0x01B0: 'TRACER.ERROR',
- 0x01B1: 'PIVOT.FIELD.GROUP',
- 0x01B2: 'PIVOT.FIELD.UNGROUP',
- 0x01B3: 'CHECKBOX.PROPERTIES',
- 0x01B4: 'LABEL.PROPERTIES',
- 0x01B5: 'LISTBOX.PROPERTIES',
- 0x01B6: 'EDITBOX.PROPERTIES',
- 0x01B7: 'PIVOT.REFRESH',
- 0x01B8: 'LINK.COMBO',
- 0x01B9: 'OPEN.TEXT',
- 0x01BA: 'HIDE.DIALOG',
- 0x01BB: 'SET.DIALOG.FOCUS',
- 0x01BC: 'ENABLE.OBJECT',
- 0x01BD: 'PUSHBUTTON.PROPERTIES',
- 0x01BE: 'SET.DIALOG.DEFAULT',
- 0x01BF: 'FILTER',
- 0x01C0: 'FILTER.SHOW.ALL',
- 0x01C1: 'CLEAR.OUTLINE',
- 0x01C2: 'FUNCTION.WIZARD',
- 0x01C3: 'ADD.LIST.ITEM',
- 0x01C4: 'SET.LIST.ITEM',
- 0x01C5: 'REMOVE.LIST.ITEM',
- 0x01C6: 'SELECT.LIST.ITEM',
- 0x01C7: 'SET.CONTROL.VALUE',
- 0x01C8: 'SAVE.COPY.AS',
- 0x01CA: 'OPTIONS.LISTS.ADD',
- 0x01CB: 'OPTIONS.LISTS.DELETE',
- 0x01CC: 'SERIES.AXES',
- 0x01CD: 'SERIES.X',
- 0x01CE: 'SERIES.Y',
- 0x01CF: 'ERRORBAR.X',
- 0x01D0: 'ERRORBAR.Y',
- 0x01D1: 'FORMAT.CHART',
- 0x01D2: 'SERIES.ORDER',
- 0x01D3: 'MAIL.LOGOFF',
- 0x01D4: 'CLEAR.ROUTING.SLIP',
- 0x01D5: 'APP.ACTIVATE.MICROSOFT',
- 0x01D6: 'MAIL.EDIT.MAILER',
- 0x01D7: 'ON.SHEET',
- 0x01D8: 'STANDARD.WIDTH',
- 0x01D9: 'SCENARIO.MERGE',
- 0x01DA: 'SUMMARY.INFO',
- 0x01DB: 'FIND.FILE',
- 0x01DC: 'ACTIVE.CELL.FONT',
- 0x01DD: 'ENABLE.TIPWIZARD',
- 0x01DE: 'VBA.MAKE.ADDIN',
- 0x01E0: 'INSERTDATATABLE',
- 0x01E1: 'WORKGROUP.OPTIONS',
- 0x01E2: 'MAIL.SEND.MAILER',
- 0x01E5: 'AUTOCORRECT',
- 0x01E9: 'POST.DOCUMENT',
- 0x01EB: 'PICKLIST',
- 0x01ED: 'VIEW.SHOW',
- 0x01EE: 'VIEW.DEFINE',
- 0x01EF: 'VIEW.DELETE',
- 0x01FD: 'SHEET.BACKGROUND',
- 0x01FE: 'INSERT.MAP.OBJECT',
- 0x01FF: 'OPTIONS.MENONO',
- 0x0205: 'MSOCHECKS',
- 0x0206: 'NORMAL',
- 0x0207: 'LAYOUT',
- 0x0208: 'RM.PRINT.AREA',
- 0x0209: 'CLEAR.PRINT.AREA',
- 0x020A: 'ADD.PRINT.AREA',
- 0x020B: 'MOVE.BRK',
- 0x0221: 'HIDECURR.NOTE',
- 0x0222: 'HIDEALL.NOTES',
- 0x0223: 'DELETE.NOTE',
- 0x0224: 'TRAVERSE.NOTES',
- 0x0225: 'ACTIVATE.NOTES',
- 0x026C: 'PROTECT.REVISIONS',
- 0x026D: 'UNPROTECT.REVISIONS',
- 0x0287: 'OPTIONS.ME',
- 0x028D: 'WEB.PUBLISH',
- 0x029B: 'NEWWEBQUERY',
- 0x02A1: 'PIVOT.TABLE.CHART',
- 0x02F1: 'OPTIONS.SAVE',
- 0x02F3: 'OPTIONS.SPELL',
- 0x0328: 'HIDEALL.INKANNOTS'
- };
-
- /* [MS-XLS] 2.5.198.17 */
- /* [MS-XLSB] 2.5.97.10 */
- var Ftab = {
- 0x0000: 'COUNT',
- 0x0001: 'IF',
- 0x0002: 'ISNA',
- 0x0003: 'ISERROR',
- 0x0004: 'SUM',
- 0x0005: 'AVERAGE',
- 0x0006: 'MIN',
- 0x0007: 'MAX',
- 0x0008: 'ROW',
- 0x0009: 'COLUMN',
- 0x000A: 'NA',
- 0x000B: 'NPV',
- 0x000C: 'STDEV',
- 0x000D: 'DOLLAR',
- 0x000E: 'FIXED',
- 0x000F: 'SIN',
- 0x0010: 'COS',
- 0x0011: 'TAN',
- 0x0012: 'ATAN',
- 0x0013: 'PI',
- 0x0014: 'SQRT',
- 0x0015: 'EXP',
- 0x0016: 'LN',
- 0x0017: 'LOG10',
- 0x0018: 'ABS',
- 0x0019: 'INT',
- 0x001A: 'SIGN',
- 0x001B: 'ROUND',
- 0x001C: 'LOOKUP',
- 0x001D: 'INDEX',
- 0x001E: 'REPT',
- 0x001F: 'MID',
- 0x0020: 'LEN',
- 0x0021: 'VALUE',
- 0x0022: 'TRUE',
- 0x0023: 'FALSE',
- 0x0024: 'AND',
- 0x0025: 'OR',
- 0x0026: 'NOT',
- 0x0027: 'MOD',
- 0x0028: 'DCOUNT',
- 0x0029: 'DSUM',
- 0x002A: 'DAVERAGE',
- 0x002B: 'DMIN',
- 0x002C: 'DMAX',
- 0x002D: 'DSTDEV',
- 0x002E: 'VAR',
- 0x002F: 'DVAR',
- 0x0030: 'TEXT',
- 0x0031: 'LINEST',
- 0x0032: 'TREND',
- 0x0033: 'LOGEST',
- 0x0034: 'GROWTH',
- 0x0035: 'GOTO',
- 0x0036: 'HALT',
- 0x0037: 'RETURN',
- 0x0038: 'PV',
- 0x0039: 'FV',
- 0x003A: 'NPER',
- 0x003B: 'PMT',
- 0x003C: 'RATE',
- 0x003D: 'MIRR',
- 0x003E: 'IRR',
- 0x003F: 'RAND',
- 0x0040: 'MATCH',
- 0x0041: 'DATE',
- 0x0042: 'TIME',
- 0x0043: 'DAY',
- 0x0044: 'MONTH',
- 0x0045: 'YEAR',
- 0x0046: 'WEEKDAY',
- 0x0047: 'HOUR',
- 0x0048: 'MINUTE',
- 0x0049: 'SECOND',
- 0x004A: 'NOW',
- 0x004B: 'AREAS',
- 0x004C: 'ROWS',
- 0x004D: 'COLUMNS',
- 0x004E: 'OFFSET',
- 0x004F: 'ABSREF',
- 0x0050: 'RELREF',
- 0x0051: 'ARGUMENT',
- 0x0052: 'SEARCH',
- 0x0053: 'TRANSPOSE',
- 0x0054: 'ERROR',
- 0x0055: 'STEP',
- 0x0056: 'TYPE',
- 0x0057: 'ECHO',
- 0x0058: 'SET.NAME',
- 0x0059: 'CALLER',
- 0x005A: 'DEREF',
- 0x005B: 'WINDOWS',
- 0x005C: 'SERIES',
- 0x005D: 'DOCUMENTS',
- 0x005E: 'ACTIVE.CELL',
- 0x005F: 'SELECTION',
- 0x0060: 'RESULT',
- 0x0061: 'ATAN2',
- 0x0062: 'ASIN',
- 0x0063: 'ACOS',
- 0x0064: 'CHOOSE',
- 0x0065: 'HLOOKUP',
- 0x0066: 'VLOOKUP',
- 0x0067: 'LINKS',
- 0x0068: 'INPUT',
- 0x0069: 'ISREF',
- 0x006A: 'GET.FORMULA',
- 0x006B: 'GET.NAME',
- 0x006C: 'SET.VALUE',
- 0x006D: 'LOG',
- 0x006E: 'EXEC',
- 0x006F: 'CHAR',
- 0x0070: 'LOWER',
- 0x0071: 'UPPER',
- 0x0072: 'PROPER',
- 0x0073: 'LEFT',
- 0x0074: 'RIGHT',
- 0x0075: 'EXACT',
- 0x0076: 'TRIM',
- 0x0077: 'REPLACE',
- 0x0078: 'SUBSTITUTE',
- 0x0079: 'CODE',
- 0x007A: 'NAMES',
- 0x007B: 'DIRECTORY',
- 0x007C: 'FIND',
- 0x007D: 'CELL',
- 0x007E: 'ISERR',
- 0x007F: 'ISTEXT',
- 0x0080: 'ISNUMBER',
- 0x0081: 'ISBLANK',
- 0x0082: 'T',
- 0x0083: 'N',
- 0x0084: 'FOPEN',
- 0x0085: 'FCLOSE',
- 0x0086: 'FSIZE',
- 0x0087: 'FREADLN',
- 0x0088: 'FREAD',
- 0x0089: 'FWRITELN',
- 0x008A: 'FWRITE',
- 0x008B: 'FPOS',
- 0x008C: 'DATEVALUE',
- 0x008D: 'TIMEVALUE',
- 0x008E: 'SLN',
- 0x008F: 'SYD',
- 0x0090: 'DDB',
- 0x0091: 'GET.DEF',
- 0x0092: 'REFTEXT',
- 0x0093: 'TEXTREF',
- 0x0094: 'INDIRECT',
- 0x0095: 'REGISTER',
- 0x0096: 'CALL',
- 0x0097: 'ADD.BAR',
- 0x0098: 'ADD.MENU',
- 0x0099: 'ADD.COMMAND',
- 0x009A: 'ENABLE.COMMAND',
- 0x009B: 'CHECK.COMMAND',
- 0x009C: 'RENAME.COMMAND',
- 0x009D: 'SHOW.BAR',
- 0x009E: 'DELETE.MENU',
- 0x009F: 'DELETE.COMMAND',
- 0x00A0: 'GET.CHART.ITEM',
- 0x00A1: 'DIALOG.BOX',
- 0x00A2: 'CLEAN',
- 0x00A3: 'MDETERM',
- 0x00A4: 'MINVERSE',
- 0x00A5: 'MMULT',
- 0x00A6: 'FILES',
- 0x00A7: 'IPMT',
- 0x00A8: 'PPMT',
- 0x00A9: 'COUNTA',
- 0x00AA: 'CANCEL.KEY',
- 0x00AB: 'FOR',
- 0x00AC: 'WHILE',
- 0x00AD: 'BREAK',
- 0x00AE: 'NEXT',
- 0x00AF: 'INITIATE',
- 0x00B0: 'REQUEST',
- 0x00B1: 'POKE',
- 0x00B2: 'EXECUTE',
- 0x00B3: 'TERMINATE',
- 0x00B4: 'RESTART',
- 0x00B5: 'HELP',
- 0x00B6: 'GET.BAR',
- 0x00B7: 'PRODUCT',
- 0x00B8: 'FACT',
- 0x00B9: 'GET.CELL',
- 0x00BA: 'GET.WORKSPACE',
- 0x00BB: 'GET.WINDOW',
- 0x00BC: 'GET.DOCUMENT',
- 0x00BD: 'DPRODUCT',
- 0x00BE: 'ISNONTEXT',
- 0x00BF: 'GET.NOTE',
- 0x00C0: 'NOTE',
- 0x00C1: 'STDEVP',
- 0x00C2: 'VARP',
- 0x00C3: 'DSTDEVP',
- 0x00C4: 'DVARP',
- 0x00C5: 'TRUNC',
- 0x00C6: 'ISLOGICAL',
- 0x00C7: 'DCOUNTA',
- 0x00C8: 'DELETE.BAR',
- 0x00C9: 'UNREGISTER',
- 0x00CC: 'USDOLLAR',
- 0x00CD: 'FINDB',
- 0x00CE: 'SEARCHB',
- 0x00CF: 'REPLACEB',
- 0x00D0: 'LEFTB',
- 0x00D1: 'RIGHTB',
- 0x00D2: 'MIDB',
- 0x00D3: 'LENB',
- 0x00D4: 'ROUNDUP',
- 0x00D5: 'ROUNDDOWN',
- 0x00D6: 'ASC',
- 0x00D7: 'DBCS',
- 0x00D8: 'RANK',
- 0x00DB: 'ADDRESS',
- 0x00DC: 'DAYS360',
- 0x00DD: 'TODAY',
- 0x00DE: 'VDB',
- 0x00DF: 'ELSE',
- 0x00E0: 'ELSE.IF',
- 0x00E1: 'END.IF',
- 0x00E2: 'FOR.CELL',
- 0x00E3: 'MEDIAN',
- 0x00E4: 'SUMPRODUCT',
- 0x00E5: 'SINH',
- 0x00E6: 'COSH',
- 0x00E7: 'TANH',
- 0x00E8: 'ASINH',
- 0x00E9: 'ACOSH',
- 0x00EA: 'ATANH',
- 0x00EB: 'DGET',
- 0x00EC: 'CREATE.OBJECT',
- 0x00ED: 'VOLATILE',
- 0x00EE: 'LAST.ERROR',
- 0x00EF: 'CUSTOM.UNDO',
- 0x00F0: 'CUSTOM.REPEAT',
- 0x00F1: 'FORMULA.CONVERT',
- 0x00F2: 'GET.LINK.INFO',
- 0x00F3: 'TEXT.BOX',
- 0x00F4: 'INFO',
- 0x00F5: 'GROUP',
- 0x00F6: 'GET.OBJECT',
- 0x00F7: 'DB',
- 0x00F8: 'PAUSE',
- 0x00FB: 'RESUME',
- 0x00FC: 'FREQUENCY',
- 0x00FD: 'ADD.TOOLBAR',
- 0x00FE: 'DELETE.TOOLBAR',
- 0x00FF: 'User',
- 0x0100: 'RESET.TOOLBAR',
- 0x0101: 'EVALUATE',
- 0x0102: 'GET.TOOLBAR',
- 0x0103: 'GET.TOOL',
- 0x0104: 'SPELLING.CHECK',
- 0x0105: 'ERROR.TYPE',
- 0x0106: 'APP.TITLE',
- 0x0107: 'WINDOW.TITLE',
- 0x0108: 'SAVE.TOOLBAR',
- 0x0109: 'ENABLE.TOOL',
- 0x010A: 'PRESS.TOOL',
- 0x010B: 'REGISTER.ID',
- 0x010C: 'GET.WORKBOOK',
- 0x010D: 'AVEDEV',
- 0x010E: 'BETADIST',
- 0x010F: 'GAMMALN',
- 0x0110: 'BETAINV',
- 0x0111: 'BINOMDIST',
- 0x0112: 'CHIDIST',
- 0x0113: 'CHIINV',
- 0x0114: 'COMBIN',
- 0x0115: 'CONFIDENCE',
- 0x0116: 'CRITBINOM',
- 0x0117: 'EVEN',
- 0x0118: 'EXPONDIST',
- 0x0119: 'FDIST',
- 0x011A: 'FINV',
- 0x011B: 'FISHER',
- 0x011C: 'FISHERINV',
- 0x011D: 'FLOOR',
- 0x011E: 'GAMMADIST',
- 0x011F: 'GAMMAINV',
- 0x0120: 'CEILING',
- 0x0121: 'HYPGEOMDIST',
- 0x0122: 'LOGNORMDIST',
- 0x0123: 'LOGINV',
- 0x0124: 'NEGBINOMDIST',
- 0x0125: 'NORMDIST',
- 0x0126: 'NORMSDIST',
- 0x0127: 'NORMINV',
- 0x0128: 'NORMSINV',
- 0x0129: 'STANDARDIZE',
- 0x012A: 'ODD',
- 0x012B: 'PERMUT',
- 0x012C: 'POISSON',
- 0x012D: 'TDIST',
- 0x012E: 'WEIBULL',
- 0x012F: 'SUMXMY2',
- 0x0130: 'SUMX2MY2',
- 0x0131: 'SUMX2PY2',
- 0x0132: 'CHITEST',
- 0x0133: 'CORREL',
- 0x0134: 'COVAR',
- 0x0135: 'FORECAST',
- 0x0136: 'FTEST',
- 0x0137: 'INTERCEPT',
- 0x0138: 'PEARSON',
- 0x0139: 'RSQ',
- 0x013A: 'STEYX',
- 0x013B: 'SLOPE',
- 0x013C: 'TTEST',
- 0x013D: 'PROB',
- 0x013E: 'DEVSQ',
- 0x013F: 'GEOMEAN',
- 0x0140: 'HARMEAN',
- 0x0141: 'SUMSQ',
- 0x0142: 'KURT',
- 0x0143: 'SKEW',
- 0x0144: 'ZTEST',
- 0x0145: 'LARGE',
- 0x0146: 'SMALL',
- 0x0147: 'QUARTILE',
- 0x0148: 'PERCENTILE',
- 0x0149: 'PERCENTRANK',
- 0x014A: 'MODE',
- 0x014B: 'TRIMMEAN',
- 0x014C: 'TINV',
- 0x014E: 'MOVIE.COMMAND',
- 0x014F: 'GET.MOVIE',
- 0x0150: 'CONCATENATE',
- 0x0151: 'POWER',
- 0x0152: 'PIVOT.ADD.DATA',
- 0x0153: 'GET.PIVOT.TABLE',
- 0x0154: 'GET.PIVOT.FIELD',
- 0x0155: 'GET.PIVOT.ITEM',
- 0x0156: 'RADIANS',
- 0x0157: 'DEGREES',
- 0x0158: 'SUBTOTAL',
- 0x0159: 'SUMIF',
- 0x015A: 'COUNTIF',
- 0x015B: 'COUNTBLANK',
- 0x015C: 'SCENARIO.GET',
- 0x015D: 'OPTIONS.LISTS.GET',
- 0x015E: 'ISPMT',
- 0x015F: 'DATEDIF',
- 0x0160: 'DATESTRING',
- 0x0161: 'NUMBERSTRING',
- 0x0162: 'ROMAN',
- 0x0163: 'OPEN.DIALOG',
- 0x0164: 'SAVE.DIALOG',
- 0x0165: 'VIEW.GET',
- 0x0166: 'GETPIVOTDATA',
- 0x0167: 'HYPERLINK',
- 0x0168: 'PHONETIC',
- 0x0169: 'AVERAGEA',
- 0x016A: 'MAXA',
- 0x016B: 'MINA',
- 0x016C: 'STDEVPA',
- 0x016D: 'VARPA',
- 0x016E: 'STDEVA',
- 0x016F: 'VARA',
- 0x0170: 'BAHTTEXT',
- 0x0171: 'THAIDAYOFWEEK',
- 0x0172: 'THAIDIGIT',
- 0x0173: 'THAIMONTHOFYEAR',
- 0x0174: 'THAINUMSOUND',
- 0x0175: 'THAINUMSTRING',
- 0x0176: 'THAISTRINGLENGTH',
- 0x0177: 'ISTHAIDIGIT',
- 0x0178: 'ROUNDBAHTDOWN',
- 0x0179: 'ROUNDBAHTUP',
- 0x017A: 'THAIYEAR',
- 0x017B: 'RTD',
-
- 0x017C: 'CUBEVALUE',
- 0x017D: 'CUBEMEMBER',
- 0x017E: 'CUBEMEMBERPROPERTY',
- 0x017F: 'CUBERANKEDMEMBER',
- 0x0180: 'HEX2BIN',
- 0x0181: 'HEX2DEC',
- 0x0182: 'HEX2OCT',
- 0x0183: 'DEC2BIN',
- 0x0184: 'DEC2HEX',
- 0x0185: 'DEC2OCT',
- 0x0186: 'OCT2BIN',
- 0x0187: 'OCT2HEX',
- 0x0188: 'OCT2DEC',
- 0x0189: 'BIN2DEC',
- 0x018A: 'BIN2OCT',
- 0x018B: 'BIN2HEX',
- 0x018C: 'IMSUB',
- 0x018D: 'IMDIV',
- 0x018E: 'IMPOWER',
- 0x018F: 'IMABS',
- 0x0190: 'IMSQRT',
- 0x0191: 'IMLN',
- 0x0192: 'IMLOG2',
- 0x0193: 'IMLOG10',
- 0x0194: 'IMSIN',
- 0x0195: 'IMCOS',
- 0x0196: 'IMEXP',
- 0x0197: 'IMARGUMENT',
- 0x0198: 'IMCONJUGATE',
- 0x0199: 'IMAGINARY',
- 0x019A: 'IMREAL',
- 0x019B: 'COMPLEX',
- 0x019C: 'IMSUM',
- 0x019D: 'IMPRODUCT',
- 0x019E: 'SERIESSUM',
- 0x019F: 'FACTDOUBLE',
- 0x01A0: 'SQRTPI',
- 0x01A1: 'QUOTIENT',
- 0x01A2: 'DELTA',
- 0x01A3: 'GESTEP',
- 0x01A4: 'ISEVEN',
- 0x01A5: 'ISODD',
- 0x01A6: 'MROUND',
- 0x01A7: 'ERF',
- 0x01A8: 'ERFC',
- 0x01A9: 'BESSELJ',
- 0x01AA: 'BESSELK',
- 0x01AB: 'BESSELY',
- 0x01AC: 'BESSELI',
- 0x01AD: 'XIRR',
- 0x01AE: 'XNPV',
- 0x01AF: 'PRICEMAT',
- 0x01B0: 'YIELDMAT',
- 0x01B1: 'INTRATE',
- 0x01B2: 'RECEIVED',
- 0x01B3: 'DISC',
- 0x01B4: 'PRICEDISC',
- 0x01B5: 'YIELDDISC',
- 0x01B6: 'TBILLEQ',
- 0x01B7: 'TBILLPRICE',
- 0x01B8: 'TBILLYIELD',
- 0x01B9: 'PRICE',
- 0x01BA: 'YIELD',
- 0x01BB: 'DOLLARDE',
- 0x01BC: 'DOLLARFR',
- 0x01BD: 'NOMINAL',
- 0x01BE: 'EFFECT',
- 0x01BF: 'CUMPRINC',
- 0x01C0: 'CUMIPMT',
- 0x01C1: 'EDATE',
- 0x01C2: 'EOMONTH',
- 0x01C3: 'YEARFRAC',
- 0x01C4: 'COUPDAYBS',
- 0x01C5: 'COUPDAYS',
- 0x01C6: 'COUPDAYSNC',
- 0x01C7: 'COUPNCD',
- 0x01C8: 'COUPNUM',
- 0x01C9: 'COUPPCD',
- 0x01CA: 'DURATION',
- 0x01CB: 'MDURATION',
- 0x01CC: 'ODDLPRICE',
- 0x01CD: 'ODDLYIELD',
- 0x01CE: 'ODDFPRICE',
- 0x01CF: 'ODDFYIELD',
- 0x01D0: 'RANDBETWEEN',
- 0x01D1: 'WEEKNUM',
- 0x01D2: 'AMORDEGRC',
- 0x01D3: 'AMORLINC',
- 0x01D4: 'CONVERT',
- 0x02D4: 'SHEETJS',
- 0x01D5: 'ACCRINT',
- 0x01D6: 'ACCRINTM',
- 0x01D7: 'WORKDAY',
- 0x01D8: 'NETWORKDAYS',
- 0x01D9: 'GCD',
- 0x01DA: 'MULTINOMIAL',
- 0x01DB: 'LCM',
- 0x01DC: 'FVSCHEDULE',
- 0x01DD: 'CUBEKPIMEMBER',
- 0x01DE: 'CUBESET',
- 0x01DF: 'CUBESETCOUNT',
- 0x01E0: 'IFERROR',
- 0x01E1: 'COUNTIFS',
- 0x01E2: 'SUMIFS',
- 0x01E3: 'AVERAGEIF',
- 0x01E4: 'AVERAGEIFS'
- };
- var FtabArgc = {
- 0x0002: 1, /* ISNA */
- 0x0003: 1, /* ISERROR */
- 0x000A: 0, /* NA */
- 0x000F: 1, /* SIN */
- 0x0010: 1, /* COS */
- 0x0011: 1, /* TAN */
- 0x0012: 1, /* ATAN */
- 0x0013: 0, /* PI */
- 0x0014: 1, /* SQRT */
- 0x0015: 1, /* EXP */
- 0x0016: 1, /* LN */
- 0x0017: 1, /* LOG10 */
- 0x0018: 1, /* ABS */
- 0x0019: 1, /* INT */
- 0x001A: 1, /* SIGN */
- 0x001B: 2, /* ROUND */
- 0x001E: 2, /* REPT */
- 0x001F: 3, /* MID */
- 0x0020: 1, /* LEN */
- 0x0021: 1, /* VALUE */
- 0x0022: 0, /* TRUE */
- 0x0023: 0, /* FALSE */
- 0x0026: 1, /* NOT */
- 0x0027: 2, /* MOD */
- 0x0028: 3, /* DCOUNT */
- 0x0029: 3, /* DSUM */
- 0x002A: 3, /* DAVERAGE */
- 0x002B: 3, /* DMIN */
- 0x002C: 3, /* DMAX */
- 0x002D: 3, /* DSTDEV */
- 0x002F: 3, /* DVAR */
- 0x0030: 2, /* TEXT */
- 0x0035: 1, /* GOTO */
- 0x003D: 3, /* MIRR */
- 0x003F: 0, /* RAND */
- 0x0041: 3, /* DATE */
- 0x0042: 3, /* TIME */
- 0x0043: 1, /* DAY */
- 0x0044: 1, /* MONTH */
- 0x0045: 1, /* YEAR */
- 0x0046: 1, /* WEEKDAY */
- 0x0047: 1, /* HOUR */
- 0x0048: 1, /* MINUTE */
- 0x0049: 1, /* SECOND */
- 0x004A: 0, /* NOW */
- 0x004B: 1, /* AREAS */
- 0x004C: 1, /* ROWS */
- 0x004D: 1, /* COLUMNS */
- 0x004F: 2, /* ABSREF */
- 0x0050: 2, /* RELREF */
- 0x0053: 1, /* TRANSPOSE */
- 0x0055: 0, /* STEP */
- 0x0056: 1, /* TYPE */
- 0x0059: 0, /* CALLER */
- 0x005A: 1, /* DEREF */
- 0x005E: 0, /* ACTIVE.CELL */
- 0x005F: 0, /* SELECTION */
- 0x0061: 2, /* ATAN2 */
- 0x0062: 1, /* ASIN */
- 0x0063: 1, /* ACOS */
- 0x0065: 3, /* HLOOKUP */
- 0x0066: 3, /* VLOOKUP */
- 0x0069: 1, /* ISREF */
- 0x006A: 1, /* GET.FORMULA */
- 0x006C: 2, /* SET.VALUE */
- 0x006F: 1, /* CHAR */
- 0x0070: 1, /* LOWER */
- 0x0071: 1, /* UPPER */
- 0x0072: 1, /* PROPER */
- 0x0075: 2, /* EXACT */
- 0x0076: 1, /* TRIM */
- 0x0077: 4, /* REPLACE */
- 0x0079: 1, /* CODE */
- 0x007E: 1, /* ISERR */
- 0x007F: 1, /* ISTEXT */
- 0x0080: 1, /* ISNUMBER */
- 0x0081: 1, /* ISBLANK */
- 0x0082: 1, /* T */
- 0x0083: 1, /* N */
- 0x0085: 1, /* FCLOSE */
- 0x0086: 1, /* FSIZE */
- 0x0087: 1, /* FREADLN */
- 0x0088: 2, /* FREAD */
- 0x0089: 2, /* FWRITELN */
- 0x008A: 2, /* FWRITE */
- 0x008C: 1, /* DATEVALUE */
- 0x008D: 1, /* TIMEVALUE */
- 0x008E: 3, /* SLN */
- 0x008F: 4, /* SYD */
- 0x0090: 4, /* DDB */
- 0x00A1: 1, /* DIALOG.BOX */
- 0x00A2: 1, /* CLEAN */
- 0x00A3: 1, /* MDETERM */
- 0x00A4: 1, /* MINVERSE */
- 0x00A5: 2, /* MMULT */
- 0x00AC: 1, /* WHILE */
- 0x00AF: 2, /* INITIATE */
- 0x00B0: 2, /* REQUEST */
- 0x00B1: 3, /* POKE */
- 0x00B2: 2, /* EXECUTE */
- 0x00B3: 1, /* TERMINATE */
- 0x00B8: 1, /* FACT */
- 0x00BA: 1, /* GET.WORKSPACE */
- 0x00BD: 3, /* DPRODUCT */
- 0x00BE: 1, /* ISNONTEXT */
- 0x00C3: 3, /* DSTDEVP */
- 0x00C4: 3, /* DVARP */
- 0x00C5: 1, /* TRUNC */
- 0x00C6: 1, /* ISLOGICAL */
- 0x00C7: 3, /* DCOUNTA */
- 0x00C9: 1, /* UNREGISTER */
- 0x00CF: 4, /* REPLACEB */
- 0x00D2: 3, /* MIDB */
- 0x00D3: 1, /* LENB */
- 0x00D4: 2, /* ROUNDUP */
- 0x00D5: 2, /* ROUNDDOWN */
- 0x00D6: 1, /* ASC */
- 0x00D7: 1, /* DBCS */
- 0x00E1: 0, /* END.IF */
- 0x00E5: 1, /* SINH */
- 0x00E6: 1, /* COSH */
- 0x00E7: 1, /* TANH */
- 0x00E8: 1, /* ASINH */
- 0x00E9: 1, /* ACOSH */
- 0x00EA: 1, /* ATANH */
- 0x00EB: 3, /* DGET */
- 0x00F4: 1, /* INFO */
- 0x00F7: 4, /* DB */
- 0x00FC: 2, /* FREQUENCY */
- 0x0101: 1, /* EVALUATE */
- 0x0105: 1, /* ERROR.TYPE */
- 0x010F: 1, /* GAMMALN */
- 0x0111: 4, /* BINOMDIST */
- 0x0112: 2, /* CHIDIST */
- 0x0113: 2, /* CHIINV */
- 0x0114: 2, /* COMBIN */
- 0x0115: 3, /* CONFIDENCE */
- 0x0116: 3, /* CRITBINOM */
- 0x0117: 1, /* EVEN */
- 0x0118: 3, /* EXPONDIST */
- 0x0119: 3, /* FDIST */
- 0x011A: 3, /* FINV */
- 0x011B: 1, /* FISHER */
- 0x011C: 1, /* FISHERINV */
- 0x011D: 2, /* FLOOR */
- 0x011E: 4, /* GAMMADIST */
- 0x011F: 3, /* GAMMAINV */
- 0x0120: 2, /* CEILING */
- 0x0121: 4, /* HYPGEOMDIST */
- 0x0122: 3, /* LOGNORMDIST */
- 0x0123: 3, /* LOGINV */
- 0x0124: 3, /* NEGBINOMDIST */
- 0x0125: 4, /* NORMDIST */
- 0x0126: 1, /* NORMSDIST */
- 0x0127: 3, /* NORMINV */
- 0x0128: 1, /* NORMSINV */
- 0x0129: 3, /* STANDARDIZE */
- 0x012A: 1, /* ODD */
- 0x012B: 2, /* PERMUT */
- 0x012C: 3, /* POISSON */
- 0x012D: 3, /* TDIST */
- 0x012E: 4, /* WEIBULL */
- 0x012F: 2, /* SUMXMY2 */
- 0x0130: 2, /* SUMX2MY2 */
- 0x0131: 2, /* SUMX2PY2 */
- 0x0132: 2, /* CHITEST */
- 0x0133: 2, /* CORREL */
- 0x0134: 2, /* COVAR */
- 0x0135: 3, /* FORECAST */
- 0x0136: 2, /* FTEST */
- 0x0137: 2, /* INTERCEPT */
- 0x0138: 2, /* PEARSON */
- 0x0139: 2, /* RSQ */
- 0x013A: 2, /* STEYX */
- 0x013B: 2, /* SLOPE */
- 0x013C: 4, /* TTEST */
- 0x0145: 2, /* LARGE */
- 0x0146: 2, /* SMALL */
- 0x0147: 2, /* QUARTILE */
- 0x0148: 2, /* PERCENTILE */
- 0x014B: 2, /* TRIMMEAN */
- 0x014C: 2, /* TINV */
- 0x0151: 2, /* POWER */
- 0x0156: 1, /* RADIANS */
- 0x0157: 1, /* DEGREES */
- 0x015A: 2, /* COUNTIF */
- 0x015B: 1, /* COUNTBLANK */
- 0x015E: 4, /* ISPMT */
- 0x015F: 3, /* DATEDIF */
- 0x0160: 1, /* DATESTRING */
- 0x0161: 2, /* NUMBERSTRING */
- 0x0168: 1, /* PHONETIC */
- 0x0170: 1, /* BAHTTEXT */
- 0x0171: 1, /* THAIDAYOFWEEK */
- 0x0172: 1, /* THAIDIGIT */
- 0x0173: 1, /* THAIMONTHOFYEAR */
- 0x0174: 1, /* THAINUMSOUND */
- 0x0175: 1, /* THAINUMSTRING */
- 0x0176: 1, /* THAISTRINGLENGTH */
- 0x0177: 1, /* ISTHAIDIGIT */
- 0x0178: 1, /* ROUNDBAHTDOWN */
- 0x0179: 1, /* ROUNDBAHTUP */
- 0x017A: 1, /* THAIYEAR */
- 0x017E: 3, /* CUBEMEMBERPROPERTY */
- 0x0181: 1, /* HEX2DEC */
- 0x0188: 1, /* OCT2DEC */
- 0x0189: 1, /* BIN2DEC */
- 0x018C: 2, /* IMSUB */
- 0x018D: 2, /* IMDIV */
- 0x018E: 2, /* IMPOWER */
- 0x018F: 1, /* IMABS */
- 0x0190: 1, /* IMSQRT */
- 0x0191: 1, /* IMLN */
- 0x0192: 1, /* IMLOG2 */
- 0x0193: 1, /* IMLOG10 */
- 0x0194: 1, /* IMSIN */
- 0x0195: 1, /* IMCOS */
- 0x0196: 1, /* IMEXP */
- 0x0197: 1, /* IMARGUMENT */
- 0x0198: 1, /* IMCONJUGATE */
- 0x0199: 1, /* IMAGINARY */
- 0x019A: 1, /* IMREAL */
- 0x019E: 4, /* SERIESSUM */
- 0x019F: 1, /* FACTDOUBLE */
- 0x01A0: 1, /* SQRTPI */
- 0x01A1: 2, /* QUOTIENT */
- 0x01A4: 1, /* ISEVEN */
- 0x01A5: 1, /* ISODD */
- 0x01A6: 2, /* MROUND */
- 0x01A8: 1, /* ERFC */
- 0x01A9: 2, /* BESSELJ */
- 0x01AA: 2, /* BESSELK */
- 0x01AB: 2, /* BESSELY */
- 0x01AC: 2, /* BESSELI */
- 0x01AE: 3, /* XNPV */
- 0x01B6: 3, /* TBILLEQ */
- 0x01B7: 3, /* TBILLPRICE */
- 0x01B8: 3, /* TBILLYIELD */
- 0x01BB: 2, /* DOLLARDE */
- 0x01BC: 2, /* DOLLARFR */
- 0x01BD: 2, /* NOMINAL */
- 0x01BE: 2, /* EFFECT */
- 0x01BF: 6, /* CUMPRINC */
- 0x01C0: 6, /* CUMIPMT */
- 0x01C1: 2, /* EDATE */
- 0x01C2: 2, /* EOMONTH */
- 0x01D0: 2, /* RANDBETWEEN */
- 0x01D4: 3, /* CONVERT */
- 0x01DC: 2, /* FVSCHEDULE */
- 0x01DF: 1, /* CUBESETCOUNT */
- 0x01E0: 2, /* IFERROR */
- 0xFFFF: 0
- };
- /* [MS-XLSX] 2.2.3 Functions */
- /* [MS-XLSB] 2.5.97.10 Ftab */
- var XLSXFutureFunctions = {
- "_xlfn.ACOT": "ACOT",
- "_xlfn.ACOTH": "ACOTH",
- "_xlfn.AGGREGATE": "AGGREGATE",
- "_xlfn.ARABIC": "ARABIC",
- "_xlfn.AVERAGEIF": "AVERAGEIF",
- "_xlfn.AVERAGEIFS": "AVERAGEIFS",
- "_xlfn.BASE": "BASE",
- "_xlfn.BETA.DIST": "BETA.DIST",
- "_xlfn.BETA.INV": "BETA.INV",
- "_xlfn.BINOM.DIST": "BINOM.DIST",
- "_xlfn.BINOM.DIST.RANGE": "BINOM.DIST.RANGE",
- "_xlfn.BINOM.INV": "BINOM.INV",
- "_xlfn.BITAND": "BITAND",
- "_xlfn.BITLSHIFT": "BITLSHIFT",
- "_xlfn.BITOR": "BITOR",
- "_xlfn.BITRSHIFT": "BITRSHIFT",
- "_xlfn.BITXOR": "BITXOR",
- "_xlfn.CEILING.MATH": "CEILING.MATH",
- "_xlfn.CEILING.PRECISE": "CEILING.PRECISE",
- "_xlfn.CHISQ.DIST": "CHISQ.DIST",
- "_xlfn.CHISQ.DIST.RT": "CHISQ.DIST.RT",
- "_xlfn.CHISQ.INV": "CHISQ.INV",
- "_xlfn.CHISQ.INV.RT": "CHISQ.INV.RT",
- "_xlfn.CHISQ.TEST": "CHISQ.TEST",
- "_xlfn.COMBINA": "COMBINA",
- "_xlfn.CONCAT": "CONCAT",
- "_xlfn.CONFIDENCE.NORM": "CONFIDENCE.NORM",
- "_xlfn.CONFIDENCE.T": "CONFIDENCE.T",
- "_xlfn.COT": "COT",
- "_xlfn.COTH": "COTH",
- "_xlfn.COUNTIFS": "COUNTIFS",
- "_xlfn.COVARIANCE.P": "COVARIANCE.P",
- "_xlfn.COVARIANCE.S": "COVARIANCE.S",
- "_xlfn.CSC": "CSC",
- "_xlfn.CSCH": "CSCH",
- "_xlfn.DAYS": "DAYS",
- "_xlfn.DECIMAL": "DECIMAL",
- "_xlfn.ECMA.CEILING": "ECMA.CEILING",
- "_xlfn.ERF.PRECISE": "ERF.PRECISE",
- "_xlfn.ERFC.PRECISE": "ERFC.PRECISE",
- "_xlfn.EXPON.DIST": "EXPON.DIST",
- "_xlfn.F.DIST": "F.DIST",
- "_xlfn.F.DIST.RT": "F.DIST.RT",
- "_xlfn.F.INV": "F.INV",
- "_xlfn.F.INV.RT": "F.INV.RT",
- "_xlfn.F.TEST": "F.TEST",
- "_xlfn.FILTERXML": "FILTERXML",
- "_xlfn.FLOOR.MATH": "FLOOR.MATH",
- "_xlfn.FLOOR.PRECISE": "FLOOR.PRECISE",
- "_xlfn.FORECAST.ETS": "FORECAST.ETS",
- "_xlfn.FORECAST.ETS.CONFINT": "FORECAST.ETS.CONFINT",
- "_xlfn.FORECAST.ETS.SEASONALITY": "FORECAST.ETS.SEASONALITY",
- "_xlfn.FORECAST.ETS.STAT": "FORECAST.ETS.STAT",
- "_xlfn.FORECAST.LINEAR": "FORECAST.LINEAR",
- "_xlfn.FORMULATEXT": "FORMULATEXT",
- "_xlfn.GAMMA": "GAMMA",
- "_xlfn.GAMMA.DIST": "GAMMA.DIST",
- "_xlfn.GAMMA.INV": "GAMMA.INV",
- "_xlfn.GAMMALN.PRECISE": "GAMMALN.PRECISE",
- "_xlfn.GAUSS": "GAUSS",
- "_xlfn.HYPGEOM.DIST": "HYPGEOM.DIST",
- "_xlfn.IFERROR": "IFERROR",
- "_xlfn.IFNA": "IFNA",
- "_xlfn.IFS": "IFS",
- "_xlfn.IMCOSH": "IMCOSH",
- "_xlfn.IMCOT": "IMCOT",
- "_xlfn.IMCSC": "IMCSC",
- "_xlfn.IMCSCH": "IMCSCH",
- "_xlfn.IMSEC": "IMSEC",
- "_xlfn.IMSECH": "IMSECH",
- "_xlfn.IMSINH": "IMSINH",
- "_xlfn.IMTAN": "IMTAN",
- "_xlfn.ISFORMULA": "ISFORMULA",
- "_xlfn.ISO.CEILING": "ISO.CEILING",
- "_xlfn.ISOWEEKNUM": "ISOWEEKNUM",
- "_xlfn.LOGNORM.DIST": "LOGNORM.DIST",
- "_xlfn.LOGNORM.INV": "LOGNORM.INV",
- "_xlfn.MAXIFS": "MAXIFS",
- "_xlfn.MINIFS": "MINIFS",
- "_xlfn.MODE.MULT": "MODE.MULT",
- "_xlfn.MODE.SNGL": "MODE.SNGL",
- "_xlfn.MUNIT": "MUNIT",
- "_xlfn.NEGBINOM.DIST": "NEGBINOM.DIST",
- "_xlfn.NETWORKDAYS.INTL": "NETWORKDAYS.INTL",
- "_xlfn.NIGBINOM": "NIGBINOM",
- "_xlfn.NORM.DIST": "NORM.DIST",
- "_xlfn.NORM.INV": "NORM.INV",
- "_xlfn.NORM.S.DIST": "NORM.S.DIST",
- "_xlfn.NORM.S.INV": "NORM.S.INV",
- "_xlfn.NUMBERVALUE": "NUMBERVALUE",
- "_xlfn.PDURATION": "PDURATION",
- "_xlfn.PERCENTILE.EXC": "PERCENTILE.EXC",
- "_xlfn.PERCENTILE.INC": "PERCENTILE.INC",
- "_xlfn.PERCENTRANK.EXC": "PERCENTRANK.EXC",
- "_xlfn.PERCENTRANK.INC": "PERCENTRANK.INC",
- "_xlfn.PERMUTATIONA": "PERMUTATIONA",
- "_xlfn.PHI": "PHI",
- "_xlfn.POISSON.DIST": "POISSON.DIST",
- "_xlfn.QUARTILE.EXC": "QUARTILE.EXC",
- "_xlfn.QUARTILE.INC": "QUARTILE.INC",
- "_xlfn.QUERYSTRING": "QUERYSTRING",
- "_xlfn.RANK.AVG": "RANK.AVG",
- "_xlfn.RANK.EQ": "RANK.EQ",
- "_xlfn.RRI": "RRI",
- "_xlfn.SEC": "SEC",
- "_xlfn.SECH": "SECH",
- "_xlfn.SHEET": "SHEET",
- "_xlfn.SHEETS": "SHEETS",
- "_xlfn.SKEW.P": "SKEW.P",
- "_xlfn.STDEV.P": "STDEV.P",
- "_xlfn.STDEV.S": "STDEV.S",
- "_xlfn.SUMIFS": "SUMIFS",
- "_xlfn.SWITCH": "SWITCH",
- "_xlfn.T.DIST": "T.DIST",
- "_xlfn.T.DIST.2T": "T.DIST.2T",
- "_xlfn.T.DIST.RT": "T.DIST.RT",
- "_xlfn.T.INV": "T.INV",
- "_xlfn.T.INV.2T": "T.INV.2T",
- "_xlfn.T.TEST": "T.TEST",
- "_xlfn.TEXTJOIN": "TEXTJOIN",
- "_xlfn.UNICHAR": "UNICHAR",
- "_xlfn.UNICODE": "UNICODE",
- "_xlfn.VAR.P": "VAR.P",
- "_xlfn.VAR.S": "VAR.S",
- "_xlfn.WEBSERVICE": "WEBSERVICE",
- "_xlfn.WEIBULL.DIST": "WEIBULL.DIST",
- "_xlfn.WORKDAY.INTL": "WORKDAY.INTL",
- "_xlfn.XOR": "XOR",
- "_xlfn.Z.TEST": "Z.TEST"
- };
-
- /* Part 3 TODO: actually parse formulae */
- function ods_to_csf_formula(f) {
- if(f.slice(0,3) == "of:") f = f.slice(3);
- /* 5.2 Basic Expressions */
- if(f.charCodeAt(0) == 61) {
- f = f.slice(1);
- if(f.charCodeAt(0) == 61) f = f.slice(1);
- }
- f = f.replace(/COM\.MICROSOFT\./g, "");
- /* Part 3 Section 5.8 References */
- f = f.replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g, function($$, $1) { return $1.replace(/\./g,""); });
- /* TODO: something other than this */
- f = f.replace(/\[.(#[A-Z]*[?!])\]/g, "$1");
- return f.replace(/[;~]/g,",").replace(/\|/g,";");
- }
-
- function csf_to_ods_formula(f) {
- var o = "of:=" + f.replace(crefregex, "$1[.$2$3$4$5]").replace(/\]:\[/g,":");
- /* TODO: something other than this */
- return o.replace(/;/g, "|").replace(/,/g,";");
- }
-
- function ods_to_csf_3D(r) {
- var a = r.split(":");
- var s = a[0].split(".")[0];
- return [s, a[0].split(".")[1] + (a.length > 1 ? (":" + (a[1].split(".")[1] || a[1].split(".")[0])) : "")];
- }
-
- function csf_to_ods_3D(r) {
- return r.replace(/\./,"!");
- }
-
- var strs = {}; // shared strings
- var _ssfopts = {}; // spreadsheet formatting options
-
- RELS.WS = [
- "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",
- "http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"
- ];
-
- /*global Map */
- var browser_has_Map = typeof Map !== 'undefined';
-
- function get_sst_id(sst, str, rev) {
- var i = 0, len = sst.length;
- if(rev) {
- if(browser_has_Map ? rev.has(str) : rev.hasOwnProperty(str)) {
- var revarr = browser_has_Map ? rev.get(str) : rev[str];
- for(; i < revarr.length; ++i) {
- if(sst[revarr[i]].t === str) { sst.Count ++; return revarr[i]; }
- }
- }
- } else for(; i < len; ++i) {
- if(sst[i].t === str) { sst.Count ++; return i; }
- }
- sst[len] = ({t:str}); sst.Count ++; sst.Unique ++;
- if(rev) {
- if(browser_has_Map) {
- if(!rev.has(str)) rev.set(str, []);
- rev.get(str).push(len);
- } else {
- if(!rev.hasOwnProperty(str)) rev[str] = [];
- rev[str].push(len);
- }
- }
- return len;
- }
-
- function col_obj_w(C, col) {
- var p = ({min:C+1,max:C+1});
- /* wch (chars), wpx (pixels) */
- var wch = -1;
- if(col.MDW) MDW = col.MDW;
- if(col.width != null) p.customWidth = 1;
- else if(col.wpx != null) wch = px2char(col.wpx);
- else if(col.wch != null) wch = col.wch;
- if(wch > -1) { p.width = char2width(wch); p.customWidth = 1; }
- else if(col.width != null) p.width = col.width;
- if(col.hidden) p.hidden = true;
- return p;
- }
-
- function default_margins(margins, mode) {
- if(!margins) return;
- var defs = [0.7, 0.7, 0.75, 0.75, 0.3, 0.3];
- if(mode == 'xlml') defs = [1, 1, 1, 1, 0.5, 0.5];
- if(margins.left == null) margins.left = defs[0];
- if(margins.right == null) margins.right = defs[1];
- if(margins.top == null) margins.top = defs[2];
- if(margins.bottom == null) margins.bottom = defs[3];
- if(margins.header == null) margins.header = defs[4];
- if(margins.footer == null) margins.footer = defs[5];
- }
-
- function get_cell_style(styles, cell, opts) {
- var z = opts.revssf[cell.z != null ? cell.z : "General"];
- var i = 0x3c, len = styles.length;
- if(z == null && opts.ssf) {
- for(; i < 0x188; ++i) if(opts.ssf[i] == null) {
- SSF.load(cell.z, i);
- // $FlowIgnore
- opts.ssf[i] = cell.z;
- opts.revssf[cell.z] = z = i;
- break;
- }
- }
- for(i = 0; i != len; ++i) if(styles[i].numFmtId === z) return i;
- styles[len] = {
- numFmtId:z,
- fontId:0,
- fillId:0,
- borderId:0,
- xfId:0,
- applyNumberFormat:1
- };
- return len;
- }
-
- function safe_format(p, fmtid, fillid, opts, themes, styles) {
- if(p.t === 'z') return;
- if(p.t === 'd' && typeof p.v === 'string') p.v = parseDate(p.v);
- try {
- if(opts.cellNF) p.z = SSF._table[fmtid];
- } catch(e) { if(opts.WTF) throw e; }
- if(!opts || opts.cellText !== false) try {
- if(SSF._table[fmtid] == null) SSF.load(SSFImplicit[fmtid] || "General", fmtid);
- if(p.t === 'e') p.w = p.w || BErr[p.v];
- else if(fmtid === 0) {
- if(p.t === 'n') {
- if((p.v|0) === p.v) p.w = SSF._general_int(p.v);
- else p.w = SSF._general_num(p.v);
- }
- else if(p.t === 'd') {
- var dd = datenum(p.v);
- if((dd|0) === dd) p.w = SSF._general_int(dd);
- else p.w = SSF._general_num(dd);
- }
- else if(p.v === undefined) return "";
- else p.w = SSF._general(p.v,_ssfopts);
- }
- else if(p.t === 'd') p.w = SSF.format(fmtid,datenum(p.v),_ssfopts);
- else p.w = SSF.format(fmtid,p.v,_ssfopts);
- } catch(e) { if(opts.WTF) throw e; }
- if(!opts.cellStyles) return;
- if(fillid != null) try {
- p.s = styles.Fills[fillid];
- if (p.s.fgColor && p.s.fgColor.theme && !p.s.fgColor.rgb) {
- p.s.fgColor.rgb = rgb_tint(themes.themeElements.clrScheme[p.s.fgColor.theme].rgb, p.s.fgColor.tint || 0);
- if(opts.WTF) p.s.fgColor.raw_rgb = themes.themeElements.clrScheme[p.s.fgColor.theme].rgb;
- }
- if (p.s.bgColor && p.s.bgColor.theme) {
- p.s.bgColor.rgb = rgb_tint(themes.themeElements.clrScheme[p.s.bgColor.theme].rgb, p.s.bgColor.tint || 0);
- if(opts.WTF) p.s.bgColor.raw_rgb = themes.themeElements.clrScheme[p.s.bgColor.theme].rgb;
- }
- } catch(e) { if(opts.WTF && styles.Fills) throw e; }
- }
-
- function check_ws(ws, sname, i) {
- if(ws && ws['!ref']) {
- var range = safe_decode_range(ws['!ref']);
- if(range.e.c < range.s.c || range.e.r < range.s.r) throw new Error("Bad range (" + i + "): " + ws['!ref']);
- }
- }
- function parse_ws_xml_dim(ws, s) {
- var d = safe_decode_range(s);
- if(d.s.r<=d.e.r && d.s.c<=d.e.c && d.s.r>=0 && d.s.c>=0) ws["!ref"] = encode_range(d);
- }
- var mergecregex = /<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g;
- var sheetdataregex = /<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/;
- var hlinkregex = /<(?:\w:)?hyperlink [^>]*>/mg;
- var dimregex = /"(\w*:\w*)"/;
- var colregex = /<(?:\w:)?col\b[^>]*[\/]?>/g;
- var afregex = /<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g;
- var marginregex= /<(?:\w:)?pageMargins[^>]*\/>/g;
- var sheetprregex = /<(?:\w:)?sheetPr\b(?:[^>a-z][^>]*)?\/>/;
- var svsregex = /<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/;
-
- /* 18.3 Worksheets */
- function parse_ws_xml(data, opts, idx, rels, wb, themes, styles) {
- if(!data) return data;
- if(!rels) rels = {'!id':{}};
- if(DENSE != null && opts.dense == null) opts.dense = DENSE;
-
- /* 18.3.1.99 worksheet CT_Worksheet */
- var s = opts.dense ? ([]) : ({});
- var refguess = ({s: {r:2000000, c:2000000}, e: {r:0, c:0} });
-
- var data1 = "", data2 = "";
- var mtch = data.match(sheetdataregex);
- if(mtch) {
- data1 = data.slice(0, mtch.index);
- data2 = data.slice(mtch.index + mtch[0].length);
- } else data1 = data2 = data;
-
- /* 18.3.1.82 sheetPr CT_SheetPr */
- var sheetPr = data1.match(sheetprregex);
- if(sheetPr) parse_ws_xml_sheetpr(sheetPr[0], s, wb, idx);
-
- /* 18.3.1.35 dimension CT_SheetDimension */
- var ridx = (data1.match(/<(?:\w*:)?dimension/)||{index:-1}).index;
- if(ridx > 0) {
- var ref = data1.slice(ridx,ridx+50).match(dimregex);
- if(ref) parse_ws_xml_dim(s, ref[1]);
- }
-
- /* 18.3.1.88 sheetViews CT_SheetViews */
- var svs = data1.match(svsregex);
- if(svs && svs[1]) parse_ws_xml_sheetviews(svs[1], wb);
-
- /* 18.3.1.17 cols CT_Cols */
- var columns = [];
- if(opts.cellStyles) {
- /* 18.3.1.13 col CT_Col */
- var cols = data1.match(colregex);
- if(cols) parse_ws_xml_cols(columns, cols);
- }
-
- /* 18.3.1.80 sheetData CT_SheetData ? */
- if(mtch) parse_ws_xml_data(mtch[1], s, opts, refguess, themes, styles);
-
- /* 18.3.1.2 autoFilter CT_AutoFilter */
- var afilter = data2.match(afregex);
- if(afilter) s['!autofilter'] = parse_ws_xml_autofilter(afilter[0]);
-
- /* 18.3.1.55 mergeCells CT_MergeCells */
- var merges = [];
- var _merge = data2.match(mergecregex);
- if(_merge) for(ridx = 0; ridx != _merge.length; ++ridx)
- merges[ridx] = safe_decode_range(_merge[ridx].slice(_merge[ridx].indexOf("\"")+1));
-
- /* 18.3.1.48 hyperlinks CT_Hyperlinks */
- var hlink = data2.match(hlinkregex);
- if(hlink) parse_ws_xml_hlinks(s, hlink, rels);
-
- /* 18.3.1.62 pageMargins CT_PageMargins */
- var margins = data2.match(marginregex);
- if(margins) s['!margins'] = parse_ws_xml_margins(parsexmltag(margins[0]));
-
- if(!s["!ref"] && refguess.e.c >= refguess.s.c && refguess.e.r >= refguess.s.r) s["!ref"] = encode_range(refguess);
- if(opts.sheetRows > 0 && s["!ref"]) {
- var tmpref = safe_decode_range(s["!ref"]);
- if(opts.sheetRows <= +tmpref.e.r) {
- tmpref.e.r = opts.sheetRows - 1;
- if(tmpref.e.r > refguess.e.r) tmpref.e.r = refguess.e.r;
- if(tmpref.e.r < tmpref.s.r) tmpref.s.r = tmpref.e.r;
- if(tmpref.e.c > refguess.e.c) tmpref.e.c = refguess.e.c;
- if(tmpref.e.c < tmpref.s.c) tmpref.s.c = tmpref.e.c;
- s["!fullref"] = s["!ref"];
- s["!ref"] = encode_range(tmpref);
- }
- }
- if(columns.length > 0) s["!cols"] = columns;
- if(merges.length > 0) s["!merges"] = merges;
- return s;
- }
-
- function write_ws_xml_merges(merges) {
- if(merges.length === 0) return "";
- var o = '<mergeCells count="' + merges.length + '">';
- for(var i = 0; i != merges.length; ++i) o += '<mergeCell ref="' + encode_range(merges[i]) + '"/>';
- return o + '</mergeCells>';
- }
-
- /* 18.3.1.82-3 sheetPr CT_ChartsheetPr / CT_SheetPr */
- function parse_ws_xml_sheetpr(sheetPr, s, wb, idx) {
- var data = parsexmltag(sheetPr);
- if(!wb.Sheets[idx]) wb.Sheets[idx] = {};
- if(data.codeName) wb.Sheets[idx].CodeName = data.codeName;
- }
- function write_ws_xml_sheetpr(ws, wb, idx, opts, o) {
- var needed = false;
- var props = {}, payload = null;
- if(opts.bookType !== 'xlsx' && wb.vbaraw) {
- var cname = wb.SheetNames[idx];
- try { if(wb.Workbook) cname = wb.Workbook.Sheets[idx].CodeName || cname; } catch(e) {}
- needed = true;
- props.codeName = escapexml(cname);
- }
-
- if(!needed && !payload) return;
- o[o.length] = (writextag('sheetPr', payload, props));
- }
-
- /* 18.3.1.85 sheetProtection CT_SheetProtection */
- var sheetprot_deffalse = ["objects", "scenarios", "selectLockedCells", "selectUnlockedCells"];
- var sheetprot_deftrue = [
- "formatColumns", "formatRows", "formatCells",
- "insertColumns", "insertRows", "insertHyperlinks",
- "deleteColumns", "deleteRows",
- "sort", "autoFilter", "pivotTables"
- ];
- function write_ws_xml_protection(sp) {
- // algorithmName, hashValue, saltValue, spinCountpassword
- var o = ({sheet:1});
- sheetprot_deffalse.forEach(function(n) { if(sp[n] != null && sp[n]) o[n] = "1"; });
- sheetprot_deftrue.forEach(function(n) { if(sp[n] != null && !sp[n]) o[n] = "0"; });
- /* TODO: algorithm */
- if(sp.password) o.password = crypto_CreatePasswordVerifier_Method1(sp.password).toString(16).toUpperCase();
- return writextag('sheetProtection', null, o);
- }
-
- function parse_ws_xml_hlinks(s, data, rels) {
- var dense = Array.isArray(s);
- for(var i = 0; i != data.length; ++i) {
- var val = parsexmltag(utf8read(data[i]), true);
- if(!val.ref) return;
- var rel = ((rels || {})['!id']||[])[val.id];
- if(rel) {
- val.Target = rel.Target;
- if(val.location) val.Target += "#"+val.location;
- } else {
- val.Target = "#" + val.location;
- rel = {Target: val.Target, TargetMode: 'Internal'};
- }
- val.Rel = rel;
- if(val.tooltip) { val.Tooltip = val.tooltip; delete val.tooltip; }
- var rng = safe_decode_range(val.ref);
- for(var R=rng.s.r;R<=rng.e.r;++R) for(var C=rng.s.c;C<=rng.e.c;++C) {
- var addr = encode_cell({c:C,r:R});
- if(dense) {
- if(!s[R]) s[R] = [];
- if(!s[R][C]) s[R][C] = {t:"z",v:undefined};
- s[R][C].l = val;
- } else {
- if(!s[addr]) s[addr] = {t:"z",v:undefined};
- s[addr].l = val;
- }
- }
- }
- }
-
- function parse_ws_xml_margins(margin) {
- var o = {};
- ["left", "right", "top", "bottom", "header", "footer"].forEach(function(k) {
- if(margin[k]) o[k] = parseFloat(margin[k]);
- });
- return o;
- }
- function write_ws_xml_margins(margin) {
- default_margins(margin);
- return writextag('pageMargins', null, margin);
- }
-
- function parse_ws_xml_cols(columns, cols) {
- var seencol = false;
- for(var coli = 0; coli != cols.length; ++coli) {
- var coll = parsexmltag(cols[coli], true);
- if(coll.hidden) coll.hidden = parsexmlbool(coll.hidden);
- var colm=parseInt(coll.min, 10)-1, colM=parseInt(coll.max,10)-1;
- delete coll.min; delete coll.max; coll.width = +coll.width;
- if(!seencol && coll.width) { seencol = true; find_mdw_colw(coll.width); }
- process_col(coll);
- while(colm <= colM) columns[colm++] = dup(coll);
- }
- }
- function write_ws_xml_cols(ws, cols) {
- var o = ["<cols>"], col;
- for(var i = 0; i != cols.length; ++i) {
- if(!(col = cols[i])) continue;
- o[o.length] = (writextag('col', null, col_obj_w(i, col)));
- }
- o[o.length] = "</cols>";
- return o.join("");
- }
-
- function parse_ws_xml_autofilter(data) {
- var o = { ref: (data.match(/ref="([^"]*)"/)||[])[1]};
- return o;
- }
- function write_ws_xml_autofilter(data, ws, wb, idx) {
- var ref = typeof data.ref == "string" ? data.ref : encode_range(data.ref);
- if(!wb.Workbook) wb.Workbook = ({Sheets:[]});
- if(!wb.Workbook.Names) wb.Workbook.Names = [];
- var names = wb.Workbook.Names;
- var range = decode_range(ref);
- if(range.s.r == range.e.r) { range.e.r = decode_range(ws["!ref"]).e.r; ref = encode_range(range); }
- for(var i = 0; i < names.length; ++i) {
- var name = names[i];
- if(name.Name != '_xlnm._FilterDatabase') continue;
- if(name.Sheet != idx) continue;
- name.Ref = "'" + wb.SheetNames[idx] + "'!" + ref; break;
- }
- if(i == names.length) names.push({ Name: '_xlnm._FilterDatabase', Sheet: idx, Ref: "'" + wb.SheetNames[idx] + "'!" + ref });
- return writextag("autoFilter", null, {ref:ref});
- }
-
- /* 18.3.1.88 sheetViews CT_SheetViews */
- /* 18.3.1.87 sheetView CT_SheetView */
- var sviewregex = /<(?:\w:)?sheetView(?:[^>a-z][^>]*)?\/?>/;
- function parse_ws_xml_sheetviews(data, wb) {
- if(!wb.Views) wb.Views = [{}];
- (data.match(sviewregex)||[]).forEach(function(r, i) {
- var tag = parsexmltag(r);
- // $FlowIgnore
- if(!wb.Views[i]) wb.Views[i] = {};
- // $FlowIgnore
- if(parsexmlbool(tag.rightToLeft)) wb.Views[i].RTL = true;
- });
- }
- function write_ws_xml_sheetviews(ws, opts, idx, wb) {
- var sview = ({workbookViewId:"0"});
- // $FlowIgnore
- if((((wb||{}).Workbook||{}).Views||[])[0]) sview.rightToLeft = wb.Workbook.Views[0].RTL ? "1" : "0";
- return writextag("sheetViews", writextag("sheetView", null, sview), {});
- }
-
- function write_ws_xml_cell(cell, ref, ws, opts) {
- if(cell.v === undefined && cell.f === undefined || cell.t === 'z') return "";
- var vv = "";
- var oldt = cell.t, oldv = cell.v;
- if(cell.t !== "z") switch(cell.t) {
- case 'b': vv = cell.v ? "1" : "0"; break;
- case 'n': vv = ''+cell.v; break;
- case 'e': vv = BErr[cell.v]; break;
- case 'd':
- if(opts && opts.cellDates) vv = parseDate(cell.v, -1).toISOString();
- else {
- cell = dup(cell);
- cell.t = 'n';
- vv = ''+(cell.v = datenum(parseDate(cell.v)));
- }
- if(typeof cell.z === 'undefined') cell.z = SSF._table[14];
- break;
- default: vv = cell.v; break;
- }
- var v = writetag('v', escapexml(vv)), o = ({r:ref});
- /* TODO: cell style */
- var os = get_cell_style(opts.cellXfs, cell, opts);
- if(os !== 0) o.s = os;
- switch(cell.t) {
- case 'n': break;
- case 'd': o.t = "d"; break;
- case 'b': o.t = "b"; break;
- case 'e': o.t = "e"; break;
- case 'z': break;
- default: if(cell.v == null) { delete cell.t; break; }
- if(opts && opts.bookSST) {
- v = writetag('v', ''+get_sst_id(opts.Strings, cell.v, opts.revStrings));
- o.t = "s"; break;
- }
- o.t = "str"; break;
- }
- if(cell.t != oldt) { cell.t = oldt; cell.v = oldv; }
- if(cell.f) {
- var ff = cell.F && cell.F.slice(0, ref.length) == ref ? {t:"array", ref:cell.F} : null;
- v = writextag('f', escapexml(cell.f), ff) + (cell.v != null ? v : "");
- }
- if(cell.l) ws['!links'].push([ref, cell.l]);
- if(cell.c) ws['!comments'].push([ref, cell.c]);
- return writextag('c', v, o);
- }
-
- var parse_ws_xml_data = (function() {
- var cellregex = /<(?:\w+:)?c[ >]/, rowregex = /<\/(?:\w+:)?row>/;
- var rregex = /r=["']([^"']*)["']/, isregex = /<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/;
- var refregex = /ref=["']([^"']*)["']/;
- var match_v = matchtag("v"), match_f = matchtag("f");
-
- return function parse_ws_xml_data(sdata, s, opts, guess, themes, styles) {
- var ri = 0, x = "", cells = [], cref = [], idx=0, i=0, cc=0, d="", p;
- var tag, tagr = 0, tagc = 0;
- var sstr, ftag;
- var fmtid = 0, fillid = 0;
- var do_format = Array.isArray(styles.CellXf), cf;
- var arrayf = [];
- var sharedf = [];
- var dense = Array.isArray(s);
- var rows = [], rowobj = {}, rowrite = false;
- for(var marr = sdata.split(rowregex), mt = 0, marrlen = marr.length; mt != marrlen; ++mt) {
- x = marr[mt].trim();
- var xlen = x.length;
- if(xlen === 0) continue;
-
- /* 18.3.1.73 row CT_Row */
- for(ri = 0; ri < xlen; ++ri) if(x.charCodeAt(ri) === 62) break; ++ri;
- tag = parsexmltag(x.slice(0,ri), true);
- tagr = tag.r != null ? parseInt(tag.r, 10) : tagr+1; tagc = -1;
- if(opts.sheetRows && opts.sheetRows < tagr) continue;
- if(guess.s.r > tagr - 1) guess.s.r = tagr - 1;
- if(guess.e.r < tagr - 1) guess.e.r = tagr - 1;
-
- if(opts && opts.cellStyles) {
- rowobj = {}; rowrite = false;
- if(tag.ht) { rowrite = true; rowobj.hpt = parseFloat(tag.ht); rowobj.hpx = pt2px(rowobj.hpt); }
- if(tag.hidden == "1") { rowrite = true; rowobj.hidden = true; }
- if(tag.outlineLevel != null) { rowrite = true; rowobj.level = +tag.outlineLevel; }
- if(rowrite) rows[tagr-1] = rowobj;
- }
-
- /* 18.3.1.4 c CT_Cell */
- cells = x.slice(ri).split(cellregex);
- for(var rslice = 0; rslice != cells.length; ++rslice) if(cells[rslice].trim().charAt(0) != "<") break;
- cells = cells.slice(rslice);
- for(ri = 0; ri != cells.length; ++ri) {
- x = cells[ri].trim();
- if(x.length === 0) continue;
- cref = x.match(rregex); idx = ri; i=0; cc=0;
- x = "<c " + (x.slice(0,1)=="<"?">":"") + x;
- if(cref != null && cref.length === 2) {
- idx = 0; d=cref[1];
- for(i=0; i != d.length; ++i) {
- if((cc=d.charCodeAt(i)-64) < 1 || cc > 26) break;
- idx = 26*idx + cc;
- }
- --idx;
- tagc = idx;
- } else ++tagc;
- for(i = 0; i != x.length; ++i) if(x.charCodeAt(i) === 62) break; ++i;
- tag = parsexmltag(x.slice(0,i), true);
- if(!tag.r) tag.r = encode_cell({r:tagr-1, c:tagc});
- d = x.slice(i);
- p = ({t:""});
-
- if((cref=d.match(match_v))!= null && cref[1] !== '') p.v=unescapexml(cref[1]);
- if(opts.cellFormula) {
- if((cref=d.match(match_f))!= null && cref[1] !== '') {
- /* TODO: match against XLSXFutureFunctions */
- p.f=_xlfn(unescapexml(utf8read(cref[1])));
- if(cref[0].indexOf('t="array"') > -1) {
- p.F = (d.match(refregex)||[])[1];
- if(p.F.indexOf(":") > -1) arrayf.push([safe_decode_range(p.F), p.F]);
- } else if(cref[0].indexOf('t="shared"') > -1) {
- // TODO: parse formula
- ftag = parsexmltag(cref[0]);
- sharedf[parseInt(ftag.si, 10)] = [ftag, _xlfn(unescapexml(utf8read(cref[1]))), tag.r];
- }
- } else if((cref=d.match(/<f[^>]*\/>/))) {
- ftag = parsexmltag(cref[0]);
- if(sharedf[ftag.si]) p.f = shift_formula_xlsx(sharedf[ftag.si][1], sharedf[ftag.si][2]/*[0].ref*/, tag.r);
- }
- /* TODO: factor out contains logic */
- var _tag = decode_cell(tag.r);
- for(i = 0; i < arrayf.length; ++i)
- if(_tag.r >= arrayf[i][0].s.r && _tag.r <= arrayf[i][0].e.r)
- if(_tag.c >= arrayf[i][0].s.c && _tag.c <= arrayf[i][0].e.c)
- p.F = arrayf[i][1];
- }
-
- if(tag.t == null && p.v === undefined) {
- if(p.f || p.F) {
- p.v = 0; p.t = "n";
- } else if(!opts.sheetStubs) continue;
- else p.t = "z";
- }
- else p.t = tag.t || "n";
- if(guess.s.c > tagc) guess.s.c = tagc;
- if(guess.e.c < tagc) guess.e.c = tagc;
- /* 18.18.11 t ST_CellType */
- switch(p.t) {
- case 'n':
- if(p.v == "" || p.v == null) {
- if(!opts.sheetStubs) continue;
- p.t = 'z';
- } else p.v = parseFloat(p.v);
- break;
- case 's':
- if(typeof p.v == 'undefined') {
- if(!opts.sheetStubs) continue;
- p.t = 'z';
- } else {
- sstr = strs[parseInt(p.v, 10)];
- p.v = sstr.t;
- p.r = sstr.r;
- if(opts.cellHTML) p.h = sstr.h;
- }
- break;
- case 'str':
- p.t = "s";
- p.v = (p.v!=null) ? utf8read(p.v) : '';
- if(opts.cellHTML) p.h = escapehtml(p.v);
- break;
- case 'inlineStr':
- cref = d.match(isregex);
- p.t = 's';
- if(cref != null && (sstr = parse_si(cref[1]))) {
- p.v = sstr.t;
- if(opts.cellHTML) p.h = sstr.h;
- } else p.v = "";
- break;
- case 'b': p.v = parsexmlbool(p.v); break;
- case 'd':
- if(opts.cellDates) p.v = parseDate(p.v, 1);
- else { p.v = datenum(parseDate(p.v, 1)); p.t = 'n'; }
- break;
- /* error string in .w, number in .v */
- case 'e':
- if(!opts || opts.cellText !== false) p.w = p.v;
- p.v = RBErr[p.v]; break;
- }
- /* formatting */
- fmtid = fillid = 0;
- cf = null;
- if(do_format && tag.s !== undefined) {
- cf = styles.CellXf[tag.s];
- if(cf != null) {
- if(cf.numFmtId != null) fmtid = cf.numFmtId;
- if(opts.cellStyles) {
- if(cf.fillId != null) fillid = cf.fillId;
- }
- }
- }
- safe_format(p, fmtid, fillid, opts, themes, styles);
- if(opts.cellDates && do_format && p.t == 'n' && SSF.is_date(SSF._table[fmtid])) { p.t = 'd'; p.v = numdate(p.v); }
- if(dense) {
- var _r = decode_cell(tag.r);
- if(!s[_r.r]) s[_r.r] = [];
- s[_r.r][_r.c] = p;
- } else s[tag.r] = p;
- }
- }
- if(rows.length > 0) s['!rows'] = rows;
- }; })();
-
- function write_ws_xml_data(ws, opts, idx, wb) {
- var o = [], r = [], range = safe_decode_range(ws['!ref']), cell="", ref, rr = "", cols = [], R=0, C=0, rows = ws['!rows'];
- var dense = Array.isArray(ws);
- var params = ({r:rr}), row, height = -1;
- for(C = range.s.c; C <= range.e.c; ++C) cols[C] = encode_col(C);
- for(R = range.s.r; R <= range.e.r; ++R) {
- r = [];
- rr = encode_row(R);
- for(C = range.s.c; C <= range.e.c; ++C) {
- ref = cols[C] + rr;
- var _cell = dense ? (ws[R]||[])[C]: ws[ref];
- if(_cell === undefined) continue;
- if((cell = write_ws_xml_cell(_cell, ref, ws, opts, idx, wb)) != null) r.push(cell);
- }
- if(r.length > 0 || (rows && rows[R])) {
- params = ({r:rr});
- if(rows && rows[R]) {
- row = rows[R];
- if(row.hidden) params.hidden = 1;
- height = -1;
- if(row.hpx) height = px2pt(row.hpx);
- else if(row.hpt) height = row.hpt;
- if(height > -1) { params.ht = height; params.customHeight = 1; }
- if(row.level) { params.outlineLevel = row.level; }
- }
- o[o.length] = (writextag('row', r.join(""), params));
- }
- }
- if(rows) for(; R < rows.length; ++R) {
- if(rows && rows[R]) {
- params = ({r:R+1});
- row = rows[R];
- if(row.hidden) params.hidden = 1;
- height = -1;
- if (row.hpx) height = px2pt(row.hpx);
- else if (row.hpt) height = row.hpt;
- if (height > -1) { params.ht = height; params.customHeight = 1; }
- if (row.level) { params.outlineLevel = row.level; }
- o[o.length] = (writextag('row', "", params));
- }
- }
- return o.join("");
- }
-
- var WS_XML_ROOT = writextag('worksheet', null, {
- 'xmlns': XMLNS.main[0],
- 'xmlns:r': XMLNS.r
- });
-
- function write_ws_xml(idx, opts, wb, rels) {
- var o = [XML_HEADER, WS_XML_ROOT];
- var s = wb.SheetNames[idx], sidx = 0, rdata = "";
- var ws = wb.Sheets[s];
- if(ws == null) ws = {};
- var ref = ws['!ref'] || 'A1';
- var range = safe_decode_range(ref);
- if(range.e.c > 0x3FFF || range.e.r > 0xFFFFF) {
- if(opts.WTF) throw new Error("Range " + ref + " exceeds format limit A1:XFD1048576");
- range.e.c = Math.min(range.e.c, 0x3FFF);
- range.e.r = Math.min(range.e.c, 0xFFFFF);
- ref = encode_range(range);
- }
- if(!rels) rels = {};
- ws['!comments'] = [];
- var _drawing = [];
-
- write_ws_xml_sheetpr(ws, wb, idx, opts, o);
-
- o[o.length] = (writextag('dimension', null, {'ref': ref}));
-
- o[o.length] = write_ws_xml_sheetviews(ws, opts, idx, wb);
-
- /* TODO: store in WB, process styles */
- if(opts.sheetFormat) o[o.length] = (writextag('sheetFormatPr', null, {
- defaultRowHeight:opts.sheetFormat.defaultRowHeight||'16',
- baseColWidth:opts.sheetFormat.baseColWidth||'10',
- outlineLevelRow:opts.sheetFormat.outlineLevelRow||'7'
- }));
-
- if(ws['!cols'] != null && ws['!cols'].length > 0) o[o.length] = (write_ws_xml_cols(ws, ws['!cols']));
-
- o[sidx = o.length] = '<sheetData/>';
- ws['!links'] = [];
- if(ws['!ref'] != null) {
- rdata = write_ws_xml_data(ws, opts, idx, wb, rels);
- if(rdata.length > 0) o[o.length] = (rdata);
- }
- if(o.length>sidx+1) { o[o.length] = ('</sheetData>'); o[sidx]=o[sidx].replace("/>",">"); }
-
- /* sheetCalcPr */
-
- if(ws['!protect'] != null) o[o.length] = write_ws_xml_protection(ws['!protect']);
-
- /* protectedRanges */
- /* scenarios */
-
- if(ws['!autofilter'] != null) o[o.length] = write_ws_xml_autofilter(ws['!autofilter'], ws, wb, idx);
-
- /* sortState */
- /* dataConsolidate */
- /* customSheetViews */
-
- if(ws['!merges'] != null && ws['!merges'].length > 0) o[o.length] = (write_ws_xml_merges(ws['!merges']));
-
- /* phoneticPr */
- /* conditionalFormatting */
- /* dataValidations */
-
- var relc = -1, rel, rId = -1;
- if(ws['!links'].length > 0) {
- o[o.length] = "<hyperlinks>";
- ws['!links'].forEach(function(l) {
- if(!l[1].Target) return;
- rel = ({"ref":l[0]});
- if(l[1].Target.charAt(0) != "#") {
- rId = add_rels(rels, -1, escapexml(l[1].Target).replace(/#.*$/, ""), RELS.HLINK);
- rel["r:id"] = "rId"+rId;
- }
- if((relc = l[1].Target.indexOf("#")) > -1) rel.location = escapexml(l[1].Target.slice(relc+1));
- if(l[1].Tooltip) rel.tooltip = escapexml(l[1].Tooltip);
- o[o.length] = writextag("hyperlink",null,rel);
- });
- o[o.length] = "</hyperlinks>";
- }
- delete ws['!links'];
-
- /* printOptions */
-
- if(ws['!margins'] != null) o[o.length] = write_ws_xml_margins(ws['!margins']);
-
- /* pageSetup */
- /* headerFooter */
- /* rowBreaks */
- /* colBreaks */
- /* customProperties */
- /* cellWatches */
-
- if(!opts || opts.ignoreEC || (opts.ignoreEC == (void 0))) o[o.length] = writetag("ignoredErrors", writextag("ignoredError", null, {numberStoredAsText:1, sqref:ref}));
-
- /* smartTags */
-
- if(_drawing.length > 0) {
- rId = add_rels(rels, -1, "../drawings/drawing" + (idx+1) + ".xml", RELS.DRAW);
- o[o.length] = writextag("drawing", null, {"r:id":"rId" + rId});
- ws['!drawing'] = _drawing;
- }
-
- if(ws['!comments'].length > 0) {
- rId = add_rels(rels, -1, "../drawings/vmlDrawing" + (idx+1) + ".vml", RELS.VML);
- o[o.length] = writextag("legacyDrawing", null, {"r:id":"rId" + rId});
- ws['!legacy'] = rId;
- }
-
- /* legacyDrawingHF */
- /* picture */
- /* oleObjects */
- /* controls */
- /* webPublishItems */
- /* tableParts */
- /* extLst */
-
- if(o.length>1) { o[o.length] = ('</worksheet>'); o[1]=o[1].replace("/>",">"); }
- return o.join("");
- }
-
- /* [MS-XLSB] 2.4.726 BrtRowHdr */
- function parse_BrtRowHdr(data, length) {
- var z = ({});
- var tgt = data.l + length;
- z.r = data.read_shift(4);
- data.l += 4; // TODO: ixfe
- var miyRw = data.read_shift(2);
- data.l += 1; // TODO: top/bot padding
- var flags = data.read_shift(1);
- data.l = tgt;
- if(flags & 0x07) z.level = flags & 0x07;
- if(flags & 0x10) z.hidden = true;
- if(flags & 0x20) z.hpt = miyRw / 20;
- return z;
- }
- function write_BrtRowHdr(R, range, ws) {
- var o = new_buf(17+8*16);
- var row = (ws['!rows']||[])[R]||{};
- o.write_shift(4, R);
-
- o.write_shift(4, 0); /* TODO: ixfe */
-
- var miyRw = 0x0140;
- if(row.hpx) miyRw = px2pt(row.hpx) * 20;
- else if(row.hpt) miyRw = row.hpt * 20;
- o.write_shift(2, miyRw);
-
- o.write_shift(1, 0); /* top/bot padding */
-
- var flags = 0x0;
- if(row.level) flags |= row.level;
- if(row.hidden) flags |= 0x10;
- if(row.hpx || row.hpt) flags |= 0x20;
- o.write_shift(1, flags);
-
- o.write_shift(1, 0); /* phonetic guide */
-
- /* [MS-XLSB] 2.5.8 BrtColSpan explains the mechanism */
- var ncolspan = 0, lcs = o.l;
- o.l += 4;
-
- var caddr = {r:R, c:0};
- for(var i = 0; i < 16; ++i) {
- if((range.s.c > ((i+1) << 10)) || (range.e.c < (i << 10))) continue;
- var first = -1, last = -1;
- for(var j = (i<<10); j < ((i+1)<<10); ++j) {
- caddr.c = j;
- var cell = Array.isArray(ws) ? (ws[caddr.r]||[])[caddr.c] : ws[encode_cell(caddr)];
- if(cell) { if(first < 0) first = j; last = j; }
- }
- if(first < 0) continue;
- ++ncolspan;
- o.write_shift(4, first);
- o.write_shift(4, last);
- }
-
- var l = o.l;
- o.l = lcs;
- o.write_shift(4, ncolspan);
- o.l = l;
-
- return o.length > o.l ? o.slice(0, o.l) : o;
- }
- function write_row_header(ba, ws, range, R) {
- var o = write_BrtRowHdr(R, range, ws);
- if((o.length > 17) || (ws['!rows']||[])[R]) write_record(ba, 'BrtRowHdr', o);
- }
-
- /* [MS-XLSB] 2.4.820 BrtWsDim */
- var parse_BrtWsDim = parse_UncheckedRfX;
- var write_BrtWsDim = write_UncheckedRfX;
-
- /* [MS-XLSB] 2.4.821 BrtWsFmtInfo */
- function parse_BrtWsFmtInfo() {
- }
- //function write_BrtWsFmtInfo(ws, o) { }
-
- /* [MS-XLSB] 2.4.823 BrtWsProp */
- function parse_BrtWsProp(data, length) {
- var z = {};
- /* TODO: pull flags */
- data.l += 19;
- z.name = parse_XLSBCodeName(data, length - 19);
- return z;
- }
- function write_BrtWsProp(str, o) {
- if(o == null) o = new_buf(84+4*str.length);
- for(var i = 0; i < 3; ++i) o.write_shift(1,0);
- write_BrtColor({auto:1}, o);
- o.write_shift(-4,-1);
- o.write_shift(-4,-1);
- write_XLSBCodeName(str, o);
- return o.slice(0, o.l);
- }
-
- /* [MS-XLSB] 2.4.306 BrtCellBlank */
- function parse_BrtCellBlank(data) {
- var cell = parse_XLSBCell(data);
- return [cell];
- }
- function write_BrtCellBlank(cell, ncell, o) {
- if(o == null) o = new_buf(8);
- return write_XLSBCell(ncell, o);
- }
-
-
- /* [MS-XLSB] 2.4.307 BrtCellBool */
- function parse_BrtCellBool(data) {
- var cell = parse_XLSBCell(data);
- var fBool = data.read_shift(1);
- return [cell, fBool, 'b'];
- }
- function write_BrtCellBool(cell, ncell, o) {
- if(o == null) o = new_buf(9);
- write_XLSBCell(ncell, o);
- o.write_shift(1, cell.v ? 1 : 0);
- return o;
- }
-
- /* [MS-XLSB] 2.4.308 BrtCellError */
- function parse_BrtCellError(data) {
- var cell = parse_XLSBCell(data);
- var bError = data.read_shift(1);
- return [cell, bError, 'e'];
- }
-
- /* [MS-XLSB] 2.4.311 BrtCellIsst */
- function parse_BrtCellIsst(data) {
- var cell = parse_XLSBCell(data);
- var isst = data.read_shift(4);
- return [cell, isst, 's'];
- }
- function write_BrtCellIsst(cell, ncell, o) {
- if(o == null) o = new_buf(12);
- write_XLSBCell(ncell, o);
- o.write_shift(4, ncell.v);
- return o;
- }
-
- /* [MS-XLSB] 2.4.313 BrtCellReal */
- function parse_BrtCellReal(data) {
- var cell = parse_XLSBCell(data);
- var value = parse_Xnum(data);
- return [cell, value, 'n'];
- }
- function write_BrtCellReal(cell, ncell, o) {
- if(o == null) o = new_buf(16);
- write_XLSBCell(ncell, o);
- write_Xnum(cell.v, o);
- return o;
- }
-
- /* [MS-XLSB] 2.4.314 BrtCellRk */
- function parse_BrtCellRk(data) {
- var cell = parse_XLSBCell(data);
- var value = parse_RkNumber(data);
- return [cell, value, 'n'];
- }
- function write_BrtCellRk(cell, ncell, o) {
- if(o == null) o = new_buf(12);
- write_XLSBCell(ncell, o);
- write_RkNumber(cell.v, o);
- return o;
- }
-
-
- /* [MS-XLSB] 2.4.317 BrtCellSt */
- function parse_BrtCellSt(data) {
- var cell = parse_XLSBCell(data);
- var value = parse_XLWideString(data);
- return [cell, value, 'str'];
- }
- function write_BrtCellSt(cell, ncell, o) {
- if(o == null) o = new_buf(12 + 4 * cell.v.length);
- write_XLSBCell(ncell, o);
- write_XLWideString(cell.v, o);
- return o.length > o.l ? o.slice(0, o.l) : o;
- }
-
- /* [MS-XLSB] 2.4.653 BrtFmlaBool */
- function parse_BrtFmlaBool(data, length, opts) {
- var end = data.l + length;
- var cell = parse_XLSBCell(data);
- cell.r = opts['!row'];
- var value = data.read_shift(1);
- var o = [cell, value, 'b'];
- if(opts.cellFormula) {
- data.l += 2;
- var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
- o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */
- }
- else data.l = end;
- return o;
- }
-
- /* [MS-XLSB] 2.4.654 BrtFmlaError */
- function parse_BrtFmlaError(data, length, opts) {
- var end = data.l + length;
- var cell = parse_XLSBCell(data);
- cell.r = opts['!row'];
- var value = data.read_shift(1);
- var o = [cell, value, 'e'];
- if(opts.cellFormula) {
- data.l += 2;
- var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
- o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */
- }
- else data.l = end;
- return o;
- }
-
- /* [MS-XLSB] 2.4.655 BrtFmlaNum */
- function parse_BrtFmlaNum(data, length, opts) {
- var end = data.l + length;
- var cell = parse_XLSBCell(data);
- cell.r = opts['!row'];
- var value = parse_Xnum(data);
- var o = [cell, value, 'n'];
- if(opts.cellFormula) {
- data.l += 2;
- var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
- o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */
- }
- else data.l = end;
- return o;
- }
-
- /* [MS-XLSB] 2.4.656 BrtFmlaString */
- function parse_BrtFmlaString(data, length, opts) {
- var end = data.l + length;
- var cell = parse_XLSBCell(data);
- cell.r = opts['!row'];
- var value = parse_XLWideString(data);
- var o = [cell, value, 'str'];
- if(opts.cellFormula) {
- data.l += 2;
- var formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);
- o[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */
- }
- else data.l = end;
- return o;
- }
-
- /* [MS-XLSB] 2.4.682 BrtMergeCell */
- var parse_BrtMergeCell = parse_UncheckedRfX;
- var write_BrtMergeCell = write_UncheckedRfX;
- /* [MS-XLSB] 2.4.107 BrtBeginMergeCells */
- function write_BrtBeginMergeCells(cnt, o) {
- if(o == null) o = new_buf(4);
- o.write_shift(4, cnt);
- return o;
- }
-
- /* [MS-XLSB] 2.4.662 BrtHLink */
- function parse_BrtHLink(data, length) {
- var end = data.l + length;
- var rfx = parse_UncheckedRfX(data, 16);
- var relId = parse_XLNullableWideString(data);
- var loc = parse_XLWideString(data);
- var tooltip = parse_XLWideString(data);
- var display = parse_XLWideString(data);
- data.l = end;
- var o = ({rfx:rfx, relId:relId, loc:loc, display:display});
- if(tooltip) o.Tooltip = tooltip;
- return o;
- }
- function write_BrtHLink(l, rId) {
- var o = new_buf(50+4*(l[1].Target.length + (l[1].Tooltip || "").length));
- write_UncheckedRfX({s:decode_cell(l[0]), e:decode_cell(l[0])}, o);
- write_RelID("rId" + rId, o);
- var locidx = l[1].Target.indexOf("#");
- var loc = locidx == -1 ? "" : l[1].Target.slice(locidx+1);
- write_XLWideString(loc || "", o);
- write_XLWideString(l[1].Tooltip || "", o);
- write_XLWideString("", o);
- return o.slice(0, o.l);
- }
-
- /* [MS-XLSB] 2.4.692 BrtPane */
- function parse_BrtPane(/*data, length, opts*/) {
- }
-
- /* [MS-XLSB] 2.4.6 BrtArrFmla */
- function parse_BrtArrFmla(data, length, opts) {
- var end = data.l + length;
- var rfx = parse_RfX(data, 16);
- var fAlwaysCalc = data.read_shift(1);
- var o = [rfx]; o[2] = fAlwaysCalc;
- if(opts.cellFormula) {
- var formula = parse_XLSBArrayParsedFormula(data, end - data.l, opts);
- o[1] = formula;
- } else data.l = end;
- return o;
- }
-
- /* [MS-XLSB] 2.4.750 BrtShrFmla */
- function parse_BrtShrFmla(data, length, opts) {
- var end = data.l + length;
- var rfx = parse_UncheckedRfX(data, 16);
- var o = [rfx];
- if(opts.cellFormula) {
- var formula = parse_XLSBSharedParsedFormula(data, end - data.l, opts);
- o[1] = formula;
- data.l = end;
- } else data.l = end;
- return o;
- }
-
- /* [MS-XLSB] 2.4.323 BrtColInfo */
- /* TODO: once XLS ColInfo is set, combine the functions */
- function write_BrtColInfo(C, col, o) {
- if(o == null) o = new_buf(18);
- var p = col_obj_w(C, col);
- o.write_shift(-4, C);
- o.write_shift(-4, C);
- o.write_shift(4, (p.width || 10) * 256);
- o.write_shift(4, 0/*ixfe*/); // style
- var flags = 0;
- if(col.hidden) flags |= 0x01;
- if(typeof p.width == 'number') flags |= 0x02;
- if(col.level) flags |= (col.level << 8);
- o.write_shift(2, flags); // bit flag
- return o;
- }
-
- /* [MS-XLSB] 2.4.678 BrtMargins */
- var BrtMarginKeys = ["left","right","top","bottom","header","footer"];
- function parse_BrtMargins(data) {
- var margins = ({});
- BrtMarginKeys.forEach(function(k) { margins[k] = parse_Xnum(data, 8); });
- return margins;
- }
- function write_BrtMargins(margins, o) {
- if(o == null) o = new_buf(6*8);
- default_margins(margins);
- BrtMarginKeys.forEach(function(k) { write_Xnum((margins)[k], o); });
- return o;
- }
-
- /* [MS-XLSB] 2.4.299 BrtBeginWsView */
- function parse_BrtBeginWsView(data) {
- var f = data.read_shift(2);
- data.l += 28;
- return { RTL: f & 0x20 };
- }
- function write_BrtBeginWsView(ws, Workbook, o) {
- if(o == null) o = new_buf(30);
- var f = 0x39c;
- if((((Workbook||{}).Views||[])[0]||{}).RTL) f |= 0x20;
- o.write_shift(2, f); // bit flag
- o.write_shift(4, 0);
- o.write_shift(4, 0); // view first row
- o.write_shift(4, 0); // view first col
- o.write_shift(1, 0); // gridline color ICV
- o.write_shift(1, 0);
- o.write_shift(2, 0);
- o.write_shift(2, 100); // zoom scale
- o.write_shift(2, 0);
- o.write_shift(2, 0);
- o.write_shift(2, 0);
- o.write_shift(4, 0); // workbook view id
- return o;
- }
-
- /* [MS-XLSB] 2.4.309 BrtCellIgnoreEC */
- function write_BrtCellIgnoreEC(ref) {
- var o = new_buf(24);
- o.write_shift(4, 4);
- o.write_shift(4, 1);
- write_UncheckedRfX(ref, o);
- return o;
- }
-
- /* [MS-XLSB] 2.4.748 BrtSheetProtection */
- function write_BrtSheetProtection(sp, o) {
- if(o == null) o = new_buf(16*4+2);
- o.write_shift(2, sp.password ? crypto_CreatePasswordVerifier_Method1(sp.password) : 0);
- o.write_shift(4, 1); // this record should not be written if no protection
- [
- ["objects", false], // fObjects
- ["scenarios", false], // fScenarios
- ["formatCells", true], // fFormatCells
- ["formatColumns", true], // fFormatColumns
- ["formatRows", true], // fFormatRows
- ["insertColumns", true], // fInsertColumns
- ["insertRows", true], // fInsertRows
- ["insertHyperlinks", true], // fInsertHyperlinks
- ["deleteColumns", true], // fDeleteColumns
- ["deleteRows", true], // fDeleteRows
- ["selectLockedCells", false], // fSelLockedCells
- ["sort", true], // fSort
- ["autoFilter", true], // fAutoFilter
- ["pivotTables", true], // fPivotTables
- ["selectUnlockedCells", false] // fSelUnlockedCells
- ].forEach(function(n) {
- if(n[1]) o.write_shift(4, sp[n[0]] != null && !sp[n[0]] ? 1 : 0);
- else o.write_shift(4, sp[n[0]] != null && sp[n[0]] ? 0 : 1);
- });
- return o;
- }
-
- function parse_BrtDVal(/*data, length, opts*/) {
- }
- function parse_BrtDVal14(/*data, length, opts*/) {
- }
- /* [MS-XLSB] 2.1.7.61 Worksheet */
- function parse_ws_bin(data, _opts, idx, rels, wb, themes, styles) {
- if(!data) return data;
- var opts = _opts || {};
- if(!rels) rels = {'!id':{}};
- if(DENSE != null && opts.dense == null) opts.dense = DENSE;
- var s = (opts.dense ? [] : {});
-
- var ref;
- var refguess = {s: {r:2000000, c:2000000}, e: {r:0, c:0} };
-
- var state = [];
- var pass = false, end = false;
- var row, p, cf, R, C, addr, sstr, rr, cell;
- var merges = [];
- opts.biff = 12;
- opts['!row'] = 0;
-
- var ai = 0, af = false;
-
- var arrayf = [];
- var sharedf = {};
- var supbooks = opts.supbooks || wb.supbooks || ([[]]);
- supbooks.sharedf = sharedf;
- supbooks.arrayf = arrayf;
- supbooks.SheetNames = wb.SheetNames || wb.Sheets.map(function(x) { return x.name; });
- if(!opts.supbooks) {
- opts.supbooks = supbooks;
- if(wb.Names) for(var i = 0; i < wb.Names.length; ++i) supbooks[0][i+1] = wb.Names[i];
- }
-
- var colinfo = [], rowinfo = [];
- var seencol = false;
-
- recordhopper(data, function ws_parse(val, R_n, RT) {
- if(end) return;
- switch(RT) {
- case 0x0094: /* 'BrtWsDim' */
- ref = val; break;
- case 0x0000: /* 'BrtRowHdr' */
- row = val;
- if(opts.sheetRows && opts.sheetRows <= row.r) end=true;
- rr = encode_row(R = row.r);
- opts['!row'] = row.r;
- if(val.hidden || val.hpt || val.level != null) {
- if(val.hpt) val.hpx = pt2px(val.hpt);
- rowinfo[val.r] = val;
- }
- break;
-
- case 0x0002: /* 'BrtCellRk' */
- case 0x0003: /* 'BrtCellError' */
- case 0x0004: /* 'BrtCellBool' */
- case 0x0005: /* 'BrtCellReal' */
- case 0x0006: /* 'BrtCellSt' */
- case 0x0007: /* 'BrtCellIsst' */
- case 0x0008: /* 'BrtFmlaString' */
- case 0x0009: /* 'BrtFmlaNum' */
- case 0x000A: /* 'BrtFmlaBool' */
- case 0x000B: /* 'BrtFmlaError' */
- p = ({t:val[2]});
- switch(val[2]) {
- case 'n': p.v = val[1]; break;
- case 's': sstr = strs[val[1]]; p.v = sstr.t; p.r = sstr.r; break;
- case 'b': p.v = val[1] ? true : false; break;
- case 'e': p.v = val[1]; if(opts.cellText !== false) p.w = BErr[p.v]; break;
- case 'str': p.t = 's'; p.v = val[1]; break;
- }
- if((cf = styles.CellXf[val[0].iStyleRef])) safe_format(p,cf.numFmtId,null,opts, themes, styles);
- C = val[0].c;
- if(opts.dense) { if(!s[R]) s[R] = []; s[R][C] = p; }
- else s[encode_col(C) + rr] = p;
- if(opts.cellFormula) {
- af = false;
- for(ai = 0; ai < arrayf.length; ++ai) {
- var aii = arrayf[ai];
- if(row.r >= aii[0].s.r && row.r <= aii[0].e.r)
- if(C >= aii[0].s.c && C <= aii[0].e.c) {
- p.F = encode_range(aii[0]); af = true;
- }
- }
- if(!af && val.length > 3) p.f = val[3];
- }
- if(refguess.s.r > row.r) refguess.s.r = row.r;
- if(refguess.s.c > C) refguess.s.c = C;
- if(refguess.e.r < row.r) refguess.e.r = row.r;
- if(refguess.e.c < C) refguess.e.c = C;
- if(opts.cellDates && cf && p.t == 'n' && SSF.is_date(SSF._table[cf.numFmtId])) {
- var _d = SSF.parse_date_code(p.v); if(_d) { p.t = 'd'; p.v = new Date(_d.y, _d.m-1,_d.d,_d.H,_d.M,_d.S,_d.u); }
- }
- break;
-
- case 0x0001: /* 'BrtCellBlank' */
- if(!opts.sheetStubs || pass) break;
- p = ({t:'z',v:undefined});
- C = val[0].c;
- if(opts.dense) { if(!s[R]) s[R] = []; s[R][C] = p; }
- else s[encode_col(C) + rr] = p;
- if(refguess.s.r > row.r) refguess.s.r = row.r;
- if(refguess.s.c > C) refguess.s.c = C;
- if(refguess.e.r < row.r) refguess.e.r = row.r;
- if(refguess.e.c < C) refguess.e.c = C;
- break;
-
- case 0x00B0: /* 'BrtMergeCell' */
- merges.push(val); break;
-
- case 0x01EE: /* 'BrtHLink' */
- var rel = rels['!id'][val.relId];
- if(rel) {
- val.Target = rel.Target;
- if(val.loc) val.Target += "#"+val.loc;
- val.Rel = rel;
- } else if(val.relId == '') {
- val.Target = "#" + val.loc;
- }
- for(R=val.rfx.s.r;R<=val.rfx.e.r;++R) for(C=val.rfx.s.c;C<=val.rfx.e.c;++C) {
- if(opts.dense) {
- if(!s[R]) s[R] = [];
- if(!s[R][C]) s[R][C] = {t:'z',v:undefined};
- s[R][C].l = val;
- } else {
- addr = encode_cell({c:C,r:R});
- if(!s[addr]) s[addr] = {t:'z',v:undefined};
- s[addr].l = val;
- }
- }
- break;
-
- case 0x01AA: /* 'BrtArrFmla' */
- if(!opts.cellFormula) break;
- arrayf.push(val);
- cell = ((opts.dense ? s[R][C] : s[encode_col(C) + rr]));
- cell.f = stringify_formula(val[1], refguess, {r:row.r, c:C}, supbooks, opts);
- cell.F = encode_range(val[0]);
- break;
- case 0x01AB: /* 'BrtShrFmla' */
- if(!opts.cellFormula) break;
- sharedf[encode_cell(val[0].s)] = val[1];
- cell = (opts.dense ? s[R][C] : s[encode_col(C) + rr]);
- cell.f = stringify_formula(val[1], refguess, {r:row.r, c:C}, supbooks, opts);
- break;
-
- /* identical to 'ColInfo' in XLS */
- case 0x003C: /* 'BrtColInfo' */
- if(!opts.cellStyles) break;
- while(val.e >= val.s) {
- colinfo[val.e--] = { width: val.w/256, hidden: !!(val.flags & 0x01), level: val.level };
- if(!seencol) { seencol = true; find_mdw_colw(val.w/256); }
- process_col(colinfo[val.e+1]);
- }
- break;
-
- case 0x00A1: /* 'BrtBeginAFilter' */
- s['!autofilter'] = { ref:encode_range(val) };
- break;
-
- case 0x01DC: /* 'BrtMargins' */
- s['!margins'] = val;
- break;
-
- case 0x0093: /* 'BrtWsProp' */
- if(!wb.Sheets[idx]) wb.Sheets[idx] = {};
- if(val.name) wb.Sheets[idx].CodeName = val.name;
- break;
-
- case 0x0089: /* 'BrtBeginWsView' */
- if(!wb.Views) wb.Views = [{}];
- if(!wb.Views[0]) wb.Views[0] = {};
- if(val.RTL) wb.Views[0].RTL = true;
- break;
-
- case 0x01E5: /* 'BrtWsFmtInfo' */
- break;
-
- case 0x0040: /* 'BrtDVal' */
- case 0x041D: /* 'BrtDVal14' */
- break;
-
- case 0x0097: /* 'BrtPane' */
- break;
- case 0x00AF: /* 'BrtAFilterDateGroupItem' */
- case 0x0284: /* 'BrtActiveX' */
- case 0x0271: /* 'BrtBigName' */
- case 0x0232: /* 'BrtBkHim' */
- case 0x018C: /* 'BrtBrk' */
- case 0x0458: /* 'BrtCFIcon' */
- case 0x047A: /* 'BrtCFRuleExt' */
- case 0x01D7: /* 'BrtCFVO' */
- case 0x041A: /* 'BrtCFVO14' */
- case 0x0289: /* 'BrtCellIgnoreEC' */
- case 0x0451: /* 'BrtCellIgnoreEC14' */
- case 0x0031: /* 'BrtCellMeta' */
- case 0x024D: /* 'BrtCellSmartTagProperty' */
- case 0x025F: /* 'BrtCellWatch' */
- case 0x0234: /* 'BrtColor' */
- case 0x041F: /* 'BrtColor14' */
- case 0x00A8: /* 'BrtColorFilter' */
- case 0x00AE: /* 'BrtCustomFilter' */
- case 0x049C: /* 'BrtCustomFilter14' */
- case 0x01F3: /* 'BrtDRef' */
- case 0x0226: /* 'BrtDrawing' */
- case 0x00AB: /* 'BrtDynamicFilter' */
- case 0x00A7: /* 'BrtFilter' */
- case 0x0499: /* 'BrtFilter14' */
- case 0x00A9: /* 'BrtIconFilter' */
- case 0x049D: /* 'BrtIconFilter14' */
- case 0x0227: /* 'BrtLegacyDrawing' */
- case 0x0228: /* 'BrtLegacyDrawingHF' */
- case 0x0295: /* 'BrtListPart' */
- case 0x027F: /* 'BrtOleObject' */
- case 0x01DE: /* 'BrtPageSetup' */
- case 0x0219: /* 'BrtPhoneticInfo' */
- case 0x01DD: /* 'BrtPrintOptions' */
- case 0x0218: /* 'BrtRangeProtection' */
- case 0x044F: /* 'BrtRangeProtection14' */
- case 0x02A8: /* 'BrtRangeProtectionIso' */
- case 0x0450: /* 'BrtRangeProtectionIso14' */
- case 0x0400: /* 'BrtRwDescent' */
- case 0x0098: /* 'BrtSel' */
- case 0x0297: /* 'BrtSheetCalcProp' */
- case 0x0217: /* 'BrtSheetProtection' */
- case 0x02A6: /* 'BrtSheetProtectionIso' */
- case 0x01F8: /* 'BrtSlc' */
- case 0x0413: /* 'BrtSparkline' */
- case 0x01AC: /* 'BrtTable' */
- case 0x00AA: /* 'BrtTop10Filter' */
- case 0x0C00: /* 'BrtUid' */
- case 0x0032: /* 'BrtValueMeta' */
- case 0x0816: /* 'BrtWebExtension' */
- case 0x0415: /* 'BrtWsFmtInfoEx14' */
- break;
-
- case 0x0023: /* 'BrtFRTBegin' */
- pass = true; break;
- case 0x0024: /* 'BrtFRTEnd' */
- pass = false; break;
- case 0x0025: /* 'BrtACBegin' */
- state.push(R_n); pass = true; break;
- case 0x0026: /* 'BrtACEnd' */
- state.pop(); pass = false; break;
-
- default:
- if((R_n||"").indexOf("Begin") > 0){/* empty */}
- else if((R_n||"").indexOf("End") > 0){/* empty */}
- else if(!pass || opts.WTF) throw new Error("Unexpected record " + RT + " " + R_n);
- }
- }, opts);
-
- delete opts.supbooks;
- delete opts['!row'];
-
- if(!s["!ref"] && (refguess.s.r < 2000000 || ref && (ref.e.r > 0 || ref.e.c > 0 || ref.s.r > 0 || ref.s.c > 0))) s["!ref"] = encode_range(ref || refguess);
- if(opts.sheetRows && s["!ref"]) {
- var tmpref = safe_decode_range(s["!ref"]);
- if(opts.sheetRows <= +tmpref.e.r) {
- tmpref.e.r = opts.sheetRows - 1;
- if(tmpref.e.r > refguess.e.r) tmpref.e.r = refguess.e.r;
- if(tmpref.e.r < tmpref.s.r) tmpref.s.r = tmpref.e.r;
- if(tmpref.e.c > refguess.e.c) tmpref.e.c = refguess.e.c;
- if(tmpref.e.c < tmpref.s.c) tmpref.s.c = tmpref.e.c;
- s["!fullref"] = s["!ref"];
- s["!ref"] = encode_range(tmpref);
- }
- }
- if(merges.length > 0) s["!merges"] = merges;
- if(colinfo.length > 0) s["!cols"] = colinfo;
- if(rowinfo.length > 0) s["!rows"] = rowinfo;
- return s;
- }
-
- /* TODO: something useful -- this is a stub */
- function write_ws_bin_cell(ba, cell, R, C, opts, ws) {
- if(cell.v === undefined) return;
- var vv = "";
- switch(cell.t) {
- case 'b': vv = cell.v ? "1" : "0"; break;
- case 'd': // no BrtCellDate :(
- cell = dup(cell);
- cell.z = cell.z || SSF._table[14];
- cell.v = datenum(parseDate(cell.v)); cell.t = 'n';
- break;
- /* falls through */
- case 'n': case 'e': vv = ''+cell.v; break;
- default: vv = cell.v; break;
- }
- var o = ({r:R, c:C});
- /* TODO: cell style */
- o.s = get_cell_style(opts.cellXfs, cell, opts);
- if(cell.l) ws['!links'].push([encode_cell(o), cell.l]);
- if(cell.c) ws['!comments'].push([encode_cell(o), cell.c]);
- switch(cell.t) {
- case 's': case 'str':
- if(opts.bookSST) {
- vv = get_sst_id(opts.Strings, (cell.v), opts.revStrings);
- o.t = "s"; o.v = vv;
- write_record(ba, "BrtCellIsst", write_BrtCellIsst(cell, o));
- } else {
- o.t = "str";
- write_record(ba, "BrtCellSt", write_BrtCellSt(cell, o));
- }
- return;
- case 'n':
- /* TODO: determine threshold for Real vs RK */
- if(cell.v == (cell.v | 0) && cell.v > -1000 && cell.v < 1000) write_record(ba, "BrtCellRk", write_BrtCellRk(cell, o));
- else write_record(ba, "BrtCellReal", write_BrtCellReal(cell, o));
- return;
- case 'b':
- o.t = "b";
- write_record(ba, "BrtCellBool", write_BrtCellBool(cell, o));
- return;
- case 'e': /* TODO: error */ o.t = "e"; break;
- }
- write_record(ba, "BrtCellBlank", write_BrtCellBlank(cell, o));
- }
-
- function write_CELLTABLE(ba, ws, idx, opts) {
- var range = safe_decode_range(ws['!ref'] || "A1"), ref, rr = "", cols = [];
- write_record(ba, 'BrtBeginSheetData');
- var dense = Array.isArray(ws);
- var cap = range.e.r;
- if(ws['!rows']) cap = Math.max(range.e.r, ws['!rows'].length - 1);
- for(var R = range.s.r; R <= cap; ++R) {
- rr = encode_row(R);
- /* [ACCELLTABLE] */
- /* BrtRowHdr */
- write_row_header(ba, ws, range, R);
- if(R <= range.e.r) for(var C = range.s.c; C <= range.e.c; ++C) {
- /* *16384CELL */
- if(R === range.s.r) cols[C] = encode_col(C);
- ref = cols[C] + rr;
- var cell = dense ? (ws[R]||[])[C] : ws[ref];
- if(!cell) continue;
- /* write cell */
- write_ws_bin_cell(ba, cell, R, C, opts, ws);
- }
- }
- write_record(ba, 'BrtEndSheetData');
- }
-
- function write_MERGECELLS(ba, ws) {
- if(!ws || !ws['!merges']) return;
- write_record(ba, 'BrtBeginMergeCells', write_BrtBeginMergeCells(ws['!merges'].length));
- ws['!merges'].forEach(function(m) { write_record(ba, 'BrtMergeCell', write_BrtMergeCell(m)); });
- write_record(ba, 'BrtEndMergeCells');
- }
-
- function write_COLINFOS(ba, ws) {
- if(!ws || !ws['!cols']) return;
- write_record(ba, 'BrtBeginColInfos');
- ws['!cols'].forEach(function(m, i) { if(m) write_record(ba, 'BrtColInfo', write_BrtColInfo(i, m)); });
- write_record(ba, 'BrtEndColInfos');
- }
-
- function write_IGNOREECS(ba, ws) {
- if(!ws || !ws['!ref']) return;
- write_record(ba, 'BrtBeginCellIgnoreECs');
- write_record(ba, 'BrtCellIgnoreEC', write_BrtCellIgnoreEC(safe_decode_range(ws['!ref'])));
- write_record(ba, 'BrtEndCellIgnoreECs');
- }
-
- function write_HLINKS(ba, ws, rels) {
- /* *BrtHLink */
- ws['!links'].forEach(function(l) {
- if(!l[1].Target) return;
- var rId = add_rels(rels, -1, l[1].Target.replace(/#.*$/, ""), RELS.HLINK);
- write_record(ba, "BrtHLink", write_BrtHLink(l, rId));
- });
- delete ws['!links'];
- }
- function write_LEGACYDRAWING(ba, ws, idx, rels) {
- /* [BrtLegacyDrawing] */
- if(ws['!comments'].length > 0) {
- var rId = add_rels(rels, -1, "../drawings/vmlDrawing" + (idx+1) + ".vml", RELS.VML);
- write_record(ba, "BrtLegacyDrawing", write_RelID("rId" + rId));
- ws['!legacy'] = rId;
- }
- }
-
- function write_AUTOFILTER(ba, ws, wb, idx) {
- if(!ws['!autofilter']) return;
- var data = ws['!autofilter'];
- var ref = typeof data.ref === "string" ? data.ref : encode_range(data.ref);
-
- /* Update FilterDatabase defined name for the worksheet */
- if(!wb.Workbook) wb.Workbook = ({Sheets:[]});
- if(!wb.Workbook.Names) wb.Workbook.Names = [];
- var names = wb.Workbook.Names;
- var range = decode_range(ref);
- if(range.s.r == range.e.r) { range.e.r = decode_range(ws["!ref"]).e.r; ref = encode_range(range); }
- for(var i = 0; i < names.length; ++i) {
- var name = names[i];
- if(name.Name != '_xlnm._FilterDatabase') continue;
- if(name.Sheet != idx) continue;
- name.Ref = "'" + wb.SheetNames[idx] + "'!" + ref; break;
- }
- if(i == names.length) names.push({ Name: '_xlnm._FilterDatabase', Sheet: idx, Ref: "'" + wb.SheetNames[idx] + "'!" + ref });
-
- write_record(ba, "BrtBeginAFilter", write_UncheckedRfX(safe_decode_range(ref)));
- /* *FILTERCOLUMN */
- /* [SORTSTATE] */
- /* BrtEndAFilter */
- write_record(ba, "BrtEndAFilter");
- }
-
- function write_WSVIEWS2(ba, ws, Workbook) {
- write_record(ba, "BrtBeginWsViews");
- { /* 1*WSVIEW2 */
- /* [ACUID] */
- write_record(ba, "BrtBeginWsView", write_BrtBeginWsView(ws, Workbook));
- /* [BrtPane] */
- /* *4BrtSel */
- /* *4SXSELECT */
- /* *FRT */
- write_record(ba, "BrtEndWsView");
- }
- /* *FRT */
- write_record(ba, "BrtEndWsViews");
- }
-
- function write_WSFMTINFO() {
- /* [ACWSFMTINFO] */
- //write_record(ba, "BrtWsFmtInfo", write_BrtWsFmtInfo(ws));
- }
-
- function write_SHEETPROTECT(ba, ws) {
- if(!ws['!protect']) return;
- /* [BrtSheetProtectionIso] */
- write_record(ba, "BrtSheetProtection", write_BrtSheetProtection(ws['!protect']));
- }
-
- function write_ws_bin(idx, opts, wb, rels) {
- var ba = buf_array();
- var s = wb.SheetNames[idx], ws = wb.Sheets[s] || {};
- var c = s; try { if(wb && wb.Workbook) c = wb.Workbook.Sheets[idx].CodeName || c; } catch(e) {}
- var r = safe_decode_range(ws['!ref'] || "A1");
- if(r.e.c > 0x3FFF || r.e.r > 0xFFFFF) {
- if(opts.WTF) throw new Error("Range " + (ws['!ref'] || "A1") + " exceeds format limit A1:XFD1048576");
- r.e.c = Math.min(r.e.c, 0x3FFF);
- r.e.r = Math.min(r.e.c, 0xFFFFF);
- }
- ws['!links'] = [];
- /* passed back to write_zip and removed there */
- ws['!comments'] = [];
- write_record(ba, "BrtBeginSheet");
- if(wb.vbaraw) write_record(ba, "BrtWsProp", write_BrtWsProp(c));
- write_record(ba, "BrtWsDim", write_BrtWsDim(r));
- write_WSVIEWS2(ba, ws, wb.Workbook);
- write_WSFMTINFO(ba, ws);
- write_COLINFOS(ba, ws, idx, opts, wb);
- write_CELLTABLE(ba, ws, idx, opts, wb);
- /* [BrtSheetCalcProp] */
- write_SHEETPROTECT(ba, ws);
- /* *([BrtRangeProtectionIso] BrtRangeProtection) */
- /* [SCENMAN] */
- write_AUTOFILTER(ba, ws, wb, idx);
- /* [SORTSTATE] */
- /* [DCON] */
- /* [USERSHVIEWS] */
- write_MERGECELLS(ba, ws);
- /* [BrtPhoneticInfo] */
- /* *CONDITIONALFORMATTING */
- /* [DVALS] */
- write_HLINKS(ba, ws, rels);
- /* [BrtPrintOptions] */
- if(ws['!margins']) write_record(ba, "BrtMargins", write_BrtMargins(ws['!margins']));
- /* [BrtPageSetup] */
- /* [HEADERFOOTER] */
- /* [RWBRK] */
- /* [COLBRK] */
- /* *BrtBigName */
- /* [CELLWATCHES] */
- if(!opts || opts.ignoreEC || (opts.ignoreEC == (void 0))) write_IGNOREECS(ba, ws);
- /* [SMARTTAGS] */
- /* [BrtDrawing] */
- write_LEGACYDRAWING(ba, ws, idx, rels);
- /* [BrtLegacyDrawingHF] */
- /* [BrtBkHim] */
- /* [OLEOBJECTS] */
- /* [ACTIVEXCONTROLS] */
- /* [WEBPUBITEMS] */
- /* [LISTPARTS] */
- /* FRTWORKSHEET */
- write_record(ba, "BrtEndSheet");
- return ba.end();
- }
- RELS.CHART = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart";
- RELS.CHARTEX = "http://schemas.microsoft.com/office/2014/relationships/chartEx";
-
- function parse_Cache(data) {
- var col = [];
- var num = data.match(/^<c:numCache>/);
- var f;
-
- /* 21.2.2.150 pt CT_NumVal */
- (data.match(/<c:pt idx="(\d*)">(.*?)<\/c:pt>/mg)||[]).forEach(function(pt) {
- var q = pt.match(/<c:pt idx="(\d*?)"><c:v>(.*)<\/c:v><\/c:pt>/);
- if(!q) return;
- col[+q[1]] = num ? +q[2] : q[2];
- });
-
- /* 21.2.2.71 formatCode CT_Xstring */
- var nf = unescapexml((data.match(/<c:formatCode>([\s\S]*?)<\/c:formatCode>/) || ["","General"])[1]);
-
- (data.match(/<c:f>(.*?)<\/c:f>/mg)||[]).forEach(function(F) { f = F.replace(/<.*?>/g,""); });
-
- return [col, nf, f];
- }
-
- /* 21.2 DrawingML - Charts */
- function parse_chart(data, name, opts, rels, wb, csheet) {
- var cs = ((csheet || {"!type":"chart"}));
- if(!data) return csheet;
- /* 21.2.2.27 chart CT_Chart */
-
- var C = 0, R = 0, col = "A";
- var refguess = {s: {r:2000000, c:2000000}, e: {r:0, c:0} };
-
- /* 21.2.2.120 numCache CT_NumData */
- (data.match(/<c:numCache>[\s\S]*?<\/c:numCache>/gm)||[]).forEach(function(nc) {
- var cache = parse_Cache(nc);
- refguess.s.r = refguess.s.c = 0;
- refguess.e.c = C;
- col = encode_col(C);
- cache[0].forEach(function(n,i) {
- cs[col + encode_row(i)] = {t:'n', v:n, z:cache[1] };
- R = i;
- });
- if(refguess.e.r < R) refguess.e.r = R;
- ++C;
- });
- if(C > 0) cs["!ref"] = encode_range(refguess);
- return cs;
- }
- RELS.CS = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet";
-
- var CS_XML_ROOT = writextag('chartsheet', null, {
- 'xmlns': XMLNS.main[0],
- 'xmlns:r': XMLNS.r
- });
-
- /* 18.3 Worksheets also covers Chartsheets */
- function parse_cs_xml(data, opts, idx, rels, wb) {
- if(!data) return data;
- /* 18.3.1.12 chartsheet CT_ChartSheet */
- if(!rels) rels = {'!id':{}};
- var s = ({'!type':"chart", '!drawel':null, '!rel':""});
- var m;
-
- /* 18.3.1.83 sheetPr CT_ChartsheetPr */
- var sheetPr = data.match(sheetprregex);
- if(sheetPr) parse_ws_xml_sheetpr(sheetPr[0], s, wb, idx);
-
- /* 18.3.1.36 drawing CT_Drawing */
- if((m = data.match(/drawing r:id="(.*?)"/))) s['!rel'] = m[1];
-
- if(rels['!id'][s['!rel']]) s['!drawel'] = rels['!id'][s['!rel']];
- return s;
- }
- function write_cs_xml(idx, opts, wb, rels) {
- var o = [XML_HEADER, CS_XML_ROOT];
- o[o.length] = writextag("drawing", null, {"r:id": "rId1"});
- add_rels(rels, -1, "../drawings/drawing" + (idx+1) + ".xml", RELS.DRAW);
- if(o.length>2) { o[o.length] = ('</chartsheet>'); o[1]=o[1].replace("/>",">"); }
- return o.join("");
- }
-
- /* [MS-XLSB] 2.4.331 BrtCsProp */
- function parse_BrtCsProp(data, length) {
- data.l += 10;
- var name = parse_XLWideString(data, length - 10);
- return { name: name };
- }
-
- /* [MS-XLSB] 2.1.7.7 Chart Sheet */
- function parse_cs_bin(data, opts, idx, rels, wb) {
- if(!data) return data;
- if(!rels) rels = {'!id':{}};
- var s = {'!type':"chart", '!drawel':null, '!rel':""};
- var state = [];
- var pass = false;
- recordhopper(data, function cs_parse(val, R_n, RT) {
- switch(RT) {
-
- case 0x0226: /* 'BrtDrawing' */
- s['!rel'] = val; break;
-
- case 0x028B: /* 'BrtCsProp' */
- if(!wb.Sheets[idx]) wb.Sheets[idx] = {};
- if(val.name) wb.Sheets[idx].CodeName = val.name;
- break;
-
- case 0x0232: /* 'BrtBkHim' */
- case 0x028C: /* 'BrtCsPageSetup' */
- case 0x029D: /* 'BrtCsProtection' */
- case 0x02A7: /* 'BrtCsProtectionIso' */
- case 0x0227: /* 'BrtLegacyDrawing' */
- case 0x0228: /* 'BrtLegacyDrawingHF' */
- case 0x01DC: /* 'BrtMargins' */
- case 0x0C00: /* 'BrtUid' */
- break;
-
- case 0x0023: /* 'BrtFRTBegin' */
- pass = true; break;
- case 0x0024: /* 'BrtFRTEnd' */
- pass = false; break;
- case 0x0025: /* 'BrtACBegin' */
- state.push(R_n); break;
- case 0x0026: /* 'BrtACEnd' */
- state.pop(); break;
-
- default:
- if((R_n||"").indexOf("Begin") > 0) state.push(R_n);
- else if((R_n||"").indexOf("End") > 0) state.pop();
- else if(!pass || opts.WTF) throw new Error("Unexpected record " + RT + " " + R_n);
- }
- }, opts);
-
- if(rels['!id'][s['!rel']]) s['!drawel'] = rels['!id'][s['!rel']];
- return s;
- }
- function write_cs_bin() {
- var ba = buf_array();
- write_record(ba, "BrtBeginSheet");
- /* [BrtCsProp] */
- /* CSVIEWS */
- /* [[BrtCsProtectionIso] BrtCsProtection] */
- /* [USERCSVIEWS] */
- /* [BrtMargins] */
- /* [BrtCsPageSetup] */
- /* [HEADERFOOTER] */
- /* BrtDrawing */
- /* [BrtLegacyDrawing] */
- /* [BrtLegacyDrawingHF] */
- /* [BrtBkHim] */
- /* [WEBPUBITEMS] */
- /* FRTCHARTSHEET */
- write_record(ba, "BrtEndSheet");
- return ba.end();
- }
- /* 18.2.28 (CT_WorkbookProtection) Defaults */
- var WBPropsDef = [
- ['allowRefreshQuery', false, "bool"],
- ['autoCompressPictures', true, "bool"],
- ['backupFile', false, "bool"],
- ['checkCompatibility', false, "bool"],
- ['CodeName', ''],
- ['date1904', false, "bool"],
- ['defaultThemeVersion', 0, "int"],
- ['filterPrivacy', false, "bool"],
- ['hidePivotFieldList', false, "bool"],
- ['promptedSolutions', false, "bool"],
- ['publishItems', false, "bool"],
- ['refreshAllConnections', false, "bool"],
- ['saveExternalLinkValues', true, "bool"],
- ['showBorderUnselectedTables', true, "bool"],
- ['showInkAnnotation', true, "bool"],
- ['showObjects', 'all'],
- ['showPivotChartFilter', false, "bool"],
- ['updateLinks', 'userSet']
- ];
-
- /* 18.2.30 (CT_BookView) Defaults */
- var WBViewDef = [
- ['activeTab', 0, "int"],
- ['autoFilterDateGrouping', true, "bool"],
- ['firstSheet', 0, "int"],
- ['minimized', false, "bool"],
- ['showHorizontalScroll', true, "bool"],
- ['showSheetTabs', true, "bool"],
- ['showVerticalScroll', true, "bool"],
- ['tabRatio', 600, "int"],
- ['visibility', 'visible']
- //window{Height,Width}, {x,y}Window
- ];
-
- /* 18.2.19 (CT_Sheet) Defaults */
- var SheetDef = [
- //['state', 'visible']
- ];
-
- /* 18.2.2 (CT_CalcPr) Defaults */
- var CalcPrDef = [
- ['calcCompleted', 'true'],
- ['calcMode', 'auto'],
- ['calcOnSave', 'true'],
- ['concurrentCalc', 'true'],
- ['fullCalcOnLoad', 'false'],
- ['fullPrecision', 'true'],
- ['iterate', 'false'],
- ['iterateCount', '100'],
- ['iterateDelta', '0.001'],
- ['refMode', 'A1']
- ];
-
- /* 18.2.3 (CT_CustomWorkbookView) Defaults */
- /*var CustomWBViewDef = [
- ['autoUpdate', 'false'],
- ['changesSavedWin', 'false'],
- ['includeHiddenRowCol', 'true'],
- ['includePrintSettings', 'true'],
- ['maximized', 'false'],
- ['minimized', 'false'],
- ['onlySync', 'false'],
- ['personalView', 'false'],
- ['showComments', 'commIndicator'],
- ['showFormulaBar', 'true'],
- ['showHorizontalScroll', 'true'],
- ['showObjects', 'all'],
- ['showSheetTabs', 'true'],
- ['showStatusbar', 'true'],
- ['showVerticalScroll', 'true'],
- ['tabRatio', '600'],
- ['xWindow', '0'],
- ['yWindow', '0']
- ];*/
-
- function push_defaults_array(target, defaults) {
- for(var j = 0; j != target.length; ++j) { var w = target[j];
- for(var i=0; i != defaults.length; ++i) { var z = defaults[i];
- if(w[z[0]] == null) w[z[0]] = z[1];
- else switch(z[2]) {
- case "bool": if(typeof w[z[0]] == "string") w[z[0]] = parsexmlbool(w[z[0]]); break;
- case "int": if(typeof w[z[0]] == "string") w[z[0]] = parseInt(w[z[0]], 10); break;
- }
- }
- }
- }
- function push_defaults(target, defaults) {
- for(var i = 0; i != defaults.length; ++i) { var z = defaults[i];
- if(target[z[0]] == null) target[z[0]] = z[1];
- else switch(z[2]) {
- case "bool": if(typeof target[z[0]] == "string") target[z[0]] = parsexmlbool(target[z[0]]); break;
- case "int": if(typeof target[z[0]] == "string") target[z[0]] = parseInt(target[z[0]], 10); break;
- }
- }
- }
-
- function parse_wb_defaults(wb) {
- push_defaults(wb.WBProps, WBPropsDef);
- push_defaults(wb.CalcPr, CalcPrDef);
-
- push_defaults_array(wb.WBView, WBViewDef);
- push_defaults_array(wb.Sheets, SheetDef);
-
- _ssfopts.date1904 = parsexmlbool(wb.WBProps.date1904);
- }
-
- function safe1904(wb) {
- /* TODO: store date1904 somewhere else */
- if(!wb.Workbook) return "false";
- if(!wb.Workbook.WBProps) return "false";
- return parsexmlbool(wb.Workbook.WBProps.date1904) ? "true" : "false";
- }
-
- var badchars = "][*?\/\\".split("");
- function check_ws_name(n, safe) {
- if(n.length > 31) { if(safe) return false; throw new Error("Sheet names cannot exceed 31 chars"); }
- var _good = true;
- badchars.forEach(function(c) {
- if(n.indexOf(c) == -1) return;
- if(!safe) throw new Error("Sheet name cannot contain : \\ / ? * [ ]");
- _good = false;
- });
- return _good;
- }
- function check_wb_names(N, S, codes) {
- N.forEach(function(n,i) {
- check_ws_name(n);
- for(var j = 0; j < i; ++j) if(n == N[j]) throw new Error("Duplicate Sheet Name: " + n);
- if(codes) {
- var cn = (S && S[i] && S[i].CodeName) || n;
- if(cn.charCodeAt(0) == 95 && cn.length > 22) throw new Error("Bad Code Name: Worksheet" + cn);
- }
- });
- }
- function check_wb(wb) {
- if(!wb || !wb.SheetNames || !wb.Sheets) throw new Error("Invalid Workbook");
- if(!wb.SheetNames.length) throw new Error("Workbook is empty");
- var Sheets = (wb.Workbook && wb.Workbook.Sheets) || [];
- check_wb_names(wb.SheetNames, Sheets, !!wb.vbaraw);
- for(var i = 0; i < wb.SheetNames.length; ++i) check_ws(wb.Sheets[wb.SheetNames[i]], wb.SheetNames[i], i);
- /* TODO: validate workbook */
- }
- /* 18.2 Workbook */
- var wbnsregex = /<\w+:workbook/;
- function parse_wb_xml(data, opts) {
- if(!data) throw new Error("Could not find file");
- var wb = { AppVersion:{}, WBProps:{}, WBView:[], Sheets:[], CalcPr:{}, Names:[], xmlns: "" };
- var pass = false, xmlns = "xmlns";
- var dname = {}, dnstart = 0;
- data.replace(tagregex, function xml_wb(x, idx) {
- var y = parsexmltag(x);
- switch(strip_ns(y[0])) {
- case '<?xml': break;
-
- /* 18.2.27 workbook CT_Workbook 1 */
- case '<workbook':
- if(x.match(wbnsregex)) xmlns = "xmlns" + x.match(/<(\w+):/)[1];
- wb.xmlns = y[xmlns];
- break;
- case '</workbook>': break;
-
- /* 18.2.13 fileVersion CT_FileVersion ? */
- case '<fileVersion': delete y[0]; wb.AppVersion = y; break;
- case '<fileVersion/>': case '</fileVersion>': break;
-
- /* 18.2.12 fileSharing CT_FileSharing ? */
- case '<fileSharing':
- break;
- case '<fileSharing/>': break;
-
- /* 18.2.28 workbookPr CT_WorkbookPr ? */
- case '<workbookPr':
- case '<workbookPr/>':
- WBPropsDef.forEach(function(w) {
- if(y[w[0]] == null) return;
- switch(w[2]) {
- case "bool": wb.WBProps[w[0]] = parsexmlbool(y[w[0]]); break;
- case "int": wb.WBProps[w[0]] = parseInt(y[w[0]], 10); break;
- default: wb.WBProps[w[0]] = y[w[0]];
- }
- });
- if(y.codeName) wb.WBProps.CodeName = y.codeName;
- break;
- case '</workbookPr>': break;
-
- /* 18.2.29 workbookProtection CT_WorkbookProtection ? */
- case '<workbookProtection':
- break;
- case '<workbookProtection/>': break;
-
- /* 18.2.1 bookViews CT_BookViews ? */
- case '<bookViews': case '<bookViews>': case '</bookViews>': break;
- /* 18.2.30 workbookView CT_BookView + */
- case '<workbookView': case '<workbookView/>': delete y[0]; wb.WBView.push(y); break;
- case '</workbookView>': break;
-
- /* 18.2.20 sheets CT_Sheets 1 */
- case '<sheets': case '<sheets>': case '</sheets>': break; // aggregate sheet
- /* 18.2.19 sheet CT_Sheet + */
- case '<sheet':
- switch(y.state) {
- case "hidden": y.Hidden = 1; break;
- case "veryHidden": y.Hidden = 2; break;
- default: y.Hidden = 0;
- }
- delete y.state;
- y.name = unescapexml(utf8read(y.name));
- delete y[0]; wb.Sheets.push(y); break;
- case '</sheet>': break;
-
- /* 18.2.15 functionGroups CT_FunctionGroups ? */
- case '<functionGroups': case '<functionGroups/>': break;
- /* 18.2.14 functionGroup CT_FunctionGroup + */
- case '<functionGroup': break;
-
- /* 18.2.9 externalReferences CT_ExternalReferences ? */
- case '<externalReferences': case '</externalReferences>': case '<externalReferences>': break;
- /* 18.2.8 externalReference CT_ExternalReference + */
- case '<externalReference': break;
-
- /* 18.2.6 definedNames CT_DefinedNames ? */
- case '<definedNames/>': break;
- case '<definedNames>': case '<definedNames': pass=true; break;
- case '</definedNames>': pass=false; break;
- /* 18.2.5 definedName CT_DefinedName + */
- case '<definedName': {
- dname = {};
- dname.Name = utf8read(y.name);
- if(y.comment) dname.Comment = y.comment;
- if(y.localSheetId) dname.Sheet = +y.localSheetId;
- if(parsexmlbool(y.hidden||"0")) dname.Hidden = true;
- dnstart = idx + x.length;
- } break;
- case '</definedName>': {
- dname.Ref = unescapexml(utf8read(data.slice(dnstart, idx)));
- wb.Names.push(dname);
- } break;
- case '<definedName/>': break;
-
- /* 18.2.2 calcPr CT_CalcPr ? */
- case '<calcPr': delete y[0]; wb.CalcPr = y; break;
- case '<calcPr/>': delete y[0]; wb.CalcPr = y; break;
- case '</calcPr>': break;
-
- /* 18.2.16 oleSize CT_OleSize ? (ref required) */
- case '<oleSize': break;
-
- /* 18.2.4 customWorkbookViews CT_CustomWorkbookViews ? */
- case '<customWorkbookViews>': case '</customWorkbookViews>': case '<customWorkbookViews': break;
- /* 18.2.3 customWorkbookView CT_CustomWorkbookView + */
- case '<customWorkbookView': case '</customWorkbookView>': break;
-
- /* 18.2.18 pivotCaches CT_PivotCaches ? */
- case '<pivotCaches>': case '</pivotCaches>': case '<pivotCaches': break;
- /* 18.2.17 pivotCache CT_PivotCache ? */
- case '<pivotCache': break;
-
- /* 18.2.21 smartTagPr CT_SmartTagPr ? */
- case '<smartTagPr': case '<smartTagPr/>': break;
-
- /* 18.2.23 smartTagTypes CT_SmartTagTypes ? */
- case '<smartTagTypes': case '<smartTagTypes>': case '</smartTagTypes>': break;
- /* 18.2.22 smartTagType CT_SmartTagType ? */
- case '<smartTagType': break;
-
- /* 18.2.24 webPublishing CT_WebPublishing ? */
- case '<webPublishing': case '<webPublishing/>': break;
-
- /* 18.2.11 fileRecoveryPr CT_FileRecoveryPr ? */
- case '<fileRecoveryPr': case '<fileRecoveryPr/>': break;
-
- /* 18.2.26 webPublishObjects CT_WebPublishObjects ? */
- case '<webPublishObjects>': case '<webPublishObjects': case '</webPublishObjects>': break;
- /* 18.2.25 webPublishObject CT_WebPublishObject ? */
- case '<webPublishObject': break;
-
- /* 18.2.10 extLst CT_ExtensionList ? */
- case '<extLst': case '<extLst>': case '</extLst>': case '<extLst/>': break;
- /* 18.2.7 ext CT_Extension + */
- case '<ext': pass=true; break; //TODO: check with versions of excel
- case '</ext>': pass=false; break;
-
- /* Others */
- case '<ArchID': break;
- case '<AlternateContent':
- case '<AlternateContent>': pass=true; break;
- case '</AlternateContent>': pass=false; break;
-
- /* TODO */
- case '<revisionPtr': break;
-
- default: if(!pass && opts.WTF) throw new Error('unrecognized ' + y[0] + ' in workbook');
- }
- return x;
- });
- if(XMLNS.main.indexOf(wb.xmlns) === -1) throw new Error("Unknown Namespace: " + wb.xmlns);
-
- parse_wb_defaults(wb);
-
- return wb;
- }
-
- var WB_XML_ROOT = writextag('workbook', null, {
- 'xmlns': XMLNS.main[0],
- //'xmlns:mx': XMLNS.mx,
- //'xmlns:s': XMLNS.main[0],
- 'xmlns:r': XMLNS.r
- });
-
- function write_wb_xml(wb) {
- var o = [XML_HEADER];
- o[o.length] = WB_XML_ROOT;
-
- var write_names = (wb.Workbook && (wb.Workbook.Names||[]).length > 0);
-
- /* fileVersion */
- /* fileSharing */
-
- var workbookPr = ({codeName:"ThisWorkbook"});
- if(wb.Workbook && wb.Workbook.WBProps) {
- WBPropsDef.forEach(function(x) {
- if((wb.Workbook.WBProps[x[0]]) == null) return;
- if((wb.Workbook.WBProps[x[0]]) == x[1]) return;
- workbookPr[x[0]] = (wb.Workbook.WBProps[x[0]]);
- });
- if(wb.Workbook.WBProps.CodeName) { workbookPr.codeName = wb.Workbook.WBProps.CodeName; delete workbookPr.CodeName; }
- }
- o[o.length] = (writextag('workbookPr', null, workbookPr));
-
- /* workbookProtection */
-
- var sheets = wb.Workbook && wb.Workbook.Sheets || [];
- var i = 0;
-
- /* bookViews */
-
- o[o.length] = "<sheets>";
- for(i = 0; i != wb.SheetNames.length; ++i) {
- var sht = ({name:escapexml(wb.SheetNames[i].slice(0,31))});
- sht.sheetId = ""+(i+1);
- sht["r:id"] = "rId"+(i+1);
- if(sheets[i]) switch(sheets[i].Hidden) {
- case 1: sht.state = "hidden"; break;
- case 2: sht.state = "veryHidden"; break;
- }
- o[o.length] = (writextag('sheet',null,sht));
- }
- o[o.length] = "</sheets>";
-
- /* functionGroups */
- /* externalReferences */
-
- if(write_names) {
- o[o.length] = "<definedNames>";
- if(wb.Workbook && wb.Workbook.Names) wb.Workbook.Names.forEach(function(n) {
- var d = {name:n.Name};
- if(n.Comment) d.comment = n.Comment;
- if(n.Sheet != null) d.localSheetId = ""+n.Sheet;
- if(n.Hidden) d.hidden = "1";
- if(!n.Ref) return;
- o[o.length] = writextag('definedName', String(n.Ref).replace(/</g, "<").replace(/>/g, ">"), d);
- });
- o[o.length] = "</definedNames>";
- }
-
- /* calcPr */
- /* oleSize */
- /* customWorkbookViews */
- /* pivotCaches */
- /* smartTagPr */
- /* smartTagTypes */
- /* webPublishing */
- /* fileRecoveryPr */
- /* webPublishObjects */
- /* extLst */
-
- if(o.length>2){ o[o.length] = '</workbook>'; o[1]=o[1].replace("/>",">"); }
- return o.join("");
- }
- /* [MS-XLSB] 2.4.304 BrtBundleSh */
- function parse_BrtBundleSh(data, length) {
- var z = {};
- z.Hidden = data.read_shift(4); //hsState ST_SheetState
- z.iTabID = data.read_shift(4);
- z.strRelID = parse_RelID(data,length-8);
- z.name = parse_XLWideString(data);
- return z;
- }
- function write_BrtBundleSh(data, o) {
- if(!o) o = new_buf(127);
- o.write_shift(4, data.Hidden);
- o.write_shift(4, data.iTabID);
- write_RelID(data.strRelID, o);
- write_XLWideString(data.name.slice(0,31), o);
- return o.length > o.l ? o.slice(0, o.l) : o;
- }
-
- /* [MS-XLSB] 2.4.815 BrtWbProp */
- function parse_BrtWbProp(data, length) {
- var o = ({});
- var flags = data.read_shift(4);
- o.defaultThemeVersion = data.read_shift(4);
- var strName = (length > 8) ? parse_XLWideString(data) : "";
- if(strName.length > 0) o.CodeName = strName;
- o.autoCompressPictures = !!(flags & 0x10000);
- o.backupFile = !!(flags & 0x40);
- o.checkCompatibility = !!(flags & 0x1000);
- o.date1904 = !!(flags & 0x01);
- o.filterPrivacy = !!(flags & 0x08);
- o.hidePivotFieldList = !!(flags & 0x400);
- o.promptedSolutions = !!(flags & 0x10);
- o.publishItems = !!(flags & 0x800);
- o.refreshAllConnections = !!(flags & 0x40000);
- o.saveExternalLinkValues = !!(flags & 0x80);
- o.showBorderUnselectedTables = !!(flags & 0x04);
- o.showInkAnnotation = !!(flags & 0x20);
- o.showObjects = ["all", "placeholders", "none"][(flags >> 13) & 0x03];
- o.showPivotChartFilter = !!(flags & 0x8000);
- o.updateLinks = ["userSet", "never", "always"][(flags >> 8) & 0x03];
- return o;
- }
- function write_BrtWbProp(data, o) {
- if(!o) o = new_buf(72);
- var flags = 0;
- if(data) {
- /* TODO: mirror parse_BrtWbProp fields */
- if(data.filterPrivacy) flags |= 0x08;
- }
- o.write_shift(4, flags);
- o.write_shift(4, 0);
- write_XLSBCodeName(data && data.CodeName || "ThisWorkbook", o);
- return o.slice(0, o.l);
- }
-
- function parse_BrtFRTArchID$(data, length) {
- var o = {};
- data.read_shift(4);
- o.ArchID = data.read_shift(4);
- data.l += length - 8;
- return o;
- }
-
- /* [MS-XLSB] 2.4.687 BrtName */
- function parse_BrtName(data, length, opts) {
- var end = data.l + length;
- data.l += 4; //var flags = data.read_shift(4);
- data.l += 1; //var chKey = data.read_shift(1);
- var itab = data.read_shift(4);
- var name = parse_XLNameWideString(data);
- var formula = parse_XLSBNameParsedFormula(data, 0, opts);
- var comment = parse_XLNullableWideString(data);
- //if(0 /* fProc */) {
- // unusedstring1: XLNullableWideString
- // description: XLNullableWideString
- // helpTopic: XLNullableWideString
- // unusedstring2: XLNullableWideString
- //}
- data.l = end;
- var out = ({Name:name, Ptg:formula});
- if(itab < 0xFFFFFFF) out.Sheet = itab;
- if(comment) out.Comment = comment;
- return out;
- }
-
- /* [MS-XLSB] 2.1.7.61 Workbook */
- function parse_wb_bin(data, opts) {
- var wb = { AppVersion:{}, WBProps:{}, WBView:[], Sheets:[], CalcPr:{}, xmlns: "" };
- var state = [];
- var pass = false;
-
- if(!opts) opts = {};
- opts.biff = 12;
-
- var Names = [];
- var supbooks = ([[]]);
- supbooks.SheetNames = [];
- supbooks.XTI = [];
-
- recordhopper(data, function hopper_wb(val, R_n, RT) {
- switch(RT) {
- case 0x009C: /* 'BrtBundleSh' */
- supbooks.SheetNames.push(val.name);
- wb.Sheets.push(val); break;
-
- case 0x0099: /* 'BrtWbProp' */
- wb.WBProps = val; break;
-
- case 0x0027: /* 'BrtName' */
- if(val.Sheet != null) opts.SID = val.Sheet;
- val.Ref = stringify_formula(val.Ptg, null, null, supbooks, opts);
- delete opts.SID;
- delete val.Ptg;
- Names.push(val);
- break;
- case 0x040C: /* 'BrtNameExt' */ break;
-
- case 0x0165: /* 'BrtSupSelf' */
- case 0x0166: /* 'BrtSupSame' */
- case 0x0163: /* 'BrtSupBookSrc' */
- case 0x029B: /* 'BrtSupAddin' */
- if(!supbooks[0].length) supbooks[0] = [RT, val];
- else supbooks.push([RT, val]);
- supbooks[supbooks.length - 1].XTI = [];
- break;
- case 0x016A: /* 'BrtExternSheet' */
- if(supbooks.length === 0) { supbooks[0] = []; supbooks[0].XTI = []; }
- supbooks[supbooks.length - 1].XTI = supbooks[supbooks.length - 1].XTI.concat(val);
- supbooks.XTI = supbooks.XTI.concat(val);
- break;
- case 0x0169: /* 'BrtPlaceholderName' */
- break;
-
- /* case 'BrtModelTimeGroupingCalcCol' */
- case 0x0C00: /* 'BrtUid' */
- case 0x0C01: /* 'BrtRevisionPtr' */
- case 0x0817: /* 'BrtAbsPath15' */
- case 0x0216: /* 'BrtBookProtection' */
- case 0x02A5: /* 'BrtBookProtectionIso' */
- case 0x009E: /* 'BrtBookView' */
- case 0x009D: /* 'BrtCalcProp' */
- case 0x0262: /* 'BrtCrashRecErr' */
- case 0x0802: /* 'BrtDecoupledPivotCacheID' */
- case 0x009B: /* 'BrtFileRecover' */
- case 0x0224: /* 'BrtFileSharing' */
- case 0x02A4: /* 'BrtFileSharingIso' */
- case 0x0080: /* 'BrtFileVersion' */
- case 0x0299: /* 'BrtFnGroup' */
- case 0x0850: /* 'BrtModelRelationship' */
- case 0x084D: /* 'BrtModelTable' */
- case 0x0225: /* 'BrtOleSize' */
- case 0x0805: /* 'BrtPivotTableRef' */
- case 0x0254: /* 'BrtSmartTagType' */
- case 0x081C: /* 'BrtTableSlicerCacheID' */
- case 0x081B: /* 'BrtTableSlicerCacheIDs' */
- case 0x0822: /* 'BrtTimelineCachePivotCacheID' */
- case 0x018D: /* 'BrtUserBookView' */
- case 0x009A: /* 'BrtWbFactoid' */
- case 0x045D: /* 'BrtWbProp14' */
- case 0x0229: /* 'BrtWebOpt' */
- case 0x082B: /* 'BrtWorkBookPr15' */
- break;
-
- case 0x0023: /* 'BrtFRTBegin' */
- state.push(R_n); pass = true; break;
- case 0x0024: /* 'BrtFRTEnd' */
- state.pop(); pass = false; break;
- case 0x0025: /* 'BrtACBegin' */
- state.push(R_n); pass = true; break;
- case 0x0026: /* 'BrtACEnd' */
- state.pop(); pass = false; break;
-
- case 0x0010: /* 'BrtFRTArchID$' */ break;
-
- default:
- if((R_n||"").indexOf("Begin") > 0){/* empty */}
- else if((R_n||"").indexOf("End") > 0){/* empty */}
- else if(!pass || (opts.WTF && state[state.length-1] != "BrtACBegin" && state[state.length-1] != "BrtFRTBegin")) throw new Error("Unexpected record " + RT + " " + R_n);
- }
- }, opts);
-
- parse_wb_defaults(wb);
-
- // $FlowIgnore
- wb.Names = Names;
-
- (wb).supbooks = supbooks;
- return wb;
- }
-
- function write_BUNDLESHS(ba, wb) {
- write_record(ba, "BrtBeginBundleShs");
- for(var idx = 0; idx != wb.SheetNames.length; ++idx) {
- var viz = wb.Workbook && wb.Workbook.Sheets && wb.Workbook.Sheets[idx] && wb.Workbook.Sheets[idx].Hidden || 0;
- var d = { Hidden: viz, iTabID: idx+1, strRelID: 'rId' + (idx+1), name: wb.SheetNames[idx] };
- write_record(ba, "BrtBundleSh", write_BrtBundleSh(d));
- }
- write_record(ba, "BrtEndBundleShs");
- }
-
- /* [MS-XLSB] 2.4.649 BrtFileVersion */
- function write_BrtFileVersion(data, o) {
- if(!o) o = new_buf(127);
- for(var i = 0; i != 4; ++i) o.write_shift(4, 0);
- write_XLWideString("SheetJS", o);
- write_XLWideString(XLSX.version, o);
- write_XLWideString(XLSX.version, o);
- write_XLWideString("7262", o);
- o.length = o.l;
- return o.length > o.l ? o.slice(0, o.l) : o;
- }
-
- /* [MS-XLSB] 2.4.301 BrtBookView */
- function write_BrtBookView(idx, o) {
- if(!o) o = new_buf(29);
- o.write_shift(-4, 0);
- o.write_shift(-4, 460);
- o.write_shift(4, 28800);
- o.write_shift(4, 17600);
- o.write_shift(4, 500);
- o.write_shift(4, idx);
- o.write_shift(4, idx);
- var flags = 0x78;
- o.write_shift(1, flags);
- return o.length > o.l ? o.slice(0, o.l) : o;
- }
-
- function write_BOOKVIEWS(ba, wb) {
- /* required if hidden tab appears before visible tab */
- if(!wb.Workbook || !wb.Workbook.Sheets) return;
- var sheets = wb.Workbook.Sheets;
- var i = 0, vistab = -1, hidden = -1;
- for(; i < sheets.length; ++i) {
- if(!sheets[i] || !sheets[i].Hidden && vistab == -1) vistab = i;
- else if(sheets[i].Hidden == 1 && hidden == -1) hidden = i;
- }
- if(hidden > vistab) return;
- write_record(ba, "BrtBeginBookViews");
- write_record(ba, "BrtBookView", write_BrtBookView(vistab));
- /* 1*(BrtBookView *FRT) */
- write_record(ba, "BrtEndBookViews");
- }
-
- /* [MS-XLSB] 2.4.305 BrtCalcProp */
- /*function write_BrtCalcProp(data, o) {
- if(!o) o = new_buf(26);
- o.write_shift(4,0); // force recalc
- o.write_shift(4,1);
- o.write_shift(4,0);
- write_Xnum(0, o);
- o.write_shift(-4, 1023);
- o.write_shift(1, 0x33);
- o.write_shift(1, 0x00);
- return o;
- }*/
-
- /* [MS-XLSB] 2.4.646 BrtFileRecover */
- /*function write_BrtFileRecover(data, o) {
- if(!o) o = new_buf(1);
- o.write_shift(1,0);
- return o;
- }*/
-
- /* [MS-XLSB] 2.1.7.61 Workbook */
- function write_wb_bin(wb, opts) {
- var ba = buf_array();
- write_record(ba, "BrtBeginBook");
- write_record(ba, "BrtFileVersion", write_BrtFileVersion());
- /* [[BrtFileSharingIso] BrtFileSharing] */
- write_record(ba, "BrtWbProp", write_BrtWbProp(wb.Workbook && wb.Workbook.WBProps || null));
- /* [ACABSPATH] */
- /* [[BrtBookProtectionIso] BrtBookProtection] */
- write_BOOKVIEWS(ba, wb, opts);
- write_BUNDLESHS(ba, wb, opts);
- /* [FNGROUP] */
- /* [EXTERNALS] */
- /* *BrtName */
- /* write_record(ba, "BrtCalcProp", write_BrtCalcProp()); */
- /* [BrtOleSize] */
- /* *(BrtUserBookView *FRT) */
- /* [PIVOTCACHEIDS] */
- /* [BrtWbFactoid] */
- /* [SMARTTAGTYPES] */
- /* [BrtWebOpt] */
- /* write_record(ba, "BrtFileRecover", write_BrtFileRecover()); */
- /* [WEBPUBITEMS] */
- /* [CRERRS] */
- /* FRTWORKBOOK */
- write_record(ba, "BrtEndBook");
-
- return ba.end();
- }
- function parse_wb(data, name, opts) {
- if(name.slice(-4)===".bin") return parse_wb_bin((data), opts);
- return parse_wb_xml((data), opts);
- }
-
- function parse_ws(data, name, idx, opts, rels, wb, themes, styles) {
- if(name.slice(-4)===".bin") return parse_ws_bin((data), opts, idx, rels, wb, themes, styles);
- return parse_ws_xml((data), opts, idx, rels, wb, themes, styles);
- }
-
- function parse_cs(data, name, idx, opts, rels, wb, themes, styles) {
- if(name.slice(-4)===".bin") return parse_cs_bin((data), opts, idx, rels, wb, themes, styles);
- return parse_cs_xml((data), opts, idx, rels, wb, themes, styles);
- }
-
- function parse_ms(data, name, idx, opts, rels, wb, themes, styles) {
- if(name.slice(-4)===".bin") return parse_ms_bin((data), opts, idx, rels, wb, themes, styles);
- return parse_ms_xml((data), opts, idx, rels, wb, themes, styles);
- }
-
- function parse_ds(data, name, idx, opts, rels, wb, themes, styles) {
- if(name.slice(-4)===".bin") return parse_ds_bin((data), opts, idx, rels, wb, themes, styles);
- return parse_ds_xml((data), opts, idx, rels, wb, themes, styles);
- }
-
- function parse_sty(data, name, themes, opts) {
- if(name.slice(-4)===".bin") return parse_sty_bin((data), themes, opts);
- return parse_sty_xml((data), themes, opts);
- }
-
- function parse_theme(data, name, opts) {
- return parse_theme_xml(data, opts);
- }
-
- function parse_sst(data, name, opts) {
- if(name.slice(-4)===".bin") return parse_sst_bin((data), opts);
- return parse_sst_xml((data), opts);
- }
-
- function parse_cmnt(data, name, opts) {
- if(name.slice(-4)===".bin") return parse_comments_bin((data), opts);
- return parse_comments_xml((data), opts);
- }
-
- function parse_cc(data, name, opts) {
- if(name.slice(-4)===".bin") return parse_cc_bin((data), name, opts);
- return parse_cc_xml((data), name, opts);
- }
-
- function parse_xlink(data, rel, name, opts) {
- if(name.slice(-4)===".bin") return parse_xlink_bin((data), rel, name, opts);
- return parse_xlink_xml((data), rel, name, opts);
- }
-
- function write_wb(wb, name, opts) {
- return (name.slice(-4)===".bin" ? write_wb_bin : write_wb_xml)(wb, opts);
- }
-
- function write_ws(data, name, opts, wb, rels) {
- return (name.slice(-4)===".bin" ? write_ws_bin : write_ws_xml)(data, opts, wb, rels);
- }
-
- // eslint-disable-next-line no-unused-vars
- function write_cs(data, name, opts, wb, rels) {
- return (name.slice(-4)===".bin" ? write_cs_bin : write_cs_xml)(data, opts, wb, rels);
- }
-
- function write_sty(data, name, opts) {
- return (name.slice(-4)===".bin" ? write_sty_bin : write_sty_xml)(data, opts);
- }
-
- function write_sst(data, name, opts) {
- return (name.slice(-4)===".bin" ? write_sst_bin : write_sst_xml)(data, opts);
- }
-
- function write_cmnt(data, name, opts) {
- return (name.slice(-4)===".bin" ? write_comments_bin : write_comments_xml)(data, opts);
- }
- /*
- function write_cc(data, name:string, opts) {
- return (name.slice(-4)===".bin" ? write_cc_bin : write_cc_xml)(data, opts);
- }
- */
- var attregexg2=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g;
- var attregex2=/([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/;
- function xlml_parsexmltag(tag, skip_root) {
- var words = tag.split(/\s+/);
- var z = ([]); if(!skip_root) z[0] = words[0];
- if(words.length === 1) return z;
- var m = tag.match(attregexg2), y, j, w, i;
- if(m) for(i = 0; i != m.length; ++i) {
- y = m[i].match(attregex2);
- if((j=y[1].indexOf(":")) === -1) z[y[1]] = y[2].slice(1,y[2].length-1);
- else {
- if(y[1].slice(0,6) === "xmlns:") w = "xmlns"+y[1].slice(6);
- else w = y[1].slice(j+1);
- z[w] = y[2].slice(1,y[2].length-1);
- }
- }
- return z;
- }
- function xlml_parsexmltagobj(tag) {
- var words = tag.split(/\s+/);
- var z = {};
- if(words.length === 1) return z;
- var m = tag.match(attregexg2), y, j, w, i;
- if(m) for(i = 0; i != m.length; ++i) {
- y = m[i].match(attregex2);
- if((j=y[1].indexOf(":")) === -1) z[y[1]] = y[2].slice(1,y[2].length-1);
- else {
- if(y[1].slice(0,6) === "xmlns:") w = "xmlns"+y[1].slice(6);
- else w = y[1].slice(j+1);
- z[w] = y[2].slice(1,y[2].length-1);
- }
- }
- return z;
- }
-
- // ----
-
- function xlml_format(format, value) {
- var fmt = XLMLFormatMap[format] || unescapexml(format);
- if(fmt === "General") return SSF._general(value);
- return SSF.format(fmt, value);
- }
-
- function xlml_set_custprop(Custprops, key, cp, val) {
- var oval = val;
- switch((cp[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]) {
- case "boolean": oval = parsexmlbool(val); break;
- case "i2": case "int": oval = parseInt(val, 10); break;
- case "r4": case "float": oval = parseFloat(val); break;
- case "date": case "dateTime.tz": oval = parseDate(val); break;
- case "i8": case "string": case "fixed": case "uuid": case "bin.base64": break;
- default: throw new Error("bad custprop:" + cp[0]);
- }
- Custprops[unescapexml(key)] = oval;
- }
-
- function safe_format_xlml(cell, nf, o) {
- if(cell.t === 'z') return;
- if(!o || o.cellText !== false) try {
- if(cell.t === 'e') { cell.w = cell.w || BErr[cell.v]; }
- else if(nf === "General") {
- if(cell.t === 'n') {
- if((cell.v|0) === cell.v) cell.w = SSF._general_int(cell.v);
- else cell.w = SSF._general_num(cell.v);
- }
- else cell.w = SSF._general(cell.v);
- }
- else cell.w = xlml_format(nf||"General", cell.v);
- } catch(e) { if(o.WTF) throw e; }
- try {
- var z = XLMLFormatMap[nf]||nf||"General";
- if(o.cellNF) cell.z = z;
- if(o.cellDates && cell.t == 'n' && SSF.is_date(z)) {
- var _d = SSF.parse_date_code(cell.v); if(_d) { cell.t = 'd'; cell.v = new Date(_d.y, _d.m-1,_d.d,_d.H,_d.M,_d.S,_d.u); }
- }
- } catch(e) { if(o.WTF) throw e; }
- }
-
- function process_style_xlml(styles, stag, opts) {
- if(opts.cellStyles) {
- if(stag.Interior) {
- var I = stag.Interior;
- if(I.Pattern) I.patternType = XLMLPatternTypeMap[I.Pattern] || I.Pattern;
- }
- }
- styles[stag.ID] = stag;
- }
-
- /* TODO: there must exist some form of OSP-blessed spec */
- function parse_xlml_data(xml, ss, data, cell, base, styles, csty, row, arrayf, o) {
- var nf = "General", sid = cell.StyleID, S = {}; o = o || {};
- var interiors = [];
- var i = 0;
- if(sid === undefined && row) sid = row.StyleID;
- if(sid === undefined && csty) sid = csty.StyleID;
- while(styles[sid] !== undefined) {
- if(styles[sid].nf) nf = styles[sid].nf;
- if(styles[sid].Interior) interiors.push(styles[sid].Interior);
- if(!styles[sid].Parent) break;
- sid = styles[sid].Parent;
- }
- switch(data.Type) {
- case 'Boolean':
- cell.t = 'b';
- cell.v = parsexmlbool(xml);
- break;
- case 'String':
- cell.t = 's'; cell.r = xlml_fixstr(unescapexml(xml));
- cell.v = xml.indexOf("<") > -1 ? unescapexml(ss||xml) : cell.r;
- break;
- case 'DateTime':
- if(xml.slice(-1) != "Z") xml += "Z";
- cell.v = (parseDate(xml) - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
- if(cell.v !== cell.v) cell.v = unescapexml(xml);
- else if(cell.v<60) cell.v = cell.v -1;
- if(!nf || nf == "General") nf = "yyyy-mm-dd";
- /* falls through */
- case 'Number':
- if(cell.v === undefined) cell.v=+xml;
- if(!cell.t) cell.t = 'n';
- break;
- case 'Error': cell.t = 'e'; cell.v = RBErr[xml]; if(o.cellText !== false) cell.w = xml; break;
- default: cell.t = 's'; cell.v = xlml_fixstr(ss||xml); break;
- }
- safe_format_xlml(cell, nf, o);
- if(o.cellFormula !== false) {
- if(cell.Formula) {
- var fstr = unescapexml(cell.Formula);
- /* strictly speaking, the leading = is required but some writers omit */
- if(fstr.charCodeAt(0) == 61 /* = */) fstr = fstr.slice(1);
- cell.f = rc_to_a1(fstr, base);
- delete cell.Formula;
- if(cell.ArrayRange == "RC") cell.F = rc_to_a1("RC:RC", base);
- else if(cell.ArrayRange) {
- cell.F = rc_to_a1(cell.ArrayRange, base);
- arrayf.push([safe_decode_range(cell.F), cell.F]);
- }
- } else {
- for(i = 0; i < arrayf.length; ++i)
- if(base.r >= arrayf[i][0].s.r && base.r <= arrayf[i][0].e.r)
- if(base.c >= arrayf[i][0].s.c && base.c <= arrayf[i][0].e.c)
- cell.F = arrayf[i][1];
- }
- }
- if(o.cellStyles) {
- interiors.forEach(function(x) {
- if(!S.patternType && x.patternType) S.patternType = x.patternType;
- });
- cell.s = S;
- }
- if(cell.StyleID !== undefined) cell.ixfe = cell.StyleID;
- }
-
- function xlml_clean_comment(comment) {
- comment.t = comment.v || "";
- comment.t = comment.t.replace(/\r\n/g,"\n").replace(/\r/g,"\n");
- comment.v = comment.w = comment.ixfe = undefined;
- }
-
- function xlml_normalize(d) {
- if(has_buf && Buffer.isBuffer(d)) return d.toString('utf8');
- if(typeof d === 'string') return d;
- /* duktape */
- if(typeof Uint8Array !== 'undefined' && d instanceof Uint8Array) return utf8read(a2s(ab2a(d)));
- throw new Error("Bad input format: expected Buffer or string");
- }
-
- /* TODO: Everything */
- /* UOS uses CJK in tags */
- var xlmlregex = /<(\/?)([^\s?>!\/:]*:|)([^\s?>:\/]+)[^>]*>/mg;
- //var xlmlregex = /<(\/?)([a-z0-9]*:|)(\w+)[^>]*>/mg;
- function parse_xlml_xml(d, _opts) {
- var opts = _opts || {};
- make_ssf(SSF);
- var str = debom(xlml_normalize(d));
- if(opts.type == 'binary' || opts.type == 'array' || opts.type == 'base64') {
- if(typeof cptable !== 'undefined') str = cptable.utils.decode(65001, char_codes(str));
- else str = utf8read(str);
- }
- var opening = str.slice(0, 1024).toLowerCase(), ishtml = false;
- if(opening.indexOf("<?xml") == -1) ["html", "table", "head", "meta", "script", "style", "div"].forEach(function(tag) { if(opening.indexOf("<" + tag) >= 0) ishtml = true; });
- if(ishtml) return HTML_.to_workbook(str, opts);
- var Rn;
- var state = [], tmp;
- if(DENSE != null && opts.dense == null) opts.dense = DENSE;
- var sheets = {}, sheetnames = [], cursheet = (opts.dense ? [] : {}), sheetname = "";
- var table = {}, cell = ({}), row = {};// eslint-disable-line no-unused-vars
- var dtag = xlml_parsexmltag('<Data ss:Type="String">'), didx = 0;
- var c = 0, r = 0;
- var refguess = {s: {r:2000000, c:2000000}, e: {r:0, c:0} };
- var styles = {}, stag = {};
- var ss = "", fidx = 0;
- var merges = [];
- var Props = {}, Custprops = {}, pidx = 0, cp = [];
- var comments = [], comment = ({});
- var cstys = [], csty, seencol = false;
- var arrayf = [];
- var rowinfo = [], rowobj = {}, cc = 0, rr = 0;
- var Workbook = ({ Sheets:[], WBProps:{date1904:false} }), wsprops = {};
- xlmlregex.lastIndex = 0;
- str = str.replace(/<!--([\s\S]*?)-->/mg,"");
- while((Rn = xlmlregex.exec(str))) switch(Rn[3]) {
- case 'Data':
- if(state[state.length-1][1]) break;
- if(Rn[1]==='/') parse_xlml_data(str.slice(didx, Rn.index), ss, dtag, state[state.length-1][0]=="Comment"?comment:cell, {c:c,r:r}, styles, cstys[c], row, arrayf, opts);
- else { ss = ""; dtag = xlml_parsexmltag(Rn[0]); didx = Rn.index + Rn[0].length; }
- break;
- case 'Cell':
- if(Rn[1]==='/'){
- if(comments.length > 0) cell.c = comments;
- if((!opts.sheetRows || opts.sheetRows > r) && cell.v !== undefined) {
- if(opts.dense) {
- if(!cursheet[r]) cursheet[r] = [];
- cursheet[r][c] = cell;
- } else cursheet[encode_col(c) + encode_row(r)] = cell;
- }
- if(cell.HRef) {
- cell.l = ({Target:cell.HRef});
- if(cell.HRefScreenTip) cell.l.Tooltip = cell.HRefScreenTip;
- delete cell.HRef; delete cell.HRefScreenTip;
- }
- if(cell.MergeAcross || cell.MergeDown) {
- cc = c + (parseInt(cell.MergeAcross,10)|0);
- rr = r + (parseInt(cell.MergeDown,10)|0);
- merges.push({s:{c:c,r:r},e:{c:cc,r:rr}});
- }
- if(!opts.sheetStubs) { if(cell.MergeAcross) c = cc + 1; else ++c; }
- else if(cell.MergeAcross || cell.MergeDown) {
- for(var cma = c; cma <= cc; ++cma) {
- for(var cmd = r; cmd <= rr; ++cmd) {
- if(cma > c || cmd > r) {
- if(opts.dense) {
- if(!cursheet[cmd]) cursheet[cmd] = [];
- cursheet[cmd][cma] = {t:'z'};
- } else cursheet[encode_col(cma) + encode_row(cmd)] = {t:'z'};
- }
- }
- }
- c = cc + 1;
- }
- else ++c;
- } else {
- cell = xlml_parsexmltagobj(Rn[0]);
- if(cell.Index) c = +cell.Index - 1;
- if(c < refguess.s.c) refguess.s.c = c;
- if(c > refguess.e.c) refguess.e.c = c;
- if(Rn[0].slice(-2) === "/>") ++c;
- comments = [];
- }
- break;
- case 'Row':
- if(Rn[1]==='/' || Rn[0].slice(-2) === "/>") {
- if(r < refguess.s.r) refguess.s.r = r;
- if(r > refguess.e.r) refguess.e.r = r;
- if(Rn[0].slice(-2) === "/>") {
- row = xlml_parsexmltag(Rn[0]);
- if(row.Index) r = +row.Index - 1;
- }
- c = 0; ++r;
- } else {
- row = xlml_parsexmltag(Rn[0]);
- if(row.Index) r = +row.Index - 1;
- rowobj = {};
- if(row.AutoFitHeight == "0" || row.Height) {
- rowobj.hpx = parseInt(row.Height, 10); rowobj.hpt = px2pt(rowobj.hpx);
- rowinfo[r] = rowobj;
- }
- if(row.Hidden == "1") { rowobj.hidden = true; rowinfo[r] = rowobj; }
- }
- break;
- case 'Worksheet': /* TODO: read range from FullRows/FullColumns */
- if(Rn[1]==='/'){
- if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));
- sheetnames.push(sheetname);
- if(refguess.s.r <= refguess.e.r && refguess.s.c <= refguess.e.c) {
- cursheet["!ref"] = encode_range(refguess);
- if(opts.sheetRows && opts.sheetRows <= refguess.e.r) {
- cursheet["!fullref"] = cursheet["!ref"];
- refguess.e.r = opts.sheetRows - 1;
- cursheet["!ref"] = encode_range(refguess);
- }
- }
- if(merges.length) cursheet["!merges"] = merges;
- if(cstys.length > 0) cursheet["!cols"] = cstys;
- if(rowinfo.length > 0) cursheet["!rows"] = rowinfo;
- sheets[sheetname] = cursheet;
- } else {
- refguess = {s: {r:2000000, c:2000000}, e: {r:0, c:0} };
- r = c = 0;
- state.push([Rn[3], false]);
- tmp = xlml_parsexmltag(Rn[0]);
- sheetname = unescapexml(tmp.Name);
- cursheet = (opts.dense ? [] : {});
- merges = [];
- arrayf = [];
- rowinfo = [];
- wsprops = {name:sheetname, Hidden:0};
- Workbook.Sheets.push(wsprops);
- }
- break;
- case 'Table':
- if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));}
- else if(Rn[0].slice(-2) == "/>") break;
- else {
- table = xlml_parsexmltag(Rn[0]);
- state.push([Rn[3], false]);
- cstys = []; seencol = false;
- }
- break;
-
- case 'Style':
- if(Rn[1]==='/') process_style_xlml(styles, stag, opts);
- else stag = xlml_parsexmltag(Rn[0]);
- break;
-
- case 'NumberFormat':
- stag.nf = unescapexml(xlml_parsexmltag(Rn[0]).Format || "General");
- if(XLMLFormatMap[stag.nf]) stag.nf = XLMLFormatMap[stag.nf];
- for(var ssfidx = 0; ssfidx != 0x188; ++ssfidx) if(SSF._table[ssfidx] == stag.nf) break;
- if(ssfidx == 0x188) for(ssfidx = 0x39; ssfidx != 0x188; ++ssfidx) if(SSF._table[ssfidx] == null) { SSF.load(stag.nf, ssfidx); break; }
- break;
-
- case 'Column':
- if(state[state.length-1][0] !== 'Table') break;
- csty = xlml_parsexmltag(Rn[0]);
- if(csty.Hidden) { csty.hidden = true; delete csty.Hidden; }
- if(csty.Width) csty.wpx = parseInt(csty.Width, 10);
- if(!seencol && csty.wpx > 10) {
- seencol = true; MDW = DEF_MDW; //find_mdw_wpx(csty.wpx);
- for(var _col = 0; _col < cstys.length; ++_col) if(cstys[_col]) process_col(cstys[_col]);
- }
- if(seencol) process_col(csty);
- cstys[(csty.Index-1||cstys.length)] = csty;
- for(var i = 0; i < +csty.Span; ++i) cstys[cstys.length] = dup(csty);
- break;
-
- case 'NamedRange':
- if(!Workbook.Names) Workbook.Names = [];
- var _NamedRange = parsexmltag(Rn[0]);
- var _DefinedName = ({
- Name: _NamedRange.Name,
- Ref: rc_to_a1(_NamedRange.RefersTo.slice(1), {r:0, c:0})
- });
- if(Workbook.Sheets.length>0) _DefinedName.Sheet=Workbook.Sheets.length-1;
- Workbook.Names.push(_DefinedName);
- break;
-
- case 'NamedCell': break;
- case 'B': break;
- case 'I': break;
- case 'U': break;
- case 'S': break;
- case 'Sub': break;
- case 'Sup': break;
- case 'Span': break;
- case 'Alignment':
- break;
- case 'Borders': break;
- case 'Border': break;
- case 'Font':
- if(Rn[0].slice(-2) === "/>") break;
- else if(Rn[1]==="/") ss += str.slice(fidx, Rn.index);
- else fidx = Rn.index + Rn[0].length;
- break;
- case 'Interior':
- if(!opts.cellStyles) break;
- stag.Interior = xlml_parsexmltag(Rn[0]);
- break;
- case 'Protection': break;
-
- case 'Author':
- case 'Title':
- case 'Description':
- case 'Created':
- case 'Keywords':
- case 'Subject':
- case 'Category':
- case 'Company':
- case 'LastAuthor':
- case 'LastSaved':
- case 'LastPrinted':
- case 'Version':
- case 'Revision':
- case 'TotalTime':
- case 'HyperlinkBase':
- case 'Manager':
- case 'ContentStatus':
- case 'Identifier':
- case 'Language':
- case 'AppName':
- if(Rn[0].slice(-2) === "/>") break;
- else if(Rn[1]==="/") xlml_set_prop(Props, Rn[3], str.slice(pidx, Rn.index));
- else pidx = Rn.index + Rn[0].length;
- break;
- case 'Paragraphs': break;
-
- case 'Styles':
- case 'Workbook':
- if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));}
- else state.push([Rn[3], false]);
- break;
-
- case 'Comment':
- if(Rn[1]==='/'){
- if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));
- xlml_clean_comment(comment);
- comments.push(comment);
- } else {
- state.push([Rn[3], false]);
- tmp = xlml_parsexmltag(Rn[0]);
- comment = ({a:tmp.Author});
- }
- break;
-
- case 'AutoFilter':
- if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));}
- else if(Rn[0].charAt(Rn[0].length-2) !== '/') {
- var AutoFilter = xlml_parsexmltag(Rn[0]);
- cursheet['!autofilter'] = { ref:rc_to_a1(AutoFilter.Range).replace(/\$/g,"") };
- state.push([Rn[3], true]);
- }
- break;
-
- case 'Name': break;
-
- case 'DataValidation':
- if(Rn[1]==='/'){
- if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));
- } else {
- if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], true]);
- }
- break;
-
- case 'ComponentOptions':
- case 'DocumentProperties':
- case 'CustomDocumentProperties':
- case 'OfficeDocumentSettings':
- case 'PivotTable':
- case 'PivotCache':
- case 'Names':
- case 'MapInfo':
- case 'PageBreaks':
- case 'QueryTable':
- case 'Sorting':
- case 'Schema':
- case 'data':
- case 'ConditionalFormatting':
- case 'SmartTagType':
- case 'SmartTags':
- case 'ExcelWorkbook':
- case 'WorkbookOptions':
- case 'WorksheetOptions':
- if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error("Bad state: "+tmp.join("|"));}
- else if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], true]);
- break;
-
- default:
- /* FODS file root is <office:document> */
- if(state.length == 0 && Rn[3] == "document") return parse_fods(str, opts);
- /* UOS file root is <uof:UOF> */
- if(state.length == 0 && Rn[3] == "UOF") return parse_fods(str, opts);
-
- var seen = true;
- switch(state[state.length-1][0]) {
- /* OfficeDocumentSettings */
- case 'OfficeDocumentSettings': switch(Rn[3]) {
- case 'AllowPNG': break;
- case 'RemovePersonalInformation': break;
- case 'DownloadComponents': break;
- case 'LocationOfComponents': break;
- case 'Colors': break;
- case 'Color': break;
- case 'Index': break;
- case 'RGB': break;
- case 'PixelsPerInch': break; // TODO: set PPI
- case 'TargetScreenSize': break;
- case 'ReadOnlyRecommended': break;
- default: seen = false;
- } break;
-
- /* ComponentOptions */
- case 'ComponentOptions': switch(Rn[3]) {
- case 'Toolbar': break;
- case 'HideOfficeLogo': break;
- case 'SpreadsheetAutoFit': break;
- case 'Label': break;
- case 'Caption': break;
- case 'MaxHeight': break;
- case 'MaxWidth': break;
- case 'NextSheetNumber': break;
- default: seen = false;
- } break;
-
- /* ExcelWorkbook */
- case 'ExcelWorkbook': switch(Rn[3]) {
- case 'Date1904':
- Workbook.WBProps.date1904 = true;
- break;
- case 'WindowHeight': break;
- case 'WindowWidth': break;
- case 'WindowTopX': break;
- case 'WindowTopY': break;
- case 'TabRatio': break;
- case 'ProtectStructure': break;
- case 'ProtectWindow': break;
- case 'ProtectWindows': break;
- case 'ActiveSheet': break;
- case 'DisplayInkNotes': break;
- case 'FirstVisibleSheet': break;
- case 'SupBook': break;
- case 'SheetName': break;
- case 'SheetIndex': break;
- case 'SheetIndexFirst': break;
- case 'SheetIndexLast': break;
- case 'Dll': break;
- case 'AcceptLabelsInFormulas': break;
- case 'DoNotSaveLinkValues': break;
- case 'Iteration': break;
- case 'MaxIterations': break;
- case 'MaxChange': break;
- case 'Path': break;
- case 'Xct': break;
- case 'Count': break;
- case 'SelectedSheets': break;
- case 'Calculation': break;
- case 'Uncalced': break;
- case 'StartupPrompt': break;
- case 'Crn': break;
- case 'ExternName': break;
- case 'Formula': break;
- case 'ColFirst': break;
- case 'ColLast': break;
- case 'WantAdvise': break;
- case 'Boolean': break;
- case 'Error': break;
- case 'Text': break;
- case 'OLE': break;
- case 'NoAutoRecover': break;
- case 'PublishObjects': break;
- case 'DoNotCalculateBeforeSave': break;
- case 'Number': break;
- case 'RefModeR1C1': break;
- case 'EmbedSaveSmartTags': break;
- default: seen = false;
- } break;
-
- /* WorkbookOptions */
- case 'WorkbookOptions': switch(Rn[3]) {
- case 'OWCVersion': break;
- case 'Height': break;
- case 'Width': break;
- default: seen = false;
- } break;
-
- /* WorksheetOptions */
- case 'WorksheetOptions': switch(Rn[3]) {
- case 'Visible':
- if(Rn[0].slice(-2) === "/>"){/* empty */}
- else if(Rn[1]==="/") switch(str.slice(pidx, Rn.index)) {
- case "SheetHidden": wsprops.Hidden = 1; break;
- case "SheetVeryHidden": wsprops.Hidden = 2; break;
- }
- else pidx = Rn.index + Rn[0].length;
- break;
- case 'Header':
- if(!cursheet['!margins']) default_margins(cursheet['!margins']={}, 'xlml');
- cursheet['!margins'].header = parsexmltag(Rn[0]).Margin;
- break;
- case 'Footer':
- if(!cursheet['!margins']) default_margins(cursheet['!margins']={}, 'xlml');
- cursheet['!margins'].footer = parsexmltag(Rn[0]).Margin;
- break;
- case 'PageMargins':
- var pagemargins = parsexmltag(Rn[0]);
- if(!cursheet['!margins']) default_margins(cursheet['!margins']={},'xlml');
- if(pagemargins.Top) cursheet['!margins'].top = pagemargins.Top;
- if(pagemargins.Left) cursheet['!margins'].left = pagemargins.Left;
- if(pagemargins.Right) cursheet['!margins'].right = pagemargins.Right;
- if(pagemargins.Bottom) cursheet['!margins'].bottom = pagemargins.Bottom;
- break;
- case 'DisplayRightToLeft':
- if(!Workbook.Views) Workbook.Views = [];
- if(!Workbook.Views[0]) Workbook.Views[0] = {};
- Workbook.Views[0].RTL = true;
- break;
-
- case 'FreezePanes': break;
- case 'FrozenNoSplit': break;
-
- case 'SplitHorizontal':
- case 'SplitVertical':
- break;
-
- case 'DoNotDisplayGridlines':
- break;
-
- case 'TopRowBottomPane': break;
- case 'LeftColumnRightPane': break;
-
- case 'Unsynced': break;
- case 'Print': break;
- case 'Panes': break;
- case 'Scale': break;
- case 'Pane': break;
- case 'Number': break;
- case 'Layout': break;
- case 'PageSetup': break;
- case 'Selected': break;
- case 'ProtectObjects': break;
- case 'EnableSelection': break;
- case 'ProtectScenarios': break;
- case 'ValidPrinterInfo': break;
- case 'HorizontalResolution': break;
- case 'VerticalResolution': break;
- case 'NumberofCopies': break;
- case 'ActiveRow': break;
- case 'ActiveCol': break;
- case 'ActivePane': break;
- case 'TopRowVisible': break;
- case 'LeftColumnVisible': break;
- case 'FitToPage': break;
- case 'RangeSelection': break;
- case 'PaperSizeIndex': break;
- case 'PageLayoutZoom': break;
- case 'PageBreakZoom': break;
- case 'FilterOn': break;
- case 'FitWidth': break;
- case 'FitHeight': break;
- case 'CommentsLayout': break;
- case 'Zoom': break;
- case 'LeftToRight': break;
- case 'Gridlines': break;
- case 'AllowSort': break;
- case 'AllowFilter': break;
- case 'AllowInsertRows': break;
- case 'AllowDeleteRows': break;
- case 'AllowInsertCols': break;
- case 'AllowDeleteCols': break;
- case 'AllowInsertHyperlinks': break;
- case 'AllowFormatCells': break;
- case 'AllowSizeCols': break;
- case 'AllowSizeRows': break;
- case 'NoSummaryRowsBelowDetail': break;
- case 'TabColorIndex': break;
- case 'DoNotDisplayHeadings': break;
- case 'ShowPageLayoutZoom': break;
- case 'NoSummaryColumnsRightDetail': break;
- case 'BlackAndWhite': break;
- case 'DoNotDisplayZeros': break;
- case 'DisplayPageBreak': break;
- case 'RowColHeadings': break;
- case 'DoNotDisplayOutline': break;
- case 'NoOrientation': break;
- case 'AllowUsePivotTables': break;
- case 'ZeroHeight': break;
- case 'ViewableRange': break;
- case 'Selection': break;
- case 'ProtectContents': break;
- default: seen = false;
- } break;
-
- /* PivotTable */
- case 'PivotTable': case 'PivotCache': switch(Rn[3]) {
- case 'ImmediateItemsOnDrop': break;
- case 'ShowPageMultipleItemLabel': break;
- case 'CompactRowIndent': break;
- case 'Location': break;
- case 'PivotField': break;
- case 'Orientation': break;
- case 'LayoutForm': break;
- case 'LayoutSubtotalLocation': break;
- case 'LayoutCompactRow': break;
- case 'Position': break;
- case 'PivotItem': break;
- case 'DataType': break;
- case 'DataField': break;
- case 'SourceName': break;
- case 'ParentField': break;
- case 'PTLineItems': break;
- case 'PTLineItem': break;
- case 'CountOfSameItems': break;
- case 'Item': break;
- case 'ItemType': break;
- case 'PTSource': break;
- case 'CacheIndex': break;
- case 'ConsolidationReference': break;
- case 'FileName': break;
- case 'Reference': break;
- case 'NoColumnGrand': break;
- case 'NoRowGrand': break;
- case 'BlankLineAfterItems': break;
- case 'Hidden': break;
- case 'Subtotal': break;
- case 'BaseField': break;
- case 'MapChildItems': break;
- case 'Function': break;
- case 'RefreshOnFileOpen': break;
- case 'PrintSetTitles': break;
- case 'MergeLabels': break;
- case 'DefaultVersion': break;
- case 'RefreshName': break;
- case 'RefreshDate': break;
- case 'RefreshDateCopy': break;
- case 'VersionLastRefresh': break;
- case 'VersionLastUpdate': break;
- case 'VersionUpdateableMin': break;
- case 'VersionRefreshableMin': break;
- case 'Calculation': break;
- default: seen = false;
- } break;
-
- /* PageBreaks */
- case 'PageBreaks': switch(Rn[3]) {
- case 'ColBreaks': break;
- case 'ColBreak': break;
- case 'RowBreaks': break;
- case 'RowBreak': break;
- case 'ColStart': break;
- case 'ColEnd': break;
- case 'RowEnd': break;
- default: seen = false;
- } break;
-
- /* AutoFilter */
- case 'AutoFilter': switch(Rn[3]) {
- case 'AutoFilterColumn': break;
- case 'AutoFilterCondition': break;
- case 'AutoFilterAnd': break;
- case 'AutoFilterOr': break;
- default: seen = false;
- } break;
-
- /* QueryTable */
- case 'QueryTable': switch(Rn[3]) {
- case 'Id': break;
- case 'AutoFormatFont': break;
- case 'AutoFormatPattern': break;
- case 'QuerySource': break;
- case 'QueryType': break;
- case 'EnableRedirections': break;
- case 'RefreshedInXl9': break;
- case 'URLString': break;
- case 'HTMLTables': break;
- case 'Connection': break;
- case 'CommandText': break;
- case 'RefreshInfo': break;
- case 'NoTitles': break;
- case 'NextId': break;
- case 'ColumnInfo': break;
- case 'OverwriteCells': break;
- case 'DoNotPromptForFile': break;
- case 'TextWizardSettings': break;
- case 'Source': break;
- case 'Number': break;
- case 'Decimal': break;
- case 'ThousandSeparator': break;
- case 'TrailingMinusNumbers': break;
- case 'FormatSettings': break;
- case 'FieldType': break;
- case 'Delimiters': break;
- case 'Tab': break;
- case 'Comma': break;
- case 'AutoFormatName': break;
- case 'VersionLastEdit': break;
- case 'VersionLastRefresh': break;
- default: seen = false;
- } break;
-
- case 'DataValidation':
- switch(Rn[3]) {
- case 'Range': break;
-
- case 'Type': break;
- case 'Min': break;
- case 'Max': break;
- case 'Sort': break;
- case 'Descending': break;
- case 'Order': break;
- case 'CaseSensitive': break;
- case 'Value': break;
- case 'ErrorStyle': break;
- case 'ErrorMessage': break;
- case 'ErrorTitle': break;
- case 'InputMessage': break;
- case 'InputTitle': break;
- case 'ComboHide': break;
- case 'InputHide': break;
- case 'Condition': break;
- case 'Qualifier': break;
- case 'UseBlank': break;
- case 'Value1': break;
- case 'Value2': break;
- case 'Format': break;
-
- case 'CellRangeList': break;
- default: seen = false;
- } break;
-
- case 'Sorting':
- case 'ConditionalFormatting':
- switch(Rn[3]) {
- case 'Range': break;
- case 'Type': break;
- case 'Min': break;
- case 'Max': break;
- case 'Sort': break;
- case 'Descending': break;
- case 'Order': break;
- case 'CaseSensitive': break;
- case 'Value': break;
- case 'ErrorStyle': break;
- case 'ErrorMessage': break;
- case 'ErrorTitle': break;
- case 'CellRangeList': break;
- case 'InputMessage': break;
- case 'InputTitle': break;
- case 'ComboHide': break;
- case 'InputHide': break;
- case 'Condition': break;
- case 'Qualifier': break;
- case 'UseBlank': break;
- case 'Value1': break;
- case 'Value2': break;
- case 'Format': break;
- default: seen = false;
- } break;
-
- /* MapInfo (schema) */
- case 'MapInfo': case 'Schema': case 'data': switch(Rn[3]) {
- case 'Map': break;
- case 'Entry': break;
- case 'Range': break;
- case 'XPath': break;
- case 'Field': break;
- case 'XSDType': break;
- case 'FilterOn': break;
- case 'Aggregate': break;
- case 'ElementType': break;
- case 'AttributeType': break;
- /* These are from xsd (XML Schema Definition) */
- case 'schema':
- case 'element':
- case 'complexType':
- case 'datatype':
- case 'all':
- case 'attribute':
- case 'extends': break;
-
- case 'row': break;
- default: seen = false;
- } break;
-
- /* SmartTags (can be anything) */
- case 'SmartTags': break;
-
- default: seen = false; break;
- }
- if(seen) break;
- /* CustomDocumentProperties */
- if(Rn[3].match(/!\[CDATA/)) break;
- if(!state[state.length-1][1]) throw 'Unrecognized tag: ' + Rn[3] + "|" + state.join("|");
- if(state[state.length-1][0]==='CustomDocumentProperties') {
- if(Rn[0].slice(-2) === "/>") break;
- else if(Rn[1]==="/") xlml_set_custprop(Custprops, Rn[3], cp, str.slice(pidx, Rn.index));
- else { cp = Rn; pidx = Rn.index + Rn[0].length; }
- break;
- }
- if(opts.WTF) throw 'Unrecognized tag: ' + Rn[3] + "|" + state.join("|");
- }
- var out = ({});
- if(!opts.bookSheets && !opts.bookProps) out.Sheets = sheets;
- out.SheetNames = sheetnames;
- out.Workbook = Workbook;
- out.SSF = SSF.get_table();
- out.Props = Props;
- out.Custprops = Custprops;
- return out;
- }
-
- function parse_xlml(data, opts) {
- fix_read_opts(opts=opts||{});
- switch(opts.type||"base64") {
- case "base64": return parse_xlml_xml(Base64.decode(data), opts);
- case "binary": case "buffer": case "file": return parse_xlml_xml(data, opts);
- case "array": return parse_xlml_xml(a2s(data), opts);
- }
- }
-
- /* TODO */
- function write_props_xlml(wb, opts) {
- var o = [];
- /* DocumentProperties */
- if(wb.Props) o.push(xlml_write_docprops(wb.Props, opts));
- /* CustomDocumentProperties */
- if(wb.Custprops) o.push(xlml_write_custprops(wb.Props, wb.Custprops, opts));
- return o.join("");
- }
- /* TODO */
- function write_wb_xlml() {
- /* OfficeDocumentSettings */
- /* ExcelWorkbook */
- return "";
- }
- /* TODO */
- function write_sty_xlml(wb, opts) {
- /* Styles */
- var styles = ['<Style ss:ID="Default" ss:Name="Normal"><NumberFormat/></Style>'];
- opts.cellXfs.forEach(function(xf, id) {
- var payload = [];
- payload.push(writextag('NumberFormat', null, {"ss:Format": escapexml(SSF._table[xf.numFmtId])}));
- styles.push(writextag('Style', payload.join(""), {"ss:ID": "s" + (21+id)}));
- });
- return writextag("Styles", styles.join(""));
- }
- function write_name_xlml(n) { return writextag("NamedRange", null, {"ss:Name": n.Name, "ss:RefersTo":"=" + a1_to_rc(n.Ref, {r:0,c:0})}); }
- function write_names_xlml(wb) {
- if(!((wb||{}).Workbook||{}).Names) return "";
- var names = wb.Workbook.Names;
- var out = [];
- for(var i = 0; i < names.length; ++i) {
- var n = names[i];
- if(n.Sheet != null) continue;
- if(n.Name.match(/^_xlfn\./)) continue;
- out.push(write_name_xlml(n));
- }
- return writextag("Names", out.join(""));
- }
- function write_ws_xlml_names(ws, opts, idx, wb) {
- if(!ws) return "";
- if(!((wb||{}).Workbook||{}).Names) return "";
- var names = wb.Workbook.Names;
- var out = [];
- for(var i = 0; i < names.length; ++i) {
- var n = names[i];
- if(n.Sheet != idx) continue;
- /*switch(n.Name) {
- case "_": continue;
- }*/
- if(n.Name.match(/^_xlfn\./)) continue;
- out.push(write_name_xlml(n));
- }
- return out.join("");
- }
- /* WorksheetOptions */
- function write_ws_xlml_wsopts(ws, opts, idx, wb) {
- if(!ws) return "";
- var o = [];
- /* NOTE: spec technically allows any order, but stick with implied order */
-
- /* FitToPage */
- /* DoNotDisplayColHeaders */
- /* DoNotDisplayRowHeaders */
- /* ViewableRange */
- /* Selection */
- /* GridlineColor */
- /* Name */
- /* ExcelWorksheetType */
- /* IntlMacro */
- /* Unsynced */
- /* Selected */
- /* CodeName */
-
- if(ws['!margins']) {
- o.push("<PageSetup>");
- if(ws['!margins'].header) o.push(writextag("Header", null, {'x:Margin':ws['!margins'].header}));
- if(ws['!margins'].footer) o.push(writextag("Footer", null, {'x:Margin':ws['!margins'].footer}));
- o.push(writextag("PageMargins", null, {
- 'x:Bottom': ws['!margins'].bottom || "0.75",
- 'x:Left': ws['!margins'].left || "0.7",
- 'x:Right': ws['!margins'].right || "0.7",
- 'x:Top': ws['!margins'].top || "0.75"
- }));
- o.push("</PageSetup>");
- }
-
- /* PageSetup */
- /* DisplayPageBreak */
- /* TransitionExpressionEvaluation */
- /* TransitionFormulaEntry */
- /* Print */
- /* Zoom */
- /* PageLayoutZoom */
- /* PageBreakZoom */
- /* ShowPageBreakZoom */
- /* DefaultRowHeight */
- /* DefaultColumnWidth */
- /* StandardWidth */
-
- if(wb && wb.Workbook && wb.Workbook.Sheets && wb.Workbook.Sheets[idx]) {
- /* Visible */
- if(wb.Workbook.Sheets[idx].Hidden) o.push(writextag("Visible", (wb.Workbook.Sheets[idx].Hidden == 1 ? "SheetHidden" : "SheetVeryHidden"), {}));
- else {
- /* Selected */
- for(var i = 0; i < idx; ++i) if(wb.Workbook.Sheets[i] && !wb.Workbook.Sheets[i].Hidden) break;
- if(i == idx) o.push("<Selected/>");
- }
- }
-
- /* LeftColumnVisible */
-
- if(((((wb||{}).Workbook||{}).Views||[])[0]||{}).RTL) o.push("<DisplayRightToLeft/>");
-
- /* GridlineColorIndex */
- /* DisplayFormulas */
- /* DoNotDisplayGridlines */
- /* DoNotDisplayHeadings */
- /* DoNotDisplayOutline */
- /* ApplyAutomaticOutlineStyles */
- /* NoSummaryRowsBelowDetail */
- /* NoSummaryColumnsRightDetail */
- /* DoNotDisplayZeros */
- /* ActiveRow */
- /* ActiveColumn */
- /* FilterOn */
- /* RangeSelection */
- /* TopRowVisible */
- /* TopRowBottomPane */
- /* LeftColumnRightPane */
- /* ActivePane */
- /* SplitHorizontal */
- /* SplitVertical */
- /* FreezePanes */
- /* FrozenNoSplit */
- /* TabColorIndex */
- /* Panes */
-
- /* NOTE: Password not supported in XLML Format */
- if(ws['!protect']) {
- o.push(writetag("ProtectContents", "True"));
- if(ws['!protect'].objects) o.push(writetag("ProtectObjects", "True"));
- if(ws['!protect'].scenarios) o.push(writetag("ProtectScenarios", "True"));
- if(ws['!protect'].selectLockedCells != null && !ws['!protect'].selectLockedCells) o.push(writetag("EnableSelection", "NoSelection"));
- else if(ws['!protect'].selectUnlockedCells != null && !ws['!protect'].selectUnlockedCells) o.push(writetag("EnableSelection", "UnlockedCells"));
- [
- [ "formatCells", "AllowFormatCells" ],
- [ "formatColumns", "AllowSizeCols" ],
- [ "formatRows", "AllowSizeRows" ],
- [ "insertColumns", "AllowInsertCols" ],
- [ "insertRows", "AllowInsertRows" ],
- [ "insertHyperlinks", "AllowInsertHyperlinks" ],
- [ "deleteColumns", "AllowDeleteCols" ],
- [ "deleteRows", "AllowDeleteRows" ],
- [ "sort", "AllowSort" ],
- [ "autoFilter", "AllowFilter" ],
- [ "pivotTables", "AllowUsePivotTables" ]
- ].forEach(function(x) { if(ws['!protect'][x[0]]) o.push("<"+x[1]+"/>"); });
- }
-
- if(o.length == 0) return "";
- return writextag("WorksheetOptions", o.join(""), {xmlns:XLMLNS.x});
- }
- function write_ws_xlml_comment(comments) {
- return comments.map(function(c) {
- // TODO: formatted text
- var t = xlml_unfixstr(c.t||"");
- var d =writextag("ss:Data", t, {"xmlns":"http://www.w3.org/TR/REC-html40"});
- return writextag("Comment", d, {"ss:Author":c.a});
- }).join("");
- }
- function write_ws_xlml_cell(cell, ref, ws, opts, idx, wb, addr){
- if(!cell || (cell.v == undefined && cell.f == undefined)) return "";
-
- var attr = {};
- if(cell.f) attr["ss:Formula"] = "=" + escapexml(a1_to_rc(cell.f, addr));
- if(cell.F && cell.F.slice(0, ref.length) == ref) {
- var end = decode_cell(cell.F.slice(ref.length + 1));
- attr["ss:ArrayRange"] = "RC:R" + (end.r == addr.r ? "" : "[" + (end.r - addr.r) + "]") + "C" + (end.c == addr.c ? "" : "[" + (end.c - addr.c) + "]");
- }
-
- if(cell.l && cell.l.Target) {
- attr["ss:HRef"] = escapexml(cell.l.Target);
- if(cell.l.Tooltip) attr["x:HRefScreenTip"] = escapexml(cell.l.Tooltip);
- }
-
- if(ws['!merges']) {
- var marr = ws['!merges'];
- for(var mi = 0; mi != marr.length; ++mi) {
- if(marr[mi].s.c != addr.c || marr[mi].s.r != addr.r) continue;
- if(marr[mi].e.c > marr[mi].s.c) attr['ss:MergeAcross'] = marr[mi].e.c - marr[mi].s.c;
- if(marr[mi].e.r > marr[mi].s.r) attr['ss:MergeDown'] = marr[mi].e.r - marr[mi].s.r;
- }
- }
-
- var t = "", p = "";
- switch(cell.t) {
- case 'z': if(!opts.sheetStubs) return ""; break;
- case 'n': t = 'Number'; p = String(cell.v); break;
- case 'b': t = 'Boolean'; p = (cell.v ? "1" : "0"); break;
- case 'e': t = 'Error'; p = BErr[cell.v]; break;
- case 'd': t = 'DateTime'; p = new Date(cell.v).toISOString(); if(cell.z == null) cell.z = cell.z || SSF._table[14]; break;
- case 's': t = 'String'; p = escapexlml(cell.v||""); break;
- }
- /* TODO: cell style */
- var os = get_cell_style(opts.cellXfs, cell, opts);
- attr["ss:StyleID"] = "s" + (21+os);
- attr["ss:Index"] = addr.c + 1;
- var _v = (cell.v != null ? p : "");
- var m = cell.t == 'z' ? "" : ('<Data ss:Type="' + t + '">' + _v + '</Data>');
-
- if((cell.c||[]).length > 0) m += write_ws_xlml_comment(cell.c);
-
- return writextag("Cell", m, attr);
- }
- function write_ws_xlml_row(R, row) {
- var o = '<Row ss:Index="' + (R+1) + '"';
- if(row) {
- if(row.hpt && !row.hpx) row.hpx = pt2px(row.hpt);
- if(row.hpx) o += ' ss:AutoFitHeight="0" ss:Height="' + row.hpx + '"';
- if(row.hidden) o += ' ss:Hidden="1"';
- }
- return o + '>';
- }
- /* TODO */
- function write_ws_xlml_table(ws, opts, idx, wb) {
- if(!ws['!ref']) return "";
- var range = safe_decode_range(ws['!ref']);
- var marr = ws['!merges'] || [], mi = 0;
- var o = [];
- if(ws['!cols']) ws['!cols'].forEach(function(n, i) {
- process_col(n);
- var w = !!n.width;
- var p = col_obj_w(i, n);
- var k = {"ss:Index":i+1};
- if(w) k['ss:Width'] = width2px(p.width);
- if(n.hidden) k['ss:Hidden']="1";
- o.push(writextag("Column",null,k));
- });
- var dense = Array.isArray(ws);
- for(var R = range.s.r; R <= range.e.r; ++R) {
- var row = [write_ws_xlml_row(R, (ws['!rows']||[])[R])];
- for(var C = range.s.c; C <= range.e.c; ++C) {
- var skip = false;
- for(mi = 0; mi != marr.length; ++mi) {
- if(marr[mi].s.c > C) continue;
- if(marr[mi].s.r > R) continue;
- if(marr[mi].e.c < C) continue;
- if(marr[mi].e.r < R) continue;
- if(marr[mi].s.c != C || marr[mi].s.r != R) skip = true;
- break;
- }
- if(skip) continue;
- var addr = {r:R,c:C};
- var ref = encode_cell(addr), cell = dense ? (ws[R]||[])[C] : ws[ref];
- row.push(write_ws_xlml_cell(cell, ref, ws, opts, idx, wb, addr));
- }
- row.push("</Row>");
- if(row.length > 2) o.push(row.join(""));
- }
- return o.join("");
- }
- function write_ws_xlml(idx, opts, wb) {
- var o = [];
- var s = wb.SheetNames[idx];
- var ws = wb.Sheets[s];
-
- var t = ws ? write_ws_xlml_names(ws, opts, idx, wb) : "";
- if(t.length > 0) o.push("<Names>" + t + "</Names>");
-
- /* Table */
- t = ws ? write_ws_xlml_table(ws, opts, idx, wb) : "";
- if(t.length > 0) o.push("<Table>" + t + "</Table>");
-
- /* WorksheetOptions */
- o.push(write_ws_xlml_wsopts(ws, opts, idx, wb));
-
- return o.join("");
- }
- function write_xlml(wb, opts) {
- if(!opts) opts = {};
- if(!wb.SSF) wb.SSF = SSF.get_table();
- if(wb.SSF) {
- make_ssf(SSF); SSF.load_table(wb.SSF);
- // $FlowIgnore
- opts.revssf = evert_num(wb.SSF); opts.revssf[wb.SSF[65535]] = 0;
- opts.ssf = wb.SSF;
- opts.cellXfs = [];
- get_cell_style(opts.cellXfs, {}, {revssf:{"General":0}});
- }
- var d = [];
- d.push(write_props_xlml(wb, opts));
- d.push(write_wb_xlml(wb, opts));
- d.push("");
- d.push("");
- for(var i = 0; i < wb.SheetNames.length; ++i)
- d.push(writextag("Worksheet", write_ws_xlml(i, opts, wb), {"ss:Name":escapexml(wb.SheetNames[i])}));
- d[2] = write_sty_xlml(wb, opts);
- d[3] = write_names_xlml(wb, opts);
- return XML_HEADER + writextag("Workbook", d.join(""), {
- 'xmlns': XLMLNS.ss,
- 'xmlns:o': XLMLNS.o,
- 'xmlns:x': XLMLNS.x,
- 'xmlns:ss': XLMLNS.ss,
- 'xmlns:dt': XLMLNS.dt,
- 'xmlns:html': XLMLNS.html
- });
- }
- /* [MS-OLEDS] 2.3.8 CompObjStream */
- function parse_compobj(obj) {
- var v = {};
- var o = obj.content;
- /* [MS-OLEDS] 2.3.7 CompObjHeader -- All fields MUST be ignored */
- o.l = 28;
-
- v.AnsiUserType = o.read_shift(0, "lpstr-ansi");
- v.AnsiClipboardFormat = parse_ClipboardFormatOrAnsiString(o);
-
- if(o.length - o.l <= 4) return v;
-
- var m = o.read_shift(4);
- if(m == 0 || m > 40) return v;
- o.l-=4; v.Reserved1 = o.read_shift(0, "lpstr-ansi");
-
- if(o.length - o.l <= 4) return v;
- m = o.read_shift(4);
- if(m !== 0x71b239f4) return v;
- v.UnicodeClipboardFormat = parse_ClipboardFormatOrUnicodeString(o);
-
- m = o.read_shift(4);
- if(m == 0 || m > 40) return v;
- o.l-=4; v.Reserved2 = o.read_shift(0, "lpwstr");
- }
-
- /*
- Continue logic for:
- - 2.4.58 Continue
- - 2.4.59 ContinueBigName
- - 2.4.60 ContinueFrt
- - 2.4.61 ContinueFrt11
- - 2.4.62 ContinueFrt12
- */
- function slurp(R, blob, length, opts) {
- var l = length;
- var bufs = [];
- var d = blob.slice(blob.l,blob.l+l);
- if(opts && opts.enc && opts.enc.insitu) switch(R.n) {
- case 'BOF': case 'FilePass': case 'FileLock': case 'InterfaceHdr': case 'RRDInfo': case 'RRDHead': case 'UsrExcl': break;
- default:
- if(d.length === 0) break;
- opts.enc.insitu(d);
- }
- bufs.push(d);
- blob.l += l;
- var next = (XLSRecordEnum[__readUInt16LE(blob,blob.l)]);
- var start = 0;
- while(next != null && next.n.slice(0,8) === 'Continue') {
- l = __readUInt16LE(blob,blob.l+2);
- start = blob.l + 4;
- if(next.n == 'ContinueFrt') start += 4;
- else if(next.n.slice(0,11) == 'ContinueFrt') start += 12;
- bufs.push(blob.slice(start,blob.l+4+l));
- blob.l += 4+l;
- next = (XLSRecordEnum[__readUInt16LE(blob, blob.l)]);
- }
- var b = (bconcat(bufs));
- prep_blob(b, 0);
- var ll = 0; b.lens = [];
- for(var j = 0; j < bufs.length; ++j) { b.lens.push(ll); ll += bufs[j].length; }
- return R.f(b, b.length, opts);
- }
-
- function safe_format_xf(p, opts, date1904) {
- if(p.t === 'z') return;
- if(!p.XF) return;
- var fmtid = 0;
- try {
- fmtid = p.z || p.XF.numFmtId || 0;
- if(opts.cellNF) p.z = SSF._table[fmtid];
- } catch(e) { if(opts.WTF) throw e; }
- if(!opts || opts.cellText !== false) try {
- if(p.t === 'e') { p.w = p.w || BErr[p.v]; }
- else if(fmtid === 0 || fmtid == "General") {
- if(p.t === 'n') {
- if((p.v|0) === p.v) p.w = SSF._general_int(p.v);
- else p.w = SSF._general_num(p.v);
- }
- else p.w = SSF._general(p.v);
- }
- else p.w = SSF.format(fmtid,p.v, {date1904:!!date1904});
- } catch(e) { if(opts.WTF) throw e; }
- if(opts.cellDates && fmtid && p.t == 'n' && SSF.is_date(SSF._table[fmtid] || String(fmtid))) {
- var _d = SSF.parse_date_code(p.v); if(_d) { p.t = 'd'; p.v = new Date(_d.y, _d.m-1,_d.d,_d.H,_d.M,_d.S,_d.u); }
- }
- }
-
- function make_cell(val, ixfe, t) {
- return ({v:val, ixfe:ixfe, t:t});
- }
-
- // 2.3.2
- function parse_workbook(blob, options) {
- var wb = ({opts:{}});
- var Sheets = {};
- if(DENSE != null && options.dense == null) options.dense = DENSE;
- var out = ((options.dense ? [] : {}));
- var Directory = {};
- var range = ({});
- var last_formula = null;
- var sst = ([]);
- var cur_sheet = "";
- var Preamble = {};
- var lastcell, last_cell = "", cc, cmnt, rngC, rngR;
- var sharedf = {};
- var arrayf = [];
- var temp_val;
- var country;
- var cell_valid = true;
- var XFs = []; /* XF records */
- var palette = [];
- var Workbook = ({ Sheets:[], WBProps:{date1904:false}, Views:[{}] }), wsprops = {};
- var get_rgb = function getrgb(icv) {
- if(icv < 8) return XLSIcv[icv];
- if(icv < 64) return palette[icv-8] || XLSIcv[icv];
- return XLSIcv[icv];
- };
- var process_cell_style = function pcs(cell, line, options) {
- var xfd = line.XF.data;
- if(!xfd || !xfd.patternType || !options || !options.cellStyles) return;
- line.s = ({});
- line.s.patternType = xfd.patternType;
- var t;
- if((t = rgb2Hex(get_rgb(xfd.icvFore)))) { line.s.fgColor = {rgb:t}; }
- if((t = rgb2Hex(get_rgb(xfd.icvBack)))) { line.s.bgColor = {rgb:t}; }
- };
- var addcell = function addcell(cell, line, options) {
- if(file_depth > 1) return;
- if(options.sheetRows && cell.r >= options.sheetRows) cell_valid = false;
- if(!cell_valid) return;
- if(options.cellStyles && line.XF && line.XF.data) process_cell_style(cell, line, options);
- delete line.ixfe; delete line.XF;
- lastcell = cell;
- last_cell = encode_cell(cell);
- if(!range || !range.s || !range.e) range = {s:{r:0,c:0},e:{r:0,c:0}};
- if(cell.r < range.s.r) range.s.r = cell.r;
- if(cell.c < range.s.c) range.s.c = cell.c;
- if(cell.r + 1 > range.e.r) range.e.r = cell.r + 1;
- if(cell.c + 1 > range.e.c) range.e.c = cell.c + 1;
- if(options.cellFormula && line.f) {
- for(var afi = 0; afi < arrayf.length; ++afi) {
- if(arrayf[afi][0].s.c > cell.c || arrayf[afi][0].s.r > cell.r) continue;
- if(arrayf[afi][0].e.c < cell.c || arrayf[afi][0].e.r < cell.r) continue;
- line.F = encode_range(arrayf[afi][0]);
- if(arrayf[afi][0].s.c != cell.c || arrayf[afi][0].s.r != cell.r) delete line.f;
- if(line.f) line.f = "" + stringify_formula(arrayf[afi][1], range, cell, supbooks, opts);
- break;
- }
- }
- {
- if(options.dense) {
- if(!out[cell.r]) out[cell.r] = [];
- out[cell.r][cell.c] = line;
- } else out[last_cell] = line;
- }
- };
- var opts = ({
- enc: false, // encrypted
- sbcch: 0, // cch in the preceding SupBook
- snames: [], // sheetnames
- sharedf: sharedf, // shared formulae by address
- arrayf: arrayf, // array formulae array
- rrtabid: [], // RRTabId
- lastuser: "", // Last User from WriteAccess
- biff: 8, // BIFF version
- codepage: 0, // CP from CodePage record
- winlocked: 0, // fLockWn from WinProtect
- cellStyles: !!options && !!options.cellStyles,
- WTF: !!options && !!options.wtf
- });
- if(options.password) opts.password = options.password;
- var themes;
- var merges = [];
- var objects = [];
- var colinfo = [], rowinfo = [];
- // eslint-disable-next-line no-unused-vars
- var defwidth = 0, defheight = 0; // twips / MDW respectively
- var seencol = false;
- var supbooks = ([]); // 1-indexed, will hold extern names
- supbooks.SheetNames = opts.snames;
- supbooks.sharedf = opts.sharedf;
- supbooks.arrayf = opts.arrayf;
- supbooks.names = [];
- supbooks.XTI = [];
- var last_Rn = '';
- var file_depth = 0; /* TODO: make a real stack */
- var BIFF2Fmt = 0, BIFF2FmtTable = [];
- var FilterDatabases = []; /* TODO: sort out supbooks and process elsewhere */
- var last_lbl;
-
- /* explicit override for some broken writers */
- opts.codepage = 1200;
- set_cp(1200);
- var seen_codepage = false;
- while(blob.l < blob.length - 1) {
- var s = blob.l;
- var RecordType = blob.read_shift(2);
- if(RecordType === 0 && last_Rn === 'EOF') break;
- var length = (blob.l === blob.length ? 0 : blob.read_shift(2));
- var R = XLSRecordEnum[RecordType];
- //console.log(RecordType.toString(16), RecordType, R, blob.l, length, blob.length);
- //if(!R) console.log(blob.slice(blob.l, blob.l + length));
- if(R && R.f) {
- if(options.bookSheets) {
- if(last_Rn === 'BoundSheet8' && R.n !== 'BoundSheet8') break;
- }
- last_Rn = R.n;
- if(R.r === 2 || R.r == 12) {
- var rt = blob.read_shift(2); length -= 2;
- if(!opts.enc && rt !== RecordType && (((rt&0xFF)<<8)|(rt>>8)) !== RecordType) throw new Error("rt mismatch: " + rt + "!=" + RecordType);
- if(R.r == 12){ blob.l += 10; length -= 10; } // skip FRT
- }
- //console.error(R,blob.l,length,blob.length);
- var val = ({});
- if(R.n === 'EOF') val = R.f(blob, length, opts);
- else val = slurp(R, blob, length, opts);
- var Rn = R.n;
- if(file_depth == 0 && Rn != 'BOF') continue;
- /* nested switch statements to workaround V8 128 limit */
- switch(Rn) {
- /* Workbook Options */
- case 'Date1904':
- wb.opts.Date1904 = Workbook.WBProps.date1904 = val; break;
- case 'WriteProtect': wb.opts.WriteProtect = true; break;
- case 'FilePass':
- if(!opts.enc) blob.l = 0;
- opts.enc = val;
- if(!options.password) throw new Error("File is password-protected");
- if(val.valid == null) throw new Error("Encryption scheme unsupported");
- if(!val.valid) throw new Error("Password is incorrect");
- break;
- case 'WriteAccess': opts.lastuser = val; break;
- case 'FileSharing': break; //TODO
- case 'CodePage':
- var cpval = Number(val);
- /* overrides based on test cases */
- switch(cpval) {
- case 0x5212: cpval = 1200; break;
- case 0x8000: cpval = 10000; break;
- case 0x8001: cpval = 1252; break;
- }
- set_cp(opts.codepage = cpval);
- seen_codepage = true;
- break;
- case 'RRTabId': opts.rrtabid = val; break;
- case 'WinProtect': opts.winlocked = val; break;
- case 'Template': break; // TODO
- case 'BookBool': break; // TODO
- case 'UsesELFs': break;
- case 'MTRSettings': break;
- case 'RefreshAll':
- case 'CalcCount':
- case 'CalcDelta':
- case 'CalcIter':
- case 'CalcMode':
- case 'CalcPrecision':
- case 'CalcSaveRecalc':
- wb.opts[Rn] = val; break;
- case 'CalcRefMode': opts.CalcRefMode = val; break; // TODO: implement R1C1
- case 'Uncalced': break;
- case 'ForceFullCalculation': wb.opts.FullCalc = val; break;
- case 'WsBool':
- if(val.fDialog) out["!type"] = "dialog";
- break; // TODO
- case 'XF':
- XFs.push(val); break;
- case 'ExtSST': break; // TODO
- case 'BookExt': break; // TODO
- case 'RichTextStream': break;
- case 'BkHim': break;
-
- case 'SupBook':
- supbooks.push([val]);
- supbooks[supbooks.length-1].XTI = [];
- break;
- case 'ExternName':
- supbooks[supbooks.length-1].push(val);
- break;
- case 'Index': break; // TODO
- case 'Lbl':
- last_lbl = ({
- Name: val.Name,
- Ref: stringify_formula(val.rgce,range,null,supbooks,opts)
- });
- if(val.itab > 0) last_lbl.Sheet = val.itab - 1;
- supbooks.names.push(last_lbl);
- if(!supbooks[0]) { supbooks[0] = []; supbooks[0].XTI = []; }
- supbooks[supbooks.length-1].push(val);
- if(val.Name == "_xlnm._FilterDatabase" && val.itab > 0)
- if(val.rgce && val.rgce[0] && val.rgce[0][0] && val.rgce[0][0][0] == 'PtgArea3d')
- FilterDatabases[val.itab - 1] = { ref: encode_range(val.rgce[0][0][1][2]) };
- break;
- case 'ExternCount': opts.ExternCount = val; break;
- case 'ExternSheet':
- if(supbooks.length == 0) { supbooks[0] = []; supbooks[0].XTI = []; }
- supbooks[supbooks.length - 1].XTI = supbooks[supbooks.length - 1].XTI.concat(val); supbooks.XTI = supbooks.XTI.concat(val); break;
- case 'NameCmt':
- /* TODO: search for correct name */
- if(opts.biff < 8) break;
- if(last_lbl != null) last_lbl.Comment = val[1];
- break;
-
- case 'Protect': out["!protect"] = val; break; /* for sheet or book */
- case 'Password': if(val !== 0 && opts.WTF) console.error("Password verifier: " + val); break;
- case 'Prot4Rev': case 'Prot4RevPass': break; /*TODO: Revision Control*/
-
- case 'BoundSheet8': {
- Directory[val.pos] = val;
- opts.snames.push(val.name);
- } break;
- case 'EOF': {
- if(--file_depth) break;
- if(range.e) {
- if(range.e.r > 0 && range.e.c > 0) {
- range.e.r--; range.e.c--;
- out["!ref"] = encode_range(range);
- if(options.sheetRows && options.sheetRows <= range.e.r) {
- var tmpri = range.e.r;
- range.e.r = options.sheetRows - 1;
- out["!fullref"] = out["!ref"];
- out["!ref"] = encode_range(range);
- range.e.r = tmpri;
- }
- range.e.r++; range.e.c++;
- }
- if(merges.length > 0) out["!merges"] = merges;
- if(objects.length > 0) out["!objects"] = objects;
- if(colinfo.length > 0) out["!cols"] = colinfo;
- if(rowinfo.length > 0) out["!rows"] = rowinfo;
- Workbook.Sheets.push(wsprops);
- }
- if(cur_sheet === "") Preamble = out; else Sheets[cur_sheet] = out;
- out = ((options.dense ? [] : {}));
- } break;
- case 'BOF': {
- if(opts.biff === 8) opts.biff = {
- 0x0009:2,
- 0x0209:3,
- 0x0409:4
- }[RecordType] || {
- 0x0200:2,
- 0x0300:3,
- 0x0400:4,
- 0x0500:5,
- 0x0600:8,
- 0x0002:2,
- 0x0007:2
- }[val.BIFFVer] || 8;
- if(opts.biff == 8 && val.BIFFVer == 0 && val.dt == 16) opts.biff = 2;
- if(file_depth++) break;
- cell_valid = true;
- out = ((options.dense ? [] : {}));
-
- if(opts.biff < 8 && !seen_codepage) { seen_codepage = true; set_cp(opts.codepage = options.codepage || 1252); }
- if(opts.biff < 5) {
- if(cur_sheet === "") cur_sheet = "Sheet1";
- range = {s:{r:0,c:0},e:{r:0,c:0}};
- /* fake BoundSheet8 */
- var fakebs8 = {pos: blob.l - length, name:cur_sheet};
- Directory[fakebs8.pos] = fakebs8;
- opts.snames.push(cur_sheet);
- }
- else cur_sheet = (Directory[s] || {name:""}).name;
- if(val.dt == 0x20) out["!type"] = "chart";
- if(val.dt == 0x40) out["!type"] = "macro";
- merges = [];
- objects = [];
- opts.arrayf = arrayf = [];
- colinfo = []; rowinfo = [];
- defwidth = defheight = 0;
- seencol = false;
- wsprops = {Hidden:(Directory[s]||{hs:0}).hs, name:cur_sheet };
- } break;
-
- case 'Number': case 'BIFF2NUM': case 'BIFF2INT': {
- if(out["!type"] == "chart") if(options.dense ? (out[val.r]||[])[val.c]: out[encode_cell({c:val.c, r:val.r})]) ++val.c;
- temp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe]||{}, v:val.val, t:'n'});
- if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
- safe_format_xf(temp_val, options, wb.opts.Date1904);
- addcell({c:val.c, r:val.r}, temp_val, options);
- } break;
- case 'BoolErr': {
- temp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe], v:val.val, t:val.t});
- if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
- safe_format_xf(temp_val, options, wb.opts.Date1904);
- addcell({c:val.c, r:val.r}, temp_val, options);
- } break;
- case 'RK': {
- temp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe], v:val.rknum, t:'n'});
- if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
- safe_format_xf(temp_val, options, wb.opts.Date1904);
- addcell({c:val.c, r:val.r}, temp_val, options);
- } break;
- case 'MulRk': {
- for(var j = val.c; j <= val.C; ++j) {
- var ixfe = val.rkrec[j-val.c][0];
- temp_val= ({ixfe:ixfe, XF:XFs[ixfe], v:val.rkrec[j-val.c][1], t:'n'});
- if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
- safe_format_xf(temp_val, options, wb.opts.Date1904);
- addcell({c:j, r:val.r}, temp_val, options);
- }
- } break;
- case 'Formula': {
- if(val.val == 'String') { last_formula = val; break; }
- temp_val = make_cell(val.val, val.cell.ixfe, val.tt);
- temp_val.XF = XFs[temp_val.ixfe];
- if(options.cellFormula) {
- var _f = val.formula;
- if(_f && _f[0] && _f[0][0] && _f[0][0][0] == 'PtgExp') {
- var _fr = _f[0][0][1][0], _fc = _f[0][0][1][1];
- var _fe = encode_cell({r:_fr, c:_fc});
- if(sharedf[_fe]) temp_val.f = ""+stringify_formula(val.formula,range,val.cell,supbooks, opts);
- else temp_val.F = ((options.dense ? (out[_fr]||[])[_fc]: out[_fe]) || {}).F;
- } else temp_val.f = ""+stringify_formula(val.formula,range,val.cell,supbooks, opts);
- }
- if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
- safe_format_xf(temp_val, options, wb.opts.Date1904);
- addcell(val.cell, temp_val, options);
- last_formula = val;
- } break;
- case 'String': {
- if(last_formula) { /* technically always true */
- last_formula.val = val;
- temp_val = make_cell(val, last_formula.cell.ixfe, 's');
- temp_val.XF = XFs[temp_val.ixfe];
- if(options.cellFormula) {
- temp_val.f = ""+stringify_formula(last_formula.formula, range, last_formula.cell, supbooks, opts);
- }
- if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
- safe_format_xf(temp_val, options, wb.opts.Date1904);
- addcell(last_formula.cell, temp_val, options);
- last_formula = null;
- } else throw new Error("String record expects Formula");
- } break;
- case 'Array': {
- arrayf.push(val);
- var _arraystart = encode_cell(val[0].s);
- cc = options.dense ? (out[val[0].s.r]||[])[val[0].s.c] : out[_arraystart];
- if(options.cellFormula && cc) {
- if(!last_formula) break; /* technically unreachable */
- if(!_arraystart || !cc) break;
- cc.f = ""+stringify_formula(val[1], range, val[0], supbooks, opts);
- cc.F = encode_range(val[0]);
- }
- } break;
- case 'ShrFmla': {
- if(!cell_valid) break;
- if(!options.cellFormula) break;
- if(last_cell) {
- /* TODO: capture range */
- if(!last_formula) break; /* technically unreachable */
- sharedf[encode_cell(last_formula.cell)]= val[0];
- cc = options.dense ? (out[last_formula.cell.r]||[])[last_formula.cell.c] : out[encode_cell(last_formula.cell)];
- (cc||{}).f = ""+stringify_formula(val[0], range, lastcell, supbooks, opts);
- }
- } break;
- case 'LabelSst':
- temp_val=make_cell(sst[val.isst].t, val.ixfe, 's');
- if(sst[val.isst].h) temp_val.h = sst[val.isst].h;
- temp_val.XF = XFs[temp_val.ixfe];
- if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
- safe_format_xf(temp_val, options, wb.opts.Date1904);
- addcell({c:val.c, r:val.r}, temp_val, options);
- break;
- case 'Blank': if(options.sheetStubs) {
- temp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe], t:'z'});
- if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
- safe_format_xf(temp_val, options, wb.opts.Date1904);
- addcell({c:val.c, r:val.r}, temp_val, options);
- } break;
- case 'MulBlank': if(options.sheetStubs) {
- for(var _j = val.c; _j <= val.C; ++_j) {
- var _ixfe = val.ixfe[_j-val.c];
- temp_val= ({ixfe:_ixfe, XF:XFs[_ixfe], t:'z'});
- if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
- safe_format_xf(temp_val, options, wb.opts.Date1904);
- addcell({c:_j, r:val.r}, temp_val, options);
- }
- } break;
- case 'RString':
- case 'Label': case 'BIFF2STR':
- temp_val=make_cell(val.val, val.ixfe, 's');
- temp_val.XF = XFs[temp_val.ixfe];
- if(BIFF2Fmt > 0) temp_val.z = BIFF2FmtTable[(temp_val.ixfe>>8) & 0x1F];
- safe_format_xf(temp_val, options, wb.opts.Date1904);
- addcell({c:val.c, r:val.r}, temp_val, options);
- break;
-
- case 'Dimensions': {
- if(file_depth === 1) range = val; /* TODO: stack */
- } break;
- case 'SST': {
- sst = val;
- } break;
- case 'Format': { /* val = [id, fmt] */
- if(opts.biff == 4) {
- BIFF2FmtTable[BIFF2Fmt++] = val[1];
- for(var b4idx = 0; b4idx < BIFF2Fmt + 163; ++b4idx) if(SSF._table[b4idx] == val[1]) break;
- if(b4idx >= 163) SSF.load(val[1], BIFF2Fmt + 163);
- }
- else SSF.load(val[1], val[0]);
- } break;
- case 'BIFF2FORMAT': {
- BIFF2FmtTable[BIFF2Fmt++] = val;
- for(var b2idx = 0; b2idx < BIFF2Fmt + 163; ++b2idx) if(SSF._table[b2idx] == val) break;
- if(b2idx >= 163) SSF.load(val, BIFF2Fmt + 163);
- } break;
-
- case 'MergeCells': merges = merges.concat(val); break;
-
- case 'Obj': objects[val.cmo[0]] = opts.lastobj = val; break;
- case 'TxO': opts.lastobj.TxO = val; break;
- case 'ImData': opts.lastobj.ImData = val; break;
-
- case 'HLink': {
- for(rngR = val[0].s.r; rngR <= val[0].e.r; ++rngR)
- for(rngC = val[0].s.c; rngC <= val[0].e.c; ++rngC) {
- cc = options.dense ? (out[rngR]||[])[rngC] : out[encode_cell({c:rngC,r:rngR})];
- if(cc) cc.l = val[1];
- }
- } break;
- case 'HLinkTooltip': {
- for(rngR = val[0].s.r; rngR <= val[0].e.r; ++rngR)
- for(rngC = val[0].s.c; rngC <= val[0].e.c; ++rngC) {
- cc = options.dense ? (out[rngR]||[])[rngC] : out[encode_cell({c:rngC,r:rngR})];
- if(cc && cc.l) cc.l.Tooltip = val[1];
- }
- } break;
-
- /* Comments */
- case 'Note': {
- if(opts.biff <= 5 && opts.biff >= 2) break; /* TODO: BIFF5 */
- cc = options.dense ? (out[val[0].r]||[])[val[0].c] : out[encode_cell(val[0])];
- var noteobj = objects[val[2]];
- if(!cc) {
- if(options.dense) {
- if(!out[val[0].r]) out[val[0].r] = [];
- cc = out[val[0].r][val[0].c] = ({t:"z"});
- } else {
- cc = out[encode_cell(val[0])] = ({t:"z"});
- }
- range.e.r = Math.max(range.e.r, val[0].r);
- range.s.r = Math.min(range.s.r, val[0].r);
- range.e.c = Math.max(range.e.c, val[0].c);
- range.s.c = Math.min(range.s.c, val[0].c);
- }
- if(!cc.c) cc.c = [];
- cmnt = {a:val[1],t:noteobj.TxO.t};
- cc.c.push(cmnt);
- } break;
-
- default: switch(R.n) { /* nested */
- case 'ClrtClient': break;
- case 'XFExt': update_xfext(XFs[val.ixfe], val.ext); break;
-
- case 'DefColWidth': defwidth = val; break;
- case 'DefaultRowHeight': defheight = val[1]; break; // TODO: flags
-
- case 'ColInfo': {
- if(!opts.cellStyles) break;
- while(val.e >= val.s) {
- colinfo[val.e--] = { width: val.w/256 };
- if(!seencol) { seencol = true; find_mdw_colw(val.w/256); }
- process_col(colinfo[val.e+1]);
- }
- } break;
- case 'Row': {
- var rowobj = {};
- if(val.level != null) { rowinfo[val.r] = rowobj; rowobj.level = val.level; }
- if(val.hidden) { rowinfo[val.r] = rowobj; rowobj.hidden = true; }
- if(val.hpt) {
- rowinfo[val.r] = rowobj;
- rowobj.hpt = val.hpt; rowobj.hpx = pt2px(val.hpt);
- }
- } break;
-
- case 'LeftMargin':
- case 'RightMargin':
- case 'TopMargin':
- case 'BottomMargin':
- if(!out['!margins']) default_margins(out['!margins'] = {});
- out['!margins'][Rn.slice(0,-6).toLowerCase()] = val;
- break;
-
- case 'Setup': // TODO
- if(!out['!margins']) default_margins(out['!margins'] = {});
- out['!margins'].header = val.header;
- out['!margins'].footer = val.footer;
- break;
-
- case 'Window2': // TODO
- // $FlowIgnore
- if(val.RTL) Workbook.Views[0].RTL = true;
- break;
-
- case 'Header': break; // TODO
- case 'Footer': break; // TODO
- case 'HCenter': break; // TODO
- case 'VCenter': break; // TODO
- case 'Pls': break; // TODO
- case 'GCW': break;
- case 'LHRecord': break;
- case 'DBCell': break; // TODO
- case 'EntExU2': break; // TODO
- case 'SxView': break; // TODO
- case 'Sxvd': break; // TODO
- case 'SXVI': break; // TODO
- case 'SXVDEx': break; // TODO
- case 'SxIvd': break; // TODO
- case 'SXString': break; // TODO
- case 'Sync': break;
- case 'Addin': break;
- case 'SXDI': break; // TODO
- case 'SXLI': break; // TODO
- case 'SXEx': break; // TODO
- case 'QsiSXTag': break; // TODO
- case 'Selection': break;
- case 'Feat': break;
- case 'FeatHdr': case 'FeatHdr11': break;
- case 'Feature11': case 'Feature12': case 'List12': break;
- case 'Country': country = val; break;
- case 'RecalcId': break;
- case 'DxGCol': break; // TODO: htmlify
- case 'Fbi': case 'Fbi2': case 'GelFrame': break;
- case 'Font': break; // TODO
- case 'XFCRC': break; // TODO
- case 'Style': break; // TODO
- case 'StyleExt': break; // TODO
- case 'Palette': palette = val; break;
- case 'Theme': themes = val; break;
- /* Protection */
- case 'ScenarioProtect': break;
- case 'ObjProtect': break;
-
- /* Conditional Formatting */
- case 'CondFmt12': break;
-
- /* Table */
- case 'Table': break; // TODO
- case 'TableStyles': break; // TODO
- case 'TableStyle': break; // TODO
- case 'TableStyleElement': break; // TODO
-
- /* PivotTable */
- case 'SXStreamID': break; // TODO
- case 'SXVS': break; // TODO
- case 'DConRef': break; // TODO
- case 'SXAddl': break; // TODO
- case 'DConBin': break; // TODO
- case 'DConName': break; // TODO
- case 'SXPI': break; // TODO
- case 'SxFormat': break; // TODO
- case 'SxSelect': break; // TODO
- case 'SxRule': break; // TODO
- case 'SxFilt': break; // TODO
- case 'SxItm': break; // TODO
- case 'SxDXF': break; // TODO
-
- /* Scenario Manager */
- case 'ScenMan': break;
-
- /* Data Consolidation */
- case 'DCon': break;
-
- /* Watched Cell */
- case 'CellWatch': break;
-
- /* Print Settings */
- case 'PrintRowCol': break;
- case 'PrintGrid': break;
- case 'PrintSize': break;
-
- case 'XCT': break;
- case 'CRN': break;
-
- case 'Scl': {
- //console.log("Zoom Level:", val[0]/val[1],val);
- } break;
- case 'SheetExt': {
- /* empty */
- } break;
- case 'SheetExtOptional': {
- /* empty */
- } break;
-
- /* VBA */
- case 'ObNoMacros': {
- /* empty */
- } break;
- case 'ObProj': {
- /* empty */
- } break;
- case 'CodeName': {
- if(!cur_sheet) Workbook.WBProps.CodeName = val || "ThisWorkbook";
- else wsprops.CodeName = val || wsprops.name;
- } break;
- case 'GUIDTypeLib': {
- /* empty */
- } break;
-
- case 'WOpt': break; // TODO: WTF?
- case 'PhoneticInfo': break;
-
- case 'OleObjectSize': break;
-
- /* Differential Formatting */
- case 'DXF': case 'DXFN': case 'DXFN12': case 'DXFN12List': case 'DXFN12NoCB': break;
-
- /* Data Validation */
- case 'Dv': case 'DVal': break;
-
- /* Data Series */
- case 'BRAI': case 'Series': case 'SeriesText': break;
-
- /* Data Connection */
- case 'DConn': break;
- case 'DbOrParamQry': break;
- case 'DBQueryExt': break;
-
- case 'OleDbConn': break;
- case 'ExtString': break;
-
- /* Formatting */
- case 'IFmtRecord': break;
- case 'CondFmt': case 'CF': case 'CF12': case 'CFEx': break;
-
- /* Explicitly Ignored */
- case 'Excel9File': break;
- case 'Units': break;
- case 'InterfaceHdr': case 'Mms': case 'InterfaceEnd': case 'DSF': break;
- case 'BuiltInFnGroupCount': /* 2.4.30 0x0E or 0x10 but excel 2011 generates 0x11? */ break;
- /* View Stuff */
- case 'Window1': case 'HideObj': case 'GridSet': case 'Guts':
- case 'UserBView': case 'UserSViewBegin': case 'UserSViewEnd': break;
- case 'Pane': break;
- default: switch(R.n) { /* nested */
- /* Chart */
- case 'Dat':
- case 'Begin': case 'End':
- case 'StartBlock': case 'EndBlock':
- case 'Frame': case 'Area':
- case 'Axis': case 'AxisLine': case 'Tick': break;
- case 'AxesUsed':
- case 'CrtLayout12': case 'CrtLayout12A': case 'CrtLink': case 'CrtLine': case 'CrtMlFrt': case 'CrtMlFrtContinue': break;
- case 'LineFormat': case 'AreaFormat':
- case 'Chart': case 'Chart3d': case 'Chart3DBarShape': case 'ChartFormat': case 'ChartFrtInfo': break;
- case 'PlotArea': case 'PlotGrowth': break;
- case 'SeriesList': case 'SerParent': case 'SerAuxTrend': break;
- case 'DataFormat': case 'SerToCrt': case 'FontX': break;
- case 'CatSerRange': case 'AxcExt': case 'SerFmt': break;
- case 'ShtProps': break;
- case 'DefaultText': case 'Text': case 'CatLab': break;
- case 'DataLabExtContents': break;
- case 'Legend': case 'LegendException': break;
- case 'Pie': case 'Scatter': break;
- case 'PieFormat': case 'MarkerFormat': break;
- case 'StartObject': case 'EndObject': break;
- case 'AlRuns': case 'ObjectLink': break;
- case 'SIIndex': break;
- case 'AttachedLabel': case 'YMult': break;
-
- /* Chart Group */
- case 'Line': case 'Bar': break;
- case 'Surf': break;
-
- /* Axis Group */
- case 'AxisParent': break;
- case 'Pos': break;
- case 'ValueRange': break;
-
- /* Pivot Chart */
- case 'SXViewEx9': break; // TODO
- case 'SXViewLink': break;
- case 'PivotChartBits': break;
- case 'SBaseRef': break;
- case 'TextPropsStream': break;
-
- /* Chart Misc */
- case 'LnExt': break;
- case 'MkrExt': break;
- case 'CrtCoopt': break;
-
- /* Query Table */
- case 'Qsi': case 'Qsif': case 'Qsir': case 'QsiSXTag': break;
- case 'TxtQry': break;
-
- /* Filter */
- case 'FilterMode': break;
- case 'AutoFilter': case 'AutoFilterInfo': break;
- case 'AutoFilter12': break;
- case 'DropDownObjIds': break;
- case 'Sort': break;
- case 'SortData': break;
-
- /* Drawing */
- case 'ShapePropsStream': break;
- case 'MsoDrawing': case 'MsoDrawingGroup': case 'MsoDrawingSelection': break;
- /* Pub Stuff */
- case 'WebPub': case 'AutoWebPub': break;
-
- /* Print Stuff */
- case 'HeaderFooter': case 'HFPicture': case 'PLV':
- case 'HorizontalPageBreaks': case 'VerticalPageBreaks': break;
- /* Behavioral */
- case 'Backup': case 'CompressPictures': case 'Compat12': break;
-
- /* Should not Happen */
- case 'Continue': case 'ContinueFrt12': break;
-
- /* Future Records */
- case 'FrtFontList': case 'FrtWrapper': break;
-
- default: switch(R.n) { /* nested */
- /* BIFF5 records */
- case 'TabIdConf': case 'Radar': case 'RadarArea': case 'DropBar': case 'Intl': case 'CoordList': case 'SerAuxErrBar': break;
-
- /* BIFF2-4 records */
- case 'BIFF2FONTCLR': case 'BIFF2FMTCNT': case 'BIFF2FONTXTRA': break;
- case 'BIFF2XF': case 'BIFF3XF': case 'BIFF4XF': break;
- case 'BIFF4FMTCNT': case 'BIFF2ROW': case 'BIFF2WINDOW2': break;
-
- /* Miscellaneous */
- case 'SCENARIO': case 'DConBin': case 'PicF': case 'DataLabExt':
- case 'Lel': case 'BopPop': case 'BopPopCustom': case 'RealTimeData':
- case 'Name': break;
- case 'LHNGraph': case 'FnGroupName': case 'AddMenu': case 'LPr': break;
- case 'ListObj': case 'ListField': break;
- case 'RRSort': break;
- case 'BigName': break;
- case 'ToolbarHdr': case 'ToolbarEnd': break;
- case 'DDEObjName': break;
- case 'FRTArchId$': break;
- default: if(options.WTF) throw 'Unrecognized Record ' + R.n;
- }}}}
- } else blob.l += length;
- }
- wb.SheetNames=keys(Directory).sort(function(a,b) { return Number(a) - Number(b); }).map(function(x){return Directory[x].name;});
- if(!options.bookSheets) wb.Sheets=Sheets;
- if(wb.Sheets) FilterDatabases.forEach(function(r,i) { wb.Sheets[wb.SheetNames[i]]['!autofilter'] = r; });
- wb.Preamble=Preamble;
- wb.Strings = sst;
- wb.SSF = SSF.get_table();
- if(opts.enc) wb.Encryption = opts.enc;
- if(themes) wb.Themes = themes;
- wb.Metadata = {};
- if(country !== undefined) wb.Metadata.Country = country;
- if(supbooks.names.length > 0) Workbook.Names = supbooks.names;
- wb.Workbook = Workbook;
- return wb;
- }
-
- /* TODO: split props*/
- var PSCLSID = {
- SI: "e0859ff2f94f6810ab9108002b27b3d9",
- DSI: "02d5cdd59c2e1b10939708002b2cf9ae",
- UDI: "05d5cdd59c2e1b10939708002b2cf9ae"
- };
- function parse_xls_props(cfb, props, o) {
- /* [MS-OSHARED] 2.3.3.2.2 Document Summary Information Property Set */
- var DSI = CFB.find(cfb, '!DocumentSummaryInformation');
- if(DSI && DSI.size > 0) try {
- var DocSummary = parse_PropertySetStream(DSI, DocSummaryPIDDSI, PSCLSID.DSI);
- for(var d in DocSummary) props[d] = DocSummary[d];
- } catch(e) {if(o.WTF) throw e;/* empty */}
-
- /* [MS-OSHARED] 2.3.3.2.1 Summary Information Property Set*/
- var SI = CFB.find(cfb, '!SummaryInformation');
- if(SI && SI.size > 0) try {
- var Summary = parse_PropertySetStream(SI, SummaryPIDSI, PSCLSID.SI);
- for(var s in Summary) if(props[s] == null) props[s] = Summary[s];
- } catch(e) {if(o.WTF) throw e;/* empty */}
-
- if(props.HeadingPairs && props.TitlesOfParts) {
- load_props_pairs(props.HeadingPairs, props.TitlesOfParts, props, o);
- delete props.HeadingPairs; delete props.TitlesOfParts;
- }
- }
- function write_xls_props(wb, cfb) {
- var DSEntries = [], SEntries = [], CEntries = [];
- var i = 0, Keys;
- if(wb.Props) {
- Keys = keys(wb.Props);
- // $FlowIgnore
- for(i = 0; i < Keys.length; ++i) (DocSummaryRE.hasOwnProperty(Keys[i]) ? DSEntries : SummaryRE.hasOwnProperty(Keys[i]) ? SEntries : CEntries).push([Keys[i], wb.Props[Keys[i]]]);
- }
- if(wb.Custprops) {
- Keys = keys(wb.Custprops);
- // $FlowIgnore
- for(i = 0; i < Keys.length; ++i) if(!(wb.Props||{}).hasOwnProperty(Keys[i])) (DocSummaryRE.hasOwnProperty(Keys[i]) ? DSEntries : SummaryRE.hasOwnProperty(Keys[i]) ? SEntries : CEntries).push([Keys[i], wb.Custprops[Keys[i]]]);
- }
- var CEntries2 = [];
- for(i = 0; i < CEntries.length; ++i) {
- if(XLSPSSkip.indexOf(CEntries[i][0]) > -1) continue;
- if(CEntries[i][1] == null) continue;
- CEntries2.push(CEntries[i]);
- }
- if(SEntries.length) CFB.utils.cfb_add(cfb, "/\u0005SummaryInformation", write_PropertySetStream(SEntries, PSCLSID.SI, SummaryRE, SummaryPIDSI));
- if(DSEntries.length || CEntries2.length) CFB.utils.cfb_add(cfb, "/\u0005DocumentSummaryInformation", write_PropertySetStream(DSEntries, PSCLSID.DSI, DocSummaryRE, DocSummaryPIDDSI, CEntries2.length ? CEntries2 : null, PSCLSID.UDI));
- }
-
- function parse_xlscfb(cfb, options) {
- if(!options) options = {};
- fix_read_opts(options);
- reset_cp();
- if(options.codepage) set_ansi(options.codepage);
- var CompObj, WB;
- if(cfb.FullPaths) {
- if(CFB.find(cfb, '/encryption')) throw new Error("File is password-protected");
- CompObj = CFB.find(cfb, '!CompObj');
- WB = CFB.find(cfb, '/Workbook') || CFB.find(cfb, '/Book');
- } else {
- switch(options.type) {
- case 'base64': cfb = s2a(Base64.decode(cfb)); break;
- case 'binary': cfb = s2a(cfb); break;
- case 'buffer': break;
- case 'array': if(!Array.isArray(cfb)) cfb = Array.prototype.slice.call(cfb); break;
- }
- prep_blob(cfb, 0);
- WB = ({content: cfb});
- }
- var WorkbookP;
-
- var _data;
- if(CompObj) parse_compobj(CompObj);
- if(options.bookProps && !options.bookSheets) WorkbookP = ({});
- else {
- var T = has_buf ? 'buffer' : 'array';
- if(WB && WB.content) WorkbookP = parse_workbook(WB.content, options);
- /* Quattro Pro 7-8 */
- else if((_data=CFB.find(cfb, 'PerfectOffice_MAIN')) && _data.content) WorkbookP = WK_.to_workbook(_data.content, (options.type = T, options));
- /* Quattro Pro 9 */
- else if((_data=CFB.find(cfb, 'NativeContent_MAIN')) && _data.content) WorkbookP = WK_.to_workbook(_data.content, (options.type = T, options));
- else throw new Error("Cannot find Workbook stream");
- if(options.bookVBA && cfb.FullPaths && CFB.find(cfb, '/_VBA_PROJECT_CUR/VBA/dir')) WorkbookP.vbaraw = make_vba_xls(cfb);
- }
-
- var props = {};
- if(cfb.FullPaths) parse_xls_props(cfb, props, options);
-
- WorkbookP.Props = WorkbookP.Custprops = props; /* TODO: split up properties */
- if(options.bookFiles) WorkbookP.cfb = cfb;
- /*WorkbookP.CompObjP = CompObjP; // TODO: storage? */
- return WorkbookP;
- }
-
-
- function write_xlscfb(wb, opts) {
- var o = opts || {};
- var cfb = CFB.utils.cfb_new({root:"R"});
- var wbpath = "/Workbook";
- switch(o.bookType || "xls") {
- case "xls": o.bookType = "biff8";
- /* falls through */
- case "xla": if(!o.bookType) o.bookType = "xla";
- /* falls through */
- case "biff8": wbpath = "/Workbook"; o.biff = 8; break;
- case "biff5": wbpath = "/Book"; o.biff = 5; break;
- default: throw new Error("invalid type " + o.bookType + " for XLS CFB");
- }
- CFB.utils.cfb_add(cfb, wbpath, write_biff_buf(wb, o));
- if(o.biff == 8 && (wb.Props || wb.Custprops)) write_xls_props(wb, cfb);
- // TODO: SI, DSI, CO
- if(o.biff == 8 && wb.vbaraw) fill_vba_xls(cfb, CFB.read(wb.vbaraw, {type: typeof wb.vbaraw == "string" ? "binary" : "buffer"}));
- return cfb;
- }
- /* [MS-XLSB] 2.3 Record Enumeration */
- var XLSBRecordEnum = {
- 0x0000: { n:"BrtRowHdr", f:parse_BrtRowHdr },
- 0x0001: { n:"BrtCellBlank", f:parse_BrtCellBlank },
- 0x0002: { n:"BrtCellRk", f:parse_BrtCellRk },
- 0x0003: { n:"BrtCellError", f:parse_BrtCellError },
- 0x0004: { n:"BrtCellBool", f:parse_BrtCellBool },
- 0x0005: { n:"BrtCellReal", f:parse_BrtCellReal },
- 0x0006: { n:"BrtCellSt", f:parse_BrtCellSt },
- 0x0007: { n:"BrtCellIsst", f:parse_BrtCellIsst },
- 0x0008: { n:"BrtFmlaString", f:parse_BrtFmlaString },
- 0x0009: { n:"BrtFmlaNum", f:parse_BrtFmlaNum },
- 0x000A: { n:"BrtFmlaBool", f:parse_BrtFmlaBool },
- 0x000B: { n:"BrtFmlaError", f:parse_BrtFmlaError },
- 0x0010: { n:"BrtFRTArchID$", f:parse_BrtFRTArchID$ },
- 0x0013: { n:"BrtSSTItem", f:parse_RichStr },
- 0x0014: { n:"BrtPCDIMissing" },
- 0x0015: { n:"BrtPCDINumber" },
- 0x0016: { n:"BrtPCDIBoolean" },
- 0x0017: { n:"BrtPCDIError" },
- 0x0018: { n:"BrtPCDIString" },
- 0x0019: { n:"BrtPCDIDatetime" },
- 0x001A: { n:"BrtPCDIIndex" },
- 0x001B: { n:"BrtPCDIAMissing" },
- 0x001C: { n:"BrtPCDIANumber" },
- 0x001D: { n:"BrtPCDIABoolean" },
- 0x001E: { n:"BrtPCDIAError" },
- 0x001F: { n:"BrtPCDIAString" },
- 0x0020: { n:"BrtPCDIADatetime" },
- 0x0021: { n:"BrtPCRRecord" },
- 0x0022: { n:"BrtPCRRecordDt" },
- 0x0023: { n:"BrtFRTBegin" },
- 0x0024: { n:"BrtFRTEnd" },
- 0x0025: { n:"BrtACBegin" },
- 0x0026: { n:"BrtACEnd" },
- 0x0027: { n:"BrtName", f:parse_BrtName },
- 0x0028: { n:"BrtIndexRowBlock" },
- 0x002A: { n:"BrtIndexBlock" },
- 0x002B: { n:"BrtFont", f:parse_BrtFont },
- 0x002C: { n:"BrtFmt", f:parse_BrtFmt },
- 0x002D: { n:"BrtFill", f:parse_BrtFill },
- 0x002E: { n:"BrtBorder", f:parse_BrtBorder },
- 0x002F: { n:"BrtXF", f:parse_BrtXF },
- 0x0030: { n:"BrtStyle" },
- 0x0031: { n:"BrtCellMeta" },
- 0x0032: { n:"BrtValueMeta" },
- 0x0033: { n:"BrtMdb" },
- 0x0034: { n:"BrtBeginFmd" },
- 0x0035: { n:"BrtEndFmd" },
- 0x0036: { n:"BrtBeginMdx" },
- 0x0037: { n:"BrtEndMdx" },
- 0x0038: { n:"BrtBeginMdxTuple" },
- 0x0039: { n:"BrtEndMdxTuple" },
- 0x003A: { n:"BrtMdxMbrIstr" },
- 0x003B: { n:"BrtStr" },
- 0x003C: { n:"BrtColInfo", f:parse_ColInfo },
- 0x003E: { n:"BrtCellRString" },
- 0x003F: { n:"BrtCalcChainItem$", f:parse_BrtCalcChainItem$ },
- 0x0040: { n:"BrtDVal", f:parse_BrtDVal },
- 0x0041: { n:"BrtSxvcellNum" },
- 0x0042: { n:"BrtSxvcellStr" },
- 0x0043: { n:"BrtSxvcellBool" },
- 0x0044: { n:"BrtSxvcellErr" },
- 0x0045: { n:"BrtSxvcellDate" },
- 0x0046: { n:"BrtSxvcellNil" },
- 0x0080: { n:"BrtFileVersion" },
- 0x0081: { n:"BrtBeginSheet" },
- 0x0082: { n:"BrtEndSheet" },
- 0x0083: { n:"BrtBeginBook", f:parsenoop, p:0 },
- 0x0084: { n:"BrtEndBook" },
- 0x0085: { n:"BrtBeginWsViews" },
- 0x0086: { n:"BrtEndWsViews" },
- 0x0087: { n:"BrtBeginBookViews" },
- 0x0088: { n:"BrtEndBookViews" },
- 0x0089: { n:"BrtBeginWsView", f:parse_BrtBeginWsView },
- 0x008A: { n:"BrtEndWsView" },
- 0x008B: { n:"BrtBeginCsViews" },
- 0x008C: { n:"BrtEndCsViews" },
- 0x008D: { n:"BrtBeginCsView" },
- 0x008E: { n:"BrtEndCsView" },
- 0x008F: { n:"BrtBeginBundleShs" },
- 0x0090: { n:"BrtEndBundleShs" },
- 0x0091: { n:"BrtBeginSheetData" },
- 0x0092: { n:"BrtEndSheetData" },
- 0x0093: { n:"BrtWsProp", f:parse_BrtWsProp },
- 0x0094: { n:"BrtWsDim", f:parse_BrtWsDim, p:16 },
- 0x0097: { n:"BrtPane", f:parse_BrtPane },
- 0x0098: { n:"BrtSel" },
- 0x0099: { n:"BrtWbProp", f:parse_BrtWbProp },
- 0x009A: { n:"BrtWbFactoid" },
- 0x009B: { n:"BrtFileRecover" },
- 0x009C: { n:"BrtBundleSh", f:parse_BrtBundleSh },
- 0x009D: { n:"BrtCalcProp" },
- 0x009E: { n:"BrtBookView" },
- 0x009F: { n:"BrtBeginSst", f:parse_BrtBeginSst },
- 0x00A0: { n:"BrtEndSst" },
- 0x00A1: { n:"BrtBeginAFilter", f:parse_UncheckedRfX },
- 0x00A2: { n:"BrtEndAFilter" },
- 0x00A3: { n:"BrtBeginFilterColumn" },
- 0x00A4: { n:"BrtEndFilterColumn" },
- 0x00A5: { n:"BrtBeginFilters" },
- 0x00A6: { n:"BrtEndFilters" },
- 0x00A7: { n:"BrtFilter" },
- 0x00A8: { n:"BrtColorFilter" },
- 0x00A9: { n:"BrtIconFilter" },
- 0x00AA: { n:"BrtTop10Filter" },
- 0x00AB: { n:"BrtDynamicFilter" },
- 0x00AC: { n:"BrtBeginCustomFilters" },
- 0x00AD: { n:"BrtEndCustomFilters" },
- 0x00AE: { n:"BrtCustomFilter" },
- 0x00AF: { n:"BrtAFilterDateGroupItem" },
- 0x00B0: { n:"BrtMergeCell", f:parse_BrtMergeCell },
- 0x00B1: { n:"BrtBeginMergeCells" },
- 0x00B2: { n:"BrtEndMergeCells" },
- 0x00B3: { n:"BrtBeginPivotCacheDef" },
- 0x00B4: { n:"BrtEndPivotCacheDef" },
- 0x00B5: { n:"BrtBeginPCDFields" },
- 0x00B6: { n:"BrtEndPCDFields" },
- 0x00B7: { n:"BrtBeginPCDField" },
- 0x00B8: { n:"BrtEndPCDField" },
- 0x00B9: { n:"BrtBeginPCDSource" },
- 0x00BA: { n:"BrtEndPCDSource" },
- 0x00BB: { n:"BrtBeginPCDSRange" },
- 0x00BC: { n:"BrtEndPCDSRange" },
- 0x00BD: { n:"BrtBeginPCDFAtbl" },
- 0x00BE: { n:"BrtEndPCDFAtbl" },
- 0x00BF: { n:"BrtBeginPCDIRun" },
- 0x00C0: { n:"BrtEndPCDIRun" },
- 0x00C1: { n:"BrtBeginPivotCacheRecords" },
- 0x00C2: { n:"BrtEndPivotCacheRecords" },
- 0x00C3: { n:"BrtBeginPCDHierarchies" },
- 0x00C4: { n:"BrtEndPCDHierarchies" },
- 0x00C5: { n:"BrtBeginPCDHierarchy" },
- 0x00C6: { n:"BrtEndPCDHierarchy" },
- 0x00C7: { n:"BrtBeginPCDHFieldsUsage" },
- 0x00C8: { n:"BrtEndPCDHFieldsUsage" },
- 0x00C9: { n:"BrtBeginExtConnection" },
- 0x00CA: { n:"BrtEndExtConnection" },
- 0x00CB: { n:"BrtBeginECDbProps" },
- 0x00CC: { n:"BrtEndECDbProps" },
- 0x00CD: { n:"BrtBeginECOlapProps" },
- 0x00CE: { n:"BrtEndECOlapProps" },
- 0x00CF: { n:"BrtBeginPCDSConsol" },
- 0x00D0: { n:"BrtEndPCDSConsol" },
- 0x00D1: { n:"BrtBeginPCDSCPages" },
- 0x00D2: { n:"BrtEndPCDSCPages" },
- 0x00D3: { n:"BrtBeginPCDSCPage" },
- 0x00D4: { n:"BrtEndPCDSCPage" },
- 0x00D5: { n:"BrtBeginPCDSCPItem" },
- 0x00D6: { n:"BrtEndPCDSCPItem" },
- 0x00D7: { n:"BrtBeginPCDSCSets" },
- 0x00D8: { n:"BrtEndPCDSCSets" },
- 0x00D9: { n:"BrtBeginPCDSCSet" },
- 0x00DA: { n:"BrtEndPCDSCSet" },
- 0x00DB: { n:"BrtBeginPCDFGroup" },
- 0x00DC: { n:"BrtEndPCDFGroup" },
- 0x00DD: { n:"BrtBeginPCDFGItems" },
- 0x00DE: { n:"BrtEndPCDFGItems" },
- 0x00DF: { n:"BrtBeginPCDFGRange" },
- 0x00E0: { n:"BrtEndPCDFGRange" },
- 0x00E1: { n:"BrtBeginPCDFGDiscrete" },
- 0x00E2: { n:"BrtEndPCDFGDiscrete" },
- 0x00E3: { n:"BrtBeginPCDSDTupleCache" },
- 0x00E4: { n:"BrtEndPCDSDTupleCache" },
- 0x00E5: { n:"BrtBeginPCDSDTCEntries" },
- 0x00E6: { n:"BrtEndPCDSDTCEntries" },
- 0x00E7: { n:"BrtBeginPCDSDTCEMembers" },
- 0x00E8: { n:"BrtEndPCDSDTCEMembers" },
- 0x00E9: { n:"BrtBeginPCDSDTCEMember" },
- 0x00EA: { n:"BrtEndPCDSDTCEMember" },
- 0x00EB: { n:"BrtBeginPCDSDTCQueries" },
- 0x00EC: { n:"BrtEndPCDSDTCQueries" },
- 0x00ED: { n:"BrtBeginPCDSDTCQuery" },
- 0x00EE: { n:"BrtEndPCDSDTCQuery" },
- 0x00EF: { n:"BrtBeginPCDSDTCSets" },
- 0x00F0: { n:"BrtEndPCDSDTCSets" },
- 0x00F1: { n:"BrtBeginPCDSDTCSet" },
- 0x00F2: { n:"BrtEndPCDSDTCSet" },
- 0x00F3: { n:"BrtBeginPCDCalcItems" },
- 0x00F4: { n:"BrtEndPCDCalcItems" },
- 0x00F5: { n:"BrtBeginPCDCalcItem" },
- 0x00F6: { n:"BrtEndPCDCalcItem" },
- 0x00F7: { n:"BrtBeginPRule" },
- 0x00F8: { n:"BrtEndPRule" },
- 0x00F9: { n:"BrtBeginPRFilters" },
- 0x00FA: { n:"BrtEndPRFilters" },
- 0x00FB: { n:"BrtBeginPRFilter" },
- 0x00FC: { n:"BrtEndPRFilter" },
- 0x00FD: { n:"BrtBeginPNames" },
- 0x00FE: { n:"BrtEndPNames" },
- 0x00FF: { n:"BrtBeginPName" },
- 0x0100: { n:"BrtEndPName" },
- 0x0101: { n:"BrtBeginPNPairs" },
- 0x0102: { n:"BrtEndPNPairs" },
- 0x0103: { n:"BrtBeginPNPair" },
- 0x0104: { n:"BrtEndPNPair" },
- 0x0105: { n:"BrtBeginECWebProps" },
- 0x0106: { n:"BrtEndECWebProps" },
- 0x0107: { n:"BrtBeginEcWpTables" },
- 0x0108: { n:"BrtEndECWPTables" },
- 0x0109: { n:"BrtBeginECParams" },
- 0x010A: { n:"BrtEndECParams" },
- 0x010B: { n:"BrtBeginECParam" },
- 0x010C: { n:"BrtEndECParam" },
- 0x010D: { n:"BrtBeginPCDKPIs" },
- 0x010E: { n:"BrtEndPCDKPIs" },
- 0x010F: { n:"BrtBeginPCDKPI" },
- 0x0110: { n:"BrtEndPCDKPI" },
- 0x0111: { n:"BrtBeginDims" },
- 0x0112: { n:"BrtEndDims" },
- 0x0113: { n:"BrtBeginDim" },
- 0x0114: { n:"BrtEndDim" },
- 0x0115: { n:"BrtIndexPartEnd" },
- 0x0116: { n:"BrtBeginStyleSheet" },
- 0x0117: { n:"BrtEndStyleSheet" },
- 0x0118: { n:"BrtBeginSXView" },
- 0x0119: { n:"BrtEndSXVI" },
- 0x011A: { n:"BrtBeginSXVI" },
- 0x011B: { n:"BrtBeginSXVIs" },
- 0x011C: { n:"BrtEndSXVIs" },
- 0x011D: { n:"BrtBeginSXVD" },
- 0x011E: { n:"BrtEndSXVD" },
- 0x011F: { n:"BrtBeginSXVDs" },
- 0x0120: { n:"BrtEndSXVDs" },
- 0x0121: { n:"BrtBeginSXPI" },
- 0x0122: { n:"BrtEndSXPI" },
- 0x0123: { n:"BrtBeginSXPIs" },
- 0x0124: { n:"BrtEndSXPIs" },
- 0x0125: { n:"BrtBeginSXDI" },
- 0x0126: { n:"BrtEndSXDI" },
- 0x0127: { n:"BrtBeginSXDIs" },
- 0x0128: { n:"BrtEndSXDIs" },
- 0x0129: { n:"BrtBeginSXLI" },
- 0x012A: { n:"BrtEndSXLI" },
- 0x012B: { n:"BrtBeginSXLIRws" },
- 0x012C: { n:"BrtEndSXLIRws" },
- 0x012D: { n:"BrtBeginSXLICols" },
- 0x012E: { n:"BrtEndSXLICols" },
- 0x012F: { n:"BrtBeginSXFormat" },
- 0x0130: { n:"BrtEndSXFormat" },
- 0x0131: { n:"BrtBeginSXFormats" },
- 0x0132: { n:"BrtEndSxFormats" },
- 0x0133: { n:"BrtBeginSxSelect" },
- 0x0134: { n:"BrtEndSxSelect" },
- 0x0135: { n:"BrtBeginISXVDRws" },
- 0x0136: { n:"BrtEndISXVDRws" },
- 0x0137: { n:"BrtBeginISXVDCols" },
- 0x0138: { n:"BrtEndISXVDCols" },
- 0x0139: { n:"BrtEndSXLocation" },
- 0x013A: { n:"BrtBeginSXLocation" },
- 0x013B: { n:"BrtEndSXView" },
- 0x013C: { n:"BrtBeginSXTHs" },
- 0x013D: { n:"BrtEndSXTHs" },
- 0x013E: { n:"BrtBeginSXTH" },
- 0x013F: { n:"BrtEndSXTH" },
- 0x0140: { n:"BrtBeginISXTHRws" },
- 0x0141: { n:"BrtEndISXTHRws" },
- 0x0142: { n:"BrtBeginISXTHCols" },
- 0x0143: { n:"BrtEndISXTHCols" },
- 0x0144: { n:"BrtBeginSXTDMPS" },
- 0x0145: { n:"BrtEndSXTDMPs" },
- 0x0146: { n:"BrtBeginSXTDMP" },
- 0x0147: { n:"BrtEndSXTDMP" },
- 0x0148: { n:"BrtBeginSXTHItems" },
- 0x0149: { n:"BrtEndSXTHItems" },
- 0x014A: { n:"BrtBeginSXTHItem" },
- 0x014B: { n:"BrtEndSXTHItem" },
- 0x014C: { n:"BrtBeginMetadata" },
- 0x014D: { n:"BrtEndMetadata" },
- 0x014E: { n:"BrtBeginEsmdtinfo" },
- 0x014F: { n:"BrtMdtinfo" },
- 0x0150: { n:"BrtEndEsmdtinfo" },
- 0x0151: { n:"BrtBeginEsmdb" },
- 0x0152: { n:"BrtEndEsmdb" },
- 0x0153: { n:"BrtBeginEsfmd" },
- 0x0154: { n:"BrtEndEsfmd" },
- 0x0155: { n:"BrtBeginSingleCells" },
- 0x0156: { n:"BrtEndSingleCells" },
- 0x0157: { n:"BrtBeginList" },
- 0x0158: { n:"BrtEndList" },
- 0x0159: { n:"BrtBeginListCols" },
- 0x015A: { n:"BrtEndListCols" },
- 0x015B: { n:"BrtBeginListCol" },
- 0x015C: { n:"BrtEndListCol" },
- 0x015D: { n:"BrtBeginListXmlCPr" },
- 0x015E: { n:"BrtEndListXmlCPr" },
- 0x015F: { n:"BrtListCCFmla" },
- 0x0160: { n:"BrtListTrFmla" },
- 0x0161: { n:"BrtBeginExternals" },
- 0x0162: { n:"BrtEndExternals" },
- 0x0163: { n:"BrtSupBookSrc", f:parse_RelID},
- 0x0165: { n:"BrtSupSelf" },
- 0x0166: { n:"BrtSupSame" },
- 0x0167: { n:"BrtSupTabs" },
- 0x0168: { n:"BrtBeginSupBook" },
- 0x0169: { n:"BrtPlaceholderName" },
- 0x016A: { n:"BrtExternSheet", f:parse_ExternSheet },
- 0x016B: { n:"BrtExternTableStart" },
- 0x016C: { n:"BrtExternTableEnd" },
- 0x016E: { n:"BrtExternRowHdr" },
- 0x016F: { n:"BrtExternCellBlank" },
- 0x0170: { n:"BrtExternCellReal" },
- 0x0171: { n:"BrtExternCellBool" },
- 0x0172: { n:"BrtExternCellError" },
- 0x0173: { n:"BrtExternCellString" },
- 0x0174: { n:"BrtBeginEsmdx" },
- 0x0175: { n:"BrtEndEsmdx" },
- 0x0176: { n:"BrtBeginMdxSet" },
- 0x0177: { n:"BrtEndMdxSet" },
- 0x0178: { n:"BrtBeginMdxMbrProp" },
- 0x0179: { n:"BrtEndMdxMbrProp" },
- 0x017A: { n:"BrtBeginMdxKPI" },
- 0x017B: { n:"BrtEndMdxKPI" },
- 0x017C: { n:"BrtBeginEsstr" },
- 0x017D: { n:"BrtEndEsstr" },
- 0x017E: { n:"BrtBeginPRFItem" },
- 0x017F: { n:"BrtEndPRFItem" },
- 0x0180: { n:"BrtBeginPivotCacheIDs" },
- 0x0181: { n:"BrtEndPivotCacheIDs" },
- 0x0182: { n:"BrtBeginPivotCacheID" },
- 0x0183: { n:"BrtEndPivotCacheID" },
- 0x0184: { n:"BrtBeginISXVIs" },
- 0x0185: { n:"BrtEndISXVIs" },
- 0x0186: { n:"BrtBeginColInfos" },
- 0x0187: { n:"BrtEndColInfos" },
- 0x0188: { n:"BrtBeginRwBrk" },
- 0x0189: { n:"BrtEndRwBrk" },
- 0x018A: { n:"BrtBeginColBrk" },
- 0x018B: { n:"BrtEndColBrk" },
- 0x018C: { n:"BrtBrk" },
- 0x018D: { n:"BrtUserBookView" },
- 0x018E: { n:"BrtInfo" },
- 0x018F: { n:"BrtCUsr" },
- 0x0190: { n:"BrtUsr" },
- 0x0191: { n:"BrtBeginUsers" },
- 0x0193: { n:"BrtEOF" },
- 0x0194: { n:"BrtUCR" },
- 0x0195: { n:"BrtRRInsDel" },
- 0x0196: { n:"BrtRREndInsDel" },
- 0x0197: { n:"BrtRRMove" },
- 0x0198: { n:"BrtRREndMove" },
- 0x0199: { n:"BrtRRChgCell" },
- 0x019A: { n:"BrtRREndChgCell" },
- 0x019B: { n:"BrtRRHeader" },
- 0x019C: { n:"BrtRRUserView" },
- 0x019D: { n:"BrtRRRenSheet" },
- 0x019E: { n:"BrtRRInsertSh" },
- 0x019F: { n:"BrtRRDefName" },
- 0x01A0: { n:"BrtRRNote" },
- 0x01A1: { n:"BrtRRConflict" },
- 0x01A2: { n:"BrtRRTQSIF" },
- 0x01A3: { n:"BrtRRFormat" },
- 0x01A4: { n:"BrtRREndFormat" },
- 0x01A5: { n:"BrtRRAutoFmt" },
- 0x01A6: { n:"BrtBeginUserShViews" },
- 0x01A7: { n:"BrtBeginUserShView" },
- 0x01A8: { n:"BrtEndUserShView" },
- 0x01A9: { n:"BrtEndUserShViews" },
- 0x01AA: { n:"BrtArrFmla", f:parse_BrtArrFmla },
- 0x01AB: { n:"BrtShrFmla", f:parse_BrtShrFmla },
- 0x01AC: { n:"BrtTable" },
- 0x01AD: { n:"BrtBeginExtConnections" },
- 0x01AE: { n:"BrtEndExtConnections" },
- 0x01AF: { n:"BrtBeginPCDCalcMems" },
- 0x01B0: { n:"BrtEndPCDCalcMems" },
- 0x01B1: { n:"BrtBeginPCDCalcMem" },
- 0x01B2: { n:"BrtEndPCDCalcMem" },
- 0x01B3: { n:"BrtBeginPCDHGLevels" },
- 0x01B4: { n:"BrtEndPCDHGLevels" },
- 0x01B5: { n:"BrtBeginPCDHGLevel" },
- 0x01B6: { n:"BrtEndPCDHGLevel" },
- 0x01B7: { n:"BrtBeginPCDHGLGroups" },
- 0x01B8: { n:"BrtEndPCDHGLGroups" },
- 0x01B9: { n:"BrtBeginPCDHGLGroup" },
- 0x01BA: { n:"BrtEndPCDHGLGroup" },
- 0x01BB: { n:"BrtBeginPCDHGLGMembers" },
- 0x01BC: { n:"BrtEndPCDHGLGMembers" },
- 0x01BD: { n:"BrtBeginPCDHGLGMember" },
- 0x01BE: { n:"BrtEndPCDHGLGMember" },
- 0x01BF: { n:"BrtBeginQSI" },
- 0x01C0: { n:"BrtEndQSI" },
- 0x01C1: { n:"BrtBeginQSIR" },
- 0x01C2: { n:"BrtEndQSIR" },
- 0x01C3: { n:"BrtBeginDeletedNames" },
- 0x01C4: { n:"BrtEndDeletedNames" },
- 0x01C5: { n:"BrtBeginDeletedName" },
- 0x01C6: { n:"BrtEndDeletedName" },
- 0x01C7: { n:"BrtBeginQSIFs" },
- 0x01C8: { n:"BrtEndQSIFs" },
- 0x01C9: { n:"BrtBeginQSIF" },
- 0x01CA: { n:"BrtEndQSIF" },
- 0x01CB: { n:"BrtBeginAutoSortScope" },
- 0x01CC: { n:"BrtEndAutoSortScope" },
- 0x01CD: { n:"BrtBeginConditionalFormatting" },
- 0x01CE: { n:"BrtEndConditionalFormatting" },
- 0x01CF: { n:"BrtBeginCFRule" },
- 0x01D0: { n:"BrtEndCFRule" },
- 0x01D1: { n:"BrtBeginIconSet" },
- 0x01D2: { n:"BrtEndIconSet" },
- 0x01D3: { n:"BrtBeginDatabar" },
- 0x01D4: { n:"BrtEndDatabar" },
- 0x01D5: { n:"BrtBeginColorScale" },
- 0x01D6: { n:"BrtEndColorScale" },
- 0x01D7: { n:"BrtCFVO" },
- 0x01D8: { n:"BrtExternValueMeta" },
- 0x01D9: { n:"BrtBeginColorPalette" },
- 0x01DA: { n:"BrtEndColorPalette" },
- 0x01DB: { n:"BrtIndexedColor" },
- 0x01DC: { n:"BrtMargins", f:parse_BrtMargins },
- 0x01DD: { n:"BrtPrintOptions" },
- 0x01DE: { n:"BrtPageSetup" },
- 0x01DF: { n:"BrtBeginHeaderFooter" },
- 0x01E0: { n:"BrtEndHeaderFooter" },
- 0x01E1: { n:"BrtBeginSXCrtFormat" },
- 0x01E2: { n:"BrtEndSXCrtFormat" },
- 0x01E3: { n:"BrtBeginSXCrtFormats" },
- 0x01E4: { n:"BrtEndSXCrtFormats" },
- 0x01E5: { n:"BrtWsFmtInfo", f:parse_BrtWsFmtInfo },
- 0x01E6: { n:"BrtBeginMgs" },
- 0x01E7: { n:"BrtEndMGs" },
- 0x01E8: { n:"BrtBeginMGMaps" },
- 0x01E9: { n:"BrtEndMGMaps" },
- 0x01EA: { n:"BrtBeginMG" },
- 0x01EB: { n:"BrtEndMG" },
- 0x01EC: { n:"BrtBeginMap" },
- 0x01ED: { n:"BrtEndMap" },
- 0x01EE: { n:"BrtHLink", f:parse_BrtHLink },
- 0x01EF: { n:"BrtBeginDCon" },
- 0x01F0: { n:"BrtEndDCon" },
- 0x01F1: { n:"BrtBeginDRefs" },
- 0x01F2: { n:"BrtEndDRefs" },
- 0x01F3: { n:"BrtDRef" },
- 0x01F4: { n:"BrtBeginScenMan" },
- 0x01F5: { n:"BrtEndScenMan" },
- 0x01F6: { n:"BrtBeginSct" },
- 0x01F7: { n:"BrtEndSct" },
- 0x01F8: { n:"BrtSlc" },
- 0x01F9: { n:"BrtBeginDXFs" },
- 0x01FA: { n:"BrtEndDXFs" },
- 0x01FB: { n:"BrtDXF" },
- 0x01FC: { n:"BrtBeginTableStyles" },
- 0x01FD: { n:"BrtEndTableStyles" },
- 0x01FE: { n:"BrtBeginTableStyle" },
- 0x01FF: { n:"BrtEndTableStyle" },
- 0x0200: { n:"BrtTableStyleElement" },
- 0x0201: { n:"BrtTableStyleClient" },
- 0x0202: { n:"BrtBeginVolDeps" },
- 0x0203: { n:"BrtEndVolDeps" },
- 0x0204: { n:"BrtBeginVolType" },
- 0x0205: { n:"BrtEndVolType" },
- 0x0206: { n:"BrtBeginVolMain" },
- 0x0207: { n:"BrtEndVolMain" },
- 0x0208: { n:"BrtBeginVolTopic" },
- 0x0209: { n:"BrtEndVolTopic" },
- 0x020A: { n:"BrtVolSubtopic" },
- 0x020B: { n:"BrtVolRef" },
- 0x020C: { n:"BrtVolNum" },
- 0x020D: { n:"BrtVolErr" },
- 0x020E: { n:"BrtVolStr" },
- 0x020F: { n:"BrtVolBool" },
- 0x0210: { n:"BrtBeginCalcChain$" },
- 0x0211: { n:"BrtEndCalcChain$" },
- 0x0212: { n:"BrtBeginSortState" },
- 0x0213: { n:"BrtEndSortState" },
- 0x0214: { n:"BrtBeginSortCond" },
- 0x0215: { n:"BrtEndSortCond" },
- 0x0216: { n:"BrtBookProtection" },
- 0x0217: { n:"BrtSheetProtection" },
- 0x0218: { n:"BrtRangeProtection" },
- 0x0219: { n:"BrtPhoneticInfo" },
- 0x021A: { n:"BrtBeginECTxtWiz" },
- 0x021B: { n:"BrtEndECTxtWiz" },
- 0x021C: { n:"BrtBeginECTWFldInfoLst" },
- 0x021D: { n:"BrtEndECTWFldInfoLst" },
- 0x021E: { n:"BrtBeginECTwFldInfo" },
- 0x0224: { n:"BrtFileSharing" },
- 0x0225: { n:"BrtOleSize" },
- 0x0226: { n:"BrtDrawing", f:parse_RelID },
- 0x0227: { n:"BrtLegacyDrawing" },
- 0x0228: { n:"BrtLegacyDrawingHF" },
- 0x0229: { n:"BrtWebOpt" },
- 0x022A: { n:"BrtBeginWebPubItems" },
- 0x022B: { n:"BrtEndWebPubItems" },
- 0x022C: { n:"BrtBeginWebPubItem" },
- 0x022D: { n:"BrtEndWebPubItem" },
- 0x022E: { n:"BrtBeginSXCondFmt" },
- 0x022F: { n:"BrtEndSXCondFmt" },
- 0x0230: { n:"BrtBeginSXCondFmts" },
- 0x0231: { n:"BrtEndSXCondFmts" },
- 0x0232: { n:"BrtBkHim" },
- 0x0234: { n:"BrtColor" },
- 0x0235: { n:"BrtBeginIndexedColors" },
- 0x0236: { n:"BrtEndIndexedColors" },
- 0x0239: { n:"BrtBeginMRUColors" },
- 0x023A: { n:"BrtEndMRUColors" },
- 0x023C: { n:"BrtMRUColor" },
- 0x023D: { n:"BrtBeginDVals" },
- 0x023E: { n:"BrtEndDVals" },
- 0x0241: { n:"BrtSupNameStart" },
- 0x0242: { n:"BrtSupNameValueStart" },
- 0x0243: { n:"BrtSupNameValueEnd" },
- 0x0244: { n:"BrtSupNameNum" },
- 0x0245: { n:"BrtSupNameErr" },
- 0x0246: { n:"BrtSupNameSt" },
- 0x0247: { n:"BrtSupNameNil" },
- 0x0248: { n:"BrtSupNameBool" },
- 0x0249: { n:"BrtSupNameFmla" },
- 0x024A: { n:"BrtSupNameBits" },
- 0x024B: { n:"BrtSupNameEnd" },
- 0x024C: { n:"BrtEndSupBook" },
- 0x024D: { n:"BrtCellSmartTagProperty" },
- 0x024E: { n:"BrtBeginCellSmartTag" },
- 0x024F: { n:"BrtEndCellSmartTag" },
- 0x0250: { n:"BrtBeginCellSmartTags" },
- 0x0251: { n:"BrtEndCellSmartTags" },
- 0x0252: { n:"BrtBeginSmartTags" },
- 0x0253: { n:"BrtEndSmartTags" },
- 0x0254: { n:"BrtSmartTagType" },
- 0x0255: { n:"BrtBeginSmartTagTypes" },
- 0x0256: { n:"BrtEndSmartTagTypes" },
- 0x0257: { n:"BrtBeginSXFilters" },
- 0x0258: { n:"BrtEndSXFilters" },
- 0x0259: { n:"BrtBeginSXFILTER" },
- 0x025A: { n:"BrtEndSXFilter" },
- 0x025B: { n:"BrtBeginFills" },
- 0x025C: { n:"BrtEndFills" },
- 0x025D: { n:"BrtBeginCellWatches" },
- 0x025E: { n:"BrtEndCellWatches" },
- 0x025F: { n:"BrtCellWatch" },
- 0x0260: { n:"BrtBeginCRErrs" },
- 0x0261: { n:"BrtEndCRErrs" },
- 0x0262: { n:"BrtCrashRecErr" },
- 0x0263: { n:"BrtBeginFonts" },
- 0x0264: { n:"BrtEndFonts" },
- 0x0265: { n:"BrtBeginBorders" },
- 0x0266: { n:"BrtEndBorders" },
- 0x0267: { n:"BrtBeginFmts" },
- 0x0268: { n:"BrtEndFmts" },
- 0x0269: { n:"BrtBeginCellXFs" },
- 0x026A: { n:"BrtEndCellXFs" },
- 0x026B: { n:"BrtBeginStyles" },
- 0x026C: { n:"BrtEndStyles" },
- 0x0271: { n:"BrtBigName" },
- 0x0272: { n:"BrtBeginCellStyleXFs" },
- 0x0273: { n:"BrtEndCellStyleXFs" },
- 0x0274: { n:"BrtBeginComments" },
- 0x0275: { n:"BrtEndComments" },
- 0x0276: { n:"BrtBeginCommentAuthors" },
- 0x0277: { n:"BrtEndCommentAuthors" },
- 0x0278: { n:"BrtCommentAuthor", f:parse_BrtCommentAuthor },
- 0x0279: { n:"BrtBeginCommentList" },
- 0x027A: { n:"BrtEndCommentList" },
- 0x027B: { n:"BrtBeginComment", f:parse_BrtBeginComment},
- 0x027C: { n:"BrtEndComment" },
- 0x027D: { n:"BrtCommentText", f:parse_BrtCommentText },
- 0x027E: { n:"BrtBeginOleObjects" },
- 0x027F: { n:"BrtOleObject" },
- 0x0280: { n:"BrtEndOleObjects" },
- 0x0281: { n:"BrtBeginSxrules" },
- 0x0282: { n:"BrtEndSxRules" },
- 0x0283: { n:"BrtBeginActiveXControls" },
- 0x0284: { n:"BrtActiveX" },
- 0x0285: { n:"BrtEndActiveXControls" },
- 0x0286: { n:"BrtBeginPCDSDTCEMembersSortBy" },
- 0x0288: { n:"BrtBeginCellIgnoreECs" },
- 0x0289: { n:"BrtCellIgnoreEC" },
- 0x028A: { n:"BrtEndCellIgnoreECs" },
- 0x028B: { n:"BrtCsProp", f:parse_BrtCsProp },
- 0x028C: { n:"BrtCsPageSetup" },
- 0x028D: { n:"BrtBeginUserCsViews" },
- 0x028E: { n:"BrtEndUserCsViews" },
- 0x028F: { n:"BrtBeginUserCsView" },
- 0x0290: { n:"BrtEndUserCsView" },
- 0x0291: { n:"BrtBeginPcdSFCIEntries" },
- 0x0292: { n:"BrtEndPCDSFCIEntries" },
- 0x0293: { n:"BrtPCDSFCIEntry" },
- 0x0294: { n:"BrtBeginListParts" },
- 0x0295: { n:"BrtListPart" },
- 0x0296: { n:"BrtEndListParts" },
- 0x0297: { n:"BrtSheetCalcProp" },
- 0x0298: { n:"BrtBeginFnGroup" },
- 0x0299: { n:"BrtFnGroup" },
- 0x029A: { n:"BrtEndFnGroup" },
- 0x029B: { n:"BrtSupAddin" },
- 0x029C: { n:"BrtSXTDMPOrder" },
- 0x029D: { n:"BrtCsProtection" },
- 0x029F: { n:"BrtBeginWsSortMap" },
- 0x02A0: { n:"BrtEndWsSortMap" },
- 0x02A1: { n:"BrtBeginRRSort" },
- 0x02A2: { n:"BrtEndRRSort" },
- 0x02A3: { n:"BrtRRSortItem" },
- 0x02A4: { n:"BrtFileSharingIso" },
- 0x02A5: { n:"BrtBookProtectionIso" },
- 0x02A6: { n:"BrtSheetProtectionIso" },
- 0x02A7: { n:"BrtCsProtectionIso" },
- 0x02A8: { n:"BrtRangeProtectionIso" },
- 0x02A9: { n:"BrtDValList" },
- 0x0400: { n:"BrtRwDescent" },
- 0x0401: { n:"BrtKnownFonts" },
- 0x0402: { n:"BrtBeginSXTupleSet" },
- 0x0403: { n:"BrtEndSXTupleSet" },
- 0x0404: { n:"BrtBeginSXTupleSetHeader" },
- 0x0405: { n:"BrtEndSXTupleSetHeader" },
- 0x0406: { n:"BrtSXTupleSetHeaderItem" },
- 0x0407: { n:"BrtBeginSXTupleSetData" },
- 0x0408: { n:"BrtEndSXTupleSetData" },
- 0x0409: { n:"BrtBeginSXTupleSetRow" },
- 0x040A: { n:"BrtEndSXTupleSetRow" },
- 0x040B: { n:"BrtSXTupleSetRowItem" },
- 0x040C: { n:"BrtNameExt" },
- 0x040D: { n:"BrtPCDH14" },
- 0x040E: { n:"BrtBeginPCDCalcMem14" },
- 0x040F: { n:"BrtEndPCDCalcMem14" },
- 0x0410: { n:"BrtSXTH14" },
- 0x0411: { n:"BrtBeginSparklineGroup" },
- 0x0412: { n:"BrtEndSparklineGroup" },
- 0x0413: { n:"BrtSparkline" },
- 0x0414: { n:"BrtSXDI14" },
- 0x0415: { n:"BrtWsFmtInfoEx14" },
- 0x0416: { n:"BrtBeginConditionalFormatting14" },
- 0x0417: { n:"BrtEndConditionalFormatting14" },
- 0x0418: { n:"BrtBeginCFRule14" },
- 0x0419: { n:"BrtEndCFRule14" },
- 0x041A: { n:"BrtCFVO14" },
- 0x041B: { n:"BrtBeginDatabar14" },
- 0x041C: { n:"BrtBeginIconSet14" },
- 0x041D: { n:"BrtDVal14", f: parse_BrtDVal14 },
- 0x041E: { n:"BrtBeginDVals14" },
- 0x041F: { n:"BrtColor14" },
- 0x0420: { n:"BrtBeginSparklines" },
- 0x0421: { n:"BrtEndSparklines" },
- 0x0422: { n:"BrtBeginSparklineGroups" },
- 0x0423: { n:"BrtEndSparklineGroups" },
- 0x0425: { n:"BrtSXVD14" },
- 0x0426: { n:"BrtBeginSXView14" },
- 0x0427: { n:"BrtEndSXView14" },
- 0x0428: { n:"BrtBeginSXView16" },
- 0x0429: { n:"BrtEndSXView16" },
- 0x042A: { n:"BrtBeginPCD14" },
- 0x042B: { n:"BrtEndPCD14" },
- 0x042C: { n:"BrtBeginExtConn14" },
- 0x042D: { n:"BrtEndExtConn14" },
- 0x042E: { n:"BrtBeginSlicerCacheIDs" },
- 0x042F: { n:"BrtEndSlicerCacheIDs" },
- 0x0430: { n:"BrtBeginSlicerCacheID" },
- 0x0431: { n:"BrtEndSlicerCacheID" },
- 0x0433: { n:"BrtBeginSlicerCache" },
- 0x0434: { n:"BrtEndSlicerCache" },
- 0x0435: { n:"BrtBeginSlicerCacheDef" },
- 0x0436: { n:"BrtEndSlicerCacheDef" },
- 0x0437: { n:"BrtBeginSlicersEx" },
- 0x0438: { n:"BrtEndSlicersEx" },
- 0x0439: { n:"BrtBeginSlicerEx" },
- 0x043A: { n:"BrtEndSlicerEx" },
- 0x043B: { n:"BrtBeginSlicer" },
- 0x043C: { n:"BrtEndSlicer" },
- 0x043D: { n:"BrtSlicerCachePivotTables" },
- 0x043E: { n:"BrtBeginSlicerCacheOlapImpl" },
- 0x043F: { n:"BrtEndSlicerCacheOlapImpl" },
- 0x0440: { n:"BrtBeginSlicerCacheLevelsData" },
- 0x0441: { n:"BrtEndSlicerCacheLevelsData" },
- 0x0442: { n:"BrtBeginSlicerCacheLevelData" },
- 0x0443: { n:"BrtEndSlicerCacheLevelData" },
- 0x0444: { n:"BrtBeginSlicerCacheSiRanges" },
- 0x0445: { n:"BrtEndSlicerCacheSiRanges" },
- 0x0446: { n:"BrtBeginSlicerCacheSiRange" },
- 0x0447: { n:"BrtEndSlicerCacheSiRange" },
- 0x0448: { n:"BrtSlicerCacheOlapItem" },
- 0x0449: { n:"BrtBeginSlicerCacheSelections" },
- 0x044A: { n:"BrtSlicerCacheSelection" },
- 0x044B: { n:"BrtEndSlicerCacheSelections" },
- 0x044C: { n:"BrtBeginSlicerCacheNative" },
- 0x044D: { n:"BrtEndSlicerCacheNative" },
- 0x044E: { n:"BrtSlicerCacheNativeItem" },
- 0x044F: { n:"BrtRangeProtection14" },
- 0x0450: { n:"BrtRangeProtectionIso14" },
- 0x0451: { n:"BrtCellIgnoreEC14" },
- 0x0457: { n:"BrtList14" },
- 0x0458: { n:"BrtCFIcon" },
- 0x0459: { n:"BrtBeginSlicerCachesPivotCacheIDs" },
- 0x045A: { n:"BrtEndSlicerCachesPivotCacheIDs" },
- 0x045B: { n:"BrtBeginSlicers" },
- 0x045C: { n:"BrtEndSlicers" },
- 0x045D: { n:"BrtWbProp14" },
- 0x045E: { n:"BrtBeginSXEdit" },
- 0x045F: { n:"BrtEndSXEdit" },
- 0x0460: { n:"BrtBeginSXEdits" },
- 0x0461: { n:"BrtEndSXEdits" },
- 0x0462: { n:"BrtBeginSXChange" },
- 0x0463: { n:"BrtEndSXChange" },
- 0x0464: { n:"BrtBeginSXChanges" },
- 0x0465: { n:"BrtEndSXChanges" },
- 0x0466: { n:"BrtSXTupleItems" },
- 0x0468: { n:"BrtBeginSlicerStyle" },
- 0x0469: { n:"BrtEndSlicerStyle" },
- 0x046A: { n:"BrtSlicerStyleElement" },
- 0x046B: { n:"BrtBeginStyleSheetExt14" },
- 0x046C: { n:"BrtEndStyleSheetExt14" },
- 0x046D: { n:"BrtBeginSlicerCachesPivotCacheID" },
- 0x046E: { n:"BrtEndSlicerCachesPivotCacheID" },
- 0x046F: { n:"BrtBeginConditionalFormattings" },
- 0x0470: { n:"BrtEndConditionalFormattings" },
- 0x0471: { n:"BrtBeginPCDCalcMemExt" },
- 0x0472: { n:"BrtEndPCDCalcMemExt" },
- 0x0473: { n:"BrtBeginPCDCalcMemsExt" },
- 0x0474: { n:"BrtEndPCDCalcMemsExt" },
- 0x0475: { n:"BrtPCDField14" },
- 0x0476: { n:"BrtBeginSlicerStyles" },
- 0x0477: { n:"BrtEndSlicerStyles" },
- 0x0478: { n:"BrtBeginSlicerStyleElements" },
- 0x0479: { n:"BrtEndSlicerStyleElements" },
- 0x047A: { n:"BrtCFRuleExt" },
- 0x047B: { n:"BrtBeginSXCondFmt14" },
- 0x047C: { n:"BrtEndSXCondFmt14" },
- 0x047D: { n:"BrtBeginSXCondFmts14" },
- 0x047E: { n:"BrtEndSXCondFmts14" },
- 0x0480: { n:"BrtBeginSortCond14" },
- 0x0481: { n:"BrtEndSortCond14" },
- 0x0482: { n:"BrtEndDVals14" },
- 0x0483: { n:"BrtEndIconSet14" },
- 0x0484: { n:"BrtEndDatabar14" },
- 0x0485: { n:"BrtBeginColorScale14" },
- 0x0486: { n:"BrtEndColorScale14" },
- 0x0487: { n:"BrtBeginSxrules14" },
- 0x0488: { n:"BrtEndSxrules14" },
- 0x0489: { n:"BrtBeginPRule14" },
- 0x048A: { n:"BrtEndPRule14" },
- 0x048B: { n:"BrtBeginPRFilters14" },
- 0x048C: { n:"BrtEndPRFilters14" },
- 0x048D: { n:"BrtBeginPRFilter14" },
- 0x048E: { n:"BrtEndPRFilter14" },
- 0x048F: { n:"BrtBeginPRFItem14" },
- 0x0490: { n:"BrtEndPRFItem14" },
- 0x0491: { n:"BrtBeginCellIgnoreECs14" },
- 0x0492: { n:"BrtEndCellIgnoreECs14" },
- 0x0493: { n:"BrtDxf14" },
- 0x0494: { n:"BrtBeginDxF14s" },
- 0x0495: { n:"BrtEndDxf14s" },
- 0x0499: { n:"BrtFilter14" },
- 0x049A: { n:"BrtBeginCustomFilters14" },
- 0x049C: { n:"BrtCustomFilter14" },
- 0x049D: { n:"BrtIconFilter14" },
- 0x049E: { n:"BrtPivotCacheConnectionName" },
- 0x0800: { n:"BrtBeginDecoupledPivotCacheIDs" },
- 0x0801: { n:"BrtEndDecoupledPivotCacheIDs" },
- 0x0802: { n:"BrtDecoupledPivotCacheID" },
- 0x0803: { n:"BrtBeginPivotTableRefs" },
- 0x0804: { n:"BrtEndPivotTableRefs" },
- 0x0805: { n:"BrtPivotTableRef" },
- 0x0806: { n:"BrtSlicerCacheBookPivotTables" },
- 0x0807: { n:"BrtBeginSxvcells" },
- 0x0808: { n:"BrtEndSxvcells" },
- 0x0809: { n:"BrtBeginSxRow" },
- 0x080A: { n:"BrtEndSxRow" },
- 0x080C: { n:"BrtPcdCalcMem15" },
- 0x0813: { n:"BrtQsi15" },
- 0x0814: { n:"BrtBeginWebExtensions" },
- 0x0815: { n:"BrtEndWebExtensions" },
- 0x0816: { n:"BrtWebExtension" },
- 0x0817: { n:"BrtAbsPath15" },
- 0x0818: { n:"BrtBeginPivotTableUISettings" },
- 0x0819: { n:"BrtEndPivotTableUISettings" },
- 0x081B: { n:"BrtTableSlicerCacheIDs" },
- 0x081C: { n:"BrtTableSlicerCacheID" },
- 0x081D: { n:"BrtBeginTableSlicerCache" },
- 0x081E: { n:"BrtEndTableSlicerCache" },
- 0x081F: { n:"BrtSxFilter15" },
- 0x0820: { n:"BrtBeginTimelineCachePivotCacheIDs" },
- 0x0821: { n:"BrtEndTimelineCachePivotCacheIDs" },
- 0x0822: { n:"BrtTimelineCachePivotCacheID" },
- 0x0823: { n:"BrtBeginTimelineCacheIDs" },
- 0x0824: { n:"BrtEndTimelineCacheIDs" },
- 0x0825: { n:"BrtBeginTimelineCacheID" },
- 0x0826: { n:"BrtEndTimelineCacheID" },
- 0x0827: { n:"BrtBeginTimelinesEx" },
- 0x0828: { n:"BrtEndTimelinesEx" },
- 0x0829: { n:"BrtBeginTimelineEx" },
- 0x082A: { n:"BrtEndTimelineEx" },
- 0x082B: { n:"BrtWorkBookPr15" },
- 0x082C: { n:"BrtPCDH15" },
- 0x082D: { n:"BrtBeginTimelineStyle" },
- 0x082E: { n:"BrtEndTimelineStyle" },
- 0x082F: { n:"BrtTimelineStyleElement" },
- 0x0830: { n:"BrtBeginTimelineStylesheetExt15" },
- 0x0831: { n:"BrtEndTimelineStylesheetExt15" },
- 0x0832: { n:"BrtBeginTimelineStyles" },
- 0x0833: { n:"BrtEndTimelineStyles" },
- 0x0834: { n:"BrtBeginTimelineStyleElements" },
- 0x0835: { n:"BrtEndTimelineStyleElements" },
- 0x0836: { n:"BrtDxf15" },
- 0x0837: { n:"BrtBeginDxfs15" },
- 0x0838: { n:"brtEndDxfs15" },
- 0x0839: { n:"BrtSlicerCacheHideItemsWithNoData" },
- 0x083A: { n:"BrtBeginItemUniqueNames" },
- 0x083B: { n:"BrtEndItemUniqueNames" },
- 0x083C: { n:"BrtItemUniqueName" },
- 0x083D: { n:"BrtBeginExtConn15" },
- 0x083E: { n:"BrtEndExtConn15" },
- 0x083F: { n:"BrtBeginOledbPr15" },
- 0x0840: { n:"BrtEndOledbPr15" },
- 0x0841: { n:"BrtBeginDataFeedPr15" },
- 0x0842: { n:"BrtEndDataFeedPr15" },
- 0x0843: { n:"BrtTextPr15" },
- 0x0844: { n:"BrtRangePr15" },
- 0x0845: { n:"BrtDbCommand15" },
- 0x0846: { n:"BrtBeginDbTables15" },
- 0x0847: { n:"BrtEndDbTables15" },
- 0x0848: { n:"BrtDbTable15" },
- 0x0849: { n:"BrtBeginDataModel" },
- 0x084A: { n:"BrtEndDataModel" },
- 0x084B: { n:"BrtBeginModelTables" },
- 0x084C: { n:"BrtEndModelTables" },
- 0x084D: { n:"BrtModelTable" },
- 0x084E: { n:"BrtBeginModelRelationships" },
- 0x084F: { n:"BrtEndModelRelationships" },
- 0x0850: { n:"BrtModelRelationship" },
- 0x0851: { n:"BrtBeginECTxtWiz15" },
- 0x0852: { n:"BrtEndECTxtWiz15" },
- 0x0853: { n:"BrtBeginECTWFldInfoLst15" },
- 0x0854: { n:"BrtEndECTWFldInfoLst15" },
- 0x0855: { n:"BrtBeginECTWFldInfo15" },
- 0x0856: { n:"BrtFieldListActiveItem" },
- 0x0857: { n:"BrtPivotCacheIdVersion" },
- 0x0858: { n:"BrtSXDI15" },
- 0x0859: { n:"BrtBeginModelTimeGroupings" },
- 0x085A: { n:"BrtEndModelTimeGroupings" },
- 0x085B: { n:"BrtBeginModelTimeGrouping" },
- 0x085C: { n:"BrtEndModelTimeGrouping" },
- 0x085D: { n:"BrtModelTimeGroupingCalcCol" },
- 0x0C00: { n:"BrtUid" },
- 0x0C01: { n:"BrtRevisionPtr" },
- 0x13e7: { n:"BrtBeginCalcFeatures" },
- 0x13e8: { n:"BrtEndCalcFeatures" },
- 0x13e9: { n:"BrtCalcFeature" },
- 0xFFFF: { n:"" }
- };
-
- var XLSBRE = evert_key(XLSBRecordEnum, 'n');
-
- /* [MS-XLS] 2.3 Record Enumeration */
- var XLSRecordEnum = {
- 0x0003: { n:"BIFF2NUM", f:parse_BIFF2NUM },
- 0x0004: { n:"BIFF2STR", f:parse_BIFF2STR },
- 0x0006: { n:"Formula", f:parse_Formula },
- 0x0009: { n:'BOF', f:parse_BOF },
- 0x000a: { n:'EOF', f:parsenoop2 },
- 0x000c: { n:"CalcCount", f:parseuint16 },
- 0x000d: { n:"CalcMode", f:parseuint16 },
- 0x000e: { n:"CalcPrecision", f:parsebool },
- 0x000f: { n:"CalcRefMode", f:parsebool },
- 0x0010: { n:"CalcDelta", f:parse_Xnum },
- 0x0011: { n:"CalcIter", f:parsebool },
- 0x0012: { n:"Protect", f:parsebool },
- 0x0013: { n:"Password", f:parseuint16 },
- 0x0014: { n:"Header", f:parse_XLHeaderFooter },
- 0x0015: { n:"Footer", f:parse_XLHeaderFooter },
- 0x0017: { n:"ExternSheet", f:parse_ExternSheet },
- 0x0018: { n:"Lbl", f:parse_Lbl },
- 0x0019: { n:"WinProtect", f:parsebool },
- 0x001a: { n:"VerticalPageBreaks" },
- 0x001b: { n:"HorizontalPageBreaks" },
- 0x001c: { n:"Note", f:parse_Note },
- 0x001d: { n:"Selection" },
- 0x0022: { n:"Date1904", f:parsebool },
- 0x0023: { n:"ExternName", f:parse_ExternName },
- 0x0026: { n:"LeftMargin", f:parse_Xnum },
- 0x0027: { n:"RightMargin", f:parse_Xnum },
- 0x0028: { n:"TopMargin", f:parse_Xnum },
- 0x0029: { n:"BottomMargin", f:parse_Xnum },
- 0x002a: { n:"PrintRowCol", f:parsebool },
- 0x002b: { n:"PrintGrid", f:parsebool },
- 0x002f: { n:"FilePass", f:parse_FilePass },
- 0x0031: { n:"Font", f:parse_Font },
- 0x0033: { n:"PrintSize", f:parseuint16 },
- 0x003c: { n:"Continue" },
- 0x003d: { n:"Window1", f:parse_Window1 },
- 0x0040: { n:"Backup", f:parsebool },
- 0x0041: { n:"Pane", f:parse_Pane },
- 0x0042: { n:'CodePage', f:parseuint16 },
- 0x004d: { n:"Pls" },
- 0x0050: { n:"DCon" },
- 0x0051: { n:"DConRef" },
- 0x0052: { n:"DConName" },
- 0x0055: { n:"DefColWidth", f:parseuint16 },
- 0x0059: { n:"XCT" },
- 0x005a: { n:"CRN" },
- 0x005b: { n:"FileSharing" },
- 0x005c: { n:'WriteAccess', f:parse_WriteAccess },
- 0x005d: { n:"Obj", f:parse_Obj },
- 0x005e: { n:"Uncalced" },
- 0x005f: { n:"CalcSaveRecalc", f:parsebool },
- 0x0060: { n:"Template" },
- 0x0061: { n:"Intl" },
- 0x0063: { n:"ObjProtect", f:parsebool },
- 0x007d: { n:"ColInfo", f:parse_ColInfo },
- 0x0080: { n:"Guts", f:parse_Guts },
- 0x0081: { n:"WsBool", f:parse_WsBool },
- 0x0082: { n:"GridSet", f:parseuint16 },
- 0x0083: { n:"HCenter", f:parsebool },
- 0x0084: { n:"VCenter", f:parsebool },
- 0x0085: { n:'BoundSheet8', f:parse_BoundSheet8 },
- 0x0086: { n:"WriteProtect" },
- 0x008c: { n:"Country", f:parse_Country },
- 0x008d: { n:"HideObj", f:parseuint16 },
- 0x0090: { n:"Sort" },
- 0x0092: { n:"Palette", f:parse_Palette },
- 0x0097: { n:"Sync" },
- 0x0098: { n:"LPr" },
- 0x0099: { n:"DxGCol" },
- 0x009a: { n:"FnGroupName" },
- 0x009b: { n:"FilterMode" },
- 0x009c: { n:"BuiltInFnGroupCount", f:parseuint16 },
- 0x009d: { n:"AutoFilterInfo" },
- 0x009e: { n:"AutoFilter" },
- 0x00a0: { n:"Scl", f:parse_Scl },
- 0x00a1: { n:"Setup", f:parse_Setup },
- 0x00ae: { n:"ScenMan" },
- 0x00af: { n:"SCENARIO" },
- 0x00b0: { n:"SxView" },
- 0x00b1: { n:"Sxvd" },
- 0x00b2: { n:"SXVI" },
- 0x00b4: { n:"SxIvd" },
- 0x00b5: { n:"SXLI" },
- 0x00b6: { n:"SXPI" },
- 0x00b8: { n:"DocRoute" },
- 0x00b9: { n:"RecipName" },
- 0x00bd: { n:"MulRk", f:parse_MulRk },
- 0x00be: { n:"MulBlank", f:parse_MulBlank },
- 0x00c1: { n:'Mms', f:parsenoop2 },
- 0x00c5: { n:"SXDI" },
- 0x00c6: { n:"SXDB" },
- 0x00c7: { n:"SXFDB" },
- 0x00c8: { n:"SXDBB" },
- 0x00c9: { n:"SXNum" },
- 0x00ca: { n:"SxBool", f:parsebool },
- 0x00cb: { n:"SxErr" },
- 0x00cc: { n:"SXInt" },
- 0x00cd: { n:"SXString" },
- 0x00ce: { n:"SXDtr" },
- 0x00cf: { n:"SxNil" },
- 0x00d0: { n:"SXTbl" },
- 0x00d1: { n:"SXTBRGIITM" },
- 0x00d2: { n:"SxTbpg" },
- 0x00d3: { n:"ObProj" },
- 0x00d5: { n:"SXStreamID" },
- 0x00d7: { n:"DBCell" },
- 0x00d8: { n:"SXRng" },
- 0x00d9: { n:"SxIsxoper" },
- 0x00da: { n:"BookBool", f:parseuint16 },
- 0x00dc: { n:"DbOrParamQry" },
- 0x00dd: { n:"ScenarioProtect", f:parsebool },
- 0x00de: { n:"OleObjectSize" },
- 0x00e0: { n:"XF", f:parse_XF },
- 0x00e1: { n:'InterfaceHdr', f:parse_InterfaceHdr },
- 0x00e2: { n:'InterfaceEnd', f:parsenoop2 },
- 0x00e3: { n:"SXVS" },
- 0x00e5: { n:"MergeCells", f:parse_MergeCells },
- 0x00e9: { n:"BkHim" },
- 0x00eb: { n:"MsoDrawingGroup" },
- 0x00ec: { n:"MsoDrawing" },
- 0x00ed: { n:"MsoDrawingSelection" },
- 0x00ef: { n:"PhoneticInfo" },
- 0x00f0: { n:"SxRule" },
- 0x00f1: { n:"SXEx" },
- 0x00f2: { n:"SxFilt" },
- 0x00f4: { n:"SxDXF" },
- 0x00f5: { n:"SxItm" },
- 0x00f6: { n:"SxName" },
- 0x00f7: { n:"SxSelect" },
- 0x00f8: { n:"SXPair" },
- 0x00f9: { n:"SxFmla" },
- 0x00fb: { n:"SxFormat" },
- 0x00fc: { n:"SST", f:parse_SST },
- 0x00fd: { n:"LabelSst", f:parse_LabelSst },
- 0x00ff: { n:"ExtSST", f:parse_ExtSST },
- 0x0100: { n:"SXVDEx" },
- 0x0103: { n:"SXFormula" },
- 0x0122: { n:"SXDBEx" },
- 0x0137: { n:"RRDInsDel" },
- 0x0138: { n:"RRDHead" },
- 0x013b: { n:"RRDChgCell" },
- 0x013d: { n:"RRTabId", f:parseuint16a },
- 0x013e: { n:"RRDRenSheet" },
- 0x013f: { n:"RRSort" },
- 0x0140: { n:"RRDMove" },
- 0x014a: { n:"RRFormat" },
- 0x014b: { n:"RRAutoFmt" },
- 0x014d: { n:"RRInsertSh" },
- 0x014e: { n:"RRDMoveBegin" },
- 0x014f: { n:"RRDMoveEnd" },
- 0x0150: { n:"RRDInsDelBegin" },
- 0x0151: { n:"RRDInsDelEnd" },
- 0x0152: { n:"RRDConflict" },
- 0x0153: { n:"RRDDefName" },
- 0x0154: { n:"RRDRstEtxp" },
- 0x015f: { n:"LRng" },
- 0x0160: { n:"UsesELFs", f:parsebool },
- 0x0161: { n:"DSF", f:parsenoop2 },
- 0x0191: { n:"CUsr" },
- 0x0192: { n:"CbUsr" },
- 0x0193: { n:"UsrInfo" },
- 0x0194: { n:"UsrExcl" },
- 0x0195: { n:"FileLock" },
- 0x0196: { n:"RRDInfo" },
- 0x0197: { n:"BCUsrs" },
- 0x0198: { n:"UsrChk" },
- 0x01a9: { n:"UserBView" },
- 0x01aa: { n:"UserSViewBegin" },
- 0x01ab: { n:"UserSViewEnd" },
- 0x01ac: { n:"RRDUserView" },
- 0x01ad: { n:"Qsi" },
- 0x01ae: { n:"SupBook", f:parse_SupBook },
- 0x01af: { n:"Prot4Rev", f:parsebool },
- 0x01b0: { n:"CondFmt" },
- 0x01b1: { n:"CF" },
- 0x01b2: { n:"DVal" },
- 0x01b5: { n:"DConBin" },
- 0x01b6: { n:"TxO", f:parse_TxO },
- 0x01b7: { n:"RefreshAll", f:parsebool },
- 0x01b8: { n:"HLink", f:parse_HLink },
- 0x01b9: { n:"Lel" },
- 0x01ba: { n:"CodeName", f:parse_XLUnicodeString },
- 0x01bb: { n:"SXFDBType" },
- 0x01bc: { n:"Prot4RevPass", f:parseuint16 },
- 0x01bd: { n:"ObNoMacros" },
- 0x01be: { n:"Dv" },
- 0x01c0: { n:"Excel9File", f:parsenoop2 },
- 0x01c1: { n:"RecalcId", f:parse_RecalcId, r:2},
- 0x01c2: { n:"EntExU2", f:parsenoop2 },
- 0x0200: { n:"Dimensions", f:parse_Dimensions },
- 0x0201: { n:"Blank", f:parse_Blank },
- 0x0203: { n:"Number", f:parse_Number },
- 0x0204: { n:"Label", f:parse_Label },
- 0x0205: { n:"BoolErr", f:parse_BoolErr },
- 0x0206: { n:"Formula", f:parse_Formula },
- 0x0207: { n:"String", f:parse_String },
- 0x0208: { n:'Row', f:parse_Row },
- 0x020b: { n:"Index" },
- 0x0221: { n:"Array", f:parse_Array },
- 0x0225: { n:"DefaultRowHeight", f:parse_DefaultRowHeight },
- 0x0236: { n:"Table" },
- 0x023e: { n:"Window2", f:parse_Window2 },
- 0x027e: { n:"RK", f:parse_RK },
- 0x0293: { n:"Style" },
- 0x0406: { n:"Formula", f:parse_Formula },
- 0x0418: { n:"BigName" },
- 0x041e: { n:"Format", f:parse_Format },
- 0x043c: { n:"ContinueBigName" },
- 0x04bc: { n:"ShrFmla", f:parse_ShrFmla },
- 0x0800: { n:"HLinkTooltip", f:parse_HLinkTooltip },
- 0x0801: { n:"WebPub" },
- 0x0802: { n:"QsiSXTag" },
- 0x0803: { n:"DBQueryExt" },
- 0x0804: { n:"ExtString" },
- 0x0805: { n:"TxtQry" },
- 0x0806: { n:"Qsir" },
- 0x0807: { n:"Qsif" },
- 0x0808: { n:"RRDTQSIF" },
- 0x0809: { n:'BOF', f:parse_BOF },
- 0x080a: { n:"OleDbConn" },
- 0x080b: { n:"WOpt" },
- 0x080c: { n:"SXViewEx" },
- 0x080d: { n:"SXTH" },
- 0x080e: { n:"SXPIEx" },
- 0x080f: { n:"SXVDTEx" },
- 0x0810: { n:"SXViewEx9" },
- 0x0812: { n:"ContinueFrt" },
- 0x0813: { n:"RealTimeData" },
- 0x0850: { n:"ChartFrtInfo" },
- 0x0851: { n:"FrtWrapper" },
- 0x0852: { n:"StartBlock" },
- 0x0853: { n:"EndBlock" },
- 0x0854: { n:"StartObject" },
- 0x0855: { n:"EndObject" },
- 0x0856: { n:"CatLab" },
- 0x0857: { n:"YMult" },
- 0x0858: { n:"SXViewLink" },
- 0x0859: { n:"PivotChartBits" },
- 0x085a: { n:"FrtFontList" },
- 0x0862: { n:"SheetExt" },
- 0x0863: { n:"BookExt", r:12},
- 0x0864: { n:"SXAddl" },
- 0x0865: { n:"CrErr" },
- 0x0866: { n:"HFPicture" },
- 0x0867: { n:'FeatHdr', f:parsenoop2 },
- 0x0868: { n:"Feat" },
- 0x086a: { n:"DataLabExt" },
- 0x086b: { n:"DataLabExtContents" },
- 0x086c: { n:"CellWatch" },
- 0x0871: { n:"FeatHdr11" },
- 0x0872: { n:"Feature11" },
- 0x0874: { n:"DropDownObjIds" },
- 0x0875: { n:"ContinueFrt11" },
- 0x0876: { n:"DConn" },
- 0x0877: { n:"List12" },
- 0x0878: { n:"Feature12" },
- 0x0879: { n:"CondFmt12" },
- 0x087a: { n:"CF12" },
- 0x087b: { n:"CFEx" },
- 0x087c: { n:"XFCRC", f:parse_XFCRC, r:12 },
- 0x087d: { n:"XFExt", f:parse_XFExt, r:12 },
- 0x087e: { n:"AutoFilter12" },
- 0x087f: { n:"ContinueFrt12" },
- 0x0884: { n:"MDTInfo" },
- 0x0885: { n:"MDXStr" },
- 0x0886: { n:"MDXTuple" },
- 0x0887: { n:"MDXSet" },
- 0x0888: { n:"MDXProp" },
- 0x0889: { n:"MDXKPI" },
- 0x088a: { n:"MDB" },
- 0x088b: { n:"PLV" },
- 0x088c: { n:"Compat12", f:parsebool, r:12 },
- 0x088d: { n:"DXF" },
- 0x088e: { n:"TableStyles", r:12 },
- 0x088f: { n:"TableStyle" },
- 0x0890: { n:"TableStyleElement" },
- 0x0892: { n:"StyleExt" },
- 0x0893: { n:"NamePublish" },
- 0x0894: { n:"NameCmt", f:parse_NameCmt, r:12 },
- 0x0895: { n:"SortData" },
- 0x0896: { n:"Theme", f:parse_Theme, r:12 },
- 0x0897: { n:"GUIDTypeLib" },
- 0x0898: { n:"FnGrp12" },
- 0x0899: { n:"NameFnGrp12" },
- 0x089a: { n:"MTRSettings", f:parse_MTRSettings, r:12 },
- 0x089b: { n:"CompressPictures", f:parsenoop2 },
- 0x089c: { n:"HeaderFooter" },
- 0x089d: { n:"CrtLayout12" },
- 0x089e: { n:"CrtMlFrt" },
- 0x089f: { n:"CrtMlFrtContinue" },
- 0x08a3: { n:"ForceFullCalculation", f:parse_ForceFullCalculation },
- 0x08a4: { n:"ShapePropsStream" },
- 0x08a5: { n:"TextPropsStream" },
- 0x08a6: { n:"RichTextStream" },
- 0x08a7: { n:"CrtLayout12A" },
- 0x1001: { n:"Units" },
- 0x1002: { n:"Chart" },
- 0x1003: { n:"Series" },
- 0x1006: { n:"DataFormat" },
- 0x1007: { n:"LineFormat" },
- 0x1009: { n:"MarkerFormat" },
- 0x100a: { n:"AreaFormat" },
- 0x100b: { n:"PieFormat" },
- 0x100c: { n:"AttachedLabel" },
- 0x100d: { n:"SeriesText" },
- 0x1014: { n:"ChartFormat" },
- 0x1015: { n:"Legend" },
- 0x1016: { n:"SeriesList" },
- 0x1017: { n:"Bar" },
- 0x1018: { n:"Line" },
- 0x1019: { n:"Pie" },
- 0x101a: { n:"Area" },
- 0x101b: { n:"Scatter" },
- 0x101c: { n:"CrtLine" },
- 0x101d: { n:"Axis" },
- 0x101e: { n:"Tick" },
- 0x101f: { n:"ValueRange" },
- 0x1020: { n:"CatSerRange" },
- 0x1021: { n:"AxisLine" },
- 0x1022: { n:"CrtLink" },
- 0x1024: { n:"DefaultText" },
- 0x1025: { n:"Text" },
- 0x1026: { n:"FontX", f:parseuint16 },
- 0x1027: { n:"ObjectLink" },
- 0x1032: { n:"Frame" },
- 0x1033: { n:"Begin" },
- 0x1034: { n:"End" },
- 0x1035: { n:"PlotArea" },
- 0x103a: { n:"Chart3d" },
- 0x103c: { n:"PicF" },
- 0x103d: { n:"DropBar" },
- 0x103e: { n:"Radar" },
- 0x103f: { n:"Surf" },
- 0x1040: { n:"RadarArea" },
- 0x1041: { n:"AxisParent" },
- 0x1043: { n:"LegendException" },
- 0x1044: { n:"ShtProps", f:parse_ShtProps },
- 0x1045: { n:"SerToCrt" },
- 0x1046: { n:"AxesUsed" },
- 0x1048: { n:"SBaseRef" },
- 0x104a: { n:"SerParent" },
- 0x104b: { n:"SerAuxTrend" },
- 0x104e: { n:"IFmtRecord" },
- 0x104f: { n:"Pos" },
- 0x1050: { n:"AlRuns" },
- 0x1051: { n:"BRAI" },
- 0x105b: { n:"SerAuxErrBar" },
- 0x105c: { n:"ClrtClient", f:parse_ClrtClient },
- 0x105d: { n:"SerFmt" },
- 0x105f: { n:"Chart3DBarShape" },
- 0x1060: { n:"Fbi" },
- 0x1061: { n:"BopPop" },
- 0x1062: { n:"AxcExt" },
- 0x1063: { n:"Dat" },
- 0x1064: { n:"PlotGrowth" },
- 0x1065: { n:"SIIndex" },
- 0x1066: { n:"GelFrame" },
- 0x1067: { n:"BopPopCustom" },
- 0x1068: { n:"Fbi2" },
-
- 0x0000: { n:"Dimensions", f:parse_Dimensions },
- 0x0002: { n:"BIFF2INT", f:parse_BIFF2INT },
- 0x0005: { n:"BoolErr", f:parse_BoolErr },
- 0x0007: { n:"String", f:parse_BIFF2STRING },
- 0x0008: { n:"BIFF2ROW" },
- 0x000b: { n:"Index" },
- 0x0016: { n:"ExternCount", f:parseuint16 },
- 0x001e: { n:"BIFF2FORMAT", f:parse_BIFF2Format },
- 0x001f: { n:"BIFF2FMTCNT" }, /* 16-bit cnt of BIFF2FORMAT records */
- 0x0020: { n:"BIFF2COLINFO" },
- 0x0021: { n:"Array", f:parse_Array },
- 0x0025: { n:"DefaultRowHeight", f:parse_DefaultRowHeight },
- 0x0032: { n:"BIFF2FONTXTRA", f:parse_BIFF2FONTXTRA },
- 0x0034: { n:"DDEObjName" },
- 0x003e: { n:"BIFF2WINDOW2" },
- 0x0043: { n:"BIFF2XF" },
- 0x0045: { n:"BIFF2FONTCLR" },
- 0x0056: { n:"BIFF4FMTCNT" }, /* 16-bit cnt, similar to BIFF2 */
- 0x007e: { n:"RK" }, /* Not necessarily same as 0x027e */
- 0x007f: { n:"ImData", f:parse_ImData },
- 0x0087: { n:"Addin" },
- 0x0088: { n:"Edg" },
- 0x0089: { n:"Pub" },
- 0x0091: { n:"Sub" },
- 0x0094: { n:"LHRecord" },
- 0x0095: { n:"LHNGraph" },
- 0x0096: { n:"Sound" },
- 0x00a9: { n:"CoordList" },
- 0x00ab: { n:"GCW" },
- 0x00bc: { n:"ShrFmla" }, /* Not necessarily same as 0x04bc */
- 0x00bf: { n:"ToolbarHdr" },
- 0x00c0: { n:"ToolbarEnd" },
- 0x00c2: { n:"AddMenu" },
- 0x00c3: { n:"DelMenu" },
- 0x00d6: { n:"RString", f:parse_RString },
- 0x00df: { n:"UDDesc" },
- 0x00ea: { n:"TabIdConf" },
- 0x0162: { n:"XL5Modify" },
- 0x01a5: { n:"FileSharing2" },
- 0x0209: { n:'BOF', f:parse_BOF },
- 0x0218: { n:"Lbl", f:parse_Lbl },
- 0x0223: { n:"ExternName", f:parse_ExternName },
- 0x0231: { n:"Font" },
- 0x0243: { n:"BIFF3XF" },
- 0x0409: { n:'BOF', f:parse_BOF },
- 0x0443: { n:"BIFF4XF" },
- 0x086d: { n:"FeatInfo" },
- 0x0873: { n:"FeatInfo11" },
- 0x0881: { n:"SXAddl12" },
- 0x08c0: { n:"AutoWebPub" },
- 0x08c1: { n:"ListObj" },
- 0x08c2: { n:"ListField" },
- 0x08c3: { n:"ListDV" },
- 0x08c4: { n:"ListCondFmt" },
- 0x08c5: { n:"ListCF" },
- 0x08c6: { n:"FMQry" },
- 0x08c7: { n:"FMSQry" },
- 0x08c8: { n:"PLV" },
- 0x08c9: { n:"LnExt" },
- 0x08ca: { n:"MkrExt" },
- 0x08cb: { n:"CrtCoopt" },
- 0x08d6: { n:"FRTArchId$", r:12 },
-
- 0x7262: {}
- };
-
- var XLSRE = evert_key(XLSRecordEnum, 'n');
- function write_biff_rec(ba, type, payload, length) {
- var t = +type || +XLSRE[type];
- if(isNaN(t)) return;
- var len = length || (payload||[]).length || 0;
- var o = ba.next(4);
- o.write_shift(2, t);
- o.write_shift(2, len);
- if(len > 0 && is_buf(payload)) ba.push(payload);
- }
-
- function write_BIFF2Cell(out, r, c) {
- if(!out) out = new_buf(7);
- out.write_shift(2, r);
- out.write_shift(2, c);
- out.write_shift(2, 0);
- out.write_shift(1, 0);
- return out;
- }
-
- function write_BIFF2BERR(r, c, val, t) {
- var out = new_buf(9);
- write_BIFF2Cell(out, r, c);
- if(t == 'e') { out.write_shift(1, val); out.write_shift(1, 1); }
- else { out.write_shift(1, val?1:0); out.write_shift(1, 0); }
- return out;
- }
-
- /* TODO: codepage, large strings */
- function write_BIFF2LABEL(r, c, val) {
- var out = new_buf(8 + 2*val.length);
- write_BIFF2Cell(out, r, c);
- out.write_shift(1, val.length);
- out.write_shift(val.length, val, 'sbcs');
- return out.l < out.length ? out.slice(0, out.l) : out;
- }
-
- function write_ws_biff2_cell(ba, cell, R, C) {
- if(cell.v != null) switch(cell.t) {
- case 'd': case 'n':
- var v = cell.t == 'd' ? datenum(parseDate(cell.v)) : cell.v;
- if((v == (v|0)) && (v >= 0) && (v < 65536))
- write_biff_rec(ba, 0x0002, write_BIFF2INT(R, C, v));
- else
- write_biff_rec(ba, 0x0003, write_BIFF2NUM(R,C, v));
- return;
- case 'b': case 'e': write_biff_rec(ba, 0x0005, write_BIFF2BERR(R, C, cell.v, cell.t)); return;
- /* TODO: codepage, sst */
- case 's': case 'str':
- write_biff_rec(ba, 0x0004, write_BIFF2LABEL(R, C, cell.v));
- return;
- }
- write_biff_rec(ba, 0x0001, write_BIFF2Cell(null, R, C));
- }
-
- function write_ws_biff2(ba, ws, idx, opts) {
- var dense = Array.isArray(ws);
- var range = safe_decode_range(ws['!ref'] || "A1"), ref, rr = "", cols = [];
- if(range.e.c > 0xFF || range.e.r > 0x3FFF) {
- if(opts.WTF) throw new Error("Range " + (ws['!ref'] || "A1") + " exceeds format limit A1:IV16384");
- range.e.c = Math.min(range.e.c, 0xFF);
- range.e.r = Math.min(range.e.c, 0x3FFF);
- ref = encode_range(range);
- }
- for(var R = range.s.r; R <= range.e.r; ++R) {
- rr = encode_row(R);
- for(var C = range.s.c; C <= range.e.c; ++C) {
- if(R === range.s.r) cols[C] = encode_col(C);
- ref = cols[C] + rr;
- var cell = dense ? (ws[R]||[])[C] : ws[ref];
- if(!cell) continue;
- /* write cell */
- write_ws_biff2_cell(ba, cell, R, C, opts);
- }
- }
- }
-
- /* Based on test files */
- function write_biff2_buf(wb, opts) {
- var o = opts || {};
- if(DENSE != null && o.dense == null) o.dense = DENSE;
- var ba = buf_array();
- var idx = 0;
- for(var i=0;i<wb.SheetNames.length;++i) if(wb.SheetNames[i] == o.sheet) idx=i;
- if(idx == 0 && !!o.sheet && wb.SheetNames[0] != o.sheet) throw new Error("Sheet not found: " + o.sheet);
- write_biff_rec(ba, 0x0009, write_BOF(wb, 0x10, o));
- /* ... */
- write_ws_biff2(ba, wb.Sheets[wb.SheetNames[idx]], idx, o, wb);
- /* ... */
- write_biff_rec(ba, 0x000A);
- return ba.end();
- }
-
- function write_FONTS_biff8(ba, data, opts) {
- write_biff_rec(ba, "Font", write_Font({
- sz:12,
- color: {theme:1},
- name: "Arial",
- family: 2,
- scheme: "minor"
- }, opts));
- }
-
-
- function write_FMTS_biff8(ba, NF, opts) {
- if(!NF) return;
- [[5,8],[23,26],[41,44],[/*63*/50,/*66],[164,*/392]].forEach(function(r) {
- for(var i = r[0]; i <= r[1]; ++i) if(NF[i] != null) write_biff_rec(ba, "Format", write_Format(i, NF[i], opts));
- });
- }
-
- function write_FEAT(ba, ws) {
- /* [MS-XLS] 2.4.112 */
- var o = new_buf(19);
- o.write_shift(4, 0x867); o.write_shift(4, 0); o.write_shift(4, 0);
- o.write_shift(2, 3); o.write_shift(1, 1); o.write_shift(4, 0);
- write_biff_rec(ba, "FeatHdr", o);
- /* [MS-XLS] 2.4.111 */
- o = new_buf(39);
- o.write_shift(4, 0x868); o.write_shift(4, 0); o.write_shift(4, 0);
- o.write_shift(2, 3); o.write_shift(1, 0); o.write_shift(4, 0);
- o.write_shift(2, 1); o.write_shift(4, 4); o.write_shift(2, 0);
- write_Ref8U(safe_decode_range(ws['!ref']||"A1"), o);
- o.write_shift(4, 4);
- write_biff_rec(ba, "Feat", o);
- }
-
- function write_CELLXFS_biff8(ba, opts) {
- for(var i = 0; i < 16; ++i) write_biff_rec(ba, "XF", write_XF({numFmtId:0, style:true}, 0, opts));
- opts.cellXfs.forEach(function(c) {
- write_biff_rec(ba, "XF", write_XF(c, 0, opts));
- });
- }
-
- function write_ws_biff8_hlinks(ba, ws) {
- for(var R=0; R<ws['!links'].length; ++R) {
- var HL = ws['!links'][R];
- write_biff_rec(ba, "HLink", write_HLink(HL));
- if(HL[1].Tooltip) write_biff_rec(ba, "HLinkTooltip", write_HLinkTooltip(HL));
- }
- delete ws['!links'];
- }
-
- function write_ws_biff8_cell(ba, cell, R, C, opts) {
- var os = 16 + get_cell_style(opts.cellXfs, cell, opts);
- if(cell.v == null && !cell.bf) {
- write_biff_rec(ba, "Blank", write_XLSCell(R, C, os));
- return;
- }
- if(cell.bf) write_biff_rec(ba, "Formula", write_Formula(cell, R, C, opts, os));
- else switch(cell.t) {
- case 'd': case 'n':
- var v = cell.t == 'd' ? datenum(parseDate(cell.v)) : cell.v;
- /* TODO: emit RK as appropriate */
- write_biff_rec(ba, "Number", write_Number(R, C, v, os, opts));
- break;
- case 'b': case 'e':
- write_biff_rec(ba, 0x0205, write_BoolErr(R, C, cell.v, os, opts, cell.t));
- break;
- /* TODO: codepage, sst */
- case 's': case 'str':
- write_biff_rec(ba, "Label", write_Label(R, C, cell.v, os, opts));
- break;
- default:
- write_biff_rec(ba, "Blank", write_XLSCell(R, C, os));
- }
- }
-
- /* [MS-XLS] 2.1.7.20.5 */
- function write_ws_biff8(idx, opts, wb) {
- var ba = buf_array();
- var s = wb.SheetNames[idx], ws = wb.Sheets[s] || {};
- var _WB = ((wb||{}).Workbook||{});
- var _sheet = ((_WB.Sheets||[])[idx]||{});
- var dense = Array.isArray(ws);
- var b8 = opts.biff == 8;
- var ref, rr = "", cols = [];
- var range = safe_decode_range(ws['!ref'] || "A1");
- var MAX_ROWS = b8 ? 65536 : 16384;
- if(range.e.c > 0xFF || range.e.r >= MAX_ROWS) {
- if(opts.WTF) throw new Error("Range " + (ws['!ref'] || "A1") + " exceeds format limit A1:IV16384");
- range.e.c = Math.min(range.e.c, 0xFF);
- range.e.r = Math.min(range.e.c, MAX_ROWS-1);
- }
-
- write_biff_rec(ba, 0x0809, write_BOF(wb, 0x10, opts));
- /* [Uncalced] Index */
- write_biff_rec(ba, "CalcMode", writeuint16(1));
- write_biff_rec(ba, "CalcCount", writeuint16(100));
- write_biff_rec(ba, "CalcRefMode", writebool(true));
- write_biff_rec(ba, "CalcIter", writebool(false));
- write_biff_rec(ba, "CalcDelta", write_Xnum(0.001));
- write_biff_rec(ba, "CalcSaveRecalc", writebool(true));
- write_biff_rec(ba, "PrintRowCol", writebool(false));
- write_biff_rec(ba, "PrintGrid", writebool(false));
- write_biff_rec(ba, "GridSet", writeuint16(1));
- write_biff_rec(ba, "Guts", write_Guts([0,0]));
- /* DefaultRowHeight WsBool [Sync] [LPr] [HorizontalPageBreaks] [VerticalPageBreaks] */
- /* Header (string) */
- /* Footer (string) */
- write_biff_rec(ba, "HCenter", writebool(false));
- write_biff_rec(ba, "VCenter", writebool(false));
- /* ... */
- write_biff_rec(ba, 0x200, write_Dimensions(range, opts));
- /* ... */
-
- if(b8) ws['!links'] = [];
- for(var R = range.s.r; R <= range.e.r; ++R) {
- rr = encode_row(R);
- for(var C = range.s.c; C <= range.e.c; ++C) {
- if(R === range.s.r) cols[C] = encode_col(C);
- ref = cols[C] + rr;
- var cell = dense ? (ws[R]||[])[C] : ws[ref];
- if(!cell) continue;
- /* write cell */
- write_ws_biff8_cell(ba, cell, R, C, opts);
- if(b8 && cell.l) ws['!links'].push([ref, cell.l]);
- }
- }
- var cname = _sheet.CodeName || _sheet.name || s;
- /* ... */
- if(b8 && _WB.Views) write_biff_rec(ba, "Window2", write_Window2(_WB.Views[0]));
- /* ... */
- if(b8 && (ws['!merges']||[]).length) write_biff_rec(ba, "MergeCells", write_MergeCells(ws['!merges']));
- /* [LRng] *QUERYTABLE [PHONETICINFO] CONDFMTS */
- if(b8) write_ws_biff8_hlinks(ba, ws);
- /* [DVAL] */
- write_biff_rec(ba, "CodeName", write_XLUnicodeString(cname, opts));
- /* *WebPub *CellWatch [SheetExt] */
- if(b8) write_FEAT(ba, ws);
- /* *FEAT11 *RECORD12 */
- write_biff_rec(ba, "EOF");
- return ba.end();
- }
-
- /* [MS-XLS] 2.1.7.20.3 */
- function write_biff8_global(wb, bufs, opts) {
- var A = buf_array();
- var _WB = ((wb||{}).Workbook||{});
- var _sheets = (_WB.Sheets||[]);
- var _wb = _WB.WBProps||{};
- var b8 = opts.biff == 8, b5 = opts.biff == 5;
- write_biff_rec(A, 0x0809, write_BOF(wb, 0x05, opts));
- if(opts.bookType == "xla") write_biff_rec(A, "Addin");
- write_biff_rec(A, "InterfaceHdr", b8 ? writeuint16(0x04b0) : null);
- write_biff_rec(A, "Mms", writezeroes(2));
- if(b5) write_biff_rec(A, "ToolbarHdr");
- if(b5) write_biff_rec(A, "ToolbarEnd");
- write_biff_rec(A, "InterfaceEnd");
- write_biff_rec(A, "WriteAccess", write_WriteAccess("SheetJS", opts));
- /* [FileSharing] */
- write_biff_rec(A, "CodePage", writeuint16(b8 ? 0x04b0 : 0x04E4));
- /* *2047 Lel */
- if(b8) write_biff_rec(A, "DSF", writeuint16(0));
- if(b8) write_biff_rec(A, "Excel9File");
- write_biff_rec(A, "RRTabId", write_RRTabId(wb.SheetNames.length));
- if(b8 && wb.vbaraw) write_biff_rec(A, "ObProj");
- /* [ObNoMacros] */
- if(b8 && wb.vbaraw) {
- var cname = _wb.CodeName || "ThisWorkbook";
- write_biff_rec(A, "CodeName", write_XLUnicodeString(cname, opts));
- }
- write_biff_rec(A, "BuiltInFnGroupCount", writeuint16(0x11));
- /* *FnGroupName *FnGrp12 */
- /* *Lbl */
- /* [OleObjectSize] */
- write_biff_rec(A, "WinProtect", writebool(false));
- write_biff_rec(A, "Protect", writebool(false));
- write_biff_rec(A, "Password", writeuint16(0));
- if(b8) write_biff_rec(A, "Prot4Rev", writebool(false));
- if(b8) write_biff_rec(A, "Prot4RevPass", writeuint16(0));
- write_biff_rec(A, "Window1", write_Window1(opts));
- write_biff_rec(A, "Backup", writebool(false));
- write_biff_rec(A, "HideObj", writeuint16(0));
- write_biff_rec(A, "Date1904", writebool(safe1904(wb)=="true"));
- write_biff_rec(A, "CalcPrecision", writebool(true));
- if(b8) write_biff_rec(A, "RefreshAll", writebool(false));
- write_biff_rec(A, "BookBool", writeuint16(0));
- /* ... */
- write_FONTS_biff8(A, wb, opts);
- write_FMTS_biff8(A, wb.SSF, opts);
- write_CELLXFS_biff8(A, opts);
- /* ... */
- if(b8) write_biff_rec(A, "UsesELFs", writebool(false));
- var a = A.end();
-
- var C = buf_array();
- /* METADATA [MTRSettings] [ForceFullCalculation] */
- if(b8) write_biff_rec(C, "Country", write_Country());
- /* *SUPBOOK *LBL *RTD [RecalcId] *HFPicture *MSODRAWINGGROUP */
- /* BIFF8: [SST *Continue] ExtSST */
- /* *WebPub [WOpt] [CrErr] [BookExt] *FeatHdr *DConn [THEME] [CompressPictures] [Compat12] [GUIDTypeLib] */
- write_biff_rec(C, "EOF");
- var c = C.end();
-
- var B = buf_array();
- var blen = 0, j = 0;
- for(j = 0; j < wb.SheetNames.length; ++j) blen += (b8 ? 12 : 11) + (b8 ? 2 : 1) * wb.SheetNames[j].length;
- var start = a.length + blen + c.length;
- for(j = 0; j < wb.SheetNames.length; ++j) {
- var _sheet = _sheets[j] || ({});
- write_biff_rec(B, "BoundSheet8", write_BoundSheet8({pos:start, hs:_sheet.Hidden||0, dt:0, name:wb.SheetNames[j]}, opts));
- start += bufs[j].length;
- }
- /* 1*BoundSheet8 */
- var b = B.end();
- if(blen != b.length) throw new Error("BS8 " + blen + " != " + b.length);
-
- var out = [];
- if(a.length) out.push(a);
- if(b.length) out.push(b);
- if(c.length) out.push(c);
- return __toBuffer([out]);
- }
-
- /* [MS-XLS] 2.1.7.20 Workbook Stream */
- function write_biff8_buf(wb, opts) {
- var o = opts || {};
- var bufs = [];
-
- if(wb && !wb.SSF) {
- wb.SSF = SSF.get_table();
- }
- if(wb && wb.SSF) {
- make_ssf(SSF); SSF.load_table(wb.SSF);
- // $FlowIgnore
- o.revssf = evert_num(wb.SSF); o.revssf[wb.SSF[65535]] = 0;
- o.ssf = wb.SSF;
- }
-
- o.Strings = []; o.Strings.Count = 0; o.Strings.Unique = 0;
- fix_write_opts(o);
-
- o.cellXfs = [];
- get_cell_style(o.cellXfs, {}, {revssf:{"General":0}});
-
- if(!wb.Props) wb.Props = {};
-
- for(var i = 0; i < wb.SheetNames.length; ++i) bufs[bufs.length] = write_ws_biff8(i, o, wb);
- bufs.unshift(write_biff8_global(wb, bufs, o));
- return __toBuffer([bufs]);
- }
-
- function write_biff_buf(wb, opts) {
- var o = opts || {};
- switch(o.biff || 2) {
- case 8: case 5: return write_biff8_buf(wb, opts);
- case 4: case 3: case 2: return write_biff2_buf(wb, opts);
- }
- throw new Error("invalid type " + o.bookType + " for BIFF");
- }
- /* note: browser DOM element cannot see mso- style attrs, must parse */
- var HTML_ = (function() {
- function html_to_sheet(str, _opts) {
- var opts = _opts || {};
- if(DENSE != null && opts.dense == null) opts.dense = DENSE;
- var ws = opts.dense ? ([]) : ({});
- str = str.replace(/<!--.*?-->/g, "");
- var mtch = str.match(/<table/i);
- if(!mtch) throw new Error("Invalid HTML: could not find <table>");
- var mtch2 = str.match(/<\/table/i);
- var i = mtch.index, j = mtch2 && mtch2.index || str.length;
- var rows = split_regex(str.slice(i, j), /(:?<tr[^>]*>)/i, "<tr>");
- var R = -1, C = 0, RS = 0, CS = 0;
- var range = {s:{r:10000000, c:10000000},e:{r:0,c:0}};
- var merges = [];
- for(i = 0; i < rows.length; ++i) {
- var row = rows[i].trim();
- var hd = row.slice(0,3).toLowerCase();
- if(hd == "<tr") { ++R; if(opts.sheetRows && opts.sheetRows <= R) { --R; break; } C = 0; continue; }
- if(hd != "<td" && hd != "<th") continue;
- var cells = row.split(/<\/t[dh]>/i);
- for(j = 0; j < cells.length; ++j) {
- var cell = cells[j].trim();
- if(!cell.match(/<t[dh]/i)) continue;
- var m = cell, cc = 0;
- /* TODO: parse styles etc */
- while(m.charAt(0) == "<" && (cc = m.indexOf(">")) > -1) m = m.slice(cc+1);
- for(var midx = 0; midx < merges.length; ++midx) {
- var _merge = merges[midx];
- if(_merge.s.c == C && _merge.s.r < R && R <= _merge.e.r) { C = _merge.e.c + 1; midx = -1; }
- }
- var tag = parsexmltag(cell.slice(0, cell.indexOf(">")));
- CS = tag.colspan ? +tag.colspan : 1;
- if((RS = +tag.rowspan)>1 || CS>1) merges.push({s:{r:R,c:C},e:{r:R + (RS||1) - 1, c:C + CS - 1}});
- var _t = tag.t || "";
- /* TODO: generate stub cells */
- if(!m.length) { C += CS; continue; }
- m = htmldecode(m);
- if(range.s.r > R) range.s.r = R; if(range.e.r < R) range.e.r = R;
- if(range.s.c > C) range.s.c = C; if(range.e.c < C) range.e.c = C;
- if(!m.length) continue;
- var o = {t:'s', v:m};
- if(opts.raw || !m.trim().length || _t == 's'){}
- else if(m === 'TRUE') o = {t:'b', v:true};
- else if(m === 'FALSE') o = {t:'b', v:false};
- else if(!isNaN(fuzzynum(m))) o = {t:'n', v:fuzzynum(m)};
- else if(!isNaN(fuzzydate(m).getDate())) {
- o = ({t:'d', v:parseDate(m)});
- if(!opts.cellDates) o = ({t:'n', v:datenum(o.v)});
- o.z = opts.dateNF || SSF._table[14];
- }
- if(opts.dense) { if(!ws[R]) ws[R] = []; ws[R][C] = o; }
- else ws[encode_cell({r:R, c:C})] = o;
- C += CS;
- }
- }
- ws['!ref'] = encode_range(range);
- if(merges.length) ws["!merges"] = merges;
- return ws;
- }
- function html_to_book(str, opts) {
- return sheet_to_workbook(html_to_sheet(str, opts), opts);
- }
- function make_html_row(ws, r, R, o) {
- var M = (ws['!merges'] ||[]);
- var oo = [];
- for(var C = r.s.c; C <= r.e.c; ++C) {
- var RS = 0, CS = 0;
- for(var j = 0; j < M.length; ++j) {
- if(M[j].s.r > R || M[j].s.c > C) continue;
- if(M[j].e.r < R || M[j].e.c < C) continue;
- if(M[j].s.r < R || M[j].s.c < C) { RS = -1; break; }
- RS = M[j].e.r - M[j].s.r + 1; CS = M[j].e.c - M[j].s.c + 1; break;
- }
- if(RS < 0) continue;
- var coord = encode_cell({r:R,c:C});
- var cell = o.dense ? (ws[R]||[])[C] : ws[coord];
- /* TODO: html entities */
- var w = (cell && cell.v != null) && (cell.h || escapehtml(cell.w || (format_cell(cell), cell.w) || "")) || "";
- var sp = ({});
- if(RS > 1) sp.rowspan = RS;
- if(CS > 1) sp.colspan = CS;
- sp.t = cell && cell.t || 'z';
- if(o.editable) w = '<span contenteditable="true">' + w + '</span>';
- sp.id = (o.id || "sjs") + "-" + coord;
- oo.push(writextag('td', w, sp));
- }
- var preamble = "<tr>";
- return preamble + oo.join("") + "</tr>";
- }
- function make_html_preamble(ws, R, o) {
- var out = [];
- return out.join("") + '<table' + (o && o.id ? ' id="' + o.id + '"' : "") + '>';
- }
- var _BEGIN = '<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>';
- var _END = '</body></html>';
- function sheet_to_html(ws, opts/*, wb:?Workbook*/) {
- var o = opts || {};
- var header = o.header != null ? o.header : _BEGIN;
- var footer = o.footer != null ? o.footer : _END;
- var out = [header];
- var r = decode_range(ws['!ref']);
- o.dense = Array.isArray(ws);
- out.push(make_html_preamble(ws, r, o));
- for(var R = r.s.r; R <= r.e.r; ++R) out.push(make_html_row(ws, r, R, o));
- out.push("</table>" + footer);
- return out.join("");
- }
-
- return {
- to_workbook: html_to_book,
- to_sheet: html_to_sheet,
- _row: make_html_row,
- BEGIN: _BEGIN,
- END: _END,
- _preamble: make_html_preamble,
- from_sheet: sheet_to_html
- };
- })();
-
- function parse_dom_table(table, _opts) {
- var opts = _opts || {};
- if(DENSE != null) opts.dense = DENSE;
- var ws = opts.dense ? ([]) : ({});
- var rows = table.getElementsByTagName('tr');
- var sheetRows = opts.sheetRows || 10000000;
- var range = {s:{r:0,c:0},e:{r:0,c:0}};
- var merges = [], midx = 0;
- var rowinfo = [];
- var _R = 0, R = 0, _C = 0, C = 0, RS = 0, CS = 0;
- for(; _R < rows.length && R < sheetRows; ++_R) {
- var row = rows[_R];
- if (is_dom_element_hidden(row)) {
- if (opts.display) continue;
- rowinfo[R] = {hidden: true};
- }
- var elts = (row.children);
- for(_C = C = 0; _C < elts.length; ++_C) {
- var elt = elts[_C];
- if (opts.display && is_dom_element_hidden(elt)) continue;
- var v = htmldecode(elt.innerHTML);
- for(midx = 0; midx < merges.length; ++midx) {
- var m = merges[midx];
- if(m.s.c == C && m.s.r <= R && R <= m.e.r) { C = m.e.c+1; midx = -1; }
- }
- /* TODO: figure out how to extract nonstandard mso- style */
- CS = +elt.getAttribute("colspan") || 1;
- if((RS = +elt.getAttribute("rowspan"))>0 || CS>1) merges.push({s:{r:R,c:C},e:{r:R + (RS||1) - 1, c:C + CS - 1}});
- var o = {t:'s', v:v};
- var _t = elt.getAttribute("t") || "";
- if(v != null) {
- if(v.length == 0) o.t = _t || 'z';
- else if(opts.raw || v.trim().length == 0 || _t == "s"){}
- else if(v === 'TRUE') o = {t:'b', v:true};
- else if(v === 'FALSE') o = {t:'b', v:false};
- else if(!isNaN(fuzzynum(v))) o = {t:'n', v:fuzzynum(v)};
- else if(!isNaN(fuzzydate(v).getDate())) {
- o = ({t:'d', v:parseDate(v)});
- if(!opts.cellDates) o = ({t:'n', v:datenum(o.v)});
- o.z = opts.dateNF || SSF._table[14];
- }
- }
- if(opts.dense) { if(!ws[R]) ws[R] = []; ws[R][C] = o; }
- else ws[encode_cell({c:C, r:R})] = o;
- if(range.e.c < C) range.e.c = C;
- C += CS;
- }
- ++R;
- }
- if(merges.length) ws['!merges'] = merges;
- if(rowinfo.length) ws['!rows'] = rowinfo;
- range.e.r = R - 1;
- ws['!ref'] = encode_range(range);
- if(R >= sheetRows) ws['!fullref'] = encode_range((range.e.r = rows.length-_R+R-1,range)); // We can count the real number of rows to parse but we don't to improve the performance
- return ws;
- }
-
- function table_to_book(table, opts) {
- return sheet_to_workbook(parse_dom_table(table, opts), opts);
- }
-
- function is_dom_element_hidden(element) {
- var display = '';
- var get_computed_style = get_get_computed_style_function(element);
- if(get_computed_style) display = get_computed_style(element).getPropertyValue('display');
- if(!display) display = element.style.display; // Fallback for cases when getComputedStyle is not available (e.g. an old browser or some Node.js environments) or doesn't work (e.g. if the element is not inserted to a document)
- return display === 'none';
- }
-
- /* global getComputedStyle */
- function get_get_computed_style_function(element) {
- // The proper getComputedStyle implementation is the one defined in the element window
- if(element.ownerDocument.defaultView && typeof element.ownerDocument.defaultView.getComputedStyle === 'function') return element.ownerDocument.defaultView.getComputedStyle;
- // If it is not available, try to get one from the global namespace
- if(typeof getComputedStyle === 'function') return getComputedStyle;
- return null;
- }
- /* OpenDocument */
- var parse_content_xml = (function() {
-
- var parse_text_p = function(text) {
- /* 6.1.2 White Space Characters */
- var fixed = text
- .replace(/[\t\r\n]/g, " ").trim().replace(/ +/g, " ")
- .replace(/<text:s\/>/g," ")
- .replace(/<text:s text:c="(\d+)"\/>/g, function($$,$1) { return Array(parseInt($1,10)+1).join(" "); })
- .replace(/<text:tab[^>]*\/>/g,"\t")
- .replace(/<text:line-break\/>/g,"\n");
- var v = unescapexml(fixed.replace(/<[^>]*>/g,""));
-
- return [v];
- };
-
- var number_formats = {
- /* ods name: [short ssf fmt, long ssf fmt] */
- day: ["d", "dd"],
- month: ["m", "mm"],
- year: ["y", "yy"],
- hours: ["h", "hh"],
- minutes: ["m", "mm"],
- seconds: ["s", "ss"],
- "am-pm": ["A/P", "AM/PM"],
- "day-of-week": ["ddd", "dddd"],
- era: ["e", "ee"],
- /* there is no native representation of LO "Q" format */
- quarter: ["\\Qm", "m\\\"th quarter\""]
- };
-
- return function pcx(d, _opts) {
- var opts = _opts || {};
- if(DENSE != null && opts.dense == null) opts.dense = DENSE;
- var str = xlml_normalize(d);
- var state = [], tmp;
- var tag;
- var NFtag = {name:""}, NF = "", pidx = 0;
- var sheetag;
- var rowtag;
- var Sheets = {}, SheetNames = [];
- var ws = opts.dense ? ([]) : ({});
- var Rn, q;
- var ctag = ({value:""});
- var textp = "", textpidx = 0, textptag;
- var textR = [];
- var R = -1, C = -1, range = {s: {r:1000000,c:10000000}, e: {r:0, c:0}};
- var row_ol = 0;
- var number_format_map = {};
- var merges = [], mrange = {}, mR = 0, mC = 0;
- var rowinfo = [], rowpeat = 1, colpeat = 1;
- var arrayf = [];
- var WB = {Names:[]};
- var atag = ({});
- var _Ref = ["", ""];
- var comments = [], comment = ({});
- var creator = "", creatoridx = 0;
- var isstub = false, intable = false;
- var i = 0;
- xlmlregex.lastIndex = 0;
- str = str.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");
- while((Rn = xlmlregex.exec(str))) switch((Rn[3]=Rn[3].replace(/_.*$/,""))) {
-
- case 'table': case '工作表': // 9.1.2 <table:table>
- if(Rn[1]==='/') {
- if(range.e.c >= range.s.c && range.e.r >= range.s.r) ws['!ref'] = encode_range(range);
- if(opts.sheetRows > 0 && opts.sheetRows <= range.e.r) {
- ws['!fullref'] = ws['!ref'];
- range.e.r = opts.sheetRows - 1;
- ws['!ref'] = encode_range(range);
- }
- if(merges.length) ws['!merges'] = merges;
- if(rowinfo.length) ws["!rows"] = rowinfo;
- sheetag.name = sheetag['名称'] || sheetag.name;
- if(typeof JSON !== 'undefined') JSON.stringify(sheetag);
- SheetNames.push(sheetag.name);
- Sheets[sheetag.name] = ws;
- intable = false;
- }
- else if(Rn[0].charAt(Rn[0].length-2) !== '/') {
- sheetag = parsexmltag(Rn[0], false);
- R = C = -1;
- range.s.r = range.s.c = 10000000; range.e.r = range.e.c = 0;
- ws = opts.dense ? ([]) : ({}); merges = [];
- rowinfo = [];
- intable = true;
- }
- break;
-
- case 'table-row-group': // 9.1.9 <table:table-row-group>
- if(Rn[1] === "/") --row_ol; else ++row_ol;
- break;
- case 'table-row': case '行': // 9.1.3 <table:table-row>
- if(Rn[1] === '/') { R+=rowpeat; rowpeat = 1; break; }
- rowtag = parsexmltag(Rn[0], false);
- if(rowtag['行号']) R = rowtag['行号'] - 1; else if(R == -1) R = 0;
- rowpeat = +rowtag['number-rows-repeated'] || 1;
- /* TODO: remove magic */
- if(rowpeat < 10) for(i = 0; i < rowpeat; ++i) if(row_ol > 0) rowinfo[R + i] = {level: row_ol};
- C = -1; break;
- case 'covered-table-cell': // 9.1.5 <table:covered-table-cell>
- if(Rn[1] !== '/') ++C;
- if(opts.sheetStubs) {
- if(opts.dense) { if(!ws[R]) ws[R] = []; ws[R][C] = {t:'z'}; }
- else ws[encode_cell({r:R,c:C})] = {t:'z'};
- }
- textp = ""; textR = [];
- break; /* stub */
- case 'table-cell': case '数据':
- if(Rn[0].charAt(Rn[0].length-2) === '/') {
- ++C;
- ctag = parsexmltag(Rn[0], false);
- colpeat = parseInt(ctag['number-columns-repeated']||"1", 10);
- q = ({t:'z', v:null});
- if(ctag.formula && opts.cellFormula != false) q.f = ods_to_csf_formula(unescapexml(ctag.formula));
- if((ctag['数据类型'] || ctag['value-type']) == "string") {
- q.t = "s"; q.v = unescapexml(ctag['string-value'] || "");
- if(opts.dense) {
- if(!ws[R]) ws[R] = [];
- ws[R][C] = q;
- } else {
- ws[encode_cell({r:R,c:C})] = q;
- }
- }
- C+= colpeat-1;
- } else if(Rn[1]!=='/') {
- ++C;
- colpeat = 1;
- var rptR = rowpeat ? R + rowpeat - 1 : R;
- if(C > range.e.c) range.e.c = C;
- if(C < range.s.c) range.s.c = C;
- if(R < range.s.r) range.s.r = R;
- if(rptR > range.e.r) range.e.r = rptR;
- ctag = parsexmltag(Rn[0], false);
- comments = []; comment = ({});
- q = ({t:ctag['数据类型'] || ctag['value-type'], v:null});
- if(opts.cellFormula) {
- if(ctag.formula) ctag.formula = unescapexml(ctag.formula);
- if(ctag['number-matrix-columns-spanned'] && ctag['number-matrix-rows-spanned']) {
- mR = parseInt(ctag['number-matrix-rows-spanned'],10) || 0;
- mC = parseInt(ctag['number-matrix-columns-spanned'],10) || 0;
- mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}};
- q.F = encode_range(mrange);
- arrayf.push([mrange, q.F]);
- }
- if(ctag.formula) q.f = ods_to_csf_formula(ctag.formula);
- else for(i = 0; i < arrayf.length; ++i)
- if(R >= arrayf[i][0].s.r && R <= arrayf[i][0].e.r)
- if(C >= arrayf[i][0].s.c && C <= arrayf[i][0].e.c)
- q.F = arrayf[i][1];
- }
- if(ctag['number-columns-spanned'] || ctag['number-rows-spanned']) {
- mR = parseInt(ctag['number-rows-spanned'],10) || 0;
- mC = parseInt(ctag['number-columns-spanned'],10) || 0;
- mrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}};
- merges.push(mrange);
- }
-
- /* 19.675.2 table:number-columns-repeated */
- if(ctag['number-columns-repeated']) colpeat = parseInt(ctag['number-columns-repeated'], 10);
-
- /* 19.385 office:value-type */
- switch(q.t) {
- case 'boolean': q.t = 'b'; q.v = parsexmlbool(ctag['boolean-value']); break;
- case 'float': q.t = 'n'; q.v = parseFloat(ctag.value); break;
- case 'percentage': q.t = 'n'; q.v = parseFloat(ctag.value); break;
- case 'currency': q.t = 'n'; q.v = parseFloat(ctag.value); break;
- case 'date': q.t = 'd'; q.v = parseDate(ctag['date-value']);
- if(!opts.cellDates) { q.t = 'n'; q.v = datenum(q.v); }
- q.z = 'm/d/yy'; break;
- case 'time': q.t = 'n'; q.v = parse_isodur(ctag['time-value'])/86400; break;
- case 'number': q.t = 'n'; q.v = parseFloat(ctag['数据数值']); break;
- default:
- if(q.t === 'string' || q.t === 'text' || !q.t) {
- q.t = 's';
- if(ctag['string-value'] != null) { textp = unescapexml(ctag['string-value']); textR = []; }
- } else throw new Error('Unsupported value type ' + q.t);
- }
- } else {
- isstub = false;
- if(q.t === 's') {
- q.v = textp || '';
- if(textR.length) q.R = textR;
- isstub = textpidx == 0;
- }
- if(atag.Target) q.l = atag;
- if(comments.length > 0) { q.c = comments; comments = []; }
- if(textp && opts.cellText !== false) q.w = textp;
- if(!isstub || opts.sheetStubs) {
- if(!(opts.sheetRows && opts.sheetRows <= R)) {
- for(var rpt = 0; rpt < rowpeat; ++rpt) {
- colpeat = parseInt(ctag['number-columns-repeated']||"1", 10);
- if(opts.dense) {
- if(!ws[R + rpt]) ws[R + rpt] = [];
- ws[R + rpt][C] = rpt == 0 ? q : dup(q);
- while(--colpeat > 0) ws[R + rpt][C + colpeat] = dup(q);
- } else {
- ws[encode_cell({r:R + rpt,c:C})] = q;
- while(--colpeat > 0) ws[encode_cell({r:R + rpt,c:C + colpeat})] = dup(q);
- }
- if(range.e.c <= C) range.e.c = C;
- }
- }
- }
- colpeat = parseInt(ctag['number-columns-repeated']||"1", 10);
- C += colpeat-1; colpeat = 0;
- q = {};
- textp = ""; textR = [];
- }
- atag = ({});
- break; // 9.1.4 <table:table-cell>
-
- /* pure state */
- case 'document': // TODO: <office:document> is the root for FODS
- case 'document-content': case '电子表格文档': // 3.1.3.2 <office:document-content>
- case 'spreadsheet': case '主体': // 3.7 <office:spreadsheet>
- case 'scripts': // 3.12 <office:scripts>
- case 'styles': // TODO <office:styles>
- case 'font-face-decls': // 3.14 <office:font-face-decls>
- if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;}
- else if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], true]);
- break;
-
- case 'annotation': // 14.1 <office:annotation>
- if(Rn[1]==='/'){
- if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;
- comment.t = textp;
- if(textR.length) comment.R = textR;
- comment.a = creator;
- comments.push(comment);
- }
- else if(Rn[0].charAt(Rn[0].length-2) !== '/') {state.push([Rn[3], false]);}
- creator = ""; creatoridx = 0;
- textp = ""; textpidx = 0; textR = [];
- break;
-
- case 'creator': // 4.3.2.7 <dc:creator>
- if(Rn[1]==='/') { creator = str.slice(creatoridx,Rn.index); }
- else creatoridx = Rn.index + Rn[0].length;
- break;
-
- /* ignore state */
- case 'meta': case '元数据': // TODO: <office:meta> <uof:元数据> FODS/UOF
- case 'settings': // TODO: <office:settings>
- case 'config-item-set': // TODO: <office:config-item-set>
- case 'config-item-map-indexed': // TODO: <office:config-item-map-indexed>
- case 'config-item-map-entry': // TODO: <office:config-item-map-entry>
- case 'config-item-map-named': // TODO: <office:config-item-map-entry>
- case 'shapes': // 9.2.8 <table:shapes>
- case 'frame': // 10.4.2 <draw:frame>
- case 'text-box': // 10.4.3 <draw:text-box>
- case 'image': // 10.4.4 <draw:image>
- case 'data-pilot-tables': // 9.6.2 <table:data-pilot-tables>
- case 'list-style': // 16.30 <text:list-style>
- case 'form': // 13.13 <form:form>
- case 'dde-links': // 9.8 <table:dde-links>
- case 'event-listeners': // TODO
- case 'chart': // TODO
- if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;}
- else if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], false]);
- textp = ""; textpidx = 0; textR = [];
- break;
-
- case 'scientific-number': // TODO: <number:scientific-number>
- break;
- case 'currency-symbol': // TODO: <number:currency-symbol>
- break;
- case 'currency-style': // TODO: <number:currency-style>
- break;
- case 'number-style': // 16.27.2 <number:number-style>
- case 'percentage-style': // 16.27.9 <number:percentage-style>
- case 'date-style': // 16.27.10 <number:date-style>
- case 'time-style': // 16.27.18 <number:time-style>
- if(Rn[1]==='/'){
- number_format_map[NFtag.name] = NF;
- if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;
- } else if(Rn[0].charAt(Rn[0].length-2) !== '/') {
- NF = "";
- NFtag = parsexmltag(Rn[0], false);
- state.push([Rn[3], true]);
- } break;
-
- case 'script': break; // 3.13 <office:script>
- case 'libraries': break; // TODO: <ooo:libraries>
- case 'automatic-styles': break; // 3.15.3 <office:automatic-styles>
- case 'master-styles': break; // TODO: <office:master-styles>
-
- case 'default-style': // TODO: <style:default-style>
- case 'page-layout': break; // TODO: <style:page-layout>
- case 'style': // 16.2 <style:style>
- break;
- case 'map': break; // 16.3 <style:map>
- case 'font-face': break; // 16.21 <style:font-face>
-
- case 'paragraph-properties': break; // 17.6 <style:paragraph-properties>
- case 'table-properties': break; // 17.15 <style:table-properties>
- case 'table-column-properties': break; // 17.16 <style:table-column-properties>
- case 'table-row-properties': break; // 17.17 <style:table-row-properties>
- case 'table-cell-properties': break; // 17.18 <style:table-cell-properties>
-
- case 'number': // 16.27.3 <number:number>
- switch(state[state.length-1][0]) {
- case 'time-style':
- case 'date-style':
- tag = parsexmltag(Rn[0], false);
- NF += number_formats[Rn[3]][tag.style==='long'?1:0]; break;
- } break;
-
- case 'fraction': break; // TODO 16.27.6 <number:fraction>
-
- case 'day': // 16.27.11 <number:day>
- case 'month': // 16.27.12 <number:month>
- case 'year': // 16.27.13 <number:year>
- case 'era': // 16.27.14 <number:era>
- case 'day-of-week': // 16.27.15 <number:day-of-week>
- case 'week-of-year': // 16.27.16 <number:week-of-year>
- case 'quarter': // 16.27.17 <number:quarter>
- case 'hours': // 16.27.19 <number:hours>
- case 'minutes': // 16.27.20 <number:minutes>
- case 'seconds': // 16.27.21 <number:seconds>
- case 'am-pm': // 16.27.22 <number:am-pm>
- switch(state[state.length-1][0]) {
- case 'time-style':
- case 'date-style':
- tag = parsexmltag(Rn[0], false);
- NF += number_formats[Rn[3]][tag.style==='long'?1:0]; break;
- } break;
-
- case 'boolean-style': break; // 16.27.23 <number:boolean-style>
- case 'boolean': break; // 16.27.24 <number:boolean>
- case 'text-style': break; // 16.27.25 <number:text-style>
- case 'text': // 16.27.26 <number:text>
- if(Rn[0].slice(-2) === "/>") break;
- else if(Rn[1]==="/") switch(state[state.length-1][0]) {
- case 'number-style':
- case 'date-style':
- case 'time-style':
- NF += str.slice(pidx, Rn.index);
- break;
- }
- else pidx = Rn.index + Rn[0].length;
- break;
-
- case 'named-range': // 9.4.12 <table:named-range>
- tag = parsexmltag(Rn[0], false);
- _Ref = ods_to_csf_3D(tag['cell-range-address']);
- var nrange = ({Name:tag.name, Ref:_Ref[0] + '!' + _Ref[1]});
- if(intable) nrange.Sheet = SheetNames.length;
- WB.Names.push(nrange);
- break;
-
- case 'text-content': break; // 16.27.27 <number:text-content>
- case 'text-properties': break; // 16.27.27 <style:text-properties>
- case 'embedded-text': break; // 16.27.4 <number:embedded-text>
-
- case 'body': case '电子表格': break; // 3.3 16.9.6 19.726.3
-
- case 'forms': break; // 12.25.2 13.2
- case 'table-column': break; // 9.1.6 <table:table-column>
- case 'table-header-rows': break; // 9.1.7 <table:table-header-rows>
- case 'table-rows': break; // 9.1.12 <table:table-rows>
- /* TODO: outline levels */
- case 'table-column-group': break; // 9.1.10 <table:table-column-group>
- case 'table-header-columns': break; // 9.1.11 <table:table-header-columns>
- case 'table-columns': break; // 9.1.12 <table:table-columns>
-
- case 'null-date': break; // 9.4.2 <table:null-date> TODO: date1904
-
- case 'graphic-properties': break; // 17.21 <style:graphic-properties>
- case 'calculation-settings': break; // 9.4.1 <table:calculation-settings>
- case 'named-expressions': break; // 9.4.11 <table:named-expressions>
- case 'label-range': break; // 9.4.9 <table:label-range>
- case 'label-ranges': break; // 9.4.10 <table:label-ranges>
- case 'named-expression': break; // 9.4.13 <table:named-expression>
- case 'sort': break; // 9.4.19 <table:sort>
- case 'sort-by': break; // 9.4.20 <table:sort-by>
- case 'sort-groups': break; // 9.4.22 <table:sort-groups>
-
- case 'tab': break; // 6.1.4 <text:tab>
- case 'line-break': break; // 6.1.5 <text:line-break>
- case 'span': break; // 6.1.7 <text:span>
- case 'p': case '文本串': // 5.1.3 <text:p>
- if(Rn[1]==='/' && (!ctag || !ctag['string-value'])) {
- var ptp = parse_text_p(str.slice(textpidx,Rn.index), textptag);
- textp = (textp.length > 0 ? textp + "\n" : "") + ptp[0];
- } else { textptag = parsexmltag(Rn[0], false); textpidx = Rn.index + Rn[0].length; }
- break; // <text:p>
- case 's': break; // <text:s>
-
- case 'database-range': // 9.4.15 <table:database-range>
- if(Rn[1]==='/') break;
- try {
- _Ref = ods_to_csf_3D(parsexmltag(Rn[0])['target-range-address']);
- Sheets[_Ref[0]]['!autofilter'] = { ref:_Ref[1] };
- } catch(e) {/* empty */}
- break;
-
- case 'date': break; // <*:date>
-
- case 'object': break; // 10.4.6.2 <draw:object>
- case 'title': case '标题': break; // <*:title> OR <uof:标题>
- case 'desc': break; // <*:desc>
- case 'binary-data': break; // 10.4.5 TODO: b64 blob
-
- /* 9.2 Advanced Tables */
- case 'table-source': break; // 9.2.6
- case 'scenario': break; // 9.2.6
-
- case 'iteration': break; // 9.4.3 <table:iteration>
- case 'content-validations': break; // 9.4.4 <table:
- case 'content-validation': break; // 9.4.5 <table:
- case 'help-message': break; // 9.4.6 <table:
- case 'error-message': break; // 9.4.7 <table:
- case 'database-ranges': break; // 9.4.14 <table:database-ranges>
- case 'filter': break; // 9.5.2 <table:filter>
- case 'filter-and': break; // 9.5.3 <table:filter-and>
- case 'filter-or': break; // 9.5.4 <table:filter-or>
- case 'filter-condition': break; // 9.5.5 <table:filter-condition>
-
- case 'list-level-style-bullet': break; // 16.31 <text:
- case 'list-level-style-number': break; // 16.32 <text:
- case 'list-level-properties': break; // 17.19 <style:
-
- /* 7.3 Document Fields */
- case 'sender-firstname': // 7.3.6.2
- case 'sender-lastname': // 7.3.6.3
- case 'sender-initials': // 7.3.6.4
- case 'sender-title': // 7.3.6.5
- case 'sender-position': // 7.3.6.6
- case 'sender-email': // 7.3.6.7
- case 'sender-phone-private': // 7.3.6.8
- case 'sender-fax': // 7.3.6.9
- case 'sender-company': // 7.3.6.10
- case 'sender-phone-work': // 7.3.6.11
- case 'sender-street': // 7.3.6.12
- case 'sender-city': // 7.3.6.13
- case 'sender-postal-code': // 7.3.6.14
- case 'sender-country': // 7.3.6.15
- case 'sender-state-or-province': // 7.3.6.16
- case 'author-name': // 7.3.7.1
- case 'author-initials': // 7.3.7.2
- case 'chapter': // 7.3.8
- case 'file-name': // 7.3.9
- case 'template-name': // 7.3.9
- case 'sheet-name': // 7.3.9
- break;
-
- case 'event-listener':
- break;
- /* TODO: FODS Properties */
- case 'initial-creator':
- case 'creation-date':
- case 'print-date':
- case 'generator':
- case 'document-statistic':
- case 'user-defined':
- case 'editing-duration':
- case 'editing-cycles':
- break;
-
- /* TODO: FODS Config */
- case 'config-item':
- break;
-
- /* TODO: style tokens */
- case 'page-number': break; // TODO <text:page-number>
- case 'page-count': break; // TODO <text:page-count>
- case 'time': break; // TODO <text:time>
-
- /* 9.3 Advanced Table Cells */
- case 'cell-range-source': break; // 9.3.1 <table:
- case 'detective': break; // 9.3.2 <table:
- case 'operation': break; // 9.3.3 <table:
- case 'highlighted-range': break; // 9.3.4 <table:
-
- /* 9.6 Data Pilot Tables <table: */
- case 'data-pilot-table': // 9.6.3
- case 'source-cell-range': // 9.6.5
- case 'source-service': // 9.6.6
- case 'data-pilot-field': // 9.6.7
- case 'data-pilot-level': // 9.6.8
- case 'data-pilot-subtotals': // 9.6.9
- case 'data-pilot-subtotal': // 9.6.10
- case 'data-pilot-members': // 9.6.11
- case 'data-pilot-member': // 9.6.12
- case 'data-pilot-display-info': // 9.6.13
- case 'data-pilot-sort-info': // 9.6.14
- case 'data-pilot-layout-info': // 9.6.15
- case 'data-pilot-field-reference': // 9.6.16
- case 'data-pilot-groups': // 9.6.17
- case 'data-pilot-group': // 9.6.18
- case 'data-pilot-group-member': // 9.6.19
- break;
-
- /* 10.3 Drawing Shapes */
- case 'rect': // 10.3.2
- break;
-
- /* 14.6 DDE Connections */
- case 'dde-connection-decls': // 14.6.2 <text:
- case 'dde-connection-decl': // 14.6.3 <text:
- case 'dde-link': // 14.6.4 <table:
- case 'dde-source': // 14.6.5 <office:
- break;
-
- case 'properties': break; // 13.7 <form:properties>
- case 'property': break; // 13.8 <form:property>
-
- case 'a': // 6.1.8 hyperlink
- if(Rn[1]!== '/') {
- atag = parsexmltag(Rn[0], false);
- if(!atag.href) break;
- atag.Target = atag.href; delete atag.href;
- if(atag.Target.charAt(0) == "#" && atag.Target.indexOf(".") > -1) {
- _Ref = ods_to_csf_3D(atag.Target.slice(1));
- atag.Target = "#" + _Ref[0] + "!" + _Ref[1];
- }
- }
- break;
-
- /* non-standard */
- case 'table-protection': break;
- case 'data-pilot-grand-total': break; // <table:
- case 'office-document-common-attrs': break; // bare
- default: switch(Rn[2]) {
- case 'dc:': // TODO: properties
- case 'calcext:': // ignore undocumented extensions
- case 'loext:': // ignore undocumented extensions
- case 'ooo:': // ignore undocumented extensions
- case 'chartooo:': // ignore undocumented extensions
- case 'draw:': // TODO: drawing
- case 'style:': // TODO: styles
- case 'chart:': // TODO: charts
- case 'form:': // TODO: forms
- case 'uof:': // TODO: uof
- case '表:': // TODO: uof
- case '字:': // TODO: uof
- break;
- default: if(opts.WTF) throw new Error(Rn);
- }
- }
- var out = ({
- Sheets: Sheets,
- SheetNames: SheetNames,
- Workbook: WB
- });
- if(opts.bookSheets) delete out.Sheets;
- return out;
- };
- })();
-
- function parse_ods(zip, opts) {
- opts = opts || ({});
- var ods = !!safegetzipfile(zip, 'objectdata');
- if(ods) parse_manifest(getzipdata(zip, 'META-INF/manifest.xml'), opts);
- var content = getzipstr(zip, 'content.xml');
- if(!content) throw new Error("Missing content.xml in " + (ods ? "ODS" : "UOF")+ " file");
- var wb = parse_content_xml(ods ? content : utf8read(content), opts);
- if(safegetzipfile(zip, 'meta.xml')) wb.Props = parse_core_props(getzipdata(zip, 'meta.xml'));
- return wb;
- }
- function parse_fods(data, opts) {
- return parse_content_xml(data, opts);
- }
-
- /* OpenDocument */
- var write_styles_ods = (function() {
- var payload = '<office:document-styles ' + wxt_helper({
- 'xmlns:office': "urn:oasis:names:tc:opendocument:xmlns:office:1.0",
- 'xmlns:table': "urn:oasis:names:tc:opendocument:xmlns:table:1.0",
- 'xmlns:style': "urn:oasis:names:tc:opendocument:xmlns:style:1.0",
- 'xmlns:text': "urn:oasis:names:tc:opendocument:xmlns:text:1.0",
- 'xmlns:draw': "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
- 'xmlns:fo': "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",
- 'xmlns:xlink': "http://www.w3.org/1999/xlink",
- 'xmlns:dc': "http://purl.org/dc/elements/1.1/",
- 'xmlns:number': "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0",
- 'xmlns:svg': "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0",
- 'xmlns:of': "urn:oasis:names:tc:opendocument:xmlns:of:1.2",
- 'office:version': "1.2"
- }) + '></office:document-styles>';
- return function wso() {
- return XML_HEADER + payload;
- };
- })();
- var write_content_ods = (function() {
- /* 6.1.2 White Space Characters */
- var write_text_p = function(text) {
- return escapexml(text)
- .replace(/ +/g, function($$){return '<text:s text:c="'+$$.length+'"/>';})
- .replace(/\t/g, "<text:tab/>")
- .replace(/\n/g, "<text:line-break/>")
- .replace(/^ /, "<text:s/>").replace(/ $/, "<text:s/>");
- };
-
- var null_cell_xml = ' <table:table-cell />\n';
- var covered_cell_xml = ' <table:covered-table-cell/>\n';
- var write_ws = function(ws, wb, i) {
- /* Section 9 Tables */
- var o = [];
- o.push(' <table:table table:name="' + escapexml(wb.SheetNames[i]) + '">\n');
- var R=0,C=0, range = decode_range(ws['!ref']);
- var marr = ws['!merges'] || [], mi = 0;
- var dense = Array.isArray(ws);
- for(R = 0; R < range.s.r; ++R) o.push(' <table:table-row></table:table-row>\n');
- for(; R <= range.e.r; ++R) {
- o.push(' <table:table-row>\n');
- for(C=0; C < range.s.c; ++C) o.push(null_cell_xml);
- for(; C <= range.e.c; ++C) {
- var skip = false, ct = {}, textp = "";
- for(mi = 0; mi != marr.length; ++mi) {
- if(marr[mi].s.c > C) continue;
- if(marr[mi].s.r > R) continue;
- if(marr[mi].e.c < C) continue;
- if(marr[mi].e.r < R) continue;
- if(marr[mi].s.c != C || marr[mi].s.r != R) skip = true;
- ct['table:number-columns-spanned'] = (marr[mi].e.c - marr[mi].s.c + 1);
- ct['table:number-rows-spanned'] = (marr[mi].e.r - marr[mi].s.r + 1);
- break;
- }
- if(skip) { o.push(covered_cell_xml); continue; }
- var ref = encode_cell({r:R, c:C}), cell = dense ? (ws[R]||[])[C]: ws[ref];
- if(cell && cell.f) {
- ct['table:formula'] = escapexml(csf_to_ods_formula(cell.f));
- if(cell.F) {
- if(cell.F.slice(0, ref.length) == ref) {
- var _Fref = decode_range(cell.F);
- ct['table:number-matrix-columns-spanned'] = (_Fref.e.c - _Fref.s.c + 1);
- ct['table:number-matrix-rows-spanned'] = (_Fref.e.r - _Fref.s.r + 1);
- }
- }
- }
- if(!cell) { o.push(null_cell_xml); continue; }
- switch(cell.t) {
- case 'b':
- textp = (cell.v ? 'TRUE' : 'FALSE');
- ct['office:value-type'] = "boolean";
- ct['office:boolean-value'] = (cell.v ? 'true' : 'false');
- break;
- case 'n':
- textp = (cell.w||String(cell.v||0));
- ct['office:value-type'] = "float";
- ct['office:value'] = (cell.v||0);
- break;
- case 's': case 'str':
- textp = cell.v;
- ct['office:value-type'] = "string";
- break;
- case 'd':
- textp = (cell.w||(parseDate(cell.v).toISOString()));
- ct['office:value-type'] = "date";
- ct['office:date-value'] = (parseDate(cell.v).toISOString());
- ct['table:style-name'] = "ce1";
- break;
- //case 'e':
- default: o.push(null_cell_xml); continue;
- }
- var text_p = write_text_p(textp);
- if(cell.l && cell.l.Target) {
- var _tgt = cell.l.Target; _tgt = _tgt.charAt(0) == "#" ? "#" + csf_to_ods_3D(_tgt.slice(1)) : _tgt;
- text_p = writextag('text:a', text_p, {'xlink:href': _tgt});
- }
- o.push(' ' + writextag('table:table-cell', writextag('text:p', text_p, {}), ct) + '\n');
- }
- o.push(' </table:table-row>\n');
- }
- o.push(' </table:table>\n');
- return o.join("");
- };
-
- var write_automatic_styles_ods = function(o) {
- o.push(' <office:automatic-styles>\n');
- o.push(' <number:date-style style:name="N37" number:automatic-order="true">\n');
- o.push(' <number:month number:style="long"/>\n');
- o.push(' <number:text>/</number:text>\n');
- o.push(' <number:day number:style="long"/>\n');
- o.push(' <number:text>/</number:text>\n');
- o.push(' <number:year/>\n');
- o.push(' </number:date-style>\n');
- o.push(' <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N37"/>\n');
- o.push(' </office:automatic-styles>\n');
- };
-
- return function wcx(wb, opts) {
- var o = [XML_HEADER];
- /* 3.1.3.2 */
- var attr = wxt_helper({
- 'xmlns:office': "urn:oasis:names:tc:opendocument:xmlns:office:1.0",
- 'xmlns:table': "urn:oasis:names:tc:opendocument:xmlns:table:1.0",
- 'xmlns:style': "urn:oasis:names:tc:opendocument:xmlns:style:1.0",
- 'xmlns:text': "urn:oasis:names:tc:opendocument:xmlns:text:1.0",
- 'xmlns:draw': "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
- 'xmlns:fo': "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",
- 'xmlns:xlink': "http://www.w3.org/1999/xlink",
- 'xmlns:dc': "http://purl.org/dc/elements/1.1/",
- 'xmlns:meta': "urn:oasis:names:tc:opendocument:xmlns:meta:1.0",
- 'xmlns:number': "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0",
- 'xmlns:presentation': "urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",
- 'xmlns:svg': "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0",
- 'xmlns:chart': "urn:oasis:names:tc:opendocument:xmlns:chart:1.0",
- 'xmlns:dr3d': "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",
- 'xmlns:math': "http://www.w3.org/1998/Math/MathML",
- 'xmlns:form': "urn:oasis:names:tc:opendocument:xmlns:form:1.0",
- 'xmlns:script': "urn:oasis:names:tc:opendocument:xmlns:script:1.0",
- 'xmlns:ooo': "http://openoffice.org/2004/office",
- 'xmlns:ooow': "http://openoffice.org/2004/writer",
- 'xmlns:oooc': "http://openoffice.org/2004/calc",
- 'xmlns:dom': "http://www.w3.org/2001/xml-events",
- 'xmlns:xforms': "http://www.w3.org/2002/xforms",
- 'xmlns:xsd': "http://www.w3.org/2001/XMLSchema",
- 'xmlns:xsi': "http://www.w3.org/2001/XMLSchema-instance",
- 'xmlns:sheet': "urn:oasis:names:tc:opendocument:sh33tjs:1.0",
- 'xmlns:rpt': "http://openoffice.org/2005/report",
- 'xmlns:of': "urn:oasis:names:tc:opendocument:xmlns:of:1.2",
- 'xmlns:xhtml': "http://www.w3.org/1999/xhtml",
- 'xmlns:grddl': "http://www.w3.org/2003/g/data-view#",
- 'xmlns:tableooo': "http://openoffice.org/2009/table",
- 'xmlns:drawooo': "http://openoffice.org/2010/draw",
- 'xmlns:calcext': "urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0",
- 'xmlns:loext': "urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0",
- 'xmlns:field': "urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0",
- 'xmlns:formx': "urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0",
- 'xmlns:css3t': "http://www.w3.org/TR/css3-text/",
- 'office:version': "1.2"
- });
-
- var fods = wxt_helper({
- 'xmlns:config': "urn:oasis:names:tc:opendocument:xmlns:config:1.0",
- 'office:mimetype': "application/vnd.oasis.opendocument.spreadsheet"
- });
-
- if(opts.bookType == "fods") o.push('<office:document' + attr + fods + '>\n');
- else o.push('<office:document-content' + attr + '>\n');
- write_automatic_styles_ods(o);
- o.push(' <office:body>\n');
- o.push(' <office:spreadsheet>\n');
- for(var i = 0; i != wb.SheetNames.length; ++i) o.push(write_ws(wb.Sheets[wb.SheetNames[i]], wb, i, opts));
- o.push(' </office:spreadsheet>\n');
- o.push(' </office:body>\n');
- if(opts.bookType == "fods") o.push('</office:document>');
- else o.push('</office:document-content>');
- return o.join("");
- };
- })();
-
- function write_ods(wb, opts) {
- if(opts.bookType == "fods") return write_content_ods(wb, opts);
-
- var zip = zip_new();
- var f = "";
-
- var manifest = [];
- var rdf = [];
-
- /* Part 3 Section 3.3 MIME Media Type */
- f = "mimetype";
- zip_add_file(zip, f, "application/vnd.oasis.opendocument.spreadsheet");
-
- /* Part 1 Section 2.2 Documents */
- f = "content.xml";
- zip_add_file(zip, f, write_content_ods(wb, opts));
- manifest.push([f, "text/xml"]);
- rdf.push([f, "ContentFile"]);
-
- /* TODO: these are hard-coded styles to satiate excel */
- f = "styles.xml";
- zip_add_file(zip, f, write_styles_ods(wb, opts));
- manifest.push([f, "text/xml"]);
- rdf.push([f, "StylesFile"]);
-
- /* TODO: this is hard-coded to satiate excel */
- f = "meta.xml";
- zip_add_file(zip, f, write_meta_ods());
- manifest.push([f, "text/xml"]);
- rdf.push([f, "MetadataFile"]);
-
- /* Part 3 Section 6 Metadata Manifest File */
- f = "manifest.rdf";
- zip_add_file(zip, f, write_rdf(rdf/*, opts*/));
- manifest.push([f, "application/rdf+xml"]);
-
- /* Part 3 Section 4 Manifest File */
- f = "META-INF/manifest.xml";
- zip_add_file(zip, f, write_manifest(manifest/*, opts*/));
-
- return zip;
- }
-
- function write_sheet_index(wb, sheet) {
- if(!sheet) return 0;
- var idx = wb.SheetNames.indexOf(sheet);
- if(idx == -1) throw new Error("Sheet not found: " + sheet);
- return idx;
- }
-
- function write_obj_str(factory) {
- return function write_str(wb, o) {
- var idx = write_sheet_index(wb, o.sheet);
- return factory.from_sheet(wb.Sheets[wb.SheetNames[idx]], o, wb);
- };
- }
-
- var write_htm_str = write_obj_str(HTML_);
- var write_csv_str = write_obj_str({from_sheet:sheet_to_csv});
- var write_slk_str = write_obj_str(typeof SYLK !== "undefined" ? SYLK : {});
- var write_dif_str = write_obj_str(typeof DIF !== "undefined" ? DIF : {});
- var write_prn_str = write_obj_str(typeof PRN !== "undefined" ? PRN : {});
- var write_rtf_str = write_obj_str(typeof RTF !== "undefined" ? RTF : {});
- var write_txt_str = write_obj_str({from_sheet:sheet_to_txt});
- var write_dbf_buf = write_obj_str(typeof DBF !== "undefined" ? DBF : {});
- var write_eth_str = write_obj_str(typeof ETH !== "undefined" ? ETH : {});
-
- function fix_opts_func(defaults) {
- return function fix_opts(opts) {
- for(var i = 0; i != defaults.length; ++i) {
- var d = defaults[i];
- if(opts[d[0]] === undefined) opts[d[0]] = d[1];
- if(d[2] === 'n') opts[d[0]] = Number(opts[d[0]]);
- }
- };
- }
-
- var fix_read_opts = fix_opts_func([
- ['cellNF', false], /* emit cell number format string as .z */
- ['cellHTML', true], /* emit html string as .h */
- ['cellFormula', true], /* emit formulae as .f */
- ['cellStyles', false], /* emits style/theme as .s */
- ['cellText', true], /* emit formatted text as .w */
- ['cellDates', false], /* emit date cells with type `d` */
-
- ['sheetStubs', false], /* emit empty cells */
- ['sheetRows', 0, 'n'], /* read n rows (0 = read all rows) */
-
- ['bookDeps', false], /* parse calculation chains */
- ['bookSheets', false], /* only try to get sheet names (no Sheets) */
- ['bookProps', false], /* only try to get properties (no Sheets) */
- ['bookFiles', false], /* include raw file structure (keys, files, cfb) */
- ['bookVBA', false], /* include vba raw data (vbaraw) */
-
- ['password',''], /* password */
- ['WTF', false] /* WTF mode (throws errors) */
- ]);
-
-
- var fix_write_opts = fix_opts_func([
- ['cellDates', false], /* write date cells with type `d` */
-
- ['bookSST', false], /* Generate Shared String Table */
-
- ['bookType', 'xlsx'], /* Type of workbook (xlsx/m/b) */
-
- ['compression', false], /* Use file compression */
-
- ['WTF', false] /* WTF mode (throws errors) */
- ]);
- function get_sheet_type(n) {
- if(RELS.WS.indexOf(n) > -1) return "sheet";
- if(RELS.CS && n == RELS.CS) return "chart";
- if(RELS.DS && n == RELS.DS) return "dialog";
- if(RELS.MS && n == RELS.MS) return "macro";
- return (n && n.length) ? n : "sheet";
- }
- function safe_parse_wbrels(wbrels, sheets) {
- if(!wbrels) return 0;
- try {
- wbrels = sheets.map(function pwbr(w) { if(!w.id) w.id = w.strRelID; return [w.name, wbrels['!id'][w.id].Target, get_sheet_type(wbrels['!id'][w.id].Type)]; });
- } catch(e) { return null; }
- return !wbrels || wbrels.length === 0 ? null : wbrels;
- }
-
- function safe_parse_sheet(zip, path, relsPath, sheet, idx, sheetRels, sheets, stype, opts, wb, themes, styles) {
- try {
- sheetRels[sheet]=parse_rels(getzipstr(zip, relsPath, true), path);
- var data = getzipdata(zip, path);
- var _ws;
- switch(stype) {
- case 'sheet': _ws = parse_ws(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); break;
- case 'chart': _ws = parse_cs(data, path, idx, opts, sheetRels[sheet], wb, themes, styles);
- if(!_ws || !_ws['!drawel']) break;
- var dfile = resolve_path(_ws['!drawel'].Target, path);
- var drelsp = get_rels_path(dfile);
- var draw = parse_drawing(getzipstr(zip, dfile, true), parse_rels(getzipstr(zip, drelsp, true), dfile));
- var chartp = resolve_path(draw, dfile);
- var crelsp = get_rels_path(chartp);
- _ws = parse_chart(getzipstr(zip, chartp, true), chartp, opts, parse_rels(getzipstr(zip, crelsp, true), chartp), wb, _ws);
- break;
- case 'macro': _ws = parse_ms(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); break;
- case 'dialog': _ws = parse_ds(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); break;
- default: throw new Error("Unrecognized sheet type " + stype);
- }
- sheets[sheet] = _ws;
-
- /* scan rels for comments */
- var comments = [];
- if(sheetRels && sheetRels[sheet]) keys(sheetRels[sheet]).forEach(function(n) {
- if(sheetRels[sheet][n].Type == RELS.CMNT) {
- var dfile = resolve_path(sheetRels[sheet][n].Target, path);
- comments = parse_cmnt(getzipdata(zip, dfile, true), dfile, opts);
- if(!comments || !comments.length) return;
- sheet_insert_comments(_ws, comments);
- }
- });
- } catch(e) { if(opts.WTF) throw e; }
- }
-
- function strip_front_slash(x) { return x.charAt(0) == '/' ? x.slice(1) : x; }
-
- function parse_zip(zip, opts) {
- make_ssf(SSF);
- opts = opts || {};
- fix_read_opts(opts);
-
- /* OpenDocument Part 3 Section 2.2.1 OpenDocument Package */
- if(safegetzipfile(zip, 'META-INF/manifest.xml')) return parse_ods(zip, opts);
- /* UOC */
- if(safegetzipfile(zip, 'objectdata.xml')) return parse_ods(zip, opts);
- /* Numbers */
- if(safegetzipfile(zip, 'Index/Document.iwa')) throw new Error('Unsupported NUMBERS file');
-
- var entries = zipentries(zip);
- var dir = parse_ct((getzipstr(zip, '[Content_Types].xml')));
- var xlsb = false;
- var sheets, binname;
- if(dir.workbooks.length === 0) {
- binname = "xl/workbook.xml";
- if(getzipdata(zip,binname, true)) dir.workbooks.push(binname);
- }
- if(dir.workbooks.length === 0) {
- binname = "xl/workbook.bin";
- if(!getzipdata(zip,binname,true)) throw new Error("Could not find workbook");
- dir.workbooks.push(binname);
- xlsb = true;
- }
- if(dir.workbooks[0].slice(-3) == "bin") xlsb = true;
-
- var themes = ({});
- var styles = ({});
- if(!opts.bookSheets && !opts.bookProps) {
- strs = [];
- if(dir.sst) try { strs=parse_sst(getzipdata(zip, strip_front_slash(dir.sst)), dir.sst, opts); } catch(e) { if(opts.WTF) throw e; }
-
- if(opts.cellStyles && dir.themes.length) themes = parse_theme(getzipstr(zip, dir.themes[0].replace(/^\//,''), true)||"",dir.themes[0], opts);
-
- if(dir.style) styles = parse_sty(getzipdata(zip, strip_front_slash(dir.style)), dir.style, themes, opts);
- }
-
- /*var externbooks = */dir.links.map(function(link) {
- try {
- var rels = parse_rels(getzipstr(zip, get_rels_path(strip_front_slash(link))), link);
- return parse_xlink(getzipdata(zip, strip_front_slash(link)), rels, link, opts);
- } catch(e) {}
- });
-
- var wb = parse_wb(getzipdata(zip, strip_front_slash(dir.workbooks[0])), dir.workbooks[0], opts);
-
- var props = {}, propdata = "";
-
- if(dir.coreprops.length) {
- propdata = getzipdata(zip, strip_front_slash(dir.coreprops[0]), true);
- if(propdata) props = parse_core_props(propdata);
- if(dir.extprops.length !== 0) {
- propdata = getzipdata(zip, strip_front_slash(dir.extprops[0]), true);
- if(propdata) parse_ext_props(propdata, props, opts);
- }
- }
-
- var custprops = {};
- if(!opts.bookSheets || opts.bookProps) {
- if (dir.custprops.length !== 0) {
- propdata = getzipstr(zip, strip_front_slash(dir.custprops[0]), true);
- if(propdata) custprops = parse_cust_props(propdata, opts);
- }
- }
-
- var out = ({});
- if(opts.bookSheets || opts.bookProps) {
- if(wb.Sheets) sheets = wb.Sheets.map(function pluck(x){ return x.name; });
- else if(props.Worksheets && props.SheetNames.length > 0) sheets=props.SheetNames;
- if(opts.bookProps) { out.Props = props; out.Custprops = custprops; }
- if(opts.bookSheets && typeof sheets !== 'undefined') out.SheetNames = sheets;
- if(opts.bookSheets ? out.SheetNames : opts.bookProps) return out;
- }
- sheets = {};
-
- var deps = {};
- if(opts.bookDeps && dir.calcchain) deps=parse_cc(getzipdata(zip, strip_front_slash(dir.calcchain)),dir.calcchain,opts);
-
- var i=0;
- var sheetRels = ({});
- var path, relsPath;
-
- {
- var wbsheets = wb.Sheets;
- props.Worksheets = wbsheets.length;
- props.SheetNames = [];
- for(var j = 0; j != wbsheets.length; ++j) {
- props.SheetNames[j] = wbsheets[j].name;
- }
- }
-
- var wbext = xlsb ? "bin" : "xml";
- var wbrelsi = dir.workbooks[0].lastIndexOf("/");
- var wbrelsfile = (dir.workbooks[0].slice(0, wbrelsi+1) + "_rels/" + dir.workbooks[0].slice(wbrelsi+1) + ".rels").replace(/^\//,"");
- if(!safegetzipfile(zip, wbrelsfile)) wbrelsfile = 'xl/_rels/workbook.' + wbext + '.rels';
- var wbrels = parse_rels(getzipstr(zip, wbrelsfile, true), wbrelsfile);
- if(wbrels) wbrels = safe_parse_wbrels(wbrels, wb.Sheets);
-
- /* Numbers iOS hack */
- var nmode = (getzipdata(zip,"xl/worksheets/sheet.xml",true))?1:0;
- for(i = 0; i != props.Worksheets; ++i) {
- var stype = "sheet";
- if(wbrels && wbrels[i]) {
- path = 'xl/' + (wbrels[i][1]).replace(/[\/]?xl\//, "");
- if(!safegetzipfile(zip, path)) path = wbrels[i][1];
- if(!safegetzipfile(zip, path)) path = wbrelsfile.replace(/_rels\/.*$/,"") + wbrels[i][1];
- stype = wbrels[i][2];
- } else {
- path = 'xl/worksheets/sheet'+(i+1-nmode)+"." + wbext;
- path = path.replace(/sheet0\./,"sheet.");
- }
- relsPath = path.replace(/^(.*)(\/)([^\/]*)$/, "$1/_rels/$3.rels");
- safe_parse_sheet(zip, path, relsPath, props.SheetNames[i], i, sheetRels, sheets, stype, opts, wb, themes, styles);
- }
-
- out = ({
- Directory: dir,
- Workbook: wb,
- Props: props,
- Custprops: custprops,
- Deps: deps,
- Sheets: sheets,
- SheetNames: props.SheetNames,
- Strings: strs,
- Styles: styles,
- Themes: themes,
- SSF: SSF.get_table()
- });
- if(opts.bookFiles) {
- out.keys = entries;
- out.files = zip.files;
- }
- if(opts.bookVBA) {
- if(dir.vba.length > 0) out.vbaraw = getzipdata(zip,strip_front_slash(dir.vba[0]),true);
- else if(dir.defaults && dir.defaults.bin === CT_VBA) out.vbaraw = getzipdata(zip, 'xl/vbaProject.bin',true);
- }
- return out;
- }
-
- /* [MS-OFFCRYPTO] 2.1.1 */
- function parse_xlsxcfb(cfb, _opts) {
- var opts = _opts || {};
- var f = 'Workbook', data = CFB.find(cfb, f);
- try {
- f = '/!DataSpaces/Version';
- data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f);
- /*var version = */parse_DataSpaceVersionInfo(data.content);
-
- /* 2.3.4.1 */
- f = '/!DataSpaces/DataSpaceMap';
- data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f);
- var dsm = parse_DataSpaceMap(data.content);
- if(dsm.length !== 1 || dsm[0].comps.length !== 1 || dsm[0].comps[0].t !== 0 || dsm[0].name !== "StrongEncryptionDataSpace" || dsm[0].comps[0].v !== "EncryptedPackage")
- throw new Error("ECMA-376 Encrypted file bad " + f);
-
- /* 2.3.4.2 */
- f = '/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace';
- data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f);
- var seds = parse_DataSpaceDefinition(data.content);
- if(seds.length != 1 || seds[0] != "StrongEncryptionTransform")
- throw new Error("ECMA-376 Encrypted file bad " + f);
-
- /* 2.3.4.3 */
- f = '/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary';
- data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f);
- /*var hdr = */parse_Primary(data.content);
- } catch(e) {}
-
- f = '/EncryptionInfo';
- data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f);
- var einfo = parse_EncryptionInfo(data.content);
-
- /* 2.3.4.4 */
- f = '/EncryptedPackage';
- data = CFB.find(cfb, f); if(!data || !data.content) throw new Error("ECMA-376 Encrypted file missing " + f);
-
- /*global decrypt_agile */
- if(einfo[0] == 0x04 && typeof decrypt_agile !== 'undefined') return decrypt_agile(einfo[1], data.content, opts.password || "", opts);
- /*global decrypt_std76 */
- if(einfo[0] == 0x02 && typeof decrypt_std76 !== 'undefined') return decrypt_std76(einfo[1], data.content, opts.password || "", opts);
- throw new Error("File is password-protected");
- }
-
- function write_zip(wb, opts) {
- _shapeid = 1024;
- if(opts.bookType == "ods") return write_ods(wb, opts);
- if(wb && !wb.SSF) {
- wb.SSF = SSF.get_table();
- }
- if(wb && wb.SSF) {
- make_ssf(SSF); SSF.load_table(wb.SSF);
- // $FlowIgnore
- opts.revssf = evert_num(wb.SSF); opts.revssf[wb.SSF[65535]] = 0;
- opts.ssf = wb.SSF;
- }
- opts.rels = {}; opts.wbrels = {};
- opts.Strings = []; opts.Strings.Count = 0; opts.Strings.Unique = 0;
- if(browser_has_Map) opts.revStrings = new Map();
- else { opts.revStrings = {}; opts.revStrings.foo = []; delete opts.revStrings.foo; }
- var wbext = opts.bookType == "xlsb" ? "bin" : "xml";
- var vbafmt = VBAFMTS.indexOf(opts.bookType) > -1;
- var ct = new_ct();
- fix_write_opts(opts = opts || {});
- var zip = zip_new();
- var f = "", rId = 0;
-
- opts.cellXfs = [];
- get_cell_style(opts.cellXfs, {}, {revssf:{"General":0}});
-
- if(!wb.Props) wb.Props = {};
-
- f = "docProps/core.xml";
- zip_add_file(zip, f, write_core_props(wb.Props, opts));
- ct.coreprops.push(f);
- add_rels(opts.rels, 2, f, RELS.CORE_PROPS);
-
- f = "docProps/app.xml";
- if(wb.Props && wb.Props.SheetNames){/* empty */}
- else if(!wb.Workbook || !wb.Workbook.Sheets) wb.Props.SheetNames = wb.SheetNames;
- else {
- var _sn = [];
- for(var _i = 0; _i < wb.SheetNames.length; ++_i)
- if((wb.Workbook.Sheets[_i]||{}).Hidden != 2) _sn.push(wb.SheetNames[_i]);
- wb.Props.SheetNames = _sn;
- }
- wb.Props.Worksheets = wb.Props.SheetNames.length;
- zip_add_file(zip, f, write_ext_props(wb.Props, opts));
- ct.extprops.push(f);
- add_rels(opts.rels, 3, f, RELS.EXT_PROPS);
-
- if(wb.Custprops !== wb.Props && keys(wb.Custprops||{}).length > 0) {
- f = "docProps/custom.xml";
- zip_add_file(zip, f, write_cust_props(wb.Custprops, opts));
- ct.custprops.push(f);
- add_rels(opts.rels, 4, f, RELS.CUST_PROPS);
- }
-
- for(rId=1;rId <= wb.SheetNames.length; ++rId) {
- var wsrels = {'!id':{}};
- var ws = wb.Sheets[wb.SheetNames[rId-1]];
- var _type = (ws || {})["!type"] || "sheet";
- switch(_type) {
- case "chart":
- /* falls through */
- default:
- f = "xl/worksheets/sheet" + rId + "." + wbext;
- zip_add_file(zip, f, write_ws(rId-1, f, opts, wb, wsrels));
- ct.sheets.push(f);
- add_rels(opts.wbrels, -1, "worksheets/sheet" + rId + "." + wbext, RELS.WS[0]);
- }
-
- if(ws) {
- var comments = ws['!comments'];
- var need_vml = false;
- if(comments && comments.length > 0) {
- var cf = "xl/comments" + rId + "." + wbext;
- zip_add_file(zip, cf, write_cmnt(comments, cf, opts));
- ct.comments.push(cf);
- add_rels(wsrels, -1, "../comments" + rId + "." + wbext, RELS.CMNT);
- need_vml = true;
- }
- if(ws['!legacy']) {
- if(need_vml) zip_add_file(zip, "xl/drawings/vmlDrawing" + (rId) + ".vml", write_comments_vml(rId, ws['!comments']));
- }
- delete ws['!comments'];
- delete ws['!legacy'];
- }
-
- if(wsrels['!id'].rId1) zip_add_file(zip, get_rels_path(f), write_rels(wsrels));
- }
-
- if(opts.Strings != null && opts.Strings.length > 0) {
- f = "xl/sharedStrings." + wbext;
- zip_add_file(zip, f, write_sst(opts.Strings, f, opts));
- ct.strs.push(f);
- add_rels(opts.wbrels, -1, "sharedStrings." + wbext, RELS.SST);
- }
-
- f = "xl/workbook." + wbext;
- zip_add_file(zip, f, write_wb(wb, f, opts));
- ct.workbooks.push(f);
- add_rels(opts.rels, 1, f, RELS.WB);
-
- /* TODO: something more intelligent with themes */
-
- f = "xl/theme/theme1.xml";
- zip_add_file(zip, f, write_theme(wb.Themes, opts));
- ct.themes.push(f);
- add_rels(opts.wbrels, -1, "theme/theme1.xml", RELS.THEME);
-
- /* TODO: something more intelligent with styles */
-
- f = "xl/styles." + wbext;
- zip_add_file(zip, f, write_sty(wb, f, opts));
- ct.styles.push(f);
- add_rels(opts.wbrels, -1, "styles." + wbext, RELS.STY);
-
- if(wb.vbaraw && vbafmt) {
- f = "xl/vbaProject.bin";
- zip_add_file(zip, f, wb.vbaraw);
- ct.vba.push(f);
- add_rels(opts.wbrels, -1, "vbaProject.bin", RELS.VBA);
- }
-
- zip_add_file(zip, "[Content_Types].xml", write_ct(ct, opts));
- zip_add_file(zip, '_rels/.rels', write_rels(opts.rels));
- zip_add_file(zip, 'xl/_rels/workbook.' + wbext + '.rels', write_rels(opts.wbrels));
-
- delete opts.revssf; delete opts.ssf;
- return zip;
- }
- function firstbyte(f,o) {
- var x = "";
- switch((o||{}).type || "base64") {
- case 'buffer': return [f[0], f[1], f[2], f[3]];
- case 'base64': x = Base64.decode(f.slice(0,24)); break;
- case 'binary': x = f; break;
- case 'array': return [f[0], f[1], f[2], f[3]];
- default: throw new Error("Unrecognized type " + (o && o.type || "undefined"));
- }
- return [x.charCodeAt(0), x.charCodeAt(1), x.charCodeAt(2), x.charCodeAt(3)];
- }
-
- function read_cfb(cfb, opts) {
- if(CFB.find(cfb, "EncryptedPackage")) return parse_xlsxcfb(cfb, opts);
- return parse_xlscfb(cfb, opts);
- }
-
- function read_zip(data, opts) {
- var zip, d = data;
- var o = opts||{};
- if(!o.type) o.type = (has_buf && Buffer.isBuffer(data)) ? "buffer" : "base64";
- zip = zip_read(d, o);
- return parse_zip(zip, o);
- }
-
- function read_plaintext(data, o) {
- var i = 0;
- main: while(i < data.length) switch(data.charCodeAt(i)) {
- case 0x0A: case 0x0D: case 0x20: ++i; break;
- case 0x3C: return parse_xlml(data.slice(i),o);
- default: break main;
- }
- return PRN.to_workbook(data, o);
- }
-
- function read_plaintext_raw(data, o) {
- var str = "", bytes = firstbyte(data, o);
- switch(o.type) {
- case 'base64': str = Base64.decode(data); break;
- case 'binary': str = data; break;
- case 'buffer': str = data.toString('binary'); break;
- case 'array': str = cc2str(data); break;
- default: throw new Error("Unrecognized type " + o.type);
- }
- if(bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF) str = utf8read(str);
- return read_plaintext(str, o);
- }
-
- function read_utf16(data, o) {
- var d = data;
- if(o.type == 'base64') d = Base64.decode(d);
- d = cptable.utils.decode(1200, d.slice(2), 'str');
- o.type = "binary";
- return read_plaintext(d, o);
- }
-
- function bstrify(data) {
- return !data.match(/[^\x00-\x7F]/) ? data : utf8write(data);
- }
-
- function read_prn(data, d, o, str) {
- if(str) { o.type = "string"; return PRN.to_workbook(data, o); }
- return PRN.to_workbook(d, o);
- }
-
- function readSync(data, opts) {
- reset_cp();
- if(typeof ArrayBuffer !== 'undefined' && data instanceof ArrayBuffer) return readSync(new Uint8Array(data), opts);
- var d = data, n = [0,0,0,0], str = false;
- var o = opts||{};
- if(o.cellStyles) { o.cellNF = true; }
- _ssfopts = {};
- if(o.dateNF) _ssfopts.dateNF = o.dateNF;
- if(!o.type) o.type = (has_buf && Buffer.isBuffer(data)) ? "buffer" : "base64";
- if(o.type == "file") { o.type = has_buf ? "buffer" : "binary"; d = read_binary(data); }
- if(o.type == "string") { str = true; o.type = "binary"; o.codepage = 65001; d = bstrify(data); }
- if(o.type == 'array' && typeof Uint8Array !== 'undefined' && data instanceof Uint8Array && typeof ArrayBuffer !== 'undefined') {
- // $FlowIgnore
- var ab=new ArrayBuffer(3), vu=new Uint8Array(ab); vu.foo="bar";
- // $FlowIgnore
- if(!vu.foo) {o=dup(o); o.type='array'; return readSync(ab2a(d), o);}
- }
- switch((n = firstbyte(d, o))[0]) {
- case 0xD0: return read_cfb(CFB.read(d, o), o);
- case 0x09: if(n[1] <= 0x04) return parse_xlscfb(d, o); break;
- case 0x3C: return parse_xlml(d, o);
- case 0x49: if(n[1] === 0x44) return read_wb_ID(d, o); break;
- case 0x54: if(n[1] === 0x41 && n[2] === 0x42 && n[3] === 0x4C) return DIF.to_workbook(d, o); break;
- case 0x50: return (n[1] === 0x4B && n[2] < 0x09 && n[3] < 0x09) ? read_zip(d, o) : read_prn(data, d, o, str);
- case 0xEF: return n[3] === 0x3C ? parse_xlml(d, o) : read_prn(data, d, o, str);
- case 0xFF: if(n[1] === 0xFE) { return read_utf16(d, o); } break;
- case 0x00: if(n[1] === 0x00 && n[2] >= 0x02 && n[3] === 0x00) return WK_.to_workbook(d, o); break;
- case 0x03: case 0x83: case 0x8B: case 0x8C: return DBF.to_workbook(d, o);
- case 0x7B: if(n[1] === 0x5C && n[2] === 0x72 && n[3] === 0x74) return RTF.to_workbook(d, o); break;
- case 0x0A: case 0x0D: case 0x20: return read_plaintext_raw(d, o);
- }
- if(n[2] <= 12 && n[3] <= 31) return DBF.to_workbook(d, o);
- return read_prn(data, d, o, str);
- }
-
- function readFileSync(filename, opts) {
- var o = opts||{}; o.type = 'file';
- return readSync(filename, o);
- }
- function write_cfb_ctr(cfb, o) {
- switch(o.type) {
- case "base64": case "binary": break;
- case "buffer": case "array": o.type = ""; break;
- case "file": return write_dl(o.file, CFB.write(cfb, {type:has_buf ? 'buffer' : ""}));
- case "string": throw new Error("'string' output type invalid for '" + o.bookType + "' files");
- default: throw new Error("Unrecognized type " + o.type);
- }
- return CFB.write(cfb, o);
- }
-
- /*global encrypt_agile */
- function write_zip_type(wb, opts) {
- var o = opts||{};
- var z = write_zip(wb, o);
- var oopts = {};
- if(o.compression) oopts.compression = 'DEFLATE';
- if(o.password) oopts.type = has_buf ? "nodebuffer" : "string";
- else switch(o.type) {
- case "base64": oopts.type = "base64"; break;
- case "binary": oopts.type = "string"; break;
- case "string": throw new Error("'string' output type invalid for '" + o.bookType + "' files");
- case "buffer":
- case "file": oopts.type = has_buf ? "nodebuffer" : "string"; break;
- default: throw new Error("Unrecognized type " + o.type);
- }
- var out = z.FullPaths ? CFB.write(z, {fileType:"zip", type: {"nodebuffer": "buffer", "string": "binary"}[oopts.type] || oopts.type}) : z.generate(oopts);
- if(o.password && typeof encrypt_agile !== 'undefined') return write_cfb_ctr(encrypt_agile(out, o.password), o);
- if(o.type === "file") return write_dl(o.file, out);
- return o.type == "string" ? utf8read(out) : out;
- }
-
- function write_cfb_type(wb, opts) {
- var o = opts||{};
- var cfb = write_xlscfb(wb, o);
- return write_cfb_ctr(cfb, o);
- }
-
- function write_string_type(out, opts, bom) {
- if(!bom) bom = "";
- var o = bom + out;
- switch(opts.type) {
- case "base64": return Base64.encode(utf8write(o));
- case "binary": return utf8write(o);
- case "string": return out;
- case "file": return write_dl(opts.file, o, 'utf8');
- case "buffer": {
- if(has_buf) return Buffer_from(o, 'utf8');
- else return write_string_type(o, {type:'binary'}).split("").map(function(c) { return c.charCodeAt(0); });
- }
- }
- throw new Error("Unrecognized type " + opts.type);
- }
-
- function write_stxt_type(out, opts) {
- switch(opts.type) {
- case "base64": return Base64.encode(out);
- case "binary": return out;
- case "string": return out; /* override in sheet_to_txt */
- case "file": return write_dl(opts.file, out, 'binary');
- case "buffer": {
- if(has_buf) return Buffer_from(out, 'binary');
- else return out.split("").map(function(c) { return c.charCodeAt(0); });
- }
- }
- throw new Error("Unrecognized type " + opts.type);
- }
-
- /* TODO: test consistency */
- function write_binary_type(out, opts) {
- switch(opts.type) {
- case "string":
- case "base64":
- case "binary":
- var bstr = "";
- // $FlowIgnore
- for(var i = 0; i < out.length; ++i) bstr += String.fromCharCode(out[i]);
- return opts.type == 'base64' ? Base64.encode(bstr) : opts.type == 'string' ? utf8read(bstr) : bstr;
- case "file": return write_dl(opts.file, out);
- case "buffer": return out;
- default: throw new Error("Unrecognized type " + opts.type);
- }
- }
-
- function writeSync(wb, opts) {
- reset_cp();
- check_wb(wb);
- var o = opts||{};
- if(o.cellStyles) { o.cellNF = true; }
- if(o.type == "array") { o.type = "binary"; var out = (writeSync(wb, o)); o.type = "array"; return s2ab(out); }
- switch(o.bookType || 'xlsb') {
- case 'xml':
- case 'xlml': return write_string_type(write_xlml(wb, o), o);
- case 'slk':
- case 'sylk': return write_string_type(write_slk_str(wb, o), o);
- case 'htm':
- case 'html': return write_string_type(write_htm_str(wb, o), o);
- case 'txt': return write_stxt_type(write_txt_str(wb, o), o);
- case 'csv': return write_string_type(write_csv_str(wb, o), o, "\ufeff");
- case 'dif': return write_string_type(write_dif_str(wb, o), o);
- case 'dbf': return write_binary_type(write_dbf_buf(wb, o), o);
- case 'prn': return write_string_type(write_prn_str(wb, o), o);
- case 'rtf': return write_string_type(write_rtf_str(wb, o), o);
- case 'eth': return write_string_type(write_eth_str(wb, o), o);
- case 'fods': return write_string_type(write_ods(wb, o), o);
- case 'biff2': if(!o.biff) o.biff = 2; /* falls through */
- case 'biff3': if(!o.biff) o.biff = 3; /* falls through */
- case 'biff4': if(!o.biff) o.biff = 4; return write_binary_type(write_biff_buf(wb, o), o);
- case 'biff5': if(!o.biff) o.biff = 5; /* falls through */
- case 'biff8':
- case 'xla':
- case 'xls': if(!o.biff) o.biff = 8; return write_cfb_type(wb, o);
- case 'xlsx':
- case 'xlsm':
- case 'xlam':
- case 'xlsb':
- case 'ods': return write_zip_type(wb, o);
- default: throw new Error ("Unrecognized bookType |" + o.bookType + "|");
- }
- }
-
- function resolve_book_type(o) {
- if(o.bookType) return;
- var _BT = {
- "xls": "biff8",
- "htm": "html",
- "slk": "sylk",
- "socialcalc": "eth",
- "Sh33tJS": "WTF"
- };
- var ext = o.file.slice(o.file.lastIndexOf(".")).toLowerCase();
- if(ext.match(/^\.[a-z]+$/)) o.bookType = ext.slice(1);
- o.bookType = _BT[o.bookType] || o.bookType;
- }
-
- function writeFileSync(wb, filename, opts) {
- var o = opts||{}; o.type = 'file';
- o.file = filename;
- resolve_book_type(o);
- return writeSync(wb, o);
- }
-
- function writeFileAsync(filename, wb, opts, cb) {
- var o = opts||{}; o.type = 'file';
- o.file = filename;
- resolve_book_type(o);
- o.type = 'buffer';
- var _cb = cb; if(!(_cb instanceof Function)) _cb = (opts);
- return _fs.writeFile(filename, writeSync(wb, o), _cb);
- }
- function make_json_row(sheet, r, R, cols, header, hdr, dense, o) {
- var rr = encode_row(R);
- var defval = o.defval, raw = o.raw || !o.hasOwnProperty("raw");
- var isempty = true;
- var row = (header === 1) ? [] : {};
- if(header !== 1) {
- if(Object.defineProperty) try { Object.defineProperty(row, '__rowNum__', {value:R, enumerable:false}); } catch(e) { row.__rowNum__ = R; }
- else row.__rowNum__ = R;
- }
- if(!dense || sheet[R]) for (var C = r.s.c; C <= r.e.c; ++C) {
- var val = dense ? sheet[R][C] : sheet[cols[C] + rr];
- if(val === undefined || val.t === undefined) {
- if(defval === undefined) continue;
- if(hdr[C] != null) { row[hdr[C]] = defval; }
- continue;
- }
- var v = val.v;
- switch(val.t){
- case 'z': if(v == null) break; continue;
- case 'e': v = void 0; break;
- case 's': case 'd': case 'b': case 'n': break;
- default: throw new Error('unrecognized type ' + val.t);
- }
- if(hdr[C] != null) {
- if(v == null) {
- if(defval !== undefined) row[hdr[C]] = defval;
- else if(raw && v === null) row[hdr[C]] = null;
- else continue;
- } else {
- row[hdr[C]] = raw ? v : format_cell(val,v,o);
- }
- if(v != null) isempty = false;
- }
- }
- return { row: row, isempty: isempty };
- }
-
-
- function sheet_to_json(sheet, opts) {
- if(sheet == null || sheet["!ref"] == null) return [];
- var val = {t:'n',v:0}, header = 0, offset = 1, hdr = [], v=0, vv="";
- var r = {s:{r:0,c:0},e:{r:0,c:0}};
- var o = opts || {};
- var range = o.range != null ? o.range : sheet["!ref"];
- if(o.header === 1) header = 1;
- else if(o.header === "A") header = 2;
- else if(Array.isArray(o.header)) header = 3;
- else if(o.header == null) header = 0;
- switch(typeof range) {
- case 'string': r = safe_decode_range(range); break;
- case 'number': r = safe_decode_range(sheet["!ref"]); r.s.r = range; break;
- default: r = range;
- }
- if(header > 0) offset = 0;
- var rr = encode_row(r.s.r);
- var cols = [];
- var out = [];
- var outi = 0, counter = 0;
- var dense = Array.isArray(sheet);
- var R = r.s.r, C = 0, CC = 0;
- if(dense && !sheet[R]) sheet[R] = [];
- for(C = r.s.c; C <= r.e.c; ++C) {
- cols[C] = encode_col(C);
- val = dense ? sheet[R][C] : sheet[cols[C] + rr];
- switch(header) {
- case 1: hdr[C] = C - r.s.c; break;
- case 2: hdr[C] = cols[C]; break;
- case 3: hdr[C] = o.header[C - r.s.c]; break;
- default:
- if(val == null) val = {w: "__EMPTY", t: "s"};
- vv = v = format_cell(val, null, o);
- counter = 0;
- for(CC = 0; CC < hdr.length; ++CC) if(hdr[CC] == vv) vv = v + "_" + (++counter);
- hdr[C] = vv;
- }
- }
- for (R = r.s.r + offset; R <= r.e.r; ++R) {
- var row = make_json_row(sheet, r, R, cols, header, hdr, dense, o);
- if((row.isempty === false) || (header === 1 ? o.blankrows !== false : !!o.blankrows)) out[outi++] = row.row;
- }
- out.length = outi;
- return out;
- }
-
- var qreg = /"/g;
- function make_csv_row(sheet, r, R, cols, fs, rs, FS, o) {
- var isempty = true;
- var row = [], txt = "", rr = encode_row(R);
- for(var C = r.s.c; C <= r.e.c; ++C) {
- if (!cols[C]) continue;
- var val = o.dense ? (sheet[R]||[])[C]: sheet[cols[C] + rr];
- if(val == null) txt = "";
- else if(val.v != null) {
- isempty = false;
- txt = ''+format_cell(val, null, o);
- for(var i = 0, cc = 0; i !== txt.length; ++i) if((cc = txt.charCodeAt(i)) === fs || cc === rs || cc === 34) {txt = "\"" + txt.replace(qreg, '""') + "\""; break; }
- if(txt == "ID") txt = '"ID"';
- } else if(val.f != null && !val.F) {
- isempty = false;
- txt = '=' + val.f; if(txt.indexOf(",") >= 0) txt = '"' + txt.replace(qreg, '""') + '"';
- } else txt = "";
- /* NOTE: Excel CSV does not support array formulae */
- row.push(txt);
- }
- if(o.blankrows === false && isempty) return null;
- return row.join(FS);
- }
-
- function sheet_to_csv(sheet, opts) {
- var out = [];
- var o = opts == null ? {} : opts;
- if(sheet == null || sheet["!ref"] == null) return "";
- var r = safe_decode_range(sheet["!ref"]);
- var FS = o.FS !== undefined ? o.FS : ",", fs = FS.charCodeAt(0);
- var RS = o.RS !== undefined ? o.RS : "\n", rs = RS.charCodeAt(0);
- var endregex = new RegExp((FS=="|" ? "\\|" : FS)+"+$");
- var row = "", cols = [];
- o.dense = Array.isArray(sheet);
- var colinfo = o.skipHidden && sheet["!cols"] || [];
- var rowinfo = o.skipHidden && sheet["!rows"] || [];
- for(var C = r.s.c; C <= r.e.c; ++C) if (!((colinfo[C]||{}).hidden)) cols[C] = encode_col(C);
- for(var R = r.s.r; R <= r.e.r; ++R) {
- if ((rowinfo[R]||{}).hidden) continue;
- row = make_csv_row(sheet, r, R, cols, fs, rs, FS, o);
- if(row == null) { continue; }
- if(o.strip) row = row.replace(endregex,"");
- out.push(row + RS);
- }
- delete o.dense;
- return out.join("");
- }
-
- function sheet_to_txt(sheet, opts) {
- if(!opts) opts = {}; opts.FS = "\t"; opts.RS = "\n";
- var s = sheet_to_csv(sheet, opts);
- if(typeof cptable == 'undefined' || opts.type == 'string') return s;
- var o = cptable.utils.encode(1200, s, 'str');
- return String.fromCharCode(255) + String.fromCharCode(254) + o;
- }
-
- function sheet_to_formulae(sheet) {
- var y = "", x, val="";
- if(sheet == null || sheet["!ref"] == null) return [];
- var r = safe_decode_range(sheet['!ref']), rr = "", cols = [], C;
- var cmds = [];
- var dense = Array.isArray(sheet);
- for(C = r.s.c; C <= r.e.c; ++C) cols[C] = encode_col(C);
- for(var R = r.s.r; R <= r.e.r; ++R) {
- rr = encode_row(R);
- for(C = r.s.c; C <= r.e.c; ++C) {
- y = cols[C] + rr;
- x = dense ? (sheet[R]||[])[C] : sheet[y];
- val = "";
- if(x === undefined) continue;
- else if(x.F != null) {
- y = x.F;
- if(!x.f) continue;
- val = x.f;
- if(y.indexOf(":") == -1) y = y + ":" + y;
- }
- if(x.f != null) val = x.f;
- else if(x.t == 'z') continue;
- else if(x.t == 'n' && x.v != null) val = "" + x.v;
- else if(x.t == 'b') val = x.v ? "TRUE" : "FALSE";
- else if(x.w !== undefined) val = "'" + x.w;
- else if(x.v === undefined) continue;
- else if(x.t == 's') val = "'" + x.v;
- else val = ""+x.v;
- cmds[cmds.length] = y + "=" + val;
- }
- }
- return cmds;
- }
-
- function sheet_add_json(_ws, js, opts) {
- var o = opts || {};
- var offset = +!o.skipHeader;
- var ws = _ws || ({});
- var _R = 0, _C = 0;
- if(ws && o.origin != null) {
- if(typeof o.origin == 'number') _R = o.origin;
- else {
- var _origin = typeof o.origin == "string" ? decode_cell(o.origin) : o.origin;
- _R = _origin.r; _C = _origin.c;
- }
- }
- var cell;
- var range = ({s: {c:0, r:0}, e: {c:_C, r:_R + js.length - 1 + offset}});
- if(ws['!ref']) {
- var _range = safe_decode_range(ws['!ref']);
- range.e.c = Math.max(range.e.c, _range.e.c);
- range.e.r = Math.max(range.e.r, _range.e.r);
- if(_R == -1) { _R = range.e.r + 1; range.e.r = _R + js.length - 1 + offset; }
- }
- var hdr = o.header || [], C = 0;
-
- js.forEach(function (JS, R) {
- keys(JS).forEach(function(k) {
- if((C=hdr.indexOf(k)) == -1) hdr[C=hdr.length] = k;
- var v = JS[k];
- var t = 'z';
- var z = "";
- var ref = encode_cell({c:_C + C,r:_R + R + offset});
- cell = utils.sheet_get_cell(ws, ref);
- if(v && typeof v === 'object' && !(v instanceof Date)){
- ws[ref] = v;
- } else {
- if(typeof v == 'number') t = 'n';
- else if(typeof v == 'boolean') t = 'b';
- else if(typeof v == 'string') t = 's';
- else if(v instanceof Date) {
- t = 'd';
- if(!o.cellDates) { t = 'n'; v = datenum(v); }
- z = (o.dateNF || SSF._table[14]);
- }
- if(!cell) ws[ref] = cell = ({t:t, v:v});
- else {
- cell.t = t; cell.v = v;
- delete cell.w; delete cell.R;
- if(z) cell.z = z;
- }
- if(z) cell.z = z;
- }
- });
- });
- range.e.c = Math.max(range.e.c, _C + hdr.length - 1);
- var __R = encode_row(_R);
- if(offset) for(C = 0; C < hdr.length; ++C) ws[encode_col(C + _C) + __R] = {t:'s', v:hdr[C]};
- ws['!ref'] = encode_range(range);
- return ws;
- }
- function json_to_sheet(js, opts) { return sheet_add_json(null, js, opts); }
-
- var utils = {
- encode_col: encode_col,
- encode_row: encode_row,
- encode_cell: encode_cell,
- encode_range: encode_range,
- decode_col: decode_col,
- decode_row: decode_row,
- split_cell: split_cell,
- decode_cell: decode_cell,
- decode_range: decode_range,
- format_cell: format_cell,
- get_formulae: sheet_to_formulae,
- make_csv: sheet_to_csv,
- make_json: sheet_to_json,
- make_formulae: sheet_to_formulae,
- sheet_add_aoa: sheet_add_aoa,
- sheet_add_json: sheet_add_json,
- aoa_to_sheet: aoa_to_sheet,
- json_to_sheet: json_to_sheet,
- table_to_sheet: parse_dom_table,
- table_to_book: table_to_book,
- sheet_to_csv: sheet_to_csv,
- sheet_to_txt: sheet_to_txt,
- sheet_to_json: sheet_to_json,
- sheet_to_html: HTML_.from_sheet,
- sheet_to_formulae: sheet_to_formulae,
- sheet_to_row_object_array: sheet_to_json
- };
-
- (function(utils) {
- utils.consts = utils.consts || {};
- function add_consts(R/*Array<any>*/) { R.forEach(function(a){ utils.consts[a[0]] = a[1]; }); }
-
- function get_default(x, y, z) { return x[y] != null ? x[y] : (x[y] = z); }
-
- /* get cell, creating a stub if necessary */
- function ws_get_cell_stub(ws, R, C) {
- /* A1 cell address */
- if(typeof R == "string") {
- /* dense */
- if(Array.isArray(ws)) {
- var RC = decode_cell(R);
- if(!ws[RC.r]) ws[RC.r] = [];
- return ws[RC.r][RC.c] || (ws[RC.r][RC.c] = {t:'z'});
- }
- return ws[R] || (ws[R] = {t:'z'});
- }
- /* cell address object */
- if(typeof R != "number") return ws_get_cell_stub(ws, encode_cell(R));
- /* R and C are 0-based indices */
- return ws_get_cell_stub(ws, encode_cell({r:R,c:C||0}));
- }
- utils.sheet_get_cell = ws_get_cell_stub;
-
- /* find sheet index for given name / validate index */
- function wb_sheet_idx(wb, sh) {
- if(typeof sh == "number") {
- if(sh >= 0 && wb.SheetNames.length > sh) return sh;
- throw new Error("Cannot find sheet # " + sh);
- } else if(typeof sh == "string") {
- var idx = wb.SheetNames.indexOf(sh);
- if(idx > -1) return idx;
- throw new Error("Cannot find sheet name |" + sh + "|");
- } else throw new Error("Cannot find sheet |" + sh + "|");
- }
-
- /* simple blank workbook object */
- utils.book_new = function() {
- return { SheetNames: [], Sheets: {} };
- };
-
- /* add a worksheet to the end of a given workbook */
- utils.book_append_sheet = function(wb, ws, name) {
- if(!name) for(var i = 1; i <= 0xFFFF; ++i) if(wb.SheetNames.indexOf(name = "Sheet" + i) == -1) break;
- if(!name) throw new Error("Too many worksheets");
- check_ws_name(name);
- if(wb.SheetNames.indexOf(name) >= 0) throw new Error("Worksheet with name |" + name + "| already exists!");
-
- wb.SheetNames.push(name);
- wb.Sheets[name] = ws;
- };
-
- /* set sheet visibility (visible/hidden/very hidden) */
- utils.book_set_sheet_visibility = function(wb, sh, vis) {
- get_default(wb,"Workbook",{});
- get_default(wb.Workbook,"Sheets",[]);
-
- var idx = wb_sheet_idx(wb, sh);
- // $FlowIgnore
- get_default(wb.Workbook.Sheets,idx, {});
-
- switch(vis) {
- case 0: case 1: case 2: break;
- default: throw new Error("Bad sheet visibility setting " + vis);
- }
- // $FlowIgnore
- wb.Workbook.Sheets[idx].Hidden = vis;
- };
- add_consts([
- ["SHEET_VISIBLE", 0],
- ["SHEET_HIDDEN", 1],
- ["SHEET_VERY_HIDDEN", 2]
- ]);
-
- /* set number format */
- utils.cell_set_number_format = function(cell, fmt) {
- cell.z = fmt;
- return cell;
- };
-
- /* set cell hyperlink */
- utils.cell_set_hyperlink = function(cell, target, tooltip) {
- if(!target) {
- delete cell.l;
- } else {
- cell.l = ({ Target: target });
- if(tooltip) cell.l.Tooltip = tooltip;
- }
- return cell;
- };
- utils.cell_set_internal_link = function(cell, range, tooltip) { return utils.cell_set_hyperlink(cell, "#" + range, tooltip); };
-
- /* add to cell comments */
- utils.cell_add_comment = function(cell, text, author) {
- if(!cell.c) cell.c = [];
- cell.c.push({t:text, a:author||"SheetJS"});
- };
-
- /* set array formula and flush related cells */
- utils.sheet_set_array_formula = function(ws, range, formula) {
- var rng = typeof range != "string" ? range : safe_decode_range(range);
- var rngstr = typeof range == "string" ? range : encode_range(range);
- for(var R = rng.s.r; R <= rng.e.r; ++R) for(var C = rng.s.c; C <= rng.e.c; ++C) {
- var cell = ws_get_cell_stub(ws, R, C);
- cell.t = 'n';
- cell.F = rngstr;
- delete cell.v;
- if(R == rng.s.r && C == rng.s.c) cell.f = formula;
- }
- return ws;
- };
-
- return utils;
- })(utils);
-
- if(has_buf && "function" != 'undefined') (function() {
- var Readable = __webpack_require__(/*! stream */ 3).Readable;
-
- var write_csv_stream = function(sheet, opts) {
- var stream = Readable();
- var o = opts == null ? {} : opts;
- if(sheet == null || sheet["!ref"] == null) { stream.push(null); return stream; }
- var r = safe_decode_range(sheet["!ref"]);
- var FS = o.FS !== undefined ? o.FS : ",", fs = FS.charCodeAt(0);
- var RS = o.RS !== undefined ? o.RS : "\n", rs = RS.charCodeAt(0);
- var endregex = new RegExp((FS=="|" ? "\\|" : FS)+"+$");
- var row = "", cols = [];
- o.dense = Array.isArray(sheet);
- var colinfo = o.skipHidden && sheet["!cols"] || [];
- var rowinfo = o.skipHidden && sheet["!rows"] || [];
- for(var C = r.s.c; C <= r.e.c; ++C) if (!((colinfo[C]||{}).hidden)) cols[C] = encode_col(C);
- var R = r.s.r;
- var BOM = false;
- stream._read = function() {
- if(!BOM) { BOM = true; return stream.push("\uFEFF"); }
- while(R <= r.e.r) {
- ++R;
- if ((rowinfo[R-1]||{}).hidden) continue;
- row = make_csv_row(sheet, r, R-1, cols, fs, rs, FS, o);
- if(row != null) {
- if(o.strip) row = row.replace(endregex,"");
- stream.push(row + RS);
- break;
- }
- }
- if(R > r.e.r) return stream.push(null);
- };
- return stream;
- };
-
- var write_html_stream = function(ws, opts) {
- var stream = Readable();
-
- var o = opts || {};
- var header = o.header != null ? o.header : HTML_.BEGIN;
- var footer = o.footer != null ? o.footer : HTML_.END;
- stream.push(header);
- var r = decode_range(ws['!ref']);
- o.dense = Array.isArray(ws);
- stream.push(HTML_._preamble(ws, r, o));
- var R = r.s.r;
- var end = false;
- stream._read = function() {
- if(R > r.e.r) {
- if(!end) { end = true; stream.push("</table>" + footer); }
- return stream.push(null);
- }
- while(R <= r.e.r) {
- stream.push(HTML_._row(ws, r, R, o));
- ++R;
- break;
- }
- };
- return stream;
- };
-
- var write_json_stream = function(sheet, opts) {
- var stream = Readable({objectMode:true});
-
- if(sheet == null || sheet["!ref"] == null) { stream.push(null); return stream; }
- var val = {t:'n',v:0}, header = 0, offset = 1, hdr = [], v=0, vv="";
- var r = {s:{r:0,c:0},e:{r:0,c:0}};
- var o = opts || {};
- var range = o.range != null ? o.range : sheet["!ref"];
- if(o.header === 1) header = 1;
- else if(o.header === "A") header = 2;
- else if(Array.isArray(o.header)) header = 3;
- switch(typeof range) {
- case 'string': r = safe_decode_range(range); break;
- case 'number': r = safe_decode_range(sheet["!ref"]); r.s.r = range; break;
- default: r = range;
- }
- if(header > 0) offset = 0;
- var rr = encode_row(r.s.r);
- var cols = [];
- var counter = 0;
- var dense = Array.isArray(sheet);
- var R = r.s.r, C = 0, CC = 0;
- if(dense && !sheet[R]) sheet[R] = [];
- for(C = r.s.c; C <= r.e.c; ++C) {
- cols[C] = encode_col(C);
- val = dense ? sheet[R][C] : sheet[cols[C] + rr];
- switch(header) {
- case 1: hdr[C] = C - r.s.c; break;
- case 2: hdr[C] = cols[C]; break;
- case 3: hdr[C] = o.header[C - r.s.c]; break;
- default:
- if(val == null) val = {w: "__EMPTY", t: "s"};
- vv = v = format_cell(val, null, o);
- counter = 0;
- for(CC = 0; CC < hdr.length; ++CC) if(hdr[CC] == vv) vv = v + "_" + (++counter);
- hdr[C] = vv;
- }
- }
- R = r.s.r + offset;
- stream._read = function() {
- if(R > r.e.r) return stream.push(null);
- while(R <= r.e.r) {
- //if ((rowinfo[R-1]||{}).hidden) continue;
- var row = make_json_row(sheet, r, R, cols, header, hdr, dense, o);
- ++R;
- if((row.isempty === false) || (header === 1 ? o.blankrows !== false : !!o.blankrows)) {
- stream.push(row.row);
- break;
- }
- }
- };
- return stream;
- };
-
- XLSX.stream = {
- to_json: write_json_stream,
- to_html: write_html_stream,
- to_csv: write_csv_stream
- };
- })();
-
- if(typeof parse_xlscfb !== "undefined") XLSX.parse_xlscfb = parse_xlscfb;
- XLSX.parse_zip = parse_zip;
- XLSX.read = readSync; //xlsread
- XLSX.readFile = readFileSync; //readFile
- XLSX.readFileSync = readFileSync;
- XLSX.write = writeSync;
- XLSX.writeFile = writeFileSync;
- XLSX.writeFileSync = writeFileSync;
- XLSX.writeFileAsync = writeFileAsync;
- XLSX.utils = utils;
- XLSX.SSF = SSF;
- if(typeof CFB !== "undefined") XLSX.CFB = CFB;
- }
- /*global define */
- if(true) make_xlsx_lib(exports);
- else {}
- /*exported XLS, ODS */
- var XLS = XLSX, ODS = XLSX;
-
- /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer, __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js")))
-
- /***/ }),
-
- /***/ "./resources/js/app.js":
- /*!*****************************!*\
- !*** ./resources/js/app.js ***!
- \*****************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- /**
- * First we will load all of this project's JavaScript dependencies which
- * includes React and other helpers. It's a great starting point while
- * building robust, powerful web applications using React + Laravel.
- */
- __webpack_require__(/*! ./bootstrap */ "./resources/js/bootstrap.js");
- /**
- * Next, we will create a fresh React component instance and attach it to
- * the page. Then, you may begin adding components to this application
- * or customize the JavaScript scaffolding to fit your unique needs.
- */
-
-
- __webpack_require__(/*! ./components/compound/NewCompoundDataTable */ "./resources/js/components/compound/NewCompoundDataTable.js");
-
- __webpack_require__(/*! ./components/compound/VerifiedCompoundDatatable */ "./resources/js/components/compound/VerifiedCompoundDatatable.js");
-
- __webpack_require__(/*! ./components/compound/NoticeCompoundDatatable */ "./resources/js/components/compound/NoticeCompoundDatatable.js");
-
- __webpack_require__(/*! ./components/compound/ConfiscatedCompoundDatatable */ "./resources/js/components/compound/ConfiscatedCompoundDatatable.js");
-
- __webpack_require__(/*! ./components/compound/CompletedDatatable */ "./resources/js/components/compound/CompletedDatatable.js");
-
- __webpack_require__(/*! ./components/compound/ReportCompound */ "./resources/js/components/compound/ReportCompound.js");
-
- /***/ }),
-
- /***/ "./resources/js/bootstrap.js":
- /*!***********************************!*\
- !*** ./resources/js/bootstrap.js ***!
- \***********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- window._ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
- /**
- * We'll load jQuery and the Bootstrap jQuery plugin which provides support
- * for JavaScript based Bootstrap features such as modals and tabs. This
- * code may be modified to fit the specific needs of your application.
- */
-
- try {
- window.Popper = __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")["default"];
- window.$ = window.jQuery = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js");
-
- __webpack_require__(/*! bootstrap */ "./node_modules/bootstrap/dist/js/bootstrap.js");
- } catch (e) {}
- /**
- * We'll load the axios HTTP library which allows us to easily issue requests
- * to our Laravel back-end. This library automatically handles sending the
- * CSRF token as a header based on the value of the "XSRF" token cookie.
- */
-
-
- window.axios = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
- window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
- /**
- * Next we will register the CSRF Token as a common header with Axios so that
- * all outgoing HTTP requests automatically have it attached. This is just
- * a simple convenience so we don't have to attach every token manually.
- */
-
- var token = document.head.querySelector('meta[name="csrf-token"]');
-
- if (token) {
- window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
- } else {
- console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
- }
- /**
- * Echo exposes an expressive API for subscribing to channels and listening
- * for events that are broadcast by Laravel. Echo and event broadcasting
- * allows your team to easily build robust real-time web applications.
- */
- // import Echo from 'laravel-echo'
- // window.Pusher = require('pusher-js');
- // window.Echo = new Echo({
- // broadcaster: 'pusher',
- // key: process.env.MIX_PUSHER_APP_KEY,
- // cluster: process.env.MIX_PUSHER_APP_CLUSTER,
- // encrypted: true
- // });
-
- /***/ }),
-
- /***/ "./resources/js/components/DatatableParkir.js":
- /*!****************************************************!*\
- !*** ./resources/js/components/DatatableParkir.js ***!
- \****************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DatatableParkir; });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-bootstrap */ "./node_modules/react-bootstrap/esm/index.js");
- /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-spinners/ClipLoader */ "./node_modules/react-spinners/ClipLoader.js");
- /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
- /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_3__);
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
-
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
-
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
-
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
-
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
-
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
-
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
-
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
-
-
-
-
-
-
- var DatatableParkir =
- /*#__PURE__*/
- function (_Component) {
- _inherits(DatatableParkir, _Component);
-
- function DatatableParkir(props) {
- var _this;
-
- _classCallCheck(this, DatatableParkir);
-
- _this = _possibleConstructorReturn(this, _getPrototypeOf(DatatableParkir).call(this, props));
- _this.state = {
- data: props.data,
- currentUrl: props.url,
- showModal: false,
- processing: false,
- responseMessage: '',
- form: {
- current_id: props.current_id,
- id: '',
- status: 'Belum Bayar',
- remark: '',
- amount: ''
- }
- };
- _this.onSubmit = _this.onSubmit.bind(_assertThisInitialized(_this));
- _this.onChangeStatus = _this.onChangeStatus.bind(_assertThisInitialized(_this));
- _this.onChangeRemark = _this.onChangeRemark.bind(_assertThisInitialized(_this));
- _this.onChangeAmount = _this.onChangeAmount.bind(_assertThisInitialized(_this));
- _this.closeModal = _this.closeModal.bind(_assertThisInitialized(_this));
- return _this;
- }
-
- _createClass(DatatableParkir, [{
- key: "onChangeStatus",
- value: function onChangeStatus(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- status: value
- })
- };
- });
- }
- }, {
- key: "onChangeRemark",
- value: function onChangeRemark(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- remark: value
- })
- };
- });
- }
- }, {
- key: "onChangeAmount",
- value: function onChangeAmount(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- amount: value
- })
- };
- });
- }
- }, {
- key: "onUpdateStatus",
- value: function onUpdateStatus(e) {
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- id: e
- })
- };
- });
- this.setState({
- showModal: true
- });
- }
- }, {
- key: "closeModal",
- value: function closeModal() {
- this.setState({
- showModal: false
- });
- }
- }, {
- key: "onSubmit",
- value: function onSubmit(e) {
- var _this2 = this;
-
- e.preventDefault();
- var input = prompt("Adakah anda pasti kemaskini status kompaun ini? \nTaip 'yes' untuk teruskan", "");
-
- if (input == "yes") {
- this.setState({
- processing: true
- });
- var formData = this.state.form;
- axios__WEBPACK_IMPORTED_MODULE_3___default.a.post("/api/update/compound/via-dashboard", formData).then(function (response) {
- if (response.data.success) {
- fetch(_this2.state.currentUrl).then(function (response) {
- response.json().then(function (res) {
- _this2.setState({
- processing: false
- });
-
- _this2.setState({
- data: res.data,
- showModal: false
- });
- });
- });
-
- _this2.setState({
- responseMessage: response.data.message
- });
-
- alert(response.data.message);
- } else {
- alert(response.data.message);
-
- _this2.setState({
- showModal: false,
- processing: false,
- responseMessage: response.data.message
- });
- }
- })["catch"](function (error) {
- console.log(error);
- });
- } else {
- alert('Kemaskini status dibatalkan');
- this.setState({
- showModal: false
- });
- }
- }
- }, {
- key: "render",
- value: function render() {
- var _this3 = this;
-
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "data_table_main dt-responsive table-responsive"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("table", {
- id: "compoundParkir",
- className: "table table-sm table-striped table-bordered nowrap dataTable",
- width: "100%"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("thead", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "#"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kpd"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Jenis"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Tarikh Masa"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kesalahan"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kadar Kompaun"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "No Plat"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "PenguatKuasa"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "110"
- }, "Status"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Tindakan"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tbody", null, this.state.data.length > 0 ? this.state.data.map(function (item, i) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", {
- key: i
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.DT_RowIndex), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.index !== "" ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("small", {
- className: "label label-success"
- }, item.index), "\xA0", item.kpd) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.kpd)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.jenis), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.tarikh_masa), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, "Seksyen ", item.kesalahan.sketr, " ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), " ", item.kesalahan.nama), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.jumlah_kemaskini_kompaun !== "" ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.jumlah_kemaskini_kompaun) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.jumlah_asal_kompaun)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.no_plate), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.enforcer.no_badan, ", ", item.enforcer.full_name), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.catatan_dari_admin !== null ? item.status !== "Belum Bayar" ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, item.status)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- style: {
- "marginTop": "8px"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Bayaran: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), "RM ", item.amount_payment), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- style: {
- "marginTop": "8px"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Catatan: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.catatan_dari_admin), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- style: {
- "marginTop": "8px"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Kemaskini: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.updated_at, " ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.updated_by !== null ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.updated_by.no_badan) : "")) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, item.status)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- style: {
- "marginTop": "8px"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Catatan: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.catatan_dari_admin), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- style: {
- "marginTop": "8px"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Kemasikini: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.updated_at, " ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.updated_by !== null ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.updated_by.no_badan) : "")) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, item.status))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", {
- style: {
- "textAlign": "center"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/" + item.kpd + "/index",
- className: "btn btn-info btn-sm waves-effect waves-light"
- }, "TERUSKAN"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
- "data-toggle": "modal",
- "data-target": "#ajaxModel",
- onClick: _this3.onUpdateStatus.bind(_this3, item._id),
- className: "btn btn-primary btn-sm waves-effect waves-light"
- }, "KEMASKINI STATUS")));
- }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", {
- colSpan: "10",
- style: {
- "textAlign": "center"
- }
- }, "Tiada Data Ditemui"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tfoot", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "#"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kpd"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Jenis"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Tarikh Masa"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kesalahan"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kadar Kompaun"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "No Plat"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "PenguatKuasa"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "110"
- }, "Status"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Tindakan"))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"], {
- size: "lg",
- show: this.state.showModal,
- onHide: this.closeModal
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("form", {
- className: "form-horizontal",
- onSubmit: this.onSubmit
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"].Header, {
- closeButton: true
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"].Title, null, "Kemaskini Status Kompaun")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"].Body, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "modal-body"
- }, !this.state.processing ? '' : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "sweet-loading",
- style: {
- 'textAlign': 'center'
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default.a, {
- style: {
- 'border-color': 'red'
- },
- sizeUnit: "px",
- size: 50,
- color: '#123abc',
- loading: this.state.processing
- })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "hidden",
- name: "compound_id",
- id: "compound_id",
- value: this.state.form.id
- }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "form-group"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "col-sm-6 control-label"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Status")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-sm-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
- className: "form-control",
- required: true,
- value: this.state.form.status,
- onChange: this.onChangeStatus
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- key: "Belum Bayar",
- value: "Belum Bayar"
- }, "Belum Bayar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- key: "Berbayar",
- value: "Berbayar"
- }, "Berbayar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- key: "Batal",
- value: "Batal"
- }, "Batal")))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "form-group"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "col-sm-6 control-label"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Catatan ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("code", null, "*"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-sm-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("textarea", {
- className: "form-control",
- value: this.state.form.remark,
- onChange: this.onChangeRemark
- }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "form-group"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "col-sm-6 control-label"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Jumlah Dibayar ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("code", null, "*"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-sm-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "number",
- steps: "0.00",
- className: "form-control",
- placeholder: "0.0",
- value: this.state.form.amount,
- onChange: this.onChangeAmount,
- required: true
- }))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"].Footer, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
- type: "button",
- className: "btn btn-sm btn-default waves-effect",
- onClick: this.closeModal
- }, "Close"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
- type: "submit",
- className: "btn btn-sm btn-primary waves-effect waves-light"
- }, "KEMASKINI")))));
- }
- }]);
-
- return DatatableParkir;
- }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
-
-
-
- /***/ }),
-
- /***/ "./resources/js/components/DatatablePelbagai.js":
- /*!******************************************************!*\
- !*** ./resources/js/components/DatatablePelbagai.js ***!
- \******************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return DatatablePelbagai; });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var react_bootstrap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-bootstrap */ "./node_modules/react-bootstrap/esm/index.js");
- /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-spinners/ClipLoader */ "./node_modules/react-spinners/ClipLoader.js");
- /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
- /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_3__);
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
-
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
-
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
-
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
-
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
-
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
-
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
-
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
-
-
-
-
-
-
- var DatatablePelbagai =
- /*#__PURE__*/
- function (_Component) {
- _inherits(DatatablePelbagai, _Component);
-
- function DatatablePelbagai(props) {
- var _this;
-
- _classCallCheck(this, DatatablePelbagai);
-
- _this = _possibleConstructorReturn(this, _getPrototypeOf(DatatablePelbagai).call(this, props));
- _this.state = {
- data: props.data,
- currentUrl: props.url,
- showModal: false,
- processing: false,
- responseMessage: '',
- form: {
- current_id: props.current_id,
- id: '',
- status: 'Belum Bayar',
- remark: '',
- amount: ''
- }
- };
- _this.onSubmit = _this.onSubmit.bind(_assertThisInitialized(_this));
- _this.onChangeStatus = _this.onChangeStatus.bind(_assertThisInitialized(_this));
- _this.onChangeRemark = _this.onChangeRemark.bind(_assertThisInitialized(_this));
- _this.onChangeAmount = _this.onChangeAmount.bind(_assertThisInitialized(_this));
- _this.closeModal = _this.closeModal.bind(_assertThisInitialized(_this));
- return _this;
- }
-
- _createClass(DatatablePelbagai, [{
- key: "onChangeStatus",
- value: function onChangeStatus(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- status: value
- })
- };
- });
- }
- }, {
- key: "onChangeRemark",
- value: function onChangeRemark(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- remark: value
- })
- };
- });
- }
- }, {
- key: "onChangeAmount",
- value: function onChangeAmount(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- amount: value
- })
- };
- });
- }
- }, {
- key: "onUpdateStatus",
- value: function onUpdateStatus(e) {
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- id: e
- })
- };
- });
- this.setState({
- showModal: true
- });
- }
- }, {
- key: "closeModal",
- value: function closeModal() {
- this.setState({
- showModal: false
- });
- }
- }, {
- key: "onSubmit",
- value: function onSubmit(e) {
- var _this2 = this;
-
- e.preventDefault();
- var input = prompt("Adakah anda pasti kemaskini status kompaun ini? \nTaip 'yes' untuk teruskan", "");
-
- if (input == "yes") {
- this.setState({
- processing: true
- });
- var formData = this.state.form;
- axios__WEBPACK_IMPORTED_MODULE_3___default.a.post("/api/update/compound/via-dashboard", formData).then(function (response) {
- if (response.data.success) {
- fetch(_this2.state.currentUrl).then(function (response) {
- response.json().then(function (res) {
- _this2.setState({
- processing: false
- });
-
- _this2.setState({
- data: res.data,
- showModal: false
- });
- });
- });
-
- _this2.setState({
- responseMessage: response.data.message
- });
-
- alert(response.data.message);
- } else {
- alert(response.data.message);
-
- _this2.setState({
- showModal: false,
- processing: false,
- responseMessage: response.data.message
- });
- }
- })["catch"](function (error) {
- console.log(error);
- });
- } else {
- alert('Kemaskini status dibatalkan');
- this.setState({
- showModal: false
- });
- }
- }
- }, {
- key: "render",
- value: function render() {
- var _this3 = this;
-
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "data_table_main dt-responsive table-responsive"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("table", {
- id: "compoundPelbagai",
- className: "table table-sm table-striped table-bordered nowrap",
- width: "100%"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("thead", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "#"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kpd"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Jenis"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Tarikh Masa"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kesalahan"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "110"
- }, "Kadar Kompaun"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Nric"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "No.Syarikat"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "PenguatKuasa"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Status"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Tindakan"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tbody", null, this.state.data.length > 0 ? this.state.data.map(function (item, i) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", {
- key: i
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.DT_RowIndex), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.index !== "" ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("small", {
- className: "label label-success"
- }, item.index), "\xA0", item.kpd) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.kpd)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.jenis), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.tarikh_masa), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, "Seksyen ", item.kesalahan.sketr, " ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), " ", item.kesalahan.nama), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.jumlah_kemaskini_kompaun !== "" ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.jumlah_kemaskini_kompaun) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.jumlah_asal_kompaun)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.nric), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.no_daftar_syarikat), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.enforcer.no_badan, ", ", item.enforcer.full_name), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.catatan_dari_admin !== null ? item.status !== "Belum Bayar" ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, item.status)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- style: {
- "marginTop": "8px"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Bayaran: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), "RM ", item.amount_payment), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- style: {
- "marginTop": "8px"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Catatan: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.catatan_dari_admin), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- style: {
- "marginTop": "8px"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Kemaskini: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.updated_at, " ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.updated_by !== null ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.updated_by.no_badan) : "")) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, item.status)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- style: {
- "marginTop": "8px"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Catatan: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.catatan_dari_admin), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- style: {
- "marginTop": "8px"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, "Kemasikini: "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.updated_at, " ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("br", null), item.updated_by !== null ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, item.updated_by.no_badan) : "")) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, item.status))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", {
- style: {
- "textAlign": "center"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/" + item.kpd + "/index",
- className: "btn btn-info btn-sm waves-effect waves-light"
- }, "TERUSKAN"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
- "data-toggle": "modal",
- "data-target": "#ajaxModel",
- onClick: _this3.onUpdateStatus.bind(_this3, item._id),
- className: "btn btn-primary btn-sm waves-effect waves-light"
- }, "KEMASKINI STATUS")));
- }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", {
- colSpan: "11",
- style: {
- "textAlign": "center"
- }
- }, "Tiada Data Ditemui"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tfoot", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "#"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kpd"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Jenis"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Tarikh Masa"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kesalahan"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "110"
- }, "Kadar Kompaun"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Nric"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "No.Syarikat"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "PenguatKuasa"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Status"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Tindakan"))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"], {
- size: "lg",
- show: this.state.showModal,
- onHide: this.closeModal
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("form", {
- className: "form-horizontal",
- onSubmit: this.onSubmit
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"].Header, {
- closeButton: true
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"].Title, null, "Kemaskini Status Kompaun")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"].Body, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "modal-body"
- }, !this.state.processing ? '' : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "sweet-loading",
- style: {
- 'textAlign': 'center'
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default.a, {
- style: {
- 'border-color': 'red'
- },
- sizeUnit: "px",
- size: 50,
- color: '#123abc',
- loading: this.state.processing
- })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "hidden",
- name: "compound_id",
- id: "compound_id",
- value: this.state.form.id
- }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "form-group"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "col-sm-6 control-label"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Status")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-sm-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
- className: "form-control",
- required: true,
- value: this.state.form.status,
- onChange: this.onChangeStatus
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- key: "Belum Bayar",
- value: "Belum Bayar"
- }, "Belum Bayar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- key: "Berbayar",
- value: "Berbayar"
- }, "Berbayar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- key: "Batal",
- value: "Batal"
- }, "Batal")))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "form-group"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "col-sm-6 control-label"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Catatan ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("code", null, "*"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-sm-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("textarea", {
- className: "form-control",
- value: this.state.form.remark,
- onChange: this.onChangeRemark
- }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "form-group"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "col-sm-6 control-label"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Jumlah Dibayar ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("code", null, "*"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-sm-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "number",
- steps: "0.00",
- className: "form-control",
- placeholder: "0.0",
- value: this.state.form.amount,
- onChange: this.onChangeAmount,
- required: true
- }))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_bootstrap__WEBPACK_IMPORTED_MODULE_1__["Modal"].Footer, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
- type: "button",
- className: "btn btn-sm btn-default waves-effect",
- onClick: this.closeModal
- }, "Close"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
- type: "submit",
- className: "btn btn-sm btn-primary waves-effect waves-light"
- }, "KEMASKINI")))));
- }
- }]);
-
- return DatatablePelbagai;
- }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
-
-
-
- /***/ }),
-
- /***/ "./resources/js/components/ExportCSV.js":
- /*!**********************************************!*\
- !*** ./resources/js/components/ExportCSV.js ***!
- \**********************************************/
- /*! exports provided: ExportCSV */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ExportCSV", function() { return ExportCSV; });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var file_saver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! file-saver */ "./node_modules/file-saver/dist/FileSaver.min.js");
- /* harmony import */ var file_saver__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(file_saver__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var xlsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! xlsx */ "./node_modules/xlsx/xlsx.js");
- /* harmony import */ var xlsx__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(xlsx__WEBPACK_IMPORTED_MODULE_2__);
-
-
-
- var ExportCSV = function ExportCSV(_ref) {
- var csvData = _ref.csvData,
- fileName = _ref.fileName,
- type = _ref.type;
- var fileType = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';
- var fileExtension = '.xlsx';
-
- var exportToCSV = function exportToCSV(csvData, fileName, type) {
- var finalData = [];
-
- if (type == 'Parkir') {
- csvData.map(function (item, i) {
- finalData.push({
- No: i,
- Kpd: item.kpd,
- Jenis: item.jenis,
- Tarikh_Masa: item.tarikh_masa,
- Kesalahan: 'Seksyen' + item.kesalahan.sketr + ' ' + item.kesalahan.nama,
- Kadar_Kompaun: item.jumlah_kemaskini_kompaun !== "" ? item.jumlah_kemaskini_kompaun : item.jumlah_asal_kompaun,
- No_Plat: item.no_plate,
- Penguatkuasa: item.enforcer.no_badan + ', ' + item.enforcer.full_name,
- Status: item.status
- });
- });
- } else if (type == 'Pelbagai') {
- csvData.map(function (item, i) {
- finalData.push({
- No: i,
- Kpd: item.kpd,
- Jenis: item.jenis,
- Tarikh_Masa: item.tarikh_masa,
- Kesalahan: 'Seksyen' + item.kesalahan.sketr + ' ' + item.kesalahan.nama,
- Kadar_Kompaun: item.jumlah_kemaskini_kompaun !== "" ? item.jumlah_kemaskini_kompaun : item.jumlah_asal_kompaun,
- Nric: item.nric,
- No_Daftar_syarikat: item.no_daftar_syarikat,
- Penguatkuasa: item.enforcer.no_badan + ', ' + item.enforcer.full_name,
- Status: item.status
- });
- });
- }
-
- var ws = xlsx__WEBPACK_IMPORTED_MODULE_2__["utils"].json_to_sheet(finalData);
- var wb = {
- Sheets: {
- 'data': ws
- },
- SheetNames: ['data']
- };
- var excelBuffer = xlsx__WEBPACK_IMPORTED_MODULE_2__["write"](wb, {
- bookType: 'xlsx',
- type: 'array'
- });
- var data = new Blob([excelBuffer], {
- type: fileType
- });
- file_saver__WEBPACK_IMPORTED_MODULE_1__["saveAs"](data, fileName + fileExtension);
- };
-
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
- onClick: function onClick(e) {
- return exportToCSV(csvData, fileName, type);
- },
- className: "btn btn-success btn-sm waves-effect waves-light f-right"
- }, "Eksport ke CSV");
- };
-
- /***/ }),
-
- /***/ "./resources/js/components/compound/CompletedDatatable.js":
- /*!****************************************************************!*\
- !*** ./resources/js/components/compound/CompletedDatatable.js ***!
- \****************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return CompletedDatatable; });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-spinners/ClipLoader */ "./node_modules/react-spinners/ClipLoader.js");
- /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _ExportCSV__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ExportCSV */ "./resources/js/components/ExportCSV.js");
- /* harmony import */ var _DatatableParkir__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../DatatableParkir */ "./resources/js/components/DatatableParkir.js");
- /* harmony import */ var _DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../DatatablePelbagai */ "./resources/js/components/DatatablePelbagai.js");
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
-
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
-
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
-
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
-
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
-
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
-
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
-
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
-
-
-
-
-
-
-
-
- var CompletedDatatable =
- /*#__PURE__*/
- function (_Component) {
- _inherits(CompletedDatatable, _Component);
-
- function CompletedDatatable(props) {
- var _this;
-
- _classCallCheck(this, CompletedDatatable);
-
- _this = _possibleConstructorReturn(this, _getPrototypeOf(CompletedDatatable).call(this, props));
- _this.state = {
- current_id: _this.props.current_id,
- dataCompound: [],
- loading: 'null',
- current_url: 'null',
- total: {
- baru: _this.props.baru,
- invest: _this.props.invest,
- notice: _this.props.notice,
- inven: _this.props.inven,
- collap: _this.props.collap,
- comp: _this.props.comp
- },
- check: {
- kpd: true,
- date: true,
- faulty: true,
- enforcer: true,
- platno: false,
- companyno: false,
- nric: false
- },
- form: {
- modul: _this.props.modul,
- status: _this.props.status,
- type: 'Parkir',
- kpd: '',
- start_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
- end_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
- faulty: 'All',
- enforcer: 'All',
- plate_no: '',
- company_no: '',
- nric: ''
- },
- list_enforcer: JSON.parse(_this.props.enforcer),
- list_faulty: JSON.parse(_this.props.faulty)
- };
- _this.onCheckKpd = _this.onCheckKpd.bind(_assertThisInitialized(_this));
- _this.onCheckDate = _this.onCheckDate.bind(_assertThisInitialized(_this));
- _this.onCheckPlateNo = _this.onCheckPlateNo.bind(_assertThisInitialized(_this));
- _this.onCheckCompanyNo = _this.onCheckCompanyNo.bind(_assertThisInitialized(_this));
- _this.onCheckNric = _this.onCheckNric.bind(_assertThisInitialized(_this));
- _this.onChangeKpd = _this.onChangeKpd.bind(_assertThisInitialized(_this));
- _this.onChangeType = _this.onChangeType.bind(_assertThisInitialized(_this));
- _this.onChangeStart = _this.onChangeStart.bind(_assertThisInitialized(_this));
- _this.onChangeEnd = _this.onChangeEnd.bind(_assertThisInitialized(_this));
- _this.onChangeFaulty = _this.onChangeFaulty.bind(_assertThisInitialized(_this));
- _this.onChangeEnforcer = _this.onChangeEnforcer.bind(_assertThisInitialized(_this));
- _this.onChangePlateNo = _this.onChangePlateNo.bind(_assertThisInitialized(_this));
- _this.onChangeCompanyNo = _this.onChangeCompanyNo.bind(_assertThisInitialized(_this));
- _this.onChangeNric = _this.onChangeNric.bind(_assertThisInitialized(_this));
- _this.onSubmit = _this.onSubmit.bind(_assertThisInitialized(_this));
- return _this;
- }
-
- _createClass(CompletedDatatable, [{
- key: "onCheckKpd",
- value: function onCheckKpd(e) {
- var _this2 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- kpd: !_this2.state.check.kpd
- })
- };
- });
- }
- }, {
- key: "onCheckDate",
- value: function onCheckDate(e) {
- var _this3 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- date: !_this3.state.check.date
- })
- };
- });
- }
- }, {
- key: "onCheckPlateNo",
- value: function onCheckPlateNo(e) {
- var _this4 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- platno: !_this4.state.check.platno
- })
- };
- });
- }
- }, {
- key: "onCheckCompanyNo",
- value: function onCheckCompanyNo(e) {
- var _this5 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- companyno: !_this5.state.check.companyno
- })
- };
- });
- }
- }, {
- key: "onCheckNric",
- value: function onCheckNric(e) {
- var _this6 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- nric: !_this6.state.check.nric
- })
- };
- });
- }
- }, {
- key: "onChangeKpd",
- value: function onChangeKpd(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- kpd: value
- })
- };
- });
- }
- }, {
- key: "onChangeType",
- value: function onChangeType(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- type: value
- }),
- loading: 'null',
- dataCompound: []
- };
- });
- }
- }, {
- key: "onChangeStart",
- value: function onChangeStart(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- start_date: value
- })
- };
- });
- }
- }, {
- key: "onChangeEnd",
- value: function onChangeEnd(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- end_date: value
- })
- };
- });
- }
- }, {
- key: "onChangeFaulty",
- value: function onChangeFaulty(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- faulty: value
- })
- };
- });
- }
- }, {
- key: "onChangeEnforcer",
- value: function onChangeEnforcer(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- enforcer: value
- })
- };
- });
- }
- }, {
- key: "onChangePlateNo",
- value: function onChangePlateNo(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- plate_no: value
- })
- };
- });
- }
- }, {
- key: "onChangeCompanyNo",
- value: function onChangeCompanyNo(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- company_no: value
- })
- };
- });
- }
- }, {
- key: "onChangeNric",
- value: function onChangeNric(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- nric: value
- })
- };
- });
- }
- }, {
- key: "onSubmit",
- value: function onSubmit(e) {
- var _this7 = this;
-
- e.preventDefault();
- this.setState({
- loading: true
- });
- var formData = {
- type: this.state.form.type,
- enforcer: this.state.form.enforcer,
- faulty: this.state.form.faulty,
- modul: this.state.form.modul,
- status: this.state.form.status
- };
-
- if (this.state.check.date) {
- formData = _objectSpread({}, formData, {
- start_date: this.state.form.start_date,
- end_date: this.state.form.end_date
- });
- } else {
- formData = _objectSpread({}, formData, {
- start_date: '',
- end_date: ''
- });
- }
-
- if (this.state.check.kpd) {
- formData = _objectSpread({}, formData, {
- kpd: this.state.form.kpd
- });
- } else if (this.state.check.platno) {
- formData = _objectSpread({}, formData, {
- plate_no: this.state.form.plate_no
- });
- } else if (this.state.check.companyno) {
- formData = _objectSpread({}, formData, {
- company_no: this.state.form.company_no
- });
- } else if (this.state.check.nric) {
- formData = _objectSpread({}, formData, {
- nric: this.state.form.nric
- });
- }
-
- var queryString = Object.keys(formData).map(function (key) {
- return key + '=' + formData[key];
- }).join('&');
- fetch('/api/list/compound?' + queryString).then(function (response) {
- response.json().then(function (res) {
- _this7.setState({
- dataCompound: res.data,
- loading: false,
- current_url: '/api/list/compound?' + queryString
- });
- });
- });
- }
- }, {
- key: "render",
- value: function render() {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-xl-2 col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "panel panel-default"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "panel-heading"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h4", {
- className: "panel-title"
- }, " Modul Kategori ")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "panel-body"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound"
- }, "Baru"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-inverse-danger"
- }, this.state.total.baru)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/investigation"
- }, "Pengesahan Kompaun"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.invest)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/notice"
- }, "Notis Amaran"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.notice), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/confiscated"
- }, "Sitaan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.inven), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/completed",
- className: "active"
- }, "Kompaun Dijelaskan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.comp))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-xl-10 col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card-block"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("form", {
- className: "main cussPayment",
- onSubmit: this.onSubmit
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckKpd,
- defaultChecked: true
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "input-group input-group-sm"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", {
- className: "input-group-prepend"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "input-group-text"
- }, "KPD")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "SCM4744",
- value: this.state.form.kpd,
- onChange: this.onChangeKpd,
- required: this.state.check.kpd
- }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Jenis Kompaun ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("code", null, "*"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
- className: "form-control form-control-sm",
- value: this.state.form.type,
- onChange: this.onChangeType,
- required: true
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Parkir"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Pelbagai")))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckDate,
- defaultChecked: true
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Tarikh"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "date",
- className: " form-control form-control-sm",
- value: this.state.form.start_date,
- onChange: this.onChangeStart,
- required: this.state.check.date
- })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "-")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "date",
- className: "form-control form-control-sm",
- value: this.state.form.end_date,
- onChange: this.onChangeEnd
- }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Seksyen Kesalahan"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-9 .offset-xl-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
- className: "form-control form-control-sm",
- defaultValue: "All",
- onChange: this.onChangeFaulty,
- required: this.state.check.faulty
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- value: "All"
- }, "All"), this.state.list_faulty.map(function (act, i) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("optgroup", {
- label: act.nama,
- key: i
- }, act.faulty.map(function (faulty, j) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- key: j,
- value: faulty._id
- }, "Seksyen ", faulty.sketr);
- }));
- })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "PenguatKuasa"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-6 .offset-xl-6"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
- className: "form-control form-control-sm",
- defaultValue: "All",
- onChange: this.onChangeEnforcer,
- required: this.state.check.enforcer
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- value: "All"
- }, "All"), this.state.list_enforcer.map(function (staff, i) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- key: i,
- value: staff._id
- }, staff.no_badan, ", ", staff.full_name);
- })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckPlateNo,
- defaultChecked: false
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No.Plat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "no plat",
- value: this.state.form.plate_no,
- onChange: this.onChangePlateNo,
- required: this.state.check.platno
- })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckCompanyNo,
- defaultChecked: false
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, " No.Syarikat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "no syarikat",
- value: this.state.form.company_no,
- onChange: this.onChangeCompanyNo,
- required: this.state.check.companyno
- })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckNric,
- defaultChecked: false
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "NRIC")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "nric",
- value: this.state.form.nric,
- onChange: this.onChangeNric,
- required: this.state.check.nric
- }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "form-group"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
- type: "submit",
- id: "tapis",
- className: "btn btn-info btn-sm waves-effect waves-light"
- }, "Carian")))))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card-header"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h5", null, "Senarai Kompaun"), this.state.dataCompound.length > 0 ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ExportCSV__WEBPACK_IMPORTED_MODULE_3__["ExportCSV"], {
- csvData: this.state.dataCompound,
- fileName: "Report_saman_1",
- type: this.state.form.type
- }) : ''), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card-block contact-details"
- }, this.state.loading !== 'null' ? !this.state.loading ? this.state.form.type === 'Parkir' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatableParkir__WEBPACK_IMPORTED_MODULE_4__["default"], {
- data: this.state.dataCompound,
- url: this.state.current_url,
- current_id: this.state.current_id
- }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__["default"], {
- data: this.state.dataCompound,
- url: this.state.current_url,
- current_id: this.state.current_id
- }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "sweet-loading",
- style: {
- 'textAlign': 'center'
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default.a, {
- style: {
- 'border-color': 'red'
- },
- sizeUnit: "px",
- size: 50,
- color: '#123abc',
- loading: this.state.loading
- })) : ''))));
- }
- }]);
-
- return CompletedDatatable;
- }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
-
-
-
- if (document.getElementById('completedcompound')) {
- var component = document.getElementById('completedcompound');
- var props = Object.assign({}, component.dataset);
- react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(CompletedDatatable, props), component);
- }
-
- /***/ }),
-
- /***/ "./resources/js/components/compound/ConfiscatedCompoundDatatable.js":
- /*!**************************************************************************!*\
- !*** ./resources/js/components/compound/ConfiscatedCompoundDatatable.js ***!
- \**************************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ConfiscatedCompoundDatatable; });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-spinners/ClipLoader */ "./node_modules/react-spinners/ClipLoader.js");
- /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _ExportCSV__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ExportCSV */ "./resources/js/components/ExportCSV.js");
- /* harmony import */ var _DatatableParkir__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../DatatableParkir */ "./resources/js/components/DatatableParkir.js");
- /* harmony import */ var _DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../DatatablePelbagai */ "./resources/js/components/DatatablePelbagai.js");
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
-
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
-
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
-
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
-
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
-
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
-
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
-
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
-
-
-
-
-
-
-
-
- var ConfiscatedCompoundDatatable =
- /*#__PURE__*/
- function (_Component) {
- _inherits(ConfiscatedCompoundDatatable, _Component);
-
- function ConfiscatedCompoundDatatable(props) {
- var _this;
-
- _classCallCheck(this, ConfiscatedCompoundDatatable);
-
- _this = _possibleConstructorReturn(this, _getPrototypeOf(ConfiscatedCompoundDatatable).call(this, props));
- _this.state = {
- current_id: _this.props.current_id,
- dataCompound: [],
- loading: 'null',
- current_url: 'null',
- total: {
- baru: _this.props.baru,
- invest: _this.props.invest,
- notice: _this.props.notice,
- inven: _this.props.inven,
- collap: _this.props.collap,
- comp: _this.props.comp
- },
- check: {
- kpd: true,
- date: true,
- faulty: true,
- enforcer: true,
- platno: false,
- companyno: false,
- nric: false
- },
- form: {
- modul: _this.props.modul,
- status: _this.props.status,
- type: 'Parkir',
- kpd: '',
- start_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
- end_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
- faulty: 'All',
- enforcer: 'All',
- plate_no: '',
- company_no: '',
- nric: ''
- },
- list_enforcer: JSON.parse(_this.props.enforcer),
- list_faulty: JSON.parse(_this.props.faulty)
- };
- _this.onCheckKpd = _this.onCheckKpd.bind(_assertThisInitialized(_this));
- _this.onCheckDate = _this.onCheckDate.bind(_assertThisInitialized(_this));
- _this.onCheckPlateNo = _this.onCheckPlateNo.bind(_assertThisInitialized(_this));
- _this.onCheckCompanyNo = _this.onCheckCompanyNo.bind(_assertThisInitialized(_this));
- _this.onCheckNric = _this.onCheckNric.bind(_assertThisInitialized(_this));
- _this.onChangeKpd = _this.onChangeKpd.bind(_assertThisInitialized(_this));
- _this.onChangeType = _this.onChangeType.bind(_assertThisInitialized(_this));
- _this.onChangeStart = _this.onChangeStart.bind(_assertThisInitialized(_this));
- _this.onChangeEnd = _this.onChangeEnd.bind(_assertThisInitialized(_this));
- _this.onChangeFaulty = _this.onChangeFaulty.bind(_assertThisInitialized(_this));
- _this.onChangeEnforcer = _this.onChangeEnforcer.bind(_assertThisInitialized(_this));
- _this.onChangePlateNo = _this.onChangePlateNo.bind(_assertThisInitialized(_this));
- _this.onChangeCompanyNo = _this.onChangeCompanyNo.bind(_assertThisInitialized(_this));
- _this.onChangeNric = _this.onChangeNric.bind(_assertThisInitialized(_this));
- _this.onSubmit = _this.onSubmit.bind(_assertThisInitialized(_this));
- return _this;
- }
-
- _createClass(ConfiscatedCompoundDatatable, [{
- key: "onCheckKpd",
- value: function onCheckKpd(e) {
- var _this2 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- kpd: !_this2.state.check.kpd
- })
- };
- });
- }
- }, {
- key: "onCheckDate",
- value: function onCheckDate(e) {
- var _this3 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- date: !_this3.state.check.date
- })
- };
- });
- }
- }, {
- key: "onCheckPlateNo",
- value: function onCheckPlateNo(e) {
- var _this4 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- platno: !_this4.state.check.platno
- })
- };
- });
- }
- }, {
- key: "onCheckCompanyNo",
- value: function onCheckCompanyNo(e) {
- var _this5 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- companyno: !_this5.state.check.companyno
- })
- };
- });
- }
- }, {
- key: "onCheckNric",
- value: function onCheckNric(e) {
- var _this6 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- nric: !_this6.state.check.nric
- })
- };
- });
- }
- }, {
- key: "onChangeKpd",
- value: function onChangeKpd(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- kpd: value
- })
- };
- });
- }
- }, {
- key: "onChangeType",
- value: function onChangeType(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- type: value
- }),
- loading: 'null',
- dataCompound: []
- };
- });
- }
- }, {
- key: "onChangeStart",
- value: function onChangeStart(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- start_date: value
- })
- };
- });
- }
- }, {
- key: "onChangeEnd",
- value: function onChangeEnd(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- end_date: value
- })
- };
- });
- }
- }, {
- key: "onChangeFaulty",
- value: function onChangeFaulty(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- faulty: value
- })
- };
- });
- }
- }, {
- key: "onChangeEnforcer",
- value: function onChangeEnforcer(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- enforcer: value
- })
- };
- });
- }
- }, {
- key: "onChangePlateNo",
- value: function onChangePlateNo(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- plate_no: value
- })
- };
- });
- }
- }, {
- key: "onChangeCompanyNo",
- value: function onChangeCompanyNo(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- company_no: value
- })
- };
- });
- }
- }, {
- key: "onChangeNric",
- value: function onChangeNric(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- nric: value
- })
- };
- });
- }
- }, {
- key: "onSubmit",
- value: function onSubmit(e) {
- var _this7 = this;
-
- e.preventDefault();
- this.setState({
- loading: true
- });
- var formData = {
- type: this.state.form.type,
- enforcer: this.state.form.enforcer,
- faulty: this.state.form.faulty,
- modul: this.state.form.modul,
- status: this.state.form.status
- };
-
- if (this.state.check.date) {
- formData = _objectSpread({}, formData, {
- start_date: this.state.form.start_date,
- end_date: this.state.form.end_date
- });
- } else {
- formData = _objectSpread({}, formData, {
- start_date: '',
- end_date: ''
- });
- }
-
- if (this.state.check.kpd) {
- formData = _objectSpread({}, formData, {
- kpd: this.state.form.kpd
- });
- } else if (this.state.check.platno) {
- formData = _objectSpread({}, formData, {
- plate_no: this.state.form.plate_no
- });
- } else if (this.state.check.companyno) {
- formData = _objectSpread({}, formData, {
- company_no: this.state.form.company_no
- });
- } else if (this.state.check.nric) {
- formData = _objectSpread({}, formData, {
- nric: this.state.form.nric
- });
- }
-
- var queryString = Object.keys(formData).map(function (key) {
- return key + '=' + formData[key];
- }).join('&');
- fetch('/api/list/compound?' + queryString).then(function (response) {
- response.json().then(function (res) {
- _this7.setState({
- dataCompound: res.data,
- loading: false,
- current_url: '/api/list/compound?' + queryString
- });
- });
- });
- }
- }, {
- key: "render",
- value: function render() {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-xl-2 col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "panel panel-default"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "panel-heading"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h4", {
- className: "panel-title"
- }, " Modul Kategori ")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "panel-body"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound"
- }, "Baru"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-inverse-danger"
- }, this.state.total.baru)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/investigation"
- }, "Pengesahan Kompaun"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.invest)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/notice"
- }, "Notis Amaran"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.notice), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/confiscated",
- className: "active"
- }, "Sitaan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.inven), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/completed"
- }, "Kompaun Dijelaskan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.comp))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-xl-10 col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card-block"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("form", {
- className: "main cussPayment",
- onSubmit: this.onSubmit
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckKpd,
- defaultChecked: true
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "input-group input-group-sm"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", {
- className: "input-group-prepend"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "input-group-text"
- }, "KPD")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "SCM4744",
- value: this.state.form.kpd,
- onChange: this.onChangeKpd,
- required: this.state.check.kpd
- }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Jenis Kompaun ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("code", null, "*"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
- className: "form-control form-control-sm",
- value: this.state.form.type,
- onChange: this.onChangeType,
- required: true
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Parkir"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Pelbagai")))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckDate,
- defaultChecked: true
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Tarikh"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "date",
- className: " form-control form-control-sm",
- value: this.state.form.start_date,
- onChange: this.onChangeStart,
- required: this.state.check.date
- })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "-")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "date",
- className: "form-control form-control-sm",
- value: this.state.form.end_date,
- onChange: this.onChangeEnd
- }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Seksyen Kesalahan"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-9 .offset-xl-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
- className: "form-control form-control-sm",
- defaultValue: "All",
- onChange: this.onChangeFaulty,
- required: this.state.check.faulty
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- value: "All"
- }, "All"), this.state.list_faulty.map(function (act, i) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("optgroup", {
- label: act.nama,
- key: i
- }, act.faulty.map(function (faulty, j) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- key: j,
- value: faulty._id
- }, "Seksyen ", faulty.sketr);
- }));
- })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "PenguatKuasa"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-6 .offset-xl-6"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
- className: "form-control form-control-sm",
- defaultValue: "All",
- onChange: this.onChangeEnforcer,
- required: this.state.check.enforcer
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- value: "All"
- }, "All"), this.state.list_enforcer.map(function (staff, i) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- key: i,
- value: staff._id
- }, staff.no_badan, ", ", staff.full_name);
- })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckPlateNo,
- defaultChecked: false
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No.Plat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "no plat",
- value: this.state.form.plate_no,
- onChange: this.onChangePlateNo,
- required: this.state.check.platno
- })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckCompanyNo,
- defaultChecked: false
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, " No.Syarikat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "no syarikat",
- value: this.state.form.company_no,
- onChange: this.onChangeCompanyNo,
- required: this.state.check.companyno
- })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckNric,
- defaultChecked: false
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "NRIC")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "nric",
- value: this.state.form.nric,
- onChange: this.onChangeNric,
- required: this.state.check.nric
- }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "form-group"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
- type: "submit",
- id: "tapis",
- className: "btn btn-info btn-sm waves-effect waves-light"
- }, "Carian")))))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card-header"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h5", null, "Senarai Kompaun"), this.state.dataCompound.length > 0 ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ExportCSV__WEBPACK_IMPORTED_MODULE_3__["ExportCSV"], {
- csvData: this.state.dataCompound,
- fileName: "Report_saman_1",
- type: this.state.form.type
- }) : ''), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card-block contact-details"
- }, this.state.loading !== 'null' ? !this.state.loading ? this.state.form.type === 'Parkir' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatableParkir__WEBPACK_IMPORTED_MODULE_4__["default"], {
- data: this.state.dataCompound,
- url: this.state.current_url,
- current_id: this.state.current_id
- }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__["default"], {
- data: this.state.dataCompound,
- url: this.state.current_url,
- current_id: this.state.current_id
- }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "sweet-loading",
- style: {
- 'textAlign': 'center'
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default.a, {
- style: {
- 'border-color': 'red'
- },
- sizeUnit: "px",
- size: 50,
- color: '#123abc',
- loading: this.state.loading
- })) : ''))));
- }
- }]);
-
- return ConfiscatedCompoundDatatable;
- }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
-
-
-
- if (document.getElementById('confiscatedcompound')) {
- var component = document.getElementById('confiscatedcompound');
- var props = Object.assign({}, component.dataset);
- react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(ConfiscatedCompoundDatatable, props), component);
- }
-
- /***/ }),
-
- /***/ "./resources/js/components/compound/NewCompoundDataTable.js":
- /*!******************************************************************!*\
- !*** ./resources/js/components/compound/NewCompoundDataTable.js ***!
- \******************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return NewCompoundDataTable; });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-spinners/ClipLoader */ "./node_modules/react-spinners/ClipLoader.js");
- /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _ExportCSV__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ExportCSV */ "./resources/js/components/ExportCSV.js");
- /* harmony import */ var _DatatableParkir__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../DatatableParkir */ "./resources/js/components/DatatableParkir.js");
- /* harmony import */ var _DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../DatatablePelbagai */ "./resources/js/components/DatatablePelbagai.js");
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
-
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
-
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
-
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
-
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
-
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
-
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
-
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
-
-
-
-
-
-
-
-
- var NewCompoundDataTable =
- /*#__PURE__*/
- function (_Component) {
- _inherits(NewCompoundDataTable, _Component);
-
- function NewCompoundDataTable(props) {
- var _this;
-
- _classCallCheck(this, NewCompoundDataTable);
-
- _this = _possibleConstructorReturn(this, _getPrototypeOf(NewCompoundDataTable).call(this, props));
- _this.state = {
- current_id: _this.props.current_id,
- dataCompound: [],
- loading: 'null',
- current_url: 'null',
- total: {
- baru: _this.props.baru,
- invest: _this.props.invest,
- notice: _this.props.notice,
- inven: _this.props.inven,
- collap: _this.props.collap,
- comp: _this.props.comp
- },
- check: {
- kpd: true,
- date: true,
- faulty: true,
- enforcer: true,
- platno: false,
- companyno: false,
- nric: false
- },
- form: {
- modul: _this.props.modul,
- status: _this.props.status,
- type: 'Parkir',
- kpd: '',
- start_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
- end_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
- faulty: 'All',
- enforcer: 'All',
- plate_no: '',
- company_no: '',
- nric: ''
- },
- list_enforcer: JSON.parse(_this.props.enforcer),
- list_faulty: JSON.parse(_this.props.faulty)
- };
- _this.onCheckKpd = _this.onCheckKpd.bind(_assertThisInitialized(_this));
- _this.onCheckDate = _this.onCheckDate.bind(_assertThisInitialized(_this));
- _this.onCheckPlateNo = _this.onCheckPlateNo.bind(_assertThisInitialized(_this));
- _this.onCheckCompanyNo = _this.onCheckCompanyNo.bind(_assertThisInitialized(_this));
- _this.onCheckNric = _this.onCheckNric.bind(_assertThisInitialized(_this));
- _this.onChangeKpd = _this.onChangeKpd.bind(_assertThisInitialized(_this));
- _this.onChangeType = _this.onChangeType.bind(_assertThisInitialized(_this));
- _this.onChangeStart = _this.onChangeStart.bind(_assertThisInitialized(_this));
- _this.onChangeEnd = _this.onChangeEnd.bind(_assertThisInitialized(_this));
- _this.onChangeFaulty = _this.onChangeFaulty.bind(_assertThisInitialized(_this));
- _this.onChangeEnforcer = _this.onChangeEnforcer.bind(_assertThisInitialized(_this));
- _this.onChangePlateNo = _this.onChangePlateNo.bind(_assertThisInitialized(_this));
- _this.onChangeCompanyNo = _this.onChangeCompanyNo.bind(_assertThisInitialized(_this));
- _this.onChangeNric = _this.onChangeNric.bind(_assertThisInitialized(_this));
- _this.onChangeStatus = _this.onChangeStatus.bind(_assertThisInitialized(_this));
- _this.onSubmit = _this.onSubmit.bind(_assertThisInitialized(_this));
- return _this;
- }
-
- _createClass(NewCompoundDataTable, [{
- key: "onCheckKpd",
- value: function onCheckKpd(e) {
- var _this2 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- kpd: !_this2.state.check.kpd
- })
- };
- });
- }
- }, {
- key: "onCheckDate",
- value: function onCheckDate(e) {
- var _this3 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- date: !_this3.state.check.date
- })
- };
- });
- }
- }, {
- key: "onCheckPlateNo",
- value: function onCheckPlateNo(e) {
- var _this4 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- platno: !_this4.state.check.platno
- })
- };
- });
- }
- }, {
- key: "onCheckCompanyNo",
- value: function onCheckCompanyNo(e) {
- var _this5 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- companyno: !_this5.state.check.companyno
- })
- };
- });
- }
- }, {
- key: "onCheckNric",
- value: function onCheckNric(e) {
- var _this6 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- nric: !_this6.state.check.nric
- })
- };
- });
- }
- }, {
- key: "onChangeKpd",
- value: function onChangeKpd(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- kpd: value
- })
- };
- });
- }
- }, {
- key: "onChangeType",
- value: function onChangeType(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- type: value
- }),
- loading: 'null',
- dataCompound: []
- };
- });
- }
- }, {
- key: "onChangeStart",
- value: function onChangeStart(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- start_date: value
- })
- };
- });
- }
- }, {
- key: "onChangeEnd",
- value: function onChangeEnd(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- end_date: value
- })
- };
- });
- }
- }, {
- key: "onChangeFaulty",
- value: function onChangeFaulty(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- faulty: value
- })
- };
- });
- }
- }, {
- key: "onChangeEnforcer",
- value: function onChangeEnforcer(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- enforcer: value
- })
- };
- });
- }
- }, {
- key: "onChangePlateNo",
- value: function onChangePlateNo(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- plate_no: value
- })
- };
- });
- }
- }, {
- key: "onChangeCompanyNo",
- value: function onChangeCompanyNo(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- company_no: value
- })
- };
- });
- }
- }, {
- key: "onChangeNric",
- value: function onChangeNric(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- nric: value
- })
- };
- });
- }
- }, {
- key: "onChangeStatus",
- value: function onChangeStatus(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- status: value
- })
- };
- });
- }
- }, {
- key: "onSubmit",
- value: function onSubmit(e) {
- var _this7 = this;
-
- e.preventDefault();
- this.setState({
- loading: true
- });
- var formData = {
- type: this.state.form.type,
- enforcer: this.state.form.enforcer,
- faulty: this.state.form.faulty,
- modul: this.state.form.modul,
- status: this.state.form.status
- };
-
- if (this.state.check.date) {
- formData = _objectSpread({}, formData, {
- start_date: this.state.form.start_date,
- end_date: this.state.form.end_date
- });
- } else {
- formData = _objectSpread({}, formData, {
- start_date: '',
- end_date: ''
- });
- }
-
- if (this.state.check.kpd) {
- formData = _objectSpread({}, formData, {
- kpd: this.state.form.kpd
- });
- } else if (this.state.check.platno) {
- formData = _objectSpread({}, formData, {
- plate_no: this.state.form.plate_no
- });
- } else if (this.state.check.companyno) {
- formData = _objectSpread({}, formData, {
- company_no: this.state.form.company_no
- });
- } else if (this.state.check.nric) {
- formData = _objectSpread({}, formData, {
- nric: this.state.form.nric
- });
- }
-
- var queryString = Object.keys(formData).map(function (key) {
- return key + '=' + formData[key];
- }).join('&');
- fetch('/api/list/compound?' + queryString).then(function (response) {
- response.json().then(function (res) {
- _this7.setState({
- dataCompound: res.data,
- loading: false,
- current_url: '/api/list/compound?' + queryString
- });
- });
- });
- }
- }, {
- key: "render",
- value: function render() {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-xl-2 col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "panel panel-default"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "panel-heading"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h4", {
- className: "panel-title"
- }, " Modul Kategori ")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "panel-body"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound",
- className: "active"
- }, "Baru"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-inverse-danger"
- }, this.state.total.baru)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/investigation"
- }, "Pengesahan Kompaun"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.invest)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/notice"
- }, "Notis Amaran"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.notice), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/confiscated"
- }, "Sitaan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.inven), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/completed"
- }, "Kompaun Dijelaskan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.comp))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-xl-10 col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card-block"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("form", {
- className: "main cussPayment",
- onSubmit: this.onSubmit
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckKpd,
- defaultChecked: true
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "input-group input-group-sm"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", {
- className: "input-group-prepend"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "input-group-text"
- }, "KPD")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "SCM4744",
- value: this.state.form.kpd,
- onChange: this.onChangeKpd,
- required: this.state.check.kpd
- }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Jenis Kompaun ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("code", null, "*"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
- className: "form-control form-control-sm",
- value: this.state.form.type,
- onChange: this.onChangeType,
- required: true
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Parkir"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Pelbagai")))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckDate,
- defaultChecked: true
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Tarikh"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "date",
- className: " form-control form-control-sm",
- value: this.state.form.start_date,
- onChange: this.onChangeStart,
- required: this.state.check.date
- })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "-")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "date",
- className: "form-control form-control-sm",
- value: this.state.form.end_date,
- onChange: this.onChangeEnd
- }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Seksyen Kesalahan"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-9 .offset-xl-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
- className: "form-control form-control-sm",
- defaultValue: "All",
- onChange: this.onChangeFaulty,
- required: this.state.check.faulty
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- value: "All"
- }, "All"), this.state.list_faulty.map(function (act, i) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("optgroup", {
- label: act.nama,
- key: i
- }, act.faulty.map(function (faulty, j) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- key: j,
- value: faulty._id
- }, "Seksyen ", faulty.sketr);
- }));
- })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "PenguatKuasa"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-6 .offset-xl-6"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
- className: "form-control form-control-sm",
- defaultValue: "All",
- onChange: this.onChangeEnforcer,
- required: this.state.check.enforcer
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- value: "All"
- }, "All"), this.state.list_enforcer.map(function (staff, i) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- key: i,
- value: staff._id
- }, staff.no_badan, ", ", staff.full_name);
- })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckPlateNo,
- defaultChecked: false
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No.Plat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "no plat",
- value: this.state.form.plate_no,
- onChange: this.onChangePlateNo,
- required: this.state.check.platno
- })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckCompanyNo,
- defaultChecked: false
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, " No.Syarikat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "no syarikat",
- value: this.state.form.company_no,
- onChange: this.onChangeCompanyNo,
- required: this.state.check.companyno
- })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckNric,
- defaultChecked: false
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "NRIC")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "nric",
- value: this.state.form.nric,
- onChange: this.onChangeNric,
- required: this.state.check.nric
- }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Status"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3 .offset-xl-9"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
- className: "form-control form-control-sm",
- defaultValue: "All",
- onChange: this.onChangeStatus,
- required: true
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- value: "All"
- }, "All"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- value: "Belum Bayar"
- }, "Belum Bayar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- value: "Batal"
- }, "Batal")))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "form-group"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
- type: "submit",
- id: "tapis",
- className: "btn btn-info btn-sm waves-effect waves-light"
- }, "Carian")))))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card-header"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h5", null, "Senarai Kompaun"), this.state.dataCompound.length > 0 ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ExportCSV__WEBPACK_IMPORTED_MODULE_3__["ExportCSV"], {
- csvData: this.state.dataCompound,
- fileName: "Report_saman_1",
- type: this.state.form.type
- }) : ''), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card-block contact-details"
- }, this.state.loading !== 'null' ? !this.state.loading ? this.state.form.type === 'Parkir' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatableParkir__WEBPACK_IMPORTED_MODULE_4__["default"], {
- data: this.state.dataCompound,
- url: this.state.current_url,
- current_id: this.state.current_id
- }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__["default"], {
- data: this.state.dataCompound,
- url: this.state.current_url,
- current_id: this.state.current_id
- }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "sweet-loading",
- style: {
- 'textAlign': 'center'
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default.a, {
- style: {
- 'border-color': 'red'
- },
- sizeUnit: "px",
- size: 50,
- color: '#123abc',
- loading: this.state.loading
- })) : ''))));
- }
- }]);
-
- return NewCompoundDataTable;
- }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
-
-
-
- if (document.getElementById('newcompound')) {
- var component = document.getElementById('newcompound');
- var props = Object.assign({}, component.dataset);
- react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(NewCompoundDataTable, props), component);
- }
-
- /***/ }),
-
- /***/ "./resources/js/components/compound/NoticeCompoundDatatable.js":
- /*!*********************************************************************!*\
- !*** ./resources/js/components/compound/NoticeCompoundDatatable.js ***!
- \*********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return NoticeCompoundDatatable; });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-spinners/ClipLoader */ "./node_modules/react-spinners/ClipLoader.js");
- /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _ExportCSV__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ExportCSV */ "./resources/js/components/ExportCSV.js");
- /* harmony import */ var _DatatableParkir__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../DatatableParkir */ "./resources/js/components/DatatableParkir.js");
- /* harmony import */ var _DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../DatatablePelbagai */ "./resources/js/components/DatatablePelbagai.js");
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
-
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
-
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
-
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
-
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
-
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
-
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
-
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
-
-
-
-
-
-
-
-
- var NoticeCompoundDatatable =
- /*#__PURE__*/
- function (_Component) {
- _inherits(NoticeCompoundDatatable, _Component);
-
- function NoticeCompoundDatatable(props) {
- var _this;
-
- _classCallCheck(this, NoticeCompoundDatatable);
-
- _this = _possibleConstructorReturn(this, _getPrototypeOf(NoticeCompoundDatatable).call(this, props));
- _this.state = {
- current_id: _this.props.current_id,
- dataCompound: [],
- loading: 'null',
- current_url: 'null',
- total: {
- baru: _this.props.baru,
- invest: _this.props.invest,
- notice: _this.props.notice,
- inven: _this.props.inven,
- collap: _this.props.collap,
- comp: _this.props.comp
- },
- check: {
- kpd: true,
- date: true,
- faulty: true,
- enforcer: true,
- platno: false,
- companyno: false,
- nric: false
- },
- form: {
- modul: _this.props.modul,
- status: _this.props.status,
- type: 'Parkir',
- kpd: '',
- start_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
- end_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
- faulty: 'All',
- enforcer: 'All',
- plate_no: '',
- company_no: '',
- nric: ''
- },
- list_enforcer: JSON.parse(_this.props.enforcer),
- list_faulty: JSON.parse(_this.props.faulty)
- };
- _this.onCheckKpd = _this.onCheckKpd.bind(_assertThisInitialized(_this));
- _this.onCheckDate = _this.onCheckDate.bind(_assertThisInitialized(_this));
- _this.onCheckPlateNo = _this.onCheckPlateNo.bind(_assertThisInitialized(_this));
- _this.onCheckCompanyNo = _this.onCheckCompanyNo.bind(_assertThisInitialized(_this));
- _this.onCheckNric = _this.onCheckNric.bind(_assertThisInitialized(_this));
- _this.onChangeKpd = _this.onChangeKpd.bind(_assertThisInitialized(_this));
- _this.onChangeType = _this.onChangeType.bind(_assertThisInitialized(_this));
- _this.onChangeStart = _this.onChangeStart.bind(_assertThisInitialized(_this));
- _this.onChangeEnd = _this.onChangeEnd.bind(_assertThisInitialized(_this));
- _this.onChangeFaulty = _this.onChangeFaulty.bind(_assertThisInitialized(_this));
- _this.onChangeEnforcer = _this.onChangeEnforcer.bind(_assertThisInitialized(_this));
- _this.onChangePlateNo = _this.onChangePlateNo.bind(_assertThisInitialized(_this));
- _this.onChangeCompanyNo = _this.onChangeCompanyNo.bind(_assertThisInitialized(_this));
- _this.onChangeNric = _this.onChangeNric.bind(_assertThisInitialized(_this));
- _this.onSubmit = _this.onSubmit.bind(_assertThisInitialized(_this));
- return _this;
- }
-
- _createClass(NoticeCompoundDatatable, [{
- key: "onCheckKpd",
- value: function onCheckKpd(e) {
- var _this2 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- kpd: !_this2.state.check.kpd
- })
- };
- });
- }
- }, {
- key: "onCheckDate",
- value: function onCheckDate(e) {
- var _this3 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- date: !_this3.state.check.date
- })
- };
- });
- }
- }, {
- key: "onCheckPlateNo",
- value: function onCheckPlateNo(e) {
- var _this4 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- platno: !_this4.state.check.platno
- })
- };
- });
- }
- }, {
- key: "onCheckCompanyNo",
- value: function onCheckCompanyNo(e) {
- var _this5 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- companyno: !_this5.state.check.companyno
- })
- };
- });
- }
- }, {
- key: "onCheckNric",
- value: function onCheckNric(e) {
- var _this6 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- nric: !_this6.state.check.nric
- })
- };
- });
- }
- }, {
- key: "onChangeKpd",
- value: function onChangeKpd(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- kpd: value
- })
- };
- });
- }
- }, {
- key: "onChangeType",
- value: function onChangeType(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- type: value
- }),
- loading: 'null',
- dataCompound: []
- };
- });
- }
- }, {
- key: "onChangeStart",
- value: function onChangeStart(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- start_date: value
- })
- };
- });
- }
- }, {
- key: "onChangeEnd",
- value: function onChangeEnd(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- end_date: value
- })
- };
- });
- }
- }, {
- key: "onChangeFaulty",
- value: function onChangeFaulty(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- faulty: value
- })
- };
- });
- }
- }, {
- key: "onChangeEnforcer",
- value: function onChangeEnforcer(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- enforcer: value
- })
- };
- });
- }
- }, {
- key: "onChangePlateNo",
- value: function onChangePlateNo(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- plate_no: value
- })
- };
- });
- }
- }, {
- key: "onChangeCompanyNo",
- value: function onChangeCompanyNo(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- company_no: value
- })
- };
- });
- }
- }, {
- key: "onChangeNric",
- value: function onChangeNric(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- nric: value
- })
- };
- });
- }
- }, {
- key: "onSubmit",
- value: function onSubmit(e) {
- var _this7 = this;
-
- e.preventDefault();
- this.setState({
- loading: true
- });
- var formData = {
- type: this.state.form.type,
- enforcer: this.state.form.enforcer,
- faulty: this.state.form.faulty,
- modul: this.state.form.modul,
- status: this.state.form.status
- };
-
- if (this.state.check.date) {
- formData = _objectSpread({}, formData, {
- start_date: this.state.form.start_date,
- end_date: this.state.form.end_date
- });
- } else {
- formData = _objectSpread({}, formData, {
- start_date: '',
- end_date: ''
- });
- }
-
- if (this.state.check.kpd) {
- formData = _objectSpread({}, formData, {
- kpd: this.state.form.kpd
- });
- } else if (this.state.check.platno) {
- formData = _objectSpread({}, formData, {
- plate_no: this.state.form.plate_no
- });
- } else if (this.state.check.companyno) {
- formData = _objectSpread({}, formData, {
- company_no: this.state.form.company_no
- });
- } else if (this.state.check.nric) {
- formData = _objectSpread({}, formData, {
- nric: this.state.form.nric
- });
- }
-
- var queryString = Object.keys(formData).map(function (key) {
- return key + '=' + formData[key];
- }).join('&');
- fetch('/api/list/compound?' + queryString).then(function (response) {
- response.json().then(function (res) {
- _this7.setState({
- dataCompound: res.data,
- loading: false,
- current_url: '/api/list/compound?' + queryString
- });
- });
- });
- }
- }, {
- key: "render",
- value: function render() {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-xl-2 col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "panel panel-default"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "panel-heading"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h4", {
- className: "panel-title"
- }, " Modul Kategori ")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "panel-body"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound"
- }, "Baru"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-inverse-danger"
- }, this.state.total.baru)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/investigation"
- }, "Pengesahan Kompaun"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.invest)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/notice",
- className: "active"
- }, "Notis Amaran"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.notice), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/confiscated"
- }, "Sitaan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.inven), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/completed"
- }, "Kompaun Dijelaskan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.comp))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-xl-10 col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card-block"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("form", {
- className: "main cussPayment",
- onSubmit: this.onSubmit
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckKpd,
- defaultChecked: true
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "input-group input-group-sm"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", {
- className: "input-group-prepend"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "input-group-text"
- }, "KPD")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "SCM4744",
- value: this.state.form.kpd,
- onChange: this.onChangeKpd,
- required: this.state.check.kpd
- }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Jenis Kompaun ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("code", null, "*"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
- className: "form-control form-control-sm",
- value: this.state.form.type,
- onChange: this.onChangeType,
- required: true
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Parkir"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Pelbagai")))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckDate,
- defaultChecked: true
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Tarikh"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "date",
- className: " form-control form-control-sm",
- value: this.state.form.start_date,
- onChange: this.onChangeStart,
- required: this.state.check.date
- })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "-")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "date",
- className: "form-control form-control-sm",
- value: this.state.form.end_date,
- onChange: this.onChangeEnd
- }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Seksyen Kesalahan"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-9 .offset-xl-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
- className: "form-control form-control-sm",
- defaultValue: "All",
- onChange: this.onChangeFaulty,
- required: this.state.check.faulty
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- value: "All"
- }, "All"), this.state.list_faulty.map(function (act, i) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("optgroup", {
- label: act.nama,
- key: i
- }, act.faulty.map(function (faulty, j) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- key: j,
- value: faulty._id
- }, "Seksyen ", faulty.sketr);
- }));
- })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "PenguatKuasa"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-6 .offset-xl-6"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
- className: "form-control form-control-sm",
- defaultValue: "All",
- onChange: this.onChangeEnforcer,
- required: this.state.check.enforcer
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- value: "All"
- }, "All"), this.state.list_enforcer.map(function (staff, i) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- key: i,
- value: staff._id
- }, staff.no_badan, ", ", staff.full_name);
- })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckPlateNo,
- defaultChecked: false
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No.Plat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "no plat",
- value: this.state.form.plate_no,
- onChange: this.onChangePlateNo,
- required: this.state.check.platno
- })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckCompanyNo,
- defaultChecked: false
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, " No.Syarikat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "no syarikat",
- value: this.state.form.company_no,
- onChange: this.onChangeCompanyNo,
- required: this.state.check.companyno
- })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckNric,
- defaultChecked: false
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "NRIC")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "nric",
- value: this.state.form.nric,
- onChange: this.onChangeNric,
- required: this.state.check.nric
- }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "form-group"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
- type: "submit",
- id: "tapis",
- className: "btn btn-info btn-sm waves-effect waves-light"
- }, "Carian")))))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card-header"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h5", null, "Senarai Kompaun"), this.state.dataCompound.length > 0 ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ExportCSV__WEBPACK_IMPORTED_MODULE_3__["ExportCSV"], {
- csvData: this.state.dataCompound,
- fileName: "Report_saman_1",
- type: this.state.form.type
- }) : ''), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card-block contact-details"
- }, this.state.loading !== 'null' ? !this.state.loading ? this.state.form.type === 'Parkir' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatableParkir__WEBPACK_IMPORTED_MODULE_4__["default"], {
- data: this.state.dataCompound,
- url: this.state.current_url,
- current_id: this.state.current_id
- }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__["default"], {
- data: this.state.dataCompound,
- url: this.state.current_url,
- current_id: this.state.current_id
- }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "sweet-loading",
- style: {
- 'textAlign': 'center'
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default.a, {
- style: {
- 'border-color': 'red'
- },
- sizeUnit: "px",
- size: 50,
- color: '#123abc',
- loading: this.state.loading
- })) : ''))));
- }
- }]);
-
- return NoticeCompoundDatatable;
- }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
-
-
-
- if (document.getElementById('noticecompound')) {
- var component = document.getElementById('noticecompound');
- var props = Object.assign({}, component.dataset);
- react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(NoticeCompoundDatatable, props), component);
- }
-
- /***/ }),
-
- /***/ "./resources/js/components/compound/ReportCompound.js":
- /*!************************************************************!*\
- !*** ./resources/js/components/compound/ReportCompound.js ***!
- \************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return ReportCompound; });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-spinners/ClipLoader */ "./node_modules/react-spinners/ClipLoader.js");
- /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _ExportCSV__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ExportCSV */ "./resources/js/components/ExportCSV.js");
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
-
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
-
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
-
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
-
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
-
-
-
-
-
-
- var ReportCompound =
- /*#__PURE__*/
- function (_Component) {
- _inherits(ReportCompound, _Component);
-
- function ReportCompound(props) {
- var _this;
-
- _classCallCheck(this, ReportCompound);
-
- _this = _possibleConstructorReturn(this, _getPrototypeOf(ReportCompound).call(this, props));
- _this.state = {
- current_id: _this.props.current_id,
- dataReport: [],
- loading: true
- };
- return _this;
- }
-
- _createClass(ReportCompound, [{
- key: "componentDidMount",
- value: function componentDidMount() {
- var _this2 = this;
-
- fetch('/api/report/compound/list/null/null').then(function (response) {
- response.json().then(function (res) {
- _this2.setState({
- dataReport: res.data,
- loading: false
- });
-
- var script = document.createElement("script");
- script.src = "/js/dashboard/datatable.js";
- script.async = true;
- document.body.appendChild(script);
- });
- });
- }
- }, {
- key: "render",
- value: function render() {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-xl-12 col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card-header"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h5", null, "Laporan Pengeluaran Kompaun Mengikut Kesalahan")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card-block"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "data_table_main dt-responsive table-responsive"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("table", {
- id: "report",
- className: "table table-sm table-striped table-bordered nowrap datatable",
- style: {
- "width": "100%"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("thead", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "20"
- }, "#"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kesalahan"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Jumlah Kompaun Keluar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Amaun Kompaun (Rm)"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Jumlah Bayar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Amaun Bayar (RM)"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Jumlah Kompaun Belum Bayar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Amount Tungakkan (RM)"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Kompaun Batal"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Amaun Batal (RM)"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Kompaun Kurang"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Amaun Kurang (RM)"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tbody", null, !this.state.loading ? this.state.dataReport.map(function (item, i) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", {
- key: i
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.index), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.kesalahan), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.jumlahK), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.amaunK), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.jumlahB), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.amaunB), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.belumB), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.amaunT), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.kBatal), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.amaunBatal), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.kompaunKurang), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", null, item.amaunKurang));
- }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("td", {
- colSpan: "12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "sweet-loading",
- style: {
- 'textAlign': 'center'
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default.a, {
- style: {
- 'border-color': 'red'
- },
- sizeUnit: "px",
- size: 50,
- color: '#123abc',
- loading: this.state.loading
- }))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tfoot", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "20"
- }, "#"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", null, "Kesalahan"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Jumlah Kompaun Keluar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Amaun Kompaun (Rm)"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Jumlah Bayar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Amaun Bayar (RM)"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Jumlah Kompaun Belum Bayar"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Amount Tungakkan (RM)"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Kompaun Batal"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Amaun Batal (RM)"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Kompaun Kurang"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("th", {
- width: "80"
- }, "Amaun Kurang (RM)")))))))));
- }
- }]);
-
- return ReportCompound;
- }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
-
-
-
- if (document.getElementById('reportcompound')) {
- var component = document.getElementById('reportcompound');
- var props = Object.assign({}, component.dataset);
- react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(ReportCompound, props), component);
- }
-
- /***/ }),
-
- /***/ "./resources/js/components/compound/VerifiedCompoundDatatable.js":
- /*!***********************************************************************!*\
- !*** ./resources/js/components/compound/VerifiedCompoundDatatable.js ***!
- \***********************************************************************/
- /*! exports provided: default */
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
-
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return VerifiedCompoundDatatable; });
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
- /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
- /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-spinners/ClipLoader */ "./node_modules/react-spinners/ClipLoader.js");
- /* harmony import */ var react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _ExportCSV__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ExportCSV */ "./resources/js/components/ExportCSV.js");
- /* harmony import */ var _DatatableParkir__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../DatatableParkir */ "./resources/js/components/DatatableParkir.js");
- /* harmony import */ var _DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../DatatablePelbagai */ "./resources/js/components/DatatablePelbagai.js");
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
-
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
-
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
-
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } }
-
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
-
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
-
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
-
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
-
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
-
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
-
-
-
-
-
-
-
-
- var VerifiedCompoundDatatable =
- /*#__PURE__*/
- function (_Component) {
- _inherits(VerifiedCompoundDatatable, _Component);
-
- function VerifiedCompoundDatatable(props) {
- var _this;
-
- _classCallCheck(this, VerifiedCompoundDatatable);
-
- _this = _possibleConstructorReturn(this, _getPrototypeOf(VerifiedCompoundDatatable).call(this, props));
- _this.state = {
- current_id: _this.props.current_id,
- dataCompound: [],
- loading: 'null',
- current_url: 'null',
- total: {
- baru: _this.props.baru,
- invest: _this.props.invest,
- notice: _this.props.notice,
- inven: _this.props.inven,
- collap: _this.props.collap,
- comp: _this.props.comp
- },
- check: {
- kpd: true,
- date: true,
- faulty: true,
- enforcer: true,
- platno: false,
- companyno: false,
- nric: false
- },
- form: {
- modul: _this.props.modul,
- status: _this.props.status,
- type: 'Parkir',
- kpd: '',
- start_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
- end_date: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + new Date().getDate(),
- faulty: 'All',
- enforcer: 'All',
- plate_no: '',
- company_no: '',
- nric: ''
- },
- list_enforcer: JSON.parse(_this.props.enforcer),
- list_faulty: JSON.parse(_this.props.faulty)
- };
- _this.onCheckKpd = _this.onCheckKpd.bind(_assertThisInitialized(_this));
- _this.onCheckDate = _this.onCheckDate.bind(_assertThisInitialized(_this));
- _this.onCheckPlateNo = _this.onCheckPlateNo.bind(_assertThisInitialized(_this));
- _this.onCheckCompanyNo = _this.onCheckCompanyNo.bind(_assertThisInitialized(_this));
- _this.onCheckNric = _this.onCheckNric.bind(_assertThisInitialized(_this));
- _this.onChangeKpd = _this.onChangeKpd.bind(_assertThisInitialized(_this));
- _this.onChangeType = _this.onChangeType.bind(_assertThisInitialized(_this));
- _this.onChangeStart = _this.onChangeStart.bind(_assertThisInitialized(_this));
- _this.onChangeEnd = _this.onChangeEnd.bind(_assertThisInitialized(_this));
- _this.onChangeFaulty = _this.onChangeFaulty.bind(_assertThisInitialized(_this));
- _this.onChangeEnforcer = _this.onChangeEnforcer.bind(_assertThisInitialized(_this));
- _this.onChangePlateNo = _this.onChangePlateNo.bind(_assertThisInitialized(_this));
- _this.onChangeCompanyNo = _this.onChangeCompanyNo.bind(_assertThisInitialized(_this));
- _this.onChangeNric = _this.onChangeNric.bind(_assertThisInitialized(_this));
- _this.onSubmit = _this.onSubmit.bind(_assertThisInitialized(_this));
- return _this;
- }
-
- _createClass(VerifiedCompoundDatatable, [{
- key: "onCheckKpd",
- value: function onCheckKpd(e) {
- var _this2 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- kpd: !_this2.state.check.kpd
- })
- };
- });
- }
- }, {
- key: "onCheckDate",
- value: function onCheckDate(e) {
- var _this3 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- date: !_this3.state.check.date
- })
- };
- });
- }
- }, {
- key: "onCheckPlateNo",
- value: function onCheckPlateNo(e) {
- var _this4 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- platno: !_this4.state.check.platno
- })
- };
- });
- }
- }, {
- key: "onCheckCompanyNo",
- value: function onCheckCompanyNo(e) {
- var _this5 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- companyno: !_this5.state.check.companyno
- })
- };
- });
- }
- }, {
- key: "onCheckNric",
- value: function onCheckNric(e) {
- var _this6 = this;
-
- this.setState(function (prevState) {
- return {
- check: _objectSpread({}, prevState.check, {
- nric: !_this6.state.check.nric
- })
- };
- });
- }
- }, {
- key: "onChangeKpd",
- value: function onChangeKpd(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- kpd: value
- })
- };
- });
- }
- }, {
- key: "onChangeType",
- value: function onChangeType(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- type: value
- }),
- loading: 'null',
- dataCompound: []
- };
- });
- }
- }, {
- key: "onChangeStart",
- value: function onChangeStart(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- start_date: value
- })
- };
- });
- }
- }, {
- key: "onChangeEnd",
- value: function onChangeEnd(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- end_date: value
- })
- };
- });
- }
- }, {
- key: "onChangeFaulty",
- value: function onChangeFaulty(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- faulty: value
- })
- };
- });
- }
- }, {
- key: "onChangeEnforcer",
- value: function onChangeEnforcer(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- enforcer: value
- })
- };
- });
- }
- }, {
- key: "onChangePlateNo",
- value: function onChangePlateNo(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- plate_no: value
- })
- };
- });
- }
- }, {
- key: "onChangeCompanyNo",
- value: function onChangeCompanyNo(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- company_no: value
- })
- };
- });
- }
- }, {
- key: "onChangeNric",
- value: function onChangeNric(e) {
- var value = e.target.value;
- this.setState(function (prevState) {
- return {
- form: _objectSpread({}, prevState.form, {
- nric: value
- })
- };
- });
- }
- }, {
- key: "onSubmit",
- value: function onSubmit(e) {
- var _this7 = this;
-
- e.preventDefault();
- this.setState({
- loading: true
- });
- var formData = {
- type: this.state.form.type,
- enforcer: this.state.form.enforcer,
- faulty: this.state.form.faulty,
- modul: this.state.form.modul,
- status: this.state.form.status
- };
-
- if (this.state.check.date) {
- formData = _objectSpread({}, formData, {
- start_date: this.state.form.start_date,
- end_date: this.state.form.end_date
- });
- } else {
- formData = _objectSpread({}, formData, {
- start_date: '',
- end_date: ''
- });
- }
-
- if (this.state.check.kpd) {
- formData = _objectSpread({}, formData, {
- kpd: this.state.form.kpd
- });
- } else if (this.state.check.platno) {
- formData = _objectSpread({}, formData, {
- plate_no: this.state.form.plate_no
- });
- } else if (this.state.check.companyno) {
- formData = _objectSpread({}, formData, {
- company_no: this.state.form.company_no
- });
- } else if (this.state.check.nric) {
- formData = _objectSpread({}, formData, {
- nric: this.state.form.nric
- });
- }
-
- var queryString = Object.keys(formData).map(function (key) {
- return key + '=' + formData[key];
- }).join('&');
- fetch('/api/list/compound?' + queryString).then(function (response) {
- response.json().then(function (res) {
- _this7.setState({
- dataCompound: res.data,
- loading: false,
- current_url: '/api/list/compound?' + queryString
- });
- });
- });
- }
- }, {
- key: "render",
- value: function render() {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-xl-2 col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "panel panel-default"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "panel-heading"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h4", {
- className: "panel-title"
- }, " Modul Kategori ")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "panel-body"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound"
- }, "Baru"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-inverse-danger"
- }, this.state.total.baru)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/investigation",
- className: "active"
- }, "Pengesahan Kompaun"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.invest)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/notice"
- }, "Notis Amaran"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.notice), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/confiscated"
- }, "Sitaan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.inven), " "), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("a", {
- href: "/main/compound/completed"
- }, "Kompaun Dijelaskan"), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "badge badge-success"
- }, this.state.total.comp))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-xl-10 col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card-block"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("form", {
- className: "main cussPayment",
- onSubmit: this.onSubmit
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckKpd,
- defaultChecked: true
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "input-group input-group-sm"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", {
- className: "input-group-prepend"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", {
- className: "input-group-text"
- }, "KPD")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "SCM4744",
- value: this.state.form.kpd,
- onChange: this.onChangeKpd,
- required: this.state.check.kpd
- }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Jenis Kompaun ", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("code", null, "*"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
- className: "form-control form-control-sm",
- value: this.state.form.type,
- onChange: this.onChangeType,
- required: true
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Parkir"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", null, "Pelbagai")))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckDate,
- defaultChecked: true
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Tarikh"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "date",
- className: " form-control form-control-sm",
- value: this.state.form.start_date,
- onChange: this.onChangeStart,
- required: this.state.check.date
- })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "-")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "date",
- className: "form-control form-control-sm",
- value: this.state.form.end_date,
- onChange: this.onChangeEnd
- }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "Seksyen Kesalahan"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-9 .offset-xl-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
- className: "form-control form-control-sm",
- defaultValue: "All",
- onChange: this.onChangeFaulty,
- required: this.state.check.faulty
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- value: "All"
- }, "All"), this.state.list_faulty.map(function (act, i) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("optgroup", {
- label: act.nama,
- key: i
- }, act.faulty.map(function (faulty, j) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- key: j,
- value: faulty._id
- }, "Seksyen ", faulty.sketr);
- }));
- })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-12 col-md-12 col-sm-12 col-xs-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "PenguatKuasa"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-6 .offset-xl-6"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("select", {
- className: "form-control form-control-sm",
- defaultValue: "All",
- onChange: this.onChangeEnforcer,
- required: this.state.check.enforcer
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- value: "All"
- }, "All"), this.state.list_enforcer.map(function (staff, i) {
- return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("option", {
- key: i,
- value: staff._id
- }, staff.no_badan, ", ", staff.full_name);
- })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "row clearfix",
- style: {
- marginBottom: "1.25em"
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckPlateNo,
- defaultChecked: false
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "No.Plat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "no plat",
- value: this.state.form.plate_no,
- onChange: this.onChangePlateNo,
- required: this.state.check.platno
- })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckCompanyNo,
- defaultChecked: false
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, " No.Syarikat")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "no syarikat",
- value: this.state.form.company_no,
- onChange: this.onChangeCompanyNo,
- required: this.state.check.companyno
- })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-lg-3"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "checkbox",
- onClick: this.onCheckNric,
- defaultChecked: false
- }), "\xA0", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("b", null, "NRIC")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", {
- type: "text",
- className: "form-control form-control-sm",
- placeholder: "nric",
- value: this.state.form.nric,
- onChange: this.onChangeNric,
- required: this.state.check.nric
- }))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "form-group"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", {
- type: "submit",
- id: "tapis",
- className: "btn btn-info btn-sm waves-effect waves-light"
- }, "Carian")))))))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "col-md-12"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card-header"
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h5", null, "Senarai Kompaun"), this.state.dataCompound.length > 0 ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_ExportCSV__WEBPACK_IMPORTED_MODULE_3__["ExportCSV"], {
- csvData: this.state.dataCompound,
- fileName: "Report_saman_1",
- type: this.state.form.type
- }) : ''), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "card-block contact-details"
- }, this.state.loading !== 'null' ? !this.state.loading ? this.state.form.type === 'Parkir' ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatableParkir__WEBPACK_IMPORTED_MODULE_4__["default"], {
- data: this.state.dataCompound,
- url: this.state.current_url,
- current_id: this.state.current_id
- }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_DatatablePelbagai__WEBPACK_IMPORTED_MODULE_5__["default"], {
- data: this.state.dataCompound,
- url: this.state.current_url,
- current_id: this.state.current_id
- }) : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
- className: "sweet-loading",
- style: {
- 'textAlign': 'center'
- }
- }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_spinners_ClipLoader__WEBPACK_IMPORTED_MODULE_2___default.a, {
- style: {
- 'border-color': 'red'
- },
- sizeUnit: "px",
- size: 50,
- color: '#123abc',
- loading: this.state.loading
- })) : ''))));
- }
- }]);
-
- return VerifiedCompoundDatatable;
- }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]);
-
-
-
- if (document.getElementById('verifiedcompound')) {
- var component = document.getElementById('verifiedcompound');
- var props = Object.assign({}, component.dataset);
- react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(VerifiedCompoundDatatable, props), component);
- }
-
- /***/ }),
-
- /***/ "./resources/sass/app.scss":
- /*!*********************************!*\
- !*** ./resources/sass/app.scss ***!
- \*********************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- // removed by extract-text-webpack-plugin
-
- /***/ }),
-
- /***/ 0:
- /*!*************************************************************!*\
- !*** multi ./resources/js/app.js ./resources/sass/app.scss ***!
- \*************************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- __webpack_require__(/*! /var/www/html/mdch.sipadu/resources/js/app.js */"./resources/js/app.js");
- module.exports = __webpack_require__(/*! /var/www/html/mdch.sipadu/resources/sass/app.scss */"./resources/sass/app.scss");
-
-
- /***/ }),
-
- /***/ 1:
- /*!********************!*\
- !*** fs (ignored) ***!
- \********************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- /* (ignored) */
-
- /***/ }),
-
- /***/ 2:
- /*!************************!*\
- !*** crypto (ignored) ***!
- \************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- /* (ignored) */
-
- /***/ }),
-
- /***/ 3:
- /*!************************!*\
- !*** stream (ignored) ***!
- \************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- /* (ignored) */
-
- /***/ })
-
- /******/ });
|